Browse Source

[Mod 0000] 展会风窗自主控制接口对接;更换活鸡兔光纤组件;局部风机频率按钮配置

hongrunxia 1 week ago
parent
commit
97313829d7

+ 297 - 297
src/views/vent/monitorManager/alarmMonitor/common/echartLine.vue

@@ -5,340 +5,340 @@
 </template>
 
 <script lang="ts" setup>
-import { defineProps, ref, nextTick, reactive, watch } from 'vue';
-import * as echarts from 'echarts';
+  import { defineProps, ref, nextTick, reactive, watch } from 'vue';
+  import * as echarts from 'echarts';
 
-let props = defineProps({
-  echartDataGq: {
-    type: Object,
-  },
-  maxY: {
-    type: Number,
-  },
-  minY:{
-    type: Number,
-  },
-  echartDw: {
-    type: String,
-  },
-  echartDw1: {
-    type: String,
-  },
-  gridV: {
-    type: Object,
-    default: () => {
-      return {
-        top: '15%',
-        left: '2%',
-        bottom: '6%',
-        right: '2%',
-        containLabel: true,
-      };
+  let props = defineProps({
+    echartDataGq: {
+      type: Object,
     },
-  },
-  // //报警历史交点坐标
-  // pointHisWarnData:{
-  //   type:Object,
-  //   default:()=>{
-  //     return {}
-  //   }
-  // }
-});
-//获取dom元素节点
-let line = ref<any>();
-let echartDataGqs = reactive({});
-watch(
-  () => props.echartDataGq,
-  (data) => {
-    echartDataGqs = Object.assign({}, data);
-    getOption();
-  },
-  { immediate: true, deep: true }
-);
-function getOption() {
-  nextTick(() => {
-    let myChart = echarts.init(line.value);
-    let option = {
-      grid: props.gridV,
-      tooltip: {
-        trigger: 'axis',
-        backgroundColor: 'rgba(0, 0, 0, .6)',
-        textStyle: {
-          color: '#fff',
-          fontSize: 12,
-        },
+    maxY: {
+      type: Number,
+    },
+    minY: {
+      type: Number,
+    },
+    echartDw: {
+      type: String,
+    },
+    echartDw1: {
+      type: String,
+    },
+    gridV: {
+      type: Object,
+      default: () => {
+        return {
+          top: '15%',
+          left: '35',
+          bottom: '6%',
+          right: '2%',
+          containLabel: true,
+        };
       },
-      legend: {
-        align: 'left',
-        right: 'center',
-        top: '-20',
-        type: 'plain',
-        textStyle: {
-          color: '#7ec7ff',
-          fontSize: 14,
-        },
-        // icon:'rect',
-        itemGap: 25,
-        itemWidth: 18,
-        icon: 'path://M0 2a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v0a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2z',
-        data: [
-          {
-            name: echartDataGqs.avgData ? echartDataGqs.avgData.lengedData : '',
-          },
-          {
-            name: echartDataGqs.maxData ? echartDataGqs.maxData.lengedData : '',
-          },
-          {
-            name: echartDataGqs.minData ? echartDataGqs.minData.lengedData : '',
-          },
-          {
-            name: echartDataGqs.curData ? echartDataGqs.curData.lengedData : '',
+    },
+    // //报警历史交点坐标
+    // pointHisWarnData:{
+    //   type:Object,
+    //   default:()=>{
+    //     return {}
+    //   }
+    // }
+  });
+  //获取dom元素节点
+  let line = ref<any>();
+  let echartDataGqs = reactive({});
+  watch(
+    () => props.echartDataGq,
+    (data) => {
+      echartDataGqs = Object.assign({}, data);
+      getOption();
+    },
+    { immediate: true, deep: true }
+  );
+  function getOption() {
+    nextTick(() => {
+      let myChart = echarts.init(line.value);
+      let option = {
+        grid: props.gridV,
+        tooltip: {
+          trigger: 'axis',
+          backgroundColor: 'rgba(0, 0, 0, .6)',
+          textStyle: {
+            color: '#fff',
+            fontSize: 12,
           },
-        ],
-      },
-      xAxis: [
-        {
-          type: 'category',
-          boundaryGap: false,
-          axisLabel: {
-            // formatter: '{value}',
+        },
+        legend: {
+          align: 'left',
+          right: 'center',
+          top: '-20',
+          type: 'plain',
+          textStyle: {
+            color: '#7ec7ff',
             fontSize: 14,
-            margin: 20,
-            textStyle: {
-              color: '#b3b8cc',
+          },
+          // icon:'rect',
+          itemGap: 25,
+          itemWidth: 18,
+          icon: 'path://M0 2a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v0a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2z',
+          data: [
+            {
+              name: echartDataGqs.avgData ? echartDataGqs.avgData.lengedData : '',
+            },
+            {
+              name: echartDataGqs.maxData ? echartDataGqs.maxData.lengedData : '',
             },
-            formatter: function (params) {
-              let newParamsName = ref(''); // 最终拼接成的字符串
-              let paramsNameNumber = ref(params.length); // 实际标签的个数
-              let provideNumber = ref(10); // 每行能显示的字的个数
-              let rowNumber = Math.ceil(paramsNameNumber.value / provideNumber.value); // 换行的话,需要显示几行,向上取整
-              /**
-               * 判断标签的个数是否大于规定的个数, 如果大于,则进行换行处理 如果不大于,即等于或小于,就返回原标签
-               */
-              // 条件等同于rowNumber>1
-              if (paramsNameNumber.value > provideNumber.value) {
-                /** 循环每一行,p表示行 */
-                for (var p = 0; p < rowNumber; p++) {
-                  var tempStr = ''; // 表示每一次截取的字符串
-                  var start = p * provideNumber.value; // 开始截取的位置
-                  var end = start + provideNumber.value; // 结束截取的位置
-                  // 此处特殊处理最后一行的索引值
-                  if (p == rowNumber - 1) {
-                    // 最后一次不换行
-                    tempStr = params.substring(start, paramsNameNumber.value);
-                  } else {
-                    // 每一次拼接字符串并换行
-                    tempStr = params.substring(start, end) + '\n';
+            {
+              name: echartDataGqs.minData ? echartDataGqs.minData.lengedData : '',
+            },
+            {
+              name: echartDataGqs.curData ? echartDataGqs.curData.lengedData : '',
+            },
+          ],
+        },
+        xAxis: [
+          {
+            type: 'category',
+            boundaryGap: false,
+            axisLabel: {
+              // formatter: '{value}',
+              fontSize: 14,
+              margin: 20,
+              textStyle: {
+                color: '#b3b8cc',
+              },
+              formatter: function (params) {
+                let newParamsName = ref(''); // 最终拼接成的字符串
+                let paramsNameNumber = ref(params.length); // 实际标签的个数
+                let provideNumber = ref(10); // 每行能显示的字的个数
+                let rowNumber = Math.ceil(paramsNameNumber.value / provideNumber.value); // 换行的话,需要显示几行,向上取整
+                /**
+                 * 判断标签的个数是否大于规定的个数, 如果大于,则进行换行处理 如果不大于,即等于或小于,就返回原标签
+                 */
+                // 条件等同于rowNumber>1
+                if (paramsNameNumber.value > provideNumber.value) {
+                  /** 循环每一行,p表示行 */
+                  for (var p = 0; p < rowNumber; p++) {
+                    var tempStr = ''; // 表示每一次截取的字符串
+                    var start = p * provideNumber.value; // 开始截取的位置
+                    var end = start + provideNumber.value; // 结束截取的位置
+                    // 此处特殊处理最后一行的索引值
+                    if (p == rowNumber - 1) {
+                      // 最后一次不换行
+                      tempStr = params.substring(start, paramsNameNumber.value);
+                    } else {
+                      // 每一次拼接字符串并换行
+                      tempStr = params.substring(start, end) + '\n';
+                    }
+                    newParamsName.value += tempStr; // 最终拼成的字符串
                   }
-                  newParamsName.value += tempStr; // 最终拼成的字符串
+                } else {
+                  // 将旧标签的值赋给新标签
+                  newParamsName.value = params;
                 }
-              } else {
-                // 将旧标签的值赋给新标签
-                newParamsName.value = params;
-              }
-              //将最终的字符串返回
-              return newParamsName.value;
+                //将最终的字符串返回
+                return newParamsName.value;
+              },
             },
-          },
-          axisLine: {
-            lineStyle: {
-              // color: 'rgba(14, 53, 95)',
-              color: '#244a94',
+            axisLine: {
+              lineStyle: {
+                // color: 'rgba(14, 53, 95)',
+                color: '#244a94',
+              },
             },
-          },
-          splitLine: {
-            show: false,
-            //   lineStyle: {
-            //     color: '#243753',
-            //   },
-          },
-          axisTick: {
-            show: false,
-          },
-          data: echartDataGqs.xData ? echartDataGqs.xData : [],
-        },
-      ],
-      yAxis: [
-        {
-          boundaryGap: false,
-          type: 'value',
-          max: props.maxY,
-          min:props.minY,
-          axisLabel: {
-            textStyle: {
-              color: '#b3b8cc',
+            splitLine: {
+              show: false,
+              //   lineStyle: {
+              //     color: '#243753',
+              //   },
             },
-            formatter: '{value}',
-          },
-          name: props.echartDw,
-          nameTextStyle: {
-            color: '#fff',
-            fontSize: 12,
-            lineHeight: 10,
-          },
-          splitLine: {
-            lineStyle: {
-              // color: 'rgba(14, 53, 95)',
-              color: '#0d2973',
+            axisTick: {
+              show: false,
             },
+            data: echartDataGqs.xData ? echartDataGqs.xData : [],
           },
-          axisLine: {
-            show: true,
-            lineStyle: {
-              // color: 'rgba(14, 53, 95)',
-              color: '#244a94',
+        ],
+        yAxis: [
+          {
+            boundaryGap: false,
+            type: 'value',
+            max: props.maxY,
+            min: props.minY,
+            axisLabel: {
+              textStyle: {
+                color: '#b3b8cc',
+              },
+              formatter: '{value}',
+            },
+            name: props.echartDw,
+            nameTextStyle: {
+              color: '#fff',
+              fontSize: 12,
+              lineHeight: 10,
+            },
+            splitLine: {
+              lineStyle: {
+                // color: 'rgba(14, 53, 95)',
+                color: '#0d2973',
+              },
+            },
+            axisLine: {
+              show: true,
+              lineStyle: {
+                // color: 'rgba(14, 53, 95)',
+                color: '#244a94',
+              },
+            },
+            axisTick: {
+              show: false,
             },
           },
-          axisTick: {
-            show: false,
-          },
-        },
-        // {
-        //   boundaryGap: false,
-        //   type: 'value',
-        //   max: props.maxY,
-        //   min:props.minY,
-        //   axisLabel: {
-        //     textStyle: {
-        //       color: '#b3b8cc',
-        //     },
-        //     formatter: '{value}',
-        //   },
-        //   name: props.echartDw1,
-        //   nameTextStyle: {
-        //     color: '#fff',
-        //     fontSize: 12,
-        //     lineHeight: 10,
-        //   },
-        //   splitLine: {
-        //     lineStyle: {
-        //       color: 'rgba(14, 53, 95)',
-        //     },
-        //   },
-        //   axisLine: {
-        //     show: true,
-        //     lineStyle: {
-        //       color: 'rgba(14, 53, 95)',
-        //     },
-        //   },
-        //   axisTick: {
-        //     show: false,
-        //   },
-        // },
-      ],
-      series: [
-        {
-          name: echartDataGqs.maxData ? echartDataGqs.maxData.lengedData : '',
-          type: 'line',
-
-          // markPoint: {
-          //   symbol: 'circle',
-          //   data: [
-          //     {
-          //       coord: [345.44, 94250.0],
-          //       name: '交点',
+          // {
+          //   boundaryGap: false,
+          //   type: 'value',
+          //   max: props.maxY,
+          //   min:props.minY,
+          //   axisLabel: {
+          //     textStyle: {
+          //       color: '#b3b8cc',
           //     },
-
-          //   ],
-          //   symbolSize: 10,
-          //   itemStyle: {
-          //     color: '#19a3df',
-          //     borderColor: '#a3c8d8',
+          //     formatter: '{value}',
           //   },
-          //   label: {
-          //     fontSize: 10,
+          //   name: props.echartDw1,
+          //   nameTextStyle: {
           //     color: '#fff',
+          //     fontSize: 12,
+          //     lineHeight: 10,
+          //   },
+          //   splitLine: {
+          //     lineStyle: {
+          //       color: 'rgba(14, 53, 95)',
+          //     },
+          //   },
+          //   axisLine: {
+          //     show: true,
+          //     lineStyle: {
+          //       color: 'rgba(14, 53, 95)',
+          //     },
+          //   },
+          //   axisTick: {
+          //     show: false,
           //   },
           // },
-          smooth: true,
-          symbol: 'none',
-          zlevel: 3,
-          itemStyle: {
-            color: '#ff0000',
-            borderColor: '#ff0000',
-          },
-          lineStyle: {
-            normal: {
-              width: 2,
+        ],
+        series: [
+          {
+            name: echartDataGqs.maxData ? echartDataGqs.maxData.lengedData : '',
+            type: 'line',
+
+            // markPoint: {
+            //   symbol: 'circle',
+            //   data: [
+            //     {
+            //       coord: [345.44, 94250.0],
+            //       name: '交点',
+            //     },
+
+            //   ],
+            //   symbolSize: 10,
+            //   itemStyle: {
+            //     color: '#19a3df',
+            //     borderColor: '#a3c8d8',
+            //   },
+            //   label: {
+            //     fontSize: 10,
+            //     color: '#fff',
+            //   },
+            // },
+            smooth: true,
+            symbol: 'none',
+            zlevel: 3,
+            itemStyle: {
               color: '#ff0000',
+              borderColor: '#ff0000',
             },
+            lineStyle: {
+              normal: {
+                width: 2,
+                color: '#ff0000',
+              },
+            },
+            data: echartDataGqs.maxData ? echartDataGqs.maxData.data : [],
           },
-          data: echartDataGqs.maxData ? echartDataGqs.maxData.data : [],
-        },
-        {
-          name: echartDataGqs.minData ? echartDataGqs.minData.lengedData : '',
-          type: 'line',
-          smooth: true,
-          symbol: 'none',
-          zlevel: 3,
-          itemStyle: {
-            color: '#4fffad',
-            borderColor: '#a3c8d8',
-          },
-          lineStyle: {
-            normal: {
-              width: 2,
+          {
+            name: echartDataGqs.minData ? echartDataGqs.minData.lengedData : '',
+            type: 'line',
+            smooth: true,
+            symbol: 'none',
+            zlevel: 3,
+            itemStyle: {
               color: '#4fffad',
+              borderColor: '#a3c8d8',
             },
+            lineStyle: {
+              normal: {
+                width: 2,
+                color: '#4fffad',
+              },
+            },
+            data: echartDataGqs.minData ? echartDataGqs.minData.data : [],
           },
-          data: echartDataGqs.minData ? echartDataGqs.minData.data : [],
-        },
-        {
-          name: echartDataGqs.avgData ? echartDataGqs.avgData.lengedData : '',
-          type: 'line',
-          smooth: true,
-          symbol: 'none',
-          zlevel: 3,
-          itemStyle: {
-            color: '#fc8452',
-            borderColor: '#a3c8d8',
-          },
-          lineStyle: {
-            normal: {
-              width: 2,
+          {
+            name: echartDataGqs.avgData ? echartDataGqs.avgData.lengedData : '',
+            type: 'line',
+            smooth: true,
+            symbol: 'none',
+            zlevel: 3,
+            itemStyle: {
               color: '#fc8452',
+              borderColor: '#a3c8d8',
+            },
+            lineStyle: {
+              normal: {
+                width: 2,
+                color: '#fc8452',
+              },
             },
-          },
 
-          data: echartDataGqs.avgData ? echartDataGqs.avgData.data : [],
-        },
-        {
-          name: echartDataGqs.curData ? echartDataGqs.curData.lengedData : '',
-          type: 'line',
-          smooth: true,
-          symbol: 'none',
-          zlevel: 3,
-          itemStyle: {
-            color: '#fc8452',
-            borderColor: '#a3c8d8',
+            data: echartDataGqs.avgData ? echartDataGqs.avgData.data : [],
           },
-          lineStyle: {
-            normal: {
-              width: 2,
+          {
+            name: echartDataGqs.curData ? echartDataGqs.curData.lengedData : '',
+            type: 'line',
+            smooth: true,
+            symbol: 'none',
+            zlevel: 3,
+            itemStyle: {
               color: '#fc8452',
+              borderColor: '#a3c8d8',
+            },
+            lineStyle: {
+              normal: {
+                width: 2,
+                color: '#fc8452',
+              },
             },
-          },
 
-          data: echartDataGqs.curData ? echartDataGqs.curData.data : [],
-        },
-      ],
-    };
-    myChart.setOption(option);
-    window.onresize = function () {
-      myChart.resize();
-    };
-  });
-}
+            data: echartDataGqs.curData ? echartDataGqs.curData.data : [],
+          },
+        ],
+      };
+      myChart.setOption(option);
+      window.onresize = function () {
+        myChart.resize();
+      };
+    });
+  }
 </script>
 
 <style scoped lang="less">
-.echartLine {
-  width: 100%;
-  height: 100%;
-
-  .line {
+  .echartLine {
     width: 100%;
     height: 100%;
+
+    .line {
+      width: 100%;
+      height: 100%;
+    }
   }
-}
 </style>

+ 12 - 9
src/views/vent/monitorManager/comment/DeviceEcharts.vue

@@ -1,12 +1,12 @@
 <template>
   <div class="charts-container">
     <a-select ref="select" v-model:value="chartsType" size="small" style="position: absolute; z-index: 99; top: 2px; left: 2px; width: 98px">
-      <!-- <a-select-option value="listMonitor">实时监测</a-select-option> -->
       <a-select-option value="history">历史记录</a-select-option>
+      <a-select-option value="listMonitor">实时监测</a-select-option>
       <!-- <a-select-option value="detail">详情监测</a-select-option> -->
     </a-select>
 
-    <!-- <div class="charts-box" v-if="chartsType === 'listMonitor'" style="position: absolute; top: 20px">
+    <div class="charts-box" v-if="chartsType === 'listMonitor'" style="position: absolute; top: 20px">
       <BarAndLine
         :chartsColumnsType="chartsColumnsType"
         :xAxisPropType="xAxisPropType"
@@ -14,9 +14,9 @@
         height="100%"
         chartsType="listMonitor"
         :option="echartsOption"
-        :chartsColumns="chartsColumns"
+        :chartsColumns="chartsColumnList"
       />
-    </div> -->
+    </div>
     <div class="charts-box" v-if="chartsType === 'detail' && deviceListApi">
       <Select
         :options="options"
@@ -33,7 +33,7 @@
         height="100%"
         :option="echartsOption2"
         chartsType="detail"
-        :chartsColumns="chartsColumns"
+        :chartsColumns="chartsColumnList"
       />
     </div>
     <div class="charts-box" v-else-if="chartsType === 'history'">
@@ -129,7 +129,7 @@
         :option="echartsOption1"
         chartsType="history"
         style="margin-top: 20px"
-        :chartsColumns="chartsColumns"
+        :chartsColumns="chartsColumnList"
       />
     </div>
   </div>
@@ -140,6 +140,7 @@
   import dayjs from 'dayjs';
   import { defHttp } from '/@/utils/http/axios';
   import { Select, Pagination } from 'ant-design-vue';
+  import { getTableHeaderColumns } from '/@/hooks/web/useWebColumns';
 
   export default defineComponent({
     name: 'DeviceEcharts',
@@ -196,6 +197,7 @@
         skip: '8',
         interval: '1h',
       });
+      const chartsColumnList = props.chartsColumns ? props.chartsColumns : getTableHeaderColumns(props.chartsColumnsType);
       const resultXAxisPropType = ref('');
       const resultDataSource = ref<any[]>([]);
       const detailDataSource = ref<any[]>([]);
@@ -206,7 +208,7 @@
         grid: {
           top: '60px',
           left: '10px',
-          right: props.chartsColumns.length * 15 + 'px',
+          right: chartsColumnList.length * 15 + 'px',
           bottom: '5%',
           containLabel: true,
         },
@@ -223,7 +225,7 @@
         grid: {
           top: '70px',
           left: '10px',
-          right: props.chartsColumns.length * 15 + 'px',
+          right: chartsColumnList.length * 15 + 'px',
           bottom: '45px',
           containLabel: true,
         },
@@ -238,7 +240,7 @@
         grid: {
           top: '70px',
           left: '10px',
-          right: props.chartsColumns.length * 15 + 'px',
+          right: chartsColumnList.length * 15 + 'px',
           bottom: '2%',
           containLabel: true,
         },
@@ -364,6 +366,7 @@
         onChange,
         globalConfig,
         stationType,
+        chartsColumnList,
       };
     },
   });

+ 4 - 0
src/views/vent/monitorManager/deviceMonitor/components/device/device.data.ts

@@ -61,6 +61,8 @@ export function getMonitorComponent() {
       FiberModal = defineAsyncComponent(() => import('./modal/fiber.modal.sjh.vue'));
       break;
     case 'sdmtjtbdmk': //保德
+    case 'sdmtjtdltmk': //大柳塔
+    case 'sdmtjtdltmkhjtj': //活鸡兔
       FiberModal = defineAsyncComponent(() => import('./modal/fiber.modal.bd.vue'));
       break;
     case 'sdmtjtbetmk': //布尔台
@@ -546,6 +548,8 @@ export const noWarningArr = [
   'substation_normal',
 ]; // 无预警详情的
 export const haveSysDetailArr = ['forcFan', 'pulping']; //有场景详情的
+
+export const haveHistoryEcharts = ['majorpath', 'gasmonitor']; // 有历史曲线的
 // export const haveSysDetailArr = ['']; //有场景详情的
 // 无定位
 export const noLocationArr = () => {

+ 21 - 6
src/views/vent/monitorManager/deviceMonitor/components/device/index.vue

@@ -466,11 +466,17 @@
                 <HistoryBall :dataSource="dataSource"></HistoryBall>
               </template>
               <template v-else-if="deviceType.startsWith('fanmain')">
-                <HistoryTableNew class="w-100% h-100%" :device-code="`${deviceType}`" :scroll="scroll"
-                  dict-code="fan_dict" />
+                <!-- 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" />
               </template>
               <template v-else-if="deviceType.startsWith('fanlocal')">
-                <HistoryTableNew class="w-100% hM-100%" :device-code="`${deviceType}`" :scroll="scroll" dict-code="fanlocal_dict" />
+                <!-- 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" />
               </template>
               <template v-else>
                 <HistoryTable ref="historyTable" :sysId="systemID" :columns-type="`${deviceType}`"
@@ -478,9 +484,17 @@
               </template>
             </div>
           </a-tab-pane>
-          <a-tab-pane key="5" tab="历史曲线" v-if="deviceType.startsWith('majorpath')">
+          <a-tab-pane key="5" :tab="deviceType.startsWith('gasmonitor') ? '曲线监测': '历史曲线'" v-if="haveHistoryEcharts.find((item) => deviceType.startsWith(item))">
             <div class="tab-item">
-              <HistoryTableMajorPath 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"
+                height="300px"
+                :dataSource="dataSource"
+                :device-list-api="list.bind(null, { devicetype: 'gasmonitor', pagetype: 'normal' })"
+                device-type="gasmonitor"
+              />
             </div>
           </a-tab-pane>
           <a-tab-pane key="3" tab="报警历史" v-if="!noWarningArr.find((item) => deviceType.startsWith(item))">
@@ -546,13 +560,14 @@ import {
   surfaceChartsColumns,
   noHistoryArr,
   getMonitorComponent,
-  vehicleFormConfig,
+  haveHistoryEcharts,
   noLocationArr,
 } from './device.data';
 import mainPath from './modal/mainPath.vue';
 import { formConfig } from '../../../safetyMonitor/safety.data';
 import { getDictItemsByCode } from '/@/utils/dict';
 import BarAndLine from '/@/components/chart/BarAndLine.vue';
+import DeviceEcharts from '../../../comment/DeviceEcharts.vue';
 import MTreeSelect from '/@/components/Form/src/jeecg/components/MTreeSelect.vue';
 // import ApiSelect from '/@/components/Form/src/components/ApiSelect.vue';
 import { nextTick } from 'vue';

+ 309 - 307
src/views/vent/monitorManager/deviceMonitor/components/device/modal/fiber.modal.bd.vue

@@ -1,10 +1,13 @@
 <template>
-  <BasicModal v-bind="$attrs" @register="register" :title="`光纤测温详情    ${currentTime}`" width="1200px" @ok="handleOk"
-    @cancel="handleCancel">
+  <BasicModal v-bind="$attrs" @register="register" :title="`光纤测温详情    ${currentTime}`" width="1200px" @ok="handleOk" @cancel="handleCancel">
     <div class="fiber-modal">
       <div class="modal-left">
-        <div v-for="device in deviceList" class="link-item"
-          :class="{ 'active-device-title': device.deviceID === activeDeviceID }" :key="device.deviceID">
+        <div
+          v-for="device in deviceList"
+          class="link-item"
+          :class="{ 'active-device-title': device.deviceID === activeDeviceID }"
+          :key="device.deviceID"
+        >
           <span class="" @click="selectDevice(device.deviceID)">{{ device.strinstallpos }}</span>
         </div>
       </div>
@@ -53,8 +56,7 @@
         <div class="right-bottom">
           <span class="base-title">测点监测曲线</span>
           <div class="echarts-box">
-            <BarAndLine xAxisPropType="pos" :dataSource="posList" height="100%" :chartsColumns="chartsColumns"
-              :option="echatsOption" />
+            <BarAndLine xAxisPropType="pos" :dataSource="posList" height="100%" :chartsColumns="chartsColumns" :option="echatsOption" />
           </div>
         </div>
         <div class="right-center">
@@ -68,367 +70,367 @@
   </BasicModal>
 </template>
 <script lang="ts">
-import { defineComponent, ref, watch, shallowRef, reactive } from 'vue';
-import { BasicModal, useModalInner } from '/@/components/Modal';
-import BarAndLine from '/@/components/chart/BarAndLine.vue';
-import { SvgIcon } from '/@/components/Icon';
-import dayjs from 'dayjs';
-import { formatNum } from '/@/utils/ventutil';
-
-export default defineComponent({
-  components: { BasicModal, BarAndLine, SvgIcon },
-  props: {
-    dataSource: { type: Array },
-    activeID: { type: String },
-  },
-  setup(props) {
-    const currentTime = ref(dayjs().format('YYYY-MM-DD HH:mm:ss'));
-    const modelRef = ref({});
-    const loading = ref(true);
-    const activeDeviceID = ref<any>('');
-    const deviceList = ref<any[]>([]);
-    const posList = ref<any[]>([]);
-    const history = ref<any[]>([]);
-    const posMonitor = shallowRef({});
-
-    const echatsOption = {
-      grid: {
-        top: '20%',
-        left: '2px',
-        right: '10px',
-        bottom: '3%',
-        containLabel: true,
-      },
-      toolbox: {
-        feature: {},
-      },
-    };
-
-    const chartsColumns = [
-      {
-        legend: '测点温度',
-        seriesName: '(℃)',
-        ymax: 100,
-        yname: '℃',
-        linetype: 'line',
-        yaxispos: 'left',
-        color: '#FDB146',
-        sort: 1,
-        xRotate: 0,
-        dataIndex: 'value',
-      },
-    ];
-    const columns = [
-      {
-        title: '位置',
-        dataIndex: 'position',
-        align: 'center',
-        customRender: ({ index }) => {
-          return `测点${index}`;
+  import { defineComponent, ref, watch, shallowRef, reactive } from 'vue';
+  import { BasicModal, useModalInner } from '/@/components/Modal';
+  import BarAndLine from '/@/components/chart/BarAndLine.vue';
+  import { SvgIcon } from '/@/components/Icon';
+  import dayjs from 'dayjs';
+  import { formatNum } from '/@/utils/ventutil';
+
+  export default defineComponent({
+    components: { BasicModal, BarAndLine, SvgIcon },
+    props: {
+      dataSource: { type: Array },
+      activeID: { type: String },
+    },
+    setup(props) {
+      const currentTime = ref(dayjs().format('YYYY-MM-DD HH:mm:ss'));
+      const modelRef = ref({});
+      const loading = ref(true);
+      const activeDeviceID = ref<any>('');
+      const deviceList = ref<any[]>([]);
+      const posList = ref<any[]>([]);
+      const history = ref<any[]>([]);
+      const posMonitor = shallowRef({});
+
+      const echatsOption = {
+        grid: {
+          top: '20%',
+          left: '2px',
+          right: '10px',
+          bottom: '3%',
+          containLabel: true,
         },
-      },
-      {
-        title: '最高温度(℃)',
-        dataIndex: 'fmax',
-        align: 'center',
-      },
-      {
-        title: '平均温度(℃)',
-        dataIndex: 'favg',
-        align: 'center',
-      },
-      {
-        title: '最低温度(℃)',
-        dataIndex: 'fmin',
-        align: 'center',
-      },
-      {
-        title: '时间',
-        dataIndex: 'time',
-        align: 'center',
-        width: 200,
-      },
-    ];
-
-    const [register, { setModalProps, closeModal }] = useModalInner();
-
-    function handleVisibleChange(visible) {
-      if (visible) {
+        toolbox: {
+          feature: {},
+        },
+      };
+
+      const chartsColumns = [
+        {
+          legend: '测点温度',
+          seriesName: '(℃)',
+          ymax: 100,
+          yname: '℃',
+          linetype: 'line',
+          yaxispos: 'left',
+          color: '#FDB146',
+          sort: 1,
+          xRotate: 0,
+          dataIndex: 'value',
+        },
+      ];
+      const columns = [
+        {
+          title: '位置',
+          dataIndex: 'position',
+          align: 'center',
+          customRender: ({ index }) => {
+            return `测点${index}`;
+          },
+        },
+        {
+          title: '最高温度(℃)',
+          dataIndex: 'fmax',
+          align: 'center',
+        },
+        {
+          title: '平均温度(℃)',
+          dataIndex: 'favg',
+          align: 'center',
+        },
+        {
+          title: '最低温度(℃)',
+          dataIndex: 'fmin',
+          align: 'center',
+        },
+        {
+          title: '时间',
+          dataIndex: 'time',
+          align: 'center',
+          width: 200,
+        },
+      ];
+
+      const [register, { setModalProps, closeModal }] = useModalInner();
+
+      function handleVisibleChange(visible) {
+        if (visible) {
+          loading.value = true;
+          setModalProps({ loading: true, confirmLoading: true });
+
+          setTimeout(() => {
+            loading.value = false;
+            setModalProps({ loading: false, confirmLoading: false });
+          }, 1000);
+        }
+      }
+
+      // 选择监测
+      function selectDevice(id) {
         loading.value = true;
         setModalProps({ loading: true, confirmLoading: true });
-
         setTimeout(() => {
           loading.value = false;
+          activeDeviceID.value = id;
           setModalProps({ loading: false, confirmLoading: false });
-        }, 1000);
+        }, 300);
       }
-    }
-
-    // 选择监测
-    function selectDevice(id) {
-      loading.value = true;
-      setModalProps({ loading: true, confirmLoading: true });
-      setTimeout(() => {
-        loading.value = false;
-        activeDeviceID.value = id;
-        setModalProps({ loading: false, confirmLoading: false });
-      }, 300);
-    }
 
-    function handleOk(e) {
-      e.preventDefault();
-      closeModal();
-    }
-
-    function handleCancel(e) {
-      e.preventDefault();
-      closeModal();
-    }
+      function handleOk(e) {
+        e.preventDefault();
+        closeModal();
+      }
 
-    watch([() => props.dataSource, () => props.activeID], ([newDataSource, newActiveID], [oldDataSource, oldActiveID]) => {
-      console.log(newDataSource, 'newDataSource--------------');
-      deviceList.value = newDataSource as any[];
-      if (newActiveID != oldActiveID) {
-        activeDeviceID.value = newActiveID as string;
+      function handleCancel(e) {
+        e.preventDefault();
+        closeModal();
       }
-      // activeDeviceID.value = activeDeviceID.value ? activeDeviceID.value : newActiveID;
-      newDataSource?.forEach((item: any, index) => {
-        if ((!activeDeviceID.value && index == 0) || item.deviceID === activeDeviceID.value) {
-          history.value = item.history;
-          posMonitor.value = item.readData;
-          if (item.readData.fibreTemperature) {
-            const list = JSON.parse(item.readData.fibreTemperature);
-            if (list.length > 0) posList.value = list;
-          }
+
+      watch([() => props.dataSource, () => props.activeID], ([newDataSource, newActiveID], [oldDataSource, oldActiveID]) => {
+        console.log(newDataSource, 'newDataSource--------------');
+        deviceList.value = newDataSource as any[];
+        if (newActiveID != oldActiveID) {
+          activeDeviceID.value = newActiveID as string;
         }
+        // activeDeviceID.value = activeDeviceID.value ? activeDeviceID.value : newActiveID;
+        newDataSource?.forEach((item: any, index) => {
+          if ((!activeDeviceID.value && index == 0) || item.deviceID === activeDeviceID.value) {
+            history.value = item.history;
+            posMonitor.value = item.readData;
+            if (item.readData.fibreTemperature) {
+              const list = JSON.parse(item.readData.fibreTemperature);
+              if (list.length > 0) posList.value = list;
+            }
+          }
+        });
       });
-    });
-
-    return {
-      register,
-      model: modelRef,
-      currentTime,
-      handleVisibleChange,
-      selectDevice,
-      handleOk,
-      handleCancel,
-      deviceList,
-      activeDeviceID,
-      posMonitor,
-      echatsOption,
-      posList,
-      history,
-      chartsColumns,
-      columns,
-      formatNum,
-    };
-  },
-});
+
+      return {
+        register,
+        model: modelRef,
+        currentTime,
+        handleVisibleChange,
+        selectDevice,
+        handleOk,
+        handleCancel,
+        deviceList,
+        activeDeviceID,
+        posMonitor,
+        echatsOption,
+        posList,
+        history,
+        chartsColumns,
+        columns,
+        formatNum,
+      };
+    },
+  });
 </script>
 <style lang="less" scoped>
-.fiber-modal {
-  width: 100%;
-  height: 650px;
-  display: flex;
-  flex-direction: row;
-  justify-content: space-between;
-
-  .modal-left {
-    width: 200px;
-    height: 100%;
-    overflow-y: auto;
-    background: #ffffff11;
-    padding: 5px;
-    border-radius: 5px;
-
-    .active-device-title {
-      color: aqua;
-    }
+  .fiber-modal {
+    width: 100%;
+    height: 650px;
+    display: flex;
+    flex-direction: row;
+    justify-content: space-between;
+
+    .modal-left {
+      width: 200px;
+      height: 100%;
+      overflow-y: auto;
+      background: #ffffff11;
+      padding: 5px;
+      border-radius: 5px;
+
+      .active-device-title {
+        color: aqua;
+      }
 
-    .link-item {
-      position: relative;
-      cursor: pointer;
-      line-height: 30px;
-      padding-left: 30px;
+      .link-item {
+        position: relative;
+        cursor: pointer;
+        line-height: 30px;
+        padding-left: 30px;
 
-      span:hover {
-        color: #89ffff;
-      }
+        span:hover {
+          color: #89ffff;
+        }
 
-      &::after {
-        content: '';
-        position: absolute;
-        display: block;
-        width: 8px;
-        height: 8px;
-        top: 12px;
-        left: 10px;
-        transform: rotateZ(45deg) skew(10deg, 10deg);
-        background: #45d3fd;
+        &::after {
+          content: '';
+          position: absolute;
+          display: block;
+          width: 8px;
+          height: 8px;
+          top: 12px;
+          left: 10px;
+          transform: rotateZ(45deg) skew(10deg, 10deg);
+          background: #45d3fd;
+        }
       }
     }
-  }
 
-  .modal-right {
-    width: calc(100% - 220px);
-    overflow-y: auto;
-
-    .base-title {
-      line-height: 32px;
-      position: relative;
-      padding-left: 20px;
-
-      &::after {
-        content: '';
-        position: absolute;
-        display: block;
-        width: 4px;
-        height: 12px;
-        top: 4px;
-        left: 10px;
-        background: #45d3fd;
-        border-radius: 4px;
-      }
-    }
+    .modal-right {
+      width: calc(100% - 220px);
+      overflow-y: auto;
 
-    .right-top {
-      display: flex;
-      flex-direction: row;
-      justify-content: space-between;
-      margin-bottom: 10px;
+      .base-title {
+        line-height: 32px;
+        position: relative;
+        padding-left: 20px;
+
+        &::after {
+          content: '';
+          position: absolute;
+          display: block;
+          width: 4px;
+          height: 12px;
+          top: 4px;
+          left: 10px;
+          background: #45d3fd;
+          border-radius: 4px;
+        }
+      }
 
-      .top-item {
-        width: 200px;
-        height: 80px;
+      .right-top {
         display: flex;
         flex-direction: row;
-        justify-content: center;
-        border: 1px solid rgba(25, 237, 255, 0.4);
-        box-shadow: inset 0 0 10px rgba(0, 197, 255, 0.6);
-        background: rgba(0, 0, 0, 0.06666666666666667);
-        padding-top: 16px;
-
-        .icon {
-          margin-right: 10px;
-          margin-top: 5px;
-          color: #fdb146;
-        }
+        justify-content: space-between;
+        margin-bottom: 10px;
 
-        .item-container {
-          width: 100px;
+        .top-item {
+          width: 200px;
+          height: 80px;
           display: flex;
-          flex-direction: column;
+          flex-direction: row;
           justify-content: center;
-
-          div {
-            text-align: center;
+          border: 1px solid rgba(25, 237, 255, 0.4);
+          box-shadow: inset 0 0 10px rgba(0, 197, 255, 0.6);
+          background: rgba(0, 0, 0, 0.06666666666666667);
+          padding-top: 16px;
+
+          .icon {
+            margin-right: 10px;
+            margin-top: 5px;
+            color: #fdb146;
           }
 
-          .title {
-            font-size: 18px;
-          }
+          .item-container {
+            width: 100px;
+            display: flex;
+            flex-direction: column;
+            justify-content: center;
 
-          .value {
-            text-shadow: 0 0 25px #00fbfe;
-            background: linear-gradient(0deg, #45d3fd, #45d3fd, #61ddb1, #61ddb1);
-            font-style: normal;
-            background-size: cover;
-            font-family: electronicFont;
-            font-size: 30px;
-            -webkit-background-clip: text;
-            background-clip: text;
-            -webkit-text-fill-color: transparent;
-            position: relative;
-            top: -8px;
-
-            span {
-              font-family: Arial, Helvetica, sans-serif;
+            div {
+              text-align: center;
+            }
+
+            .title {
               font-size: 18px;
-              color: aliceblue;
+            }
+
+            .value {
+              text-shadow: 0 0 25px #00fbfe;
+              background: linear-gradient(0deg, #45d3fd, #45d3fd, #61ddb1, #61ddb1);
+              font-style: normal;
+              background-size: cover;
+              font-family: electronicFont;
+              font-size: 30px;
+              -webkit-background-clip: text;
+              background-clip: text;
+              -webkit-text-fill-color: transparent;
+              position: relative;
+              top: -8px;
+
+              span {
+                font-family: Arial, Helvetica, sans-serif;
+                font-size: 18px;
+                color: aliceblue;
+              }
             }
           }
         }
-      }
 
-      .warning-box {
-        padding-top: 0px;
+        .warning-box {
+          padding-top: 0px;
 
-        .icon {
-          margin-top: 20px;
+          .icon {
+            margin-top: 20px;
 
-          .icon-style {
-            color: #fdb146;
+            .icon-style {
+              color: #fdb146;
+            }
           }
-        }
 
-        .warning-value {
-          font-size: 18px;
-          color: #61ddb1;
+          .warning-value {
+            font-size: 18px;
+            color: #61ddb1;
+          }
         }
       }
-    }
 
-    .right-center {
-      margin-top: 20px;
-      display: flex;
-      flex-direction: row;
-      justify-content: space-between;
+      .right-center {
+        margin-top: 20px;
+        display: flex;
+        flex-direction: row;
+        justify-content: space-between;
 
-      .table-box {
-        position: relative;
-        width: 100%;
-        height: 250px;
+        .table-box {
+          position: relative;
+          width: 100%;
+          height: 250px;
 
-        :deep(.zxm-table-wrapper) {
-          height: 220px !important;
-          background: #ffffff05 !important;
-          border-bottom: 1px solid #91e9fe80 !important;
+          :deep(.zxm-table-wrapper) {
+            height: 220px !important;
+            background: #ffffff05 !important;
+            border-bottom: 1px solid #91e9fe80 !important;
+          }
         }
-      }
 
-      .warning-box {
-        width: calc(100% - 520px);
+        .warning-box {
+          width: calc(100% - 520px);
 
-        .warning-container {
-          width: 100%;
-          height: convert;
-          background: #009acd00;
+          .warning-container {
+            width: 100%;
+            height: convert;
+            background: #009acd00;
 
-          :deep(.dv-scroll-board) {
-            .row-item {
-              height: 40px !important;
-              line-height: 40px !important;
-            }
+            :deep(.dv-scroll-board) {
+              .row-item {
+                height: 40px !important;
+                line-height: 40px !important;
+              }
 
-            .header-item {
-              border-top: 1px solid #91e9fe !important;
-              border-bottom: 1px solid #91e9fe !important;
+              .header-item {
+                border-top: 1px solid #91e9fe !important;
+                border-bottom: 1px solid #91e9fe !important;
+              }
             }
           }
         }
       }
-    }
 
-    .right-bottom {
-      margin-top: 20px;
+      .right-bottom {
+        margin-top: 20px;
 
-      .echarts-box {
-        width: 100%;
-        height: 230px;
+        .echarts-box {
+          width: 100%;
+          height: 230px;
+        }
       }
     }
   }
-}
 
-:deep(.zxm-table-body) {
-  border: 1px solid rgba(57, 232, 255, 0.2) !important;
+  :deep(.zxm-table-body) {
+    border: 1px solid rgba(57, 232, 255, 0.2) !important;
 
-  .zxm-table-tbody>tr>td {
-    border: none !important;
+    .zxm-table-tbody > tr > td {
+      border: none !important;
+    }
   }
-}
 
-:deep(.zxm-table-cell) {
-  border-right: none !important;
-}
+  :deep(.zxm-table-cell) {
+    border-right: none !important;
+  }
 </style>

File diff suppressed because it is too large
+ 665 - 629
src/views/vent/monitorManager/fanLocalMonitor/index.vue


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

@@ -47,6 +47,8 @@
         </div>
       </div>
       <div class="top-right row">
+        <div v-if="hasPermission('window:zhldkz')" class="button-box" @click="setControl('autoRun', '开启自主调控')">开启自主调控</div>
+        <div v-if="hasPermission('window:zhldkz')" class="button-box" @click="setControl('autoStop', '关闭自主调控')">关闭自主调控</div>
         <div v-if="hasPermission('window:ldkz')" class="button-box" @click="setArea(7)">风窗自主调控</div>
         <div v-if="hasPermission('window:gasldkz')" class="button-box" @click="setArea('ldkzStart')">瓦斯超限调控开启</div>
         <div v-if="hasPermission('window:controlFull')" class="button-box" @click="setArea(5)">一键全开</div>
@@ -529,7 +531,11 @@
         data.value = value;
       } else {
         data.paramcode = handlerState;
-        data.value = value;
+        if (handlerState == 'autoRun' || handlerState == 'autoStop') {
+          data.value = null;
+        } else {
+          data.value = value;
+        }
       }
       deviceControlApi(handlerState == 3 ? params : data)
         .then((res) => {

+ 1 - 1
src/views/vent/monitorManager/windowMonitor/window.threejs.ts

@@ -9,7 +9,7 @@ import sdFc_4 from './shuangdaoFcHj.threejs'; // sdFc_4 双道-带门-卷闸
 import sdFc_2 from './shuangdaoFcSw.threejs'; // sdFc_2 单道-带小门-2个窗
 import sdFc_5 from './shuangdaoFcYjl.threejs'; // sdFc_5 双道-小门(侧边下)-小窗(榆家梁)
 import ddFc_4 from './dandaoFcBd1.threejs'; // ddFc_2 单道-一个小窗两列扇叶
-import ddFc_2 from './dandaoFcBd2.threejs'; // ddFc_2 单道-一个小窗两列扇叶
+import ddFc_2 from './dandaoFcBd2.threejs'; // ddFc_2 单道-一个大窗两列竖型扇叶
 import ddFc_6 from './dandaoFcHjt.threejs'; // ddFc_6 单道-大窗1列扇叶(活鸡兔)
 import ddFc_7 from './dandaoFcBd3.threejs'; // ddFc_6 单道-大窗1列扇叶(活鸡兔)
 import { animateCamera } from '/@/utils/threejs/util';

Some files were not shown because too many files changed in this diff