Sfoglia il codice sorgente

[Style 0000] 公司端看板各个模块样式调整

houzekong 9 mesi fa
parent
commit
3ce740fb83

+ 7 - 1
src/views/vent/home/billboard/billboard.data.ts

@@ -161,7 +161,7 @@ export const VENTILATION_STATUS_HEADER_CONFIG = [
     type: 'green-to-left',
   },
   {
-    label: '通风巷道总长度(m)',
+    label: '巷道总长度(m)',
     prop: 'totallength',
     type: 'blue-to-right',
   },
@@ -245,6 +245,12 @@ export const DEFAULT_TEST_DATA = {
         num: 0,
         typeName: '/',
       },
+      {
+        deviceType: '/',
+        warnLevel: 0,
+        num: 0,
+        typeName: '/',
+      },
     ],
     dustWarnLevel: 0, // 矿井粉尘风险性等级
   },

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

@@ -39,7 +39,7 @@
       columns: () => [],
       collapses: () => [],
       data: () => [],
-      defaultValue: '-',
+      defaultValue: '/',
       contentHeight: '220px',
     }
   );

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

@@ -30,7 +30,7 @@
     {
       columns: () => [],
       data: () => [],
-      defaultValue: '-',
+      defaultValue: '/',
     }
   );
 

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

@@ -7,7 +7,7 @@
   import CommonTitle from './CommonTitle.vue';
   import { BillboardType, DEFAULT_TEST_DATA, DUST_STATUS_COLUMN, DUST_COLLAPSES } from '../billboard.data';
   import { ref, shallowRef, onMounted } from 'vue';
-  import _ from 'lodash-es';
+  import { get } from '../utils';
   // import mapComponent from './3Dmap/index.vue';
 
   const props = withDefaults(
@@ -33,8 +33,8 @@
       201: '报警',
       1001: '网络断开',
     };
