Browse Source

Merge branch 'master' of http://182.92.126.35:3000/hrx/mky-vent-base

lxh 6 ngày trước cách đây
mục cha
commit
75df2179e1

BIN
public/video/fanLocal.webm


+ 11 - 0
src/router/routes/basic.ts

@@ -76,6 +76,17 @@ export const QIANKUN_ROUTE: AppRouteRecordRaw = {
       ver: '1',
     },
     {
+      path: '/micro-vent-3dModal/gas-pipe-net/home',
+      name: 'gas-pipe-net-home',
+      component: () => import('/@/views/vent/gas/gasPipeNet/index.vue'),
+      meta: {
+        title: '瓦斯管网监测',
+        hideBreadcrumb: true,
+        hideMenu: true,
+      },
+      ver: '1',
+    },
+    {
       path: '/micro-vent-3dModal/dashboard/analysis',
       name: 'micro-vent-3dModal-dashboard-analysis',
       component: () => import('/@/views/vent/monitorManager/deviceMonitor/index.vue'),

+ 2 - 2
src/views/vent/gas/components/list/listItem.vue

@@ -14,9 +14,9 @@
         <!-- 输入框 -->
         <div v-if="type === 'input'">
           <div class="list-item__set">
-            <div class="list-item__monitor_val">{{ value }}</div>
+            <!-- <div class="list-item__monitor_val">{{ value }}</div> -->
             <Input class="list-item__set_val" :bordered="true" :value="value" @update:value="$emit('update:value', $event)" />
-            <div class="list-item__set_button">设置</div>
+            <!-- <div class="list-item__set_button">设置</div> -->
           </div>
         </div>
         <div v-if="type === 'inputSet'">

+ 2 - 2
src/views/vent/gas/gasHome/index.vue

@@ -34,7 +34,7 @@
       window.open(newPage.href, '_blank');
     }
     if (activeValue == 'gasPiping') {
-      const newPage = router.resolve({ path: '/gas-pipe-net/home' });
+      const newPage = router.resolve({ path: '/micro-vent-3dModal/gas-pipe-net/home?type=sysMonitor&deviceType=pipingpage' });
       window.open(newPage.href, '_blank');
     }
     if (activeValue == 'gasAlarm') {
@@ -42,7 +42,7 @@
       window.open(newPage.href, '_blank');
     }
     if (activeValue == 'drillDesign') {
-      const newPage = router.resolve({ path: '/gas-pipe-net/home' });
+      const newPage = router.resolve({ path: '/micro-vent-3dModal/modelchannel/model3D/home?type=model3D&deviceType=model3D&kind=drillset' });
       window.open(newPage.href, '_blank');
     }
   }

+ 45 - 2
src/views/vent/gas/gasPipeNet/index.vue

@@ -15,7 +15,7 @@
       :device-type="cfg.deviceType"
       :data="pumpDataSource"
       :visible="true"
-      :style="{ zIndex: 3 }"
+      :style="{ zIndex: 1 }"
     />
     <div class="scene-box">
       <div class="bottom-tabs-box" @mousedown="setDivHeight($event, 175, scroll, 0)">
@@ -39,6 +39,10 @@
                   <TableAction
                     :actions="[
                       {
+                        label: '控制',
+                        onClick: () => controlHandler(record),
+                      },
+                      {
                         label: '定位',
                         onClick: goLocation.bind(null, record),
                       },
@@ -69,13 +73,16 @@
         </DvBorderBox8>
       </div>
     </div>
+    <BasicModal @register="registerModal" @ok="submitHandler">
+      <BasicForm @register="registerForm" />
+    </BasicModal>
   </div>
 </template>
 
 <script setup lang="ts">
   import CustomHeader from '/@/components/vent/customHeader.vue';
   import { setDivHeight } from '/@/utils/event';
-  import { onMounted, ref } from 'vue';
+  import { onMounted, ref, nextTick } from 'vue';
   import { BorderBox8 as DvBorderBox8 } from '@kjgl77/datav-vue3';
   import ModuleCommon from '../../home/configurable/components/ModuleCommon.vue';
   import { moduleConfigs } from './gasPipeNet.data';
