nitrogenHome_dltj.vue 37 KB

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