Browse Source

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

lxh 10 months ago
parent
commit
bb31622317

+ 1 - 1
src/design/public.less

@@ -9,7 +9,7 @@
 // =================================
 
 ::-webkit-scrollbar {
-  width: 2px;
+  width: 7px !important;
   height: 4px;
 }
 

+ 171 - 142
src/views/vent/home/billboard/billboard.data.ts

@@ -1,149 +1,178 @@
 import leftImg from '/@/assets/images/files/homes/file.svg';
 import rightImg from '/@/assets/images/files/homes/sp.svg';
 
-// export interface TITLE_CONFIG {
-//   text: string;
-//   prop: string;
-//   translation?: Record<string | number, string>;
-//   default: string;
-// }
-// export interface HEADER_CONFIG {
-//   label: string;
-//   prop: string;
-//   translation?: Record<string | number, string>;
-//   default: string;
-// }
-// export interface TABLE_CONFIG {
-//   columns: { label: string; prop: string; _t?: boolean }[];
-//   collapses: { label: string; prop: string; _t?: boolean }[];
-//   translation?: Record<string | number, string>;
-//   default: string;
-// }
-// export interface CONTENT_CONFIG {
-//   src: string;
-//   text: string;
-//   prop: string;
-// }
-// export interface TREE_CONFIG {
-//   translation?: Record<string | number, string>;
-//   default: string;
-//   prefix: string;
-//   prop: string;
-//   suffix: string;
-//   children: {
-//     prefix: string;
-//     prop: string;
-//     suffix: string;
-//   }[];
-// }
+export type Translation = Record<string | number, string>;
+export interface TitleConfig {
+  label: string;
+  prop: string;
+  translation?: Translation;
+}
+export interface HeaderConfig {
+  label: string;
+  prop: string;
+  translation?: Translation;
+}
+export interface TableConfig {
+  prop: string;
+  columns: { label: string; prop: string; _t?: boolean }[];
+  collapses: { label: string; prop: string; _t?: boolean }[];
+  translation?: Translation;
+}
+export interface ListConfig {
+  icon: string;
+  label: string;
+  prop: string;
+  translation?: Translation;
+  collapses: { label: string; prop: string; _t?: boolean }[];
+}
+export interface OverviewConfig {
+  label: string;
+  prop: string;
+  src: string;
+}
+export interface TreeConfig {
+  prefix: string;
+  prop: string;
+  suffix: string;
+  children: {
+    prefix: string;
+    prop: string;
+    suffix: string;
+  }[];
+  translation?: Record<string | number, string>;
+}
 