@@ -86,6 +93,9 @@
   import { get } from 'lodash-es';
   import { getActions } from '/@/qiankun/state';
   import { TableAction } from '/@/components/Table';
+  import { BasicModal, useModal } from '/@/components/Modal';
+  import { BasicForm, useForm } from '/@/components/Form';
+  import { message } from 'ant-design-vue';
 
   const scroll = ref<{ x: true; y: number }>({ x: true, y: 202 });
   const activeKey = ref('1');
@@ -105,11 +115,44 @@
   }
 
   const actions = getActions();
+
   function goLocation(record) {
     // debugger;
     actions.setGlobalState({ locationId: record.deviceID, locationObj: null, pageObj: null });
   }
 
+  const [registerModal, { openModal, closeModal }] = useModal();
+  const [registerForm, { setFieldsValue, validate }] = useForm({
+    showActionButtonGroup: false,
+    schemas: [
+      {
+        label: '开度',
+        component: 'Input',
+        field: 'degree',
+      },
+      {
+        label: '密码',
+        component: 'InputPassword',
+        field: 'pwd',
+        required: true,
+      },
+    ],
+  });
+
+  function submitHandler() {
+    validate().then((val) => {
+      message.success('VAL:' + JSON.stringify(val));
+      closeModal();
+    });
+  }
+
+  function controlHandler(record) {
+    openModal();
+    nextTick(() => {
+      setFieldsValue(record);
+    });
+  }
+
   onMounted(() => {
     getSysDataSource();
   });

+ 38 - 25
src/views/vent/monitorManager/comment/GasPipeTable.vue

@@ -7,14 +7,15 @@
     :isShowActionColumn="true"
     :isShowSelect="false"
     title="设备监测"
