index.vue 50 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348
  1. <template>
  2. <div class="bg" style="width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; overflow: hidden">
  3. <a-spin :spinning="loading" />
  4. <div id="fanLocal3D" style="width: 100%; height: 100%; position: absolute; overflow: hidden"> </div>
  5. <div id="fanLocal3DCSS" class="threejs-Object-CSS" style="width: 100%; height: 100%; position: absolute; overflow: hidden; pointer-events: none">
  6. <div style="z-index: -1; position: relative" v-if="hasPermission('show:sensorMonitor')">
  7. <div class="elementTag" id="inputBox">
  8. <div class="elementContent" v-if="selectData.windSpeed1 || selectData.gas3 || selectData.windSpeed_merge">
  9. <p v-if="selectData.windSpeed1 || selectData.windSpeed_merge"
  10. >风筒入口风速:<span class="value">{{
  11. selectData.windSpeed1 ? selectData.windSpeed1 : selectData.windSpeed_merge ? selectData.windSpeed_merge : '-'
  12. }}</span>
  13. <span class="unit"> m/s</span></p
  14. >
  15. <p v-if="selectData.windQuantity1 || selectData.inletAirVolume_merge"
  16. >风筒入口风量:<span class="value">{{
  17. selectData.windQuantity1 ? selectData.windQuantity1 : selectData.inletAirVolume_merge ? selectData.inletAirVolume_merge : '-'
  18. }}</span>
  19. <span class="unit"> m³/min</span></p
  20. >
  21. <p v-if="selectData.gas3"
  22. >风筒入口瓦斯浓度: <span class="value">{{ selectData.gas3 ? selectData.gas3 : '-' }}</span> <span class="unit"> %</span></p
  23. >
  24. </div>
  25. </div>
  26. <div class="elementTag" id="outBox">
  27. <div class="elementContent elementContent-r" v-if="selectData.windQuantity2 || selectData.gas1 || selectData.ductOutletAirVolume_merge">
  28. <p v-if="selectData.windQuantity2 || selectData.ductOutletAirVolume_merge"
  29. >迎头供风量:<span class="value">{{
  30. selectData.windQuantity2
  31. ? selectData.windQuantity2
  32. : selectData.ductOutletAirVolume_merge
  33. ? selectData.ductOutletAirVolume_merge
  34. : '-'
  35. }}</span>
  36. <span class="unit"> m³/min</span></p
  37. >
  38. <p v-if="selectData.gas1"
  39. >迎头瓦斯浓度:<span class="value">{{ selectData.gas1 ? selectData.gas1 : '-' }}</span> <span class="unit"> %</span></p
  40. >
  41. </div>
  42. </div>
  43. <div class="elementTag" id="returnBox">
  44. <div class="elementContent elementContent-r" v-if="selectData.gas2">
  45. <p v-if="selectData.gas2"
  46. >回风流瓦斯浓度:<span class="value">{{ selectData.gas2 ? selectData.gas2 : '-' }}</span> <span class="unit"> %</span></p
  47. >
  48. </div>
  49. </div>
  50. <div class="elementTag" id="gateBox">
  51. <div class="elementContent">
  52. <p>风门状态:关</p>
  53. <p>风门过风面积:{{ selectData.gas1 ? selectData.gas1 : '-' }}</p>
  54. </div>
  55. </div>
  56. <div class="elementTag" id="windownBox">
  57. <div class="elementContent" v-if="modalType == 'fc'">
  58. <p style="pointer-events: auto"
  59. ><a class="action-link" @click="goDetailDevice('window_fWindowM3')">风窗详情</a> <ArrowRightOutlined :style="{ color: '#157DC8' }"
  60. /></p>
  61. <p v-if="selectData.windSpeed"
  62. >风窗风流风速:<span class="value">{{ selectData.windSpeed ? selectData.windSpeed : '-' }}</span> <span class="unit"> m/s</span></p
  63. >
  64. <p v-if="selectData.fWindowM3"
  65. >风窗过风量:<span class="value">{{ selectData.fWindowM3 ? selectData.fWindowM3 : '-' }}</span> <span class="unit"> m³/min</span></p
  66. >
  67. <p v-if="selectData.OpenDegree"
  68. >风窗开度值:<span class="value">{{ selectData.OpenDegree ? selectData.OpenDegree : '-' }}</span> <span class="unit"> %</span></p
  69. >
  70. <p v-if="selectData.OpenDegree"
  71. >风窗过风面积:<span class="value">{{ selectData.forntArea ? selectData.forntArea : '-' }}</span> <span class="unit"> m2</span></p
  72. >
  73. </div>
  74. </div>
  75. </div>
  76. </div>
  77. </div>
  78. <div class="scene-box">
  79. <div class="top-box" v-if="!loading">
  80. <div class="top-center row">
  81. <div class="vent-flex-row" id="fanLocalSelectDom" v-if="!globalConfig?.simulatedPassword && getDictItemsByCode('fanlocaltype')">
  82. <span style="color: #00f5fe; margin-left: 5px">风机类型:</span>
  83. <JDictSelectTag
  84. style="width: 180px"
  85. v-model:value="devicekide"
  86. dictCode="fanlocaltype"
  87. :showChooseOption="false"
  88. :getPopupContainer="getPopupContainer"
  89. @change="changeDeviceKind"
  90. />
  91. </div>
  92. <!-- fanlocal_systeml_zj 模拟局部风机,不显示操作按钮 -->
  93. <template v-for="(item, index) in modalTypeArr.leftBtnArr" :key="index">
  94. <div v-if="hasPermission(item.permission)" :class="{ 'button-box': btnClick, 'button-disable': !btnClick }" @click="showModal(item)">{{
  95. item.value
  96. }}</div>
  97. </template>
  98. </div>
  99. <div class="top-right row">
  100. <template v-for="(item, index) in modalTypeArr.rightBtnArr" :key="index">
  101. <div v-if="hasPermission(item.permission)" :class="{ 'button-box': btnClick, 'button-disable': !btnClick }" @click="showModal(item)">{{
  102. item.value
  103. }}</div>
  104. </template>
  105. </div>
  106. </div>
  107. <div class="title-text">
  108. {{ selectData.supplyAirAddr || selectData.strinstallpos || selectData.stationname }}
  109. </div>
  110. <div class="data-show-box" v-if="!loading">
  111. <div class="data-item" v-if="leftColumns.length > 0">
  112. <div class="item-header">环境监测</div>
  113. <div class="item-container">
  114. <div class="tab">
  115. <div class="tab-item" :class="{ 'tab-item-active-r': warningMonitorRowIndex === 0 }" @click="selectDevice('warningMonitorRowIndex', 0)"
  116. >主机</div
  117. >
  118. <div class="tab-item" :class="{ 'tab-item-active-r': warningMonitorRowIndex === 1 }" @click="selectDevice('warningMonitorRowIndex', 1)"
  119. >备机</div
  120. >
  121. </div>
  122. <div class="container-group">
  123. <div class="warning-header">
  124. <div class="header-item">
  125. <div class="header-title">报警总数</div>
  126. <div class="header-value">0</div>
  127. </div>
  128. <div class="header-item">
  129. <div class="header-title"> 未处理数</div>
  130. <div class="header-value">0</div>
  131. </div>
  132. </div>
  133. <div class="warning-group">
  134. <template v-if="selectData.deviceType">
  135. <!-- <div class="warning-item" v-for="(state, index) in leftColumns" :key="index">
  136. <div class="item-name"><div class="icon"></div> {{ state.title }}</div>
  137. <div v-if="state.dataIndex.startsWith('Fan')">
  138. <div class="signal-item" v-if="warningMonitorRowIndex == 0">
  139. <div
  140. class="signal-round"
  141. :class="{
  142. 'signal-round-run': selectData[state.dataIndex.replace('Fan', 'Fan1')],
  143. 'signal-round-warning':
  144. selectData[state.dataIndex.replace('Fan', 'Fan1')] !== undefined && !selectData[state.dataIndex.replace('Fan', 'Fan1')],
  145. 'signal-round-gry': selectData[state.dataIndex.replace('Fan', 'Fan1')] === undefined,
  146. }"
  147. ></div>
  148. <div class="vent-margin-l-8">{{
  149. selectData[state.dataIndex.replace('Fan', 'Fan1')] === undefined
  150. ? '无状态'
  151. : selectData[state.dataIndex.replace('Fan', 'Fan1')]
  152. ? '正常'
  153. : '异常'
  154. }}</div>
  155. </div>
  156. <div class="signal-item" v-if="warningMonitorRowIndex == 1">
  157. <div
  158. class="signal-round"
  159. :class="{
  160. 'signal-round-run': selectData[state.dataIndex.replace('Fan', 'Fan2')],
  161. 'signal-round-warning':
  162. selectData[state.dataIndex.replace('Fan', 'Fan2')] !== undefined && !selectData[state.dataIndex.replace('Fan', 'Fan2')],
  163. 'signal-round-gry': selectData[state.dataIndex.replace('Fan', 'Fan2')] === undefined,
  164. }"
  165. ></div>
  166. <div class="vent-margin-l-8">{{
  167. selectData[state.dataIndex.replace('Fan', 'Fan2')] === undefined
  168. ? '无状态'
  169. : selectData[state.dataIndex.replace('Fan', 'Fan2')]
  170. ? '正常'
  171. : '异常'
  172. }}</div>
  173. </div>
  174. </div>
  175. <div v-else>
  176. <div class="signal-item">
  177. <div
  178. class="signal-round vent-margin-l-8"
  179. :class="{
  180. 'signal-round-run': selectData[state.dataIndex],
  181. 'signal-round-warning': selectData[state.dataIndex] !== undefined && !selectData[state.dataIndex],
  182. 'signal-round-gry': selectData[state.dataIndex] === undefined,
  183. }"
  184. ></div>
  185. <div class="vent-margin-l-8">{{ selectData[state.dataIndex] === undefined ? '无状态' : selectData[state.dataIndex] ? '正常' : '异常' }}</div>
  186. </div>
  187. </div>
  188. </div> -->
  189. <div class="container-item" v-for="(data, index) in leftColumns" :key="index">
  190. <div class="item-icon">
  191. <!-- <SvgIcon class="icon-style" size="18" name="temperature" /> -->
  192. <CaretRightOutlined class="icon-style" />
  193. </div>
  194. <div class="item-name">{{ data.title }}</div>
  195. <div v-if="data.dataIndex.startsWith('Fan')">
  196. <div class="item-value" v-if="warningMonitorRowIndex == 0">{{
  197. selectData[data.dataIndex.replace('Fan', 'Fan1')] ? selectData[data.dataIndex.replace('Fan', 'Fan1')] : '-'
  198. }}</div>
  199. <div class="item-value" v-if="warningMonitorRowIndex == 1">{{
  200. selectData[data.dataIndex.replace('Fan', 'Fan2')] ? selectData[data.dataIndex.replace('Fan', 'Fan2')] : '-'
  201. }}</div>
  202. </div>
  203. <div v-else>
  204. <div class="item-value">{{ selectData[data.dataIndex] ? selectData[data.dataIndex] : '-' }}</div>
  205. </div>
  206. </div>
  207. </template>
  208. </div>
  209. </div>
  210. </div>
  211. </div>
  212. <div class="data-item" v-if="rightColumns.length > 0">
  213. <div class="item-header">设备监测</div>
  214. <div class="item-container">
  215. <div class="tab">
  216. <div class="tab-item" :class="{ 'tab-item-active-r': dataMonitorRowIndex == 0 }" @click="selectDevice('dataMonitorRowIndex', 0)"
  217. >主机</div
  218. >
  219. <div class="tab-item" :class="{ 'tab-item-active-r': dataMonitorRowIndex == 1 }" @click="selectDevice('dataMonitorRowIndex', 1)"
  220. >备机</div
  221. >
  222. </div>
  223. <div class="container-group container-group-l">
  224. <template v-if="!loading">
  225. <div class="container-item" v-for="(data, index) in rightColumns" :key="index">
  226. <div class="item-icon">
  227. <!-- <SvgIcon class="icon-style" size="18" name="temperature" /> -->
  228. <!-- <StarOutlined /> -->
  229. <CaretRightOutlined class="icon-style" />
  230. </div>
  231. <div class="item-name">{{ data.title }}</div>
  232. <div v-if="data.dataIndex.startsWith('Fan')">
  233. <div class="item-value" v-if="dataMonitorRowIndex == 0">{{
  234. selectData[data.dataIndex.replace('Fan', 'Fan1')] ? selectData[data.dataIndex.replace('Fan', 'Fan1')] : '-'
  235. }}</div>
  236. <div class="item-value" v-if="dataMonitorRowIndex == 1">{{
  237. selectData[data.dataIndex.replace('Fan', 'Fan2')] ? selectData[data.dataIndex.replace('Fan', 'Fan2')] : '-'
  238. }}</div>
  239. </div>
  240. <div v-else>
  241. <div class="item-value">{{ selectData[data.dataIndex] ? selectData[data.dataIndex] : '-' }}</div>
  242. </div>
  243. </div>
  244. </template>
  245. </div>
  246. </div>
  247. </div>
  248. </div>
  249. <div class="bottom-tabs-box" @mousedown="setDivHeight($event, 170, scroll, 180)">
  250. <dv-border-box8 :dur="5" class="dv_border_8" :style="`bottom: 20px; padding: 5px; height: ${scroll.y + 140}px`">
  251. <!-- <div class="enter-detail" @click="goDetail()">
  252. <send-outlined class=""/>风机运行详情
  253. </div> -->
  254. <a-tabs class="tabs-box" v-model:activeKey="activeKey" @change="tabChange">
  255. <a-tab-pane key="1" tab="实时监测">
  256. <GroupMonitorTable
  257. v-if="activeKey === '1'"
  258. ref="MonitorDataTable"
  259. :dataSource="dataSource"
  260. :columnsType="`${selectData.deviceType}_monitor`"
  261. @selectRow="getSelectRow"
  262. :scroll="scroll"
  263. :is-action="true"
  264. >
  265. <template #action="{ record }">
  266. <a v-if="globalConfig?.showReport" class="table-action-link" @click="deviceEdit($event, 'reportInfo', record)">报表录入</a>
  267. <a class="table-action-link" @click="deviceEdit($event, 'deviceInfo', record)">设备编辑</a>
  268. </template>
  269. </GroupMonitorTable>
  270. </a-tab-pane>
  271. <a-tab-pane key="2" tab="实时曲线图" force-render v-if="hasPermission('echart:show')">
  272. <div class="tab-item" v-if="activeKey === '2'">
  273. <div class="vent-flex-row-between" style="height: 100%">
  274. <BarSingle
  275. :xAxisData="xAxisDataGas"
  276. :dataSource="dataSource[selectRowIndex]"
  277. height="100%"
  278. :chartsColumns="chartsColumns"
  279. style="flex: 3"
  280. />
  281. <BarSingle
  282. v-if="globalConfig?.simulatedPassword"
  283. :xAxisData="[
  284. { key: 'F1', valueKey: 'windQuantity1' },
  285. { key: 'F2', valueKey: 'windQuantity2' },
  286. ]"
  287. :dataSource="dataSource[selectRowIndex]"
  288. height="100%"
  289. :chartsColumns="chartsColumns1"
  290. style="flex: 2"
  291. />
  292. </div>
  293. </div>
  294. </a-tab-pane>
  295. <a-tab-pane key="3" tab="历史数据">
  296. <div class="tab-item" v-if="activeKey === '3'">
  297. <HistoryTable
  298. :columns-type="`${selectData.deviceType}`"
  299. :device-type="`${devicekide}`"
  300. designScope="fanlocal-history"
  301. :scroll="scroll"
  302. />
  303. </div>
  304. </a-tab-pane>
  305. <a-tab-pane key="4" tab="报警历史">
  306. <div class="tab-item" v-if="activeKey === '4'">
  307. <AlarmHistoryTable
  308. columns-type="alarm"
  309. :device-type="`${devicekide}`"
  310. :device-list-api="baseList"
  311. designScope="alarm-history"
  312. :scroll="scroll"
  313. />
  314. </div>
  315. </a-tab-pane>
  316. <a-tab-pane key="5" tab="操作历史">
  317. <div class="tab-item" v-if="activeKey === '5'">
  318. <HandlerHistoryTable
  319. columns-type="operator_history"
  320. :device-type="`${devicekide}`"
  321. :device-list-api="baseList"
  322. designScope="alarm-history"
  323. :scroll="scroll"
  324. />
  325. </div>
  326. </a-tab-pane>
  327. </a-tabs>
  328. <a-button
  329. v-if="hasPermission('btn:reportDown')"
  330. type="primary"
  331. size="small"
  332. preIcon="ant-design:download-outlined"
  333. style="position: absolute; right: 15px; top: 10px"
  334. @click="reportDown"
  335. >
  336. 报表导出
  337. </a-button>
  338. </dv-border-box8>
  339. </div>
  340. </div>
  341. <div
  342. ref="playerRef"
  343. style="z-index: 999; position: absolute; top: 100px; right: 15px; width: 100%; height: 100%; margin: auto; pointer-events: none"
  344. >
  345. </div>
  346. <a-modal v-model:visible="modalIsShow" :title="modalTitle" @ok="handleOk">
  347. <div class="modal-container">
  348. <div class="vent-flex-row">
  349. <ExclamationCircleFilled style="color: #ffb700; font-size: 30px" />
  350. <div class="warning-text">您是否要进行{{ modalTitle }}操作?</div>
  351. </div>
  352. <div class="" v-if="controlType == 'startSmoke'">
  353. <div class="startSmoke-select">
  354. <div class="label">主机:</div>
  355. <a-radio-group v-model:value="mainWindIsShow1" @change="changeMotor" name="localWind1">
  356. <a-radio value="open">开启</a-radio>
  357. <a-radio value="stop">停止</a-radio>
  358. </a-radio-group>
  359. </div>
  360. <div class="startSmoke-select">
  361. <div class="label">备机:</div>
  362. <a-radio-group v-model:value="mainWindIsShow2" @change="changeMotor" name="localWind2">
  363. <a-radio value="open">开启</a-radio>
  364. <a-radio value="stop">停止</a-radio>
  365. </a-radio-group>
  366. </div>
  367. </div>
  368. <!-- 调频 -->
  369. <div class="vent-flex-row input-box" v-if="controlType == 'Fan1Frequency'">
  370. <div class="label">主风机运行频率(Hz):</div>
  371. <a-input-number size="small" v-model:value="fan1FrequencyVal" :min="20" :max="50" :step="0.1" />
  372. </div>
  373. <div class="vent-flex-row input-box" v-if="controlType == 'Fan2Frequency'">
  374. <div class="label">备风机运行频率(Hz):</div>
  375. <a-input-number size="small" v-model:value="fan2FrequencyVal" :min="20" :max="50" :step="0.1" />
  376. </div>
  377. <div class="vent-flex-row input-box" v-if="controlType == 'FanFrequency'">
  378. <div class="label">风机运行频率(Hz):</div>
  379. <a-input-number size="small" v-model:value="fan1FrequencyVal" :min="20" :max="50" :step="0.1" />
  380. </div>
  381. <div class="vent-flex-row input-box" v-if="controlType == 'needAir'">
  382. <div class="label">需风量(单位):</div>
  383. <a-input-number size="small" v-model:value="frequencyVal" :min="30" :max="50" :step="0.1" />
  384. </div>
  385. <div class="vent-flex-row input-box" v-if="controlType == 'disAirAlarm'">
  386. <div class="label">漏风率(%):</div>
  387. <a-input-number size="small" v-model:value="frequencyVal" :min="0" :max="50" :step="0.1" />
  388. </div>
  389. <div class="vent-flex-row input-box" v-if="controlType == 'diameter'">
  390. <div class="label">风筒直径(m):</div>
  391. <a-input-number size="small" v-model:value="frequencyVal" :min="0" :max="50" :step="0.1" />
  392. </div>
  393. <div class="vent-flex-row input-box" v-if="controlType == 'len'">
  394. <div class="label">风筒长度(m):</div>
  395. <a-input-number size="small" v-model:value="frequencyVal" :min="0" :max="50" :step="0.1" />
  396. </div>
  397. <div class="vent-flex-row input-box" v-if="controlType == 'windPowerLimit'">
  398. <div class="label">风电闭锁限值(m³/min):</div>
  399. <a-input-number size="small" v-model:value="frequencyVal" :min="0" :max="50" :step="0.1" />
  400. </div>
  401. <div class="vent-flex-row input-box" v-if="controlType == 'gasPowerLimit'">
  402. <div class="label">瓦斯电闭锁限值(m³/min):</div>
  403. <a-input-number size="small" v-model:value="frequencyVal" :min="0" :max="50" :step="0.1" />
  404. </div>
  405. <div v-if="controlType == 'gasAlarm'">
  406. <div class="vent-flex-row input-box">
  407. <div class="label">传感器名称:</div>
  408. <a-select placeholder="传感器" @change="handleChangeSensor" :options="sensorList" v-model:value="modalSensor" />
  409. </div>
  410. <div class="vent-flex-row input-box">
  411. <div class="label">传感器值:</div>
  412. <a-input-number size="small" v-model:value="frequencyVal" :min="0" :max="50" :step="0.1" />
  413. </div>
  414. </div>
  415. <div v-if="controlType == 'airVolumeAlarm'">
  416. <div class="vent-flex-row input-box">
  417. <div class="label">风量上限(m³/min):</div>
  418. <a-input-number size="small" v-model:value="modalTypeArr.rightBtnArr[3].min" :min="0" :max="50" :step="0.1" />
  419. </div>
  420. <div class="vent-flex-row input-box">
  421. <div class="label">风量下限(m³/min):</div>
  422. <a-input-number size="small" v-model:value="modalTypeArr.rightBtnArr[3].max" :min="0" :max="50" :step="0.1" />
  423. </div>
  424. </div>
  425. <!-- 启动或停止 -->
  426. <div class="" v-if="controlType == 'startSmoke'"> </div>
  427. <div v-if="!globalConfig?.simulatedPassword" class="vent-flex-row input-box">
  428. <div class="label">操作密码:</div>
  429. <a-input size="small" type="password" v-model:value="passWord" />
  430. </div>
  431. </div>
  432. </a-modal>
  433. <DeviceBaseInfo @register="registerModal" :device-type="selectData['deviceType']" />
  434. <reportInfo @register="registerModal1" :editID="editID" :fileType="fileType" />
  435. </template>
  436. <script setup lang="ts">
  437. import { ExclamationCircleFilled, ArrowRightOutlined } from '@ant-design/icons-vue';
  438. import { onBeforeMount, ref, watch, onMounted, nextTick, toRaw, reactive, onUnmounted, inject, unref } from 'vue';
  439. import BarSingle from '../../../../components/chart/BarSingle.vue';
  440. import GroupMonitorTable from '../comment/GroupMonitorTable.vue';
  441. import HistoryTable from '../comment/HistoryTable.vue';
  442. import AlarmHistoryTable from '../comment/AlarmHistoryTable.vue';
  443. import HandlerHistoryTable from '../comment/HandlerHistoryTable.vue';
  444. import DeviceBaseInfo from '../comment/components/DeviceBaseInfo.vue';
  445. import { mountedThree, setModelType, destroy, addCssText, addText, playSmoke } from './fanLocal.three';
  446. import lodash from 'lodash';
  447. import { getTableList, list } from '/@/views/vent/monitorManager/fanLocalMonitor/fanLocal.api';
  448. import { list as baseList } from '../../deviceManager/fanTabel/fan.api';
  449. import { chartsColumns, chartsColumns1 } from './fanLocal.data';
  450. import { deviceControlApi } from '/@/api/vent/index';
  451. import { setDivHeight } from '/@/utils/event';
  452. import { BorderBox8 as DvBorderBox8 } from '@kjgl77/datav-vue3';
  453. import { getTableHeaderColumns } from '/@/hooks/web/useWebColumns';
  454. import { useRouter } from 'vue-router';
  455. import { useModal } from '/@/components/Modal';
  456. import type { BasicColumn } from '/@/components/Table/src/types/table';
  457. import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
  458. import { getPopupContainer } from '/@/utils';
  459. import { getDictItemsByCode } from '/@/utils/dict';
  460. import { message } from 'ant-design-vue';
  461. import { useCamera } from '/@/hooks/system/useCamera';
  462. import { CaretRightOutlined } from '@ant-design/icons-vue';
  463. import { DownloadOutlined } from '@ant-design/icons-vue';
  464. import reportInfo from '../comment/components/reportInfo.vue';
  465. import { save, reportList } from '../../reportManager/reportManager.api';
  466. import { usePermission } from '/@/hooks/web/usePermission';
  467. const { hasPermission } = usePermission();
  468. const globalConfig = inject('globalConfig');
  469. const [registerModal, { openModal, closeModal }] = useModal();
  470. const [registerModal1, { openModal: openModal1, closeModal: closeModal1 }] = useModal();
  471. const { currentRoute } = useRouter();
  472. const router = useRouter();
  473. const modalTypeArr = reactive({
  474. leftBtnArr: [
  475. {
  476. key: 'startSmoke',
  477. value: '启动风机',
  478. permission: 'btn:openclose',
  479. },
  480. {
  481. key: 'changeSmoke', // 主备两个点位
  482. value: '一键倒机',
  483. permission: 'btn:change',
  484. },
  485. {
  486. key: 'changeFan', // 主备一个点位
  487. value: '一键倒机',
  488. permission: 'btn:CtrlFanChange',
  489. },
  490. {
  491. key: 'fan1ToFan2',
  492. value: '主机倒备机',
  493. permission: 'btn:ctrlFan1ToFan2',
  494. },
  495. {
  496. key: 'fan2ToFan1',
  497. value: '备机倒主机',
  498. permission: 'btn:ctrlFan2ToFan1',
  499. },
  500. {
  501. key: 'Fan1Frequency',
  502. value: '主机调频',
  503. permission: 'btn:frequency',
  504. },
  505. {
  506. key: 'Fan2Frequency',
  507. value: '备机调频',
  508. permission: 'btn:frequency',
  509. },
  510. {
  511. key: 'FanFrequency',
  512. value: '风机调频',
  513. permission: 'btn:frequencyMerge',
  514. },
  515. {
  516. key: 'windPower',
  517. value: '风电闭锁',
  518. permission: 'fanLocal:control',
  519. },
  520. {
  521. key: 'gasPower',
  522. value: '瓦斯电闭锁',
  523. permission: 'fanLocal:control',
  524. },
  525. {
  526. key: 'needAir',
  527. value: '需风量',
  528. permission: 'fanLocal:control',
  529. },
  530. ],
  531. rightBtnArr: [
  532. {
  533. key: 'diameter',
  534. value: '风筒直径',
  535. permission: 'fanLocal:control',
  536. },
  537. {
  538. key: 'len',
  539. value: '风筒长度',
  540. permission: 'fanLocal:control',
  541. },
  542. // {
  543. // key: 'frequency',
  544. // value: '调频',
  545. // permission: 'fanLocal:control',
  546. // },
  547. {
  548. key: 'windPowerLimit',
  549. value: '风电闭锁限值',
  550. permission: 'fanLocal:control',
  551. },
  552. {
  553. key: 'gasPowerLimit',
  554. value: '瓦斯电闭锁限值',
  555. permission: 'fanLocal:control',
  556. },
  557. {
  558. key: 'airVolumeAlarm',
  559. value: '风量报警',
  560. permission: 'fanLocal:control',
  561. min: 0,
  562. max: 100,
  563. },
  564. {
  565. key: 'disAirAlarm',
  566. value: '漏风率报警',
  567. permission: 'fanLocal:control',
  568. },
  569. // {
  570. // key: 'gasAlarm',
  571. // value: '瓦斯报警',
  572. // permission: 'fanLocal:control',
  573. // },
  574. ],
  575. });
  576. const sensorList = ref<any[]>([
  577. {
  578. value: '1',
  579. label: 'T1',
  580. },
  581. {
  582. value: '2',
  583. label: 'T2',
  584. },
  585. {
  586. value: '3',
  587. label: 'T3',
  588. },
  589. ]);
  590. const scroll = reactive({
  591. y: 180,
  592. });
  593. const playerRef = ref();
  594. const MonitorDataTable = ref();
  595. const modalSensor = ref(null);
  596. const loading = ref(false);
  597. const activeKey = ref('1');
  598. const player1 = ref();
  599. const modalIsShow = ref<boolean>(false); // 是否显示模态框
  600. const modalTitle = ref(''); // 模态框标题显示内容,根据设备操作类型决定
  601. const fan1FrequencyVal = ref(40); //主机频率
  602. const fan2FrequencyVal = ref(40); //备机频率
  603. const mainWindIsShow1 = ref('open'); // 主机默认启动leftColumns
  604. const mainWindIsShow2 = ref('stop'); // 备机默认不启动
  605. const passWord = ref('');
  606. // 默认初始是第一行
  607. const selectRowIndex = ref(-1);
  608. const dataMonitorRowIndex = ref(0);
  609. // 默认数据右边监测的是主机
  610. const warningMonitorRowIndex = ref(0);
  611. const xAxisDataGas = ref([]);
  612. // 设备数据
  613. const controlType = ref('');
  614. const modalType = ref('');
  615. // 监测数据
  616. const initData = {
  617. deviceID: '',
  618. deviceType: '',
  619. strname: '',
  620. dataDh: '-', //压差
  621. dataDtestq: '-', //测试风量
  622. sourcePressure: '-', //气源压力
  623. dataDequivalarea: '-',
  624. netStatus: '0', //通信状态
  625. warnLevel_str: '',
  626. stationname: '',
  627. };
  628. const frequencyVal = ref(0);
  629. const dataSource = ref([]);
  630. // 关联设备信息
  631. const linkDeviceInfo = ref({});
  632. // 监测数据
  633. let selectData = reactive(lodash.cloneDeep(initData));
  634. const rightColumns = ref<BasicColumn[]>([]);
  635. const leftColumns = ref<BasicColumn[]>([]);
  636. const devicekide = ref('fanlocal');
  637. const deviceType = ref(selectData.deviceType);
  638. const headElHeight = ref(0);
  639. let btnClick = ref(true); // 判断按钮是否可点
  640. //报表导出
  641. let editID = ref<any>('');
  642. let fileType = ref('');
  643. const { getCamera, removeCamera } = useCamera();
  644. watch(deviceType, (type) => {
  645. rightColumns.value = getTableHeaderColumns(type + '_monitor_right') as [];
  646. if (rightColumns.value && rightColumns.value.length < 1) {
  647. rightColumns.value = getTableHeaderColumns(type.split('_')[0] + '_monitor_right') as [];
  648. }
  649. leftColumns.value = getTableHeaderColumns(type + '_monitor_left') as [];
  650. if (leftColumns.value && leftColumns.value.length < 1) {
  651. leftColumns.value = getTableHeaderColumns(type.split('_')[0] + '_monitor_left') as [];
  652. }
  653. });
  654. const flvURL1 = () => {
  655. // return `https://sf1-hscdn-tos.pstatp.com/obj/media-fe/xgplayer_doc_video/flv/xgplayer-demo-360p.flv`;
  656. return '';
  657. };
  658. const changeDeviceKind = (e) => {
  659. devicekide.value = e;
  660. loading.value = true;
  661. selectRowIndex.value = -1;
  662. nextTick(() => {
  663. // selectRowIndex.value = 0
  664. selectData = lodash.cloneDeep(initData);
  665. loading.value = false;
  666. if (selectData.deviceID) MonitorDataTable.value.setSelectedRowKeys([selectData.deviceID]);
  667. const headEl = document.querySelector(`.zxm-table-thead`);
  668. if (headEl) {
  669. headElHeight.value = headEl.clientHeight;
  670. }
  671. });
  672. };
  673. const tabChange = (activeKeyVal) => {
  674. activeKey.value = activeKeyVal;
  675. if (activeKeyVal == 1) {
  676. nextTick(() => {
  677. MonitorDataTable.value.setSelectedRowKeys([selectData.deviceID]);
  678. });
  679. }
  680. };
  681. const selectDevice = (key, val) => {
  682. if (key === 'dataMonitorRowIndex') {
  683. dataMonitorRowIndex.value = val;
  684. } else {
  685. warningMonitorRowIndex.value = val;
  686. }
  687. };
  688. //报表导出点击
  689. async function reportDown() {
  690. openModal1();
  691. let res = await save({ reportType: 'fanlocal' });
  692. console.log(res, 'res-----------');
  693. let list = await reportList({ id: res.id });
  694. console.log(list, 'list-----------');
  695. let index = list.records[0].fileName.indexOf('.');
  696. fileType.value = list.records[0].fileName.substring(index + 1);
  697. editID.value = list.records[0].id;
  698. openModal1();
  699. }
  700. //详情
  701. function goDetail() {
  702. openModal();
  703. }
  704. function goDetailDevice(linkDeviceCode) {
  705. let linkDeviceId = '';
  706. if (linkDeviceCode.startsWith('window')) {
  707. linkDeviceId = linkDeviceInfo.value[linkDeviceCode] ? linkDeviceInfo.value[linkDeviceCode]['id'] : '';
  708. router.push({ path: '/monitorChannel/monitor-window', query: { id: linkDeviceId } });
  709. }
  710. }
  711. //
  712. async function getDataSource() {
  713. if (devicekide.value) {
  714. const res = await list({ devicetype: devicekide.value, pagetype: 'normal' });
  715. if (res.msgTxt && res.msgTxt[0] && res.msgTxt[0].datalist && res.msgTxt[0].datalist.length > 0) {
  716. const dataArr = res.msgTxt[0].datalist || [];
  717. dataSource.value = [];
  718. dataArr.forEach((data) => {
  719. const readData = data.readData;
  720. data = Object.assign(data, readData);
  721. if (data['Fan1StartStatus'] && data['Fan1StartStatus'] === '1.0') data['Fan1StartStatus'] = '1';
  722. if (data['Fan2StartStatus'] && data['Fan2StartStatus'] === '1.0') data['Fan2StartStatus'] = '1';
  723. if (data['Fan1StartStatus'] && data['Fan1StartStatus'] === '0.0') data['Fan1StartStatus'] = '0';
  724. if (data['Fan2StartStatus'] && data['Fan2StartStatus'] === '0.0') data['Fan2StartStatus'] = '0';
  725. dataSource.value.push(data);
  726. });
  727. if (MonitorDataTable.value && selectRowIndex.value == -1) {
  728. MonitorDataTable.value.setSelectedRowKeys([dataSource.value[0]['deviceID']]);
  729. }
  730. const data: any = toRaw(dataSource.value[selectRowIndex.value]); //maxarea
  731. return data;
  732. } else {
  733. return (dataSource.value = []);
  734. }
  735. } else {
  736. dataSource.value = [];
  737. }
  738. }
  739. // https获取监测数据
  740. let timer: null | NodeJS.Timeout = null;
  741. async function getMonitor(flag?) {
  742. if (Object.prototype.toString.call(timer) === '[object Null]') {
  743. timer = await setTimeout(
  744. async () => {
  745. // debugger;
  746. await getDataSource();
  747. if (dataSource.value.length > 0 && selectRowIndex.value == -1 && MonitorDataTable.value) {
  748. // 初始打开页面
  749. if (currentRoute.value && currentRoute.value['query'] && currentRoute.value['query']['id']) {
  750. MonitorDataTable.value.setSelectedRowKeys(currentRoute.value['query']['id']);
  751. } else {
  752. MonitorDataTable.value.setSelectedRowKeys(dataSource.value[0]['deviceID']);
  753. }
  754. }
  755. for (const key in selectData) {
  756. selectData[key] = '';
  757. }
  758. if (dataSource.value.length > 0 && dataSource.value[selectRowIndex.value]) {
  759. deviceType.value = dataSource.value[selectRowIndex.value]['deviceType'];
  760. if (dataSource.value.length > 0 && dataSource.value[selectRowIndex.value]) {
  761. Object.assign(selectData, dataSource.value[selectRowIndex.value]);
  762. }
  763. playSmoke(selectData);
  764. addText(selectData);
  765. }
  766. if (timer) {
  767. timer = null;
  768. }
  769. getMonitor();
  770. },
  771. flag ? 0 : 1000
  772. );
  773. }
  774. }
  775. // 获取设备基本信息列表
  776. const deviceBaseList = ref([]);
  777. function getDeviceBaseList() {
  778. getTableList({ pageSize: 1000 }).then((res) => {
  779. deviceBaseList.value = res.records;
  780. });
  781. }
  782. // 切换检测数据
  783. async function getSelectRow(id) {
  784. console.log('选中的设备id------->', id);
  785. if (!id || id == selectData['deviceID']) return;
  786. // loading.value = true;
  787. const selectIndex: any = dataSource.value.findIndex((baseData: any) => baseData.deviceID == id);
  788. selectRowIndex.value = selectIndex;
  789. nextTick(() => {
  790. const headEl = document.querySelector(`.zxm-table-thead`);
  791. if (headEl) {
  792. headElHeight.value = headEl.clientHeight;
  793. }
  794. const data = dataSource.value[selectIndex];
  795. if (data) {
  796. if (selectData['linkInfo']) linkDeviceInfo.value = JSON.parse(selectData['linkInfo']);
  797. if (linkDeviceInfo.value['window_fWindowM3']) {
  798. modalType.value = 'fc';
  799. }
  800. if (data['Fan1StartStatus'] == '1') {
  801. mainWindIsShow1.value = 'open';
  802. mainWindIsShow2.value = 'stop';
  803. selectDevice('warningMonitorRowIndex', 0);
  804. selectDevice('dataMonitorRowIndex', 0);
  805. } else if (data['Fan2StartStatus'] == '1') {
  806. mainWindIsShow2.value = 'open';
  807. mainWindIsShow1.value = 'stop';
  808. selectDevice('warningMonitorRowIndex', 1);
  809. selectDevice('dataMonitorRowIndex', 1);
  810. }
  811. const xAxisDataGasArr = [];
  812. for (const key in selectData) {
  813. if (key.startsWith('gas') && key.length < 5) {
  814. xAxisDataGasArr.push({ key: 'T' + key.substring(3), valueKey: key });
  815. }
  816. }
  817. xAxisDataGas.value = xAxisDataGasArr;
  818. }
  819. setModelType(modalType.value);
  820. });
  821. await getCamera(id, playerRef.value);
  822. return;
  823. }
  824. // 打开并设置modal的标题
  825. function showModal(obj) {
  826. if (!btnClick.value) return;
  827. controlType.value = obj.key;
  828. modalTitle.value = obj.value;
  829. passWord.value = '';
  830. modalIsShow.value = true;
  831. }
  832. function changeMotor(e) {
  833. const target = e.target;
  834. if (target.name === 'localWind1') {
  835. if (target.value === 'open') {
  836. mainWindIsShow2.value = 'stop';
  837. }
  838. } else if (target.name === 'localWind2') {
  839. if (target.value === 'open') {
  840. mainWindIsShow1.value = 'stop';
  841. }
  842. }
  843. }
  844. function handleOk(e: MouseEvent) {
  845. const handType = controlType.value;
  846. const data = {
  847. deviceid: selectData.deviceID,
  848. devicetype: selectData.deviceType,
  849. paramcode: '',
  850. password: passWord.value || globalConfig?.simulatedPassword,
  851. value: null,
  852. };
  853. if (handType === 'startSmoke') {
  854. // 启动风机
  855. if (mainWindIsShow1.value === 'open' && mainWindIsShow2.value === 'stop') {
  856. // playSmoke(handType, 'top', frequency, 'open');
  857. data.paramcode = 'CtrlFan1Start';
  858. btnClick.value = false;
  859. deviceControlApi(data)
  860. .then(() => {
  861. if (globalConfig.History_Type == 'remote') {
  862. message.success('指令已下发至生产管控平台成功!');
  863. } else {
  864. message.success('指令已下发成功!');
  865. }
  866. modalTitle.value = '';
  867. modalIsShow.value = true;
  868. btnClick.value = true;
  869. })
  870. .catch((err) => {
  871. modalIsShow.value = true;
  872. });
  873. } else if (mainWindIsShow2.value === 'open' && mainWindIsShow1.value === 'stop') {
  874. // playSmoke(handType, 'down', frequency, 'open');
  875. data.paramcode = 'CtrlFan2Start';
  876. btnClick.value = false;
  877. deviceControlApi(data)
  878. .then(() => {
  879. if (globalConfig.History_Type == 'remote') {
  880. message.success('指令已下发至生产管控平台成功!');
  881. } else {
  882. message.success('指令已下发成功!');
  883. }
  884. btnClick.value = true;
  885. modalTitle.value = '';
  886. modalIsShow.value = false;
  887. })
  888. .catch((err) => {
  889. btnClick.value = true;
  890. });
  891. } else if (mainWindIsShow1.value === 'stop' && mainWindIsShow2.value === 'stop') {
  892. // playSmoke(handType, '', frequency, 'stop');
  893. }
  894. } else if (handType === 'Fan1Frequency' || handType === 'Fan2Frequency' || handType === 'FanFrequency') {
  895. // 调频
  896. if (handType === 'Fan1Frequency') {
  897. data.paramcode = 'Fan1FreqHz';
  898. data.value = fan1FrequencyVal.value;
  899. } else if (handType === 'Fan2Frequency') {
  900. data.paramcode = 'Fan2FreqHz';
  901. data.value = fan2FrequencyVal.value;
  902. } else if (handType === 'FanFrequency') {
  903. data.paramcode = 'FreqHz_merge';
  904. data.value = fan1FrequencyVal.value;
  905. }
  906. btnClick.value = false;
  907. deviceControlApi(data)
  908. .then((res) => {
  909. if (globalConfig.History_Type == 'remote') {
  910. message.success('指令已下发至生产管控平台成功!');
  911. } else {
  912. message.success('指令已下发成功!');
  913. }
  914. modalTitle.value = '';
  915. modalIsShow.value = false;
  916. btnClick.value = true;
  917. })
  918. .catch((err) => {
  919. btnClick.value = true;
  920. });
  921. } else if (handType === 'changeSmoke') {
  922. if (selectData['Fan1StartStatus'] == '0' || !selectData['Fan1StartStatus']) {
  923. data.paramcode = 'CtrlFan1Start';
  924. btnClick.value = false;
  925. deviceControlApi(data)
  926. .then((res) => {
  927. if (globalConfig.History_Type == 'remote') {
  928. message.success('指令已下发至生产管控平台成功!');
  929. } else {
  930. message.success('指令已下发成功!');
  931. }
  932. modalTitle.value = '';
  933. modalIsShow.value = false;
  934. mainWindIsShow1.value = 'stop';
  935. mainWindIsShow2.value = 'open';
  936. btnClick.value = true;
  937. })
  938. .catch((err) => {
  939. btnClick.value = true;
  940. });
  941. } else if (selectData['Fan2StartStatus'] == '0' || !selectData['Fan2StartStatus']) {
  942. data.paramcode = 'CtrlFan2Start';
  943. btnClick.value = false;
  944. deviceControlApi(data)
  945. .then((res) => {
  946. if (globalConfig.History_Type == 'remote') {
  947. message.success('指令已下发至生产管控平台成功!');
  948. } else {
  949. message.success('指令已下发成功!');
  950. }
  951. modalTitle.value = '';
  952. modalIsShow.value = false;
  953. mainWindIsShow1.value = 'open';
  954. mainWindIsShow2.value = 'stop';
  955. btnClick.value = true;
  956. })
  957. .catch((err) => {
  958. btnClick.value = true;
  959. });
  960. }
  961. // // 一键倒机
  962. // if (mainWindIsShow1.value === 'open' && mainWindIsShow2.value === 'stop') {
  963. // // playSmoke('startSmoke', 'down', frequency, 'open');
  964. // data.paramcode = 'CtrlFan2Start';
  965. // deviceControlApi(data).then((res) => {
  966. // console.log('设备操作结果', res);
  967. // modalTitle.value = '';
  968. // modalIsShow.value = false;
  969. // }).catch((err) => {
  970. // });
  971. // mainWindIsShow1.value = 'stop';
  972. // mainWindIsShow2.value = 'open';
  973. // } else if (mainWindIsShow2.value === 'open' && mainWindIsShow1.value === 'stop') {
  974. // // playSmoke('startSmoke', 'top', frequency, 'open');
  975. // data.paramcode = 'CtrlFan1Start';
  976. // deviceControlApi(data).then((res) => {
  977. // console.log('设备操作结果', res);
  978. // modalTitle.value = '';
  979. // modalIsShow.value = false;
  980. // }).catch((err) => {
  981. // });
  982. // mainWindIsShow1.value = 'open';
  983. // mainWindIsShow2.value = 'stop';
  984. // } else if (mainWindIsShow1.value === 'stop' && mainWindIsShow2.value === 'stop') {
  985. // // playSmoke(handType, '', frequency, 'stop');
  986. // }
  987. } else if (handType === 'changeFan') {
  988. data.paramcode = 'CtrlFanStart';
  989. btnClick.value = false;
  990. deviceControlApi(data)
  991. .then((res) => {
  992. if (globalConfig.History_Type == 'remote') {
  993. message.success('指令已下发至生产管控平台成功!');
  994. } else {
  995. message.success('指令已下发成功!');
  996. }
  997. modalTitle.value = '';
  998. modalIsShow.value = false;
  999. btnClick.value = true;
  1000. })
  1001. .catch((err) => {
  1002. btnClick.value = true;
  1003. });
  1004. } else if (handType === 'fan1ToFan2') {
  1005. data.paramcode = 'CtrlFan1ToFan2';
  1006. deviceControlApi(data).then(() => {
  1007. if (globalConfig.History_Type == 'remote') {
  1008. message.success('指令已下发至生产管控平台成功!');
  1009. } else {
  1010. message.success('指令已下发成功!');
  1011. }
  1012. modalTitle.value = '';
  1013. modalIsShow.value = false;
  1014. btnClick.value = true;
  1015. });
  1016. } else if (handType === 'fan2ToFan1') {
  1017. data.paramcode = 'CtrlFan2ToFan1';
  1018. deviceControlApi(data).then(() => {
  1019. if (globalConfig.History_Type == 'remote') {
  1020. message.success('指令已下发至生产管控平台成功!');
  1021. } else {
  1022. message.success('指令已下发成功!');
  1023. }
  1024. modalTitle.value = '';
  1025. modalIsShow.value = false;
  1026. btnClick.value = true;
  1027. });
  1028. }
  1029. }
  1030. function handleChangeSensor(value: string) {
  1031. console.log(value);
  1032. }
  1033. function addPlayVideo() {
  1034. if (player1.value && player1.value.play) {
  1035. if (!player1.value.paused()) player1.value.play();
  1036. document.body.removeEventListener('mousedown', addPlayVideo);
  1037. }
  1038. }
  1039. function deviceEdit(e: Event, type: string, record) {
  1040. e.stopPropagation();
  1041. openModal(true, {
  1042. type,
  1043. deviceId: record['deviceID'],
  1044. });
  1045. }
  1046. onBeforeMount(() => {
  1047. getDeviceBaseList();
  1048. });
  1049. onMounted(() => {
  1050. const { query } = unref(currentRoute);
  1051. if (query['deviceType']) devicekide.value = query['deviceType'] as string;
  1052. mountedThree(player1.value).then(async () => {
  1053. await getMonitor(true);
  1054. nextTick(async () => {
  1055. addCssText();
  1056. });
  1057. });
  1058. document.body.addEventListener('mousedown', addPlayVideo, false);
  1059. });
  1060. onUnmounted(() => {
  1061. destroy();
  1062. removeCamera();
  1063. if (timer) {
  1064. clearTimeout(timer);
  1065. timer = undefined;
  1066. }
  1067. });
  1068. </script>
  1069. <style scoped lang="less">
  1070. @import '/@/design/vent/modal.less';
  1071. :deep(.@{ventSpace}-tabs-tabpane-active) {
  1072. height: 100%;
  1073. }
  1074. .scene-box {
  1075. .title-text {
  1076. height: 32px;
  1077. }
  1078. .bottom-tabs-box {
  1079. height: 280px;
  1080. .tabs-box {
  1081. position: relative !important;
  1082. }
  1083. }
  1084. }
  1085. .data-show-box {
  1086. position: relative;
  1087. display: flex;
  1088. flex-direction: row;
  1089. justify-content: space-between;
  1090. padding: 10px 5px;
  1091. color: #ffffff;
  1092. z-index: 999;
  1093. top: 60px;
  1094. .data-item {
  1095. pointer-events: auto;
  1096. .item-header {
  1097. width: 374px;
  1098. background: url('/@/assets/images/vent/lr-top-bg.png') no-repeat;
  1099. background-size: auto;
  1100. height: 32px;
  1101. text-align: center;
  1102. line-height: 34px;
  1103. font-size: 15px;
  1104. font-weight: 600;
  1105. color: #fafafa;
  1106. }
  1107. .item-container {
  1108. width: 346px;
  1109. margin: 0 14px;
  1110. padding: 10px;
  1111. background: #00377c33;
  1112. backdrop-filter: blur(2px);
  1113. .tab {
  1114. width: 323px;
  1115. background: url('/@/assets/images/vent/lr-tab-bg.png') no-repeat;
  1116. display: flex;
  1117. .tab-item {
  1118. flex: 1;
  1119. text-align: center;
  1120. padding-top: 2px;
  1121. color: #ffffff99;
  1122. cursor: pointer;
  1123. }
  1124. .tab-item-active-l {
  1125. color: #00ffea;
  1126. background-image: url('/@/assets/images/vent/l-tab-active.png');
  1127. background-repeat: no-repeat;
  1128. background-size: auto;
  1129. background-position: 6px 3px;
  1130. }
  1131. .tab-item-active-r {
  1132. color: #00ffea;
  1133. background-image: url('/@/assets/images/vent/r-tab-active.png');
  1134. background-repeat: no-repeat;
  1135. background-position: 0 3px;
  1136. }
  1137. }
  1138. .container-group {
  1139. width: 314px;
  1140. margin: 0px 4px;
  1141. padding: 10px 0;
  1142. min-height: 432px;
  1143. background: linear-gradient(to right, #00deff22, #2081ff05);
  1144. max-height: 440px;
  1145. overflow-y: auto;
  1146. }
  1147. .container-item {
  1148. width: 100%;
  1149. height: 60px;
  1150. display: flex;
  1151. padding: 10px 0 0 20px;
  1152. margin-bottom: 5px;
  1153. position: relative;
  1154. background: url('/@/assets/images/vent/plane-bottom.png') no-repeat;
  1155. background-size: auto;
  1156. background-position: bottom;
  1157. &::before {
  1158. content: '';
  1159. display: block;
  1160. width: 100%;
  1161. height: 5px;
  1162. position: absolute;
  1163. top: 62px;
  1164. left: 0;
  1165. background-color: #73f4ff66;
  1166. backdrop-filter: blur(5px);
  1167. }
  1168. .item-icon {
  1169. width: 54px;
  1170. height: 45px;
  1171. background: url('/@/assets/images/vent/plane-icon-bg.png') no-repeat;
  1172. background-size: cover;
  1173. .icon-style {
  1174. font-size: 18px;
  1175. margin: 10px 0 0 20px;
  1176. color: #ffc800;
  1177. }
  1178. }
  1179. .item-name {
  1180. width: 180px;
  1181. line-height: 60px;
  1182. }
  1183. .item-value {
  1184. position: relative;
  1185. height: 26px;
  1186. line-height: 24px;
  1187. margin: 15px 0;
  1188. text-align: center;
  1189. width: 80px;
  1190. border: 1px solid #00f5fe;
  1191. border-radius: 13px;
  1192. background: linear-gradient(to right, #00f5fe44, #0090ff44);
  1193. &::before {
  1194. width: 6px;
  1195. height: 6px;
  1196. content: '';
  1197. position: absolute;
  1198. left: -3px;
  1199. top: 8px;
  1200. background: #ffa500;
  1201. border-radius: 3px;
  1202. }
  1203. }
  1204. }
  1205. .warning-header {
  1206. display: flex;
  1207. font-size: 14px;
  1208. .header-item {
  1209. flex: 1;
  1210. display: flex;
  1211. flex-direction: column;
  1212. margin: 5px 10px;
  1213. justify-content: center;
  1214. align-items: center;
  1215. .header-title {
  1216. color: #39e7fe;
  1217. }
  1218. .header-value {
  1219. width: 133px;
  1220. height: 56px;
  1221. font-weight: 600;
  1222. font-family: 'douyuFont';
  1223. font-size: 16px;
  1224. color: #ffa500;
  1225. display: flex;
  1226. justify-content: center;
  1227. align-items: center;
  1228. background: url('/@/assets/images/vent/count-header-bg.png') no-repeat;
  1229. }
  1230. }
  1231. }
  1232. .warning-group {
  1233. padding: 0 10px;
  1234. position: relative;
  1235. // &::before {
  1236. // content: '';
  1237. // display: block;
  1238. // width: 1px;
  1239. // height: 100%;
  1240. // position: absolute;
  1241. // left: 12px;
  1242. // background-color: #00f5fe;
  1243. // }
  1244. .warning-item {
  1245. display: flex;
  1246. flex-direction: row;
  1247. justify-content: space-between;
  1248. align-items: center;
  1249. height: 38px;
  1250. .item-name {
  1251. .icon {
  1252. width: 6px;
  1253. height: 6px;
  1254. display: inline-block;
  1255. background-color: #1cd5ff;
  1256. border-radius: 3px;
  1257. position: relative;
  1258. margin-right: 5px;
  1259. &::before {
  1260. content: '';
  1261. width: 10px;
  1262. height: 10px;
  1263. display: block;
  1264. border: 1px solid #34edff99;
  1265. border-radius: 5px;
  1266. position: absolute;
  1267. top: -2px;
  1268. left: -2px;
  1269. }
  1270. }
  1271. }
  1272. }
  1273. }
  1274. }
  1275. }
  1276. }
  1277. .input-box {
  1278. display: flex;
  1279. align-items: center;
  1280. .input-title {
  1281. color: #73e8fe;
  1282. width: auto;
  1283. }
  1284. margin-right: 10px;
  1285. }
  1286. .label {
  1287. max-width: 220px;
  1288. }
  1289. #fanLocalSelectDom {
  1290. :deep(.@{ventSpace}-select-dropdown) {
  1291. left: 0px !important;
  1292. top: 35px !important;
  1293. }
  1294. }
  1295. .@{ventSpace}-input {
  1296. width: 150px;
  1297. }
  1298. :deep(#LivePlayerBox) {
  1299. display: flex;
  1300. flex-direction: row;
  1301. justify-content: flex-end;
  1302. padding-right: 380px;
  1303. pointer-events: none;
  1304. .video-parent {
  1305. height: 208px;
  1306. pointer-events: auto !important;
  1307. }
  1308. }
  1309. </style>