|
@@ -1,41 +1,73 @@
|
|
<template>
|
|
<template>
|
|
- <a-spin tip="Loading..." :spinning="loading">
|
|
|
|
- <div class="monitor-container">
|
|
|
|
- <div style="position: absolute; height: 40px; width: 100%; top: calc(50%-20px); font-size: 20px; color: red; text-align: center">
|
|
|
|
- {{ deviceInfo.warnDes }}
|
|
|
|
|
|
+ <div
|
|
|
|
+ v-show="!loading"
|
|
|
|
+ id="dedustCss"
|
|
|
|
+ style="width: 100%; height: 100%; position: absolute; pointer-events: none; overflow: hidden; z-index: 2; top: 0px; left: 0px"
|
|
|
|
+ >
|
|
|
|
+ <FourBorderBg id="dedustEnvA">
|
|
|
|
+ <div class="monitor-item" v-for="(data, index) in dedustEnvModalA" :key="index" :id="`dedustCss3D${index}`">
|
|
|
|
+ <span class="monitor-title">{{ data.label }}:</span>
|
|
|
|
+ <span class="monitor-val">{{ get(deviceInfo, data.prop, '-') }}</span>
|
|
</div>
|
|
</div>
|
|
- <div class="lr left-box vent-margin-t-10">
|
|
|
|
- <ventBox1>
|
|
|
|
- <template #title>
|
|
|
|
- <div>除尘机状态</div>
|
|
|
|
- </template>
|
|
|
|
- <template #container>
|
|
|
|
- <List icon="warning-title" type="status-light" :labelWidth="130" layout="double-columns" title="故障状态" v-bind="dedustStatusPropA" />
|
|
|
|
- <List icon="warning-title" type="status-light" :labelWidth="300" title="报警状态" v-bind="dedustStatusPropB" />
|
|
|
|
- <List icon="warning-title" type="status-light" :labelWidth="280" title="激活状态" v-bind="dedustStatusPropC" />
|
|
|
|
- </template>
|
|
|
|
- </ventBox1>
|
|
|
|
- </div>
|
|
|
|
- <div class="lr right-box">
|
|
|
|
- <ventBox1 class="vent-margin-t-10">
|
|
|
|
- <template #title>
|
|
|
|
- <div>监测参数</div>
|
|
|
|
- </template>
|
|
|
|
- <template #container>
|
|
|
|
- <List :labelWidth="200" v-bind="dedustMonitorProp" />
|
|
|
|
- </template>
|
|
|
|
- </ventBox1>
|
|
|
|
|
|
+ <!-- <div class="title">
|
|
|
|
+ {{ monitorData[groupNum - 1]['strname'] }}
|
|
|
|
+ </div> -->
|
|
|
|
+ </FourBorderBg>
|
|
|
|
+ <FourBorderBg id="dedustEnvB">
|
|
|
|
+ <div class="monitor-item" v-for="(data, index) in dedustEnvModalB" :key="index" :id="`dedustCss3D${index}`">
|
|
|
|
+ <span class="monitor-title">{{ data.label }}:</span>
|
|
|
|
+ <span class="monitor-val">{{ get(deviceInfo, data.prop, '-') }}</span>
|
|
</div>
|
|
</div>
|
|
|
|
+ </FourBorderBg>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="monitor-container">
|
|
|
|
+ <div style="position: absolute; height: 40px; width: 100%; top: calc(50%-20px); font-size: 20px; color: red; text-align: center">
|
|
|
|
+ {{ deviceInfo.warnDes }}
|
|
|
|
+ </div>
|
|
|
|
+ <div class="lr left-box vent-margin-t-10">
|
|
|
|
+ <ventBox1>
|
|
|
|
+ <template #title>
|
|
|
|
+ <div>除尘机状态</div>
|
|
|
|
+ </template>
|
|
|
|
+ <template #container>
|
|
|
|
+ <List icon="warning-title" type="status-light" :labelWidth="130" layout="double-columns" title="故障状态" v-bind="dedustStatusPropA" />
|
|
|
|
+ <List icon="warning-title" type="status-light" :labelWidth="300" title="报警状态" v-bind="dedustStatusPropB" />
|
|
|
|
+ <List icon="warning-title" type="status-light" :labelWidth="280" title="激活状态" v-bind="dedustStatusPropC" />
|
|
|
|
+ </template>
|
|
|
|
+ </ventBox1>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="lr right-box">
|
|
|
|
+ <ventBox1 class="vent-margin-t-10">
|
|
|
|
+ <template #title>
|
|
|
|
+ <div>监测参数</div>
|
|
|
|
+ </template>
|
|
|
|
+ <template #container>
|
|
|
|
+ <List :labelWidth="200" v-bind="dedustMonitorProp" />
|
|
|
|
+ </template>
|
|
|
|
+ </ventBox1>
|
|
|
|
+ <ventBox1>
|
|
|
|
+ <template #title>
|
|
|
|
+ <div>环境参数</div>
|
|
|
|
+ </template>
|
|
|
|
+ <template #container>
|
|
|
|
+ <List :labelWidth="200" v-bind="dedustEnvProp" />
|
|
|
|
+ </template>
|
|
|
|
+ </ventBox1>
|
|
</div>
|
|
</div>
|
|
- </a-spin>
|
|
|
|
|
|
+ </div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
- import { onBeforeMount, ref, onMounted, onUnmounted, reactive, defineProps, computed } from 'vue';
|
|
|
|
|
|
+ import FourBorderBg from '/@/views/vent/comment/components/fourBorderBg.vue';
|
|
|
|
+ import { onBeforeMount, ref, onMounted, onUnmounted, defineProps, computed } from 'vue';
|
|
import { list } from '../dedust.api';
|
|
import { list } from '../dedust.api';
|
|
import ventBox1 from '/@/components/vent/ventBox1.vue';
|
|
import ventBox1 from '/@/components/vent/ventBox1.vue';
|
|
|
|
+ import { mountedThree, destroy, setModelType } from '../dedust.threejs';
|
|
// import { SvgIcon } from '/@/components/Icon';
|
|
// import { SvgIcon } from '/@/components/Icon';
|
|
import {
|
|
import {
|
|
|
|
+ dedustEnvConfig,
|
|
|
|
+ dedustEnvModalA,
|
|
|
|
+ dedustEnvModalB,
|
|
dedustMonitorConfig,
|
|
dedustMonitorConfig,
|
|
dedustStatusConfigA,
|
|
dedustStatusConfigA,
|
|
dedustStatusConfigB,
|
|
dedustStatusConfigB,
|
|
@@ -46,6 +78,7 @@
|
|
} from '../dedust.data';
|
|
} from '../dedust.data';
|
|
import List from '/@/views/vent/gas/components/list/index.vue';
|
|
import List from '/@/views/vent/gas/components/list/index.vue';
|
|
import _ from 'lodash';
|
|
import _ from 'lodash';
|
|
|
|
+ import { get } from '../../../home/billboard/utils';
|
|
|
|
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
deviceId: {
|
|
deviceId: {
|
|
@@ -55,17 +88,7 @@
|
|
});
|
|
});
|
|
|
|
|
|
const loading = ref(false);
|
|
const loading = ref(false);
|
|
-
|
|
|
|
- // 默认初始是第一行
|
|
|
|
- // const openDust = ref(false);
|
|
|
|
const deviceInfo = ref<any>({});
|
|
const deviceInfo = ref<any>({});
|
|
- const workFaceSource = ref({});
|
|
|
|
- const workFaceHistorySource = ref([]);
|
|
|
|
- // const gateDataSource = ref([]);
|
|
|
|
- // const windowDataSource = ref([]);
|
|
|
|
- // const windDataSource = ref([]);
|
|
|
|
- // const temperatureDataSource = ref([]);
|
|
|
|
- // const fireDataSource = ref([]);
|
|
|
|
|
|
|
|
// 将列表配置项转换为列表可用的prop
|
|
// 将列表配置项转换为列表可用的prop
|
|
function transConfigToProp(config, source) {
|
|
function transConfigToProp(config, source) {
|
|
@@ -91,6 +114,11 @@
|
|
items: transConfigToProp(dedustMonitorConfig, deviceInfo.value),
|
|
items: transConfigToProp(dedustMonitorConfig, deviceInfo.value),
|
|
};
|
|
};
|
|
});
|
|
});
|
|
|
|
+ const dedustEnvProp = computed(() => {
|
|
|
|
+ return {
|
|
|
|
+ items: transConfigToProp(dedustEnvConfig, deviceInfo.value),
|
|
|
|
+ };
|
|
|
|
+ });
|
|
const dedustStatusPropA = computed(() => {
|
|
const dedustStatusPropA = computed(() => {
|
|
return {
|
|
return {
|
|
status: statusConfigA as any,
|
|
status: statusConfigA as any,
|
|
@@ -110,62 +138,60 @@
|
|
};
|
|
};
|
|
});
|
|
});
|
|
|
|
|
|
- // 监测数据
|
|
|
|
- const selectData = reactive({});
|
|
|
|
-
|
|
|
|
// https获取监测数据
|
|
// https获取监测数据
|
|
- let timer: null | NodeJS.Timeout = null;
|
|
|
|
- function getMonitor(flag?) {
|
|
|
|
- if (Object.prototype.toString.call(timer) === '[object Null]') {
|
|
|
|
- timer = setTimeout(
|
|
|
|
- async () => {
|
|
|
|
- if (props.deviceId) {
|
|
|
|
- const data = await getDataSource(props.deviceId);
|
|
|
|
- Object.assign(selectData, data);
|
|
|
|
- }
|
|
|
|
- if (timer) {
|
|
|
|
- timer = null;
|
|
|
|
- }
|
|
|
|
- await getMonitor();
|
|
|
|
- loading.value = false;
|
|
|
|
- },
|
|
|
|
- flag ? 0 : 1000
|
|
|
|
- );
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+ let timer: NodeJS.Timeout;
|
|
async function getDataSource(systemID) {
|
|
async function getDataSource(systemID) {
|
|
const res = await list({ devicetype: 'sys', systemID, type: 'all' });
|
|
const res = await list({ devicetype: 'sys', systemID, type: 'all' });
|
|
- res.deviceInfo.dedustefan.datalist.forEach((e: any) => {
|
|
|
|
|
|
+ // 保留第一项数据
|
|
|
|
+ _.forEach(_.get(res, 'deviceInfo.dedustefan.datalist', []), (e) => {
|
|
Object.assign(e, e.readData);
|
|
Object.assign(e, e.readData);
|
|
- e.readData = null;
|
|
|
|
|
|
+ deviceInfo.value = e || { warnDes: '设备断开' };
|
|
|
|
+ return -1;
|
|
});
|
|
});
|
|
- deviceInfo.value = _.get(res, 'deviceInfo.dedustefan.datalist[0]', { warnDes: '设备断开' });
|
|
|
|
- workFaceHistorySource.value = res.sysInfo.history;
|
|
|
|
- workFaceSource.value = Object.assign(res.sysInfo, res.sysInfo.readData);
|
|
|
|
- loading.value = false;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
onBeforeMount(() => {});
|
|
onBeforeMount(() => {});
|
|
|
|
|
|
- onMounted(async () => {
|
|
|
|
|
|
+ onMounted(() => {
|
|
loading.value = true;
|
|
loading.value = true;
|
|
- timer = null;
|
|
|
|
- await getMonitor(true);
|
|
|
|
|
|
+ mountedThree('#dedust3D', ['#dedustCss', '#dedustEnvA', '#dedustEnvB']).then(() => {
|
|
|
|
+ setModelType('dedust').finally(() => {
|
|
|
|
+ loading.value = false;
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ timer = setInterval(() => {
|
|
|
|
+ getDataSource(props.deviceId);
|
|
|
|
+ }, 1000);
|
|
});
|
|
});
|
|
onUnmounted(() => {
|
|
onUnmounted(() => {
|
|
- if (timer) {
|
|
|
|
- clearTimeout(timer);
|
|
|
|
- timer = null;
|
|
|
|
- }
|
|
|
|
|
|
+ clearInterval(timer);
|
|
|
|
+ destroy();
|
|
});
|
|
});
|
|
</script>
|
|
</script>
|
|
<style lang="less" scoped>
|
|
<style lang="less" scoped>
|
|
|
|
+ @import '/@/design/theme.less';
|
|
@import '/@/design/vent/modal.less';
|
|
@import '/@/design/vent/modal.less';
|
|
// @import '../less/tunFace.less';
|
|
// @import '../less/tunFace.less';
|
|
@import '../../comment/less/workFace.less';
|
|
@import '../../comment/less/workFace.less';
|
|
@ventSpace: zxm;
|
|
@ventSpace: zxm;
|
|
|
|
|
|
|
|
+ .monitor-item {
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+ margin-bottom: 3px;
|
|
|
|
+
|
|
|
|
+ .monitor-val {
|
|
|
|
+ font-size: 14px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .monitor-title {
|
|
|
|
+ width: 200px;
|
|
|
|
+ color: var(--vent-font-action-link);
|
|
|
|
+ font-weight: 400;
|
|
|
|
+ font-size: 14px;
|
|
|
|
+ }
|
|
|
|
+
|
|
.dust-fan-monitor {
|
|
.dust-fan-monitor {
|
|
display: flex;
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
flex-wrap: wrap;
|