|
@@ -1,17 +1,18 @@
|
|
|
<!-- eslint-disable vue/multi-word-component-names -->
|
|
|
<template>
|
|
|
<Row justify="space-around">
|
|
|
- <Col v-for="(item, i) in SUMMARY_HEADER_CONFIG" :key="`svvhbcgs${i}`" :span="10">
|
|
|
- <LargeBoard :label="item.label" :value="headerData[item.prop]" :type="item.type" />
|
|
|
- </Col>
|
|
|
+ <!-- <Col> -->
|
|
|
+ <LargeBoard :label="SUMMARY_HEADER_CONFIG.label" :value="headerData" :type="SUMMARY_HEADER_CONFIG.type" />
|
|
|
+ <!-- </Col> -->
|
|
|
</Row>
|
|
|
<CommonTable class="mt-10px" :columns="SUMMARY_COLUMN" :data="tableData" />
|
|
|
</template>
|
|
|
<script lang="ts" setup>
|
|
|
- import { Row, Col } from 'ant-design-vue';
|
|
|
+ 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 { watch, shallowRef } from 'vue';
|
|
|
+ import { watch, shallowRef, ref } from 'vue';
|
|
|
import CommonTable from './CommonTable.vue';
|
|
|
// import mapComponent from './components/3Dmap/index.vue';
|
|
|
|
|
@@ -24,11 +25,13 @@
|
|
|
}
|
|
|
);
|
|
|
|
|
|
- const headerData = shallowRef({});
|
|
|
- const tableData = shallowRef<BillboardType['gasInfo']['gasTypeList']>([]);
|
|
|
+ const headerData = ref('/');
|
|
|
+ const tableData = shallowRef<any[]>([]);
|
|
|
|
|
|
function fetchData() {
|
|
|
- const info = props.data.gasInfo || DEFAULT_TEST_DATA.gasInfo;
|
|
|
+ const info = props.data.sys_warndata;
|
|
|
+ if (!info) return;
|
|
|
+ const sysInfo = info.info.sysInfo;
|
|
|
const trans = {
|
|
|
0: '低风险',
|
|
|
101: '低风险',
|
|
@@ -36,18 +39,31 @@
|
|
|
103: '较大风险',
|
|
|
104: '重大风险',
|
|
|
201: '报警',
|
|
|
- 1001: '网络断开',
|
|
|
};
|
|
|
- headerData.value = {
|
|
|
- gasWarnLevel: trans[info.gasWarnLevel],
|
|
|
- gasJudgeLevel: '低风险',
|
|
|
- };
|
|
|
- tableData.value = info.gasTypeList.map((e) => {
|
|
|
- return {
|
|
|
- ...e,
|
|
|
- warnLevelStr: trans[e.warnLevel],
|
|
|
- };
|
|
|
- });
|
|
|
+ headerData.value = _.get(sysInfo, SUMMARY_HEADER_CONFIG.prop, '/');
|
|
|
+ // 配合 SUMMARY_COLUMN 生成数据
|
|
|
+ tableData.value = [
|
|
|
+ {
|
|
|
+ label: '火灾监测',
|
|
|
+ value: _.get(trans, _.get(sysInfo, ['fireS', 'maxLevel'], 0)),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '设备监测',
|
|
|
+ value: _.get(trans, _.get(sysInfo, ['deviceWarnInfo', 'maxLevel'], 0)),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '瓦斯监测',
|
|
|
+ value: _.get(trans, _.get(sysInfo, ['gasS', 'maxLevel'], 0)),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '粉尘监测',
|
|
|
+ value: _.get(trans, _.get(sysInfo, ['dustS', 'maxLevel'], 0)),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '通风监测',
|
|
|
+ value: _.get(trans, _.get(sysInfo, ['ventS', 'maxLevel'], 0)),
|
|
|
+ },
|
|
|
+ ];
|
|
|
}
|
|
|
|
|
|
watch(
|
|
@@ -58,4 +74,14 @@
|
|
|
{ immediate: true }
|
|
|
);
|
|
|
</script>
|
|
|
-<style lang="less" scoped></style>
|
|
|
+<style lang="less" scoped>
|
|
|
+ .value104 {
|
|
|
+ color: #ff0000;
|
|
|
+ }
|
|
|
+ .value103 {
|
|
|
+ color: #ff8800;
|
|
|
+ }
|
|
|
+ .value102 {
|
|
|
+ color: #ffff00;
|
|
|
+ }
|
|
|
+</style>
|