nitrogenHome_dltj.vue 37 KB

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