nitrogenHome_dltj.vue 37 KB

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