Browse Source

[Feat 0000] 首页全矿井通风监测可配置化

houzekong 1 week ago
parent
commit
aac15d83e5

+ 34 - 13
src/views/vent/home/configurable/components/MonitorBar.vue

@@ -1,11 +1,11 @@
 <template>
   <a-row class="midback-info" :gutter="5">
-    <div v-for="item in computedConfig" :key="item.class" class="middata" :class="item.class" @click="handleClick(item)">
+    <div v-for="item in computedConfig" :key="item.class" class="middata" :class="item.class" @click="handleClick(item.list)">
       <div class="midnumberval">{{ item.value }}</div>
       <div class="infotext1">{{ item.label }}</div>
     </div>
-    <BasicModal title="测风装置列表" @register="register">
-      {{ list }}
+    <BasicModal title="测风装置列表" @register="register" :destroyOnClose="true">
+      <a-table :dataSource="list" :columns="columns" />
     </BasicModal>
   </a-row>
 </template>
@@ -74,6 +74,19 @@
         {
           label: '总回风量(m³/min)',
           value: '${midinfo[0].sysinfo.info.totalRetM3}',
+          // list: {
+          //   readForm: '${windrect_jin}',
+          //   columns: [
+          //     {
+          //       title: '安装位置',
+          //       dataIndex: 'strinstallpos',
+          //     },
+          //     {
+          //       title: '预警等级',
+          //       dataIndex: 'warnLevel_str',
+          //     },
+          //   ],
+          // },
         },
         {
           label: '总进风量(m³/min)',
@@ -101,22 +114,30 @@
       return {
         label: getFormattedText(data, e.label),
         value: getFormattedText(data, e.value),
-        params: getFormattedText(data, e.params),
-        class: `middata${i} ${e.params ? 'cursor-pointer' : ''}`,
+        list: getFormattedText(data, e.list),
+        class: `middata${i} ${e.list ? 'cursor-pointer' : ''}`,
       };
     });
   });
 
   const list = ref<any[]>([]);
-
-  function handleClick(item: any) {
-    if (item.params) {
-      openModal();
-      fetchDetail(item.params);
-    }
+  const columns = ref<any[]>([
+    {
+      title: '安装位置',
+      dataIndex: 'strinstallpos',
+    },
+    {
+      title: '预警等级',
+      dataIndex: 'warnLevel_str',
+    },
+  ]);
+
+  function handleClick(config: any) {
+    if (!config) return;
+    const { readForm } = config;
+    list.value = get(props.data, readForm);
+    openModal();
   }
-
-  function fetchDetail(params: any) {}
 </script>
 <style lang="less" scoped>
   .midback-info {

+ 4 - 0
src/views/vent/home/configurable/configurable.api.ts

@@ -117,6 +117,10 @@ export const list = (params) => {
       });
     }
     if (res.windrect) {
+      const windrect_jin = res.windrect.filter((e) => e.ventMode == '0');
+      const windrect_hui = res.windrect.filter((e) => e.ventMode == '1');
+      res.windrect_jin = windrect_jin;
+      res.windrect_hui = windrect_hui;
       res.windrect.forEach((e) => {
         if (e.readData.m3) {
           e.readData.m3 = e.readData.m3.replace('-', '');

+ 6 - 0
src/views/vent/home/configurable/configurable.data.ts

@@ -6366,10 +6366,16 @@ export const testConfigVent182: Config[] = [
             {
               label: '总回风量(m³/min)',
               value: '${midinfo[0].sysinfo.info.totalRetM3}',
+              list: {
+                readForm: '${windrect_hui}',
+              },
             },
             {
               label: '总进风量(m³/min)',
               value: '${midinfo[0].sysinfo.info.totalIntM3}',
+              list: {
+                readForm: '${windrect_jin}',
+              },
             },
             {
               label: '计划风量(m³/min)',