nitrogenHome_dltj.vue 38 KB

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