123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804 |
- <template>
- <div id="compressor3D" style="width: 100%; height: 100%; position: absolute; overflow: hidden"></div>
- <div
- id="compressorCss3D"
- class="threejs-Object-CSS compressorCss3D-box"
- style="width: 100%; height: 100%; position: absolute; pointer-events: none; overflow: hidden; z-index: 2; top: 0px; left: 0px"
- >
- <div v-for="(groupNum, index) in monitorDataGroup" :key="index" class="modal-monitor">
- <fourBorderBg :class="`kyj${index}`" :id="`nitrogenMonitor${groupNum}`">
- <div class="title">{{ kyjs[index] }} </div>
- <template v-for="(preMonitor, preMonitorIndex) in preMonitorList" :key="preMonitorIndex">
- <div v-if="preMonitor.code !== 'signal'" class="monitor-item">
- <span class="monitor-title">{{ preMonitor.title }}:</span>
- <span class="monitor-val"
- ><span class="val">{{
- monitorData[preMonitor.code.replace(prefix[0], `${prefix[0]}${groupNum}`)]
- ? formatNum(monitorData[preMonitor.code.replace(prefix[0], `${prefix[0]}${groupNum}`)])
- : '-'
- }}</span
- ><span class="unit">{{ preMonitor.unit }}</span></span
- >
- </div>
- <div v-else class="signal-item">
- <div class="signal" v-for="(signal, childIndex) in preMonitor.child" :key="childIndex">
- <span class="monitor-title">{{ signal.title }}</span>
- <span
- :class="{
- 'signal-round': true,
- 'signal-round-run': signal.title != '故障信号' && monitorData[signal.code.replace(prefix[0], `${prefix[0]}${groupNum}`)] == '1',
- 'signal-round-warning': signal.title == '故障信号' && monitorData[signal.code.replace(prefix[0], `${prefix[0]}${groupNum}`)] == '1',
- 'signal-round-gry': monitorData[signal.code.replace(prefix[0], `${prefix[0]}${groupNum}`)] != '1',
- }"
- ></span>
- </div>
- </div>
- </template>
- </fourBorderBg>
- <fourBorderBg :class="`cqg${index}`" :id="`cqgMonitor${groupNum}`">
- <div class="title">{{ cqgs[index] }}</div>
- <template v-for="(cqgMonitor, cqgMonitorIndex) in cqgMonitorList" :key="cqgMonitorIndex">
- <div class="monitor-item">
- <span class="monitor-title">{{ cqgMonitor.title }}:</span>
- <span class="monitor-val"
- ><span class="val">{{
- monitorData[cqgMonitor.code.replace(prefix[0], `${prefix[1]}${groupNum}`)]
- ? formatNum(monitorData[cqgMonitor.code.replace(prefix[1], `${prefix[1]}${groupNum}`)])
- : '-'
- }}</span
- ><span class="unit">{{ cqgMonitor.unit }}</span></span
- >
- </div>
- </template>
- </fourBorderBg>
- </div>
- </div>
- <div class="nitrogen-home">
- <div style="position: absolute; color: #fff; top: 30px; pointer-events: auto; display: flex">
- <div
- v-for="(sysItem, sysIndex) in monitorDataGroupArr"
- :key="sysIndex"
- class="tab-button-box"
- :class="{ 'tab-button-box-active': monitorDataGroupFlag == sysIndex + 1 }"
- @click="setMonitorGroupNum(monitorDataGroup1, sysIndex + 1)"
- >{{ '压风系统' + (sysIndex + 1) }} (运行: <p style="padding: 0 5px"></p
- ><span
- :class="{
- 'signal-round': true,
- 'signal-round-run': sysStateList[sysIndex] && sysStateList[sysIndex].isRun,
- 'signal-round-gry': sysStateList[sysIndex] && !sysStateList[sysIndex].isRun,
- }"
- ></span>
- <p style="padding: 0 5px"></p>故障:<p style="padding: 0 5px"></p
- ><span
- :class="{
- 'signal-round': true,
- 'signal-round-warning': sysStateList[sysIndex] && sysStateList[sysIndex].fault,
- 'signal-round-gry': sysStateList[sysIndex] && !sysStateList[sysIndex].fault,
- }"
- ></span
- ><p style="padding: 0 5px"></p> )</div
- >
- </div>
- <div class="total-data">
- <div class="vent-flex-row">
- <div class="item"
- >总管压力(bar):<span class="val">{{ monitorData[`MainPipePressure`] ? formatNum(monitorData[`MainPipePressure`]) : '-' }}</span></div
- >
- </div>
- </div>
- <div class="nitrogen-container">
- <div v-if="monitorData['netStatus'] == 0" class="device-state">网络断开</div>
- <div class="top-box">
- <!-- 左边监测数据 -->
- <div class="lr-box left-box">
- <div class="left-container">
- <div class="item item-l" v-for="(groupNum, index) in monitorDataGroup" :key="index">
- <div class="monitor-box">
- <ventBox1>
- <template #title>
- <div>{{ groupNum }}号压风机</div>
- </template>
- <template #container>
- <div class="state-item">
- <div class="item-col" v-for="(preFan, preFanIndex) in preFanMonitorData" :key="preFanIndex">
- <span class="state-title">{{ preFan.title + (preFan.unit !== 'signal' ? `(${preFan.unit})` : '') }}</span>
- <span v-if="preFan.unit !== 'signal'" class="state-val">{{
- monitorData[preFan.code.replace(prefix[2], prefix[2] + groupNum)] >= 0
- ? formatNum(Number(monitorData[preFan.code.replace(prefix[2], prefix[2] + groupNum)]))
- : '-'
- }}</span>
- <span
- v-else
- :class="{
- 'signal-round': true,
- 'signal-round-warning': monitorData[preFan.code.replace(prefix[2], `${prefix[2]}${groupNum}`)] == '1',
- 'signal-round-gry': monitorData[preFan.code.replace(prefix[2], `${prefix[2]}${groupNum}`)] != '1',
- }"
- ></span>
- </div>
- </div>
- </template>
- </ventBox1>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script lang="ts" setup name="nitrogenHome">
- import { onMounted, onUnmounted, ref, watch } from 'vue';
- import fourBorderBg from '../../../comment/components/fourBorderBg.vue';
- import { mountedThree, destroy, setModelType } from '../nitrogen.threejs';
- import { list } from '../nitrogen.api';
- import ventBox1 from '/@/components/vent/ventBox1.vue';
- // import { monitorDataGroupArr, preFanMonitorData, monitorData, preMonitorList, cqgMonitorList, prefix, getSysState } from '../nitrogen.dataYJ';
- // import type { State } from '../nitrogen.dataYJ';
- import { formatNum } from '/@/utils/ventutil';
- const loading = ref(true);
- const monitorDataGroupFlag = ref(0);
- const monitorDataGroup = ref([]);
- const kyjs = ref([]);
- const cqgs = ref([]);
- const monitorData = ref([]);
- const sysStateList = ref<State[]>([]);
- // https获取监测数据
- let timer: null | NodeJS.Timeout = null;
- async function getMonitor(flag?) {
- if (Object.prototype.toString.call(timer) === '[object Null]') {
- timer = await setTimeout(
- async () => {
- await getDataSource();
- if (timer) {
- timer = null;
- }
- await getMonitor(false);
- },
- flag ? 0 : 1000
- );
- }
- }
- async function getDataSource() {
- const res = await list({ devicetype: 'forcFan', pagetype: 'normal' });
- let dataSource = res.msgTxt[0] && res.msgTxt[0].datalist ? res.msgTxt[0].datalist[0] : [];
- if (dataSource) {
- monitorData.value = Object.assign(dataSource, dataSource.readData);
- }
- loading.value = false;
- sysStateList.value = getSysState(monitorData.value);
- }
- function setMonitorGroupNum(num, flag) {
- monitorDataGroupFlag.value = flag;
- }
- function changeGroup(val) {
- kyjs.value = val.map((item) => `${item}号空压机`);
- cqgs.value = val.map((item) => `${item}号储气罐`);
- monitorData.value = new Array(val.length).fill({
- strName: '空压机',
- compressGroupName: '',
- compressExhaustPressF1: '-',
- compressSeparatePressF1: '-',
- compressHostTempF1: '-',
- compressCrewTempF1: '-',
- compressRunTimeF1: '-',
- controlModel: 'LOC',
- });
- }
- watch(monitorDataGroupFlag, (newVal) => {
- const monitorGroup = monitorDataGroupArr[newVal - 1];
- changeGroup(monitorGroup);
- monitorDataGroup.value = monitorGroup;
- setModelType(monitorGroup);
- });
- onMounted(async () => {
- mountedThree().then(async () => {
- await getMonitor(true);
- monitorDataGroupFlag.value = 1;
- });
- });
- onUnmounted(() => {
- destroy();
- if (timer) {
- clearTimeout(timer);
- timer = undefined;
- }
- });
- </script>
- <style lang="less" scoped>
- @ventSpace: zxm;
- .nitrogen-home {
- width: 100%;
- height: 100%;
- display: flex;
- justify-content: center;
- position: relative;
- .total-data {
- position: absolute;
- color: #e4cd00;
- z-index: 9;
- top: 50px;
- right: 30px;
- // display: flex;
- font-size: 18px;
- .item {
- width: 200px;
- margin-left: 30px;
- .val {
- color: #00d8ff;
- }
- }
- }
- }
- .compressorCss3D-box {
- .modal-monitor {
- position: absolute;
- left: 0px;
- top: 0px;
- }
- &:deep(.win) {
- margin: 0 !important;
- background: #00000044;
- }
- &:deep(.main) {
- .title {
- height: 34px;
- text-align: center;
- font-weight: 600;
- color: #7af5ff;
- // 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 {
- display: flex;
- flex-direction: row;
- width: auto;
- margin-bottom: 3px;
- .monitor-val {
- color: #ffb700;
- display: flex;
- width: auto;
- .val {
- width: 80px;
- font-size: 14px;
- }
- .unit {
- color: #ffffffbb;
- font-size: 14px;
- }
- }
- }
- .monitor-title {
- width: 100px;
- color: #7af5ff;
- font-weight: 400;
- font-size: 14px;
- }
- .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;
- }
- }
- }
- }
- }
- .nitrogen-home {
- width: 100%;
- height: calc(100% - 100px);
- position: fixed;
- z-index: 99;
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- pointer-events: none;
- top: 60px;
- .nitrogen-container {
- width: 100%;
- height: calc(100%);
- display: flex;
- justify-content: space-between;
- margin-bottom: 100px;
- position: relative;
- .device-state {
- width: 100%;
- position: absolute;
- top: 20px;
- color: #e90000;
- display: flex;
- justify-content: center;
- font-size: 20px;
- }
- .top-box {
- width: 100%;
- padding: 10px;
- overflow: hidden;
- display: flex;
- justify-content: space-between;
- .lr-box {
- display: flex;
- flex-direction: column;
- position: relative;
- z-index: 9999;
- pointer-events: auto;
- }
- .item {
- width: 285px;
- height: auto;
- position: relative;
- border-radius: 5px;
- margin-top: 10px;
- margin-bottom: 0px;
- pointer-events: auto;
- color: #fff;
- overflow: hidden;
- .control-item {
- height: auto;
- min-height: 35px;
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- align-items: center;
- padding: 5px;
- margin: 0 10px 0 3px;
- pointer-events: auto;
- background: linear-gradient(to right, #0063cd22, #0063cd04);
- margin-bottom: 5px;
- border-width: 1px;
- border-style: dashed;
- border-image: linear-gradient(to right, #008ccd66, #0063cd04) 1 1;
- border-radius: 5px;
- &:last-child {
- margin-bottom: 0;
- }
- .control-item-l {
- display: flex;
- align-items: center;
- font-size: 14px;
- .round {
- display: inline-block;
- width: 3px;
- height: 3px;
- padding: 1px;
- border-radius: 50%;
- background-color: #3df6ff;
- margin-right: 5px;
- box-shadow: 0 0 1px 1px #64f7ff;
- }
- }
- .control-item-r {
- text-align: right;
- }
- .button-box {
- position: relative;
- padding: 5px;
- border: 1px transparent solid;
- background-clip: border-box;
- border-radius: 5px;
- margin-left: 8px;
- }
- .a-button {
- pointer-events: auto;
- }
- &::v-deep .a-button--mini {
- padding: 6px 10px;
- }
- &::v-deep .a-button--mini.is-round {
- padding: 6px 10px;
- }
- }
- .base-title {
- width: calc(100% - 60px);
- text-align: center;
- color: #00d8ff;
- }
- .state-item {
- width: 100%;
- display: flex;
- flex-direction: row;
- flex-wrap: wrap;
- .item-col {
- width: 50%;
- display: flex;
- justify-content: center;
- align-items: center;
- padding: 5px;
- .state-title {
- color: #ffffffcc;
- flex: 9;
- font-size: 14px;
- .unit {
- // color: #ffffffbb;
- }
- }
- .state-val {
- flex: 1;
- color: #e4a300;
- margin-right: 5px;
- text-align: right;
- font-size: 14px;
- }
- }
- }
- .signal-box {
- margin: 5px 0;
- display: flex;
- align-items: center;
- .signal-title {
- color: #7af5ff;
- 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: #fff;
- .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: 335px;
- .monitor-box {
- // width: 335px;
- background-color: #ffffff05;
- // margin-left: 2px;
- // border-radius: 5px;
- // backdrop-filter: blur(10px);
- }
- }
- .right-box {
- width: 330px;
- .control-group {
- display: flex;
- // justify-content: space-around;
- flex-wrap: wrap;
- .control-item {
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- padding: 0 4px;
- .control-item-title {
- color: #a6dce9;
- position: relative;
- top: 5px;
- }
- .control-item-state {
- width: 94px;
- height: 47px;
- background: url('/@/assets/images/vent/control-switch-bg.png');
- display: flex;
- justify-content: center;
- align-items: center;
- color: #fff;
- }
- .button-box {
- position: relative;
- padding: 5px;
- border: 1px transparent solid;
- background-clip: border-box;
- border-radius: 5px;
- margin-left: 8px;
- }
- .a-button {
- pointer-events: auto;
- }
- &::v-deep .a-button--mini {
- padding: 6px 10px;
- }
- &::v-deep .a-button--mini.is-round {
- padding: 6px 10px;
- }
- }
- }
- .control-btn-group {
- width: 100%;
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- align-items: center;
- .control-left-box {
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- padding: 0 20px;
- .btn-box {
- width: 100px;
- color: #fff;
- display: flex;
- justify-content: space-between;
- span {
- display: inline-block;
- padding: 2px 8px;
- background: #007099;
- border-radius: 4px;
- border: 1px solid rgb(125, 230, 249);
- cursor: pointer;
- &:hover {
- background: #005574;
- }
- }
- }
- .icon-box {
- width: 60px;
- height: 60px;
- border-radius: 30px;
- border: 2px solid #00bcdd;
- box-shadow: 0 0 20px #ffffff88;
- display: flex;
- justify-content: center;
- align-items: center;
- margin-top: 20px;
- .icon {
- width: 18px;
- height: 18px;
- border-radius: 9px;
- border: 3px solid #d7f9ff;
- position: relative;
- background: #00bcdd;
- &::before {
- position: absolute;
- content: '';
- width: 2px;
- height: 12px;
- background-color: #00bcdd;
- left: 6px;
- top: -16px;
- }
- &::after {
- position: absolute;
- content: '';
- width: 2px;
- height: 12px;
- left: 6px;
- top: 17px;
- background-color: #00d9ff;
- }
- }
- }
- .remote-icon-box {
- transform: rotate(30deg);
- animation: iconRotate 1s linear;
- }
- .remote-icon-box1 {
- transform: rotate(-30deg);
- animation: iconRotate1 1s linear;
- }
- @keyframes iconRotate {
- from {
- transform: rotate(-30deg);
- }
- to {
- transform: rotate(30deg);
- }
- }
- @keyframes iconRotate1 {
- from {
- transform: rotate(30deg);
- }
- to {
- transform: rotate(-30deg);
- }
- }
- }
- .control-right-box {
- width: 100px;
- color: #fff;
- height: 80px;
- justify-content: space-between;
- align-items: center;
- .btn {
- margin-bottom: 30px;
- }
- }
- }
- }
- .left-box {
- height: calc(100%);
- overflow-x: hidden;
- overflow-y: auto;
- pointer-events: auto;
- direction: rtl;
- .left-container {
- direction: ltr;
- }
- .control-item {
- height: 36px;
- }
- }
- }
- }
- }
- .tab-button-box {
- display: inline-block;
- position: relative;
- padding: 5px;
- // border: 1px transparent solid;
- border-radius: 5px;
- margin-left: 8px;
- margin-right: 8px;
- width: auto;
- // height: 40px;
- // border: 1px solid #65dbea;
- height: 35px !important;
- display: flex;
- align-items: center;
- justify-content: center;
- color: #fff;
- padding: 0 15px 5px 15px;
- cursor: pointer;
- &:hover {
- background: linear-gradient(#2cd1ff55, #1eb0ff55);
- }
- &::before {
- width: calc(100% - 6px);
- height: 27px;
- content: '';
- position: absolute;
- top: 3px;
- right: 0;
- left: 3px;
- bottom: 0;
- z-index: -1;
- border-radius: inherit; /*important*/
- background: linear-gradient(#1fa6cb, #127cb5);
- }
- &::after {
- width: calc(100% + 32px);
- height: 10px;
- content: '';
- position: absolute;
- top: 28px;
- right: 0;
- left: -16px;
- bottom: 0;
- z-index: -1;
- border-radius: inherit; /*important*/
- background: url('/@/assets/images/vent/short-light.png') no-repeat;
- background-position: center;
- background-size: 100%;
- z-index: 999;
- }
- }
- .tab-button-box-active {
- border: 1px solid #66989e !important;
- &:hover {
- background: none !important;
- }
- &::before {
- background: linear-gradient(#1fa6cbcc, #127cb5cc) !important;
- }
- }
- </style>
|