gasPumpHomeCC.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759
  1. <template>
  2. <div class="monitor-container">
  3. <div
  4. v-if="deviceType?.startsWith('pump_under') && deviceProperty.modelMonitor.length > 0"
  5. id="FlowSensor"
  6. class="FlowSensor-box"
  7. style="position: absolute; display: none"
  8. >
  9. <!-- <div class="elementContent">
  10. <fourBorderBg>
  11. <div v-for="(item, index) in deviceProperty.modelMonitor" :key="index" class="gas-monitor-row">
  12. <div class="title">{{ item.title }}</div>
  13. <template v-if="item.type !== 'sign' && item.type !== 'warning'">
  14. <div class="value">{{ selectData[item.code] ? selectData[item.code] : '-' }}</div>
  15. </template>
  16. <template v-else>
  17. <div class="value">
  18. <span
  19. :class="{
  20. 'signal-round': true,
  21. 'signal-round-run': item.type === 'sign' && selectData[item.code] == '1',
  22. 'signal-round-gry': selectData[item.code] == '0' || !selectData[item.code],
  23. 'signal-round-warning': item.type === 'warning' && selectData[item.code] == '1',
  24. }"
  25. ></span>
  26. </div>
  27. </template>
  28. </div>
  29. </fourBorderBg>
  30. </div> -->
  31. <div class="elementContent" style="position: absolute; display: none">
  32. <div v-for="(tag, index) in modelMonitorTags" :key="index" :id="tag.domId" class="modal-monitor-box">
  33. <template v-if="selectData[tag.code]">
  34. <div class="title">{{ tag.title }}</div>
  35. <div
  36. v-if="tag.type == 'sign'"
  37. class="signal-round"
  38. :class="{ 'signal-round-gry': selectData[tag.code] != 1, 'signal-round-run': selectData[tag.code] == 1 }"
  39. ></div>
  40. <div v-else class="value">{{ selectData[tag.code] }}</div>
  41. </template>
  42. </div>
  43. </div>
  44. </div>
  45. <div v-if="selectData['netStatus'] == 0" class="device-state">网络断开</div>
  46. <div class="btn-group">
  47. <a-button v-if="deviceProperty.detailCtrl.length > 0" class="btn-item" type="primary" @click="openModal">瓦斯泵控制</a-button>
  48. </div>
  49. <div class="lr left-box">
  50. <div class="left-container">
  51. <div class="monitor-box">
  52. <template v-for="(device, leftIndex) in deviceProperty.leftMonitor" :key="leftIndex">
  53. <ventBox1 :class="{ 'vent-margin-t-10': leftIndex > 0 }">
  54. <template #title>
  55. <div>{{ device.title }}</div>
  56. </template>
  57. <template #container>
  58. <template v-for="(deviceChild, deviceChildIndex) in device.children" :key="deviceChildIndex">
  59. <div v-for="(deviceKey, deviceIndex) in deviceChild.key" :key="deviceIndex">
  60. <div v-if="deviceChild.key.length > 1" class="parameter-title group-parameter-title"
  61. ><SvgIcon class="icon" size="14" name="pulp-title" /><span>{{ deviceChild.childTitle[deviceIndex] }}</span></div
  62. >
  63. <div class="input-box">
  64. <div v-for="(item, index) in deviceChild.list" class="input-item" :key="index">
  65. <div
  66. :class="{
  67. 'w-280px': item.type == 'sign' || item.type == 'warning',
  68. title: item.type !== 'sign' && item.type !== 'warning',
  69. }"
  70. >{{ item.title }}:</div
  71. >
  72. <template v-if="item.type !== 'sign' && item.type !== 'warning'">
  73. <div class="value">{{
  74. selectData && selectData[deviceKey + item.code] ? formatNum(selectData[deviceKey + item.code], 1) : '-'
  75. }}</div>
  76. </template>
  77. <template v-else>
  78. <div class="value">
  79. <span
  80. :class="{
  81. 'signal-round': true,
  82. 'signal-round-run': item.type === 'sign' && selectData[deviceKey + item.code] == '1',
  83. 'signal-round-gry': selectData[deviceKey + item.code] == '0' || !selectData[deviceKey + item.code],
  84. 'signal-round-warning': item.type === 'warning' && selectData[deviceKey + item.code] == '1',
  85. }"
  86. ></span>
  87. </div>
  88. </template>
  89. </div>
  90. </div>
  91. </div>
  92. </template>
  93. </template>
  94. </ventBox1>
  95. </template>
  96. </div>
  97. </div>
  98. </div>
  99. <div class="lr right-box">
  100. <div class="item-box sensor-container">
  101. <ventBox1 class="">
  102. <template #title>
  103. <div>泵站监测详情</div>
  104. </template>
  105. <template #container>
  106. <ListItem
  107. v-for="(item, index) in deviceProperty.modelMonitor"
  108. :key="index"
  109. class="w-100% mb-5px"
  110. :value="selectData[item.code]"
  111. :label="item.title"
  112. label-width="250px"
  113. />
  114. </template>
  115. </ventBox1>
  116. <ventBox1 v-for="(device, rightIndex) in deviceProperty.rightMonitor" :key="rightIndex" class="vent-margin-t-10">
  117. <template #title>
  118. <div>{{ device.title }}</div>
  119. </template>
  120. <template #container>
  121. <div v-if="device.type == 'table'">
  122. <div class="state-header">
  123. <div class="header-item" v-for="(header, index) in device.stateHeader" :key="index">{{ header }}</div>
  124. </div>
  125. <div class="">
  126. <div v-for="(child, index) in device.children" :key="index">
  127. <div class="device-row" v-for="(valveKey, valveIndex) in child.key" :key="valveIndex">
  128. <div class="state">{{ child.childTitle[valveIndex] }} </div>
  129. <div class="state" v-for="(state, i) in device['list']" :key="i">
  130. <span v-if="state['dict']">{{
  131. state['dict'][selectData[valveKey + state.code]] ? state['dict'][selectData[valveKey + state.code]] : '-'
  132. }}</span>
  133. <span
  134. v-else
  135. :class="{
  136. 'signal-round': true,
  137. 'signal-round-run': selectData[selectData[valveKey + state.code]] == '1',
  138. 'signal-round-gry': selectData[selectData[valveKey + state.code]] != '1',
  139. }"
  140. ></span>
  141. </div>
  142. </div>
  143. </div>
  144. </div>
  145. </div>
  146. <div v-else>
  147. <template v-for="(deviceChild, deviceChildIndex) in device.children" :key="deviceChildIndex">
  148. <div v-for="(deviceKey, deviceIndex) in deviceChild.key" :key="deviceIndex">
  149. <div v-if="deviceChild.key.length > 1" class="parameter-title group-parameter-title"
  150. ><SvgIcon class="icon" size="14" name="pulp-title" /><span>{{ deviceChild.childTitle[deviceIndex] }}</span></div
  151. >
  152. <div class="input-box">
  153. <div v-for="(item, index) in deviceChild.list" class="input-item" :key="index">
  154. <div
  155. :class="{ 'w-280px': item.type == 'sign' || item.type == 'warning', title: item.type !== 'sign' && item.type !== 'warning' }"
  156. >{{ item.title }}:</div
  157. >
  158. <template v-if="item.type !== 'sign' && item.type !== 'warning'">
  159. <div class="value">{{
  160. selectData && selectData[deviceKey + item.code] ? formatNum(selectData[deviceKey + item.code], 1) : '-'
  161. }}</div>
  162. </template>
  163. <template v-else>
  164. <div class="value">
  165. <span
  166. :class="{
  167. 'signal-round': true,
  168. 'signal-round-run': item.type === 'sign' && selectData[deviceKey + item.code] == '1',
  169. 'signal-round-gry': selectData[deviceKey + item.code] == '0' || !selectData[deviceKey + item.code],
  170. 'signal-round-warning': item.type === 'warning' && selectData[deviceKey + item.code] == '1',
  171. }"
  172. ></span>
  173. </div>
  174. </template>
  175. </div>
  176. </div>
  177. </div>
  178. </template>
  179. </div>
  180. </template>
  181. </ventBox1>
  182. </div>
  183. </div>
  184. <div ref="playerRef" class="player-box"></div>
  185. </div>
  186. <DetailModal @register="register" :device-type="deviceType" :device-id="deviceId" />
  187. <PasswordModal
  188. :modal-is-show="passwordModalIsShow"
  189. modal-title="密码检验"
  190. :modal-type="handlerType"
  191. @handle-ok="handleOK"
  192. @handle-cancel="handleCancel"
  193. />
  194. </template>
  195. <script setup lang="ts">
  196. import { ref, onMounted, onUnmounted, reactive, defineProps, watch, inject, nextTick, onBeforeUnmount } from 'vue';
  197. import ventBox1 from '/@/components/vent/ventBox1.vue';
  198. import { setModelType } from '../gasPump.threejs';
  199. import { getMonitorData, devicePropertyType, getModelMonitorTags } from '../gasPump.data';
  200. // import { leftMonitor, rightMonitor, modelMonitor, detailCtrl } from '../gasPump.dataCc2_2';
  201. import { list } from '../gasPump.api';
  202. import { SvgIcon } from '/@/components/Icon';
  203. import { formatNum } from '/@/utils/ventutil';
  204. import DetailModal from './DetailModalCC.vue';
  205. import { useModal } from '/@/components/Modal';
  206. import { deviceControlApi } from '/@/api/vent/index';
  207. import PasswordModal from '../../comment/components/PasswordModal.vue';
  208. import { message } from 'ant-design-vue';
  209. import fourBorderBg from '/@/components/vent/fourBorderBg.vue';
  210. import { useCamera } from '/@/hooks/system/useCamera';
  211. import ListItem from '@/views/vent/gas/components/list/listItem.vue';
  212. const globalConfig = inject('globalConfig');
  213. const props = defineProps({
  214. deviceId: {
  215. type: String,
  216. require: true,
  217. },
  218. deviceType: {
  219. type: String,
  220. require: true,
  221. },
  222. });
  223. const [register, { openModal }] = useModal();
  224. const loading = ref(false);
  225. const passwordModalIsShow = ref(false);
  226. const handlerType = ref('');
  227. const playerRef = ref();
  228. const deviceProperty = ref({
  229. leftMonitor: [] as devicePropertyType[],
  230. rightMonitor: [] as devicePropertyType[],
  231. modelMonitor: [] as devicePropertyType[],
  232. detailCtrl: [] as devicePropertyType[],
  233. });
  234. const modelMonitorTags = getModelMonitorTags();
  235. // 监测数据
  236. const selectData = ref({});
  237. const { getCamera, removeCamera } = useCamera();
  238. // https获取监测数据
  239. let timer: null | NodeJS.Timeout = null;
  240. function getMonitor(flag?) {
  241. if (Object.prototype.toString.call(timer) === '[object Null]') {
  242. return new Promise((resolve) => {
  243. timer = setTimeout(
  244. async () => {
  245. if (props.deviceId) {
  246. const data = await getDataSource(props.deviceId);
  247. selectData.value = data;
  248. }
  249. if (timer) {
  250. timer = null;
  251. }
  252. resolve(null);
  253. await getMonitor();
  254. loading.value = false;
  255. },
  256. flag ? 0 : 1000
  257. );
  258. });
  259. }
  260. }
  261. async function getDataSource(systemID) {
  262. const res = await list({ devicetype: props.deviceType, ids: systemID });
  263. // const res = {
  264. // cmd: 'monitordata',
  265. // msgTxt: [
  266. // {
  267. // datalist: [
  268. // {
  269. // msgType: null,
  270. // deviceID: '1773155914577469442',
  271. // strname: '22煤瓦斯泵站',
  272. // strinstallpos: '22煤瓦斯泵站',
  273. // fsectarea: 'null',
  274. // stationname: '22煤瓦斯泵站',
  275. // stationtype: 'redis',
  276. // deviceType: 'pump_under',
  277. // typeName: '地下瓦斯泵站',
  278. // netStatus: 1,
  279. // warnFlag: 0,
  280. // warnLevel: 0,
  281. // warnLevel_str: '正常',
  282. // syswarnLevel: null,
  283. // syswarnLevel_str: null,
  284. // syswarnLevel_des: null,
  285. // warnTime: null,
  286. // readTime: '2025-03-03 15:09:59',
  287. // warnDes: '',
  288. // frontGateOpenCtrl: null,
  289. // rearGateOpenCtrl: null,
  290. // readData: {
  291. // FeedSG101_Ib: '0',
  292. // Starter4_CloseAllow: '0',
  293. // FeedSG101_Ic: '0',
  294. // TemperatureSensor_TemperatureLowAlarm: '0',
  295. // SubmarinePump_MOT_AvgVoltage: '0',
  296. // VSL_LiquidLevelSensor_Level: '0',
  297. // GVL_CloseLimit: '0',
  298. // FeedSG102_Uca: '1242',
  299. // FeedSG102_CBStatus: '1',
  300. // Starter1_SwitchOffOutput: '0',
  301. // FeedSG101_Ia: '0',
  302. // CentrifugalPump2_GVL1_CloseLimit: '1',
  303. // Starter2_RunTimerOpen: '0',
  304. // Starter5_Uab: '0',
  305. // CentrifugalPump1_MOT_PhaseBTemp: '16',
  306. // CentrifugalPump2_GVL1_OpenFail: '0',
  307. // CentrifugalPump1_GVL1_CloseFail: '0',
  308. // CentrifugalPump2_GVL2_OnOutput: '0',
  309. // SubmarinePump2_MOT_Power: '0',
  310. // CentrifugalPump1_MOT_Ic: '0',
  311. // SubmarinePump2_MOT_AvgVoltage: '1121',
  312. // CentrifugalPump2_PU_InterlockReady: '1',
  313. // CentrifugalPump1_MOT_Ib: '0',
  314. // T101_HighVoltSwitch_Temp: '0',
  315. // CentrifugalPump2_PU_Healthy: '1',
  316. // CentrifugalPump1_PU_InterlockStarting: '0',
  317. // SubmarinePump2_PU_Healthy: '1',
  318. // CentrifugalPump1_PU_InterlockStoping: '0',
  319. // SubmarinePump2_MOT_OpenFail: '0',
  320. // CentrifugalPump2_GVL2_CloseFail: '0',
  321. // T101_LowVoltSwith_Current: '0',
  322. // CentrifugalPump2_GVL2_CtrlMode: '0',
  323. // Starter2_RunTimerClose: '0',
  324. // CentrifugalPump1_MOT_OpenFail: '0',
  325. // CentrifugalPump2_MOT_OpenFail: '0',
  326. // Starter2_SwitchOnOutput: '0',
  327. // SubmarinePump1_PU_Healthy: '1',
  328. // CentrifugalPump2_GVL2_CloseLimit: '1',
  329. // CentrifugalPump2_MOT_BackAxleOverTempAlarm: '1',
  330. // GVL_CloseFail: '0',
  331. // CentrifugalPump2_MOT_PhaseBTempAlarm: '0',
  332. // CentrifugalPump2_MOT_PhaseBTemp: '16',
  333. // CentrifugalPump2_GVL1_CloseFail: '0',
  334. // T102_CBStatus: '1',
  335. // SubmarinePump_MOT_OpenFail: '0',
  336. // FeedSG101_CBStatus: '0',
  337. // CentrifugalPump1_MOT_PhaseBTempAlarm: '0',
  338. // FanPre: '-5.0',
  339. // CentrifugalPump2_GVL2_OffOutput: '0',
  340. // Starter5_PLCState: '1',
  341. // CentrifugalPump1_GVL1_CloseLimit: '1',
  342. // FeedSG102_Healthy: '1',
  343. // PumpStopAlarm1: '1',
  344. // FeedSG101_ControlState: '0',
  345. // SubmarinePump_MOT_Power: '0',
  346. // Starter5_CloseAllow: '0',
  347. // CentrifugalPump2_GVL2_CloseReady: '1',
  348. // Starter2_SwitchOnNoReturn: '0',
  349. // CentrifugalPump2_PU_InterlockStoping: '0',
  350. // Starter5_SwitchOnNoReturn: '0',
  351. // T102_HighVoltSwitch_Temp: '49',
  352. // CentrifugalPump1_GVL1_OnOutput: '0',
  353. // Starter1_RunTimerClose: '0',
  354. // GVL_OpenLimit: '0',
  355. // CentrifugalPump1_MOT_BackAxleTemp: '870',
  356. // GVL_OpenFail: '1',
  357. // Starter1_CBStatus: '0',
  358. // CentrifugalPump1_GVL1_OpenLimit: '0',
  359. // CentrifugalPump2_GVL1_CtrlMode: '0',
  360. // CentrifugalPump1_GVL1_OffOutput: '0',
  361. // CentrifugalPump1_MOT_FrontAxleTemp: '870',
  362. // CentrifugalPump2_PU_InterlockStop: '0',
  363. // Starter4_SwitchOffOutput: '0',
  364. // CentrifugalPump2_GVL1_OnOutput: '0',
  365. // CentrifugalPump2_GVL2_OpenFail: '0',
  366. // CentrifugalPump2_PU_HMIStart: '0',
  367. // CentrifugalPump1_MOT_BackAxleOverTempAlarm: '1',
  368. // CentrifugalPump2_GVL2_OpenLimit: '0',
  369. // CentrifugalPump1_PU_InterlockStartFail: '0',
  370. // CentrifugalPump2_GVL2_Healthy: '0',
  371. // SubmarinePump2_MOT_Ic: '0',
  372. // SubmarinePump2_MOT_Ib: '0',
  373. // SubmarinePump2_MOT_Ia: '0',
  374. // Starter3_PLCState: '1',
  375. // CentrifugalPump1_GVL2_OffOutput: '0',
  376. // CentrifugalPump1_PU_Healthy: '0',
  377. // Starter4_SwitchOnOutput: '0',
  378. // FeedSG101_Uca: '0',
  379. // sign: '0',
  380. // T102_HighVoltSwitch_Current: '0',
  381. // CentrifugalPump1_MOT_PhaseATempAlarm: '2',
  382. // CentrifugalPump1_MOT_PhaseATemp: '16',
  383. // CentrifugalPump2_PU_InterlockStart: '0',
  384. // CentrifugalPump2_MOT_FrontAxleTemp: '870',
  385. // GVL_OnOutput: '1',
  386. // Starter3_CBStatus: '0',
  387. // CentrifugalPump1_GVL2_CtrlMode: '0',
  388. // SubmarinePump3_PU_Healthy: '1',
  389. // FeedSG102_ControlState: '1',
  390. // FeedSG101_Healthy: '0',
  391. // VSL_LiquidLevelSensor_HighWaterAlarm: '0',
  392. // CentrifugalPump1_GVL2_OpenFail: '0',
  393. // Starter5_OpenFail: '0',
  394. // Reset: '0',
  395. // GVL_OffOutput: '0',
  396. // Starter2_SwitchOffOutput: '0',
  397. // Starter5_SwitchOffOutput: '0',
  398. // CentrifugalPump1_GVL2_OnOutput: '0',
  399. // FeedSG102_Ic: '0',
  400. // Starter1_PLCState: '1',
  401. // CentrifugalPump1_GVL1_Healthy: '0',
  402. // CentrifugalPump2_MOT_PhaseATempAlarm: '2',
  403. // CentrifugalPump1_MOT_Power: '0',
  404. // CentrifugalPump1_MOT_FrontAxleOverTempAlarm: '1',
  405. // Starter1_SwitchOnOutput: '0',
  406. // CentrifugalPump1_MOT_PhaseCTemp: '16',
  407. // Starter4_CBStatus: '0',
  408. // CentrifugalPump2_GVL1_Healthy: '0',
  409. // T101_LowVoltSwith_SysVoltage: '0',
  410. // CentrifugalPump2_GVL1_OpenLimit: '0',
  411. // FeedSG102_Ia: '0',
  412. // TemperatureSensor_Temp: '8700',
  413. // FeedSG102_Ib: '0',
  414. // FeedSG101_CloseReady: '0',
  415. // Starter3_CloseAllow: '0',
  416. // CentrifugalPump1_GVL1_CtrlMode: '0',
  417. // CentrifugalPump1_MOT_AvgVoltage: '0',
  418. // GVL_CtrlMode: '0',
  419. // CentrifugalPump1_GVL2_CloseLimit: '1',
  420. // SubmarinePump_MOT_Ic: '0',
  421. // CentrifugalPump1_GVL2_CloseFail: '0',
  422. // CentrifugalPump1_GVL2_OpenLimit: '0',
  423. // SubmarinePump_MOT_Ib: '0',
  424. // FeedSG102_CloseReady: '1',
  425. // SubmarinePump_MOT_Ia: '0',
  426. // CentrifugalPump2_PU_InterlockStartFail: '0',
  427. // Starter3_SwitchOffOutput: '0',
  428. // T102_LowVoltSwith_Current: '0',
  429. // CentrifugalPump1_PU_InterlockReady: '0',
  430. // CentrifugalPump2_MOT_AvgVoltage: '1141',
  431. // CentrifugalPump1_GVL1_CloseReady: '0',
  432. // TemperatureSensor_TemperatureHighAlarm: '1',
  433. // Starter2_CBStatus: '0',
  434. // Starter2_PLCState: '1',
  435. // Starter3_SwitchOnOutput: '0',
  436. // Starter1_RunTimerOpen: '0',
  437. // CentrifugalPump2_PU_InterlockStarting: '0',
  438. // CentrifugalPump2_MOT_PhaseCTemp: '16',
  439. // Starter5_Ia: '0',
  440. // CentrifugalPump2_MOT_Ia: '0',
  441. // CentrifugalPump2_MOT_Ib: '0',
  442. // T102_LowVoltSwith_SysVoltage: '1135',
  443. // Starter5_Ic: '0',
  444. // CentrifugalPump1_MOT_Ia: '0',
  445. // Starter5_Ib: '0',
  446. // Starter5_CBStatus: '0',
  447. // T102_HighVoltSwitch_SysVoltage: '9978',
  448. // CentrifugalPump1_MOT_PhaseCTempAlarm: '0',
  449. // T101_CBStatus: '0',
  450. // Starter1_SwitchOnNoReturn: '0',
  451. // CentrifugalPump2_MOT_Ic: '0',
  452. // GVL_Healthy: '1',
  453. // VSL_LiquidLevelSensor_LowWaterAlarm: '1',
  454. // Starter4_PLCState: '1',
  455. // T101_HighVoltSwitch_Current: '0',
  456. // CentrifugalPump2_MOT_BackAxleTemp: '882',
  457. // CentrifugalPump2_GVL1_OffOutput: '0',
  458. // Starter5_SwitchOnOutput: '0',
  459. // CentrifugalPump2_MOT_FrontAxleOverTempAlarm: '1',
  460. // CentrifugalPump2_PU_HMIStop: '0',
  461. // isRun: '-2',
  462. // CentrifugalPump2_MOT_PhaseATemp: '16',
  463. // CentrifugalPump1_GVL2_Healthy: '0',
  464. // CentrifugalPump1_GVL1_OpenFail: '0',
  465. // T101_HighVoltSwitch_SysVoltage: '0',
  466. // },
  467. // readDataDes: null,
  468. // summaryHour: [],
  469. // summaryDay: [],
  470. // history: [],
  471. // dayhistory: [],
  472. // totalInfo: null,
  473. // sign: null,
  474. // cameras: [],
  475. // links: [],
  476. // avgParam: {},
  477. // other1: null,
  478. // other2: null,
  479. // other3: null,
  480. // remarkInfo: null,
  481. // linkInfo: null,
  482. // addrIndex: null,
  483. // warnLogNotOkCount: 0,
  484. // otherInfo: null,
  485. // orderNum: 0,
  486. // },
  487. // ],
  488. // type: 'pump_under',
  489. // },
  490. // ],
  491. // };
  492. const result = res.msgTxt[0]['datalist'][0];
  493. Object.assign(result, result['readData']);
  494. return result;
  495. }
  496. function handler(passWord, paramcode) {
  497. let value = '';
  498. if (paramcode == 'ykjdqh') {
  499. value = selectData.value['paramcode'] == '1' ? '2' : '1';
  500. }
  501. if (paramcode == 'jxmsqh') {
  502. value = selectData.value['jxmsqh'] == '1' ? '2' : '1';
  503. }
  504. const data = {
  505. deviceid: selectData.value['deviceID'],
  506. devicetype: selectData.value['deviceType'],
  507. paramcode: paramcode,
  508. password: passWord,
  509. value: value,
  510. };
  511. deviceControlApi(data)
  512. .then((res) => {
  513. if (globalConfig.History_Type == 'remote') {
  514. message.success('指令已下发至生产管控平台成功!');
  515. } else {
  516. message.success('指令已下发成功!');
  517. }
  518. })
  519. .catch((err) => {
  520. message.success('控制异常');
  521. });
  522. }
  523. function handleOK(passWord, handlerState) {
  524. handler(passWord, handlerState);
  525. passwordModalIsShow.value = false;
  526. handlerType.value = '';
  527. }
  528. function handleCancel() {
  529. passwordModalIsShow.value = false;
  530. handlerType.value = '';
  531. }
  532. watch(
  533. () => props.deviceType,
  534. () => {
  535. nextTick(async () => {
  536. if (props.deviceType == 'pump_over') {
  537. setModelType('gasPump');
  538. } else if (props.deviceType?.startsWith('pump_under')) {
  539. setModelType('gasPumpUnder');
  540. }
  541. deviceProperty.value = await getMonitorData(props.deviceType);
  542. });
  543. }
  544. );
  545. watch(
  546. () => props.deviceId,
  547. async (deviceID) => {
  548. removeCamera();
  549. if (deviceID) await getCamera(deviceID, playerRef.value);
  550. }
  551. );
  552. onMounted(async () => {
  553. timer = null;
  554. await getMonitor(true);
  555. if (selectData.value && selectData.value['deviceID']) await getCamera(selectData.value['deviceID'], playerRef.value);
  556. });
  557. onBeforeUnmount(() => {
  558. removeCamera();
  559. });
  560. onUnmounted(() => {
  561. removeCamera();
  562. if (timer) {
  563. clearTimeout(timer);
  564. timer = undefined;
  565. }
  566. });
  567. </script>
  568. <style lang="less" scoped>
  569. @import '/@/design/theme.less';
  570. @import '/@/design/vent/modal.less';
  571. @import '../../comment/less/workFace.less';
  572. @ventSpace: zxm;
  573. @{theme-deepblue} {
  574. .elementContent {
  575. --image-pump1: url('/@/assets/images/themify/deepblue/vent/pump1.png');
  576. }
  577. }
  578. .elementContent {
  579. --image-pump1: url('/@/assets/images/vent/pump1.png');
  580. :deep(.main-container) {
  581. display: flex;
  582. flex-wrap: wrap;
  583. width: 690px;
  584. padding: 10px 12px 10px 15px;
  585. border: 1px solid #d3e1ff33;
  586. background-color: #061c2a55;
  587. box-shadow: 0 0 15px #3b567f55;
  588. background-color: #38383833;
  589. }
  590. }
  591. .modal-monitor-box {
  592. background-color: #000;
  593. color: #fff;
  594. padding: 0 5px;
  595. display: flex;
  596. align-items: center;
  597. justify-content: center;
  598. .title {
  599. margin-right: 5px;
  600. }
  601. .signal-round {
  602. margin-left: 5px;
  603. }
  604. .value {
  605. width: 30px;
  606. color: #efae05;
  607. }
  608. }
  609. .device-state {
  610. width: 100%;
  611. position: absolute;
  612. top: 20px;
  613. color: #e90000;
  614. display: flex;
  615. justify-content: center;
  616. font-size: 20px;
  617. }
  618. .lr {
  619. margin-top: 0 !important;
  620. }
  621. .left-box {
  622. width: 360px !important;
  623. direction: rtl;
  624. overflow-y: auto;
  625. overflow-x: hidden;
  626. height: calc(100% - 60px);
  627. margin-top: 30px !important;
  628. .left-container {
  629. direction: ltr;
  630. :deep(.input-item .title) {
  631. width: 220px !important;
  632. }
  633. }
  634. }
  635. .right-box {
  636. width: 350px !important;
  637. overflow-y: auto;
  638. overflow-x: hidden;
  639. .environment-monitor {
  640. .item {
  641. flex: 1;
  642. margin: 0 5px;
  643. .title {
  644. color: #7ae5ff;
  645. text-align: center;
  646. margin-bottom: 2px;
  647. }
  648. .num {
  649. width: 100%;
  650. height: 30px;
  651. text-align: center;
  652. border-top: 2px solid #50c8fc;
  653. border-radius: 4px;
  654. background-image: linear-gradient(#2e4d5955, #3780b499, #2e465955);
  655. }
  656. }
  657. }
  658. .pool-box {
  659. width: 327px;
  660. height: 65px;
  661. padding: 0 5px;
  662. background: var(--image-pump1) no-repeat;
  663. background-size: cover;
  664. background-origin: content-box;
  665. margin-top: 2px;
  666. .num {
  667. color: aqua;
  668. }
  669. .center {
  670. padding-right: 5px;
  671. }
  672. }
  673. }
  674. .player-box {
  675. position: absolute;
  676. height: 100%;
  677. width: 100%;
  678. padding: 0 20px 0 20px;
  679. z-index: 9999;
  680. display: flex;
  681. align-items: end;
  682. bottom: 80px;
  683. right: 330px;
  684. :deep(#LivePlayerBox) {
  685. display: flex;
  686. justify-content: end;
  687. }
  688. }
  689. .input-box {
  690. width: calc(100%);
  691. display: flex;
  692. flex-direction: row !important;
  693. flex-wrap: wrap !important;
  694. .input-item {
  695. width: calc(50% - 8px);
  696. padding: 0 2px;
  697. &:nth-child(2n) {
  698. margin-left: 4px;
  699. }
  700. }
  701. }
  702. .btn-group {
  703. width: 100%;
  704. position: fixed;
  705. display: flex;
  706. justify-content: end;
  707. right: 380px;
  708. top: 85px;
  709. pointer-events: auto;
  710. .btn-item {
  711. width: auto;
  712. text-align: center;
  713. }
  714. }
  715. .state-header {
  716. display: flex;
  717. color: var(--vent-font-action-link);
  718. .header-item {
  719. width: 25%;
  720. text-align: center;
  721. }
  722. }
  723. .device-row {
  724. display: flex;
  725. margin-top: 10px;
  726. .state {
  727. width: 25%;
  728. text-align: center;
  729. font-size: 13px;
  730. }
  731. }
  732. :deep(.@{ventSpace}-tabs-tabpane-active) {
  733. overflow: auto;
  734. }
  735. </style>