diff --git a/src/api/laboratory/data.ts b/src/api/laboratory/data.ts index 8d8279b..3e64dd1 100644 --- a/src/api/laboratory/data.ts +++ b/src/api/laboratory/data.ts @@ -7,11 +7,20 @@ // 列表查询 export function getDataList(data: IListQuery, type: string) { - return request({ - url: `${prefix}/${type}/listPage?offset=${data.offset}&limit=${data.limit}`, - method: 'post', - data, - }) + if (type === 'ups/monitor') { + return request({ + url: `${prefix}/${type}/list?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) + } + else { + return request({ + url: `${prefix}/${type}/listPage?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) + } } // 导出 @@ -23,4 +32,3 @@ responseType: 'blob', }) } - diff --git a/src/api/laboratory/data.ts b/src/api/laboratory/data.ts index 8d8279b..3e64dd1 100644 --- a/src/api/laboratory/data.ts +++ b/src/api/laboratory/data.ts @@ -7,11 +7,20 @@ // 列表查询 export function getDataList(data: IListQuery, type: string) { - return request({ - url: `${prefix}/${type}/listPage?offset=${data.offset}&limit=${data.limit}`, - method: 'post', - data, - }) + if (type === 'ups/monitor') { + return request({ + url: `${prefix}/${type}/list?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) + } + else { + return request({ + url: `${prefix}/${type}/listPage?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) + } } // 导出 @@ -23,4 +32,3 @@ responseType: 'blob', }) } - diff --git a/src/assets/images/offLine.png b/src/assets/images/offLine.png new file mode 100644 index 0000000..9abaf4d --- /dev/null +++ b/src/assets/images/offLine.png Binary files differ diff --git a/src/api/laboratory/data.ts b/src/api/laboratory/data.ts index 8d8279b..3e64dd1 100644 --- a/src/api/laboratory/data.ts +++ b/src/api/laboratory/data.ts @@ -7,11 +7,20 @@ // 列表查询 export function getDataList(data: IListQuery, type: string) { - return request({ - url: `${prefix}/${type}/listPage?offset=${data.offset}&limit=${data.limit}`, - method: 'post', - data, - }) + if (type === 'ups/monitor') { + return request({ + url: `${prefix}/${type}/list?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) + } + else { + return request({ + url: `${prefix}/${type}/listPage?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) + } } // 导出 @@ -23,4 +32,3 @@ responseType: 'blob', }) } - diff --git a/src/assets/images/offLine.png b/src/assets/images/offLine.png new file mode 100644 index 0000000..9abaf4d --- /dev/null +++ b/src/assets/images/offLine.png Binary files differ diff --git a/src/assets/images/onLine.png b/src/assets/images/onLine.png new file mode 100644 index 0000000..38e430e --- /dev/null +++ b/src/assets/images/onLine.png Binary files differ diff --git a/src/api/laboratory/data.ts b/src/api/laboratory/data.ts index 8d8279b..3e64dd1 100644 --- a/src/api/laboratory/data.ts +++ b/src/api/laboratory/data.ts @@ -7,11 +7,20 @@ // 列表查询 export function getDataList(data: IListQuery, type: string) { - return request({ - url: `${prefix}/${type}/listPage?offset=${data.offset}&limit=${data.limit}`, - method: 'post', - data, - }) + if (type === 'ups/monitor') { + return request({ + url: `${prefix}/${type}/list?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) + } + else { + return request({ + url: `${prefix}/${type}/listPage?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) + } } // 导出 @@ -23,4 +32,3 @@ responseType: 'blob', }) } - diff --git a/src/assets/images/offLine.png b/src/assets/images/offLine.png new file mode 100644 index 0000000..9abaf4d --- /dev/null +++ b/src/assets/images/offLine.png Binary files differ diff --git a/src/assets/images/onLine.png b/src/assets/images/onLine.png new file mode 100644 index 0000000..38e430e --- /dev/null +++ b/src/assets/images/onLine.png Binary files differ diff --git a/src/assets/images/smoke-offLine.png b/src/assets/images/smoke-offLine.png new file mode 100644 index 0000000..0eb4cd8 --- /dev/null +++ b/src/assets/images/smoke-offLine.png Binary files differ diff --git a/src/api/laboratory/data.ts b/src/api/laboratory/data.ts index 8d8279b..3e64dd1 100644 --- a/src/api/laboratory/data.ts +++ b/src/api/laboratory/data.ts @@ -7,11 +7,20 @@ // 列表查询 export function getDataList(data: IListQuery, type: string) { - return request({ - url: `${prefix}/${type}/listPage?offset=${data.offset}&limit=${data.limit}`, - method: 'post', - data, - }) + if (type === 'ups/monitor') { + return request({ + url: `${prefix}/${type}/list?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) + } + else { + return request({ + url: `${prefix}/${type}/listPage?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) + } } // 导出 @@ -23,4 +32,3 @@ responseType: 'blob', }) } - diff --git a/src/assets/images/offLine.png b/src/assets/images/offLine.png new file mode 100644 index 0000000..9abaf4d --- /dev/null +++ b/src/assets/images/offLine.png Binary files differ diff --git a/src/assets/images/onLine.png b/src/assets/images/onLine.png new file mode 100644 index 0000000..38e430e --- /dev/null +++ b/src/assets/images/onLine.png Binary files differ diff --git a/src/assets/images/smoke-offLine.png b/src/assets/images/smoke-offLine.png new file mode 100644 index 0000000..0eb4cd8 --- /dev/null +++ b/src/assets/images/smoke-offLine.png Binary files differ diff --git a/src/assets/images/smoke.png b/src/assets/images/smoke.png new file mode 100644 index 0000000..92b3412 --- /dev/null +++ b/src/assets/images/smoke.png Binary files differ diff --git a/src/api/laboratory/data.ts b/src/api/laboratory/data.ts index 8d8279b..3e64dd1 100644 --- a/src/api/laboratory/data.ts +++ b/src/api/laboratory/data.ts @@ -7,11 +7,20 @@ // 列表查询 export function getDataList(data: IListQuery, type: string) { - return request({ - url: `${prefix}/${type}/listPage?offset=${data.offset}&limit=${data.limit}`, - method: 'post', - data, - }) + if (type === 'ups/monitor') { + return request({ + url: `${prefix}/${type}/list?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) + } + else { + return request({ + url: `${prefix}/${type}/listPage?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) + } } // 导出 @@ -23,4 +32,3 @@ responseType: 'blob', }) } - diff --git a/src/assets/images/offLine.png b/src/assets/images/offLine.png new file mode 100644 index 0000000..9abaf4d --- /dev/null +++ b/src/assets/images/offLine.png Binary files differ diff --git a/src/assets/images/onLine.png b/src/assets/images/onLine.png new file mode 100644 index 0000000..38e430e --- /dev/null +++ b/src/assets/images/onLine.png Binary files differ diff --git a/src/assets/images/smoke-offLine.png b/src/assets/images/smoke-offLine.png new file mode 100644 index 0000000..0eb4cd8 --- /dev/null +++ b/src/assets/images/smoke-offLine.png Binary files differ diff --git a/src/assets/images/smoke.png b/src/assets/images/smoke.png new file mode 100644 index 0000000..92b3412 --- /dev/null +++ b/src/assets/images/smoke.png Binary files differ diff --git a/src/router/index.ts b/src/router/index.ts index d244fb7..ae9b394 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -56,6 +56,7 @@ if (to.name === 'login') { next({ name: 'index', + // query: to.query, replace: true, }) } diff --git a/src/api/laboratory/data.ts b/src/api/laboratory/data.ts index 8d8279b..3e64dd1 100644 --- a/src/api/laboratory/data.ts +++ b/src/api/laboratory/data.ts @@ -7,11 +7,20 @@ // 列表查询 export function getDataList(data: IListQuery, type: string) { - return request({ - url: `${prefix}/${type}/listPage?offset=${data.offset}&limit=${data.limit}`, - method: 'post', - data, - }) + if (type === 'ups/monitor') { + return request({ + url: `${prefix}/${type}/list?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) + } + else { + return request({ + url: `${prefix}/${type}/listPage?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) + } } // 导出 @@ -23,4 +32,3 @@ responseType: 'blob', }) } - diff --git a/src/assets/images/offLine.png b/src/assets/images/offLine.png new file mode 100644 index 0000000..9abaf4d --- /dev/null +++ b/src/assets/images/offLine.png Binary files differ diff --git a/src/assets/images/onLine.png b/src/assets/images/onLine.png new file mode 100644 index 0000000..38e430e --- /dev/null +++ b/src/assets/images/onLine.png Binary files differ diff --git a/src/assets/images/smoke-offLine.png b/src/assets/images/smoke-offLine.png new file mode 100644 index 0000000..0eb4cd8 --- /dev/null +++ b/src/assets/images/smoke-offLine.png Binary files differ diff --git a/src/assets/images/smoke.png b/src/assets/images/smoke.png new file mode 100644 index 0000000..92b3412 --- /dev/null +++ b/src/assets/images/smoke.png Binary files differ diff --git a/src/router/index.ts b/src/router/index.ts index d244fb7..ae9b394 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -56,6 +56,7 @@ if (to.name === 'login') { next({ name: 'index', + // query: to.query, replace: true, }) } diff --git a/src/views/dashboard.vue b/src/views/dashboard.vue index 99c815c..bb2e8c3 100644 --- a/src/views/dashboard.vue +++ b/src/views/dashboard.vue @@ -48,7 +48,9 @@ window.open(system.url + params) } else { + console.log(' ========synstem', system.name, system.code) localStorage.setItem('currentSys', JSON.stringify({ name: system.name, code: system.code })) + routeStore.generateRoutesAtBack({ name: system.name, code: system.code }).then((res) => { if (menuStore.sidebarMenus.length > 0) { router.replace({ path: menuStore.sidebarMenusFirstDeepestPath }) diff --git a/src/api/laboratory/data.ts b/src/api/laboratory/data.ts index 8d8279b..3e64dd1 100644 --- a/src/api/laboratory/data.ts +++ b/src/api/laboratory/data.ts @@ -7,11 +7,20 @@ // 列表查询 export function getDataList(data: IListQuery, type: string) { - return request({ - url: `${prefix}/${type}/listPage?offset=${data.offset}&limit=${data.limit}`, - method: 'post', - data, - }) + if (type === 'ups/monitor') { + return request({ + url: `${prefix}/${type}/list?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) + } + else { + return request({ + url: `${prefix}/${type}/listPage?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) + } } // 导出 @@ -23,4 +32,3 @@ responseType: 'blob', }) } - diff --git a/src/assets/images/offLine.png b/src/assets/images/offLine.png new file mode 100644 index 0000000..9abaf4d --- /dev/null +++ b/src/assets/images/offLine.png Binary files differ diff --git a/src/assets/images/onLine.png b/src/assets/images/onLine.png new file mode 100644 index 0000000..38e430e --- /dev/null +++ b/src/assets/images/onLine.png Binary files differ diff --git a/src/assets/images/smoke-offLine.png b/src/assets/images/smoke-offLine.png new file mode 100644 index 0000000..0eb4cd8 --- /dev/null +++ b/src/assets/images/smoke-offLine.png Binary files differ diff --git a/src/assets/images/smoke.png b/src/assets/images/smoke.png new file mode 100644 index 0000000..92b3412 --- /dev/null +++ b/src/assets/images/smoke.png Binary files differ diff --git a/src/router/index.ts b/src/router/index.ts index d244fb7..ae9b394 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -56,6 +56,7 @@ if (to.name === 'login') { next({ name: 'index', + // query: to.query, replace: true, }) } diff --git a/src/views/dashboard.vue b/src/views/dashboard.vue index 99c815c..bb2e8c3 100644 --- a/src/views/dashboard.vue +++ b/src/views/dashboard.vue @@ -48,7 +48,9 @@ window.open(system.url + params) } else { + console.log(' ========synstem', system.name, system.code) localStorage.setItem('currentSys', JSON.stringify({ name: system.name, code: system.code })) + routeStore.generateRoutesAtBack({ name: system.name, code: system.code }).then((res) => { if (menuStore.sidebarMenus.length > 0) { router.replace({ path: menuStore.sidebarMenusFirstDeepestPath }) diff --git a/src/views/laboratory/data/list-interface.ts b/src/views/laboratory/data/list-interface.ts index fde23c3..9ed8845 100644 --- a/src/views/laboratory/data/list-interface.ts +++ b/src/views/laboratory/data/list-interface.ts @@ -87,6 +87,7 @@ uploadTime: string // 上传时间 userId: string // 负责人id userName: string // 负责人 + status?: number | string // ups监测状态 } // 列表请求参数 diff --git a/src/api/laboratory/data.ts b/src/api/laboratory/data.ts index 8d8279b..3e64dd1 100644 --- a/src/api/laboratory/data.ts +++ b/src/api/laboratory/data.ts @@ -7,11 +7,20 @@ // 列表查询 export function getDataList(data: IListQuery, type: string) { - return request({ - url: `${prefix}/${type}/listPage?offset=${data.offset}&limit=${data.limit}`, - method: 'post', - data, - }) + if (type === 'ups/monitor') { + return request({ + url: `${prefix}/${type}/list?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) + } + else { + return request({ + url: `${prefix}/${type}/listPage?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) + } } // 导出 @@ -23,4 +32,3 @@ responseType: 'blob', }) } - diff --git a/src/assets/images/offLine.png b/src/assets/images/offLine.png new file mode 100644 index 0000000..9abaf4d --- /dev/null +++ b/src/assets/images/offLine.png Binary files differ diff --git a/src/assets/images/onLine.png b/src/assets/images/onLine.png new file mode 100644 index 0000000..38e430e --- /dev/null +++ b/src/assets/images/onLine.png Binary files differ diff --git a/src/assets/images/smoke-offLine.png b/src/assets/images/smoke-offLine.png new file mode 100644 index 0000000..0eb4cd8 --- /dev/null +++ b/src/assets/images/smoke-offLine.png Binary files differ diff --git a/src/assets/images/smoke.png b/src/assets/images/smoke.png new file mode 100644 index 0000000..92b3412 --- /dev/null +++ b/src/assets/images/smoke.png Binary files differ diff --git a/src/router/index.ts b/src/router/index.ts index d244fb7..ae9b394 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -56,6 +56,7 @@ if (to.name === 'login') { next({ name: 'index', + // query: to.query, replace: true, }) } diff --git a/src/views/dashboard.vue b/src/views/dashboard.vue index 99c815c..bb2e8c3 100644 --- a/src/views/dashboard.vue +++ b/src/views/dashboard.vue @@ -48,7 +48,9 @@ window.open(system.url + params) } else { + console.log(' ========synstem', system.name, system.code) localStorage.setItem('currentSys', JSON.stringify({ name: system.name, code: system.code })) + routeStore.generateRoutesAtBack({ name: system.name, code: system.code }).then((res) => { if (menuStore.sidebarMenus.length > 0) { router.replace({ path: menuStore.sidebarMenusFirstDeepestPath }) diff --git a/src/views/laboratory/data/list-interface.ts b/src/views/laboratory/data/list-interface.ts index fde23c3..9ed8845 100644 --- a/src/views/laboratory/data/list-interface.ts +++ b/src/views/laboratory/data/list-interface.ts @@ -87,6 +87,7 @@ uploadTime: string // 上传时间 userId: string // 负责人id userName: string // 负责人 + status?: number | string // ups监测状态 } // 列表请求参数 diff --git a/src/views/laboratory/data/list.vue b/src/views/laboratory/data/list.vue index 386b755..8db5f6e 100644 --- a/src/views/laboratory/data/list.vue +++ b/src/views/laboratory/data/list.vue @@ -27,7 +27,8 @@ electricQuantityList: ref([]), // 智能电量仪 oxygenList: ref([]), // 氧气传感器 smokeList: ref([]), // 烟雾传感器 - upsList: ref([]), // 烟雾传感器 + upsList: ref([]), // UPS电源间电池 + upsMonitorList: ref([]), // UPS监测 } const menu = ref([ // 菜单 { @@ -101,18 +102,38 @@ }, { id: 'ups', - name: 'UPS电源', + name: 'UPS电源间电池', columns: ref([ { text: '设备编号', value: 'deviceNo', align: 'center', width: '160' }, { text: '设备名称', value: 'deviceName', align: 'center' }, { text: '负责部门', value: 'deptName', align: 'center' }, { text: '负责人', value: 'userName', align: 'center' }, { text: '安装地点', value: 'locationName', align: 'center' }, + { text: '所属实验室', value: 'labName', align: 'center' }, + { text: '电压(V)', value: 'labName', align: 'center' }, + { text: '内阻(mΩ)', value: 'labName', align: 'center' }, + { text: '温度(℃)', value: 'labName', align: 'center' }, { text: '状态', value: 'deviceStatusName', align: 'center', styleFilter: (row: IUPSList) => { return `${row.deviceStatus}` === '0' ? 'color: red' : `${row.deviceStatus}` === '1' ? 'color: #00a846' : '' } }, { text: '上传时间', value: 'uploadTime', align: 'center', width: '180' }, ]), list: listMap.upsList, }, + { + id: 'ups/monitor', + name: 'UPS监测', + columns: ref([ + { text: '设备编号', value: 'deviceNo', align: 'center', width: '160' }, + { text: '设备名称', value: 'deviceName', align: 'center' }, + { text: '负责部门', value: 'deptName', align: 'center' }, + { text: '负责人', value: 'userName', align: 'center' }, + { text: '安装地点', value: 'locationName', align: 'center' }, + { text: '所属实验室', value: 'labName', align: 'center' }, + { text: '参数', value: 'params', align: 'center', width: '160' }, + { text: '状态', value: 'upsMonitorDeviceStatusName', align: 'center', styleFilter: (row: IUPSList) => { return `${row.status}` === '1' ? 'color: red' : `${row.status}` === '0' ? 'color: #00a846' : '' } }, + { text: '上传时间', value: 'uploadTime', align: 'center', width: '180' }, + ]), + list: listMap.upsMonitorList, + }, ]) const currentMenu = ref('temperatureHumidity') // 当前选中的菜单 const currentIndex = ref(0) // 当前选中的菜单索引 @@ -185,10 +206,13 @@ listQuery.value.offset = 1 } getDataList(listQuery.value, currentMenu.value).then((response) => { - menu.value[currentIndex.value].list = response.data.rows.map((item: { deviceStatus: string }) => { + menu.value[currentIndex.value].list = response.data.rows.map((item: { deviceStatus: string; status: string }) => { return { ...item, deviceStatusName: `${item.deviceStatus}` === '1' ? '在线' : `${item.deviceStatus}` === '0' ? '离线' : '未知', + upsMonitorDeviceStatusName: `${item.status}` === '0' ? '正常' : `${item.status}` === '1' ? '异常' : '未知', + params: '电池电压、电池电流...', + labName: listQuery.value.labName, // 所属实验室 } }) total.value = parseInt(response.data.total) @@ -308,6 +332,37 @@ + + + + + + + + + + + + + + + + + + + { if (menuStore.sidebarMenus.length > 0) { router.replace({ path: menuStore.sidebarMenusFirstDeepestPath }) diff --git a/src/views/laboratory/data/list-interface.ts b/src/views/laboratory/data/list-interface.ts index fde23c3..9ed8845 100644 --- a/src/views/laboratory/data/list-interface.ts +++ b/src/views/laboratory/data/list-interface.ts @@ -87,6 +87,7 @@ uploadTime: string // 上传时间 userId: string // 负责人id userName: string // 负责人 + status?: number | string // ups监测状态 } // 列表请求参数 diff --git a/src/views/laboratory/data/list.vue b/src/views/laboratory/data/list.vue index 386b755..8db5f6e 100644 --- a/src/views/laboratory/data/list.vue +++ b/src/views/laboratory/data/list.vue @@ -27,7 +27,8 @@ electricQuantityList: ref([]), // 智能电量仪 oxygenList: ref([]), // 氧气传感器 smokeList: ref([]), // 烟雾传感器 - upsList: ref([]), // 烟雾传感器 + upsList: ref([]), // UPS电源间电池 + upsMonitorList: ref([]), // UPS监测 } const menu = ref([ // 菜单 { @@ -101,18 +102,38 @@ }, { id: 'ups', - name: 'UPS电源', + name: 'UPS电源间电池', columns: ref([ { text: '设备编号', value: 'deviceNo', align: 'center', width: '160' }, { text: '设备名称', value: 'deviceName', align: 'center' }, { text: '负责部门', value: 'deptName', align: 'center' }, { text: '负责人', value: 'userName', align: 'center' }, { text: '安装地点', value: 'locationName', align: 'center' }, + { text: '所属实验室', value: 'labName', align: 'center' }, + { text: '电压(V)', value: 'labName', align: 'center' }, + { text: '内阻(mΩ)', value: 'labName', align: 'center' }, + { text: '温度(℃)', value: 'labName', align: 'center' }, { text: '状态', value: 'deviceStatusName', align: 'center', styleFilter: (row: IUPSList) => { return `${row.deviceStatus}` === '0' ? 'color: red' : `${row.deviceStatus}` === '1' ? 'color: #00a846' : '' } }, { text: '上传时间', value: 'uploadTime', align: 'center', width: '180' }, ]), list: listMap.upsList, }, + { + id: 'ups/monitor', + name: 'UPS监测', + columns: ref([ + { text: '设备编号', value: 'deviceNo', align: 'center', width: '160' }, + { text: '设备名称', value: 'deviceName', align: 'center' }, + { text: '负责部门', value: 'deptName', align: 'center' }, + { text: '负责人', value: 'userName', align: 'center' }, + { text: '安装地点', value: 'locationName', align: 'center' }, + { text: '所属实验室', value: 'labName', align: 'center' }, + { text: '参数', value: 'params', align: 'center', width: '160' }, + { text: '状态', value: 'upsMonitorDeviceStatusName', align: 'center', styleFilter: (row: IUPSList) => { return `${row.status}` === '1' ? 'color: red' : `${row.status}` === '0' ? 'color: #00a846' : '' } }, + { text: '上传时间', value: 'uploadTime', align: 'center', width: '180' }, + ]), + list: listMap.upsMonitorList, + }, ]) const currentMenu = ref('temperatureHumidity') // 当前选中的菜单 const currentIndex = ref(0) // 当前选中的菜单索引 @@ -185,10 +206,13 @@ listQuery.value.offset = 1 } getDataList(listQuery.value, currentMenu.value).then((response) => { - menu.value[currentIndex.value].list = response.data.rows.map((item: { deviceStatus: string }) => { + menu.value[currentIndex.value].list = response.data.rows.map((item: { deviceStatus: string; status: string }) => { return { ...item, deviceStatusName: `${item.deviceStatus}` === '1' ? '在线' : `${item.deviceStatus}` === '0' ? '离线' : '未知', + upsMonitorDeviceStatusName: `${item.status}` === '0' ? '正常' : `${item.status}` === '1' ? '异常' : '未知', + params: '电池电压、电池电流...', + labName: listQuery.value.labName, // 所属实验室 } }) total.value = parseInt(response.data.total) @@ -308,6 +332,37 @@ + + + + + + + + + + + + + + + + + + + { typeList.value = response.data }) diff --git a/src/api/laboratory/data.ts b/src/api/laboratory/data.ts index 8d8279b..3e64dd1 100644 --- a/src/api/laboratory/data.ts +++ b/src/api/laboratory/data.ts @@ -7,11 +7,20 @@ // 列表查询 export function getDataList(data: IListQuery, type: string) { - return request({ - url: `${prefix}/${type}/listPage?offset=${data.offset}&limit=${data.limit}`, - method: 'post', - data, - }) + if (type === 'ups/monitor') { + return request({ + url: `${prefix}/${type}/list?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) + } + else { + return request({ + url: `${prefix}/${type}/listPage?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) + } } // 导出 @@ -23,4 +32,3 @@ responseType: 'blob', }) } - diff --git a/src/assets/images/offLine.png b/src/assets/images/offLine.png new file mode 100644 index 0000000..9abaf4d --- /dev/null +++ b/src/assets/images/offLine.png Binary files differ diff --git a/src/assets/images/onLine.png b/src/assets/images/onLine.png new file mode 100644 index 0000000..38e430e --- /dev/null +++ b/src/assets/images/onLine.png Binary files differ diff --git a/src/assets/images/smoke-offLine.png b/src/assets/images/smoke-offLine.png new file mode 100644 index 0000000..0eb4cd8 --- /dev/null +++ b/src/assets/images/smoke-offLine.png Binary files differ diff --git a/src/assets/images/smoke.png b/src/assets/images/smoke.png new file mode 100644 index 0000000..92b3412 --- /dev/null +++ b/src/assets/images/smoke.png Binary files differ diff --git a/src/router/index.ts b/src/router/index.ts index d244fb7..ae9b394 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -56,6 +56,7 @@ if (to.name === 'login') { next({ name: 'index', + // query: to.query, replace: true, }) } diff --git a/src/views/dashboard.vue b/src/views/dashboard.vue index 99c815c..bb2e8c3 100644 --- a/src/views/dashboard.vue +++ b/src/views/dashboard.vue @@ -48,7 +48,9 @@ window.open(system.url + params) } else { + console.log(' ========synstem', system.name, system.code) localStorage.setItem('currentSys', JSON.stringify({ name: system.name, code: system.code })) + routeStore.generateRoutesAtBack({ name: system.name, code: system.code }).then((res) => { if (menuStore.sidebarMenus.length > 0) { router.replace({ path: menuStore.sidebarMenusFirstDeepestPath }) diff --git a/src/views/laboratory/data/list-interface.ts b/src/views/laboratory/data/list-interface.ts index fde23c3..9ed8845 100644 --- a/src/views/laboratory/data/list-interface.ts +++ b/src/views/laboratory/data/list-interface.ts @@ -87,6 +87,7 @@ uploadTime: string // 上传时间 userId: string // 负责人id userName: string // 负责人 + status?: number | string // ups监测状态 } // 列表请求参数 diff --git a/src/views/laboratory/data/list.vue b/src/views/laboratory/data/list.vue index 386b755..8db5f6e 100644 --- a/src/views/laboratory/data/list.vue +++ b/src/views/laboratory/data/list.vue @@ -27,7 +27,8 @@ electricQuantityList: ref([]), // 智能电量仪 oxygenList: ref([]), // 氧气传感器 smokeList: ref([]), // 烟雾传感器 - upsList: ref([]), // 烟雾传感器 + upsList: ref([]), // UPS电源间电池 + upsMonitorList: ref([]), // UPS监测 } const menu = ref([ // 菜单 { @@ -101,18 +102,38 @@ }, { id: 'ups', - name: 'UPS电源', + name: 'UPS电源间电池', columns: ref([ { text: '设备编号', value: 'deviceNo', align: 'center', width: '160' }, { text: '设备名称', value: 'deviceName', align: 'center' }, { text: '负责部门', value: 'deptName', align: 'center' }, { text: '负责人', value: 'userName', align: 'center' }, { text: '安装地点', value: 'locationName', align: 'center' }, + { text: '所属实验室', value: 'labName', align: 'center' }, + { text: '电压(V)', value: 'labName', align: 'center' }, + { text: '内阻(mΩ)', value: 'labName', align: 'center' }, + { text: '温度(℃)', value: 'labName', align: 'center' }, { text: '状态', value: 'deviceStatusName', align: 'center', styleFilter: (row: IUPSList) => { return `${row.deviceStatus}` === '0' ? 'color: red' : `${row.deviceStatus}` === '1' ? 'color: #00a846' : '' } }, { text: '上传时间', value: 'uploadTime', align: 'center', width: '180' }, ]), list: listMap.upsList, }, + { + id: 'ups/monitor', + name: 'UPS监测', + columns: ref([ + { text: '设备编号', value: 'deviceNo', align: 'center', width: '160' }, + { text: '设备名称', value: 'deviceName', align: 'center' }, + { text: '负责部门', value: 'deptName', align: 'center' }, + { text: '负责人', value: 'userName', align: 'center' }, + { text: '安装地点', value: 'locationName', align: 'center' }, + { text: '所属实验室', value: 'labName', align: 'center' }, + { text: '参数', value: 'params', align: 'center', width: '160' }, + { text: '状态', value: 'upsMonitorDeviceStatusName', align: 'center', styleFilter: (row: IUPSList) => { return `${row.status}` === '1' ? 'color: red' : `${row.status}` === '0' ? 'color: #00a846' : '' } }, + { text: '上传时间', value: 'uploadTime', align: 'center', width: '180' }, + ]), + list: listMap.upsMonitorList, + }, ]) const currentMenu = ref('temperatureHumidity') // 当前选中的菜单 const currentIndex = ref(0) // 当前选中的菜单索引 @@ -185,10 +206,13 @@ listQuery.value.offset = 1 } getDataList(listQuery.value, currentMenu.value).then((response) => { - menu.value[currentIndex.value].list = response.data.rows.map((item: { deviceStatus: string }) => { + menu.value[currentIndex.value].list = response.data.rows.map((item: { deviceStatus: string; status: string }) => { return { ...item, deviceStatusName: `${item.deviceStatus}` === '1' ? '在线' : `${item.deviceStatus}` === '0' ? '离线' : '未知', + upsMonitorDeviceStatusName: `${item.status}` === '0' ? '正常' : `${item.status}` === '1' ? '异常' : '未知', + params: '电池电压、电池电流...', + labName: listQuery.value.labName, // 所属实验室 } }) total.value = parseInt(response.data.total) @@ -308,6 +332,37 @@ + + + + + + + + + + + + + + + + + + + { typeList.value = response.data }) diff --git a/src/views/laboratory/equipment/list/list.vue b/src/views/laboratory/equipment/list/list.vue index a15545a..5f067db 100644 --- a/src/views/laboratory/equipment/list/list.vue +++ b/src/views/laboratory/equipment/list/list.vue @@ -23,6 +23,7 @@ deviceName: '', // 设备名称 deviceNo: '', // 设备编号 deviceStatus: '', // 在线状态(1在线0离线) + deviceType: '', // 设备类型 userId: '', // 负责人id(西昌组织下人员下拉选择) labName: user.lab, // 所属实验室 ids: [], @@ -33,6 +34,7 @@ const columns = ref([ { text: '设备编号', value: 'deviceNo', align: 'center', width: '160' }, { text: '设备名称', value: 'deviceName', align: 'center' }, + { text: '设备类型', value: 'deviceTypeName', align: 'center' }, { text: '安装地点', value: 'locationName', align: 'center' }, { text: '地点位置', value: 'locationPosition', align: 'center' }, { text: '所属实验室', value: 'locationLab', align: 'center' }, @@ -49,6 +51,7 @@ const useDeptList = ref([]) // 所属部门列表 const userList = ref<{ [key: string]: string }[]>([]) // 用户列表 const deviceStatusList = ref([]) as any // 在线状态 +const deviceTypeList = ref([]) as any // 设备类型 const deviceStatusMap = ref({}) as any // 在线状态 const deptPid = ref('') @@ -63,6 +66,10 @@ // // deptPid.value = '0' // }) + // 设备类型 + getDictByCode('deviceType').then((response) => { + deviceTypeList.value = response.data + }) // 获取用户列表 getUserList({ offset: 1, limit: 999999 }).then((res: any) => { userList.value = res.data.rows @@ -108,6 +115,7 @@ deptId: '', // 负责部门id(西昌组织下拉选择) deviceName: '', // 设备名称 deviceNo: '', // 设备编号 + deviceType: '', // 设备类型 deviceStatus: '', // 在线状态(1在线0离线) userId: '', // 负责人id(西昌组织下人员下拉选择) labName: user.lab, // 所属实验室 @@ -224,6 +232,7 @@ deviceStatus: listQuery.value.deviceStatus, // 在线状态(1在线0离线) userId: listQuery.value.userId, // 负责人id(西昌组织下人员下拉选择) labName: listQuery.value.labName, // 所属实验室 + deviceType: listQuery.value.deviceType, // 设备类型 offset: 1, limit: 20, ids: checkoutList.value, @@ -268,6 +277,17 @@ + + + + + { if (menuStore.sidebarMenus.length > 0) { router.replace({ path: menuStore.sidebarMenusFirstDeepestPath }) diff --git a/src/views/laboratory/data/list-interface.ts b/src/views/laboratory/data/list-interface.ts index fde23c3..9ed8845 100644 --- a/src/views/laboratory/data/list-interface.ts +++ b/src/views/laboratory/data/list-interface.ts @@ -87,6 +87,7 @@ uploadTime: string // 上传时间 userId: string // 负责人id userName: string // 负责人 + status?: number | string // ups监测状态 } // 列表请求参数 diff --git a/src/views/laboratory/data/list.vue b/src/views/laboratory/data/list.vue index 386b755..8db5f6e 100644 --- a/src/views/laboratory/data/list.vue +++ b/src/views/laboratory/data/list.vue @@ -27,7 +27,8 @@ electricQuantityList: ref([]), // 智能电量仪 oxygenList: ref([]), // 氧气传感器 smokeList: ref([]), // 烟雾传感器 - upsList: ref([]), // 烟雾传感器 + upsList: ref([]), // UPS电源间电池 + upsMonitorList: ref([]), // UPS监测 } const menu = ref([ // 菜单 { @@ -101,18 +102,38 @@ }, { id: 'ups', - name: 'UPS电源', + name: 'UPS电源间电池', columns: ref([ { text: '设备编号', value: 'deviceNo', align: 'center', width: '160' }, { text: '设备名称', value: 'deviceName', align: 'center' }, { text: '负责部门', value: 'deptName', align: 'center' }, { text: '负责人', value: 'userName', align: 'center' }, { text: '安装地点', value: 'locationName', align: 'center' }, + { text: '所属实验室', value: 'labName', align: 'center' }, + { text: '电压(V)', value: 'labName', align: 'center' }, + { text: '内阻(mΩ)', value: 'labName', align: 'center' }, + { text: '温度(℃)', value: 'labName', align: 'center' }, { text: '状态', value: 'deviceStatusName', align: 'center', styleFilter: (row: IUPSList) => { return `${row.deviceStatus}` === '0' ? 'color: red' : `${row.deviceStatus}` === '1' ? 'color: #00a846' : '' } }, { text: '上传时间', value: 'uploadTime', align: 'center', width: '180' }, ]), list: listMap.upsList, }, + { + id: 'ups/monitor', + name: 'UPS监测', + columns: ref([ + { text: '设备编号', value: 'deviceNo', align: 'center', width: '160' }, + { text: '设备名称', value: 'deviceName', align: 'center' }, + { text: '负责部门', value: 'deptName', align: 'center' }, + { text: '负责人', value: 'userName', align: 'center' }, + { text: '安装地点', value: 'locationName', align: 'center' }, + { text: '所属实验室', value: 'labName', align: 'center' }, + { text: '参数', value: 'params', align: 'center', width: '160' }, + { text: '状态', value: 'upsMonitorDeviceStatusName', align: 'center', styleFilter: (row: IUPSList) => { return `${row.status}` === '1' ? 'color: red' : `${row.status}` === '0' ? 'color: #00a846' : '' } }, + { text: '上传时间', value: 'uploadTime', align: 'center', width: '180' }, + ]), + list: listMap.upsMonitorList, + }, ]) const currentMenu = ref('temperatureHumidity') // 当前选中的菜单 const currentIndex = ref(0) // 当前选中的菜单索引 @@ -185,10 +206,13 @@ listQuery.value.offset = 1 } getDataList(listQuery.value, currentMenu.value).then((response) => { - menu.value[currentIndex.value].list = response.data.rows.map((item: { deviceStatus: string }) => { + menu.value[currentIndex.value].list = response.data.rows.map((item: { deviceStatus: string; status: string }) => { return { ...item, deviceStatusName: `${item.deviceStatus}` === '1' ? '在线' : `${item.deviceStatus}` === '0' ? '离线' : '未知', + upsMonitorDeviceStatusName: `${item.status}` === '0' ? '正常' : `${item.status}` === '1' ? '异常' : '未知', + params: '电池电压、电池电流...', + labName: listQuery.value.labName, // 所属实验室 } }) total.value = parseInt(response.data.total) @@ -308,6 +332,37 @@ + + + + + + + + + + + + + + + + + + + { typeList.value = response.data }) diff --git a/src/views/laboratory/equipment/list/list.vue b/src/views/laboratory/equipment/list/list.vue index a15545a..5f067db 100644 --- a/src/views/laboratory/equipment/list/list.vue +++ b/src/views/laboratory/equipment/list/list.vue @@ -23,6 +23,7 @@ deviceName: '', // 设备名称 deviceNo: '', // 设备编号 deviceStatus: '', // 在线状态(1在线0离线) + deviceType: '', // 设备类型 userId: '', // 负责人id(西昌组织下人员下拉选择) labName: user.lab, // 所属实验室 ids: [], @@ -33,6 +34,7 @@ const columns = ref([ { text: '设备编号', value: 'deviceNo', align: 'center', width: '160' }, { text: '设备名称', value: 'deviceName', align: 'center' }, + { text: '设备类型', value: 'deviceTypeName', align: 'center' }, { text: '安装地点', value: 'locationName', align: 'center' }, { text: '地点位置', value: 'locationPosition', align: 'center' }, { text: '所属实验室', value: 'locationLab', align: 'center' }, @@ -49,6 +51,7 @@ const useDeptList = ref([]) // 所属部门列表 const userList = ref<{ [key: string]: string }[]>([]) // 用户列表 const deviceStatusList = ref([]) as any // 在线状态 +const deviceTypeList = ref([]) as any // 设备类型 const deviceStatusMap = ref({}) as any // 在线状态 const deptPid = ref('') @@ -63,6 +66,10 @@ // // deptPid.value = '0' // }) + // 设备类型 + getDictByCode('deviceType').then((response) => { + deviceTypeList.value = response.data + }) // 获取用户列表 getUserList({ offset: 1, limit: 999999 }).then((res: any) => { userList.value = res.data.rows @@ -108,6 +115,7 @@ deptId: '', // 负责部门id(西昌组织下拉选择) deviceName: '', // 设备名称 deviceNo: '', // 设备编号 + deviceType: '', // 设备类型 deviceStatus: '', // 在线状态(1在线0离线) userId: '', // 负责人id(西昌组织下人员下拉选择) labName: user.lab, // 所属实验室 @@ -224,6 +232,7 @@ deviceStatus: listQuery.value.deviceStatus, // 在线状态(1在线0离线) userId: listQuery.value.userId, // 负责人id(西昌组织下人员下拉选择) labName: listQuery.value.labName, // 所属实验室 + deviceType: listQuery.value.deviceType, // 设备类型 offset: 1, limit: 20, ids: checkoutList.value, @@ -268,6 +277,17 @@ + + + + + { getLocationDetail(user.lab).then((res) => { + // =====================西昌========================== // 时间频率 const timeFrequencyRoomIndex = res.data.findIndex((item: { locationName: string }) => item.locationName === '西昌时间频率计量工作间') if (timeFrequencyRoomIndex !== -1) { @@ -362,6 +389,151 @@ electricalMetrologyRoom.value.humidity = `${res.data[electricalMetrologyRoomIndex].humidity}` ? `${res.data[electricalMetrologyRoomIndex].humidity}` : '-' electricalMetrologyRoom.value.voltage = `${res.data[electricalMetrologyRoomIndex].voltage}` ? `${res.data[electricalMetrologyRoomIndex].voltage}` : '-' } + + // ============================海口====================== + // 海口温度检定工作间 + const temperatureRoomHKIndex = res.data.findIndex((item: { locationName: string }) => item.locationName === '海口温度检定工作间') + if (receiveDispatchRoomIndex !== -1) { + temperatureRoomHK.value.temperature = `${res.data[temperatureRoomHKIndex].temperature}` ? `${res.data[temperatureRoomHKIndex].temperature}` : '-' + temperatureRoomHK.value.humidity = `${res.data[temperatureRoomHKIndex].humidity}` ? `${res.data[temperatureRoomHKIndex].humidity}` : '-' + temperatureRoomHK.value.voltage = `${res.data[temperatureRoomHKIndex].voltage}` ? `${res.data[temperatureRoomHKIndex].voltage}` : '-' + temperatureRoomHK.value.netWork = res.data[temperatureRoomHKIndex].airStatus === '关机' || res.data[temperatureRoomHKIndex].airStatus === '开机' + temperatureRoomHK.value.airConditioner = res.data[temperatureRoomHKIndex].airStatus + temperatureRoomHK.value.smokeStatus = res.data[temperatureRoomHKIndex].smokeStatus + } + + // 海口湿度检定工作间 + const humidityRoomHKIndex = res.data.findIndex((item: { locationName: string }) => item.locationName === '海口湿度检定工作间') + if (receiveDispatchRoomIndex !== -1) { + humidityRoomHK.value.temperature = `${res.data[humidityRoomHKIndex].temperature}` ? `${res.data[humidityRoomHKIndex].temperature}` : '-' + humidityRoomHK.value.humidity = `${res.data[humidityRoomHKIndex].humidity}` ? `${res.data[humidityRoomHKIndex].humidity}` : '-' + humidityRoomHK.value.voltage = `${res.data[humidityRoomHKIndex].voltage}` ? `${res.data[humidityRoomHKIndex].voltage}` : '-' + humidityRoomHK.value.netWork = res.data[humidityRoomHKIndex].airStatus === '关机' || res.data[humidityRoomHKIndex].airStatus === '开机' + humidityRoomHK.value.airConditioner = res.data[humidityRoomHKIndex].airStatus + } + + // 海口UPS电源间 + const UPSRoomHKIndex = res.data.findIndex((item: { locationName: string }) => item.locationName === '海口UPS电源间') + if (receiveDispatchRoomIndex !== -1) { + UPSRoomHK.value.temperature = `${res.data[UPSRoomHKIndex].temperature}` ? `${res.data[UPSRoomHKIndex].temperature}` : '-' + UPSRoomHK.value.humidity = `${res.data[UPSRoomHKIndex].humidity}` ? `${res.data[UPSRoomHKIndex].humidity}` : '-' + } + + // 海口档案间 + const FileRoomHKIndex = res.data.findIndex((item: { locationName: string }) => item.locationName === '海口档案间') + if (receiveDispatchRoomIndex !== -1) { + FileRoomHK.value.temperature = `${res.data[FileRoomHKIndex].temperature}` ? `${res.data[FileRoomHKIndex].temperature}` : '-' + FileRoomHK.value.humidity = `${res.data[FileRoomHKIndex].humidity}` ? `${res.data[FileRoomHKIndex].humidity}` : '-' + FileRoomHK.value.voltage = `${res.data[FileRoomHKIndex].voltage}` ? `${res.data[FileRoomHKIndex].voltage}` : '-' + FileRoomHK.value.netWork = res.data[FileRoomHKIndex].airStatus === '关机' || res.data[FileRoomHKIndex].airStatus === '开机' + FileRoomHK.value.airConditioner = res.data[FileRoomHKIndex].airStatus + } + + // 海口电磁学工作间1 + const electromagnetism1RoomHKIndex = res.data.findIndex((item: { locationName: string }) => item.locationName === '海口电磁学工作间1') + if (receiveDispatchRoomIndex !== -1) { + electromagnetism1RoomHK.value.temperature = `${res.data[electromagnetism1RoomHKIndex].temperature}` ? `${res.data[electromagnetism1RoomHKIndex].temperature}` : '-' + electromagnetism1RoomHK.value.humidity = `${res.data[electromagnetism1RoomHKIndex].humidity}` ? `${res.data[electromagnetism1RoomHKIndex].humidity}` : '-' + electromagnetism1RoomHK.value.voltage = `${res.data[electromagnetism1RoomHKIndex].voltage}` ? `${res.data[electromagnetism1RoomHKIndex].voltage}` : '-' + electromagnetism1RoomHK.value.netWork = res.data[electromagnetism1RoomHKIndex].airStatus === '关机' || res.data[electromagnetism1RoomHKIndex].airStatus === '开机' + electromagnetism1RoomHK.value.airConditioner = res.data[electromagnetism1RoomHKIndex].airStatus + } + + // 海口时间频率检定工作间1 + const timeFrequency1RoomHKIndex = res.data.findIndex((item: { locationName: string }) => item.locationName === '海口时间频率检定工作间1') + if (receiveDispatchRoomIndex !== -1) { + timeFrequency1RoomHK.value.temperature = `${res.data[timeFrequency1RoomHKIndex].temperature}` ? `${res.data[timeFrequency1RoomHKIndex].temperature}` : '-' + timeFrequency1RoomHK.value.humidity = `${res.data[timeFrequency1RoomHKIndex].humidity}` ? `${res.data[timeFrequency1RoomHKIndex].humidity}` : '-' + timeFrequency1RoomHK.value.voltage = `${res.data[timeFrequency1RoomHKIndex].voltage}` ? `${res.data[timeFrequency1RoomHKIndex].voltage}` : '-' + timeFrequency1RoomHK.value.netWork = res.data[timeFrequency1RoomHKIndex].airStatus === '关机' || res.data[timeFrequency1RoomHKIndex].airStatus === '开机' + timeFrequency1RoomHK.value.airConditioner = res.data[timeFrequency1RoomHKIndex].airStatus + } + + // 海口时间频率检定工作间2 + const timeFrequency2RoomHKIndex = res.data.findIndex((item: { locationName: string }) => item.locationName === '海口时间频率检定工作间2') + if (receiveDispatchRoomIndex !== -1) { + timeFrequency2RoomHK.value.temperature = `${res.data[timeFrequency2RoomHKIndex].temperature}` ? `${res.data[timeFrequency2RoomHKIndex].temperature}` : '-' + timeFrequency2RoomHK.value.humidity = `${res.data[timeFrequency2RoomHKIndex].humidity}` ? `${res.data[timeFrequency2RoomHKIndex].humidity}` : '-' + timeFrequency2RoomHK.value.voltage = `${res.data[timeFrequency2RoomHKIndex].voltage}` ? `${res.data[timeFrequency2RoomHKIndex].voltage}` : '-' + timeFrequency2RoomHK.value.netWork = res.data[timeFrequency2RoomHKIndex].airStatus === '关机' || res.data[timeFrequency2RoomHKIndex].airStatus === '开机' + timeFrequency2RoomHK.value.airConditioner = res.data[timeFrequency2RoomHKIndex].airStatus + } + + // 海口微波信号检定工作间1 + const microwaveSignal1RoomHKIndex = res.data.findIndex((item: { locationName: string }) => item.locationName === '海口微波信号检定工作间1') + if (receiveDispatchRoomIndex !== -1) { + microwaveSignal1RoomHK.value.temperature = `${res.data[microwaveSignal1RoomHKIndex].temperature}` ? `${res.data[microwaveSignal1RoomHKIndex].temperature}` : '-' + microwaveSignal1RoomHK.value.humidity = `${res.data[microwaveSignal1RoomHKIndex].humidity}` ? `${res.data[microwaveSignal1RoomHKIndex].humidity}` : '-' + microwaveSignal1RoomHK.value.voltage = `${res.data[microwaveSignal1RoomHKIndex].voltage}` ? `${res.data[microwaveSignal1RoomHKIndex].voltage}` : '-' + microwaveSignal1RoomHK.value.netWork = res.data[microwaveSignal1RoomHKIndex].airStatus === '关机' || res.data[microwaveSignal1RoomHKIndex].airStatus === '开机' + microwaveSignal1RoomHK.value.airConditioner = res.data[microwaveSignal1RoomHKIndex].airStatus + } + + // 海口仪器收发间 + const receiveDispatchRoomHKIndex = res.data.findIndex((item: { locationName: string }) => item.locationName === '海口仪器收发间') + if (receiveDispatchRoomIndex !== -1) { + receiveDispatchRoomHK.value.temperature = `${res.data[receiveDispatchRoomHKIndex].temperature}` ? `${res.data[receiveDispatchRoomHKIndex].temperature}` : '-' + receiveDispatchRoomHK.value.humidity = `${res.data[receiveDispatchRoomHKIndex].humidity}` ? `${res.data[receiveDispatchRoomHKIndex].humidity}` : '-' + receiveDispatchRoomHK.value.oxygenDensity = `${res.data[receiveDispatchRoomHKIndex].voltage}` ? `${res.data[receiveDispatchRoomHKIndex].oxygenDensity}` : '-' + } + + // 海口安全阀校验间 + const safetyValveRoomHKIndex = res.data.findIndex((item: { locationName: string }) => item.locationName === '海口安全阀校验间') + if (receiveDispatchRoomIndex !== -1) { + safetyValveRoomHK.value.temperature = `${res.data[safetyValveRoomHKIndex].temperature}` ? `${res.data[safetyValveRoomHKIndex].temperature}` : '-' + safetyValveRoomHK.value.humidity = `${res.data[safetyValveRoomHKIndex].humidity}` ? `${res.data[safetyValveRoomHKIndex].humidity}` : '-' + safetyValveRoomHK.value.oxygenDensity = `${res.data[safetyValveRoomHKIndex].voltage}` ? `${res.data[safetyValveRoomHKIndex].oxygenDensity}` : '-' + } + + // 海口压力检定工作间2 + const pressure2RoomHKIndex = res.data.findIndex((item: { locationName: string }) => item.locationName === '海口压力检定工作间2') + if (receiveDispatchRoomIndex !== -1) { + pressure2RoomHK.value.temperature = `${res.data[pressure2RoomHKIndex].temperature}` ? `${res.data[pressure2RoomHKIndex].temperature}` : '-' + pressure2RoomHK.value.humidity = `${res.data[pressure2RoomHKIndex].humidity}` ? `${res.data[pressure2RoomHKIndex].humidity}` : '-' + pressure2RoomHK.value.voltage = `${res.data[pressure2RoomHKIndex].voltage}` ? `${res.data[pressure2RoomHKIndex].voltage}` : '-' + pressure2RoomHK.value.netWork = res.data[pressure2RoomHKIndex].airStatus === '关机' || res.data[pressure2RoomHKIndex].airStatus === '开机' + pressure2RoomHK.value.airConditioner = res.data[pressure2RoomHKIndex].airStatus + } + + // 海口压力检定工作间1 + const pressure1RoomHKIndex = res.data.findIndex((item: { locationName: string }) => item.locationName === '海口压力检定工作间1') + if (receiveDispatchRoomIndex !== -1) { + pressure1RoomHK.value.temperature = `${res.data[pressure1RoomHKIndex].temperature}` ? `${res.data[pressure1RoomHKIndex].temperature}` : '-' + pressure1RoomHK.value.humidity = `${res.data[pressure1RoomHKIndex].humidity}` ? `${res.data[pressure1RoomHKIndex].humidity}` : '-' + pressure1RoomHK.value.voltage = `${res.data[pressure1RoomHKIndex].voltage}` ? `${res.data[pressure1RoomHKIndex].voltage}` : '-' + pressure1RoomHK.value.netWork = res.data[pressure1RoomHKIndex].airStatus === '关机' || res.data[pressure1RoomHKIndex].airStatus === '开机' + pressure1RoomHK.value.airConditioner = res.data[pressure1RoomHKIndex].airStatus + } + + // 海口电磁学工作间2 + const electromagnetism2RoomHKIndex = res.data.findIndex((item: { locationName: string }) => item.locationName === '海口电磁学工作间2') + if (receiveDispatchRoomIndex !== -1) { + electromagnetism2RoomHK.value.temperature = `${res.data[electromagnetism2RoomHKIndex].temperature}` ? `${res.data[electromagnetism2RoomHKIndex].temperature}` : '-' + electromagnetism2RoomHK.value.humidity = `${res.data[electromagnetism2RoomHKIndex].humidity}` ? `${res.data[electromagnetism2RoomHKIndex].humidity}` : '-' + electromagnetism2RoomHK.value.voltage = `${res.data[electromagnetism2RoomHKIndex].voltage}` ? `${res.data[electromagnetism2RoomHKIndex].voltage}` : '-' + electromagnetism2RoomHK.value.netWork = res.data[electromagnetism2RoomHKIndex].airStatus === '关机' || res.data[electromagnetism2RoomHKIndex].airStatus === '开机' + electromagnetism2RoomHK.value.airConditioner = res.data[electromagnetism2RoomHKIndex].airStatus + } + + // 海口质量检定工作间 + const qualityArbitrationRoomHKIndex = res.data.findIndex((item: { locationName: string }) => item.locationName === '海口质量检定工作间') + if (receiveDispatchRoomIndex !== -1) { + qualityArbitrationRoomHK.value.temperature = `${res.data[qualityArbitrationRoomHKIndex].temperature}` ? `${res.data[qualityArbitrationRoomHKIndex].temperature}` : '-' + qualityArbitrationRoomHK.value.humidity = `${res.data[qualityArbitrationRoomHKIndex].humidity}` ? `${res.data[qualityArbitrationRoomHKIndex].humidity}` : '-' + qualityArbitrationRoomHK.value.voltage = `${res.data[qualityArbitrationRoomHKIndex].voltage}` ? `${res.data[qualityArbitrationRoomHKIndex].voltage}` : '-' + qualityArbitrationRoomHK.value.netWork = res.data[qualityArbitrationRoomHKIndex].airStatus === '关机' || res.data[qualityArbitrationRoomHKIndex].airStatus === '开机' + qualityArbitrationRoomHK.value.airConditioner = res.data[qualityArbitrationRoomHKIndex].airStatus + } + + // 海口备品备件库 + const spareRoomHKIndex = res.data.findIndex((item: { locationName: string }) => item.locationName === '海口备品备件库') + if (receiveDispatchRoomIndex !== -1) { + spareRoomHK.value.temperature = `${res.data[spareRoomHKIndex].temperature}` ? `${res.data[spareRoomHKIndex].temperature}` : '-' + spareRoomHK.value.humidity = `${res.data[spareRoomHKIndex].humidity}` ? `${res.data[spareRoomHKIndex].humidity}` : '-' + spareRoomHK.value.voltage = `${res.data[spareRoomHKIndex].voltage}` ? `${res.data[spareRoomHKIndex].voltage}` : '-' + spareRoomHK.value.netWork = res.data[spareRoomHKIndex].airStatus === '关机' || res.data[spareRoomHKIndex].airStatus === '开机' + spareRoomHK.value.airConditioner = res.data[spareRoomHKIndex].airStatus + } }) } @@ -406,9 +578,97 @@
-
- - +
+
+ + + + +
+ {{ spareRoomHK.airConditioner }} +
+ + + + +
+ {{ electromagnetism2RoomHK.airConditioner }} +
+ + + + +
+ {{ qualityArbitrationRoomHK.airConditioner }} +
+ + + + +
+ {{ pressure1RoomHK.airConditioner }} +
+ + + + +
+ {{ pressure2RoomHK.airConditioner }} +
+ + + + +
+ {{ timeFrequency1RoomHK.airConditioner }} +
+ + + + +
+ {{ microwaveSignal1RoomHK.airConditioner }} +
+ + + + +
+ {{ timeFrequency2RoomHK.airConditioner }} +
+ + + + +
+ {{ electromagnetism1RoomHK.airConditioner }} +
+ + + + +
+ {{ FileRoomHK.airConditioner }} +
+ + + + +
+ {{ temperatureRoomHK.airConditioner }} +
+ + + + + + +
+ {{ humidityRoomHK.airConditioner }} +
+ + +
@@ -643,7 +903,7 @@ /> - + /> --> + + + + +