nitrogenHome_hlg.vue 38 KB

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