nitrogenHome_dltj.vue 38 KB

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