|
@@ -167,7 +167,6 @@
|
|
|
]" />
|
|
|
|
|
|
</template>
|
|
|
-
|
|
|
<template #filterCell="{ column, record }">
|
|
|
<template v-if="deviceType.startsWith('gate')">
|
|
|
<template v-if="record.frontGateOpenCtrl == 1 || record.frontGateOpenCtrl === true">
|
|
@@ -408,7 +407,7 @@ const onSelect: TreeProps['onSelect'] = (keys, e) => {
|
|
|
dataSource.value = []
|
|
|
activeKey.value = '1'
|
|
|
timer = null
|
|
|
- getMonitor()
|
|
|
+ getMonitor(true)
|
|
|
}, 200)
|
|
|
};
|
|
|
|
|
@@ -457,7 +456,7 @@ async function getDeviceType() {
|
|
|
|
|
|
// https获取监测数据
|
|
|
let timer: null | NodeJS.Timeout = undefined;
|
|
|
-function getMonitor() {
|
|
|
+function getMonitor(flag?) {
|
|
|
if (deviceType.value) {
|
|
|
if (timer) timer = null
|
|
|
if (Object.prototype.toString.call(timer) === '[object Null]') {
|
|
@@ -466,7 +465,7 @@ function getMonitor() {
|
|
|
if (timer) {
|
|
|
getMonitor();
|
|
|
}
|
|
|
- }, 1000);
|
|
|
+ }, flag ? 0 : 1000);
|
|
|
}
|
|
|
}
|
|
|
};
|
|
@@ -509,7 +508,6 @@ async function getDataSource() {
|
|
|
} else {
|
|
|
let res = null
|
|
|
if(systemID.value){
|
|
|
-
|
|
|
res = await list({ devicetype: 'sys', types: deviceType.value, systemID: systemID.value })
|
|
|
if (res && res.msgTxt) {
|
|
|
const result = res.msgTxt;
|
|
@@ -536,11 +534,18 @@ async function getDataSource() {
|
|
|
})
|
|
|
}
|
|
|
}else{
|
|
|
- const formData = monitorTable.value.getForm()
|
|
|
- const searchForm = formData.getFieldsValue()
|
|
|
- res = await list({ devicetype: deviceType.value, pagetype: 'normal', filterParams: { ...searchForm } })
|
|
|
- if (res && res.msgTxt) {
|
|
|
- const result = res.msgTxt[0];
|
|
|
+ let resultData, searchForm;
|
|
|
+ if(monitorTable.value){
|
|
|
+ // 安全监控
|
|
|
+ const formData = monitorTable.value.getForm()
|
|
|
+ searchForm = formData.getFieldsValue()
|
|
|
+ resultData = await list({ devicetype: deviceType.value, pagetype: 'normal', filterParams: { ...searchForm } })
|
|
|
+ }else{
|
|
|
+ // 非安全监控
|
|
|
+ resultData = await list({ devicetype: deviceType.value, pagetype: 'normal'})
|
|
|
+ }
|
|
|
+ if (resultData && resultData.msgTxt) {
|
|
|
+ const result = resultData.msgTxt[0];
|
|
|
if(result){
|
|
|
const data = result['datalist'].filter((data: any) => {
|
|
|
const readData = data.readData;
|
|
@@ -550,7 +555,6 @@ async function getDataSource() {
|
|
|
const resultData = <any[]>[]
|
|
|
// 如果是安全监控的数据时需要过滤常见设备数据,根据设定的常用安全监控字典去匹配
|
|
|
const dictCodes = getDictItemsByCode('safetynormal')
|
|
|
-
|
|
|
if (!searchForm['dataTypeName'] && dictCodes && dictCodes.length) {
|
|
|
for (let i = 0; i < dictCodes.length; i++) {
|
|
|
const dict = dictCodes[i]
|
|
@@ -574,7 +578,6 @@ async function getDataSource() {
|
|
|
dataSource.value = []
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -604,10 +607,10 @@ function goDetail(record?) {
|
|
|
const newPage = router.resolve({ path: '/monitorChannel/monitor-windrect', query: { id: activeID.value } })
|
|
|
window.open(newPage.href, '_blank')
|
|
|
} else if (deviceType.value.indexOf("fanmain") != -1) {
|
|
|
- const newPage = router.resolve({ path: '/monitorChannel/monitor-fan-main', query: { id: activeID.value } })
|
|
|
+ const newPage = router.resolve({ path: '/monitorChannel/monitor-fanmain', query: { id: activeID.value } })
|
|
|
window.open(newPage.href, '_blank')
|
|
|
} else if (deviceType.value.indexOf("fanlocal") != -1) {
|
|
|
- const newPage = router.resolve({ path: '/monitorChannel/monitor-fan-local', query: { id: activeID.value } })
|
|
|
+ const newPage = router.resolve({ path: '/monitorChannel/monitor-fanlocal', query: { id: activeID.value } })
|
|
|
window.open(newPage.href, '_blank')
|
|
|
} else if (deviceType.value.indexOf("pulping") != -1) {
|
|
|
const newPage = router.resolve({ path: '/grout-home', query: { id: activeID.value } })
|
|
@@ -670,7 +673,6 @@ function toHome() {
|
|
|
}
|
|
|
|
|
|
async function findTreeDataValue(obj) {
|
|
|
- debugger
|
|
|
const findDeviceType = (data: [], obj) => {
|
|
|
let type = ''
|
|
|
if (obj.deviceid) {
|
|
@@ -709,7 +711,7 @@ async function findTreeDataValue(obj) {
|
|
|
if (timer === undefined) {
|
|
|
timer = null
|
|
|
await getDataSource()
|
|
|
- getMonitor()
|
|
|
+ getMonitor(true)
|
|
|
}
|
|
|
}
|
|
|
|