Forráskód Böngészése

监控看板调整

Zimo 8 órája
szülő
commit
c5ac34f718

+ 15 - 15
src/views/oli-connection/monitoring-board/chart.vue

@@ -88,21 +88,21 @@ watch(isConnected, (newVal) => {
   if (newVal) {
     // subscribe(`/636/${props.deviceCode}/property/post`)
 
-    switch (props.deviceCode) {
-      case 'YF1539':
-        subscribe(`/656/${props.deviceCode}/property/post`)
-      case 'YF325':
-      case 'YF288':
-      case 'YF671':
-      case 'YF459':
-        subscribe(`/635/${props.deviceCode}/property/post`)
-      case 'YF649':
-        subscribe(`/636/${props.deviceCode}/property/post`)
-      default:
-        subscribe(`/636/${props.deviceCode}/property/post`)
-    }
-
-    // subscribe(props.mqttUrl)
+    // switch (props.deviceCode) {
+    //   case 'YF1539':
+    //     subscribe(`/656/${props.deviceCode}/property/post`)
+    //   case 'YF325':
+    //   case 'YF288':
+    //   case 'YF671':
+    //   case 'YF459':
+    //     subscribe(`/635/${props.deviceCode}/property/post`)
+    //   case 'YF649':
+    //     subscribe(`/636/${props.deviceCode}/property/post`)
+    //   default:
+    //     subscribe(`/636/${props.deviceCode}/property/post`)
+    // }
+
+    subscribe(props.mqttUrl)
     // subscribe('/636/YF649/property/post')
   }
 })

+ 12 - 7
src/views/oli-connection/monitoring-board/index.vue

@@ -94,22 +94,22 @@ async function loadDeviceOptions() {
 
   deviceLoading.value = true
   try {
-    // const data = await IotDeviceApi.getBoardDevice({
-    //   deptId: deviceQuery.value.deptId,
-    //   ifInline: deviceQuery.value.ifInline,
-    //   pageSize: 100
-    // })
-    const data = await IotDeviceApi.getIotDeviceTdPage({
+    const data = await IotDeviceApi.getBoardDevice({
       deptId: deviceQuery.value.deptId,
       ifInline: deviceQuery.value.ifInline,
       pageSize: 100
     })
+    // const data = await IotDeviceApi.getIotDeviceTdPage({
+    //   deptId: deviceQuery.value.deptId,
+    //   ifInline: deviceQuery.value.ifInline,
+    //   pageSize: 100
+    // })
     deviceOptions.value = data.list.map((item: any) => ({
       label: item.deviceCode + '-' + item.deviceName,
       value: item.id,
       raw: item
     }))
-    // query.value.deviceIds = deviceOptions.value.map(i => i.value)
+    handleDeviceChange(deviceOptions.value.filter((i) => i.raw.ifInline === 3).map((i) => i.value))
   } catch (error) {
     deviceOptions.value = []
   } finally {
@@ -166,6 +166,10 @@ function handleRest() {
   loadDeptOptions()
   loadDeviceOptions()
 }
+
+function handleInlineChange() {
+  loadDeviceOptions()
+}
 </script>
 
 <template>
@@ -239,6 +243,7 @@ function handleRest() {
             popper-class="poper"
             class="w-full"
             :class="{ selected: Boolean(deviceQuery.ifInline) }"
+            @change="handleInlineChange"
           >
             <el-option
               v-for="dict in getStrDictOptions(DICT_TYPE.IOT_DEVICE_STATUS)"