-    risk.value = trans[_.get(info, 'dustWarnLevel', 0)];
-    tableData.value = _.get(info, 'dustTypeList', []).map((e) => {
+    risk.value = trans[get(info, 'dustWarnLevel', 0)];
+    tableData.value = get(info, 'dustTypeList', []).map((e) => {
       return {
         ...e,
         warnLevelStr: trans[e.warnLevel],

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

@@ -57,7 +57,7 @@
       201: '报警',
       1001: '网络断开',
     };
-    risk.value = riskTrans[_.get(info, 'fireWarnLevel', 0)];
+    risk.value = riskTrans[get(info, 'fireWarnLevel', 0)];
     _.forEach(info, (val, key) => {
       if (FIRE_STATUS_IGNORE_TRANSLATION_KEYS.includes(key)) return;
       info[key] = warnTrans[val];

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

@@ -5,7 +5,7 @@
       <LargeBoard :label="item.label" :value="headerData[item.prop]" :type="item.type" />
     </Col>
   </Row>
-  <CollapseTable class="mt-10px" :columns="GAS_STATUS_COLUMN" :data="tableData" :collapses="GAS_COLLAPSES" />
+  <CollapseTable class="mt-10px" :columns="GAS_STATUS_COLUMN" :data="tableData" :collapses="GAS_COLLAPSES" content-height="160px" />
 </template>
 <script lang="ts" setup>
   import _ from 'lodash-es';
@@ -14,6 +14,7 @@
   import LargeBoard from './LargeBoard.vue';
   import { onMounted, shallowRef } from 'vue';
   import CollapseTable from './CollapseTable.vue';
+  import { get } from '../utils';
   // import mapComponent from './components/3Dmap/index.vue';
 
   const props = withDefaults(
@@ -50,10 +51,10 @@
       1001: '网络断开',
     };
     headerData.value = {
-      gasWarnLevel: riskTrans[_.get(info, 'gasWarnLevel', 0)],
+      gasWarnLevel: riskTrans[get(info, 'gasWarnLevel', 0)],
       gasJudgeLevel: '低风险',
     };
-    tableData.value = _.get(info, 'gasTypeList', []).map((e) => {
+    tableData.value = get(info, 'gasTypeList', []).map((e) => {
       return {
         ...e,
         warnLevelStr: trans[e.warnLevel],

+ 7 - 7
src/views/vent/home/billboard/components/Summary.vue

@@ -8,12 +8,12 @@
   <CommonTable class="mt-10px" :columns="SUMMARY_COLUMN" :data="tableData" />
 </template>
 <script lang="ts" setup>
-  import _ from 'lodash-es';
   import { Row } from 'ant-design-vue';
   import { SUMMARY_HEADER_CONFIG, SUMMARY_COLUMN, DEFAULT_TEST_DATA, BillboardType } from '../billboard.data';
   import LargeBoard from './LargeBoard.vue';
   import { onMounted, shallowRef, ref } from 'vue';
   import CommonTable from './CommonTable.vue';
+  import { get } from '../utils';
   // import mapComponent from './components/3Dmap/index.vue';
 
   const props = withDefaults(
@@ -40,28 +40,28 @@
       104: '重大风险',
       201: '报警',
     };
-    headerData.value = _.get(sysInfo, SUMMARY_HEADER_CONFIG.prop, '/');
+    headerData.value = get(sysInfo, SUMMARY_HEADER_CONFIG.prop, '/');
     // 配合 SUMMARY_COLUMN 生成数据
     tableData.value = [
       {
         label: '火灾监测',
-        value: _.get(trans, _.get(sysInfo, ['fireS', 'maxLevel'], 0)),
+        value: get(trans, get(sysInfo, ['fireS', 'maxLevel'], 0)),
       },
       {
         label: '设备监测',
-        value: _.get(trans, _.get(sysInfo, ['deviceWarnInfo', 'maxLevel'], 0)),
+        value: get(trans, get(sysInfo, ['deviceWarnInfo', 'maxLevel'], 0)),
       },
       {
         label: '瓦斯监测',
-        value: _.get(trans, _.get(sysInfo, ['gasS', 'maxLevel'], 0)),
+        value: get(trans, get(sysInfo, ['gasS', 'maxLevel'], 0)),
       },
       {
         label: '粉尘监测',
-        value: _.get(trans, _.get(sysInfo, ['dustS', 'maxLevel'], 0)),
+        value: get(trans, get(sysInfo, ['dustS', 'maxLevel'], 0)),
       },
       {
         label: '通风监测',
-        value: _.get(trans, _.get(sysInfo, ['ventS', 'maxLevel'], 0)),
+        value: get(trans, get(sysInfo, ['ventS', 'maxLevel'], 0)),
       },
     ];
   }

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

@@ -11,13 +11,13 @@
   </Row>
 </template>
 <script lang="ts" setup>
-  import _ from 'lodash-es';
   import { Row, Col } from 'ant-design-vue';
   import { BasicTree } from '/@/components/Tree';
   import type { TreeProps } from 'ant-design-vue';
   import { BillboardType, DEFAULT_TEST_DATA, VENTILATION_STATUS_HEADER_CONFIG, VENTILATION_STATUS_TREE_CONFIG } from '../billboard.data';
   import MiniBoard from './MiniBoard.vue';
   import { ref, shallowRef, onMounted } from 'vue';
+  import { get } from '../utils';
   // import CommonTitle from './CommonTitle.vue';
   // import mapComponent from './components/3Dmap/index.vue';
 
@@ -44,7 +44,7 @@
     expandedKeys.value = [];
 
     // 处理树状图的数据
-    treeData.value = _.get(info, 'fanMainList', []).map((mainfan, i) => {
+    treeData.value = get(info, 'fanMainList', []).map((mainfan, i) => {
       expandedKeys.value.push(i.toString());
       return {
         title: `${prefix}${mainfan[prop]}${suffix}`,
@@ -60,7 +60,7 @@
 
           // 该部分数据有可能部分为undefined
           return {
-            title: `${child.prefix}${_.get(mainfan, child.prop, '/')}${child.suffix}`,
+            title: `${child.prefix}${get(mainfan, child.prop)}${child.suffix}`,
             key: `${i}-${j}`,
           };
         }),

+ 2 - 2
src/views/vent/home/billboard/utils.ts

@@ -3,7 +3,7 @@ import _ from 'lodash-es';
 /**
  * 功能类似 lodash.get 但是当取值为 null 时也直接返回默认值
  */
-export function get(o, p, defaultValue = '-') {
+export const get: typeof _.get = (o, p, defaultValue = '/') => {
   const d = _.get(o, p, defaultValue);
   return d === null ? defaultValue : d;
-}
+};