Selaa lähdekoodia

[Mod 0000] 看板数据修改

houzekong 11 kuukautta sitten
vanhempi
commit
625720afa2

+ 12 - 12
src/views/vent/home/billboard/billboard.data.ts

@@ -76,27 +76,27 @@ export const FIRE_STATUS_LIST = [
   {
     icon: 'warning-tubes',
     label: '矿井束管监测系统报警',
-    prop: 'a',
+    prop: 'b',
   },
   {
     icon: 'warning-smoke-2',
     label: '矿井烟雾传感器报警',
-    prop: 'a',
+    prop: 'c',
   },
   {
     icon: 'warning-CO-2',
     label: '矿井CO传感器报警',
-    prop: 'a',
+    prop: 'd',
   },
   {
     icon: 'warning-temp',
     label: '矿井温度传感器报警',
-    prop: 'a',
+    prop: 'e',
   },
   {
     icon: 'warning-max-temp',
     label: '矿井温度传感器最高值',
-    prop: 'a',
+    prop: 'f',
   },
 ];
 
@@ -109,23 +109,23 @@ export const FILE_OVERVIEW_CONFIG = [
 // 通风状态监测相关的内容配置项
 export const VENTILATION_STATUS_HEADER_CONFIG = [
   {
-    label: '总进风量',
+    label: '总进风量(m³/min)',
     prop: 'a',
     type: 'blue-to-left',
   },
   {
-    label: '总回风量',
-    prop: 'a',
+    label: '总回风量(m³/min)',
+    prop: 'b',
     type: 'green-to-right',
   },
   {
-    label: '总需风量',
-    prop: 'a',
+    label: '总需风量(m³/min)',
+    prop: 'c',
     type: 'green-to-left',
   },
   {
     label: '通风巷道总长度',
-    prop: 'a',
+    prop: 'd',
     type: 'blue-to-right',
   },
 ];
@@ -139,7 +139,7 @@ export const GAS_STATUS_HEADER_CONFIG = [
   },
   {
     label: '瓦斯鉴定等级',
-    prop: 'a',
+    prop: 'b',
     type: 'to-top-right',
   },
 ];

+ 8 - 2
src/views/vent/home/billboard/components/DustStatus.vue

@@ -1,6 +1,6 @@
 <!-- eslint-disable vue/multi-word-component-names -->
 <template>
-  <CommonTitle class="mb-10px" label="矿井火灾风险性等级" :value="risk" />
+  <CommonTitle class="mb-10px" label="矿井粉尘风险性等级" :value="risk" />
   <CommonTable :columns="BASIC_COLUMN" :data="data" />
 </template>
 <script lang="ts" setup>
@@ -11,6 +11,12 @@
   // import mapComponent from './3Dmap/index.vue';
 
   const risk = ref('低风险');
-  const data = ref([{ a: 1, b: 2, c: 3 }]);
+  const data = ref([
+    { a: 'XXXXX', b: 2, c: '正常' },
+    { a: 'XXXXX', b: 21, c: '正常' },
+    { a: 'XXXXX', b: 22, c: '正常' },
+    { a: 'XXXXX', b: 12, c: '正常' },
+    { a: 'XXXXX', b: 42, c: '异常' },
+  ]);
 </script>
 <style lang="less" scoped></style>

+ 9 - 3
src/views/vent/home/billboard/components/FireStatus.vue

@@ -2,7 +2,7 @@
 <template>
   <CommonTitle class="mb-10px" label="矿井火灾风险性等级" :value="risk" />
   <ListItem
-    v-for="(item, i) in list"
+    v-for="(item, i) in FIRE_STATUS_LIST"
     :key="item.icon"
     :icon="item.icon"
     :label="item.label"
@@ -17,9 +17,15 @@
   import ListItem from './ListItem.vue';
   import { FIRE_STATUS_LIST } from '../billboard.data';
 
-  const list = ref(FIRE_STATUS_LIST);
   const risk = ref('低风险');
 
-  const data = ref({});
+  const data = ref({
+    a: '正常',
+    b: '正常',
+    c: '正常',
+    d: '正常',
+    e: '正常',
+    f: '22℃',
+  });
 </script>
 <style lang="less" scoped></style>

+ 11 - 4
src/views/vent/home/billboard/components/GasStatus.vue

@@ -1,8 +1,8 @@
 <!-- eslint-disable vue/multi-word-component-names -->
 <template>
   <Row justify="space-around">
-    <Col v-for="(item, i) in headerConfig" :key="`svvhbcgs${i}`" :span="10">
-      <LargeBoard :label="item.label" :value="data[item.prop]" :type="item.type" />
+    <Col v-for="(item, i) in GAS_STATUS_HEADER_CONFIG" :key="`svvhbcgs${i}`" :span="10">
+      <LargeBoard :label="item.label" :value="headerData[item.prop]" :type="item.type" />
     </Col>
   </Row>
   <CommonTable class="mt-10px" :columns="BASIC_COLUMN" :data="data" />
