nitrogenHome_hlg.vue 38 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195
  1. <template>
  2. <div id="nitrogen3D" style="width: 100%; height: 100%; position: absolute; overflow: hidden"></div>
  3. <div
  4. id="nitrogenCss3D"
  5. class="threejs-Object-CSS"
  6. style="width: 100%; height: 100%; position: absolute; pointer-events: none; overflow: hidden; z-index: 2; top: 0px; left: 0px"
  7. >
  8. <a-spin :spinning="loading" />
  9. <div v-for="groupNum in monitorDataGroupNum" :key="groupNum" class="modal-monitor">
  10. <fourBorderBg :class="`kyj${groupNum}`" :id="`nitrogenMonitor${groupNum}`">
  11. <!-- <div class="title">空压机{{ groupNum }} </div> -->
  12. <div class="title">
  13. {{ monitorData && monitorData['strname' + groupNum] ? monitorData['strname' + groupNum] : '注氮机' + groupNum }}
  14. (
  15. <span :style="{ color: monitorData && monitorData['Status' + groupNum] == '1' ? '#67fc00' : '#e9170b' }">
  16. {{ monitorData && monitorData['Status' + groupNum] == '1' ? '运行' : '停止' }}
  17. </span>
  18. )
  19. </div>
  20. <template v-for="(preMonitor, preMonitorIndex) in preMonitorList" :key="preMonitorIndex">
  21. <div v-if="preMonitor.code !== 'signal'" class="monitor-item">
  22. <span class="monitor-title">{{ preMonitor.title }}:</span>
  23. <span class="monitor-val"
  24. ><span class="val">{{ monitorData[preMonitor.code + groupNum] ? formatNum(monitorData[preMonitor.code + groupNum]) : '-' }}</span
  25. ><span class="unit">{{ preMonitor.unit }}</span></span
  26. >
  27. </div>
  28. <div v-else class="signal-item">
  29. <div class="signal" v-for="(signal, childIndex) in preMonitor.child" :key="childIndex">
  30. <span class="monitor-title">{{ signal.title }}</span>
  31. <span style="display: inline-block; width: 30px; text-align: center" v-if="signal.isFault == -2">{{
  32. monitorData[signal.code + groupNum] == '0' ? '就地' : monitorData[signal.code + groupNum] == '1' ? '远程' : '-'
  33. }}</span>
  34. <span style="display: inline-block; width: 30px; text-align: center" v-else-if="signal.isFault == -1">{{
  35. monitorData[signal.code + groupNum] == '1' ? '加载' : monitorData[signal.code + groupNum] == '0' ? '卸载' : '-'
  36. }}</span>
  37. <span
  38. v-else
  39. :class="{
  40. 'signal-round': true,
  41. 'signal-round-run': !signal.isFault && monitorData[signal.code + groupNum] == '1',
  42. 'signal-round-warning': signal.isFault && monitorData[signal.code + groupNum] == '1',
  43. 'signal-round-gry': monitorData[signal.code + groupNum] != '1',
  44. }"
  45. ></span>
  46. </div>
  47. </div>
  48. </template>
  49. </fourBorderBg>
  50. </div>
  51. </div>
  52. <div class="nitrogen-home">
  53. <div class="nitrogen-container">
  54. <div class="top-box">
  55. <!-- 中间区域控制按钮 -->
  56. <div class="center-item-box">
  57. <div class="top-left" v-if="airCompressorState.length > 0">
  58. <div class="button-box" @click="handlerDevice(airCompressorState[0], '主机启动')">上位机启动</div>
  59. <div class="button-box" @click="handlerDevice(airCompressorState[0], '主机停止')">上位机停止</div>
  60. <div class="button-box" @click="handlerDevice(airCompressorState[0], '备机启动')">上位复位</div>
  61. </div>
  62. <div class="top-center">
  63. <div class="top-c-label">通信状态:</div>
  64. <div class="top-c-val">{{ monitorData['netStatus'] == 1 ? '连接' : monitorData['netStatus'] == 0 ? '断开' : '未知' }}</div>
  65. </div>
  66. <div class="top-right">
  67. <div class="control-type" v-if="monitorData['RemSelect'] !== undefined">
  68. <div class="control-title">空压机远近控切换:</div>
  69. <a-radio-group v-model:value="monitorData['RemSelect']">
  70. <a-radio :value="`1`">远程</a-radio>
  71. <a-radio :value="`0`">就地</a-radio>
  72. </a-radio-group>
  73. </div>
  74. <div class="control-type" v-if="monitorData['LocSelect'] !== undefined">
  75. <div class="control-title">制氮机远近控切换:</div>
  76. <a-radio-group v-model:value="monitorData['LocSelect']">
  77. <a-radio :value="`1`">远程</a-radio>
  78. <a-radio :value="`0`">就地</a-radio>
  79. </a-radio-group>
  80. </div>
  81. </div>
  82. </div>
  83. <!-- 左边监测数据 -->
  84. <div class="lr-box left-box">
  85. <ventBox1 v-if="deviceType != 'nitrogen_52507'">
  86. <template #title>
  87. <div>注氮机监测</div>
  88. </template>
  89. <template #container>
  90. <div class="input-item" v-for="(preFan, index) in nitrogenMonitorData" :key="index">
  91. <div class="title">{{ preFan.title }}</div>
  92. <div v-if="preFan.unit !== 'signal' && preFan.unit !== 'warning'" class="value">{{
  93. monitorData[preFan.code] >= 0 ? formatNum(Number(monitorData[preFan.code])) : '-'
  94. }}</div>
  95. <div
  96. v-else
  97. :class="{
  98. 'signal-round': true,
  99. 'signal-round-warning': monitorData[preFan.code] == '1' && preFan.unit == 'warning',
  100. 'signal-round-run': monitorData[preFan.code] == '1' && preFan.unit == 'signal',
  101. 'signal-round-gry': monitorData[preFan.code] != '1',
  102. }"
  103. ></div>
  104. <div class="unit">{{ preFan.unit !== 'signal' && preFan.unit !== 'warning' ? `(${preFan.unit})` : '' }}</div>
  105. </div>
  106. </template>
  107. </ventBox1>
  108. <div class="item item-l" v-for="groupNum in monitorDataGroupNum" :key="groupNum">
  109. <ventBox1>
  110. <template #title>
  111. <div>{{ monitorData && monitorData['strname' + groupNum] ? monitorData['strname' + groupNum] : '注氮机' + groupNum }}</div>
  112. </template>
  113. <template #container>
  114. <div class="monitor-box">
  115. <div class="monitor-item">
  116. <div class="state-item" v-for="(preFan, index) in preFanMonitorData" :key="index">
  117. <div class="state-title">{{
  118. preFan.title + (preFan.unit !== 'signal' && preFan.unit !== 'warning' ? `(${preFan.unit})` : '')
  119. }}</div>
  120. <div v-if="preFan.unit !== 'signal' && preFan.unit !== 'warning'" class="value">{{
  121. monitorData[preFan.code + groupNum] >= 0 ? formatNum(Number(monitorData[preFan.code + groupNum])) : '-'
  122. }}</div>
  123. <div
  124. v-else
  125. :class="{
  126. 'signal-round': true,
  127. 'signal-round-warning': monitorData[preFan.code + groupNum] == '1' && preFan.unit == 'warning',
  128. 'signal-round-run': monitorData[preFan.code + groupNum] == '1' && preFan.unit == 'signal',
  129. 'signal-round-gry': monitorData[preFan.code + groupNum] != '1',
  130. }"
  131. ></div>
  132. </div>
  133. </div>
  134. </div>
  135. </template>
  136. </ventBox1>
  137. </div>
  138. </div>
  139. <!-- 右边控制状态 -->
  140. <div class="lr-box right-box">
  141. <!-- <ventBox1 v-if="deviceType == 'nitrogen_52507'">
  142. <template #title>
  143. <div>注氮机监测</div>
  144. </template>
  145. <template #container>
  146. <div class="input-item" v-for="(preFan, index) in nitrogenMonitor" :key="index">
  147. <div class="title">{{ preFan.title }}</div>
  148. <div v-if="preFan.unit !== 'signal' && preFan.unit !== 'warning'" class="value">{{
  149. monitorData[preFan.code] >= 0 ? formatNum(Number(monitorData[preFan.code])) : '-'
  150. }}</div>
  151. <div
  152. v-else
  153. :class="{
  154. 'signal-round': true,
  155. 'signal-round-warning': monitorData[preFan.code] == '1' && preFan.unit == 'warning',
  156. 'signal-round-run': monitorData[preFan.code] == '1' && preFan.unit == 'signal',
  157. 'signal-round-gry': monitorData[preFan.code] != '1',
  158. }"
  159. ></div>
  160. <div class="unit">{{ preFan.unit !== 'signal' && preFan.unit !== 'warning' ? `(${preFan.unit})` : '' }}</div>
  161. </div>
  162. </template>
  163. </ventBox1> -->
  164. <ventBox1 class="vent-margin-t-10">
  165. <template #title>
  166. <div>设备实时监测曲线</div>
  167. </template>
  168. <template #container>
  169. <BarAndLine
  170. v-if="chartsColumns.length > 0"
  171. xAxisPropType="readTime"
  172. :dataSource="echartData"
  173. height="320px"
  174. :chartsColumns="chartsColumns"
  175. :option="echatsOption"
  176. />
  177. </template>
  178. </ventBox1>
  179. </div>
  180. </div>
  181. <div ref="playerRef" class="player-box" style=""> </div>
  182. </div>
  183. <div class="modal-monitor">
  184. <fourBorderBg id="downWindMonitor">
  185. <div class="title">下风测监测 </div>
  186. <div class="monitor-item" v-for="(data, index) in downWindData" :key="index">
  187. <span class="monitor-title">{{ data.title }} :</span>
  188. <span class="monitor-val" v-if="!refresh"
  189. ><span class="val">
  190. {{ monitorData && monitorData[data.code] ? (data.raw ? monitorData[data.code] : parseFloat(monitorData[data.code]).toFixed(2)) : '-' }}
  191. </span>
  192. <span class="unit">{{ data.unit }}</span></span
  193. >
  194. </div>
  195. </fourBorderBg>
  196. </div>
  197. </div>
  198. </template>
  199. <script lang="ts" setup name="nitrogenHome">
  200. import { onMounted, onUnmounted, ref, watch, reactive, defineProps, nextTick, inject, unref } from 'vue';
  201. import ventBox1 from '/@/components/vent/ventBox1.vue';
  202. import fourBorderBg from '../../../comment/components/fourBorderBg.vue';
  203. import { mountedThree, destroy, setModelType } from '../nitrogen.threejs';
  204. import { getDevice } from '../nitrogen.api';
  205. import BarAndLine from '/@/components/chart/BarAndLine.vue';
  206. import { deviceControlApi } from '/@/api/vent/index';
  207. import { preFanMonitorData, preMonitorList, nitrogenMonitorData } from '../nitrogen.data.hlg';
  208. import { downWindData } from '../nitrogen.data';
  209. import { formatNum } from '/@/utils/ventutil';
  210. import { useCamera } from '/@/hooks/system/useCamera';
  211. import { message } from 'ant-design-vue';
  212. import lodash from 'lodash';
  213. import { getTableHeaderColumns } from '/@/hooks/web/useWebColumns';
  214. const globalConfig = inject('globalConfig');
  215. const props = defineProps({
  216. deviceId: {
  217. type: String,
  218. require: true,
  219. },
  220. modalType: {
  221. type: String,
  222. require: true,
  223. },
  224. });
  225. const playerRef = ref();
  226. const refresh = ref(false);
  227. const modalTitle = ref(''); // 模态框标题显示内容,根据设备操作类型决定
  228. const modalType = ref(''); // 模态框内容显示类型,设备操作类型
  229. const modalIsShow = ref<boolean>(false); // 是否显示模态框
  230. const loading = ref(true);
  231. let kzParam = reactive<any>({
  232. data: {},
  233. isFw: null,
  234. });
  235. // const kyjs = ['1号空压机', '1号空压机', '1号空压机', '1号空压机'];
  236. const flvURL1 = () => {
  237. // return `https://sf1-hscdn-tos.pstatp.com/obj/media-fe/xgplayer_doc_video/flv/xgplayer-demo-360p.flv`;
  238. return '';
  239. };
  240. const colors = ['#FDB146', '#EE6666', '#9BCB75', '#03C2EC', '#DA3914', '#9C83D9'];
  241. const echatsOption = {
  242. grid: {
  243. top: '35%',
  244. left: '15%',
  245. right: '20px',
  246. bottom: '8%',
  247. // containLabel: true
  248. },
  249. toolbox: {
  250. feature: {},
  251. },
  252. };
  253. const deviceType = ref('');
  254. const monitorNetStatus = ref(0);
  255. const monitorDataGroupNum = ref(1);
  256. let airCompressorState = reactive<any[]>([]);
  257. // const chartsColumns = ref([
  258. // {
  259. // legend: '瞬时流量',
  260. // seriesName: '(m³/h)',
  261. // ymax: 2000,
  262. // yname: 'm³/h',
  263. // linetype: 'line',
  264. // yaxispos: 'left',
  265. // color: '#FDB146',
  266. // sort: 1,
  267. // xRotate: 0,
  268. // dataIndex: 'InputFlux',
  269. // },
  270. // ]);
  271. const chartsColumns = ref(getTableHeaderColumns('sys_nitrogen_chart'));
  272. const { getCamera, removeCamera } = useCamera();
  273. const monitorData = ref({});
  274. //图表数据
  275. let echartData = ref<any>([]);
  276. // https获取监测数据
  277. let timer: null | NodeJS.Timeout = null;
  278. async function getMonitor(flag?) {
  279. if (Object.prototype.toString.call(timer) === '[object Null]') {
  280. return new Promise(async (resolve) => {
  281. timer = await setTimeout(
  282. async () => {
  283. if (props.deviceId) {
  284. await getDataSource(props.deviceId);
  285. }
  286. if (timer) {
  287. timer = null;
  288. }
  289. resolve(null);
  290. await getMonitor();
  291. },
  292. flag ? 0 : 3000
  293. );
  294. });
  295. }
  296. }
  297. async function getDataSource(systemID) {
  298. const res = await getDevice({ devicetype: 'sys', systemID, type: 'all' });
  299. if (res) {
  300. const result = res;
  301. // const result = {
  302. // cmd: 'monitordata',
  303. // msgTxt: [
  304. // {
  305. // datalist: [
  306. // {
  307. // msgType: null,
  308. // deviceID: '1818548876779245569',
  309. // strname: '52507注氮机-2',
  310. // strinstallpos: '52507注氮机-2',
  311. // fsectarea: 'null',
  312. // stationname: '52507注氮机-2',
  313. // stationtype: 'redis',
  314. // deviceType: 'nitrogen_525072',
  315. // typeName: '52507注氮机2',
  316. // netStatus: 1,
  317. // warnFlag: 0,
  318. // warnLevel: 0,
  319. // warnLevel_str: '正常',
  320. // syswarnLevel: null,
  321. // syswarnLevel_str: null,
  322. // syswarnLevel_des: null,
  323. // warnTime: null,
  324. // readTime: '2024-08-04 17:59:25',
  325. // warnDes: '',
  326. // frontGateOpenCtrl: null,
  327. // rearGateOpenCtrl: null,
  328. // readData: {
  329. // FluxTotal12: '0.0',
  330. // RunTime42: '131072000',
  331. // NitrogenPurity2: '26',
  332. // ExhaustTemp2: '25.0',
  333. // Status2: '0',
  334. // RunTime2: '0',
  335. // sign: '0',
  336. // OilGasBarrel_SeparatorFault2: '0',
  337. // TotalFailureSignal2: '0',
  338. // InputFlux2: '5',
  339. // PhaseFailureFault12: '0',
  340. // RunTime22: '3080192',
  341. // LowVoltageFault2: '0',
  342. // SysVoltage2: '1158',
  343. // Fan_Current2: '0',
  344. // CtrlMode2: '1',
  345. // ExhaustPreHighFault2: '0',
  346. // ShortCutFaul2: '0',
  347. // OilGasBarrel_OverTempAlarm2: '0',
  348. // CloseFail2: '0',
  349. // OilGasBarrel_FilterBlockageFault2: '0',
  350. // HMIStartStop2: '0',
  351. // OilGasBarrel_OverTempAlarm12: '0',
  352. // OverVoltageFault2: '0',
  353. // OilGasBarrel_HighPressureFault2: '0',
  354. // Fan_OverloadFault2: '0',
  355. // OilPressureLowFault2: '0',
  356. // PhaseSequenceFault2: '0',
  357. // PhaseFailureFault2: '0',
  358. // RunTime32: '35323904',
  359. // MainMotor_OverTempFault2: '0',
  360. // FluxTotal22: '0.0',
  361. // PowerFault2: '0',
  362. // LoadorUnload2: '0',
  363. // PreMembraneTemperature2: '-19',
  364. // PhaseSequenceFault12: '0',
  365. // RunTime12: '393216',
  366. // ExhaustTemp12: '0',
  367. // TotalFailureSignal12: '0',
  368. // UnbalanceFault2: '0',
  369. // ExhaustPre2: '0',
  370. // MainMotor_OverloadFault2: '0',
  371. // NoWaterFault2: '0',
  372. // LoadTime2: '539',
  373. // MainMotor_Current2: '0',
  374. // isRun: '-2',
  375. // LeakageLock2: '0',
  376. // OpenFail2: '0',
  377. // },
  378. // readDataDes: null,
  379. // summaryHour: [],
  380. // summaryDay: [],
  381. // history: [],
  382. // dayhistory: [],
  383. // totalInfo: null,
  384. // sign: null,
  385. // cameras: [],
  386. // links: [],
  387. // other1: null,
  388. // other2: null,
  389. // other3: null,
  390. // remarkInfo: null,
  391. // linkInfo: null,
  392. // addrIndex: null,
  393. // warnLogNotOkCount: 0,
  394. // },
  395. // ],
  396. // avginfo: {
  397. // warnFlag: {
  398. // value: 0,
  399. // },
  400. // },
  401. // typeName: '52507注氮机2',
  402. // type: 'nitrogen_525072',
  403. // },
  404. // {
  405. // datalist: [
  406. // {
  407. // msgType: null,
  408. // deviceID: '1818546650996330498',
  409. // strname: '52507注氮机-1',
  410. // strinstallpos: '52507注氮机-1',
  411. // fsectarea: 'null',
  412. // stationname: '52507注氮机-1',
  413. // stationtype: 'redis',
  414. // deviceType: 'nitrogen_525071',
  415. // typeName: '52507注氮机1',
  416. // netStatus: 1,
  417. // warnFlag: 0,
  418. // warnLevel: 0,
  419. // warnLevel_str: '正常',
  420. // syswarnLevel: null,
  421. // syswarnLevel_str: null,
  422. // syswarnLevel_des: null,
  423. // warnTime: null,
  424. // readTime: '2024-08-04 17:59:25',
  425. // warnDes: '',
  426. // frontGateOpenCtrl: null,
  427. // rearGateOpenCtrl: null,
  428. // readData: {
  429. // RunTime41: '131072000',
  430. // NitrogenPurity1: '12',
  431. // ExhaustTemp1: '82.0',
  432. // RunTime21: '786432',
  433. // RunTime1: '1',
  434. // sign: '0',
  435. // OilGasBarrel_SeparatorFault1: '0',
  436. // InputFlux1: '13',
  437. // PhaseFailureFault11: '0',
  438. // LowVoltageFault1: '0',
  439. // SysVoltage1: '1149',
  440. // TotalFailureSignal1: '0',
  441. // Fan_Current1: '0',
  442. // ExhaustPreHighFault1: '0',
  443. // ShortCutFaul1: '0',
  444. // OilGasBarrel_OverTempAlarm1: '0',
  445. // CloseFail1: '0',
  446. // OilGasBarrel_FilterBlockageFault1: '0',
  447. // OilGasBarrel_OverTempAlarm11: '0',
  448. // HMIStartStop1: '0',
  449. // CtrlMode1: '1',
  450. // Fan_OverloadFault1: '0',
  451. // OilPressureLowFault1: '0',
  452. // OverVoltageFault1: '0',
  453. // OilGasBarrel_HighPressureFault1: '0',
  454. // PhaseFailureFault1: '0',
  455. // RunTime31: '70516736',
  456. // FluxTotal21: '0.0',
  457. // FluxTotal1: '0.01',
  458. // MainMotor_OverTempFault1: '0',
  459. // PhaseSequenceFault1: '0',
  460. // PowerFault1: '0',
  461. // LoadorUnload1: '0',
  462. // RunTime11: '3342336',
  463. // PhaseSequenceFault11: '0',
  464. // PreMembraneTemperature1: '25',
  465. // TotalFailureSignal11: '0',
  466. // UnbalanceFault1: '0',
  467. // ExhaustTemp11: '0',
  468. // ExhaustPre1: '89',
  469. // MainMotor_OverloadFault1: '0',
  470. // NoWaterFault1: '0',
  471. // Status1: '0',
  472. // LoadTime1: '1086',
  473. // isRun: '-2',
  474. // LeakageLock1: '0',
  475. // MainMotor_Current1: '95',
  476. // OpenFail1: '0',
  477. // o2Val: '20.23',
  478. // temperature: '19.5',
  479. // fumes_str: '0.2',
  480. // },
  481. // readDataDes: null,
  482. // summaryHour: [],
  483. // summaryDay: [],
  484. // history: [],
  485. // dayhistory: [],
  486. // totalInfo: null,
  487. // sign: null,
  488. // cameras: [],
  489. // links: [],
  490. // other1: null,
  491. // other2: null,
  492. // other3: null,
  493. // remarkInfo: null,
  494. // linkInfo: null,
  495. // addrIndex: null,
  496. // warnLogNotOkCount: 0,
  497. // },
  498. // ],
  499. // avginfo: {
  500. // warnFlag: {
  501. // value: 0,
  502. // },
  503. // },
  504. // typeName: '52507注氮机1',
  505. // type: 'nitrogen_525071',
  506. // },
  507. // {
  508. // subtype: 'sys_nitrogen',
  509. // datalist: [
  510. // {
  511. // msgType: '2',
  512. // deviceID: '1818821502634352642',
  513. // strname: '52507注氮系统',
  514. // strinstallpos: '52507注氮系统',
  515. // fsectarea: 'null',
  516. // stationname: null,
  517. // stationtype: null,
  518. // deviceType: 'sys_nitrogen',
  519. // typeName: '注氮系统',
  520. // netStatus: null,
  521. // warnFlag: 0,
  522. // warnLevel: null,
  523. // warnLevel_str: null,
  524. // syswarnLevel: 0,
  525. // syswarnLevel_str: null,
  526. // syswarnLevel_des: null,
  527. // warnTime: null,
  528. // readTime: '2024-08-01 09:56:28',
  529. // warnDes: '',
  530. // frontGateOpenCtrl: null,
  531. // rearGateOpenCtrl: null,
  532. // readData: {
  533. // sign: '0',
  534. // isRun: '-2',
  535. // },
  536. // readDataDes: null,
  537. // summaryHour: [],
  538. // summaryDay: [],
  539. // history: null,
  540. // dayhistory: [],
  541. // totalInfo: null,
  542. // sign: null,
  543. // cameras: [],
  544. // links: [],
  545. // other1: null,
  546. // other2: null,
  547. // other3: null,
  548. // remarkInfo: null,
  549. // linkInfo: null,
  550. // addrIndex: null,
  551. // warnLogNotOkCount: 0,
  552. // },
  553. // ],
  554. // typeName: '综合监测系统',
  555. // type: 'sys',
  556. // },
  557. // ],
  558. // };
  559. if (!result || result.msgTxt.length < 1) return;
  560. let dataSoreDatas = {};
  561. let netStatus = 0;
  562. result.msgTxt.forEach((item, index) => {
  563. if (item.type && item.type.startsWith('nitrogen')) {
  564. airCompressorState.length = 0;
  565. if (item.type.startsWith('nitrogen_52507')) {
  566. if (deviceType.value !== 'nitrogen_52507') deviceType.value = 'nitrogen_52507';
  567. dataSoreDatas = Object.assign(dataSoreDatas, item['datalist'][0], item['datalist'][0]['readData']);
  568. dataSoreDatas['strname' + (index + 1)] = item['datalist'][0]['strname'];
  569. if (item['datalist'][0]['netStatus']) {
  570. netStatus = 1;
  571. }
  572. } else {
  573. deviceType.value = '';
  574. monitorData.value = Object.assign(item['datalist'][0], item['datalist'][0]['readData']);
  575. if (monitorData.value['netStatus'] == 1) {
  576. netStatus = 1;
  577. }
  578. airCompressorState.push({
  579. id: monitorData.value['deviceID'],
  580. deviceType: monitorData.value['deviceType'],
  581. HMIStart: monitorData.value['HMIStart'],
  582. HMIStop: monitorData.value['HMIStop'],
  583. });
  584. }
  585. }
  586. });
  587. if (JSON.stringify(dataSoreDatas) !== '{}') {
  588. monitorData.value = dataSoreDatas;
  589. }
  590. monitorNetStatus.value = netStatus;
  591. const dataArr = lodash.cloneDeep(echartData.value);
  592. const airCompressor = { readTime: monitorData.value['readTime'].substring(11) };
  593. if (JSON.stringify(dataSoreDatas) === '{}') {
  594. airCompressor[`FluxTotal`] = monitorData.value['FluxTotal'] || 0;
  595. }
  596. // airCompressor[`InputFlux`] = Number(monitorData.value['InputFlux1']) + Number(monitorData.value['InputFlux2']) || null;
  597. // if (!airCompressor[`InputFlux`]) {
  598. // airCompressor[`InputFlux`] = monitorData.value['InputFlux'];
  599. // }
  600. airCompressor[`InputFlux`] =
  601. monitorData.value['InputFlux'] || Number(monitorData.value['InputFlux1']) + Number(monitorData.value['InputFlux2']);
  602. monitorData.value['FluxTotal'] = airCompressor[`InputFlux`];
  603. //图表数据
  604. if (dataArr.length <= 5) {
  605. dataArr.push(airCompressor);
  606. } else {
  607. dataArr.shift();
  608. dataArr.push(airCompressor);
  609. }
  610. echartData.value = dataArr;
  611. refresh.value = true;
  612. nextTick(() => {
  613. refresh.value = false;
  614. });
  615. }
  616. }
  617. function handlerDevice(data, bol) {
  618. kzParam.data = data;
  619. kzParam.isFw = bol;
  620. if (bol) {
  621. modalTitle.value = '一键复位';
  622. modalType.value = '1';
  623. modalIsShow.value = true;
  624. kzParam.data.HMIReset = !data.HMIReset;
  625. } else {
  626. modalTitle.value = '一键启停';
  627. modalType.value = '2';
  628. modalIsShow.value = true;
  629. kzParam.data.HMIStartStop = !data.HMIStartStop;
  630. }
  631. }
  632. function handleOK(passWord, handlerState) {
  633. console.log(kzParam, 'kz----------');
  634. // if (passWord !== '123456') {
  635. // message.warning('密码不正确,请重新输入');
  636. // return;
  637. // }
  638. let data = {};
  639. if (kzParam.isFw) {
  640. data = {
  641. deviceid: kzParam.data.id,
  642. devicetype: kzParam.data.deviceType,
  643. password: passWord,
  644. HMIReset: kzParam.data.HMIReset,
  645. };
  646. } else {
  647. data = {
  648. deviceid: kzParam.data.id,
  649. password: passWord,
  650. devicetype: kzParam.data.deviceType,
  651. HMIStartStop: kzParam.data.HMIStartStop,
  652. };
  653. }
  654. deviceControlApi(data).then((res) => {
  655. // 模拟时开启
  656. if (res.success) {
  657. modalIsShow.value = false;
  658. getDataSource(props.deviceId);
  659. if (globalConfig.History_Type == 'remote') {
  660. message.success('指令已下发至生产管控平台成功!');
  661. } else {
  662. message.success('指令已下发成功!');
  663. }
  664. }
  665. });
  666. }
  667. function handleCancel() {
  668. modalIsShow.value = false;
  669. modalTitle.value = '';
  670. modalType.value = '';
  671. }
  672. watch([monitorDataGroupNum, loading], ([newMonitorDataGroupNum, newLoading]) => {
  673. nextTick(() => {
  674. if (newMonitorDataGroupNum && !newLoading) {
  675. setModelType(props.modalType, newMonitorDataGroupNum);
  676. }
  677. });
  678. });
  679. onMounted(async () => {
  680. await getMonitor(true);
  681. await mountedThree().then(() => {
  682. loading.value = false;
  683. });
  684. await getCamera(props.deviceId, playerRef.value);
  685. });
  686. onUnmounted(() => {
  687. destroy();
  688. if (timer) {
  689. clearTimeout(timer);
  690. timer = undefined;
  691. }
  692. removeCamera();
  693. });
  694. </script>
  695. <style lang="less" scoped>
  696. @import '/@/design/theme.less';
  697. @ventSpace: zxm;
  698. .nitrogen-box {
  699. width: 100%;
  700. height: 100%;
  701. display: flex;
  702. justify-content: center;
  703. }
  704. #nitrogenCss3D {
  705. .modal-monitor {
  706. width: 200px;
  707. position: absolute;
  708. left: 0px;
  709. top: 0px;
  710. }
  711. &:deep(.win) {
  712. margin: 0 !important;
  713. background: #00000044;
  714. }
  715. }
  716. .nitrogen-home {
  717. width: 100%;
  718. height: 100%;
  719. position: fixed;
  720. z-index: 9999;
  721. display: flex;
  722. flex-direction: column;
  723. justify-content: center;
  724. align-items: center;
  725. pointer-events: none;
  726. top: 20px;
  727. .nitrogen-container {
  728. width: 100%;
  729. height: calc(100% - 100px);
  730. display: flex;
  731. justify-content: space-between;
  732. margin-bottom: 100px;
  733. position: relative;
  734. .device-state {
  735. width: 100%;
  736. position: absolute;
  737. top: 20px;
  738. color: #e90000;
  739. display: flex;
  740. justify-content: center;
  741. font-size: 20px;
  742. }
  743. .top-box {
  744. width: 100%;
  745. padding: 10px;
  746. overflow: hidden;
  747. display: flex;
  748. justify-content: space-between;
  749. // margin-top: 40px;
  750. .center-item-box {
  751. position: absolute;
  752. left: 50%;
  753. top: 50px;
  754. transform: translate(-48%, 0);
  755. width: calc(100% - 720px);
  756. height: 50px;
  757. display: flex;
  758. align-items: center;
  759. pointer-events: auto;
  760. .top-left {
  761. display: flex;
  762. flex: 1.5;
  763. color: #fff;
  764. .button-box {
  765. position: relative;
  766. width: auto;
  767. height: 32px;
  768. display: flex;
  769. align-items: center;
  770. justify-content: center;
  771. border-radius: 5px;
  772. color: #fff;
  773. padding: 10px 15px;
  774. margin: 0px 10px;
  775. box-sizing: border-box;
  776. cursor: pointer;
  777. background: linear-gradient(#1fa6cb, #127cb5);
  778. &:hover {
  779. background: linear-gradient(#1fa6cbcc, #127cb5cc);
  780. }
  781. }
  782. }
  783. .top-center {
  784. display: flex;
  785. flex: 1;
  786. justify-content: center;
  787. align-items: center;
  788. font-size: 20px;
  789. color: #fff;
  790. .top-c-label {
  791. color: yellow;
  792. }
  793. }
  794. .top-right {
  795. display: flex;
  796. flex: 2;
  797. justify-content: right;
  798. align-items: center;
  799. color: #fff;
  800. .control-type {
  801. display: flex;
  802. color: #fff;
  803. .control-title {
  804. color: #73e8fe;
  805. }
  806. }
  807. }
  808. }
  809. .lr-box {
  810. height: 100%;
  811. display: flex;
  812. flex-direction: column;
  813. position: relative;
  814. // overflow: hidden;
  815. z-index: 9999;
  816. pointer-events: auto;
  817. overflow-y: auto;
  818. overflow-x: hidden;
  819. .input-item {
  820. display: flex;
  821. justify-content: space-between;
  822. align-items: center;
  823. padding: 4px 8px;
  824. margin: 6px 0;
  825. background-image: linear-gradient(to right, #39deff15, #3977e500);
  826. .title {
  827. width: 200px;
  828. }
  829. .title-auto {
  830. width: auto;
  831. }
  832. .input-value {
  833. width: 80px;
  834. height: 28px;
  835. line-height: 28px !important;
  836. background: transparent !important;
  837. border-color: #228da2 !important;
  838. color: #fff !important;
  839. }
  840. .value {
  841. width: 100px;
  842. color: #00d8ff;
  843. padding-right: 20px;
  844. }
  845. .unit {
  846. width: 80px;
  847. text-align: right;
  848. }
  849. }
  850. }
  851. .item {
  852. width: 305px;
  853. height: auto;
  854. position: relative;
  855. border-radius: 5px;
  856. margin-top: 10px;
  857. margin-bottom: 0px;
  858. pointer-events: auto;
  859. color: #fff;
  860. // overflow: hidden;
  861. &:first-child {
  862. margin-top: 0px;
  863. }
  864. .base-title {
  865. color: #fff;
  866. margin-bottom: 8px;
  867. padding-left: 10px;
  868. position: relative;
  869. font-size: 16px;
  870. &::after {
  871. content: '';
  872. position: absolute;
  873. display: block;
  874. width: 4px;
  875. height: 12px;
  876. top: 7px;
  877. left: 0px;
  878. background: #45d3fd;
  879. border-radius: 4px;
  880. }
  881. }
  882. .monitor-item {
  883. width: 100%;
  884. display: flex;
  885. flex-direction: row;
  886. flex-wrap: wrap;
  887. .state-item {
  888. width: 50%;
  889. padding: 5px;
  890. display: flex;
  891. align-items: center;
  892. justify-content: space-between;
  893. .state-title {
  894. width: 100px;
  895. color: #ffffffdd;
  896. flex: 9;
  897. font-size: 14px;
  898. .unit {
  899. // color: #ffffffbb;
  900. }
  901. .value {
  902. color: #00d8ff;
  903. }
  904. }
  905. .state-val {
  906. flex: 1;
  907. color: #e4a300;
  908. margin-right: 5px;
  909. text-align: right;
  910. font-size: 14px;
  911. }
  912. }
  913. }
  914. .signal-box {
  915. margin: 5px 0;
  916. display: flex;
  917. align-items: center;
  918. .signal-title {
  919. color: #7af5ff;
  920. margin: 0 5px;
  921. }
  922. &:last-child {
  923. margin-right: 0px;
  924. }
  925. }
  926. .list-item {
  927. padding: 0 10px;
  928. display: flex;
  929. justify-content: space-between;
  930. align-items: center;
  931. .item-data-key {
  932. color: #ffffff99;
  933. }
  934. }
  935. .item-data-box {
  936. color: #fff;
  937. .state-icon {
  938. display: inline-block;
  939. width: 12px;
  940. height: 12px;
  941. border-radius: 12px;
  942. }
  943. .open {
  944. border: 5px solid #133a56;
  945. background: #4ecb73;
  946. }
  947. .close {
  948. border: 5px solid #192961;
  949. background: #6d7898;
  950. }
  951. }
  952. }
  953. .item-l {
  954. width: 100%;
  955. .monitor-box {
  956. width: 100%;
  957. .parameter-title {
  958. position: relative;
  959. width: 100%;
  960. height: 14px;
  961. margin-top: 10px;
  962. .icon,
  963. span {
  964. position: absolute;
  965. top: -10px;
  966. }
  967. }
  968. .group-parameter-title {
  969. background-image: linear-gradient(to right, #39a3ff50, #39a3ff00);
  970. .icon {
  971. left: -12px;
  972. top: -17px;
  973. }
  974. span {
  975. left: 18px;
  976. }
  977. .item-col {
  978. background-image: linear-gradient(to right, #39a3ff00, #39a3ff10);
  979. }
  980. }
  981. .device-parameter-title {
  982. background-image: linear-gradient(to right, #3df6ff40, #3df6ff00);
  983. .icon {
  984. left: -10px;
  985. top: -14px;
  986. }
  987. span {
  988. left: 18px;
  989. }
  990. .item-col {
  991. background-image: linear-gradient(to right, #3df6ff10, #3df6ff00);
  992. }
  993. }
  994. .monitor-item {
  995. .value {
  996. color: #00d8ff;
  997. }
  998. }
  999. }
  1000. }
  1001. .right-box {
  1002. width: 300px;
  1003. margin-top: 50px;
  1004. }
  1005. .left-box {
  1006. width: 335px;
  1007. margin-top: 80px;
  1008. }
  1009. }
  1010. &:deep(.win) {
  1011. width: 100%;
  1012. margin: 0 !important;
  1013. }
  1014. }
  1015. .player-box {
  1016. position: absolute;
  1017. height: auto;
  1018. // width: 100%;
  1019. right: 0px;
  1020. bottom: 110px;
  1021. z-index: 99999;
  1022. display: flex;
  1023. #LivePlayerBox {
  1024. width: auto !important;
  1025. }
  1026. }
  1027. }
  1028. &:deep(.main) {
  1029. .title {
  1030. height: 34px;
  1031. text-align: center;
  1032. font-weight: 600;
  1033. color: #7af5ff;
  1034. // background-image: url('../../../assets/img/yfj/light.png');
  1035. background-repeat: no-repeat;
  1036. background-position-x: center;
  1037. background-position-y: 100%;
  1038. background-size: 80%;
  1039. font-size: 16px;
  1040. }
  1041. .monitor-item {
  1042. width: 200px;
  1043. display: flex;
  1044. flex-direction: row;
  1045. width: auto;
  1046. margin-bottom: 3px;
  1047. .monitor-val {
  1048. color: #ffb700;
  1049. display: flex;
  1050. width: auto;
  1051. .val {
  1052. width: 80px;
  1053. font-size: 14px;
  1054. }
  1055. .unit {
  1056. color: #ffffffbb;
  1057. font-size: 14px;
  1058. }
  1059. }
  1060. }
  1061. .monitor-title {
  1062. width: 100px;
  1063. color: #7af5ff;
  1064. font-weight: 400;
  1065. font-size: 14px;
  1066. }
  1067. .signal-item {
  1068. display: flex;
  1069. justify-content: space-between;
  1070. // margin-bottom: 5px;
  1071. .signal-round {
  1072. display: inline-block;
  1073. width: 8px;
  1074. height: 8px;
  1075. border-radius: 50%;
  1076. margin: 0 10px;
  1077. position: relative;
  1078. &::after {
  1079. display: block;
  1080. content: '';
  1081. position: absolute;
  1082. width: 12px;
  1083. height: 12px;
  1084. top: -2px;
  1085. left: -2px;
  1086. border-radius: 50%;
  1087. }
  1088. }
  1089. .signal-round-gry {
  1090. background-color: #858585;
  1091. &::after {
  1092. background-color: #85858544;
  1093. box-shadow: 0 0 1px 1px #85858599;
  1094. }
  1095. }
  1096. .signal-round-run {
  1097. background-color: #67fc00;
  1098. &::after {
  1099. background-color: #67fc0044;
  1100. box-shadow: 0 0 1px 1px #c6ff77;
  1101. }
  1102. }
  1103. .signal-round-warning {
  1104. background-color: #e9170b;
  1105. &::after {
  1106. background-color: #e9170b44;
  1107. box-shadow: 0 0 1px 1px #e9170b;
  1108. }
  1109. }
  1110. }
  1111. }
  1112. :deep(.zxm-radio-wrapper) {
  1113. color: #fff !important;
  1114. }
  1115. </style>