1
0

nitrogenHome_dltj.vue 38 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. 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. } else {
  574. airCompressor[`InputFlux`] = Number(monitorData.value['InputFlux1']) + Number(monitorData.value['InputFlux2']) || null;
  575. if (!airCompressor[`InputFlux`]) airCompressor[`InputFlux`] = monitorData.value['InputFlux'];
  576. monitorData.value['RunTime31'] = (Number(monitorData.value['RunTime31']) / 24).toFixed(0);
  577. monitorData.value['RunTime41'] = (Number(monitorData.value['RunTime41']) / 24).toFixed(0);
  578. monitorData.value['RunTime32'] = (Number(monitorData.value['RunTime32']) / 24).toFixed(0);
  579. monitorData.value['RunTime42'] = (Number(monitorData.value['RunTime42']) / 24).toFixed(0);
  580. monitorData.value['FluxTotal'] = airCompressor[`InputFlux`];
  581. }
  582. //图表数据
  583. if (dataArr.length <= 5) {
  584. dataArr.push(airCompressor);
  585. } else {
  586. dataArr.shift();
  587. dataArr.push(airCompressor);
  588. }
  589. echartData.value = dataArr;
  590. refresh.value = true;
  591. nextTick(() => {
  592. refresh.value = false;
  593. });
  594. }
  595. }
  596. function handlerDevice(data, bol) {
  597. kzParam.data = data;
  598. kzParam.isFw = bol;
  599. if (bol) {
  600. modalTitle.value = '一键复位';
  601. modalType.value = '1';
  602. modalIsShow.value = true;
  603. kzParam.data.HMIReset = !data.HMIReset;
  604. } else {
  605. modalTitle.value = '一键启停';
  606. modalType.value = '2';
  607. modalIsShow.value = true;
  608. kzParam.data.HMIStartStop = !data.HMIStartStop;
  609. }
  610. }
  611. function handleOK(passWord, handlerState) {
  612. console.log(kzParam, 'kz----------');
  613. // if (passWord !== '123456') {
  614. // message.warning('密码不正确,请重新输入');
  615. // return;
  616. // }
  617. let data = {};
  618. if (kzParam.isFw) {
  619. data = {
  620. deviceid: kzParam.data.id,
  621. devicetype: kzParam.data.deviceType,
  622. password: passWord,
  623. HMIReset: kzParam.data.HMIReset,
  624. };
  625. } else {
  626. data = {
  627. deviceid: kzParam.data.id,
  628. password: passWord,
  629. devicetype: kzParam.data.deviceType,
  630. HMIStartStop: kzParam.data.HMIStartStop,
  631. };
  632. }
  633. deviceControlApi(data).then((res) => {
  634. // 模拟时开启
  635. if (res.success) {
  636. modalIsShow.value = false;
  637. getDataSource(props.deviceId);
  638. if (globalConfig.History_Type == 'remote') {
  639. message.success('指令已下发至生产管控平台成功!');
  640. } else {
  641. message.success('指令已下发成功!');
  642. }
  643. }
  644. });
  645. }
  646. function handleCancel() {
  647. modalIsShow.value = false;
  648. modalTitle.value = '';
  649. modalType.value = '';
  650. }
  651. watch([monitorDataGroupNum, loading], ([newMonitorDataGroupNum, newLoading]) => {
  652. nextTick(() => {
  653. if (newMonitorDataGroupNum && !newLoading) {
  654. setModelType(props.modalType, newMonitorDataGroupNum);
  655. }
  656. });
  657. });
  658. // 多套系统,不同点表
  659. watch(
  660. () => unref(deviceType),
  661. async (type: string) => {
  662. if (type == 'nitrogen_52507') {
  663. const { preMonitorList, preFanMonitorData, nitrogenMonitorData } = await import('../nitrogen.data.dlt1');
  664. preMonitorListData.value = preMonitorList;
  665. preFanMonitor.value = preFanMonitorData;
  666. nitrogenMonitor.value = nitrogenMonitorData;
  667. } else {
  668. const { preMonitorList, preFanMonitorData, nitrogenMonitorData } = await import('../nitrogen.data.dltj');
  669. preMonitorListData.value = preMonitorList;
  670. preFanMonitor.value = preFanMonitorData;
  671. nitrogenMonitor.value = nitrogenMonitorData;
  672. }
  673. },
  674. { immediate: true }
  675. );
  676. onMounted(async () => {
  677. await getMonitor(true);
  678. await mountedThree().then(() => {
  679. loading.value = false;
  680. });
  681. await getCamera(props.deviceId, playerRef.value);
  682. });
  683. onUnmounted(() => {
  684. destroy();
  685. if (timer) {
  686. clearTimeout(timer);
  687. timer = undefined;
  688. }
  689. removeCamera();
  690. });
  691. </script>
  692. <style lang="less" scoped>
  693. @ventSpace: zxm;
  694. .nitrogen-box {
  695. width: 100%;
  696. height: 100%;
  697. display: flex;
  698. justify-content: center;
  699. }
  700. #nitrogenCss3D {
  701. .modal-monitor {
  702. width: 200px;
  703. position: absolute;
  704. left: 0px;
  705. top: 0px;
  706. }
  707. &:deep(.win) {
  708. margin: 0 !important;
  709. background: #00000044;
  710. }
  711. }
  712. .nitrogen-home {
  713. width: 100%;
  714. height: 100%;
  715. position: fixed;
  716. z-index: 9999;
  717. display: flex;
  718. flex-direction: column;
  719. justify-content: center;
  720. align-items: center;
  721. pointer-events: none;
  722. top: 20px;
  723. .nitrogen-container {
  724. width: 100%;
  725. height: calc(100% - 100px);
  726. display: flex;
  727. justify-content: space-between;
  728. margin-bottom: 100px;
  729. position: relative;
  730. .device-state {
  731. width: 100%;
  732. position: absolute;
  733. top: 20px;
  734. color: #e90000;
  735. display: flex;
  736. justify-content: center;
  737. font-size: 20px;
  738. }
  739. .top-box {
  740. width: 100%;
  741. padding: 10px;
  742. overflow: hidden;
  743. display: flex;
  744. justify-content: space-between;
  745. // margin-top: 40px;
  746. .center-item-box {
  747. position: absolute;
  748. left: 50%;
  749. top: 50px;
  750. transform: translate(-48%, 0);
  751. width: calc(100% - 720px);
  752. height: 50px;
  753. display: flex;
  754. align-items: center;
  755. pointer-events: auto;
  756. .top-left {
  757. display: flex;
  758. flex: 1.5;
  759. color: #fff;
  760. .button-box {
  761. position: relative;
  762. width: auto;
  763. height: 32px;
  764. display: flex;
  765. align-items: center;
  766. justify-content: center;
  767. border-radius: 5px;
  768. color: #fff;
  769. padding: 10px 15px;
  770. margin: 0px 10px;
  771. box-sizing: border-box;
  772. cursor: pointer;
  773. background: linear-gradient(#1fa6cb, #127cb5);
  774. &:hover {
  775. background: linear-gradient(#1fa6cbcc, #127cb5cc);
  776. }
  777. }
  778. }
  779. .top-center {
  780. display: flex;
  781. flex: 1;
  782. justify-content: center;
  783. align-items: center;
  784. font-size: 20px;
  785. color: #fff;
  786. .top-c-label {
  787. color: yellow;
  788. }
  789. }
  790. .top-right {
  791. display: flex;
  792. flex: 2;
  793. justify-content: right;
  794. align-items: center;
  795. color: #fff;
  796. .control-type {
  797. display: flex;
  798. color: #fff;
  799. .control-title {
  800. color: #73e8fe;
  801. }
  802. }
  803. }
  804. }
  805. .lr-box {
  806. height: 100%;
  807. display: flex;
  808. flex-direction: column;
  809. position: relative;
  810. // overflow: hidden;
  811. z-index: 9999;
  812. pointer-events: auto;
  813. overflow-y: auto;
  814. overflow-x: hidden;
  815. .input-item {
  816. display: flex;
  817. justify-content: space-between;
  818. align-items: center;
  819. padding: 4px 8px;
  820. margin: 6px 0;
  821. background-image: linear-gradient(to right, #39deff15, #3977e500);
  822. .title {
  823. width: 200px;
  824. }
  825. .title-auto {
  826. width: auto;
  827. }
  828. .input-value {
  829. width: 80px;
  830. height: 28px;
  831. line-height: 28px !important;
  832. background: transparent !important;
  833. border-color: #228da2 !important;
  834. color: #fff !important;
  835. }
  836. .value {
  837. width: 100px;
  838. color: #00d8ff;
  839. padding-right: 20px;
  840. }
  841. .unit {
  842. width: 80px;
  843. text-align: right;
  844. }
  845. }
  846. }
  847. .item {
  848. width: 305px;
  849. height: auto;
  850. position: relative;
  851. border-radius: 5px;
  852. margin-top: 10px;
  853. margin-bottom: 0px;
  854. pointer-events: auto;
  855. color: #fff;
  856. // overflow: hidden;
  857. &:first-child {
  858. margin-top: 0px;
  859. }
  860. .base-title {
  861. color: #fff;
  862. margin-bottom: 8px;
  863. padding-left: 10px;
  864. position: relative;
  865. font-size: 16px;
  866. &::after {
  867. content: '';
  868. position: absolute;
  869. display: block;
  870. width: 4px;
  871. height: 12px;
  872. top: 7px;
  873. left: 0px;
  874. background: #45d3fd;
  875. border-radius: 4px;
  876. }
  877. }
  878. .monitor-item {
  879. width: 100%;
  880. display: flex;
  881. flex-direction: row;
  882. flex-wrap: wrap;
  883. .state-item {
  884. width: 50%;
  885. padding: 5px;
  886. display: flex;
  887. align-items: center;
  888. justify-content: space-between;
  889. .state-title {
  890. width: 100px;
  891. color: #ffffffdd;
  892. flex: 9;
  893. font-size: 14px;
  894. .unit {
  895. // color: #ffffffbb;
  896. }
  897. .value {
  898. color: #00d8ff;
  899. }
  900. }
  901. .state-val {
  902. flex: 1;
  903. color: #e4a300;
  904. margin-right: 5px;
  905. text-align: right;
  906. font-size: 14px;
  907. }
  908. }
  909. }
  910. .signal-box {
  911. margin: 5px 0;
  912. display: flex;
  913. align-items: center;
  914. .signal-title {
  915. color: #7af5ff;
  916. margin: 0 5px;
  917. }
  918. &:last-child {
  919. margin-right: 0px;
  920. }
  921. }
  922. .list-item {
  923. padding: 0 10px;
  924. display: flex;
  925. justify-content: space-between;
  926. align-items: center;
  927. .item-data-key {
  928. color: #ffffff99;
  929. }
  930. }
  931. .item-data-box {
  932. color: #fff;
  933. .state-icon {
  934. display: inline-block;
  935. width: 12px;
  936. height: 12px;
  937. border-radius: 12px;
  938. }
  939. .open {
  940. border: 5px solid #133a56;
  941. background: #4ecb73;
  942. }
  943. .close {
  944. border: 5px solid #192961;
  945. background: #6d7898;
  946. }
  947. }
  948. }
  949. .item-l {
  950. width: 100%;
  951. .monitor-box {
  952. width: 100%;
  953. .parameter-title {
  954. position: relative;
  955. width: 100%;
  956. height: 14px;
  957. margin-top: 10px;
  958. .icon,
  959. span {
  960. position: absolute;
  961. top: -10px;
  962. }
  963. }
  964. .group-parameter-title {
  965. background-image: linear-gradient(to right, #39a3ff50, #39a3ff00);
  966. .icon {
  967. left: -12px;
  968. top: -17px;
  969. }
  970. span {
  971. left: 18px;
  972. }
  973. .item-col {
  974. background-image: linear-gradient(to right, #39a3ff00, #39a3ff10);
  975. }
  976. }
  977. .device-parameter-title {
  978. background-image: linear-gradient(to right, #3df6ff40, #3df6ff00);
  979. .icon {
  980. left: -10px;
  981. top: -14px;
  982. }
  983. span {
  984. left: 18px;
  985. }
  986. .item-col {
  987. background-image: linear-gradient(to right, #3df6ff10, #3df6ff00);
  988. }
  989. }
  990. .monitor-item {
  991. .value {
  992. color: #00d8ff;
  993. }
  994. }
  995. }
  996. }
  997. .right-box {
  998. width: 300px;
  999. margin-top: 50px;
  1000. }
  1001. .left-box {
  1002. width: 335px;
  1003. margin-top: 80px;
  1004. }
  1005. }
  1006. &:deep(.win) {
  1007. width: 100%;
  1008. margin: 0 !important;
  1009. }
  1010. }
  1011. .player-box {
  1012. position: absolute;
  1013. height: auto;
  1014. // width: 100%;
  1015. right: 0px;
  1016. bottom: 110px;
  1017. z-index: 99999;
  1018. display: flex;
  1019. #LivePlayerBox {
  1020. width: auto !important;
  1021. }
  1022. }
  1023. }
  1024. &:deep(.main) {
  1025. .title {
  1026. height: 34px;
  1027. text-align: center;
  1028. font-weight: 600;
  1029. color: #7af5ff;
  1030. // background-image: url('../../../assets/img/yfj/light.png');
  1031. background-repeat: no-repeat;
  1032. background-position-x: center;
  1033. background-position-y: 100%;
  1034. background-size: 80%;
  1035. font-size: 16px;
  1036. }
  1037. .monitor-item {
  1038. width: 200px;
  1039. display: flex;
  1040. flex-direction: row;
  1041. width: auto;
  1042. margin-bottom: 3px;
  1043. .monitor-val {
  1044. color: #ffb700;
  1045. display: flex;
  1046. width: auto;
  1047. .val {
  1048. width: 80px;
  1049. font-size: 14px;
  1050. }
  1051. .unit {
  1052. color: #ffffffbb;
  1053. font-size: 14px;
  1054. }
  1055. }
  1056. }
  1057. .monitor-title {
  1058. width: 100px;
  1059. color: #7af5ff;
  1060. font-weight: 400;
  1061. font-size: 14px;
  1062. }
  1063. .signal-item {
  1064. display: flex;
  1065. justify-content: space-between;
  1066. // margin-bottom: 5px;
  1067. .signal-round {
  1068. display: inline-block;
  1069. width: 8px;
  1070. height: 8px;
  1071. border-radius: 50%;
  1072. margin: 0 10px;
  1073. position: relative;
  1074. &::after {
  1075. display: block;
  1076. content: '';
  1077. position: absolute;
  1078. width: 12px;
  1079. height: 12px;
  1080. top: -2px;
  1081. left: -2px;
  1082. border-radius: 50%;
  1083. }
  1084. }
  1085. .signal-round-gry {
  1086. background-color: #858585;
  1087. &::after {
  1088. background-color: #85858544;
  1089. box-shadow: 0 0 1px 1px #85858599;
  1090. }
  1091. }
  1092. .signal-round-run {
  1093. background-color: #67fc00;
  1094. &::after {
  1095. background-color: #67fc0044;
  1096. box-shadow: 0 0 1px 1px #c6ff77;
  1097. }
  1098. }
  1099. .signal-round-warning {
  1100. background-color: #e9170b;
  1101. &::after {
  1102. background-color: #e9170b44;
  1103. box-shadow: 0 0 1px 1px #e9170b;
  1104. }
  1105. }
  1106. }
  1107. }
  1108. :deep(.zxm-radio-wrapper) {
  1109. color: #fff !important;
  1110. }
  1111. </style>