Commit f61d456b authored by Cai Wei's avatar Cai Wei

fix(*): 合并代码

parents 99a4806d 09009d68
...@@ -8,6 +8,5 @@ VITE_ENV = production ...@@ -8,6 +8,5 @@ VITE_ENV = production
# 开发环境下,后端接口的基础URL # 开发环境下,后端接口的基础URL
# base api # base api
VITE_APP_BASE_API5 = '/vispc' VITE_APP_BASE_API5 = '/pc'
VITE_APP_BASE_MONITOR = '/monitor' VITE_APP_BASE_MONITOR = '/monitor'
VITE_APP_BASE_API5_PRI = https://vis.bmetech.com
\ No newline at end of file
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> <link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script src="https://cdn.tailwindcss.com"></script> <script src="/tailwindcss/index.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css" rel="stylesheet"> <link rel="stylesheet" href="/tailwindcss/index.css">
<title>DCTOM</title> <title>DCTOM</title>
<style type="text/tailwindcss"> <style type="text/tailwindcss">
@layer utilities { @layer utilities {
......
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -93,7 +93,7 @@ const props = defineProps({ ...@@ -93,7 +93,7 @@ const props = defineProps({
align: { align: {
type: String, type: String,
default: "left", default: "left",
} },
}); });
const emit = defineEmits([ const emit = defineEmits([
...@@ -148,7 +148,7 @@ const total = computed(() => props.total); ...@@ -148,7 +148,7 @@ const total = computed(() => props.total);
// 当前页数据 // 当前页数据
const currentPageData = computed(() => { const currentPageData = computed(() => {
if (!props.showPagination) return props.data; if (props.showPagination) return props.data;
const start = (currentPage.value - 1) * pageSize.value; const start = (currentPage.value - 1) * pageSize.value;
const end = start + pageSize.value; const end = start + pageSize.value;
return props.data.slice(start, end); return props.data.slice(start, end);
...@@ -178,11 +178,17 @@ const emitPaginationChange = () => { ...@@ -178,11 +178,17 @@ const emitPaginationChange = () => {
emit("update:page-size", pageSize.value); emit("update:page-size", pageSize.value);
}; };
const setCurrentPage = () => {
currentPage.value = 1;
};
defineExpose({ setCurrentPage })
// 监听数据变化,重置分页 // 监听数据变化,重置分页
watch( watch(
() => props.data, () => props.data,
() => { () => {
currentPage.value = 1; // currentPage.value = 1;
}, },
{ deep: true } { deep: true }
); );
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
> >
<template #title> <template #title>
<!-- <el-icon><location /></el-icon> --> <!-- <el-icon><location /></el-icon> -->
<img class="menu-icon" :src="`/src/assets/menu/${item.meta.icon}.png`" alt=""> <img class="menu-icon" :src="getIcon(item.meta.icon)" alt="">
<span>{{getMenuTitle(item)}}</span> <span>{{getMenuTitle(item)}}</span>
</template> </template>
<el-menu-item <el-menu-item
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
class="submenu-box" class="submenu-box"
> >
<!-- <el-icon><setting /></el-icon> --> <!-- <el-icon><setting /></el-icon> -->
<img class="menu-icon" :src="`/src/assets/menu/${item.meta.icon}.png`" alt=""> <img class="menu-icon" :src="getIcon(item.meta.icon)" alt="">
<span>{{getMenuTitle(item)}}</span> <span>{{getMenuTitle(item)}}</span>
</el-menu-item> </el-menu-item>
</template> </template>
...@@ -48,16 +48,18 @@ ...@@ -48,16 +48,18 @@
<script setup> <script setup>
import { computed, ref, onMounted } from 'vue'; import { computed, ref, onMounted } from 'vue';
import {
Document,
Menu as IconMenu,
Location,
Setting,
} from "@element-plus/icons-vue";
import {routes} from "../router/index.js"; import {routes} from "../router/index.js";
import { useRoute, useRouter } from 'vue-router'; import { useRoute, useRouter } from 'vue-router';
import { menuStore } from '@/pinia/menu.js'; import { menuStore } from '@/pinia/menu.js';
import { storeToRefs } from 'pinia'; import { storeToRefs } from 'pinia';
import closeIcon from '@/assets/menu/closeIcon.png';
import collectorList from '@/assets/menu/collectorList.png';
import dashboard from '@/assets/menu/dashboard.png';
import deviceManage from '@/assets/menu/deviceManage.png';
import dustOverview from '@/assets/menu/dustOverview.png';
import monitor from '@/assets/menu/monitor.png';
import warnning from '@/assets/menu/warnning.png';
const route = useRoute(); const route = useRoute();
const router = useRouter(); const router = useRouter();
...@@ -66,6 +68,24 @@ const { sidebar } = storeToRefs(menuStore()); ...@@ -66,6 +68,24 @@ const { sidebar } = storeToRefs(menuStore());
const routerList = routes[0].children; const routerList = routes[0].children;
const menuListData = ref(JSON.parse(sessionStorage.getItem("menuList")) || []); const menuListData = ref(JSON.parse(sessionStorage.getItem("menuList")) || []);
const getIcon = (iconName) => {
switch (iconName) {
case 'closeIcon':
return closeIcon;
case 'collectorList':
return collectorList;
case 'dashboard':
return dashboard;
case 'deviceManage':
return deviceManage;
case 'dustOverview':
return dustOverview;
case 'monitor':
return monitor;
case 'warnning':
return warnning;
}
}
// 递归过滤路由 // 递归过滤路由
const filterRoutes = (routes) => { const filterRoutes = (routes) => {
if (!routes) return []; if (!routes) return [];
......
...@@ -11,6 +11,7 @@ import { createPinia } from "pinia"; ...@@ -11,6 +11,7 @@ import { createPinia } from "pinia";
import moment from 'moment'; import moment from 'moment';
import { startPermissionCheck } from '@/utils/permissionChecker'; import { startPermissionCheck } from '@/utils/permissionChecker';
const app = createApp(App); const app = createApp(App);
for (const [key, component] of Object.entries(ElementPlusIconsVue)) { for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
app.component(key, component); app.component(key, component);
......
...@@ -258,4 +258,78 @@ export const getLineOption2 = (xData = [], seriesData = [], legendDesc = "健康 ...@@ -258,4 +258,78 @@ export const getLineOption2 = (xData = [], seriesData = [], legendDesc = "健康
smooth: true, smooth: true,
}, },
], ],
}); });
\ No newline at end of file
export const getGaugeOption = (option) => {
return {
series: [
{
type: "gauge",
startAngle: 220,
endAngle: 320,
center: ["50%", "50%"],
radius: "90%",
min: option.min || 0,
max: option.max || 100,
splitNumber: 8,
axisLine: {
lineStyle: {
width: 30,
color: [
[0.2, "#fd666d"],
[0.8, "#48cd4d"],
[1, "#fd666d"],
],
},
},
pointer: {
itemStyle: {
color: 'auto'
}
},
axisTick: {
distance: -30,
length: 10,
lineStyle: {
color: "#fff",
width: 2,
},
},
splitLine: {
distance: -30,
length: 38,
lineStyle: {
color: '#fff',
width: 2
},
},
axisLabel: {
color: 'inherit',
fontSize: 10,
distance: 30,
rotate: "tangential",
},
title: {
offsetCenter: [0, "70%"],
fontSize: 14,
fontWeight: "bolder",
},
detail: {
fontSize: 20,
offsetCenter: [0, 0],
valueAnimation: true,
formatter: function (value) {
return Math.round(value * 100) + "";
},
color: "inherit",
},
data: [
{
value: option.value || 0,
name: option.chartName || '',
},
],
},
],
};
}
\ No newline at end of file
...@@ -74,10 +74,11 @@ ...@@ -74,10 +74,11 @@
</div> </div>
<div class="table-box"> <div class="table-box">
<common-table <common-table
ref="pageRef"
:data="tableData.list" :data="tableData.list"
:columns="tableColumns" :columns="tableColumns"
:total="total" :total="total"
:default-page-size="pageSize" :default-page-size="20"
@pagination-change="handlePaginationChange" @pagination-change="handlePaginationChange"
:pagination-texts="{ :pagination-texts="{
total: '共', total: '共',
...@@ -167,7 +168,7 @@ const tableColumns = ref([ ...@@ -167,7 +168,7 @@ const tableColumns = ref([
{ {
prop: "index", prop: "index",
label: "序号", label: "序号",
width: "5%", width: "4%",
}, },
{ {
prop: "eventName", prop: "eventName",
...@@ -177,22 +178,22 @@ const tableColumns = ref([ ...@@ -177,22 +178,22 @@ const tableColumns = ref([
{ {
prop: "name", prop: "name",
label: "发生位置", label: "发生位置",
width: "9%", width: "15%",
}, },
{ {
prop: "deviceType", prop: "deviceType",
label: "设备类型", label: "设备类型",
width: "9%", width: "7%",
}, },
{ {
prop: "alarmIndicators", prop: "alarmIndicators",
label: "告警指标", label: "告警指标",
width: "9%", width: "7%",
}, },
{ {
prop: "value", prop: "value",
label: "监测值", label: "监测值",
width: "9%", width: "5%",
}, },
{ {
prop: "eventTime", prop: "eventTime",
...@@ -202,7 +203,7 @@ const tableColumns = ref([ ...@@ -202,7 +203,7 @@ const tableColumns = ref([
{ {
prop: "isSuspendAlarm", prop: "isSuspendAlarm",
label: "是否挂起期间告警", label: "是否挂起期间告警",
width: "9%", width: "8%",
}, },
{ {
prop: "operate", prop: "operate",
...@@ -212,20 +213,7 @@ const tableColumns = ref([ ...@@ -212,20 +213,7 @@ const tableColumns = ref([
]); ]);
const tableData = reactive({ const tableData = reactive({
list: [ list: [],
{
deviceName: "1#除尘器",
compart: "1234567890",
position: "转炉",
changeDateRemind: "xx",
changeDate: "xx",
changePeo: "xx",
ownerdeviceName: "xx",
lastAlarmTime: "xx",
changeRound: "xx",
operate: "挂起",
},
],
}); });
const typeList = reactive({ const typeList = reactive({
...@@ -251,9 +239,12 @@ const handlePaginationChange = (pagination) => { ...@@ -251,9 +239,12 @@ const handlePaginationChange = (pagination) => {
}; };
const onSubmit = () => { const onSubmit = () => {
currentPage.value = 1;
pageRef.value.setCurrentPage(currentPage.value);
getAlarmList(); getAlarmList();
}; };
const pageRef = ref(null);
const onReset = () => { const onReset = () => {
formInline.value = { formInline.value = {
eventName: "", eventName: "",
...@@ -265,6 +256,7 @@ const onReset = () => { ...@@ -265,6 +256,7 @@ const onReset = () => {
}; };
currentPage.value = 1; currentPage.value = 1;
pageSize.value = 20; pageSize.value = 20;
pageRef.value.setCurrentPage(currentPage.value);
getAlarmList(); getAlarmList();
}; };
......
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
</div> </div>
<div class="table-box"> <div class="table-box">
<common-table <common-table
ref="pageRef"
:data="tableData.list" :data="tableData.list"
:columns="tableColumns" :columns="tableColumns"
:default-page-size="20" :default-page-size="20"
...@@ -184,17 +185,17 @@ const tableColumns = ref([ ...@@ -184,17 +185,17 @@ const tableColumns = ref([
const tableData = reactive({ const tableData = reactive({
list: [ list: [
{ // {
deviceName: "1#除尘器", // deviceName: "1#除尘器",
compart: "1234567890", // compart: "1234567890",
position: "转炉", // position: "转炉",
changeDateRemind: "xx", // changeDateRemind: "xx",
changeDate: "xx", // changeDate: "xx",
changePeo: "xx", // changePeo: "xx",
ownerdeviceName: "xx", // ownerdeviceName: "xx",
lastAlarmTime: "xx", // lastAlarmTime: "xx",
changeRound: "xx", // changeRound: "xx",
}, // },
], ],
}); });
...@@ -246,9 +247,12 @@ const handlePaginationChange = (pagination) => { ...@@ -246,9 +247,12 @@ const handlePaginationChange = (pagination) => {
}; };
const onSubmit = () => { const onSubmit = () => {
currentPage.value = 1;
pageRef.value.setCurrentPage(currentPage.value);
getAllDustList(); getAllDustList();
}; };
const pageRef = ref(null);
const onReset = () => { const onReset = () => {
formInline.value = { formInline.value = {
compart: "", compart: "",
...@@ -257,6 +261,7 @@ const onReset = () => { ...@@ -257,6 +261,7 @@ const onReset = () => {
}; };
currentPage.value = 1; currentPage.value = 1;
pageSize.value = 20; pageSize.value = 20;
pageRef.value.setCurrentPage(currentPage.value);
getAllDustList(); getAllDustList();
}; };
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
<!-- <span class="jump-icon">>></span> --> <!-- <span class="jump-icon">>></span> -->
</div> </div>
<div class="content"> <div class="content">
<div class="item" v-for="item in listInfo" :key="item.id"> <div class="item" v-for="item in listInfo" :key="item">
<img src="@/assets/icons/notice.png" alt="">{{item.info}} <img src="@/assets/icons/notice.png" alt="">{{item}}
</div> </div>
</div> </div>
</template> </template>
...@@ -15,6 +15,10 @@ const props = defineProps({ ...@@ -15,6 +15,10 @@ const props = defineProps({
type: Array, type: Array,
default: () => [], default: () => [],
}, },
title: {
type: String,
default: "告警",
}
}); });
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
</div> </div>
</div> </div>
<div class="warn-info"> <div class="warn-info">
<warnCom :listInfo="testList"></warnCom> <warnCom title="告警" :listInfo="warnInfoList"></warnCom>
</div> </div>
</div> </div>
<div class="right-box"> <div class="right-box">
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
</div> </div>
</div> </div>
<div class="part2"> <div class="part2">
<div class="dust-title">2号窑尾除尘器</div> <div class="dust-title">{{ dusterName }}</div>
<div class="dust-info"> <div class="dust-info">
<div class="info-item" v-for="item in dustInfo" :key="item.label"> <div class="info-item" v-for="item in dustInfo" :key="item.label">
<span class="label">{{ item.label }}</span> <span class="label">{{ item.label }}</span>
...@@ -70,10 +70,18 @@ ...@@ -70,10 +70,18 @@
<div class="position-info"> <div class="position-info">
<div class="left" v-if="detailObj.compartHealthList.length > 0"> <div class="left" v-if="detailObj.compartHealthList.length > 0">
<div class="part"> <div class="part">
<div class="point warn" v-for="item in detailObj.compartHealthList[0]" :key="item"></div> <div
class="point warn"
v-for="item in detailObj.compartHealthList[0]"
:key="item"
></div>
</div> </div>
<div class="part"> <div class="part">
<div class="point warn" v-for="item in detailObj.compartHealthList[1]" :key="item"></div> <div
class="point warn"
v-for="item in detailObj.compartHealthList[1]"
:key="item"
></div>
</div> </div>
</div> </div>
<!-- <div class="right"> <!-- <div class="right">
...@@ -101,21 +109,21 @@ ...@@ -101,21 +109,21 @@
</div> </div>
</div> </div>
<div class="warn-info"> <div class="warn-info">
<warnCom :listInfo="testList"></warnCom> <warnCom title="闭环" :listInfo="closedLoopInfoList"></warnCom>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script setup> <script setup>
import { ref, reactive, onMounted, watch } from "vue"; import { ref, reactive, onMounted, onUnmounted, watch, computed } from "vue";
import * as echarts from "echarts"; import * as echarts from "echarts";
import { getDataFun } from "@/request/method.js"; import { getDataFun } from "@/request/method.js";
import { useUsersStore } from "@/pinia/user.js"; import { useUsersStore } from "@/pinia/user.js";
import moment from "moment"; import moment from "moment";
import warnCom from "./components/warn.vue"; import warnCom from "./components/warn.vue";
import healthyCom from "./components/healthyProgress.vue"; import healthyCom from "./components/healthyProgress.vue";
import { getLineOption2 } from "@/utils/chart"; import { getLineOption2, getGaugeOption } from "@/utils/chart";
const userStore = useUsersStore(); const userStore = useUsersStore();
const form = reactive({ const form = reactive({
dusterNo: "", dusterNo: "",
...@@ -140,7 +148,7 @@ const option = { ...@@ -140,7 +148,7 @@ const option = {
}, },
], ],
}; };
const chartInstance = reactive([null, null, null]); const chartInstance = reactive({});
const chartData = reactive([{}, {}, {}]); const chartData = reactive([{}, {}, {}]);
const initChart = (instance, option, domEl) => { const initChart = (instance, option, domEl) => {
if (instance && instance.dispose) { if (instance && instance.dispose) {
...@@ -148,6 +156,7 @@ const initChart = (instance, option, domEl) => { ...@@ -148,6 +156,7 @@ const initChart = (instance, option, domEl) => {
} }
instance = echarts.init(document.getElementById(domEl)); instance = echarts.init(document.getElementById(domEl));
instance.setOption(option); instance.setOption(option);
chartInstance[domEl] = instance;
}; };
const dustInfo = reactive([ const dustInfo = reactive([
{ {
...@@ -257,18 +266,12 @@ const indicatorFun = (target, domId, option) => { ...@@ -257,18 +266,12 @@ const indicatorFun = (target, domId, option) => {
target.value.setOption(option); target.value.setOption(option);
}; };
const dusterList = ref([]); const dusterList = ref([]);
// 获取除尘器名称 // 获取除尘器名称枚举值
const getDusterNameEnum = () => { const getDusterNameEnum = () => {
const url = "/bag/cycle/getDusterList"; const url = "/bag/cycle/getDusterList";
getDataFun(url, {}) getDataFun(url, {})
.then((res) => { .then((res) => {
// dusterList.value = (res && res.data) || []; dusterList.value = (res && res.data) || [];
dusterList.value = [
{
dusterNo: "wp001",
dusterName: "雾炮001",
},
];
// 判断除尘器名称是否有值 // 判断除尘器名称是否有值
form.dusterNo = dusterList.value[0].dusterNo; form.dusterNo = dusterList.value[0].dusterNo;
}) })
...@@ -355,7 +358,7 @@ const detailObj = reactive({ ...@@ -355,7 +358,7 @@ const detailObj = reactive({
bachflushCompart: "", bachflushCompart: "",
leakageCompart: "", leakageCompart: "",
faultCompart: "", faultCompart: "",
compartHealthList: [] compartHealthList: [],
}); });
// 获取除尘器详情 // 获取除尘器详情
const getDustDetail = () => { const getDustDetail = () => {
...@@ -388,7 +391,91 @@ const getDustDetail = () => { ...@@ -388,7 +391,91 @@ const getDustDetail = () => {
(res.data && res.data.bachflushCompart) || ""; (res.data && res.data.bachflushCompart) || "";
detailObj.leakageCompart = (res.data && res.data.leakageCompart) || ""; detailObj.leakageCompart = (res.data && res.data.leakageCompart) || "";
detailObj.faultCompart = (res.data && res.data.bachflushCompart) || ""; detailObj.faultCompart = (res.data && res.data.bachflushCompart) || "";
detailObj.compartHealthList = (res.data && res.data.compartHealthList) || []; detailObj.compartHealthList = (res.data &&
res.data.compartHealthList) || [
[
{
compartNo: "1",
healthStatus: 1,
sort: 1,
},
{
compartNo: "2",
healthStatus: 1,
sort: 2,
},
{
compartNo: null,
healthStatus: 1,
sort: 3,
},
{
compartNo: null,
healthStatus: 1,
sort: 4,
},
{
compartNo: null,
healthStatus: 1,
sort: 5,
},
{
compartNo: null,
healthStatus: 1,
sort: 6,
},
{
compartNo: null,
healthStatus: 1,
sort: 7,
},
{
compartNo: null,
healthStatus: 1,
sort: 8,
},
{
compartNo: null,
healthStatus: 1,
sort: 9,
},
{
compartNo: null,
healthStatus: 1,
sort: 10,
},
{
compartNo: null,
healthStatus: 1,
sort: 11,
},
{
compartNo: null,
healthStatus: 1,
sort: 12,
},
],
];
indicatorFun(
indicatorOneInstance,
"indicatorOne",
getGaugeOption({
value: dustInfo[0].value / 100,
chartName: "压差",
min: parseInt(res.data.pressureDiffLow),
max: parseInt(res.data.pressureDiffHigh),
})
);
indicatorFun(
indicatorTwoInstance,
"indicatorTwo",
getGaugeOption({
value: dustInfo[1].value,
chartName: "粉尘浓度",
min: 5,
max: 50,
})
);
}) })
.catch(() => { .catch(() => {
dustInfo.forEach((item) => { dustInfo.forEach((item) => {
...@@ -396,28 +483,6 @@ const getDustDetail = () => { ...@@ -396,28 +483,6 @@ const getDustDetail = () => {
}); });
}); });
}; };
const testList = reactive([
{
id: 1,
info: "测试1测试1测试1测试1测试1测试1测试1测试1测试1测试1测试1测试1",
},
{
id: 2,
info: "测试1测试1测试1测试1测试1测试1测试1测试1测试1测试1测试1测试1",
},
{
id: 3,
info: "测试1测试1测试1测试1测试1测试1测试1测试1测试1测试1测试1测试1",
},
// {
// id: 4,
// info: "测试1测试1测试1测试1测试1测试1测试1测试1测试1测试1测试1测试1",
// },
// {
// id: 5,
// info: "测试1测试1测试1测试1测试1测试1测试1测试1测试1测试1测试1测试1",
// },
]);
const closedLoopInfoList = ref([]); const closedLoopInfoList = ref([]);
const warnInfoList = ref([]); const warnInfoList = ref([]);
// 获取告警信息 // 获取告警信息
...@@ -443,11 +508,20 @@ const getAlarmInfo = () => { ...@@ -443,11 +508,20 @@ const getAlarmInfo = () => {
warnInfoList.value = []; warnInfoList.value = [];
}); });
}; };
const resizeFun = () => {
indicatorOneInstance && indicatorOneInstance.value.resize();
indicatorTwoInstance && indicatorTwoInstance.value.resize();
Object.keys(chartInstance).forEach((key) => {
chartInstance[key] && chartInstance[key].resize();
});
};
onMounted(() => { onMounted(() => {
getDusterNameEnum(); getDusterNameEnum();
indicatorFun(indicatorOneInstance, "indicatorOne", option2); window.addEventListener("resize", resizeFun);
indicatorFun(indicatorTwoInstance, "indicatorTwo", option2);
}); });
onUnmounted(() => {
window.removeEventListener("resize", resizeFun);
})
watch( watch(
() => form.dusterNo, () => form.dusterNo,
() => { () => {
...@@ -468,6 +542,10 @@ watch( ...@@ -468,6 +542,10 @@ watch(
getAlarmInfo(); getAlarmInfo();
} }
); );
const dusterName = computed(() => {
return dusterList.value.find((item) => item.dusterNo == form.dusterNo)
?.dusterName;
});
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
$borderColor: #bbbdc391; $borderColor: #bbbdc391;
......
const infoEnum = reactive([
{
label: "点位名称",
propKey: 'deviceName',
type: "input",
},
{
label: "仓室数量",
propKey: 'compartNum',
type: "input",
},
{
label: "地址",
propKey: 'address',
type: "input",
},
{
label: "脉冲阀故障阈值",
propKey: 'pulseValveFaultThreshold',
type: "input",
},
{
label: "斜率",
propKey: 'slope',
type: "input",
},
{
label: "脉冲数量",
propKey: 'pulseValveNum',
type: "input",
},
{
label: "截距",
propKey: 'intercept',
type: "input",
},
{
label: "反吹间隔时间",
propKey: 'backblowInterval',
type: "input",
},
{
label: "基线阈值",
propKey: 'baselineThreshold',
type: "input",
},
{
label: "延时时间",
propKey: 'delayTime',
type: "input",
},
{
label: "群聚值",
propKey: "clusterValue",
type: "input",
},
{
label: "积分时间",
propKey: 'integrationTime',
type: "input",
},
{
label: "通信口",
propKey: 'communicationPort',
type: "select",
options: []
},
{
label: "泄露阈值",
propKey: 'leakThreshold',
type: "input",
},
{
label: "故障阈值",
propKey: "faultThreshold",
type: "input",
},
{
label: "谷值判定(%)",
propKey: "valleyDection",
type: "input",
},
{
label: "阀数量",
propKey: "valveNum",
type: "input",
},
{
label: "提升阀故障",
propKey: "liftValveFailure",
type: "input",
},
{
label: "提升阀延迟时间",
propKey: "liftValveDelayTime",
type: "input",
},
]);
\ No newline at end of file
...@@ -12,9 +12,9 @@ ...@@ -12,9 +12,9 @@
<span class="label">{{ item.label }}</span> <span class="label">{{ item.label }}</span>
<el-input <el-input
v-if="item.type === 'input'" v-if="item.type === 'input'"
v-model="item.value" v-model="infoObj[item.propKey]"
></el-input> ></el-input>
<el-select v-model="item.value" v-if="item.type === 'select'"> <el-select v-model="infoObj[item.propKey]" v-if="item.type === 'select'">
<el-option <el-option
v-for="option in item.options" v-for="option in item.options"
:key="option.code" :key="option.code"
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<span class="label">{{ item.label }}</span> <span class="label">{{ item.label }}</span>
<el-input <el-input
v-if="item.type === 'input'" v-if="item.type === 'input'"
v-model="item.value" v-model="infoObj[item.propKey]"
></el-input> ></el-input>
</div> </div>
</div> </div>
...@@ -127,14 +127,17 @@ const props = defineProps({ ...@@ -127,14 +127,17 @@ const props = defineProps({
watch( watch(
() => props.infoObjProps, () => props.infoObjProps,
(newVal) => { (newVal) => {
Object.assign(infoObj, newVal); console.log(newVal);
// Object.assign(infoObj, newVal);
infoObj = newVal;
console.log(infoObj);
}, },
{ deep: true, inmediate: true } { deep: true, inmediate: true }
); );
const emit = defineEmits(["close"]); const emit = defineEmits(["close"]);
const infoObj = reactive({ let infoObj = reactive({
deviceName: "", // 点位名称 deviceName: "", // 点位名称
compartNum: "", // 仓室数量 compartNum: "", // 仓室数量
address: "", // 地址 address: "", // 地址
...@@ -165,102 +168,102 @@ const infoObj = reactive({ ...@@ -165,102 +168,102 @@ const infoObj = reactive({
indoorPulseBlow: "", // 室内卖出轮流喷吹 indoorPulseBlow: "", // 室内卖出轮流喷吹
liftValveDelayTime: "", // 提升阀延迟时间 liftValveDelayTime: "", // 提升阀延迟时间
}); });
const communicationPortOptions = ref([]) const communicationPortOptions = ref([]);
const infoEnum = reactive([ const infoEnum = reactive([
{ {
label: "点位名称", label: "点位名称",
value: infoObj.deviceName, propKey: "deviceName",
type: "input", type: "input",
}, },
{ {
label: "仓室数量", label: "仓室数量",
value: infoObj.compartNum, propKey: "compartNum",
type: "input", type: "input",
}, },
{ {
label: "地址", label: "地址",
value: infoObj.address, propKey: "address",
type: "input", type: "input",
}, },
{ {
label: "脉冲阀故障阈值", label: "脉冲阀故障阈值",
value: infoObj.pulseValveFaultThreshold, propKey: "pulseValveFaultThreshold",
type: "input", type: "input",
}, },
{ {
label: "斜率", label: "斜率",
value: infoObj.slope, propKey: "slope",
type: "input", type: "input",
}, },
{ {
label: "脉冲数量", label: "脉冲数量",
value: infoObj.pulseValveNum, propKey: "pulseValveNum",
type: "input", type: "input",
}, },
{ {
label: "截距", label: "截距",
value: infoObj.intercept, propKey: "intercept",
type: "input", type: "input",
}, },
{ {
label: "反吹间隔时间", label: "反吹间隔时间",
value: infoObj.backblowInterval, propKey: "backblowInterval",
type: "input", type: "input",
}, },
{ {
label: "基线阈值", label: "基线阈值",
value: infoObj.baselineThreshold, propKey: "baselineThreshold",
type: "input", type: "input",
}, },
{ {
label: "延时时间", label: "延时时间",
value: infoObj.delayTime, propKey: "delayTime",
type: "input", type: "input",
}, },
{ {
label: "群聚值", label: "群聚值",
value: infoObj.clusterValue, propKey: "clusterValue",
type: "input", type: "input",
}, },
{ {
label: "积分时间", label: "积分时间",
value: infoObj.integrationTime, propKey: "integrationTime",
type: "input", type: "input",
}, },
{ {
label: "通信口", label: "通信口",
value: infoObj.communicationPort, propKey: "communicationPort",
type: "select", type: "select",
options: [] options: [],
}, },
{ {
label: "泄露阈值", label: "泄露阈值",
value: infoObj.leakThreshold, propKey: "leakThreshold",
type: "input", type: "input",
}, },
{ {
label: "故障阈值", label: "故障阈值",
value: infoObj.faultThreshold, propKey: "faultThreshold",
type: "input", type: "input",
}, },
{ {
label: "谷值判定(%)", label: "谷值判定(%)",
value: infoObj.valleyDection, propKey: "valleyDection",
type: "input", type: "input",
}, },
{ {
label: "阀数量", label: "阀数量",
value: infoObj.valveNum, propKey: "valveNum",
type: "input", type: "input",
}, },
{ {
label: "提升阀故障", label: "提升阀故障",
value: infoObj.liftValveFailure, propKey: "liftValveFailure",
type: "input", type: "input",
}, },
{ {
label: "提升阀延迟时间", label: "提升阀延迟时间",
value: infoObj.liftValveDelayTime, propKey: "liftValveDelayTime",
type: "input", type: "input",
}, },
]); ]);
...@@ -291,17 +294,19 @@ const cancelFun = () => { ...@@ -291,17 +294,19 @@ const cancelFun = () => {
// 获取通信口 // 获取通信口
const getCommunicationPort = () => { const getCommunicationPort = () => {
const url = "/queryCommunicationPort"; const url = "/queryCommunicationPort";
getDataFun(url, {}).then((res) => { getDataFun(url, {})
communicationPortOptions.value = res && res.data || [] .then((res) => {
for(let i = 0; i < infoEnum.length; i++) { communicationPortOptions.value = (res && res.data) || [];
if (infoEnum[i].label === '通信口') { for (let i = 0; i < infoEnum.length; i++) {
infoEnum[i].options = communicationPortOptions.value if (infoEnum[i].label === "通信口") {
break infoEnum[i].options = communicationPortOptions.value;
break;
}
} }
} })
}).catch(err => { .catch((err) => {
communicationPortOptions.value = [] communicationPortOptions.value = [];
}); });
}; };
onMounted(() => { onMounted(() => {
getCommunicationPort(); getCommunicationPort();
......
...@@ -120,6 +120,7 @@ ...@@ -120,6 +120,7 @@
<setParamsDialog <setParamsDialog
v-model:dialogVisible="dialogVisible" v-model:dialogVisible="dialogVisible"
@close="closeDialog" @close="closeDialog"
:infoObjProps="infoObj"
></setParamsDialog> ></setParamsDialog>
</div> </div>
</template> </template>
...@@ -368,6 +369,9 @@ const beforeUpload = (file) => { ...@@ -368,6 +369,9 @@ const beforeUpload = (file) => {
return true; return true;
} }
}; };
const infoObj = ref({
})
// 获取参数 // 获取参数
const getParamsConfig = (val) => { const getParamsConfig = (val) => {
const url = "/getSensorConfig"; const url = "/getSensorConfig";
...@@ -375,42 +379,42 @@ const getParamsConfig = (val) => { ...@@ -375,42 +379,42 @@ const getParamsConfig = (val) => {
deviceNo: val.deviceNo, deviceNo: val.deviceNo,
}; };
getDataFun(url, params).then((res) => { getDataFun(url, params).then((res) => {
console.log(res); // res.data = {
res.data = { // id: 7,
id: 7, // customerId: 26,
customerId: 26, // deviceNo: "cgq_001",
deviceNo: "cgq_001", // deviceName: "布袋传感器001",
deviceName: "布袋传感器001", // compartNum: 12,
compartNum: 12, // address: "地址",
address: "地址", // pulseValveFaultThreshold: "脉冲阀故障阈值",
pulseValveFaultThreshold: "脉冲阀故障阈值", // slope: "斜率",
slope: "斜率", // pulseValveNum: "脉冲阀数量",
pulseValveNum: "脉冲阀数量", // intercept: "截距",
intercept: "截距", // backblowInterval: "反吹间隔时间",
backblowInterval: "反吹间隔时间", // baselineThreshold: "基线阈值",
baselineThreshold: "基线阈值", // delayTime: "延时时间",
delayTime: "延时时间", // clusterValue: "群聚值",
clusterValue: "群聚值", // integrationTime: "积分时间",
integrationTime: "积分时间", // communicationPort: "通信口",
communicationPort: "通信口", // leakThreshold: "泄露阈值",
leakThreshold: "泄露阈值", // onlineBackblow: true,
onlineBackblow: true, // fastBlow: true,
fastBlow: true, // faultThreshold: "故障阈值",
faultThreshold: "故障阈值", // d01Alarm: true,
d01Alarm: true, // d13Alarm: true,
d13Alarm: true, // valleyDection: "谷值判定",
valleyDection: "谷值判定", // valveNum: "阀数量",
valveNum: "阀数量", // liftValveFailure: "提升阀故障",
liftValveFailure: "提升阀故障", // compartSort: "仓室顺序",
compartSort: "仓室顺序", // liftValveDelayTime: "提升阀延迟时间",
liftValveDelayTime: "提升阀延迟时间", // diInput: true,
diInput: true, // showEarlyWarn: true,
showEarlyWarn: true, // relateDevicesNum: "关联设备",
relateDevicesNum: "关联设备", // liftValveCommunicationIp: "脉冲的设备通信ip",
liftValveCommunicationIp: "脉冲的设备通信ip", // indoorPulseBlow: true,
indoorPulseBlow: true, // };
};
dialogVisible.value = true; dialogVisible.value = true;
infoObj.value = res.data || {}
}).catch(err => { }).catch(err => {
ElMessage.error('获取参数设置失败'); ElMessage.error('获取参数设置失败');
}); });
......
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
</div> </div>
<div class="table-box"> <div class="table-box">
<common-table <common-table
ref="pageRef"
:data="tableData.list" :data="tableData.list"
:columns="tableColumns" :columns="tableColumns"
:default-page-size="20" :default-page-size="20"
...@@ -229,9 +230,12 @@ const handlePaginationChange = (pagination) => { ...@@ -229,9 +230,12 @@ const handlePaginationChange = (pagination) => {
}; };
const onSubmit = () => { const onSubmit = () => {
currentPage.value = 1;
pageRef.value.setCurrentPage(1);
getManagementList(); getManagementList();
}; };
const pageRef = ref(null);
const onReset = () => { const onReset = () => {
formInline.value = { formInline.value = {
deviceType: "", deviceType: "",
...@@ -240,6 +244,7 @@ const onReset = () => { ...@@ -240,6 +244,7 @@ const onReset = () => {
}; };
currentPage.value = 1; currentPage.value = 1;
pageSize.value = 20; pageSize.value = 20;
pageRef.value.setCurrentPage(currentPage.value);
getManagementList(); getManagementList();
}; };
......
import { defineConfig, loadEnv } from 'vite' import { defineConfig, loadEnv } from 'vite'
import vue from '@vitejs/plugin-vue' import vue from '@vitejs/plugin-vue'
import path from "path" // 需安装此模块 import path from "path" // 需安装此模块
import { fileURLToPath, URL } from 'node:url'
// https://vite.dev/config/ // https://vite.dev/config/
export default defineConfig(({mode}) => { export default defineConfig(({mode}) => {
const ENV = loadEnv(mode, process.cwd()) const ENV = loadEnv(mode, process.cwd())
return { return {
base: './', // 基础路径配置
plugins: [vue()], plugins: [vue()],
resolve: { resolve: {
alias: { alias: {
// 这里就是需要配置resolve里的别名 // 这里就是需要配置resolve里的别名
"@": path.resolve(__dirname, "./src") // path记得引入 "@": fileURLToPath(new URL('./src', import.meta.url))
}
},
build: {
outDir: 'dist', // 指定输出目录
assetsDir: 'assets', // 指定静态资源存放目录
sourcemap: false, // 不生成 sourcemap 文件
chunkSizeWarningLimit: 1500, // 文件大小警告的限制(kbs)
rollupOptions: {
output: {
chunkFileNames: 'assets/js/[name]-[hash].js',
entryFileNames: 'assets/js/[name]-[hash].js',
assetFileNames: 'assets/[ext]/[name]-[hash].[ext]',
manualChunks(id) {
if (id.includes('node_modules')) {
return 'vendor'
}
}
}
} }
}, },
server: { server: {
...@@ -17,11 +38,10 @@ export default defineConfig(({mode}) => { ...@@ -17,11 +38,10 @@ export default defineConfig(({mode}) => {
port: 3000, // 指定服务器端口 port: 3000, // 指定服务器端口
proxy: { proxy: {
[ENV.VITE_APP_BASE_API5]: { [ENV.VITE_APP_BASE_API5]: {
target: 'https://screen.bmetech.com', target: 'https://screen.bmetech.com', // 更新为完整的基础路径
// target: 'https://vis.bmetech.com',
changeOrigin: true, changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, '') // 添加路径重写规则
}, },
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment