nitrogenHome_dltj.vue 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245
  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. airCompressor[`InputFlux`] = Number(monitorData.value['InputFlux1'] || 0) + Number(monitorData.value['InputFlux2'] || 0);
  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. echartData.value = [];
  696. },
  697. { immediate: true }
  698. );
  699. watch(
  700. () => props.deviceId,
  701. async (deviceId) => {
  702. if (deviceId) await getCamera(deviceId, playerRef.value);
  703. }
  704. );
  705. onMounted(async () => {
  706. await getMonitor(true);
  707. await mountedThree().then(() => {
  708. loading.value = false;
  709. });
  710. // await getCamera(props.deviceId, playerRef.value);
  711. });
  712. onUnmounted(() => {
  713. destroy();
  714. if (timer) {
  715. clearTimeout(timer);
  716. timer = undefined;
  717. }
  718. removeCamera();
  719. });
  720. </script>
  721. <style lang="less" scoped>
  722. @import '/@/design/theme.less';
  723. @ventSpace: zxm;
  724. .nitrogen-box {
  725. width: 100%;
  726. height: 100%;
  727. display: flex;
  728. justify-content: center;
  729. }
  730. #nitrogenCss3D {
  731. .modal-monitor {
  732. width: 200px;
  733. position: absolute;
  734. left: 0px;
  735. top: 0px;
  736. }
  737. &:deep(.win) {
  738. margin: 0 !important;
  739. background: #00000044;
  740. }
  741. }
  742. .nitrogen-home {
  743. width: 100%;
  744. height: 100%;
  745. position: fixed;
  746. z-index: 9999;
  747. display: flex;
  748. flex-direction: column;
  749. justify-content: center;
  750. align-items: center;
  751. pointer-events: none;
  752. top: 20px;
  753. .nitrogen-container {
  754. width: 100%;
  755. height: calc(100% - 100px);
  756. display: flex;
  757. justify-content: space-between;
  758. margin-bottom: 100px;
  759. position: relative;
  760. .device-state {
  761. width: 100%;
  762. position: absolute;
  763. top: 20px;
  764. color: #e90000;
  765. display: flex;
  766. justify-content: center;
  767. font-size: 20px;
  768. }
  769. .top-box {
  770. width: 100%;
  771. padding: 10px;
  772. overflow: hidden;
  773. display: flex;
  774. justify-content: space-between;
  775. // margin-top: 40px;
  776. .center-item-box {
  777. position: absolute;
  778. left: 50%;
  779. top: 50px;
  780. transform: translate(-48%, 0);
  781. width: calc(100% - 720px);
  782. height: 50px;
  783. display: flex;
  784. align-items: center;
  785. pointer-events: auto;
  786. .top-left {
  787. display: flex;
  788. flex: 1.5;
  789. color: #fff;
  790. .button-box {
  791. position: relative;
  792. width: auto;
  793. height: 32px;
  794. display: flex;
  795. align-items: center;
  796. justify-content: center;
  797. border-radius: 5px;
  798. color: #fff;
  799. padding: 10px 15px;
  800. margin: 0px 10px;
  801. box-sizing: border-box;
  802. cursor: pointer;
  803. background: linear-gradient(#1fa6cb, #127cb5);
  804. &:hover {
  805. background: linear-gradient(#1fa6cbcc, #127cb5cc);
  806. }
  807. }
  808. }
  809. .top-center {
  810. display: flex;
  811. flex: 1;
  812. justify-content: center;
  813. align-items: center;
  814. font-size: 20px;
  815. color: #fff;
  816. .top-c-label {
  817. color: yellow;
  818. }
  819. }
  820. .top-right {
  821. display: flex;
  822. flex: 2;
  823. justify-content: right;
  824. align-items: center;
  825. color: #fff;
  826. .control-type {
  827. display: flex;
  828. color: #fff;
  829. .control-title {
  830. color: #73e8fe;
  831. }
  832. }
  833. }
  834. }
  835. .lr-box {
  836. height: 100%;
  837. display: flex;
  838. flex-direction: column;
  839. position: relative;
  840. // overflow: hidden;
  841. z-index: 9999;
  842. pointer-events: auto;
  843. overflow-y: auto;
  844. overflow-x: hidden;
  845. .input-item {
  846. display: flex;
  847. justify-content: space-between;
  848. align-items: center;
  849. padding: 4px 8px;
  850. margin: 6px 0;
  851. background-image: linear-gradient(to right, #39deff15, #3977e500);
  852. .title {
  853. width: 200px;
  854. }
  855. .title-auto {
  856. width: auto;
  857. }
  858. .input-value {
  859. width: 80px;
  860. height: 28px;
  861. line-height: 28px !important;
  862. background: transparent !important;
  863. border-color: #228da2 !important;
  864. color: #fff !important;
  865. }
  866. .value {
  867. width: 100px;
  868. color: #00d8ff;
  869. padding-right: 20px;
  870. }
  871. .unit {
  872. width: 80px;
  873. text-align: right;
  874. }
  875. }
  876. }
  877. .item {
  878. width: 305px;
  879. height: auto;
  880. position: relative;
  881. border-radius: 5px;
  882. margin-top: 10px;
  883. margin-bottom: 0px;
  884. pointer-events: auto;
  885. color: #fff;
  886. // overflow: hidden;
  887. &:first-child {
  888. margin-top: 0px;
  889. }
  890. .base-title {
  891. color: #fff;
  892. margin-bottom: 8px;
  893. padding-left: 10px;
  894. position: relative;
  895. font-size: 16px;
  896. &::after {
  897. content: '';
  898. position: absolute;
  899. display: block;
  900. width: 4px;
  901. height: 12px;
  902. top: 7px;
  903. left: 0px;
  904. background: #45d3fd;
  905. border-radius: 4px;
  906. }
  907. }
  908. .monitor-item {
  909. width: 100%;
  910. display: flex;
  911. flex-direction: row;
  912. flex-wrap: wrap;
  913. .state-item {
  914. width: 50%;
  915. padding: 5px;
  916. display: flex;
  917. align-items: center;
  918. justify-content: space-between;
  919. .state-title {
  920. width: 100px;
  921. color: #ffffffdd;
  922. flex: 9;
  923. font-size: 14px;
  924. .unit {
  925. // color: #ffffffbb;
  926. }
  927. .value {
  928. color: #00d8ff;
  929. }
  930. }
  931. .state-val {
  932. flex: 1;
  933. color: #e4a300;
  934. margin-right: 5px;
  935. text-align: right;
  936. font-size: 14px;
  937. }
  938. }
  939. }
  940. .signal-box {
  941. margin: 5px 0;
  942. display: flex;
  943. align-items: center;
  944. .signal-title {
  945. color: #7af5ff;
  946. margin: 0 5px;
  947. }
  948. &:last-child {
  949. margin-right: 0px;
  950. }
  951. }
  952. .list-item {
  953. padding: 0 10px;
  954. display: flex;
  955. justify-content: space-between;
  956. align-items: center;
  957. .item-data-key {
  958. color: #ffffff99;
  959. }
  960. }
  961. .item-data-box {
  962. color: #fff;
  963. .state-icon {
  964. display: inline-block;
  965. width: 12px;
  966. height: 12px;
  967. border-radius: 12px;
  968. }
  969. .open {
  970. border: 5px solid #133a56;
  971. background: #4ecb73;
  972. }
  973. .close {
  974. border: 5px solid #192961;
  975. background: #6d7898;
  976. }
  977. }
  978. }
  979. .item-l {
  980. width: 100%;
  981. .monitor-box {
  982. width: 100%;
  983. .parameter-title {
  984. position: relative;
  985. width: 100%;
  986. height: 14px;
  987. margin-top: 10px;
  988. .icon,
  989. span {
  990. position: absolute;
  991. top: -10px;
  992. }
  993. }
  994. .group-parameter-title {
  995. background-image: linear-gradient(to right, #39a3ff50, #39a3ff00);
  996. .icon {
  997. left: -12px;
  998. top: -17px;
  999. }
  1000. span {
  1001. left: 18px;
  1002. }
  1003. .item-col {
  1004. background-image: linear-gradient(to right, #39a3ff00, #39a3ff10);
  1005. }
  1006. }
  1007. .device-parameter-title {
  1008. background-image: linear-gradient(to right, #3df6ff40, #3df6ff00);
  1009. .icon {
  1010. left: -10px;
  1011. top: -14px;
  1012. }
  1013. span {
  1014. left: 18px;
  1015. }
  1016. .item-col {
  1017. background-image: linear-gradient(to right, #3df6ff10, #3df6ff00);
  1018. }
  1019. }
  1020. .monitor-item {
  1021. .value {
  1022. color: #00d8ff;
  1023. }
  1024. }
  1025. }
  1026. }
  1027. .right-box {
  1028. width: 300px;
  1029. margin-top: 50px;
  1030. }
  1031. .left-box {
  1032. width: 335px;
  1033. margin-top: 80px;
  1034. }
  1035. }
  1036. &:deep(.win) {
  1037. width: 100%;
  1038. margin: 0 !important;
  1039. }
  1040. }
  1041. .player-box {
  1042. position: absolute;
  1043. height: auto;
  1044. // width: 100%;
  1045. right: 0px;
  1046. bottom: 110px;
  1047. z-index: 99999;
  1048. display: flex;
  1049. #LivePlayerBox {
  1050. width: auto !important;
  1051. }
  1052. }
  1053. }
  1054. &:deep(.main) {
  1055. .title {
  1056. height: 34px;
  1057. text-align: center;
  1058. font-weight: 600;
  1059. color: #7af5ff;
  1060. // background-image: url('../../../assets/img/yfj/light.png');
  1061. background-repeat: no-repeat;
  1062. background-position-x: center;
  1063. background-position-y: 100%;
  1064. background-size: 80%;
  1065. font-size: 16px;
  1066. }
  1067. .monitor-item {
  1068. width: 200px;
  1069. display: flex;
  1070. flex-direction: row;
  1071. width: auto;
  1072. margin-bottom: 3px;
  1073. .monitor-val {
  1074. color: #ffb700;
  1075. display: flex;
  1076. width: auto;
  1077. .val {
  1078. width: 80px;
  1079. font-size: 14px;
  1080. }
  1081. .unit {
  1082. color: #ffffffbb;
  1083. font-size: 14px;
  1084. }
  1085. }
  1086. }
  1087. .monitor-title {
  1088. width: 100px;
  1089. color: #7af5ff;
  1090. font-weight: 400;
  1091. font-size: 14px;
  1092. }
  1093. .signal-item {
  1094. display: flex;
  1095. justify-content: space-between;
  1096. // margin-bottom: 5px;
  1097. .signal-round {
  1098. display: inline-block;
  1099. width: 8px;
  1100. height: 8px;
  1101. border-radius: 50%;
  1102. margin: 0 10px;
  1103. position: relative;
  1104. &::after {
  1105. display: block;
  1106. content: '';
  1107. position: absolute;
  1108. width: 12px;
  1109. height: 12px;
  1110. top: -2px;
  1111. left: -2px;
  1112. border-radius: 50%;
  1113. }
  1114. }
  1115. .signal-round-gry {
  1116. background-color: #858585;
  1117. &::after {
  1118. background-color: #85858544;
  1119. box-shadow: 0 0 1px 1px #85858599;
  1120. }
  1121. }
  1122. .signal-round-run {
  1123. background-color: #67fc00;
  1124. &::after {
  1125. background-color: #67fc0044;
  1126. box-shadow: 0 0 1px 1px #c6ff77;
  1127. }
  1128. }
  1129. .signal-round-warning {
  1130. background-color: #e9170b;
  1131. &::after {
  1132. background-color: #e9170b44;
  1133. box-shadow: 0 0 1px 1px #e9170b;
  1134. }
  1135. }
  1136. }
  1137. }
  1138. :deep(.zxm-radio-wrapper) {
  1139. color: #fff !important;
  1140. }
  1141. </style>