| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471 |
- <template>
- <div>{{ Math.random() }}</div>
- <div id="nitrogen3D" style="width: 100%; height: 100%; position: absolute; overflow: hidden"></div>
- <div
- id="nitrogenCss3D"
- class="threejs-Object-CSS"
- style="width: 100%; height: 100%; position: absolute; pointer-events: none; overflow: hidden; z-index: 2; top: 0px; left: 0px"
- >
- <a-spin :spinning="loading" />
- <template>
- <div v-for="groupNum in 1" :key="groupNum" class="modal-monitor">
- <fourBorderBg :class="`kyj${groupNum}`" :id="`nitrogenMonitor${groupNum}`">
- <div class="title">{{ monitorData[0]['strname'] }} </div>
- <div class="monitor-item">
- <span class="monitor-title">实时流量:</span>
- <span class="monitor-val" v-if="!refresh"
- ><span class="val">{{ monitorData[0]['flow'] ? monitorData[0]['flow'] : '-' }}</span> <span class="unit">m³/min</span></span
- >
- </div>
- <div class="monitor-item">
- <span class="monitor-title">总流量:</span>
- <span class="monitor-val" v-if="!refresh"
- ><span class="val">{{ monitorData[0]['total_flow'] ? monitorData[0]['total_flow'] : '-' }}</span> <span class="unit">m³</span></span
- >
- </div>
- <div class="monitor-item">
- <span class="monitor-title">氧浓度:</span>
- <span class="monitor-val" v-if="!refresh"
- ><span class="val">{{ monitorData[0]['oxygen_concentration'] ? monitorData[0]['oxygen_concentration'] : '-' }}</span>
- <span class="unit">%</span></span
- >
- </div>
- </fourBorderBg>
- </div>
- </template>
- </div>
- <div class="nitrogen-home">
- <div class="nitrogen-container">
- <div class="top-box">
- <!-- 中间区域控制按钮 -->
- <div class="center-item-box">
- <div class="top-left">
- <div class="button-box" @click="handlerDevice(airCompressorState[0], '主机启动')">主机启动</div>
- <div class="button-box" @click="handlerDevice(airCompressorState[0], '主机停止')">主机停止</div>
- <div class="button-box" @click="handlerDevice(airCompressorState[0], '备机启动')">备机启动</div>
- <div class="button-box" @click="handlerDevice(airCompressorState[0], '备机停止')">备机停止</div>
- </div>
- <div class="top-center">
- <div class="top-c-label">通信状态:</div>
- <div class="top-c-val">{{ monitorData[0]['netStatus'] == 1 ? '连接' : monitorData[0]['netStatus'] == 0 ? '断开' : '未知' }}</div>
- </div>
- <div class="top-right">
- <div class="control-type">
- <div class="control-title">运行状态:</div>
- <a-radio-group v-model:value="monitorData[0]['overhaul_run']">
- <a-radio :value="`1`" disabled>检修</a-radio>
- <a-radio :value="`0`" disabled>运行</a-radio>
- </a-radio-group>
- </div>
- <div class="control-type">
- <div class="control-title">控制模式:</div>
- <a-radio-group v-model:value="monitorData[0]['remote_local']">
- <a-radio :value="`1`" disabled>就地</a-radio>
- <a-radio :value="`0`" disabled>远程</a-radio>
- </a-radio-group>
- </div>
- </div>
- </div>
- <!-- 底部区域故障数据 -->
- <div class="footer-item-box">
- <div class="device-detail">
- <div class="device-title"> </div>
- <div class="device-val">主机进气蝶阀</div>
- <div class="device-val">主机出气蝶阀</div>
- <div class="device-val">备机进气蝶阀</div>
- <div class="device-val">备机出气蝶阀</div>
- <!-- <div class="device-val">故障</div> -->
- </div>
- <div v-for="(device, key) in deviceMonitorList" class="device-detail" :key="key">
- <div class="device-title">{{ device.title }}</div>
- <div v-for="(detailItem, index) in device.dataList" :key="detailItem.code" class="device-val">
- <span :style="{ color: monitorData[0][detailItem.code] != '1' ? '#BFBFBF' : '#10BC79' }">{{
- monitorData[0][detailItem.code] == '0' ? '正常' : monitorData[0][detailItem.code] == '1' ? '故障' : '-'
- }}</span>
- <!-- <span v-if="index == 1"
- :style="{ color: monitorData[0][detailItem.code] != '1' ? '#BFBFBF' : '#10BC79' }">{{
- monitorData[0][detailItem.code] == '0' ? '正常' : monitorData[0][detailItem.code] == '1' ? '故障' :
- '-'
- }}</span> -->
- </div>
- </div>
- </div>
- <!-- 左边监测数据 -->
- <div class="lr-box left-box">
- <div class="item item-l" v-for="(groupNum, ind) in monitorDataGroupNum" :key="groupNum">
- <ventBox1>
- <template #title>
- <!-- <div>{{ monitorData[groupNum - 1]['strname'] }}</div> -->
- <div v-if="ind == 0">{{ `${monitorData[0]['strname']}-主` }}</div>
- <div v-else>{{ `${monitorData[0]['strname']}-备` }}</div>
- </template>
- <template #container>
- <div class="monitor-box">
- <div class="parameter-title group-parameter-title">
- <SvgIcon class="icon" size="38" name="device-group-paramer" /><span>进气蝶阀参数</span>
- </div>
- <div v-if="ind == 0">
- <div class="state-item" v-for="(data, index) in groupParameterData" :key="index">
- <div class="item-col">
- <span class="state-title1">{{ Object.values(data)[0] }} :</span>
- <span class="state-val1" v-if="index == 0">{{
- (monitorData.length > 0 && monitorData[0][Object.keys(data)[0]]) >= 0
- ? monitorData[0][Object.keys(data)[0]]
- ? parseFloat(monitorData[0][Object.keys(data)[0]]).toFixed(2)
- : '-'
- : '-'
- }}</span>
- <span class="state-val" v-else>
- <span
- v-if="monitorData[0][Object.keys(data)[0]] == '0'"
- style="display: inline-block; width: 10px; height: 10px; border-radius: 50%; background-color: blue"
- ></span>
- <span
- v-else-if="monitorData[0][Object.keys(data)[0]] == '1'"
- style="display: inline-block; width: 10px; height: 10px; border-radius: 50%; background-color: greenyellow"
- ></span>
- <span v-else style="display: inline-block; width: 10px; height: 10px; border-radius: 50%; background-color: #ccc"></span>
- </span>
- </div>
- <div class="item-col" v-if="Object.keys(data)[1]">
- <span class="state-title1">{{ Object.values(data)[1] }} :</span>
- <span class="state-val1">
- <span
- v-if="monitorData[0][Object.keys(data)[1]] == '0'"
- style="display: inline-block; width: 10px; height: 10px; border-radius: 50%; background-color: blue"
- ></span>
- <span
- v-else-if="monitorData[0][Object.keys(data)[1]] == '1'"
- style="display: inline-block; width: 10px; height: 10px; border-radius: 50%; background-color: greenyellow"
- ></span>
- <span v-else style="display: inline-block; width: 10px; height: 10px; border-radius: 50%; background-color: #ccc"></span>
- </span>
- </div>
- </div>
- </div>
- <div v-else>
- <div class="state-item" v-for="(data, index) in groupParameterData1" :key="index">
- <div class="item-col">
- <span class="state-title1">{{ Object.values(data)[0] }} :</span>
- <span class="state-val1" v-if="index == 0">{{
- (monitorData.length > 0 && monitorData[0][Object.keys(data)[0]]) >= 0
- ? monitorData[0][Object.keys(data)[0]]
- ? parseFloat(monitorData[0][Object.keys(data)[0]]).toFixed(2)
- : '-'
- : '-'
- }}</span>
- <span class="state-val" v-else>
- <span
- v-if="monitorData[0][Object.keys(data)[0]] == '0'"
- style="display: inline-block; width: 10px; height: 10px; border-radius: 50%; background-color: blue"
- ></span>
- <span
- v-else-if="monitorData[0][Object.keys(data)[0]] == '1'"
- style="display: inline-block; width: 10px; height: 10px; border-radius: 50%; background-color: greenyellow"
- ></span>
- <span v-else style="display: inline-block; width: 10px; height: 10px; border-radius: 50%; background-color: #ccc"></span>
- </span>
- </div>
- <div class="item-col" v-if="Object.keys(data)[1]">
- <span class="state-title1">{{ Object.values(data)[1] }} :</span>
- <span class="state-val1">
- <span
- v-if="monitorData[0][Object.keys(data)[1]] == '0'"
- style="display: inline-block; width: 10px; height: 10px; border-radius: 50%; background-color: blue"
- ></span>
- <span
- v-else-if="monitorData[0][Object.keys(data)[1]] == '1'"
- style="display: inline-block; width: 10px; height: 10px; border-radius: 50%; background-color: greenyellow"
- ></span>
- <span v-else style="display: inline-block; width: 10px; height: 10px; border-radius: 50%; background-color: #ccc"></span>
- </span>
- </div>
- </div>
- </div>
- </div>
- <div class="monitor-box monitor-box1">
- <div class="parameter-title device-parameter-title">
- <SvgIcon class="icon" size="32" name="device-paramer" /><span>出气蝶阀参数</span>
- </div>
- <div class="state-box">
- <div v-if="ind == 0">
- <div class="state-item" v-for="(data, index) in deviceParameterData" :key="index">
- <div class="item-col">
- <span class="state-title1">{{ Object.values(data)[0] }} :</span>
- <span class="state-val1" v-if="index == 0">{{
- (monitorData.length > 0 && monitorData[0][Object.keys(data)[0]]) >= 0
- ? monitorData[0][Object.keys(data)[0]]
- ? parseFloat(monitorData[0][Object.keys(data)[0]]).toFixed(2)
- : '-'
- : '-'
- }}</span>
- <span class="state-val" v-else>
- <span
- v-if="monitorData[0][Object.keys(data)[0]] == '0'"
- style="display: inline-block; width: 10px; height: 10px; border-radius: 50%; background-color: blue"
- ></span>
- <span
- v-else-if="monitorData[0][Object.keys(data)[0]] == '1'"
- style="display: inline-block; width: 10px; height: 10px; border-radius: 50%; background-color: greenyellow"
- ></span>
- <span v-else style="display: inline-block; width: 10px; height: 10px; border-radius: 50%; background-color: #ccc"></span>
- </span>
- </div>
- <div class="item-col" v-if="Object.keys(data)[1]">
- <span class="state-title1">{{ Object.values(data)[1] }} :</span>
- <span class="state-val1">
- <span
- v-if="monitorData[0][Object.keys(data)[1]] == '0'"
- style="display: inline-block; width: 10px; height: 10px; border-radius: 50%; background-color: blue"
- ></span>
- <span
- v-else-if="monitorData[0][Object.keys(data)[1]] == '1'"
- style="display: inline-block; width: 10px; height: 10px; border-radius: 50%; background-color: greenyellow"
- ></span>
- <span v-else style="display: inline-block; width: 10px; height: 10px; border-radius: 50%; background-color: #ccc"></span>
- </span>
- </div>
- </div>
- </div>
- <div v-else>
- <div class="state-item" v-for="(data, index) in deviceParameterData1" :key="index">
- <div class="item-col">
- <span class="state-title1">{{ Object.values(data)[0] }} :</span>
- <span class="state-val1" v-if="index == 0">{{
- (monitorData.length > 0 && monitorData[0][Object.keys(data)[0]]) >= 0
- ? monitorData[0][Object.keys(data)[0]]
- ? parseFloat(monitorData[0][Object.keys(data)[0]]).toFixed(2)
- : '-'
- : '-'
- }}</span>
- <span class="state-val" v-else>
- <span
- v-if="monitorData[0][Object.keys(data)[0]] == '0'"
- style="display: inline-block; width: 10px; height: 10px; border-radius: 50%; background-color: blue"
- ></span>
- <span
- v-else-if="monitorData[0][Object.keys(data)[0]] == '1'"
- style="display: inline-block; width: 10px; height: 10px; border-radius: 50%; background-color: greenyellow"
- ></span>
- <span v-else style="display: inline-block; width: 10px; height: 10px; border-radius: 50%; background-color: #ccc"></span>
- </span>
- </div>
- <div class="item-col" v-if="Object.keys(data)[1]">
- <span class="state-title1">{{ Object.values(data)[1] }} :</span>
- <span class="state-val1">
- <span
- v-if="monitorData[0][Object.keys(data)[1]] == '0'"
- style="display: inline-block; width: 10px; height: 10px; border-radius: 50%; background-color: blue"
- ></span>
- <span
- v-else-if="monitorData[0][Object.keys(data)[1]] == '1'"
- style="display: inline-block; width: 10px; height: 10px; border-radius: 50%; background-color: greenyellow"
- ></span>
- <span v-else style="display: inline-block; width: 10px; height: 10px; border-radius: 50%; background-color: #ccc"></span>
- </span>
- </div>
- </div>
- </div>
- </div>
- </div>
- </template>
- </ventBox1>
- </div>
- </div>
- <!-- 右边控制状态 -->
- <div class="lr-box right-box">
- <ventBox1 class="vent-margin-t-10">
- <template #title>
- <div>设备实时监测曲线</div>
- </template>
- <template #container>
- <BarAndLine
- v-if="chartsColumns.length > 0"
- xAxisPropType="readTime"
- :dataSource="echartData"
- height="240px"
- :chartsColumns="chartsColumns"
- :option="echatsOption"
- />
- </template>
- </ventBox1>
- <div v-if="renderPlayer" ref="playerRef" class="player-box vent-margin-t-10"></div>
- </div>
- </div>
- </div>
- </div>
- <HandleModal :modal-is-show="modalIsShow" :modal-title="modalTitle" :modal-type="modalType" @handle-ok="handleOK" @handle-cancel="handleCancel" />
- </template>
- <script lang="ts" setup name="nitrogenHome">
- import { onMounted, onUnmounted, ref, watch, reactive, defineProps, nextTick, inject, onBeforeUnmount } from 'vue';
- import ventBox1 from '/@/components/vent/ventBox1.vue';
- import fourBorderBg from '../../../comment/components/fourBorderBg.vue';
- import { mountedThree, destroy, setModelType } from '../nitrogen.threejs';
- import { getDevice } from '../nitrogen.api';
- import { SvgIcon } from '/@/components/Icon';
- import BarAndLine from '/@/components/chart/BarAndLine.vue';
- import HandleModal from './modal.vue';
- import { deviceControlApi } from '/@/api/vent/index';
- import { message } from 'ant-design-vue';
- import { useCamera } from '/@/hooks/system/useCamera';
- import lodash from 'lodash';
- import { getTableHeaderColumns } from '/@/hooks/web/useWebColumns';
- const globalConfig = inject('globalConfig');
- const props = defineProps({
- deviceId: {
- type: String,
- require: true,
- },
- modalType: {
- type: String,
- require: true,
- },
- });
- const { getCamera, removeCamera } = useCamera();
- const refresh = ref(false);
- const modalTitle = ref(''); // 模态框标题显示内容,根据设备操作类型决定
- const modalType = ref(''); // 模态框内容显示类型,设备操作类型
- const modalIsShow = ref<boolean>(false); // 是否显示模态框
- const renderPlayer = ref(true);
- const loading = ref(true);
- let kzParam = reactive<any>({
- data: {},
- isFw: '',
- });
- const playerRef = ref();
- const colors = ['#FDB146', '#EE6666', '#9BCB75', '#03C2EC', '#DA3914', '#9C83D9'];
- const echatsOption = {
- grid: {
- top: '20%',
- left: '0px',
- right: '10px',
- bottom: '3%',
- containLabel: true,
- },
- toolbox: {
- feature: {},
- },
- };
- const monitorDataGroupNum = ref(0);
- let airCompressorState = reactive<any[]>([]);
- //主机进气
- const groupParameterData = [
- {
- m_in_open: '开度',
- m_bv_in_remote: '远控',
- },
- {
- m_bv_in_open: '开到位',
- m_bv_in_close: '关到位',
- },
- ];
- //备机进气
- const groupParameterData1 = [
- {
- b_in_open: '开度',
- b_bv_in_remote: '远控',
- },
- {
- b_bv_in_open: '开到位',
- b_bv_in_close: '关到位',
- },
- ];
- //主机出气
- const deviceParameterData = [
- {
- m_out_open: '开度',
- m_bv_out_remote: '远控',
- },
- {
- m_bv_out_open: '开到位',
- m_bv_out_close: '关到位',
- },
- ];
- //备机出气
- const deviceParameterData1 = [
- {
- b_out_open: '开度',
- b_bv_out_remote: '远控',
- },
- {
- b_bv_out_open: '开到位',
- b_bv_out_close: '关到位',
- },
- ];
- const deviceMonitorList = reactive([
- {
- title: '负载短路故障',
- dataList: [
- {
- title: '主机-进',
- code: 'm_in_load_short',
- },
- {
- title: '主机-出',
- code: 'm_out_load_short',
- },
- {
- title: '备机-进',
- code: 'b_in_load_short',
- },
- {
- title: '备机-出',
- code: 'b_out_load_short',
- },
- ],
- },
- {
- title: '电压过低故障',
- dataList: [
- {
- title: '主机-进',
- code: 'm_in_low_voltage',
- },
- {
- title: '主机-出',
- code: 'm_out_low_voltage',
- },
- {
- title: '备机-进',
- code: 'b_in_low_voltage',
- },
- {
- title: '备机-出',
- code: 'b_out_low_voltage',
- },
- ],
- },
- {
- title: '电压过高故障',
- dataList: [
- {
- title: '主机-进',
- code: 'm_in_high_voltage',
- },
- {
- title: '主机-出',
- code: 'm_out_high_voltage',
- },
- {
- title: '备机-进',
- code: 'b_in_high_voltage',
- },
- {
- title: '备机-出',
- code: 'b_out_high_voltage',
- },
- ],
- },
- {
- title: '电机漏电故障',
- dataList: [
- {
- title: '主机-进',
- code: 'm_in_motor_leakage',
- },
- {
- title: '主机-出',
- code: 'm_out_motor_leakage',
- },
- {
- title: '备机-进',
- code: 'b_in_motor_leakage',
- },
- {
- title: '备机-出',
- code: 'b_out_motor_leakage',
- },
- ],
- },
- {
- title: '电源缺相故障',
- dataList: [
- {
- title: '主机-进',
- code: 'm_in_supply_phase',
- },
- {
- title: '主机-出',
- code: 'm_out_supply_phase',
- },
- {
- title: '备机-进',
- code: 'b_in_supply_phase',
- },
- {
- title: '备机-出',
- code: 'b_out_supply_phase',
- },
- ],
- },
- {
- title: '关向过力矩故障',
- dataList: [
- {
- title: '主机-进',
- code: 'm_in_closing_overtorque',
- },
- {
- title: '主机-出',
- code: 'm_out_closing_overtorque',
- },
- {
- title: '备机-进',
- code: 'b_in_closing_overtorque',
- },
- {
- title: '备机-出',
- code: 'b_out_closing_overtorque',
- },
- ],
- },
- {
- title: '开向过力矩故障',
- dataList: [
- {
- title: '主机-进',
- code: 'm_in_opening_overtorque',
- },
- {
- title: '主机-出',
- code: 'm_out_opening_overtorque',
- },
- {
- title: '备机-进',
- code: 'b_in_opening_overtorque',
- },
- {
- title: '备机-出',
- code: 'b_out_opening_overtorque',
- },
- ],
- },
- {
- title: '关向过电流故障',
- dataList: [
- {
- title: '主机-进',
- code: 'm_in_closing_overcurrent',
- },
- {
- title: '主机-出',
- code: 'm_out_closing_overcurrent',
- },
- {
- title: '备机-进',
- code: 'b_in_closing_overcurrent',
- },
- {
- title: '备机出',
- code: 'b_out_closing_overcurrent',
- },
- ],
- },
- {
- title: '开向过电流故障',
- dataList: [
- {
- title: '主机-进',
- code: 'm_in_opening_overcurrent',
- },
- {
- title: '主机-出',
- code: 'm_out_opening_overcurrent',
- },
- {
- title: '备机-进',
- code: 'b_in_opening_overcurrent',
- },
- {
- title: '备机-出',
- code: 'b_out_opening_overcurrent',
- },
- ],
- },
- {
- title: '关向超时故障',
- dataList: [
- {
- title: '主机-进',
- code: 'm_in_closing_timeout',
- },
- {
- title: '主机-出',
- code: 'm_out_closing_timeout',
- },
- {
- title: '备机-进',
- code: 'b_in_closing_timeout',
- },
- {
- title: '备机-出',
- code: 'b_out_closing_timeout',
- },
- ],
- },
- {
- title: '开向超时故障',
- dataList: [
- {
- title: '主机-进',
- code: 'm_in_opening_timeout',
- },
- {
- title: '主机-出',
- code: 'm_out_opening_timeout',
- },
- {
- title: '备机-进',
- code: 'b_in_opening_timeout',
- },
- {
- title: '备机-出',
- code: 'b_out_opening_timeout',
- },
- ],
- },
- {
- title: '阀位故障',
- dataList: [
- {
- title: '主机-进',
- code: 'm_in_valve_position',
- },
- {
- title: '主机-出',
- code: 'm_out_valve_position',
- },
- {
- title: '备机-进',
- code: 'b_in_valve_position',
- },
- {
- title: '备机-出',
- code: 'b_out_valve_position',
- },
- ],
- },
- {
- title: '热过载故障',
- dataList: [
- {
- title: '主机-进',
- code: 'm_in_thermal_overload',
- },
- {
- title: '主机-出',
- code: 'm_out_thermal_overload',
- },
- {
- title: '备机-进',
- code: 'b_in_thermal_overload',
- },
- {
- title: '备机-出',
- code: 'b_out_thermal_overload',
- },
- ],
- },
- ]);
- // const chartsColumns = ref([])
- const chartsColumns = ref(getTableHeaderColumns('sys_nitrogen_chart'));
- // const propTypeArr = ref([])
- // watch(monitorDataGroupNum, () => {
- // const arr = <any[]>[]
- // const item = getTableHeaderColumns('sys_nitrogen_chart')
- // const propTypeList = []
- // for (let i = 1; i <= monitorDataGroupNum.value; i++) {
- // const lineType = lodash.cloneDeep(item[0])
- // lineType.legend = `制氮机${i}瞬时流量`;
- // lineType.dataIndex = `${item[0].dataIndex}${i}`
- // lineType.color = colors[i - 1]
- // arr.push(lineType)
- // }
- // chartsColumns.value = arr
- // })
- const monitorData = ref(
- new Array(3).fill({
- // strName: '空压机',
- // cumulativeFlow: '-',
- // centerTemperature: '-',
- // outletTemperature: '-',
- // Ia: '-',
- // Ib: '-',
- // Ic: '-',
- // Vab: '-',
- // Vac: '-',
- // Vbc: '-',
- // compressGroupName: '',
- // compressExhaustPressF1: '-',
- // compressSeparatePressF1: '-',
- // compressHostTempF1: '-',
- // compressCrewTempF1: '-',
- // compressRunTimeF1: '-',
- // controlModel: 'LOC'
- })
- );
- //图表数据
- let echartData = ref<any>([]);
- // https获取监测数据
- let timer: null | NodeJS.Timeout = null;
- async function getMonitor(flag?) {
- if (Object.prototype.toString.call(timer) === '[object Null]') {
- timer = await setTimeout(
- async () => {
- if (props.deviceId) {
- await getDataSource(props.deviceId);
- }
- if (timer) {
- timer = null;
- }
- await getMonitor();
- },
- flag ? 0 : 3000
- );
- }
- }
- async function getDataSource(systemID) {
- const res = await getDevice({ devicetype: 'sys', systemID, type: 'all' });
- if (res) {
- const result = res;
- if (!result || result.msgTxt.length < 1) return;
- result.msgTxt.forEach((item) => {
- if (item.type && item.type.startsWith('nitrogen')) {
- airCompressorState.length = 0;
- monitorData.value = item['datalist'].filter((data) => {
- const readData = data.readData;
- airCompressorState.push({
- id: data.deviceID,
- deviceType: data.deviceType,
- m_start: readData.m_start,
- m_stop: readData.m_stop,
- b_start: readData.b_start,
- b_stop: readData.b_stop,
- });
- return Object.assign(data, readData);
- });
- console.log(monitorData, 'monitorData.value---===');
- console.log(airCompressorState, 'airCompressorState--------');
- if (monitorData.value.length > 0 && monitorData.value[0]['readTime']) {
- const airCompressor = { readTime: monitorData.value[0]['readTime'].substring(11) };
- const dataArr = lodash.cloneDeep(echartData.value);
- //图表数据
- if (dataArr.length < 4) {
- monitorData.value.forEach((el, index) => {
- airCompressor['flow'] = el['flow'] || 0;
- });
- dataArr.push(airCompressor);
- } else {
- dataArr.shift();
- // dataArr.push(airCompressor)
- monitorData.value.forEach((el, index) => {
- airCompressor['flow'] = el['flow'] || 0;
- });
- dataArr.push(airCompressor);
- // console.log(dataArr,'dataArr---------')
- }
- echartData.value = dataArr;
- }
- }
- });
- // monitorDataGroupNum.value = monitorData.value.length;
- monitorDataGroupNum.value = 2;
- refresh.value = true;
- nextTick(() => {
- refresh.value = false;
- });
- }
- }
- function handlerDevice(data, titles) {
- kzParam.data = data;
- kzParam.isFw = titles;
- switch (titles) {
- case '主机启动':
- modalTitle.value = titles;
- modalType.value = '1';
- modalIsShow.value = true;
- kzParam.data.m_start = data.m_start;
- break;
- case '备机启动':
- modalTitle.value = titles;
- modalType.value = '2';
- modalIsShow.value = true;
- kzParam.data.b_start = data.b_start;
- break;
- case '主机停止':
- modalTitle.value = titles;
- modalType.value = '1';
- modalIsShow.value = true;
- kzParam.data.m_stop = data.m_stop;
- break;
- case '备机停止':
- modalTitle.value = titles;
- modalType.value = '2';
- modalIsShow.value = true;
- kzParam.data.b_stop = data.b_stop;
- break;
- }
- }
- function handleOK(passWord, handlerState) {
- console.log(kzParam, 'kz----------');
- let data = {};
- switch (kzParam.isFw) {
- case '主机启动':
- data = {
- deviceid: kzParam.data.id,
- devicetype: kzParam.data.deviceType,
- password: passWord,
- // m_start: '1',
- paramcode: 'm_start',
- value: '1',
- };
- break;
- case '备机启动':
- data = {
- deviceid: kzParam.data.id,
- devicetype: kzParam.data.deviceType,
- password: passWord,
- paramcode: 'b_start',
- value: '1',
- };
- break;
- case '主机停止':
- data = {
- deviceid: kzParam.data.id,
- devicetype: kzParam.data.deviceType,
- password: passWord,
- paramcode: 'm_stop',
- value: '1',
- };
- break;
- case '备机停止':
- data = {
- deviceid: kzParam.data.id,
- devicetype: kzParam.data.deviceType,
- password: passWord,
- paramcode: 'b_stop',
- value: '1',
- };
- break;
- }
- deviceControlApi(data).then((res) => {
- // 模拟时开启
- if (res.success) {
- modalIsShow.value = false;
- getDataSource(props.deviceId);
- if (globalConfig.History_Type == 'remote') {
- message.success('指令已下发至生产管控平台成功!');
- } else {
- message.success('指令已下发成功!');
- }
- }
- });
- }
- function handleCancel() {
- modalIsShow.value = false;
- modalTitle.value = '';
- modalType.value = '';
- }
- watch([monitorDataGroupNum, loading], ([newMonitorDataGroupNum, newLoading]) => {
- nextTick(() => {
- if (newMonitorDataGroupNum && !newLoading) {
- setModelType(props.modalType, newMonitorDataGroupNum);
- }
- });
- });
- watch(
- () => props.deviceId,
- async (deviceId) => {
- if (deviceId) {
- await getCamera(deviceId, playerRef, renderPlayer);
- }
- }
- );
- onBeforeUnmount(() => {
- removeCamera(playerRef);
- });
- onMounted(async () => {
- await getMonitor(true);
- await mountedThree().then(() => {
- loading.value = false;
- });
- await getCamera(props.deviceId, playerRef, renderPlayer);
- });
- onUnmounted(() => {
- destroy();
- if (timer) {
- clearTimeout(timer);
- timer = undefined;
- }
- });
- </script>
- <style lang="less" scoped>
- @import '/@/design/theme.less';
- @ventSpace: zxm;
- @{theme-deepblue} {
- .nitrogen-home {
- --button-box-bg: linear-gradient(#0963c1, #1774d7);
- --control-title-color: #0a80fa;
- --border-color: #0a80fad4;
- --footer-item-bg: rgba(0, 32, 66, 0.6);
- }
- }
- .nitrogen-box {
- width: 100%;
- height: 100%;
- display: flex;
- justify-content: center;
- }
- #nitrogenCss3D {
- .modal-monitor {
- width: 200px;
- position: absolute;
- left: 0px;
- top: 0px;
- }
- &:deep(.win) {
- margin: 0 !important;
- background: #00000044;
- }
- }
- .nitrogen-home {
- --button-box-bg: linear-gradient(#1fa6cb, #127cb5);
- --control-title-color: #73e8fe;
- --border-color: #00baffd4;
- --footer-item-bg: #0e223b90;
- width: 100%;
- height: 100%;
- position: fixed;
- z-index: 9999;
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- pointer-events: none;
- top: 20px;
- .nitrogen-container {
- width: 100%;
- height: calc(100% - 100px);
- display: flex;
- justify-content: space-between;
- margin-bottom: 100px;
- .top-box {
- // margin-top: 40px; //lxh
- position: relative;
- width: 100%;
- padding: 10px;
- overflow: hidden;
- display: flex;
- justify-content: space-between;
- .center-item-box {
- position: absolute;
- left: 50%;
- top: 50px;
- transform: translate(-48%, 0);
- width: calc(100% - 760px);
- height: 50px;
- display: flex;
- align-items: center;
- pointer-events: auto;
- .top-left {
- display: flex;
- flex: 2;
- color: var(--vent-font-color);
- .button-box {
- position: relative;
- width: auto;
- height: 32px;
- display: flex;
- align-items: center;
- justify-content: center;
- border-radius: 5px;
- color: var(--vent-font-color);
- padding: 10px 15px;
- margin: 0px 10px;
- box-sizing: border-box;
- cursor: pointer;
- background: var(--button-box-bg);
- }
- }
- .top-center {
- display: flex;
- flex: 1;
- justify-content: center;
- align-items: center;
- font-size: 20px;
- color: var(--vent-font-color);
- .top-c-label {
- color: yellow;
- }
- }
- .top-right {
- display: flex;
- flex: 2;
- justify-content: right;
- align-items: center;
- color: var(--vent-font-color);
- .control-type {
- display: flex;
- color: var(--vent-font-color);
- .control-title {
- color: var(--control-title-color);
- }
- }
- }
- }
- .footer-item-box {
- width: calc(100% - 20px);
- height: auto;
- position: absolute;
- left: 50%;
- bottom: 30px;
- transform: translate(-50%);
- display: flex;
- justify-content: center;
- color: var(--vent-font-color);
- // box-shadow: 0 0 30px rgb(0, 153, 184) inset;
- pointer-events: auto;
- .device-detail {
- text-align: center;
- &:first-child {
- background-color: var(--footer-item-bg);
- }
- &:last-child {
- .device-val,
- .device-title {
- border-right: 1px solid var(--border-color);
- }
- }
- .device-val {
- line-height: 36px;
- border-top: 1px solid var(--border-color);
- border-left: 1px solid var(--border-color);
- &:last-child {
- border-bottom: 1px solid var(--border-color);
- }
- }
- }
- .device-title {
- width: 110px;
- text-align: center;
- border-top: 1px solid var(--border-color);
- border-left: 1px solid var(--border-color);
- line-height: 46px;
- color: #e7fdff;
- background-color: var(--footer-item-bg);
- }
- }
- .lr-box {
- height: fit-content;
- display: flex;
- flex-direction: column;
- position: relative;
- overflow: hidden;
- z-index: 9999;
- pointer-events: auto;
- }
- .item {
- width: 335px;
- height: auto;
- position: relative;
- border-radius: 5px;
- margin-top: 10px;
- margin-bottom: 0px;
- pointer-events: auto;
- color: var(--vent-font-color);
- overflow: hidden;
- &:first-child {
- margin-top: 0px;
- }
- .base-title {
- color: var(--vent-font-color);
- margin-bottom: 8px;
- padding-left: 10px;
- position: relative;
- font-size: 16px;
- &::after {
- content: '';
- position: absolute;
- display: block;
- width: 4px;
- height: 12px;
- top: 7px;
- left: 0px;
- background: #45d3fd;
- border-radius: 4px;
- }
- }
- .state-item {
- display: flex;
- flex-direction: row;
- padding: 5px;
- .item-col {
- width: calc(50% - 5px);
- display: flex;
- justify-content: center;
- align-items: center;
- padding-right: 4px;
- background-image: linear-gradient(to right, #39a3ff00, #39a3ff10);
- &:first-child {
- margin-right: 10px;
- }
- .state-title {
- color: #ffffffcc;
- flex: 9;
- font-size: 14px;
- }
- .state-val {
- flex: 1;
- color: #00eefffe;
- margin-right: 5px;
- text-align: right;
- font-size: 14px;
- }
- .state-title1 {
- color: #ffffffcc;
- flex: 5;
- font-size: 14px;
- }
- .state-val1 {
- display: flex;
- flex: 1;
- justify-content: center;
- align-items: center;
- }
- }
- }
- .signal-box {
- margin: 5px 0;
- display: flex;
- align-items: center;
- .signal-title {
- color: var(--vent-font-action-link);
- margin: 0 5px;
- }
- &:last-child {
- margin-right: 0px;
- }
- }
- .list-item {
- padding: 0 10px;
- display: flex;
- justify-content: space-between;
- align-items: center;
- .item-data-key {
- color: #ffffff99;
- }
- }
- .item-data-box {
- color: var(--vent-font-color);
- .state-icon {
- display: inline-block;
- width: 12px;
- height: 12px;
- border-radius: 12px;
- }
- .open {
- border: 5px solid #133a56;
- background: #4ecb73;
- }
- .close {
- border: 5px solid #192961;
- background: #6d7898;
- }
- }
- }
- .item-l {
- width: 100%;
- .monitor-box {
- width: 100%;
- .parameter-title {
- position: relative;
- width: 100%;
- height: 14px;
- margin-top: 10px;
- .icon,
- span {
- position: absolute;
- top: -10px;
- }
- }
- .group-parameter-title {
- background-image: linear-gradient(to right, #39a3ff50, #39a3ff00);
- .icon {
- left: -12px;
- top: -17px;
- }
- span {
- left: 18px;
- }
- .item-col {
- background-image: linear-gradient(to right, #39a3ff00, #39a3ff10);
- }
- }
- .device-parameter-title {
- background-image: linear-gradient(to right, #3df6ff40, #3df6ff00);
- .icon {
- left: -10px;
- top: -14px;
- }
- span {
- left: 18px;
- }
- .item-col {
- background-image: linear-gradient(to right, #3df6ff10, #3df6ff00);
- }
- }
- }
- // .monitor-box1 {
- // height: 126px;
- // }
- .state-box {
- height: calc(100% - 24px);
- overflow-y: auto;
- }
- }
- .right-box {
- width: 330px;
- margin-top: 50px;
- }
- .left-box {
- width: 365px;
- margin-top: 80px;
- }
- }
- &:deep(.win) {
- width: 100%;
- margin: 0 !important;
- }
- }
- }
- &:deep(.main) {
- .title {
- height: 34px;
- text-align: center;
- font-weight: 600;
- color: var(--vent-font-action-link);
- // background-image: url('../../../assets/img/yfj/light.png');
- background-repeat: no-repeat;
- background-position-x: center;
- background-position-y: 100%;
- background-size: 80%;
- font-size: 16px;
- }
- .monitor-item {
- width: 200px;
- display: flex;
- flex-direction: row;
- width: auto;
- margin-bottom: 3px;
- .monitor-val {
- color: #ffb700;
- display: flex;
- width: auto;
- .val {
- width: 80px;
- // font-size: 14px;
- font-size: 16px;
- }
- .unit {
- color: #ffffffbb;
- // font-size: 14px;
- font-size: 16px;
- }
- }
- }
- .monitor-title {
- width: 100px;
- color: var(--vent-font-action-link);
- font-weight: 400;
- // font-size: 14px;
- font-size: 16px;
- }
- .signal-item {
- display: flex;
- justify-content: space-between;
- // margin-bottom: 5px;
- .signal-round {
- display: inline-block;
- width: 8px;
- height: 8px;
- border-radius: 50%;
- margin: 0 10px;
- position: relative;
- &::after {
- display: block;
- content: '';
- position: absolute;
- width: 12px;
- height: 12px;
- top: -2px;
- left: -2px;
- border-radius: 50%;
- }
- }
- .signal-round-gry {
- background-color: #858585;
- &::after {
- background-color: #85858544;
- box-shadow: 0 0 1px 1px #85858599;
- }
- }
- .signal-round-run {
- background-color: #67fc00;
- &::after {
- background-color: #67fc0044;
- box-shadow: 0 0 1px 1px #c6ff77;
- }
- }
- .signal-round-warning {
- background-color: #e9170b;
- &::after {
- background-color: #e9170b44;
- box-shadow: 0 0 1px 1px #e9170b;
- }
- }
- }
- }
- :deep(.zxm-radio-wrapper) {
- color: var(--vent-font-color) !important;
- }
- :deep(.zxm-radio-group) {
- color: var(--vent-font-color) !important;
- }
- :deep(.zxm-radio-group .zxm-radio-wrapper) {
- color: var(--vent-font-color) !important;
- }
- :deep(.zxm-radio-disabled + span) {
- color: var(--vent-font-color);
- }
- :deep(.zxm-radio-disabled .zxm-radio-inner::after) {
- background-color: #0490a8;
- }
- </style>
|