-    :scroll="{ y: scroll.y - 30 }"
+    :scroll="{ y: scroll.y - 60 }"
   >
     <template #action="{ record }">
       <TableAction
         :actions="[
           {
+            ifShow: () => showDetailButton,
             label: '详情',
-            onClick: (e) => deviceEdit(e, 'reportInfo', record),
+            onClick: () => $emit('detail', record),
           },
           {
             label: '定位',
@@ -40,62 +41,74 @@
       <a-tag v-if="column.dataIndex === 'netStatus'" :color="record.netStatus == '0' ? '#f00' : 'green'">
         {{ record.netStatus == '0' ? '断开' : '连接' }}
       </a-tag>
+      <span v-if="column.dataIndex === 'isLeakage'" :color="record.isLeakage == '0' ? 'green' : '#f00'">
+        {{ record.isLeakage == '0' ? '未泄露' : `${record.ld_x}m处泄露` }}
+      </span>
     </template>
   </MonitorTable>
-  <DeviceBaseInfo @register="registerModal" device-type="gaspipe" />
+  <!-- <DeviceBaseInfo @register="registerModal" device-type="gaspipe" /> -->
 </template>
 
 <script lang="ts" setup>
   import MonitorTable from './MonitorTable.vue';
-  import DeviceBaseInfo from './components/DeviceBaseInfo.vue';
+  // import DeviceBaseInfo from './components/DeviceBaseInfo.vue';
   import { TableAction } from '/@/components/Table';
-  import { useModal } from '/@/components/Modal';
+  // import { useModal } from '/@/components/Modal';
   import { onMounted } from 'vue';
   import { getGasDeviceInfo } from './comment.api';
   import { gasPipeColumns } from './comment.data';
   import { ref } from 'vue';
   import { forEach, get } from 'lodash-es';
 
-  defineProps<{
-    scroll: { y: number };
-  }>();
+  withDefaults(
+    defineProps<{
+      scroll: { y: number };
+      showDetailButton?: boolean;
+    }>(),
+    {
+      showDetailButton: false,
+    }
+  );
 
-  defineEmits(['locate']);
+  defineEmits(['locate', 'detail']);
 
-  const [registerModal, { openModal }] = useModal();
+  // const [registerModal, { openModal }] = useModal();
 
-  function deviceEdit(e: Event, type: string, record) {
-    e.stopPropagation();
-    openModal(true, {
-      type,
-      deviceId: record['deviceID'],
-    });
-  }
+  // function deviceEdit(e: Event, type: string, record) {
+  //   e.stopPropagation();
+  //   openModal(true, {
+  //     type,
+  //     deviceId: record['deviceID'],
+  //   });
+  // }
 
   const dataSource = ref<any[]>([]);
 
   function getDataSource() {
     getGasDeviceInfo({ devicetype: 'gasmonitor', pagetype: 'normal' }).then((res) => {
       dataSource.value = get(res, 'msgTxt[0].datalist', []).map((e) => {
-        const item = {};
         const start = {
           ...e.start.readData,
-          strinstallpos: e.start.strinstallpos,
+          ...e.start,
           readData: null,
         };
         const end = {
           ...e.end.readData,
-          strinstallpos: e.end.strinstallpos,
+          ...e.end,
           readData: null,
         };
-        forEach(start, (val, key) => {
-          item[`${key}_start`] = val;
-        });
+        const gasGlFaultDia = JSON.parse(e.gasGlFaultDia);
+
         forEach(end, (val, key) => {
-          item[`${key}_end`] = val;
+          end[`${key}_end`] = val;
+          delete end[key];
         });
 
-        return item;
+        return {
+          ...start,
+          ...end,
+          ...gasGlFaultDia,
+        };
       });
     });
   }

+ 25 - 30
src/views/vent/monitorManager/comment/comment.data.ts

@@ -1071,59 +1071,54 @@ export const gasPipeColumns: BasicColumn[] = [
     children: [
       {
         title: '管道位置',
-        dataIndex: 'strinstallpos_start',
-        key: 'strinstallpos_start',
+        dataIndex: 'strinstallpos',
+        key: 'strinstallpos',
       },
       {
         title: '二氧化碳(%)',
-        dataIndex: 'co2val_start',
-        key: 'co2val_start',
+        dataIndex: 'co2val',
+        key: 'co2val',
       },
       {
         title: '一氧化碳(%)',
-        dataIndex: 'coval_start',
-        key: 'coval_start',
+        dataIndex: 'coval',
+        key: 'coval',
       },
       // {
       //   title: '负压(Pa)',
-      //   dataIndex: 'fyVal_start',
-      //   key: 'fyVal_start',
+      //   dataIndex: 'fyVal',
+      //   key: 'fyVal',
       // },
       // {
       //   title: '瓦斯抽采浓度(%)',
-      //   dataIndex: 'gasC_start',
-      //   key: 'gasC_start',
+      //   dataIndex: 'gasC',
+      //   key: 'gasC',
       // },
       // {
       //   title: '瓦斯抽采混量',
-      //   dataIndex: 'gasMixMass_start',
-      //   key: 'gasMixMass_start',
+      //   dataIndex: 'gasMixMass',
+      //   key: 'gasMixMass',
       // },
       // {
       //   title: '瓦斯抽采纯量',
-      //   dataIndex: 'gasMass_start',
-      //   key: 'gasMass_start',
+      //   dataIndex: 'gasMass',
+      //   key: 'gasMass',
       // },
       {
         title: '累计抽采量',
-        dataIndex: 'gasTotalMass_start',
-        key: 'gasTotalMass_start',
+        dataIndex: 'gasTotalMass',
+        key: 'gasTotalMass',
       },
       {
         title: '管道流量',
-        dataIndex: 'gdlyVal_start',
-        key: 'gdlyVal_start',
+        dataIndex: 'gdlyVal',
+        key: 'gdlyVal',
       },
       {
         title: '管道绝对温度',
-        dataIndex: 'gdjdwdVal_start',
-        key: 'gdjdwdVal_start',
+        dataIndex: 'gdjdwdVal',
+        key: 'gdjdwdVal',
       },
-      // {
-      //   title: '是否泄露',
-      //   dataIndex: 'isLeakage_start',
-      //   key: 'isLeakage_start',
-      // },
     ],
   },
   {
@@ -1179,11 +1174,11 @@ export const gasPipeColumns: BasicColumn[] = [
         dataIndex: 'gdjdwdVal_end',
         key: 'gdjdwdVal_end',
       },
-      // {
-      //   title: '是否泄露',
-      //   dataIndex: 'isLeakage_end',
-      //   key: 'isLeakage_end',
-      // },
     ],
   },
