Browse Source

[Mod 0000] 传感器新增设备类型字典配置功能;风窗新增前后窗共同控制的功能

hongrunxia 2 days ago
parent
commit
d3d5c71dd8

BIN
public/video/fanLocal.webm


+ 1 - 5
src/views/vent/monitorManager/deviceCameraMonitor/index.vue

@@ -228,7 +228,6 @@ import HandlerHistoryTable from '../comment/HandlerHistoryTable.vue';
 import MonitorTable from '../comment/MonitorTable.vue';
 import GroupMonitorTable from '../comment/GroupMonitorTable.vue';
 import { message, Progress, } from 'ant-design-vue';
-import { getActions } from '/@/qiankun/state';
 import { useRouter } from 'vue-router';
 import { setDivHeight } from '/@/utils/event';
 import { render } from '/@/utils/common/renderUtils';
@@ -238,7 +237,6 @@ import {
   noWarningArr,
   surfaceChartsColumns,
   noHistoryArr,
-  noLocationArr,
 } from './device.data';
 import { getDictItemsByCode } from '/@/utils/dict';
 import BarAndLine from '/@/components/chart/BarAndLine.vue';
@@ -258,8 +256,6 @@ const props = defineProps({
     default: () => { },
   },
 });
-const { handleExportXls } = useMethods();
-const go = useGo();
 const echatsOption = {
   grid: {
     top: '35',
@@ -567,7 +563,7 @@ const handleOK = (passWord, handlerState, value) => {
     devicetype: selectData.value.deviceType,
     paramcode: handlerState,
     password: passWord || globalConfig?.simulatedPassword,
-    value: value,
+    value: value ? value : null,
   };
   deviceControlApi(data)
     .then((res) => {

+ 2 - 3
src/views/vent/monitorManager/deviceMonitor/components/device/device.data.ts

@@ -496,7 +496,7 @@ export const vehicleFormConfig = {
     span: 4,
   },
 };
-
+const { sysOrgCode } = useGlobSetting();
 export const noDetailArr = ['nitrogen', 'forcFan']; // 前端详情的,
 // 棋盘井球阀监测数据只有温度
 export const haveDetailArr = [
@@ -549,11 +549,10 @@ export const noWarningArr = [
 ]; // 无预警详情的
 export const haveSysDetailArr = ['forcFan', 'pulping']; //有场景详情的
 
-export const haveHistoryEcharts = ['majorpath', 'gasmonitor']; // 有历史曲线的
+export const haveHistoryEcharts = sysOrgCode === 'sdmtjtbdmk' ? ['majorpath', 'gasmonitor'] : ['majorpath']; // 有历史曲线的
 // export const haveSysDetailArr = ['']; //有场景详情的
 // 无定位
 export const noLocationArr = () => {
-  const { sysOrgCode } = useGlobSetting();
   if (sysOrgCode === 'sdmtjtcctrk') {
     return ['location', 'vehicle'];
   } else {

+ 17 - 6
src/views/vent/monitorManager/sensorMonitor/index.vue

@@ -9,7 +9,7 @@
               <Select
                 @change="handleSensorChange"
                 :options="deviceTypeOption"
-                :fieldNames="{ label: 'itemText', value: 'itemValue' }"
+                :fieldNames="{ label: 'label', value: 'value' }"
                 v-model:value="deviceKind"
                 style="width: 200px; margin-bottom: 5px; color: black"
                 placeholder="请选择设备类型"
@@ -101,7 +101,7 @@
 <script setup lang="ts">
   import BarAndLine from '/@/components/chart/BarAndLine.vue';
   import { Select } from 'ant-design-vue';
-  import { onBeforeMount, ref, onMounted, onUnmounted, toRaw, reactive, nextTick } from 'vue';
+  import { onBeforeMount, ref, onMounted, onUnmounted, toRaw, reactive, nextTick, unref } from 'vue';
   import MonitorTable from '../comment/MonitorTable.vue';
   import HistoryTable from '../comment/HistoryTable.vue';
   import AlarmHistoryTable from '../comment/AlarmHistoryTable.vue';
@@ -111,6 +111,10 @@
   import { cloneDeep } from 'lodash-es';
   import { useMethods } from '/@/hooks/system/useMethods';
   import { useGlobSetting } from '/@/hooks/setting';
+  import { useRouter } from 'vue-router';
+  import { getDictItemsByCode } from '/@/utils/dict';
+
+  const router = useRouter();
   const { sysOrgCode } = useGlobSetting();
   const { exportXlsPostBlob } = useMethods();
   const SensorMonitorRef = ref();
@@ -289,10 +293,17 @@
   });
 
   onMounted(async () => {
-    const res = await deviceList({ devicetype: 'modelsensor' });
-    const obj = res.find((item) => item.itemValue === 'modelsensor');
-    deviceTypeOption.value = obj ? obj.children : [];
-    deviceKind.value = deviceTypeOption.value[0]['itemValue'] || 'modelsensor_monitor';
+    let dictName = 'modelsensorkind';
+    const route = unref(router.currentRoute);
+    if (route.name) {
+      const nameStrList = route.name.split('-');
+      if (nameStrList.length > 0 && nameStrList[nameStrList.length - 1] !== 'sensorMonitor') {
+        dictName = nameStrList[nameStrList.length - 1];
+      }
+    }
+    const res = getDictItemsByCode(dictName);
+    deviceTypeOption.value = res;
+    deviceKind.value = deviceTypeOption.value[0]['value'];
     handleChange(deviceKind.value);
     await getMonitor(true);
   });

+ 25 - 1
src/views/vent/monitorManager/windowMonitor/index.vue

@@ -45,6 +45,7 @@
           <div v-if="hasPermission('window:showAngle')" class="button-box" @click="setAngle(1)">设定风窗角度</div>
           <div v-if="hasPermission('window:showAngleArea')" class="button-box" @click="setAngle(1)">设定风窗面积</div>
         </div>
+        <div v-if="hasPermission('window:sameSet')" class="button-box" @click="setControl('sameSetValue', '风窗面积设置')">设定风窗面积</div>
       </div>
       <div class="top-right row">
         <div v-if="hasPermission('window:zhldkz')" class="button-box" @click="setControl('autoRun', '开启自主调控')">开启自主调控</div>
@@ -454,7 +455,7 @@
     modalIsShow.value = true;
   };
 
-  const handleOK = (passWord, handlerState, value) => {
+  const handleOK = async (passWord, handlerState, value) => {
     if (!passWord && !globalConfig?.simulatedPassword) {
       message.warning('请输入密码!');
       return;
@@ -518,6 +519,29 @@
           }
         });
       }
+    } else if (handlerState == 'sameSetValue') {
+      const data1 = {
+        deviceid: selectData.value.deviceID,
+        devicetype: selectData.value.deviceType,
+        paramcode: 'frontSetValue',
+        password: passWord || globalConfig?.simulatedPassword,
+        value: null,
+      };
+      const data2 = {
+        deviceid: selectData.value.deviceID,
+        devicetype: selectData.value.deviceType,
+        paramcode: 'rearSetValue',
+        password: passWord || globalConfig?.simulatedPassword,
+        value: null,
+      };
+      const res1 = await deviceControlApi(data1);
+      const res2 = await deviceControlApi(data2);
+      if (res1.success && res2.success) {
+        message.success('指令已下发成功!');
+      } else {
+        message.error(res1.message);
+      }
+      handleCancel();
     } else {
       if (handlerState == 1 || handlerState == 2) {
         windowAngle.value = value;