@@ -15,7 +15,14 @@
   import CommonTable from './CommonTable.vue';
   // import mapComponent from './components/3Dmap/index.vue';
 
-  const headerConfig = ref(GAS_STATUS_HEADER_CONFIG);
-  const data = ref([{ a: 1, b: 2, c: 3 }]);
+  const headerData = ref({
+    a: '低风险',
+    b: '低风险',
+  });
+  const data = ref([
+    { a: '瓦斯抽采泵站', b: 2, c: '正常' },
+    { a: '瓦斯监测传感器', b: 12, c: '正常' },
+    { a: '瓦斯巡检机器人', b: 23, c: '异常' },
+  ]);
 </script>
 <style lang="less" scoped></style>

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

@@ -32,7 +32,7 @@
     height: 62px;
     line-height: 62px;
     // width: 200px;
-    padding: 0 30px;
+    padding: 0 10px;
     box-sizing: border-box;
     background-size: 100% auto;
   }

+ 29 - 9
src/views/vent/home/billboard/components/VentilationStatus.vue

@@ -1,7 +1,7 @@
 <!-- eslint-disable vue/multi-word-component-names -->
 <template>
   <Row justify="space-between">
-    <Col v-for="(item, i) in headerConfig" :key="`svvhbcvs${i}`" :span="12">
+    <Col v-for="(item, i) in VENTILATION_STATUS_HEADER_CONFIG" :key="`svvhbcvs${i}`" :span="12">
       <MiniBoard :label="item.label" :value="data[item.prop]" :type="item.type" />
     </Col>
     <div class="ventilate-status-card">
@@ -20,36 +20,56 @@
   import CommonTitle from './CommonTitle.vue';
   // import mapComponent from './components/3Dmap/index.vue';
 
-  const headerConfig = ref(VENTILATION_STATUS_HEADER_CONFIG);
-  const data = ref({});
+  const data = ref({
+    a: '13000',
+    b: '13000',
+    c: '13000',
+    d: '98765',
+  });
   const ventilatorCount = ref('0');
   const treeData: TreeProps['treeData'] = [
     {
-      title: 'parent 1',
+      title: '1号回风斜井回风系统',
       key: '0-0',
       children: [
         {
-          title: 'parent 1-0',
+          title: '名称:松定霍洛主通风机',
           key: '0-0-0',
         },
         {
-          title: 'parent 1-1',
+          title: '风量:6000(m³/min)',
           key: '0-0-1',
         },
+        {
+          title: '频率:30Hz',
+          key: '0-0-2',
+        },
+        {
+          title: '三区阻力分布:30%-40%-30%',
+          key: '0-0-3',
+        },
       ],
     },
     {
-      title: 'parent 2',
+      title: '2号回风立井回风系统',
       key: '1-0',
       children: [
         {
-          title: 'parent 2-0',
+          title: '名称:松定霍洛主通风机',
           key: '1-0-0',
         },
         {
-          title: 'parent 2-1',
+          title: '风量:6000(m³/min)',
           key: '1-0-1',
         },
+        {
+          title: '频率:30Hz',
+          key: '1-0-2',
+        },
+        {
+          title: '三区阻力分布:30%-40%-30%',
+          key: '1-0-3',
+        },
       ],
     },
   ];

+ 4 - 2
src/views/vent/home/configurable/components/CostumeHeader.vue

@@ -40,6 +40,7 @@
 
   // 选择了某一项
   function selectHandler({ key, item }) {
+    console.log('debug', key, item);
     selectedKey.value = key;
     selectedLabel.value = item.title;
     emit('change', key);
@@ -49,8 +50,9 @@
     // 获取数据
     props.api().then((opts) => {
       options.value = opts;
-      selectedKey.value = opts[0]?.key;
-      selectedLabel.value = opts[0]?.label;
+      selectHandler({ key: opts[0]?.key, item: { title: opts[0]?.label } });
+      // selectedKey.value = opts[0]?.key;
+      // selectedLabel.value = opts[0]?.label;
     });
   });
 </script>

+ 9 - 2
src/views/vent/home/configurable/components/SubVentilate.vue

@@ -27,12 +27,18 @@
     cfgList({
       deviceType: 'devicekind',
     }).then(({ records }) => {
-      configs.value = JSON.parse(records[0]?.moduleData);
+      const moduleData = JSON.parse(records[0]?.moduleData);
+      configs.value = Object.keys(moduleData).map((k) => {
+        return {
+          prop: k,
+          label: moduleData[k],
+        };
+      });
     });
   }
 
   const devices = ref<any[]>([]);
-  const selectedDevice = ref<any>();
+  const selectedDevice = ref<any>({});
   function selectDeviceByID(id: string) {
     selectedDevice.value = devices.value.find((e) => {
       return e.id === id;
@@ -44,6 +50,7 @@
       devicekind,
     }).then(({ records }) => {
       devices.value = records;
+      selectDeviceByID(records[0]?.id);
       return records.map((e) => {
         return {
           label: e.strinstallpos,