+  {
+    title: '是否泄露',
+    dataIndex: 'isLeakage',
+    key: 'isLeakage',
+  },
 ];

+ 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

@@ -499,7 +499,7 @@ export const vehicleFormConfig = {
     span: 4,
   },
 };
-
+const { sysOrgCode } = useGlobSetting();
 export const noDetailArr = ['nitrogen', 'forcFan']; // 前端详情的,
 // 棋盘井球阀监测数据只有温度
 export const haveDetailArr = [
@@ -552,11 +552,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 {

+ 29 - 8
src/views/vent/monitorManager/deviceMonitor/components/device/index.vue

@@ -385,7 +385,7 @@
             </template>
             <!-- 瓦斯管网 -->
             <template v-else-if="deviceType.startsWith('gaspipe') && activeKey == '1'">
-              <GasPipeTable :dataSource="dataSource" :deviceType="deviceType" :scroll="scroll" @locate="goLocation" />
+              <GasPipeTable :showDetailButton="true" :scroll="scroll" @detail="goDetail($event)" @locate="goLocation" />
             </template>
             <template v-else>
               <!-- 工作面echarts图标 -->
@@ -550,14 +550,24 @@
                 <!-- HistoryTableNew 没有监测deviceType 进行动态查询表头导致数据不显示 -->
                 <!-- <HistoryTableNew class="w-100% h-100%" :device-code="`${deviceType}`" :scroll="scroll"
                   dict-code="fan_dict" /> -->
-                  <HistoryTable ref="historyTable" :columns-type="`${deviceType}`"
-                  :device-type="deviceType" designScope="device-history" :scroll="scroll" />
+                <HistoryTable
+                  ref="historyTable"
+                  :columns-type="`${deviceType}`"
+                  :device-type="deviceType"
+                  designScope="device-history"
+                  :scroll="scroll"
+                />
               </template>
               <template v-else-if="deviceType.startsWith('fanlocal')">
                 <!-- HistoryTableNew 没有监测deviceType 进行动态查询表头导致数据不显示 -->
                 <!-- <HistoryTableNew class="w-100% h-100%" :device-code="`${deviceType}`" :scroll="scroll" dict-code="fanlocal_dict" /> -->
-                 <HistoryTable ref="historyTable" :columns-type="`${deviceType}`"
-                  :device-type="deviceType" designScope="device-history" :scroll="scroll" />
+                <HistoryTable
+                  ref="historyTable"
+                  :columns-type="`${deviceType}`"
+                  :device-type="deviceType"
+                  designScope="device-history"
+                  :scroll="scroll"
+                />
               </template>
               <template v-else>
                 <HistoryTable
@@ -571,9 +581,20 @@
               </template>
             </div>
           </a-tab-pane>
-          <a-tab-pane key="5" :tab="deviceType.startsWith('gasmonitor') ? '曲线监测': '历史曲线'" v-if="haveHistoryEcharts.find((item) => deviceType.startsWith(item))">
+          <a-tab-pane
+            key="5"
+            :tab="deviceType.startsWith('gasmonitor') ? '曲线监测' : '历史曲线'"
+            v-if="haveHistoryEcharts.find((item) => deviceType.startsWith(item))"
+          >
             <div class="tab-item">
-              <HistoryTableMajorPath v-if="deviceType.startsWith('majorpath')" class="w-100% h-100%" :sysId="`${systemID}`" :scroll="scroll" columnsType="sys_majorpath" type="chart" />
+              <HistoryTableMajorPath
+                v-if="deviceType.startsWith('majorpath')"
+                class="w-100% h-100%"
+                :sysId="`${systemID}`"
+                :scroll="scroll"
+                columnsType="sys_majorpath"
+                type="chart"
+              />
               <DeviceEcharts
                 chartsColumnsType="gasmonitor_chart"
                 xAxisPropType="strname"
@@ -664,7 +685,7 @@
     getMonitorComponent,
     vehicleFormConfig,
     noLocationArr,
-    haveHistoryEcharts
+    haveHistoryEcharts,
   } from './device.data';
   import mainPath from './modal/mainPath.vue';
   import { formConfig } from '../../../safetyMonitor/safety.data';

+ 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;