-// /** 看板的总配置 */
-// export const BILLBOARD_CONFIG = {
-//   DustStatus: {
-//     title: {
-//       text: '',
-//       prop: '',
-//       translation: {},
-//     },
-//     table: {
-//       columns: [{ label: '', prop: '' }],
-//       collapses: [{ label: '', prop: '' }],
-//       translation: {},
-//     },
-//   },
-//   FileOverview: {
-//     content: [
-//       { src: leftImg, text: '文档总数', prop: 'totalNum' },
-//       { src: rightImg, text: '待审批数', prop: 'approvalNum' },
-//     ],
-//   },
-//   FireStatus: {
-//     title: {
-//       text: '',
-//       prop: '',
-//       translation: {},
-//     },
-//     list: [
-//       {
-//         icon: '',
-//         label: '',
-//         prop: '',
-//         type: '',
-//         translation: {},
-//         collapses: [{ label: '', prop: '' }],
-//       },
-//     ],
-//   },
-//   GasStatus: {
-//     header: [
-//       {
-//         label: '',
-//         prop: '',
-//         translation: {},
-//       },
-//     ],
-//     table: {
-//       columns: [],
-//       collapses: [],
-//       translation: {},
-//     },
-//   },
-//   Summary: {
-//     header: [
-//       {
-//         label: '',
-//         prop: '',
-//         translation: {},
-//       },
-//     ],
-//     table: {
-//       columns: [],
-//       translation: {},
-//     },
-//   },
-//   VentilationStatus: {
-//     header: [
-//       {
-//         label: '',
-//         prop: '',
-//         filte: '',
-//         translation: {},
-//       },
-//     ],
-//     tree: {
-//       prefix: '',
-//       prop: 'strname',
-//       suffix: '',
-//       children: [
-//         {
-//           prefix: '名称:',
-//           prop: 'strinstallpos',
-//           suffix: '',
-//         },
-//         {
-//           prefix: '1号风机风量:',
-//           prop: 'Fan1m3',
-//           suffix: '(m³/min)',
-//         },
-//         {
-//           prefix: '2号风机风量:',
-//           prop: 'Fan2m3',
-//           suffix: '(m³/min)',
-//         },
-//         {
-//           prefix: '频率:',
-//           prop: 'FanFreqHz',
-//           suffix: 'Hz',
-//         },
-//         {
-//           prefix: '三区阻力分布:',
-//           prop: 'sqzlfb',
-//           suffix: '',
-//         },
-//       ],
-//     },
-//   },
-// };
+/** 看板的总配置 */
+export const BillboardConfig: {
+  DustStatus: {
+    title: TitleConfig;
+    table: TableConfig;
+  };
+  FileOverview: {
+    contents: OverviewConfig[];
+  };
+  FireStatus: {
+    title: TitleConfig;
+    lists: ListConfig[];
+  };
+  GasStauts: {
+    headers: HeaderConfig[];
+    table: TableConfig;
+  };
+  Summary: {
+    headers: HeaderConfig[];
+    table: TableConfig;
+  };
+  VentilationStauts: {
+    headers: HeaderConfig[];
+    tree: TreeConfig;
+  };
+} = {
+  DustStatus: {
+    title: {
+      text: '',
+      prop: '',
+      translation: {},
+    },
+    table: {
+      columns: [{ label: '', prop: '' }],
+      collapses: [{ label: '', prop: '' }],
+      translation: {},
+    },
+  },
+  FileOverview: {
+    content: [
+      { src: leftImg, text: '文档总数', prop: 'totalNum' },
+      { src: rightImg, text: '待审批数', prop: 'approvalNum' },
+    ],
+  },
+  FireStatus: {
+    title: {
+      text: '',
+      prop: '',
+      translation: {},
+    },
+    list: [
+      {
+        icon: '',
+        label: '',
+        prop: '',
+        type: '',
+        translation: {},
+        collapses: [{ label: '', prop: '' }],
+      },
+    ],
+  },
+  GasStatus: {
+    header: [
+      {
+        label: '',
+        prop: '',
+        translation: {},
+      },
+    ],
+    table: {
+      columns: [],
+      collapses: [],
+      translation: {},
+    },
+  },
+  Summary: {
+    header: [
+      {
+        label: '',
+        prop: '',
+        translation: {},
+      },
+    ],
+    table: {
+      columns: [],
+      translation: {},
+    },
+  },
+  VentilationStatus: {
+    header: [
+      {
+        label: '',
+        prop: '',
+        filte: '',
+        translation: {},
+      },
+    ],
+    tree: {
+      prefix: '',
+      prop: 'strname',
+      suffix: '',
+      children: [
+        {
+          prefix: '名称:',
+          prop: 'strinstallpos',
+          suffix: '',
+        },
+        {
+          prefix: '1号风机风量:',
+          prop: 'Fan1m3',
+          suffix: '(m³/min)',
+        },
+        {
+          prefix: '2号风机风量:',
+          prop: 'Fan2m3',
+          suffix: '(m³/min)',
+        },
+        {
+          prefix: '频率:',
+          prop: 'FanFreqHz',
+          suffix: 'Hz',
+        },
+        {
+          prefix: '三区阻力分布:',
+          prop: 'sqzlfb',
+          suffix: '',
+        },
+      ],
+    },
+  },
+};
 
 // 基础的表格列配置,针对普通设备
 export const GAS_STATUS_COLUMN = [

+ 2 - 1
src/views/vent/home/billboard/components/GasStatus.vue

@@ -52,7 +52,8 @@
     };
     headerData.value = {
       gasWarnLevel: riskTrans[get(info, 'gasWarnLevel', 0)],
-      gasJudgeLevel: '低风险',
+      // gasJudgeLevel: '低风险',
+      gasJudgeLevel: props.data.orgcode == 'sdmtjtbdmk' ? '高瓦斯' : '低瓦斯',
     };
     tableData.value = get(info, 'gasTypeList', []).map((e) => {
       return {

+ 78 - 0
src/views/vent/home/billboard/utils.ts

@@ -1,4 +1,5 @@
 import _ from 'lodash-es';
+import { BillboardType, HeaderConfig, ListConfig, TableConfig, TitleConfig } from './billboard.data';
 
 /**
  * 功能类似 lodash.get 但是当取值为 null 时也直接返回默认值
@@ -7,3 +8,80 @@ export const get: typeof _.get = (o, p, defaultValue = '/') => {
   const d = _.get(o, p, defaultValue);
   return d === null ? defaultValue : d;
 };
+
+/** 依据配置获取适用于 CommonTitle 的数据 */
+export function parseTitleConfig(data: BillboardType, config: TitleConfig) {
+  const val = get(data, config.prop);
+  return {
+    label: config.label,
+    value: config.translation ? get(config.translation, val) : val,
+  };
+}
+
+/** 依据配置获取适用于 LargeBoard 的数据 */
+export function parseHeaderConfigs(data: BillboardType, configs: HeaderConfig[]) {
+  const types = ['to-top-right', 'to-bottom-right'];
+  return configs.map((cfg, i) => {
+    const val = get(data, cfg.prop);
+    return {
+      label: cfg.label,
+      value: cfg.translation ? get(cfg.translation, val) : val,
+      type: types[i % configs.length],
+    };
+  });
+}
+
+/** 依据配置获取适用于 CommonTable、CollapseTable 的数据 */
+export function parseTableConfig(data: BillboardType, config: TableConfig) {
+  const arr = get(data, config.prop, []);
+  if (config.translation) {
+    const finalRes = arr.reduce((res: any[], ele) => {
+      // 对于表格里的每条数据,如果需要翻译则翻译之
+      config.columns.forEach((col) => {
+        if (col._t) {
+          const v = get(ele, col.prop);
+          _.set(ele, col.prop, get(config.translation, v));
+        }
+      });
+      config.collapses.forEach((col) => {
+        if (col._t) {
+          const v = get(ele, col.prop);
+          _.set(ele, col.prop, get(config.translation, v));
+        }
+      });
+      res.push(ele);
+      return res;
+    }, []);
+
+    return {
+      data: finalRes,
+      collapses: config.collapses,
+      columns: config.columns,
+    };
+  } else {
+    return {
+      data,
+      collapses: config.collapses,
+      columns: config.columns,
+    };
+  }
+}
+
+/** 依据配置获取适用于 ListItem 的数据 */
+export function parseListConfigs(data: BillboardType, configs: ListConfig[]) {
+  const types = ['blue', 'green'];
+  return configs.map((cfg, i) => {
+    const val = get(data, cfg.prop);
+    return {
+      icon: cfg.icon,
+      label: cfg.label,
+      value: cfg.translation ? get(cfg.translation, val) : val,
+      type: types[i % configs.length],
+      collapses: cfg.collapses.map((col) => {
+        return {
+          label: col.label,
+        };
+      }),
+    };
+  });
+}

+ 66 - 56
src/views/vent/home/clique/components/dialog-modal.vue

@@ -51,7 +51,7 @@
         <span class="dw">%</span>
       </div>
     </div>
-    <div class="modal-card3">
+    <!-- <div class="modal-card3">
       <div class="warn-left">
         <div class="vent-l">
           <span class="warn-label">{{ vent.value }}</span>
@@ -70,20 +70,20 @@
           <span class="warn-value">{{ fire.label }}</span>
           <span class="warn-label">{{ fire.value }}</span>
         </div>
-        <!-- <div class="dust-r">
+        <div class="dust-r">
           <span class="warn-value">{{ dust.label }}</span>
           <span class="warn-label">{{ dust.value }}</span>
-        </div> -->
+        </div>
       </div>
-    </div>
+    </div> -->
   </div>
 </template>
 <script lang="ts" setup>
-  import { ref, reactive, defineProps, watch, inject } from 'vue';
+  import { ref, reactive, defineProps, watch } from 'vue';
   import { SvgIcon } from '/@/components/Icon';
   import { useSSO } from '/@/hooks/vent/useSSO';
   import { getAssetURL } from '/@/utils/ui';
-  const globalConfig = inject('globalConfig');
+  // const globalConfig = inject('globalConfig');
 
   let props = defineProps({
     centerDetail: {
@@ -111,14 +111,14 @@
   let labelM = ref('');
 
   let zlList = reactive([
-    { label: '关键阻力——进风', value: 0, percent: 0 },
-    { label: '关键阻力——用风', value: 0, percent: 0 },
-    { label: '关键阻力——回风', value: 0, percent: 0 },
+    { label: '关键阻力——进风', value: 0, percent: '0' },
+    { label: '关键阻力——用风', value: 0, percent: '0' },
+    { label: '关键阻力——回风', value: 0, percent: '0' },
   ]);
 
   let windLfList = reactive([
-    { label: '有效风量率', value: 0 },
-    { label: '矿井漏风率', value: 0 },
+    { label: '有效风量率', value: '0' },
+    { label: '矿井漏风率', value: '0' },
   ]);
 
   // let vent = reactive({
@@ -140,61 +140,71 @@
   //   label: '粉尘风险性',
   //   value: '低风险',
   // });
-  let vent = reactive({
-    // label: '总进风',
-    label: '总阻力',
-    value: 0,
-  });
+  // let vent = reactive({
+  //   // label: '总进风',
+  //   label: '总阻力',
+  //   value: 0,
+  // });
 
-  let gas = reactive({
-    label: '总风量',
-    value: 0,
-  });
+  // let gas = reactive({
+  //   label: '总风量',
+  //   value: 0,
+  // });
 
-  let fire = reactive({
-    label: '等积孔',
-    value: 0,
-  });
+  // let fire = reactive({
+  //   label: '等积孔',
+  //   value: 0,
+  // });
 
   // let dust = reactive({
   //   label: '粉尘风险性',
   //   value: '低风险',
   // });
 
+  // 选取各项数据是引用的索引,有些矿井存在多个关键阻力路线等,需要轮播
+  const pickIndex = ref(0);
+
   const emit = defineEmits(['closeDialog']);
 
   function getClose() {
     emit('closeDialog', false);
   }
 
+  // 根据新的数据更新依赖数据,核心方法
+  function update(newC) {
+    if (JSON.stringify(newC) != '{}') {
+      modalCard[0]['value'] = newC.sys_data.totallength || 0;
+      modalCard[1]['value'] = newC.sys_data.personCount || 0;
+      modalCard[2]['value'] = newC.sys_data.vehicleCount || 0;
+
+      // 根据目前轮播索引确定要展示的数据index
+      const majorIndex = pickIndex.value % newC.majorpath_data.length;
+
+      labelM.value = newC.majorpath_data[majorIndex].deviceName;
+      valueM.value = newC.majorpath_data[majorIndex].majorpath.drag_total;
+      zlList[0]['value'] = newC.majorpath_data[majorIndex].majorpath.drag_1;
+      zlList[1]['value'] = newC.majorpath_data[majorIndex].majorpath.drag_2;
+      zlList[2]['value'] = newC.majorpath_data[majorIndex].majorpath.drag_3;
+      zlList[0]['percent'] = ((zlList[0]['value'] / valueM.value) * 100).toFixed(2);
+      zlList[1]['percent'] = ((zlList[1]['value'] / valueM.value) * 100).toFixed(2);
+      zlList[2]['percent'] = ((zlList[2]['value'] / valueM.value) * 100).toFixed(2);
+
+      windLfList[0].value = newC.sys_data.useM3Perent || '0';
+      const base = parseFloat(newC.sys_data.zongfengliang);
+      windLfList[1].value = (((base - parseFloat(newC.sys_data.zongjinfeng)) / base) * 100).toFixed(2);
+
+      // vent.value = newC.majorpath_data[majorIndex].majorpath.drag_total;
+      // gas.value = newC.majorpath_data[majorIndex].majorpath.m3_total;
+      // fire.value = Math.round(((1.19 * gas.value) / 60 / Math.sqrt(vent.value)) * 100) / 100;
+    }
+  }
+
   watch(
     () => props.centerDetail,
-    (newC, oldC) => {
-      console.log(newC, '地图区域详情数据-------');
-      if (JSON.stringify(newC) != '{}') {
-        modalCard[0]['value'] = newC.sys_data.totallength || 0;
-        modalCard[1]['value'] = newC.sys_data.personCount || 0;
-        modalCard[2]['value'] = newC.sys_data.vehicleCount || 0;
-
-        labelM.value = newC.majorpath_data[0].deviceName;
-        valueM.value = newC.majorpath_data[0].majorpath.drag_total;
-        zlList[0]['value'] = newC.majorpath_data[0].majorpath.drag_1;
-        zlList[1]['value'] = newC.majorpath_data[0].majorpath.drag_2;
-        zlList[2]['value'] = newC.majorpath_data[0].majorpath.drag_3;
-        zlList[0]['percent'] = ((zlList[0]['value'] / valueM.value) * 100).toFixed(2);
-        zlList[1]['percent'] = ((zlList[1]['value'] / valueM.value) * 100).toFixed(2);
-        zlList[2]['percent'] = ((zlList[2]['value'] / valueM.value) * 100).toFixed(2);
-
-        windLfList[0].value = newC.sys_data.useM3Perent || 0;
-        windLfList[1].value = (
-          ((parseFloat(newC.sys_data.zongfengliang) - parseFloat(newC.sys_data.zongjinfeng)) / parseFloat(newC.sys_data.zongfengliang)) *
-          100
-        ).toFixed(2);
-
-        vent.value = newC.majorpath_data[0].majorpath.drag_total;
-        gas.value = newC.majorpath_data[0].majorpath.m3_total;
-        fire.value = Math.round(((1.19 * gas.value) / 60 / Math.sqrt(vent.value)) * 100) / 100;
-      }
+    (newC) => {
+      // 轮播 index + 1,这样 update 取值是可以根据该 index 取值,对 1000 取余是为了处理 Infinity 后无法轮播的情况(虽然不可能出现)
+      pickIndex.value = (pickIndex.value + 1) % 1000;
+      update(newC);
     },
     {
       immediate: true,
@@ -218,7 +228,7 @@
   .dialogModal {
     position: relative;
     width: 568px;
-    height: 437px;
+    height: 340px;
     background: url('/@/assets/images/company/area-card2.png') no-repeat;
     background-size: 100% 100%;
     pointer-events: none;
@@ -308,7 +318,7 @@
       top: 121px;
       left: 50%;
       transform: translate(-50%, 0);
-      height: 110px;
+      height: 116px;
       width: 90%;
       padding: 0px 10px;
       box-sizing: border-box;
@@ -455,13 +465,13 @@
 
     .modal-card2 {
       position: absolute;
-      top: 231px;
+      top: 240px;
       left: 50%;
       transform: translate(-50%, 0);
-      height: 50px;
+      height: 60px;
       width: 90%;
-      margin: 10px 0px;
-      padding: 0px 10px;
+      margin: 10px 0;
+      padding: 0 10px;
       display: flex;
       justify-content: space-between;
       align-items: center;

+ 33 - 40
src/views/vent/home/clique/components/scene-key.vue

@@ -36,6 +36,7 @@
   import { ref, reactive, defineProps, watch } from 'vue';
   import { SvgIcon } from '/@/components/Icon';
   import echartScene from '../components/echart-scene.vue';
+  import _ from 'lodash-es';
 
   let props = defineProps({
     compositeData: {
@@ -55,6 +56,7 @@
     { label: '等积孔', value: 0 },
   ]);
 
+  const selectIndex = ref(0);
   let selectVal = ref('');
   let selectList = ref<any[]>([]);
   let compositeDatas = ref<any[]>([]);
@@ -69,47 +71,38 @@
 
   //下拉选项切换
   function changeSelect(val) {
-    console.log(val, '下拉选项');
-    selectVal.value = val;
-    let datas = compositeDatas.value.filter((v) => v.deviceName == selectVal.value)[0];
-    echartData.jfq = datas.majorpath.drag_1;
-    echartData.yfq = datas.majorpath.drag_2;
-    echartData.hfq = datas.majorpath.drag_3;
-    echartData.zf = datas.majorpath.drag_total;
-
-    sceneList[0].value = datas.majorpath.drag_total;
-    sceneList[1].value = datas.majorpath.m3_total;
+    const data = compositeDatas.value.find((v, i) => {
+      if (v.deviceName == val) {
+        selectVal.value = val;
+        selectIndex.value = i;
+        return true;
+      }
+      return false;
+    });
+    echartData.jfq = data.majorpath.drag_1;
+    echartData.yfq = data.majorpath.drag_2;
+    echartData.hfq = data.majorpath.drag_3;
+    echartData.zf = data.majorpath.drag_total;
+
+    sceneList[0].value = data.majorpath.drag_total;
+    sceneList[1].value = data.majorpath.m3_total;
     sceneList[2].value = Math.round(((1.19 * sceneList[1].value) / 60 / Math.sqrt(sceneList[0].value)) * 100) / 100;
   }
 
   watch(
     () => props.compositeData,
-    (newS, oldS) => {
-      console.log(newS, '综合监测数据------------');
+    (newS) => {
       compositeDatas.value = newS;
       if (newS.length != 0) {
         selectList.value = newS.map((el: any) => ({ label: el.deviceName, value: el.deviceName }));
-        if (selectVal.value) {
-          let datas = newS.filter((v) => v.deviceName == selectVal.value)[0];
-          echartData.jfq = datas.majorpath.drag_1;
-          echartData.yfq = datas.majorpath.drag_2;
-          echartData.hfq = datas.majorpath.drag_3;
-          echartData.zf = datas.majorpath.drag_total;
-
-          sceneList[0].value = datas.majorpath.drag_total;
-          sceneList[1].value = datas.majorpath.m3_total;
-          sceneList[2].value = Math.round(((1.19 * sceneList[1].value) / 60 / Math.sqrt(sceneList[0].value)) * 100) / 100;
-        } else {
+        if (!selectVal.value) {
           selectVal.value = selectList.value[0].value;
-          console.log(selectVal.value, '0009999');
-          echartData.jfq = newS[0].majorpath.drag_1;
-          echartData.yfq = newS[0].majorpath.drag_2;
-          echartData.hfq = newS[0].majorpath.drag_3;
-          echartData.zf = newS[0].majorpath.drag_total;
-
-          sceneList[0].value = newS[0].majorpath.drag_total;
-          sceneList[1].value = newS[0].majorpath.m3_total;
-          sceneList[2].value = Math.round(((1.19 * sceneList[1].value) / 60 / Math.sqrt(sceneList[0].value)) * 100) / 100;
+          changeSelect(selectVal.value);
+        } else {
+          // 向下寻找一个新选项以实现轮播
+          const options = selectList.value;
+          const val = _.get(options, [(selectIndex.value + 1) % options.length, 'value']);
+          changeSelect(val);
         }
       }
     },
@@ -193,6 +186,7 @@
           height: 32px;
           background: url('../../../../../assets/images/company/fxfx.png') no-repeat center;
           background-size: 100% 100%;
+          display: flex;
 
           .box-icon {
             position: absolute;
@@ -202,22 +196,21 @@
           }
 
           .box-label {
-            position: absolute;
-            left: 56px;
-            top: 50%;
-            transform: translate(0, -50%);
+            margin-left: 56px;
+            width: 50px;
+            display: block;
             color: #fff;
             font-size: 14px;
+            line-height: 32px;
           }
 
           .box-value {
-            position: absolute;
-            right: 96px;
-            top: 50%;
-            transform: translate(0, -48%);
+            width: 130px;
             font-family: 'douyuFont';
             font-size: 14px;
             color: #31fbcc;
+            line-height: 32px;
+            text-align: end;
           }
 
           .box-img {

+ 1 - 1
src/views/vent/home/clique/index.vue

@@ -102,7 +102,7 @@
         timer = null;
       }
       getMonitor();
-    }, 5000);
+    }, 10000);
   }
 
   //获取公司端首页数据

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

@@ -46,7 +46,7 @@ export const locationList = [
 ];
 
 export function getMonitorComponent() {
-  let { sysOrgCode } = useGlobSetting();
+  const { sysOrgCode } = useGlobSetting();
   // sysOrgCode = 'sdmtjtbdmk';
   let FiberModal;
   switch (sysOrgCode) {

+ 5 - 3
src/views/vent/monitorManager/deviceMonitor/components/device/index.vue

@@ -436,7 +436,7 @@ const systemID = ref('') // 系统监测时,系统id
 const selectedKeys = ref<string[]>([]);
 const expandedKeys = ref<string[]>([]);
 const scroll = reactive({
-  y: 210
+  y: 180
 })
 const treeData = ref<TreeProps['treeData']>([]);
 let departmentInfo: Null | Object = null
@@ -464,12 +464,11 @@ const onSelect: TreeProps['onSelect'] = (keys, e) => {
   if (startMonitorTimer) {
     clearTimeout(startMonitorTimer)
   }
+  dataSource.value = []
   startMonitorTimer = setTimeout(() => {
     expandedKeys.value = keys
     selectedKeys.value = keys
     treeNodeTitle.value = e.node.title
-    console.log('树选择器--------------->', selectedKeys.value, treeNodeTitle.value, e)
-    dataSource.value = []
     activeKey.value = '1'
     timer = null
     if (e.node.children?.length < 1) {
@@ -700,6 +699,7 @@ function goDetail(record?) {
       modalVisible.value = true;
     } else if (deviceType.value.startsWith('bundletube')) {
       currentModal.value = BundleModal
+      // currentModal.value = BallvalveModal
       modalVisible.value = true;
     } else if (deviceType.value.startsWith('ballvalve')) {
       currentModal.value = BallvalveModal
@@ -926,6 +926,8 @@ onMounted(async () => {
   } else {
     locationList.value = await devPosition({})
   }
+  
+
   // safetyOption.value = await safetyDeviceList(null, { devicetype: 'safetymonitor', code: 'dataTypeName' })
 })
 

+ 42 - 10
src/views/vent/monitorManager/deviceMonitor/components/device/modal/ballvalve.modal.vue

@@ -1,5 +1,5 @@
 <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
@@ -212,8 +212,20 @@
           </div>
         </div>
         <div class="right-bottom">
-          <span class="base-title">设备监测曲线</span>
-          <a-table size="small" :columns="ballvalveColumns" :data-source="[]" :pagination="false" :scroll="{ y: 300 }" />
+          <span class="base-title">设备监测</span>
+          <!-- <a-table size="small" :columns="ballvalveColumns" :data-source="historyList" :pagination="false" :scroll="{ y: 300 }" /> -->
+          <div class="echarts-box">
+            <BarAndLine
+              class="echarts-line"
+              xAxisPropType="time"
+              :dataSource="historyList"
+              height="100%"
+              width="100%"
+              :chartsColumns="chartsColumns"
+              :option="echatsOption"
+              chartsType="listMonitor"
+            />
+          </div>
         </div>
       </div>
     </div>
@@ -224,9 +236,11 @@
   import { BasicModal, useModalInner } from '/@/components/Modal';
   import BarAndLine from '/@/components/chart/BarAndLine.vue';
   import { SvgIcon } from '/@/components/Icon';
+  import { chartsColumnList } from '../device.data';
   import { Decoration7 as DvDecoration7, ScrollBoard as DvScrollBoard } from '@kjgl77/datav-vue3';
   import dayjs from 'dayjs';
   import { ballvalveColumns } from '../device.data';
+  import { getTableHeaderColumns } from '/@/hooks/web/useWebColumns';
 
   export default defineComponent({
     components: { BasicModal, BarAndLine, SvgIcon, DvScrollBoard, DvDecoration7 },
@@ -243,6 +257,20 @@
       const historyList = ref<any[]>([]);
       const posList = ref<any[]>([]);
       const posMonitor = shallowRef({});
+      const chartsColumnArr = getTableHeaderColumns('ballvalve_chart');
+      const chartsColumns = chartsColumnArr.length > 0 ? chartsColumnArr : chartsColumnList;
+      const echatsOption = {
+        grid: {
+          top: '20%',
+          left: '-5',
+          right: '45',
+          bottom: '0',
+          containLabel: true,
+        },
+        toolbox: {
+          feature: {},
+        },
+      };
 
       const [register, { setModalProps, closeModal }] = useModalInner();
 
@@ -308,6 +336,9 @@
         historyList,
         activeDeviceID,
         posMonitor,
+        echatsOption,
+        chartsColumnList,
+        chartsColumns,
       };
     },
   });
@@ -399,7 +430,8 @@
             width: 120px;
           }
           .value {
-            width: 100px;
+            width: 150px;
+            text-overflow: ellipsis;
           }
         }
       }
@@ -472,19 +504,19 @@
         }
         .item-data {
           position: relative;
-          height: 130px;
+          height: 120px;
           padding-top: 0;
           .icon {
             position: absolute;
             left: 20px;
-            top: 30px;
+            top: 25px;
             // margin-right: 30px;
             // margin-top: 25px;
           }
           .item-container {
             width: 140px;
             position: absolute;
-            padding-top: 18px;
+            padding-top: 15px;
             justify-content: flex-start;
             right: 0;
             .value {
@@ -553,7 +585,7 @@
             :deep(.dv-scroll-board) {
               .row-item {
                 height: 40px !important;
-                line-height: 40px !important;
+                line-height: 35px !important;
               }
 
               .header-item {
@@ -566,11 +598,11 @@
       }
 
       .right-bottom {
-        margin-top: 20px;
+        margin-top: 10px;
 
         .echarts-box {
           width: 100%;
-          height: 320px;
+          height: 180px;
           position: relative;
 
           .echarts-line {

+ 0 - 1
src/views/vent/monitorManager/deviceMonitor/index.vue

@@ -53,7 +53,6 @@
   );
 
   onMounted(() => {
-    debugger;
     const { type, deviceType, topage } = route.query;
     deviceKind.value = deviceType as string;
     if (!topage) {

+ 16 - 6
src/views/vent/monitorManager/fanLocalMonitor/index.vue

@@ -94,16 +94,25 @@
         </div>
         <!-- fanlocal_systeml_zj 模拟局部风机,不显示操作按钮 -->
         <template v-for="(item, index) in modalTypeArr.leftBtnArr" :key="index">
-          <div v-if="hasPermission(item.permission)" :class="{ 'button-box': btnClick, 'button-disable': !btnClick }" @click="showModal(item)">{{
-            item.value
-          }}</div>
+          <div
+            v-if="!(selectData.fanFrequencyType == 'fandp' && item.permission.startsWith('btn:frequency')) && hasPermission(item.permission)"
+            :class="{ 'button-box': btnClick, 'button-disable': !btnClick }"
+            @click="showModal(item)"
+            >{{ item.value }}</div
+          >
         </template>
       </div>
       <div class="top-right row">
         <template v-for="(item, index) in modalTypeArr.rightBtnArr" :key="index">
-          <div v-if="hasPermission(item.permission)" :class="{ 'button-box': btnClick, 'button-disable': !btnClick }" @click="showModal(item)">{{
-            item.value
-          }}</div>
+          <div
+            v-if="
+              !(selectData.fanFrequencyType == 'fandp' && (item.permission === 'fanLocal:gasAlarmSet' || item.permission === 'fanLocal:kkjc')) &&
+              hasPermission(item.permission)
+            "
+            :class="{ 'button-box': btnClick, 'button-disable': !btnClick }"
+            @click="showModal(item)"
+            >{{ item.value }}</div
+          >
         </template>
       </div>
     </div>
@@ -692,6 +701,7 @@
     netStatus: '0', //通信状态
     warnLevel_str: '',
     stationname: '',
+    fanFrequencyType: '',
   };
   const frequencyVal = ref(0);
   const dataSource = ref([]);