nitrogenHome_dltj.vue 39 KB

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