123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330 |
- <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="window3D" 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">
- <div class="top-box">
- <div class="top-left row"> 井下测风装置集中管理 </div>
- <div class="top-center row">
- <div class="button-box" @click="start(0)">复位</div>
- <div class="button-box" @click="testPlay()">自测动画</div>
- <div class="button-box" @click="testPlay('up')">上</div>
- <div class="button-box" @click="testPlay('center')">中</div>
- <div class="button-box" @click="testPlay('down')">下</div>
- <div class="button-box" @click="testPlay('reset')">复位</div>
- </div>
- <div class="top-right row">
- <div class="control-type row">
- <div class="control-title">控制模式:</div>
- <a-radio-group v-model:value="controlType">
- <a-radio :value="1">就地</a-radio>
- <a-radio :value="2">远程</a-radio>
- </a-radio-group>
- </div>
- <div class="run-type row">
- <div class="control-title">运行状态:</div>
- <a-radio-group v-model:value="controlType">
- <a-radio :value="1">检修</a-radio>
- </a-radio-group>
- </div>
- <div class="run-state row">
- <div class="control-title">网络状态:</div>
- <a-radio-group v-model:value="controlType">
- <a-radio :value="1">运行</a-radio>
- </a-radio-group>
- </div>
- </div>
- </div>
- <div class="title-box"> 2-2煤主辅三联巷自动风窗 </div>
- <div class="tabs-box">
- <div class="tabs-button-group">
- <a-button class="tabs-button" type="primary" @click="start(1)">一键测风</a-button>
- <a-button class="tabs-button" type="primary">导出报表</a-button>
- </div>
- <a-tabs v-model:activeKey="activeKey" @change="tabChange">
- <a-tab-pane key="1" tab="实时监测">
- <MonitorTable columnsType="windrect_monitor" :dataSource="dataSource" design-scope="windrect-monitor" @selectRow="getSelectRow" title="测风装置监测" />
- </a-tab-pane>
- <a-tab-pane key="2" tab="实时曲线图" force-render>
- <div class="tab-item" v-if="activeKey === '2'">
- <lineMulti :chartData="dataSource" xAxisPropType="strname" :propTypeArr="propTypeArr" height="40vh" width="100%" />
- </div>
- </a-tab-pane>
- <a-tab-pane key="3" tab="历史数据">
- <div class="tab-item"> Content of Tab Pane 2 </div>
- </a-tab-pane>
- <a-tab-pane key="4" tab="操作历史">
- <div class="tab-item"> Content of Tab Pane 2 </div>
- </a-tab-pane>
- <a-tab-pane key="5" tab="实时报警">
- <div class="tab-item"> Content of Tab Pane 2 </div>
- </a-tab-pane>
- </a-tabs>
- </div>
- </div>
- <div style=" z-index: -1; position: absolute; top: 50px; right: 10px; width:300px;height:280px;margin:auto" class="palyer">
- <LivePlayer id="cf-player1" ref="player1" :videoUrl="flvURL1()" muted live loading controls />
- <LivePlayer id="cf-player2" ref="player2" :videoUrl="flvURL1()" muted live loading controls style="margin-top: 10px"/>
- </div>
- </template>
- <script setup lang="ts">
- import '/@/assets/less/modal.less';
- import lineMulti from '/@/components/chart/LineMulti.vue';
- import { onBeforeMount, computed, ref, onMounted, nextTick, onUnmounted, reactive, toRaw } from 'vue';
- import MonitorTable from '../comment/MonitorTable.vue';
- import { initWebSocket, getRecordList } from '/@/hooks/web/useVentWebSocket';
- import { deviceControlApi } from '/@/api/vent/index';
- import { mountedThree, destroy, addFmText, play, setModelType } from './windrect.threejs';
- import LivePlayer from '@liveqing/liveplayer-v3'
- import { list } from "/@/views/vent/monitorManager/windowMonitor/window.api";
- import { initOpenState } from "/@/views/vent/monitorManager/gateMonitor/gate.threejs";
- const player1 = ref(null)
- const player2 = ref(null)
- const activeKey = ref('1');
- const loading = ref(false);
- // 默认初始是第一行
- const selectRowIndex = ref(0);
- // 监测数据
- const selectData = reactive({
- deviceID: '',
- deviceType: '',
- strname: '',
- dataDh: '-', //压差
- dataDtestq: '-', //测试风量
- sourcePressure: '-', //气源压力
- dataDequivalarea: '-',
- netStatus: '0', //通信状态
- fault: '气源压力超限',
- });
- const flvURL1 = () =>{
- return `https://sf1-hscdn-tos.pstatp.com/obj/media-fe/xgplayer_doc_video/flv/xgplayer-demo-360p.flv`
- }
- const flvURL2 = () =>{
- return `https://sf1-hscdn-tos.pstatp.com/obj/media-fe/xgplayer_doc_video/flv/xgplayer-demo-360p.flv`
- }
- // const dataSource = computed(() => {
- // const data = [...getRecordList()] || [];
- // Object.assign(selectData, toRaw(data[selectRowIndex.value]));
- // addFmText(selectData);
- // return data;
- // });
- const dataSource = ref([]);
- const propTypeArr = new Map([
- ['incipientWindSpeed1', 'V1风速'],
- ['incipientWindSpeed2', 'V2风速'],
- ['incipientWindSpeed3', 'V3风速'],
- ['sourcePressure', '气源压力'],
- ]);
- const tabChange = (activeKeyVal) => {
- activeKey.value = activeKeyVal;
- };
- // 设备数据
- const controlType = ref(1);
- // https获取监测数据
- let timer: null | NodeJS.Timeout = null;
- const getMonitor = () => {
- if (Object.prototype.toString.call(timer) === '[object Null]') {
- timer = setTimeout(() => {
- list({ devicetype: 'windrect', pagetype: 'normal' }).then((res) => {
- dataSource.value = res.msgTxt[0].datalist || [];
- dataSource.value.forEach((data: any) => {
- const readData = data.readData;
- data = Object.assign(data, readData);
- });
- const data: any = toRaw(dataSource.value[selectRowIndex.value]); //maxarea
- Object.assign(selectData, data);
- addFmText(selectData);
- // 根据3个点位分别执行动画
- if(timer){
- timer = null;
- }
- getMonitor();
- });
- }, 1000);
- }
- };
- // 自测动画方法
- const testPlay = (flag) => {
- play(flag)
- // setTimeout(() => {
- // play('up')
- // }, 0)
- // setTimeout(() => {
- // play('center')
- // }, 10000)
- // setTimeout(() => {
- // play('down')
- // }, 40000)
- // setTimeout(() => {
- // play('up')
- // }, 60000)
- }
- // 切换检测数据
- const getSelectRow = (selectRow, index) => {
- selectRowIndex.value = index
- loading.value = true
- Object.assign(selectData, selectRow)
- const type = selectRowIndex.value < 6 ? 'lmWindRect': 'zdWindRect'
- setModelType(type).then(() => {
- addFmText(selectData);
- loading.value = false;
- })
- }
- const start = (flag) => {
- const data = {
- deviceid: selectData.deviceID,
- devicetype: selectData.deviceType,
- paramcode: flag == 1 ? 'testStart' : '',
- };
- deviceControlApi(data)
- .then((res) => {
- if (res.success) {
- //
- }
- })
- }
- const addPlayVideo = () => {
- if(player1.value.play && player2.value.play) {
- // player1.value.setMuted(false);
- // player2.value.setMuted(false);
- player1.value.play();
- player2.value.play();
- document.body.removeEventListener('mousedown', addPlayVideo)
- }
- }
- onBeforeMount(() => {
- // const sendVal = JSON.stringify({ pagetype: 'normal', devicetype: 'windrect', orgcode: '', ids: '', systemID: '' });
- // initWebSocket(sendVal);
- document.body.addEventListener('mousedown', addPlayVideo, false);
- });
- onMounted(() => {
- loading.value = true;
- mountedThree(player1.value, player2.value).then(() => {
- nextTick(() => {
- loading.value = false;
- getMonitor()
- addFmText(selectData);
- });
- });
- });
- onUnmounted(() => {
- destroy();
- if(timer) {
- clearTimeout(timer)
- timer = undefined;
- }
- });
- </script>
- <style scoped lang="less">
- .input-box {
- display: flex;
- align-items: center;
- .input-title {
- color: rgb(0, 255, 242);
- width: auto;
- }
- margin-right: 10px;
- }
- :deep(.jeecg-basic-table .ant-table-wrapper) {
- background-color: #ffffff00;
- }
- :deep(.ant-tabs-bar) {
- margin: 0;
- }
- :deep(.ant-table) {
- background-color: #ffffff00 !important;
- color: #fff;
- }
- :deep(.ant-table-header) {
- background-color: transparent;
- // height: 42px;
- }
- :deep(.ant-table-thead > tr > th) {
- background-color: transparent;
- border: none;
- }
- :deep(.ant-table-body > tr > th) {
- background-color: transparent;
- border: none;
- }
- :deep(.ant-table-body > tr > td) {
- border: none;
- }
- :deep(.ant-table-fixed-header > .ant-table-content > .ant-table-scroll > .ant-table-body) {
- background-color: #ffffff05;
- margin-top: 8px;
- &::-webkit-scrollbar {
- display: none;
- }
- }
- :deep(.jeecg-basic-table .ant-table-wrapper .ant-table-title) {
- padding: 0;
- }
- :deep(.jeecg-basic-table-row__striped td) {
- background-color: transparent;
- }
- :deep(.ant-table-tbody > tr:hover.ant-table-row > td) {
- background-color: #ffffff22;
- }
- :deep(.ant-table-tbody > tr:hover.ant-table-row > th) {
- background-color: #ffffff22;
- }
- :deep(.ant-table-thead > tr:hover.ant-table-row > td) {
- background-color: #ffffff22;
- }
- :deep(.ant-table-tbody > tr.ant-table-row-selected td) {
- background-color: #ffffff22;
- }
- :deep(.ant-table-tbody > tr > td) {
- border-color: #ffffff22;
- }
- :deep(.ant-table-thead > tr > th:hover) {
- background-color: transparent !important;
- }
- :deep(.ant-table-thead > tr > th) {
- color: #fff;
- }
- :deep(.ant-table-fixed-header .ant-table-scroll .ant-table-header) {
- background: #ffffff44;
- position: relative;
- z-index: 999;
- padding: 4px 0 !important;
- &::-webkit-scrollbar {
- display: none;
- }
- }
- :deep(.ant-tabs-nav) {
- color: #fff;
- }
- </style>
|