123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247 |
- <template>
- <div class="bg"
- style="width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; overflow: hidden">
- <a-spin :spinning="loading" />
- <div id="obfurage3D" v-show="!loading" style="width: 100%; height: 100%; position: absolute; overflow: hidden"> </div>
- <!-- <div id="damper3DCSS" v-show="!loading" style="width: 100%; height: 100%; top:0; left: 0; position: absolute; overflow: hidden;">
- <div>
- <div ref="elementContent" class="elementContent">
- <p><span class="data-title">压力(Pa):</span>{{selectData.frontRearDP}}</p>
- <p><span class="data-title">动力源压力(MPa):</span>{{selectData.sourcePressure}}</p>
- <p><span class="data-title">故障诊断:</span>
- <i
- :class="{'state-icon': true, 'open': selectData.messageBoxStatus, 'close': !selectData.messageBoxStatus}"
- ></i>{{selectData.fault}}</p>
- </div>
- </div>
- </div> -->
- </div>
- <div class="scene-box">
- <customHeader :fieldNames="{ label: 'strinstallpos', value: 'deviceID', options: 'children' }" :options = 'options' @change="getSelectRow" :optionValue="optionValue">密闭监测与管控</customHeader>
- <div class="center-container">
- <obfurageHome v-if="activeKey == 'monitor'" :deviceId = 'optionValue' />
- <div v-else class="history-group">
- <div class="device-button-group" v-if="deviceList.length > 0">
- <div class="device-button" :class="{ 'device-active': deviceActive == device.deviceType }" v-for="(device, index) in deviceList" :key="index" @click="deviceChange(index)">{{ device.deviceName }}</div>
- </div>
- <div class="history-container">
- <obfurageHistory v-if="activeKey == 'monitor_history'" ref="historyTable" class="vent-margin-t-20" :deviceId = 'optionValue' :device-type="deviceType"/>
- <obfurageHandleHistoryVue v-if="activeKey == 'handler_history'" ref="alarmHistoryTable" class="vent-margin-t-20" :deviceId = 'optionValue' :device-type="deviceType" />
- <obfurageAlarmHistory v-if="activeKey == 'faultRecord'" ref="handlerHistoryTable" class="vent-margin-t-20" :deviceId = 'optionValue' :device-type="deviceType"/>
- </div>
- </div>
- </div>
- <BottomMenu @change="changeActive"/>
- </div>
-
- </template>
- <script setup lang="ts">
- import customHeader from '/@/views/vent/comment/components/customHeader.vue';
- import { onBeforeMount, ref, onMounted, onUnmounted, reactive, toRaw } from 'vue';
- import { list } from './obfurage.api';
- import BottomMenu from '/@/views/vent/comment/components/bottomMenu.vue';
- import obfurageHome from './components/obfurageHome.vue';
- import obfurageHistory from './components/obfurageHistory.vue';
- import obfurageHandleHistoryVue from './components/obfurageHandleHistory.vue';
- import obfurageAlarmHistory from './components/obfurageAlarmHistory.vue';
- import { useRouter } from 'vue-router';
- type DeviceType = { deviceType: string, deviceName: string, datalist: any[] };
- const { currentRoute } = useRouter();
- const activeKey = ref('monitor');
- const loading = ref(false);
- const historyTable = ref()
- const alarmHistoryTable = ref()
- const handlerHistoryTable = ref()
- //关联设备
- const deviceList = ref<DeviceType[]>([])
- const deviceActive = ref('')
- const deviceType = ref('')
- const options = ref()
- // 默认初始是第一行
- const selectRowIndex = ref(0);
- const dataSource = ref([])
- const sprayDataSource = ref([]);
- const bundleTubeDataSource = ref({});
- const pulpingDataSource = ref([]);
- const nitrogenDataSource = ref([]);
- const optionValue = ref('')
- // 监测数据
- const selectData = reactive({});
- function changeActive(activeValue) {
- activeKey.value = activeValue
- }
- function deviceChange(index) {
- deviceActive.value = deviceType.value = deviceList.value[index].deviceType
- }
- // 查询关联设备列表
- async function getDeviceList() {
- const res = await list({ devicetype: 'sys', systemID: optionValue.value });
- const result = res.msgTxt;
- const deviceArr = <DeviceType[]>[]
- result.forEach(item => {
- const data = item['datalist'].filter((data: any) => {
- const readData = data.readData;
- return Object.assign(data, readData);
- })
- if (item.type != 'sys') {
- deviceArr.unshift({ deviceType: item.type, deviceName: item['typeName'] ? item['typeName'] : item['datalist'][0]['typeName'], datalist: data })
- }
- })
- deviceList.value = deviceArr
- deviceActive.value = deviceArr[0].deviceType
- deviceChange(0)
- };
- async function getSysDataSource () {
- const res = await list({ devicetype: 'sys_obfurage', pagetype: 'normal' });
- dataSource.value = res.msgTxt[0].datalist || [];
- dataSource.value.forEach((data: any) => {
- const readData = data.readData;
- data = Object.assign(data, readData);
- });
-
- if(!options.value) {
- // 初始时选择第一条数据
- options.value = dataSource.value
- if(!optionValue.value){
- optionValue.value = dataSource.value[0]['deviceID']
- Object.assign(selectData, dataSource.value[0])
- }else{
- const currentData = dataSource.value.find(item => item['deviceID'] === optionValue.value) || {}
- Object.assign(selectData, currentData)
- }
- }
- const data: any = toRaw(dataSource.value[selectRowIndex.value]); //maxarea
- return data;
- };
- // 切换检测数据
- function getSelectRow(deviceID){
- const currentData = dataSource.value.find((item: any) => {
- return item.deviceID == deviceID
- })
- if(currentData){
- optionValue.value = currentData['deviceID']
- Object.assign(selectData, currentData)
- }
- }
- onBeforeMount(() => {
- });
- onMounted(async() => {
- if (currentRoute.value && currentRoute.value['query'] && currentRoute.value['query']['id']) optionValue.value = currentRoute.value['query']['id']
- await getSysDataSource()
- await getDeviceList()
- });
- onUnmounted(() => {
-
- });
- </script>
- <style lang="less" scoped>
- @import '/@/design/vent/modal.less';
- @ventSpace: zxm;
- .scene-box{
- pointer-events: none;
- .history-group{
- padding: 0 20px;
- .history-container{
- position: relative;
- background: #6195af1a;
- width: calc(100% + 10px);
- top: 0px;
- left: -10px;
- border: 1px solid #00fffd22;
- padding: 10px 0;
- box-shadow: 0 0 20px #44b4ff33 inset;
- }
- }
- .device-button-group{
- // margin: 0 20px;
- display: flex;
- pointer-events: auto;
- position: relative;
- margin-top: 90px;
- &::after{
- position:absolute;
- content: '';
- width: calc(100% + 10px);
- height: 2px;
- top: 30px;
- left: -10px;
- border-bottom: 1px solid #0efcff;
- }
- .device-button{
- padding: 4px 15px;
- position: relative;
- display: flex;
- justify-content: center;
- align-items: center;
- font-size: 14px;
-
- color: #fff;
- cursor: pointer;
- margin: 0 3px;
- &::before{
- content: '';
- position: absolute;
- top: 0;
- right: 0;
- bottom: 0;
- left: 0;
- border: 1px solid #6176AF;
- transform: skewX(-38deg);
- background-color: rgba(0, 77, 103,85%);
- z-index: -1;
- }
- }
- .device-active{
- // color: #0efcff;
- &::before{
- border-color: #0efcff;
- box-shadow: 1px 1px 3px 1px #0efcff inset;
- }
- }
- }
- }
- .center-container{
- width: 100%;
- height: calc(100% - 200px);
- }
- :deep(.@{ventSpace}-tabs-tabpane-active) {
- overflow: auto;
- }
- .input-box {
- display: flex;
- align-items: center;
- padding-left: 10px;
- .input-title {
- color: #73e8fe;
- width: auto;
- }
- .@{ventSpace}-input-number {
- border-color: #ffffff88 !important;
- }
- margin-right: 10px;
- }
- </style>
|