index.vue 72 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993
  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="inputBox0">
  8. <div class="elementContent" v-if="selectData.windInputSpeed1 || selectData.windInputSpeed_merge">
  9. <p v-if="selectData.windInputSpeed1 || selectData.windInputSpeed_merge"
  10. >局扇工作面风速:<span class="value">{{
  11. selectData.windInputSpeed1 ? selectData.windInputSpeed1 : selectData.windInputSpeed_merge ? selectData.windInputSpeed_merge : '-'
  12. }}</span>
  13. <span class="unit"> m/s</span>
  14. </p>
  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>
  20. </p>
  21. </div>
  22. </div>
  23. <div class="elementTag" id="inputBox1">
  24. <div class="elementContent" v-if="selectData.windSpeed1 || selectData.gas3 || selectData.windQuantity1 || selectData.inletAirVolume_merge">
  25. <p v-if="selectData.windSpeed1"
  26. >风筒入口风速:<span class="value">{{ selectData.windSpeed1 ? selectData.windSpeed1 : '-' }}</span> <span class="unit"> m/s</span></p
  27. >
  28. <p v-if="selectData.windQuantity1 || selectData.inletAirVolume_merge"
  29. >风筒入口风量:<span class="value">{{
  30. selectData.windQuantity1 ? selectData.windQuantity1 : selectData.inletAirVolume_merge ? selectData.inletAirVolume_merge : '-'
  31. }}</span>
  32. <span class="unit"> m³/min</span>
  33. </p>
  34. <p v-if="selectData.gas3"
  35. >风筒入口瓦斯浓度: <span class="value">{{ selectData.gas3 ? selectData.gas3 : '-' }}</span> <span class="unit"> %</span></p
  36. >
  37. </div>
  38. </div>
  39. <div class="elementTag" id="outBox">
  40. <div
  41. class="elementContent elementContent-r"
  42. v-if="
  43. selectData.windQuantity2 ||
  44. selectData.gas1 ||
  45. (selectData.windOutSpeed1 && selectData.windOutSpeed_merge) ||
  46. selectData.ductOutletAirVolume_merge
  47. "
  48. >
  49. <p v-if="selectData.windQuantity2 || selectData.m3 || selectData.ductOutletAirVolume_merge || selectData.windOutSpeed_merge">
  50. 迎头供风量:<span class="value">{{
  51. selectData.windQuantity2
  52. ? selectData.windQuantity2
  53. : selectData.m3
  54. ? selectData.m3
  55. : selectData.ductOutletAirVolume_merge
  56. ? selectData.ductOutletAirVolume_merge
  57. : '-'
  58. }}</span>
  59. <span class="unit"> m³/min</span>
  60. </p>
  61. <p v-if="selectData.gas1"
  62. >迎头瓦斯浓度:<span class="value">{{ selectData.gas1 ? selectData.gas1 : '-' }}</span> <span class="unit"> %</span></p
  63. >
  64. <p v-if="selectData.windOutSpeed1 || selectData.windOutSpeed_merge"
  65. >风筒出口风速<span class="value">{{
  66. selectData.windOutSpeed1 ? selectData.windOutSpeed1 : selectData.windOutSpeed_merge ? selectData.windOutSpeed_merge : '-'
  67. }}</span>
  68. <span class="unit"> %</span>
  69. </p>
  70. </div>
  71. </div>
  72. <div class="elementTag" id="returnBox">
  73. <div class="elementContent elementContent-r" v-if="selectData.gas2">
  74. <p v-if="selectData.gas2"
  75. >回风流瓦斯浓度:<span class="value">{{ selectData.gas2 ? selectData.gas2 : '-' }}</span> <span class="unit"> %</span></p
  76. >
  77. </div>
  78. </div>
  79. <div class="elementTag" id="gateBox" v-if="modalType == 'fm'">
  80. <div class="elementContent">
  81. <p>风门状态:关</p>
  82. <p>风门过风面积:{{ selectData.gas1 ? selectData.gas1 : '-' }}</p>
  83. </div>
  84. </div>
  85. <div class="elementTag" id="windownBox">
  86. <div class="elementContent" v-if="modalType == 'fc'">
  87. <p style="pointer-events: auto"
  88. ><a class="action-link" @click="goDetailDevice('window_fWindowM3')">风窗详情</a>
  89. <ArrowRightOutlined :style="{ color: '#157DC8' }" />
  90. </p>
  91. <p v-if="selectData.windSpeed"
  92. >风窗风流风速:<span class="value">{{ selectData.windSpeed ? selectData.windSpeed : '-' }}</span> <span class="unit"> m/s</span></p
  93. >
  94. <p v-if="selectData.fWindowM3"
  95. >风窗过风量:<span class="value">{{ selectData.fWindowM3 ? selectData.fWindowM3 : '-' }}</span> <span class="unit"> m³/min</span></p
  96. >
  97. <p v-if="selectData.OpenDegree"
  98. >风窗开度值:<span class="value">{{ selectData.OpenDegree ? selectData.OpenDegree : '-' }}</span> <span class="unit"> %</span></p
  99. >
  100. <p v-if="selectData.OpenDegree"
  101. >风窗过风面积:<span class="value">{{ selectData.forntArea ? selectData.forntArea : '-' }}</span> <span class="unit"> ㎡</span></p
  102. >
  103. </div>
  104. </div>
  105. <div class="elementTag" id="gasBox3">
  106. <div class="elementContent" v-if="selectData.gasT3">
  107. <!-- <div class="elementContent"> -->
  108. <p v-if="selectData.gasT3"
  109. >掘进工作面进风流处甲烷传感器T₃:<span class="value">{{ selectData.gasT3 ? selectData.gasT3 : '-' }}</span>
  110. <span class="unit">(%)</span></p
  111. >
  112. </div>
  113. </div>
  114. <div class="elementTag" id="gasBox2">
  115. <div class="elementContent" v-if="selectData.gasT2">
  116. <!-- <div class="elementContent"> -->
  117. <p v-if="selectData.gasT2"
  118. >掘进工作面回风流处甲烷传感器T₂:<span class="value">{{ selectData.gasT2 ? selectData.gasT2 : '-' }}</span>
  119. <span class="unit">(%)</span></p
  120. >
  121. </div>
  122. </div>
  123. <div class="elementTag" id="gasBox1">
  124. <div class="elementContent" v-if="selectData.gasT1">
  125. <!-- <div class="elementContent"> -->
  126. <p v-if="selectData.gasT1"
  127. >掘进工作面混合风流处甲烷传感器T₁:<span class="value">{{ selectData.gasT1 ? selectData.gasT1 : '-' }}</span>
  128. <span class="unit">(%)</span></p
  129. >
  130. </div>
  131. </div>
  132. </div>
  133. </div>
  134. </div>
  135. <div class="scene-box">
  136. <div class="top-box" v-if="!loading">
  137. <div class="top-center row">
  138. <div class="vent-flex-row" id="fanLocalSelectDom" v-if="!globalConfig?.simulatedPassword && getDictItemsByCode('fanlocaltype')">
  139. <span style="color: var(--vent-font-color); margin-left: 5px">风机类型:</span>
  140. <JDictSelectTag
  141. style="width: 180px"
  142. v-model:value="devicekide"
  143. dictCode="fanlocaltype"
  144. :showChooseOption="false"
  145. :getPopupContainer="getPopupContainer"
  146. @change="changeDeviceKind"
  147. />
  148. </div>
  149. <!-- fanlocal_systeml_zj 模拟局部风机,不显示操作按钮 -->
  150. <template v-for="(item, index) in modalTypeArr.leftBtnArr" :key="index">
  151. <template v-if="hasPermission(item.permission)">
  152. <template v-if="item.permission === 'btn:frequency' || item.permission === 'btn:frequencyMerge'">
  153. <div
  154. v-if="devicekide == 'fanlocal' && item.permission === 'btn:frequency'"
  155. :class="{ 'button-box': btnClick, 'button-disable': !btnClick }"
  156. @click="showModal(item)"
  157. >{{ item.value }}
  158. </div>
  159. <div
  160. v-else-if="devicekide == 'fanlocaldp' && item.permission === 'btn:frequencyMerge'"
  161. :class="{ 'button-box': btnClick, 'button-disable': !btnClick }"
  162. @click="showModal(item)"
  163. >{{ item.value }}
  164. </div>
  165. </template>
  166. <template v-else>
  167. <div :class="{ 'button-box': btnClick, 'button-disable': !btnClick }" @click="showModal(item)">{{ item.value }} </div>
  168. </template>
  169. </template>
  170. </template>
  171. </div>
  172. <div class="top-right row">
  173. <template v-for="(item, index) in modalTypeArr.rightBtnArr" :key="index">
  174. <div
  175. v-if="
  176. (item.permission === 'fanLocal:gasAlarmSet' ||
  177. item.permission === 'fanLocal:kkjc' ||
  178. item.permission === 'fanLocal:supplyAir' ||
  179. item.permission === 'fanLocal:dischargeGas') &&
  180. hasPermission(item.permission)
  181. "
  182. :class="{ 'button-box': btnClick, 'button-disable': !btnClick }"
  183. @click="showModal(item)"
  184. >{{ item.value }}</div
  185. >
  186. </template>
  187. </div>
  188. </div>
  189. <div class="title-text">
  190. {{ selectData.supplyAirAddr || selectData.strinstallpos || selectData.stationname }}
  191. </div>
  192. <div class="data-show-box" v-if="!loading">
  193. <div class="data-item" v-if="leftColumns.length > 0">
  194. <div class="item-header">环境监测与评价分析</div>
  195. <div class="item-container">
  196. <div class="tab">
  197. <div class="tab-item" :class="{ 'tab-item-active-r': warningMonitorRowIndex === 0 }" @click="selectDevice('warningMonitorRowIndex', 0)"
  198. >主机</div
  199. >
  200. <div class="tab-item" :class="{ 'tab-item-active-r': warningMonitorRowIndex === 1 }" @click="selectDevice('warningMonitorRowIndex', 1)"
  201. >备机</div
  202. >
  203. </div>
  204. <div class="container-group container-group-l">
  205. <div class="warning-group" style="max-height: 200px; overflow-y: auto">
  206. <template v-if="selectData.deviceType">
  207. <div class="container-item" v-for="(data, index) in leftColumns" :key="index">
  208. <div class="item-icon">
  209. <!-- <SvgIcon class="icon-style" size="18" name="temperature" /> -->
  210. <CaretRightOutlined class="icon-style" />
  211. </div>
  212. <div class="item-name">{{ data.title }}</div>
  213. <div v-if="data.dataIndex.startsWith('Fan')">
  214. <div class="item-value" v-if="warningMonitorRowIndex == 0">{{
  215. selectData[data.dataIndex.replace('Fan', 'Fan1')] ? selectData[data.dataIndex.replace('Fan', 'Fan1')] : '-'
  216. }}</div>
  217. <div class="item-value" v-if="warningMonitorRowIndex == 1">{{
  218. selectData[data.dataIndex.replace('Fan', 'Fan2')] ? selectData[data.dataIndex.replace('Fan', 'Fan2')] : '-'
  219. }}</div>
  220. </div>
  221. <div v-else>
  222. <div class="item-value">{{ selectData[data.dataIndex] ? selectData[data.dataIndex] : '-' }}</div>
  223. </div>
  224. </div>
  225. </template>
  226. </div>
  227. </div>
  228. <div class="container-group" style="max-height: 250px; overflow-y: auto">
  229. <div class="warning-header">
  230. <div class="header-item">
  231. <div class="header-title">评价分析</div>
  232. </div>
  233. </div>
  234. <template v-if="selectData.deviceType">
  235. <div class="container-item" v-for="(data, index) in leftColumns1" :key="index">
  236. <div class="item-icon">
  237. <!-- <SvgIcon class="icon-style" size="18" name="temperature" /> -->
  238. <CaretRightOutlined class="icon-style" />
  239. </div>
  240. <div class="item-name">{{ data.title }}</div>
  241. <div :class="['item-value', { 'text-red-bold': data.value === '超限' }]">{{ data.value ? data.value : '-' }}</div>
  242. </div>
  243. </template>
  244. </div>
  245. </div>
  246. </div>
  247. <div>
  248. <div class="data-item" v-if="rightColumns.length > 0">
  249. <div class="item-header">设备故障诊断与预警</div>
  250. <div class="item-container">
  251. <div class="tab">
  252. <div class="tab-item" :class="{ 'tab-item-active-r': dataMonitorRowIndex == 0 }" @click="selectDevice('dataMonitorRowIndex', 0)"
  253. >主机</div
  254. >
  255. <div class="tab-item" :class="{ 'tab-item-active-r': dataMonitorRowIndex == 1 }" @click="selectDevice('dataMonitorRowIndex', 1)"
  256. >备机</div
  257. >
  258. </div>
  259. <div class="container-group container-group-l">
  260. <div class="warning-group" style="max-height: 200px; overflow-y: auto">
  261. <template v-if="deviceType">
  262. <div v-for="(state, index) in rightColumns" :key="index">
  263. <template v-if="!state.dataIndex.endsWith('_w')">
  264. <div class="container-item">
  265. <div class="item-icon">
  266. <CaretRightOutlined class="icon-style" />
  267. </div>
  268. <div class="item-name">{{ state.title }}</div>
  269. <div v-if="state.dataIndex.startsWith('Fan')">
  270. <div class="item-value" v-if="dataMonitorRowIndex == 0">{{
  271. selectData[state.dataIndex.replace('Fan', 'Fan1')] ? selectData[state.dataIndex.replace('Fan', 'Fan1')] : '-'
  272. }}</div>
  273. <div class="item-value" v-if="dataMonitorRowIndex == 1">{{
  274. selectData[state.dataIndex.replace('Fan', 'Fan2')] ? selectData[state.dataIndex.replace('Fan', 'Fan2')] : '-'
  275. }}</div>
  276. </div>
  277. <div v-else>
  278. <div class="item-value">{{ selectData[state.dataIndex] ? selectData[state.dataIndex] : '-' }} </div>
  279. </div>
  280. </div>
  281. </template>
  282. </div>
  283. </template>
  284. </div>
  285. <div class="warning-group" style="max-height: 250px; overflow-y: auto">
  286. <div class="warning-header">
  287. <div class="header-item">
  288. <div class="header-title">设备报警</div>
  289. <!-- <div class="header-value">{{ selectData['warnLogNotOkCount'] }} </div> -->
  290. </div>
  291. </div>
  292. <template v-if="deviceType">
  293. <div style="height: 100%; text-align: center; color: #fff" v-if="rightColumns.length < 1"> 暂无数据 </div>
  294. <div v-else>
  295. <div v-for="(state, index) in rightColumns" :key="index">
  296. <template v-if="state.dataIndex.endsWith('_w')">
  297. <div class="warning-item">
  298. <div class="item-name"> <div class="icon"></div> {{ state.title }} </div>
  299. <div v-if="state.dataIndex.startsWith('Fan')">
  300. <div class="signal-item" v-if="warningMonitorRowIndex == 0">
  301. <div
  302. class="signal-round"
  303. :class="{
  304. 'signal-round-run': selectData[state.dataIndex.replace('Fan', 'Fan1')] == '0',
  305. 'signal-round-warning':
  306. selectData[state.dataIndex.replace('Fan', 'Fan1')] !== undefined &&
  307. selectData[state.dataIndex.replace('Fan', 'Fan1')] == '1',
  308. 'signal-round-gry': selectData[state.dataIndex.replace('Fan', 'Fan1')] === undefined,
  309. }"
  310. ></div>
  311. <div class="vent-margin-l-8">{{
  312. selectData[state.dataIndex.replace('Fan', 'Fan1')] === undefined
  313. ? '无状态'
  314. : selectData[state.dataIndex.replace('Fan', 'Fan1')] == '0'
  315. ? '正常'
  316. : '异常'
  317. }}</div>
  318. </div>
  319. <div class="signal-item" v-if="warningMonitorRowIndex == 1">
  320. <div
  321. class="signal-round"
  322. :class="{
  323. 'signal-round-run': selectData[state.dataIndex.replace('Fan', 'Fan2')] == '0',
  324. 'signal-round-warning':
  325. selectData[state.dataIndex.replace('Fan', 'Fan2')] != undefined &&
  326. selectData[state.dataIndex.replace('Fan', 'Fan2')] == '1',
  327. 'signal-round-gry': selectData[state.dataIndex.replace('Fan', 'Fan2')] == undefined,
  328. }"
  329. ></div>
  330. <div class="vent-margin-l-8">{{
  331. selectData[state.dataIndex.replace('Fan', 'Fan2')] == undefined
  332. ? '无状态'
  333. : selectData[state.dataIndex.replace('Fan', 'Fan2')] == '0'
  334. ? '正常'
  335. : '异常'
  336. }}</div>
  337. </div>
  338. </div>
  339. <div v-else>
  340. <div class="signal-item">
  341. <div
  342. class="signal-round vent-margin-l-8"
  343. :class="{
  344. 'signal-round-run': selectData[state.dataIndex] == '0',
  345. 'signal-round-warning': selectData[state.dataIndex] !== undefined && selectData[state.dataIndex] == '1',
  346. 'signal-round-gry': selectData[state.dataIndex] === undefined,
  347. }"
  348. ></div>
  349. <div class="vent-margin-l-8">{{
  350. selectData[state.dataIndex] === undefined ? '无状态' : selectData[state.dataIndex] == '0' ? '正常' : '异常'
  351. }}</div>
  352. </div>
  353. </div>
  354. </div>
  355. </template>
  356. </div>
  357. </div>
  358. </template>
  359. </div>
  360. </div>
  361. </div>
  362. </div>
  363. </div>
  364. </div>
  365. <div class="bottom-tabs-box" @mousedown="setDivHeight($event, 175, scroll, 0)">
  366. <dv-border-box8 :dur="5" class="dv_border_8" :style="`bottom: 20px; padding: 5px; height: ${scroll.y + 140}px`">
  367. <!-- <div class="enter-detail" @click="goDetail()">
  368. <send-outlined class=""/>风机运行详情
  369. </div> -->
  370. <a-tabs class="tabs-box" v-model:activeKey="activeKey" @change="tabChange">
  371. <a-tab-pane key="1" tab="实时监测">
  372. <GroupMonitorTable
  373. v-if="activeKey === '1'"
  374. ref="MonitorDataTable"
  375. :dataSource="dataSource"
  376. :columnsType="`${selectData.deviceType}_monitor`"
  377. @selectRow="getSelectRow"
  378. :scroll="scroll"
  379. :is-action="true"
  380. >
  381. <template #action="{ record }">
  382. <a v-if="globalConfig?.showReport" class="table-action-link" @click="deviceEdit($event, 'reportInfo', record)">报表录入</a>
  383. <a class="table-action-link" @click="deviceEdit($event, 'deviceInfo', record)">设备编辑</a>
  384. </template>
  385. </GroupMonitorTable>
  386. </a-tab-pane>
  387. <a-tab-pane key="3" tab="历史数据">
  388. <div class="tab-item" v-if="activeKey === '3'">
  389. <template v-if="globalConfig.History_Type == 'remote'">
  390. <HistoryTable
  391. :columns-type="`${selectData.deviceType}`"
  392. :device-type="`${devicekide}`"
  393. designScope="fanlocal-history"
  394. :scroll="scroll"
  395. />
  396. </template>
  397. <template v-else>
  398. <HistoryTable class="w-100% h-100%" :device-code="`${devicekide}`" :scroll="scroll" dict-code="fanlocal_dict" />
  399. </template>
  400. </div>
  401. </a-tab-pane>
  402. <a-tab-pane key="7" v-if="hasPermission('show:deviceEcharts')" tab="监测曲线图" force-render>
  403. <div class="tab-item" v-if="activeKey === '7'">
  404. <FanDeviceEcharts
  405. chartsColumnsType="fanlocal_chart"
  406. xAxisPropType="strname"
  407. :dataSource="dataSource"
  408. height="100%"
  409. width="100%"
  410. :fan1ChartsColumns="chartsColumnsFan1"
  411. :fan2ChartsColumns="chartsColumnsFan2"
  412. :device-list-api="list.bind(null, { devicetype: 'fanlocal', pagetype: 'normal' })"
  413. device-type="fanlocal"
  414. />
  415. </div>
  416. </a-tab-pane>
  417. <a-tab-pane key="4" tab="报警历史">
  418. <div class="tab-item" v-if="activeKey === '4'">
  419. <AlarmHistoryTable columns-type="alarm" :device-type="`${devicekide}`" designScope="alarm-history" :scroll="scroll" />
  420. </div>
  421. </a-tab-pane>
  422. <a-tab-pane key="5" tab="操作历史">
  423. <div class="tab-item" v-if="activeKey === '5'">
  424. <HandlerHistoryTable
  425. columns-type="operator_history"
  426. :device-type="`${devicekide}`"
  427. :device-list-api="baseList"
  428. designScope="alarm-history"
  429. :scroll="scroll"
  430. />
  431. </div>
  432. </a-tab-pane>
  433. <a-tab-pane key="6" tab="风机曲线" v-if="hasPermission('show:fanEcharts')">
  434. <div v-if="activeKey == '6'" class="tab-item" style="display: flex">
  435. <div style="width: calc(50% - 20px); height: 100%">
  436. <div style="color: var(--vent-font-color); width: 100%; text-align: center; margin: 5px 0px">主机</div>
  437. <BarAndLine
  438. class="echarts-line"
  439. xAxisPropType="readTime"
  440. :dataSource="echartsDataList"
  441. height="90%"
  442. width="100%"
  443. :chartsColumns="chartsColumnsFan1"
  444. :option="echatsOption"
  445. chartsType="detail"
  446. />
  447. </div>
  448. <div style="width: calc(50% - 20px); height: 100%">
  449. <div style="color: var(--vent-font-color); width: 100%; text-align: center; margin: 5px 0px">备机</div>
  450. <BarAndLine
  451. class="echarts-line"
  452. xAxisPropType="readTime"
  453. :dataSource="echartsDataList"
  454. height="90%"
  455. width="100%"
  456. :chartsColumns="chartsColumnsFan2"
  457. :option="echatsOption"
  458. chartsType="detail"
  459. />
  460. </div>
  461. </div>
  462. </a-tab-pane>
  463. <a-tab-pane key="2" tab="风量实时曲线图" force-render v-if="hasPermission('echart:show')">
  464. <div class="tab-item" style="height: 100%; padding-top: 15px">
  465. <BarAndLine
  466. v-if="activeKey == '2'"
  467. class="echarts-line"
  468. xAxisPropType="time"
  469. :dataSource="historyList"
  470. height="100%"
  471. width="100%"
  472. :chartsColumns="chartsColumnsZDKZ"
  473. :option="echatsOption"
  474. />
  475. </div>
  476. </a-tab-pane>
  477. </a-tabs>
  478. <a-button
  479. v-if="hasPermission('btn:reportDown')"
  480. type="primary"
  481. size="small"
  482. preIcon="ant-design:download-outlined"
  483. style="position: absolute; right: 15px; top: 10px"
  484. @click="reportDown"
  485. >
  486. 报表导出
  487. </a-button>
  488. </dv-border-box8>
  489. </div>
  490. </div>
  491. <div
  492. v-show="showPlay"
  493. ref="playerRef"
  494. :class="{ 'to-right': rightColumns.length < 1 || leftColumns.length < 1, 'to-no-right': rightColumns.length > 0 && leftColumns.length > 0 }"
  495. style="z-index: 999; position: absolute; top: 100px; right: 15px; width: 100%; height: 100%; margin: auto; pointer-events: none"
  496. >
  497. </div>
  498. <a-modal v-model:visible="modalIsShow" :title="modalTitle" :maskStyle="{ backgroundColor: '#000000aa', backdropFilter: 'blur(3px)' }">
  499. <template #footer>
  500. <div v-if="controlType != 'startFan'">
  501. <a-button key="back" @click="cancel">返回</a-button>
  502. <a-button key="submit" type="primary" :loading="loading" @click="handleOk">确定</a-button>
  503. </div>
  504. </template>
  505. <div class="modal-container">
  506. <div class="vent-flex-row">
  507. <ExclamationCircleFilled style="color: #ffb700; font-size: 30px" />
  508. <div class="warning-text">您是否要进行{{ modalTitle }}操作?</div>
  509. </div>
  510. <div class="" v-if="controlType == 'startSmoke'">
  511. <!-- 互斥控制 -->
  512. <div class="startSmoke-select">
  513. <div class="label">主机:</div>
  514. <a-radio-group v-model:value="mainWindIsShow1" @change="changeMotor" name="localWind1">
  515. <a-radio value="open">开启</a-radio>
  516. <a-radio value="stop">停止</a-radio>
  517. </a-radio-group>
  518. </div>
  519. <div class="startSmoke-select">
  520. <div class="label">备机:</div>
  521. <a-radio-group v-model:value="mainWindIsShow2" @change="changeMotor" name="localWind2">
  522. <a-radio value="open">开启</a-radio>
  523. <a-radio value="stop">停止</a-radio>
  524. </a-radio-group>
  525. </div>
  526. </div>
  527. <div class="" v-if="controlType == 'startFan'">
  528. <!-- 不互斥控制 -->
  529. <div class="startSmoke-select">
  530. <div class="label">主机:</div>
  531. <div :class="{ 'button-box': true, 'button-disable': false }" @click="handleOk('Fan1Open')">开启</div>
  532. <div :class="{ 'button-box': true, 'button-disable': false }" @click="handleOk('Fan1Stop')">停止</div>
  533. <div :class="{ 'button-box': true, 'button-disable': false }" @click="handleOk('Fan1Reset')">复位</div>
  534. </div>
  535. <div class="startSmoke-select">
  536. <div class="label">备机:</div>
  537. <div :class="{ 'button-box': true, 'button-disable': false }" @click="handleOk('Fan2Open')">开启</div>
  538. <div :class="{ 'button-box': true, 'button-disable': false }" @click="handleOk('Fan2Stop')">停止</div>
  539. <div :class="{ 'button-box': true, 'button-disable': false }" @click="handleOk('Fan2Reset')">复位</div>
  540. </div>
  541. </div>
  542. <!-- 调频 -->
  543. <div class="vent-flex-row input-box" v-if="controlType == 'Fan1Frequency'">
  544. <div class="label">主风机运行频率(Hz):</div>
  545. <a-input-number size="small" v-model:value="fan1FrequencyVal" :min="20" :max="50" :step="0.1" />
  546. </div>
  547. <div class="vent-flex-row input-box" v-if="controlType == 'Fan2Frequency'">
  548. <div class="label">备风机运行频率(Hz):</div>
  549. <a-input-number size="small" v-model:value="fan2FrequencyVal" :min="20" :max="50" :step="0.1" />
  550. </div>
  551. <div class="vent-flex-row input-box" v-if="controlType == 'FanFrequency'">
  552. <div class="label">风机运行频率(Hz):</div>
  553. <a-input-number size="small" v-model:value="fan1FrequencyVal" :min="20" :max="50" :step="0.1" />
  554. </div>
  555. <div class="vent-flex-row input-box" v-if="controlType == 'disAirAlarm'">
  556. <div class="label">漏风率(%):</div>
  557. <a-input-number size="small" v-model:value="frequencyVal" :min="0" :max="50" :step="0.1" />
  558. </div>
  559. <div class="vent-flex-row input-box" v-if="controlType == 'diameter'">
  560. <div class="label">风筒直径(m):</div>
  561. <a-input-number size="small" v-model:value="frequencyVal" :min="0" :max="50" :step="0.1" />
  562. </div>
  563. <div class="vent-flex-row input-box" v-if="controlType == 'len'">
  564. <div class="label">风筒长度(m):</div>
  565. <a-input-number size="small" v-model:value="frequencyVal" :min="0" :max="50" :step="0.1" />
  566. </div>
  567. <div class="vent-flex-row input-box" v-if="controlType == 'windPowerLimit'">
  568. <div class="label">风电闭锁限值(m³/min):</div>
  569. <a-input-number size="small" v-model:value="frequencyVal" :min="0" :max="50" :step="0.1" />
  570. </div>
  571. <div class="vent-flex-row input-box" v-if="controlType == 'gasPowerLimit'">
  572. <div class="label">瓦斯电闭锁限值(m³/min):</div>
  573. <a-input-number size="small" v-model:value="frequencyVal" :min="0" :max="50" :step="0.1" />
  574. </div>
  575. <div v-if="controlType == 'gasAlarmSet'">
  576. <div class="vent-flex-row input-box">
  577. <div class="label">设置瓦斯超限浓度:</div>
  578. <a-input-number size="small" v-model:value="gasWarningVal" :min="0" :max="1" :step="0.01" />
  579. </div>
  580. </div>
  581. <div v-if="controlType == 'gasAlarm'">
  582. <div class="vent-flex-row input-box">
  583. <div class="label">传感器名称:</div>
  584. <a-select placeholder="传感器" @change="handleChangeSensor" :options="sensorList" v-model:value="modalSensor" />
  585. </div>
  586. <div class="vent-flex-row input-box">
  587. <div class="label">传感器值:</div>
  588. <a-input-number size="small" v-model:value="frequencyVal" :min="0" :max="50" :step="0.1" />
  589. </div>
  590. </div>
  591. <div v-if="controlType == 'airVolumeAlarm'">
  592. <div class="vent-flex-row input-box">
  593. <div class="label">风量上限(m³/min):</div>
  594. <a-input-number size="small" v-model:value="modalTypeArr.rightBtnArr[3].min" :min="0" :max="50" :step="0.1" />
  595. </div>
  596. <div class="vent-flex-row input-box">
  597. <div class="label">风量下限(m³/min):</div>
  598. <a-input-number size="small" v-model:value="modalTypeArr.rightBtnArr[3].max" :min="0" :max="50" :step="0.1" />
  599. </div>
  600. </div>
  601. <div class="vent-flex-row input-box" v-if="controlType == 'zhlk'">
  602. <div class="label">目标风量(m³/min):</div>
  603. <a-input-number size="small" v-model:value="targetVolume" />
  604. </div>
  605. <div v-if="controlType == 'gasOverSet'">
  606. <div class="vent-flex-row input-box">
  607. <div class="label">设置瓦斯超限浓度:</div>
  608. <a-input-number size="small" v-model:value="gasWarningVal" :min="0" :max="1" :step="0.01" />
  609. </div>
  610. </div>
  611. <!-- 启动或停止 -->
  612. <div class="" v-if="controlType == 'startSmoke'"> </div>
  613. <div v-if="!globalConfig?.simulatedPassword" class="vent-flex-row input-box">
  614. <div class="label">操作密码:</div>
  615. <a-input size="small" type="password" v-model:value="passWord" />
  616. </div>
  617. </div>
  618. </a-modal>
  619. <!-- 摄像头显示隐藏图标 -->
  620. <VideoCameraOutlined class="video-icon" :class="{ 'no-play': !showPlay }" @click="changePlay" />
  621. <ConditionAssistance @register="registerModalAssistance" :dataSource="historySource" />
  622. <DeviceBaseInfo @register="registerModal" :device-type="selectData['deviceType']" />
  623. <reportInfo @register="registerModal1" :editID="editID" :fileType="fileType" />
  624. </template>
  625. <script setup lang="ts">
  626. import { ExclamationCircleFilled, ArrowRightOutlined, VideoCameraOutlined } from '@ant-design/icons-vue';
  627. import { onBeforeMount, ref, watch, onMounted, nextTick, defineAsyncComponent, reactive, onUnmounted, inject, unref } from 'vue';
  628. // import BarSingle from '../../../../components/chart/BarSingle.vue';
  629. import FanDeviceEcharts from '../comment/FanDeviceEcharts.vue';
  630. import BarAndLine from '../../../../components/chart/BarAndLine.vue';
  631. import GroupMonitorTable from '../comment/GroupMonitorTable.vue';
  632. import AlarmHistoryTable from '../comment/AlarmHistoryTable.vue';
  633. import HandlerHistoryTable from '../comment/HandlerHistoryTable.vue';
  634. import DeviceBaseInfo from '../comment/components/DeviceBaseInfo.vue';
  635. import { mountedThree, setModelType, destroy, addCssText, addText, playSmoke } from './fanLocal.three';
  636. import lodash from 'lodash';
  637. import { getTableList, list, autoAdjust } from '/@/views/vent/monitorManager/fanLocalMonitor/fanLocal.api';
  638. import { list as baseList } from '../../deviceManager/fanTabel/fan.api';
  639. import { echatsOption, chartsColumnsZDKZ } from './fanLocal.data';
  640. import { deviceControlApi } from '/@/api/vent/index';
  641. import { setDivHeight } from '/@/utils/event';
  642. import { BorderBox8 as DvBorderBox8 } from '@kjgl77/datav-vue3';
  643. import { getTableHeaderColumns } from '/@/hooks/web/useWebColumns';
  644. import { useRouter } from 'vue-router';
  645. import { useModal } from '/@/components/Modal';
  646. import type { BasicColumn } from '/@/components/Table/src/types/table';
  647. import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
  648. import { getPopupContainer } from '/@/utils';
  649. import { getDictItemsByCode } from '/@/utils/dict';
  650. import { message } from 'ant-design-vue';
  651. import { useCamera } from '/@/hooks/system/useCamera';
  652. import { CaretRightOutlined } from '@ant-design/icons-vue';
  653. import ConditionAssistance from './components/conditionAssistance.vue';
  654. import reportInfo from '../comment/components/reportInfo.vue';
  655. import { save, reportList } from '../../reportManager/reportManager.api';
  656. import { usePermission } from '/@/hooks/web/usePermission';
  657. import { useGlobSetting } from '/@/hooks/setting';
  658. import { useMessage } from '/@/hooks/web/useMessage';
  659. import { cloneDeep } from 'lodash-es';
  660. const globalConfig = inject('globalConfig');
  661. const HistoryTable =
  662. globalConfig.History_Type == 'remote'
  663. ? defineAsyncComponent(() => import('../comment/HistoryTable.vue'))
  664. : defineAsyncComponent(() => import('../../../vent/comment/history/HistoryTable.vue'));
  665. const { hasPermission } = usePermission();
  666. const [registerModal, { openModal, closeModal }] = useModal();
  667. const [registerModal1, { openModal: openModal1, closeModal: closeModal1 }] = useModal();
  668. const [registerModalAssistance, { openModal: openAssistance, closeModal: closeAssistance }] = useModal();
  669. const { currentRoute } = useRouter();
  670. const router = useRouter();
  671. const { createConfirm } = useMessage();
  672. const globSetting = useGlobSetting();
  673. const showPlay = ref(hasPermission('fanlocal:showCamera') ? true : false);
  674. const modalTypeArr = reactive({
  675. leftBtnArr: [
  676. {
  677. key: 'startSmoke',
  678. value: '启停风机',
  679. permission: 'btn:openclose',
  680. },
  681. {
  682. key: 'startFan',
  683. value: '启停风机',
  684. permission: 'btn:openclose1',
  685. },
  686. {
  687. key: 'changeSmoke', // 主备两个点位
  688. value: '一键倒机',
  689. permission: 'btn:change',
  690. },
  691. {
  692. key: 'changeFan', // 主备一个点位
  693. value: '一键倒机',
  694. permission: 'btn:CtrlFanChange',
  695. },
  696. {
  697. key: 'fan1ToFan2',
  698. value: '主机倒备机',
  699. permission: 'btn:ctrlFan1ToFan2',
  700. },
  701. {
  702. key: 'fan2ToFan1',
  703. value: '备机倒主机',
  704. permission: 'btn:ctrlFan2ToFan1',
  705. },
  706. {
  707. key: 'Fan1Frequency',
  708. value: '主机调频',
  709. permission: 'btn:frequency',
  710. },
  711. {
  712. key: 'Fan2Frequency',
  713. value: '备机调频',
  714. permission: 'btn:frequency',
  715. },
  716. {
  717. key: 'FanFrequency',
  718. value: '风机调频',
  719. permission: 'btn:frequencyMerge',
  720. },
  721. {
  722. key: 'windPower',
  723. value: '风电闭锁',
  724. permission: 'fanLocal:fdbs',
  725. },
  726. {
  727. key: 'gasPower',
  728. value: '瓦斯电闭锁',
  729. permission: 'fanLocal:wsdbs',
  730. },
  731. {
  732. key: 'needAir',
  733. value: '需风量',
  734. permission: 'fanLocal:control',
  735. },
  736. ],
  737. rightBtnArr: [
  738. {
  739. key: 'gasAlarmSet',
  740. value: '瓦斯限值设定',
  741. permission: 'fanLocal:gasAlarmSet',
  742. },
  743. {
  744. key: 'gasOverSet', //
  745. value: '瓦斯限值设定',
  746. permission: 'fanLocal:gasOverSet',
  747. },
  748. {
  749. key: 'kkjc',
  750. value: '工况辅助决策',
  751. permission: 'fanLocal:kkjc',
  752. },
  753. {
  754. key: 'zhlk',
  755. value: '自主联控',
  756. permission: 'fanLocal:zhlk',
  757. },
  758. {
  759. key: 'diameter',
  760. value: '风筒直径',
  761. permission: 'fanLocal:control',
  762. },
  763. {
  764. key: 'diameter',
  765. value: '风筒直径',
  766. permission: 'fanLocal:control',
  767. },
  768. {
  769. key: 'len',
  770. value: '风筒长度',
  771. permission: 'fanLocal:control',
  772. },
  773. // {
  774. // key: 'frequency',
  775. // value: '调频',
  776. // permission: 'fanLocal:control',
  777. // },
  778. {
  779. key: 'windPowerLimit',
  780. value: '风电闭锁限值',
  781. permission: 'fanLocal:control',
  782. },
  783. {
  784. key: 'gasPowerLimit',
  785. value: '瓦斯电闭锁限值',
  786. permission: 'fanLocal:control',
  787. },
  788. {
  789. key: 'airVolumeAlarm',
  790. value: '风量报警',
  791. permission: 'fanLocal:control',
  792. min: 0,
  793. max: 100,
  794. },
  795. {
  796. key: 'disAirAlarm',
  797. value: '漏风率报警',
  798. permission: 'fanLocal:control',
  799. },
  800. // {
  801. // key: 'dischargeGas',
  802. // value: '智能排放瓦斯',
  803. // permission: 'fanLocal:dischargeGas',
  804. // },
  805. // {
  806. // key: 'supplyAir',
  807. // value: '按需供风联动',
  808. // permission: 'fanLocal:supplyAir',
  809. // },
  810. ],
  811. });
  812. const sensorList = ref<any[]>([
  813. {
  814. value: '1',
  815. label: 'T1',
  816. },
  817. {
  818. value: '2',
  819. label: 'T2',
  820. },
  821. {
  822. value: '3',
  823. label: 'T3',
  824. },
  825. ]);
  826. const scroll = reactive({
  827. y: 180,
  828. });
  829. const deviceTypeDicts = getDictItemsByCode('fanlocaltype');
  830. const gasWarningVal = ref(0.6); // 瓦斯最大报警值
  831. const playerRef = ref();
  832. const MonitorDataTable = ref();
  833. const modalSensor = ref(null);
  834. const loading = ref(false);
  835. const activeKey = ref('1');
  836. const player1 = ref();
  837. const modalIsShow = ref<boolean>(false); // 是否显示模态框
  838. const modalTitle = ref(''); // 模态框标题显示内容,根据设备操作类型决定
  839. const fan1FrequencyVal = ref(40); //主机频率
  840. const fan2FrequencyVal = ref(40); //备机频率
  841. const mainWindIsShow1 = ref('open'); // 主机默认启动leftColumns
  842. const mainWindIsShow2 = ref('stop'); // 备机默认不启动
  843. const fanControl = ref('');
  844. const targetVolume = ref(600);
  845. const historyList = ref([]);
  846. const passWord = ref('');
  847. // 默认初始是第一行
  848. const selectRowIndex = ref(-1);
  849. const dataMonitorRowIndex = ref(0);
  850. // 默认数据右边监测的是主机
  851. const warningMonitorRowIndex = ref(0);
  852. const xAxisDataGas = ref([]);
  853. // 设备数据
  854. const controlType = ref('');
  855. const modalType = ref('');
  856. // 监测数据
  857. const initData = {
  858. deviceID: '',
  859. deviceType: '',
  860. strname: '',
  861. dataDh: '-', //压差
  862. dataDtestq: '-', //测试风量
  863. sourcePressure: '-', //气源压力
  864. dataDequivalarea: '-',
  865. netStatus: '0', //通信状态
  866. warnLevel_str: '',
  867. stationname: '',
  868. fanFrequencyType: '',
  869. };
  870. const frequencyVal = ref(0);
  871. const dataSource = ref([]);
  872. const historySource = ref([]);
  873. // 关联设备信息
  874. const linkDeviceInfo = ref({});
  875. // 监测数据
  876. let selectData = reactive(lodash.cloneDeep(initData));
  877. const rightColumns = ref<BasicColumn[]>([]);
  878. const leftColumns = ref<BasicColumn[]>([]);
  879. const leftColumns1 = ref<any[]>([
  880. { title: '供风充足评价', value: '' },
  881. { title: '回风流超限评价', value: '' },
  882. { title: '漏风率评价', value: '' },
  883. ]);
  884. const devicekide = ref(deviceTypeDicts && deviceTypeDicts.length > 0 ? deviceTypeDicts[0]['value'] : 'fanlocal');
  885. const deviceType = ref(selectData.deviceType);
  886. const headElHeight = ref(0);
  887. let btnClick = ref(true); // 判断按钮是否可点
  888. //报表导出
  889. let editID = ref<any>('');
  890. let fileType = ref('');
  891. const { getCamera, removeCamera } = useCamera();
  892. const echartsDataList = ref<any[]>([]);
  893. const remoteChartsColumns = getTableHeaderColumns('fanlocal_chart');
  894. const chartsColumns = remoteChartsColumns && remoteChartsColumns.length > 0 ? remoteChartsColumns : [];
  895. let chartsColumnsFan1 = [],
  896. chartsColumnsFan2 = [];
  897. // 这里需要处理主备echartColumns
  898. if (chartsColumns.length > 0) {
  899. console.log(chartsColumns);
  900. for (let i = 0; i < chartsColumns.length; i++) {
  901. let itemColumn = chartsColumns[i];
  902. let dataIndexFan1, dataIndexFan2;
  903. if (itemColumn['dataIndex']) {
  904. const dataIndex = itemColumn['dataIndex'] as string;
  905. dataIndexFan1 = dataIndex.startsWith('Fan') ? dataIndex.replace('Fan', 'Fan1') : dataIndex.replace('fan', 'fan1');
  906. dataIndexFan2 = dataIndex.startsWith('Fan') ? dataIndex.replace('Fan', 'Fan2') : dataIndex.replace('fan', 'fan2');
  907. chartsColumnsFan1.push({ ...itemColumn, dataIndex: dataIndexFan1, legend: '主机' + itemColumn['legend'] });
  908. chartsColumnsFan2.push({ ...itemColumn, dataIndex: dataIndexFan2, legend: '备机' + itemColumn['legend'] });
  909. }
  910. }
  911. }
  912. watch(deviceType, (type) => {
  913. rightColumns.value = getTableHeaderColumns(type + '_monitor_right') as [];
  914. if (rightColumns.value && rightColumns.value.length < 1) {
  915. rightColumns.value = getTableHeaderColumns(type.split('_')[0] + '_monitor_right') as [];
  916. }
  917. leftColumns.value = getTableHeaderColumns(type + '_monitor_left') as [];
  918. if (leftColumns.value && leftColumns.value.length < 1) {
  919. leftColumns.value = getTableHeaderColumns(type.split('_')[0] + '_monitor_left') as [];
  920. }
  921. });
  922. const flvURL1 = () => {
  923. // return `https://sf1-hscdn-tos.pstatp.com/obj/media-fe/xgplayer_doc_video/flv/xgplayer-demo-360p.flv`;
  924. return '';
  925. };
  926. const changeDeviceKind = (e) => {
  927. devicekide.value = e;
  928. loading.value = true;
  929. selectRowIndex.value = -1;
  930. nextTick(() => {
  931. selectData = lodash.cloneDeep(initData);
  932. loading.value = false;
  933. if (selectData.deviceID) MonitorDataTable.value.setSelectedRowKeys([selectData.deviceID]);
  934. const headEl = document.querySelector(`.zxm-table-thead`);
  935. if (headEl) {
  936. headElHeight.value = headEl.clientHeight;
  937. }
  938. });
  939. };
  940. const changePlay = () => {
  941. showPlay.value = !showPlay.value;
  942. };
  943. const tabChange = (activeKeyVal) => {
  944. activeKey.value = activeKeyVal;
  945. if (activeKeyVal == 1) {
  946. nextTick(() => {
  947. MonitorDataTable.value.setSelectedRowKeys([selectData.deviceID]);
  948. });
  949. }
  950. };
  951. const selectDevice = (key, val) => {
  952. if (key === 'dataMonitorRowIndex') {
  953. dataMonitorRowIndex.value = val;
  954. } else {
  955. warningMonitorRowIndex.value = val;
  956. }
  957. };
  958. //报表导出点击
  959. async function reportDown() {
  960. openModal1();
  961. let res = await save({ reportType: 'fanlocal' });
  962. console.log(res, 'res-----------');
  963. let list = await reportList({ id: res.id });
  964. console.log(list, 'list-----------');
  965. let index = list.records[0].fileName.indexOf('.');
  966. fileType.value = list.records[0].fileName.substring(index + 1);
  967. editID.value = list.records[0].id;
  968. openModal1();
  969. }
  970. //详情
  971. function goDetail() {
  972. openModal();
  973. }
  974. function goDetailDevice(link需风量DeviceCode) {
  975. let linkDeviceId = '';
  976. if (linkDeviceCode.startsWith('window')) {
  977. linkDeviceId = linkDeviceInfo.value[linkDeviceCode] ? linkDeviceInfo.value[linkDeviceCode]['id'] : '';
  978. router.push({ path: '/monitorChannel/monitor-window', query: { id: linkDeviceId } });
  979. }
  980. }
  981. //
  982. async function getDataSource() {
  983. if (devicekide.value) {
  984. const res = await list({ devicetype: devicekide.value, pagetype: 'normal' });
  985. // const res = await list({ devicetype: 'fanlocal', pagetype: 'normal' });
  986. if (res.msgTxt && res.msgTxt[0] && res.msgTxt[0].datalist && res.msgTxt[0].datalist.length > 0) {
  987. const dataArr = res.msgTxt[0].datalist || [];
  988. dataSource.value = [];
  989. dataArr.forEach((data) => {
  990. const readData = data.readData;
  991. data = Object.assign(data, readData);
  992. if (data['Fan1StartStatus'] && data['Fan1StartStatus'] === '1.0') data['Fan1StartStatus'] = '1';
  993. if (data['Fan2StartStatus'] && data['Fan2StartStatus'] === '1.0') data['Fan2StartStatus'] = '1';
  994. if (data['Fan1StartStatus'] && data['Fan1StartStatus'] === '0.0') data['Fan1StartStatus'] = '0';
  995. if (data['Fan2StartStatus'] && data['Fan2StartStatus'] === '0.0') data['Fan2StartStatus'] = '0';
  996. data['windQuantity2'] =
  997. data['windQuantity2'] ||
  998. data['m3'] ||
  999. data['ductOutletAirVolume_merge'] ||
  1000. data['windOutSpeed_merge'] ||
  1001. data['windOutSpeed1'] ||
  1002. data['windOutSpeed2'] ||
  1003. data['windOutSpeed_merge'];
  1004. // if (globSetting.sysOrgCode === 'sdmtjtbetmk') {
  1005. // if (data['m3']) data['ductOutletAirVolume_merge'] = data['m3'];
  1006. // if (data['m3']) data['inletAirVolume_merge'] = (Number(data['m3']) * 1.08).toFixed(2);
  1007. // }
  1008. const m3 = data.windSpeed_merge;
  1009. const fsectarea = data.windSectionArea_merge;
  1010. const needq = data.needq;
  1011. const airLeakageRatePerHundred = data.airLeakageRatePerHundred_merge;
  1012. const airVolume = m3 * fsectarea; // 计算风量
  1013. // 更新供风充足评价
  1014. leftColumns1.value[0].value = airVolume >= needq ? '充足' : '不充足';
  1015. if (data.tunnelType === 'coalTunnel') {
  1016. leftColumns1.value[1].value = m3 < 0.25 ? '超限' : '正常';
  1017. } else if (data.tunnelType === 'rockTunnel' || data.tunnelType === 'coalRockTunnel') {
  1018. leftColumns1.value[1].value = m3 < 0.15 ? '超限' : '正常';
  1019. }
  1020. if (data.airLeakageRatePerHundredX === '' || data.airLeakageRatePerHundred_merge === '') {
  1021. leftColumns1.value[2].value = '-';
  1022. } else {
  1023. leftColumns1.value[2].value = airLeakageRatePerHundred <= data.airLeakageRatePerHundredX ? '满足' : '不满足';
  1024. }
  1025. dataSource.value.push(data);
  1026. });
  1027. if (selectRowIndex.value > -1) {
  1028. const data = dataArr[selectRowIndex.value];
  1029. // 存放echarts数据
  1030. if (data && data['readTime']) {
  1031. const dataList = cloneDeep(echartsDataList.value);
  1032. if (dataList.length == 0 || dataList[dataList.length - 1]['readTime'] !== data['readTime']) {
  1033. if (dataList.length < 15) {
  1034. dataList.push({ ...data });
  1035. } else {
  1036. dataList.shift();
  1037. dataList.push({ ...data });
  1038. }
  1039. echartsDataList.value = dataList;
  1040. }
  1041. }
  1042. // 制动控制echarts数据获取
  1043. let echartsData = dataArr[selectRowIndex.value]['history'] || [];
  1044. echartsData = echartsData.filter((item) => {
  1045. item['FanfHz'] = data['Fan1StartStatus'] == '1' ? item['Fan1fHz'] : data['Fan2StartStatus'] == '1' ? item['Fan2fHz'] : 0;
  1046. item['windQuantity2'] =
  1047. item['windQuantity2'] ||
  1048. item['m3'] ||
  1049. item['ductOutletAirVolume_merge'] ||
  1050. item['windOutSpeed_merge'] ||
  1051. item['windOutSpeed1'] ||
  1052. item['windOutSpeed2'] ||
  1053. item['windOutSpeed_merge'];
  1054. return true;
  1055. });
  1056. historyList.value = echartsData;
  1057. }
  1058. } else {
  1059. return (dataSource.value = []);
  1060. }
  1061. } else {
  1062. dataSource.value = [];
  1063. }
  1064. }
  1065. // https获取监测数据
  1066. let timer: null | NodeJS.Timeout = null;
  1067. async function getMonitor(flag?) {
  1068. if (Object.prototype.toString.call(timer) === '[object Null]') {
  1069. timer = await setTimeout(
  1070. async () => {
  1071. // debugger;
  1072. await getDataSource();
  1073. if (dataSource.value.length > 0 && selectRowIndex.value == -1 && MonitorDataTable.value) {
  1074. // 初始打开页面
  1075. if (flag && currentRoute.value && currentRoute.value['query'] && currentRoute.value['query']['id']) {
  1076. MonitorDataTable.value.setSelectedRowKeys(currentRoute.value['query']['id']);
  1077. } else {
  1078. MonitorDataTable.value.setSelectedRowKeys(dataSource.value[0]['deviceID']);
  1079. }
  1080. }
  1081. for (const key in selectData) {
  1082. selectData[key] = '';
  1083. }
  1084. if (dataSource.value.length > 0 && dataSource.value[selectRowIndex.value]) {
  1085. deviceType.value = dataSource.value[selectRowIndex.value]['deviceType'];
  1086. if (dataSource.value.length > 0 && dataSource.value[selectRowIndex.value]) {
  1087. Object.assign(selectData, dataSource.value[selectRowIndex.value]);
  1088. }
  1089. playSmoke(selectData);
  1090. addText(selectData);
  1091. }
  1092. historySource.value = selectData.history;
  1093. if (timer) {
  1094. timer = null;
  1095. }
  1096. getMonitor();
  1097. },
  1098. flag ? 0 : 1000
  1099. );
  1100. }
  1101. }
  1102. // 获取设备基本信息列表
  1103. const deviceBaseList = ref([]);
  1104. function getDeviceBaseList() {
  1105. getTableList({ pageSize: 1000 }).then((res) => {
  1106. deviceBaseList.value = res.records;
  1107. });
  1108. }
  1109. // 切换检测数据
  1110. async function getSelectRow(id) {
  1111. console.log('选中的设备id------->', id);
  1112. if (!id || id == selectData['deviceID']) return;
  1113. // loading.value = true;
  1114. const selectIndex: any = dataSource.value.findIndex((baseData: any) => baseData.deviceID == id);
  1115. selectRowIndex.value = selectIndex;
  1116. nextTick(() => {
  1117. const headEl = document.querySelector(`.zxm-table-thead`);
  1118. if (headEl) {
  1119. headElHeight.value = headEl.clientHeight;
  1120. }
  1121. const data = dataSource.value[selectIndex];
  1122. if (data) {
  1123. if (selectData['linkInfo']) linkDeviceInfo.value = JSON.parse(selectData['linkInfo']);
  1124. if (linkDeviceInfo.value['window_fWindowM3']) {
  1125. modalType.value = 'fc';
  1126. }
  1127. // 主备互斥控制
  1128. if (data['Fan1StartStatus'] == '1') {
  1129. mainWindIsShow1.value = 'open';
  1130. mainWindIsShow2.value = 'stop';
  1131. selectDevice('warningMonitorRowIndex', 0);
  1132. selectDevice('dataMonitorRowIndex', 0);
  1133. } else if (data['Fan2StartStatus'] == '1') {
  1134. mainWindIsShow2.value = 'open';
  1135. mainWindIsShow1.value = 'stop';
  1136. selectDevice('warningMonitorRowIndex', 1);
  1137. selectDevice('dataMonitorRowIndex', 1);
  1138. }
  1139. const xAxisDataGasArr = [];
  1140. for (const key in selectData) {
  1141. if (key.startsWith('gas') && key.length < 5) {
  1142. xAxisDataGasArr.push({ key: 'T' + key.substring(3), valueKey: key });
  1143. }
  1144. }
  1145. xAxisDataGas.value = xAxisDataGasArr;
  1146. }
  1147. setModelType(modalType.value);
  1148. });
  1149. await getCamera(id, playerRef.value);
  1150. return;
  1151. }
  1152. // 打开并设置modal的标题
  1153. function showModal(obj) {
  1154. if (!btnClick.value) return;
  1155. if (obj.key == 'kkjc') {
  1156. gasWarningVal.value = 0.6;
  1157. // 工况辅助决策
  1158. openAssistance(true, {});
  1159. return;
  1160. }
  1161. controlType.value = obj.key;
  1162. modalTitle.value = obj.value;
  1163. passWord.value = '';
  1164. modalIsShow.value = true;
  1165. }
  1166. function changeMotor(e) {
  1167. const target = e.target;
  1168. if (target.name === 'localWind1') {
  1169. if (target.value === 'open') {
  1170. mainWindIsShow2.value = 'stop';
  1171. }
  1172. } else if (target.name === 'localWind2') {
  1173. if (target.value === 'open') {
  1174. mainWindIsShow1.value = 'stop';
  1175. }
  1176. }
  1177. }
  1178. function handleOk(control?) {
  1179. if (passWord.value == '') {
  1180. message.warning('请输入密码!');
  1181. return;
  1182. }
  1183. createConfirm({
  1184. iconType: 'warning',
  1185. title: '控制',
  1186. content: '您确定要控制吗?',
  1187. onOk: () => handerFn(),
  1188. });
  1189. const handerFn = () => {
  1190. const handType = controlType.value;
  1191. const data = {
  1192. deviceid: selectData.deviceID,
  1193. devicetype: selectData.deviceType,
  1194. paramcode: '',
  1195. password: passWord.value || globalConfig?.simulatedPassword,
  1196. value: null,
  1197. };
  1198. if (handType === 'startSmoke') {
  1199. // 启动风机
  1200. // 以下是互斥
  1201. if (mainWindIsShow1.value === 'open' && mainWindIsShow2.value === 'stop') {
  1202. // playSmoke(handType, 'top', frequency, 'open');
  1203. data.paramcode = 'CtrlFan1Start';
  1204. deviceControlApi(data)
  1205. .then((res) => {
  1206. if (res.success) {
  1207. if (globalConfig.History_Type == 'remote') {
  1208. message.success('指令已下发至生产管控平台成功!');
  1209. } else {
  1210. message.success('指令已下发成功!');
  1211. }
  1212. modalTitle.value = '';
  1213. modalIsShow.value = false;
  1214. } else {
  1215. message.error(res.message);
  1216. }
  1217. })
  1218. .catch((err) => {
  1219. // modalIsShow.value = true;
  1220. });
  1221. } else if (mainWindIsShow2.value === 'open' && mainWindIsShow1.value === 'stop') {
  1222. // playSmoke(handType, 'down', frequency, 'open');
  1223. data.paramcode = 'CtrlFan2Start';
  1224. deviceControlApi(data)
  1225. .then(() => {
  1226. if (res.success) {
  1227. if (globalConfig.History_Type == 'remote') {
  1228. message.success('指令已下发至生产管控平台成功!');
  1229. } else {
  1230. message.success('指令已下发成功!');
  1231. }
  1232. modalTitle.value = '';
  1233. modalIsShow.value = false;
  1234. } else {
  1235. message.error(res.message);
  1236. }
  1237. })
  1238. .catch((err) => {});
  1239. } else if (mainWindIsShow1.value === 'stop' && mainWindIsShow2.value === 'stop') {
  1240. // playSmoke(handType, '', frequency, 'stop');
  1241. }
  1242. } else if (handType === 'startFan') {
  1243. if (control === 'Fan1Open') {
  1244. data.paramcode = 'CtrlFan1Start';
  1245. } else if (control === 'Fan2Open') {
  1246. data.paramcode = 'CtrlFan2Start';
  1247. } else if (control === 'Fan1Stop') {
  1248. data.paramcode = 'CtrlFan1Stop';
  1249. } else if (control === 'Fan2Stop') {
  1250. data.paramcode = 'CtrlFan2Stop';
  1251. } else if (control === 'Fan1Reset') {
  1252. data.paramcode = 'CtrlFan1Reset';
  1253. } else if (control === 'Fan2Reset') {
  1254. data.paramcode = 'CtrlFan2Reset';
  1255. }
  1256. deviceControlApi(data)
  1257. .then((res) => {
  1258. if (res.success) {
  1259. if (globalConfig.History_Type == 'remote') {
  1260. message.success('指令已下发至生产管控平台成功!');
  1261. } else {
  1262. message.success('指令已下发成功!');
  1263. }
  1264. modalTitle.value = '';
  1265. modalIsShow.value = false;
  1266. } else {
  1267. message.error(res.message);
  1268. }
  1269. })
  1270. .catch((err) => {
  1271. btnClick.value = true;
  1272. });
  1273. } else if (handType === 'Fan1Frequency' || handType === 'Fan2Frequency' || handType === 'FanFrequency') {
  1274. // 调频
  1275. if (handType === 'Fan1Frequency') {
  1276. data.paramcode = 'Fan1FreqHz';
  1277. data.value = fan1FrequencyVal.value;
  1278. } else if (handType === 'Fan2Frequency') {
  1279. data.paramcode = 'Fan2FreqHz';
  1280. data.value = fan2FrequencyVal.value;
  1281. } else if (handType === 'FanFrequency') {
  1282. data.paramcode = 'FreqHz_merge';
  1283. data.value = fan1FrequencyVal.value;
  1284. }
  1285. deviceControlApi(data)
  1286. .then((res) => {
  1287. if (res.success) {
  1288. if (globalConfig.History_Type == 'remote') {
  1289. message.success('指令已下发至生产管控平台成功!');
  1290. } else {
  1291. message.success('指令已下发成功!');
  1292. }
  1293. modalTitle.value = '';
  1294. modalIsShow.value = false;
  1295. } else {
  1296. message.error(res.message);
  1297. }
  1298. })
  1299. .catch((err) => {});
  1300. } else if (handType === 'changeSmoke') {
  1301. if (selectData['Fan1StartStatus'] == '0' || !selectData['Fan1StartStatus']) {
  1302. data.paramcode = 'CtrlFan1Start';
  1303. deviceControlApi(data)
  1304. .then((res) => {
  1305. if (res.success) {
  1306. if (globalConfig.History_Type == 'remote') {
  1307. message.success('指令已下发至生产管控平台成功!');
  1308. } else {
  1309. message.success('指令已下发成功!');
  1310. }
  1311. modalTitle.value = '';
  1312. modalIsShow.value = false;
  1313. } else {
  1314. message.error(res.message);
  1315. }
  1316. mainWindIsShow1.value = 'stop';
  1317. mainWindIsShow2.value = 'open';
  1318. })
  1319. .catch((err) => {});
  1320. } else if (selectData['Fan2StartStatus'] == '0' || !selectData['Fan2StartStatus']) {
  1321. data.paramcode = 'CtrlFan2Start';
  1322. deviceControlApi(data)
  1323. .then((res) => {
  1324. if (res.success) {
  1325. if (globalConfig.History_Type == 'remote') {
  1326. message.success('指令已下发至生产管控平台成功!');
  1327. } else {
  1328. message.success('指令已下发成功!');
  1329. }
  1330. modalTitle.value = '';
  1331. modalIsShow.value = false;
  1332. } else {
  1333. message.error(res.message);
  1334. }
  1335. mainWindIsShow1.value = 'open';
  1336. mainWindIsShow2.value = 'stop';
  1337. })
  1338. .catch((err) => {});
  1339. }
  1340. // // 一键倒机
  1341. // if (mainWindIsShow1.value === 'open' && mainWindIsShow2.value === 'stop') {
  1342. // // playSmoke('startSmoke', 'down', frequency, 'open');
  1343. // data.paramcode = 'CtrlFan2Start';
  1344. // deviceControlApi(data).then((res) => {
  1345. // console.log('设备操作结果', res);
  1346. // modalTitle.value = '';
  1347. // modalIsShow.value = false;
  1348. // }).catch((err) => {
  1349. // });
  1350. // mainWindIsShow1.value = 'stop';
  1351. // mainWindIsShow2.value = 'open';
  1352. // } else if (mainWindIsShow2.value === 'open' && mainWindIsShow1.value === 'stop') {
  1353. // // playSmoke('startSmoke', 'top', frequency, 'open');
  1354. // data.paramcode = 'CtrlFan1Start';
  1355. // deviceControlApi(data).then((res) => {
  1356. // console.log('设备操作结果', res);
  1357. // modalTitle.value = '';
  1358. // modalIsShow.value = false;
  1359. // }).catch((err) => {
  1360. // });
  1361. // mainWindIsShow1.value = 'open';
  1362. // mainWindIsShow2.value = 'stop';
  1363. // } else if (mainWindIsShow1.value === 'stop' && mainWindIsShow2.value === 'stop') {
  1364. // // playSmoke(handType, '', frequency, 'stop');
  1365. // }
  1366. } else if (handType === 'changeFan') {
  1367. data.paramcode = 'CtrlFanStart';
  1368. deviceControlApi(data)
  1369. .then((res) => {
  1370. if (res.success) {
  1371. if (globalConfig.History_Type == 'remote') {
  1372. message.success('指令已下发至生产管控平台成功!');
  1373. } else {
  1374. message.success('指令已下发成功!');
  1375. }
  1376. } else {
  1377. message.error(res.message);
  1378. }
  1379. modalTitle.value = '';
  1380. modalIsShow.value = false;
  1381. })
  1382. .catch((err) => {});
  1383. } else if (handType === 'fan1ToFan2') {
  1384. data.paramcode = 'CtrlFan1ToFan2';
  1385. deviceControlApi(data).then((res) => {
  1386. if (res.success) {
  1387. if (globalConfig.History_Type == 'remote') {
  1388. message.success('指令已下发至生产管控平台成功!');
  1389. } else {
  1390. message.success('指令已下发成功!');
  1391. }
  1392. modalTitle.value = '';
  1393. modalIsShow.value = false;
  1394. } else {
  1395. message.error(res.message);
  1396. }
  1397. });
  1398. } else if (handType === 'fan2ToFan1') {
  1399. data.paramcode = 'CtrlFan2ToFan1';
  1400. deviceControlApi(data).then((res) => {
  1401. if (res.success) {
  1402. if (globalConfig.History_Type == 'remote') {
  1403. message.success('指令已下发至生产管控平台成功!');
  1404. } else {
  1405. message.success('指令已下发成功!');
  1406. }
  1407. modalTitle.value = '';
  1408. modalIsShow.value = false;
  1409. } else {
  1410. message.error(res.message);
  1411. }
  1412. });
  1413. } else if (handType === 'gasAlarmSet') {
  1414. if (passWord.value != '123456') {
  1415. message.error('密码错误,请重新输入!');
  1416. return;
  1417. }
  1418. if (gasWarningVal.value) {
  1419. modalTitle.value = '';
  1420. modalIsShow.value = false;
  1421. setTimeout(() => {
  1422. passWord.value = '';
  1423. modalIsShow.value = true;
  1424. controlType.value = 'toGkjc';
  1425. modalTitle.value = '工况决策辅助';
  1426. }, 500);
  1427. } else {
  1428. message.error('请核对瓦斯超限浓度值!');
  1429. }
  1430. } else if (handType === 'toGkjc') {
  1431. if (passWord.value != '123456') {
  1432. message.error('密码错误,请重新输入!');
  1433. return;
  1434. }
  1435. //进行工况决策
  1436. if (selectData.Fan1StartStatus == '1') {
  1437. openAssistance(true, {
  1438. // m3: selectData.m3 || 675.87,
  1439. m3: 675.87,
  1440. frequency: 30,
  1441. // m3: 525.87, //5.0测试数据
  1442. // frequency: 35,
  1443. // frequency: selectData.Fan1fHz || selectData.Fan1FreqHz || selectData.Fan1Loop_Frequency,
  1444. gasWarningVal: gasWarningVal.value,
  1445. isCompute: false,
  1446. });
  1447. } else if (selectData.Fan2StartStatus == '1') {
  1448. openAssistance(true, {
  1449. // m3: selectData.m3 || 675.87,
  1450. m3: 675.87,
  1451. frequency: 30,
  1452. // frequency: selectData.Fan2fHz || selectData.Fan2FreqHz || selectData.Fan2Loop_Frequency,
  1453. gasWarningVal: gasWarningVal.value,
  1454. isCompute: false,
  1455. });
  1456. } else {
  1457. // openAssistance(true, { m3: 635.04, dataDh: 5748 });
  1458. openAssistance(true);
  1459. }
  1460. modalTitle.value = '';
  1461. modalIsShow.value = false;
  1462. } else if (handType === 'zhlk' || handType === 'gasOverSet') {
  1463. modalIsShow.value = false;
  1464. if (targetVolume.value) {
  1465. const params =
  1466. handType === 'zhlk'
  1467. ? { auto: 1, fanlocalId: selectData.deviceID, xufengliang: targetVolume.value }
  1468. : { auto: 1, fanlocalId: selectData.deviceID, gasMax: gasWarningVal.value };
  1469. autoAdjust(params)
  1470. .then(() => {
  1471. if (hasPermission('echart:show')) activeKey.value = '2';
  1472. if (globalConfig.History_Type == 'remote') {
  1473. message.success('指令已下发至生产管控平台成功!');
  1474. } else {
  1475. message.success('指令已下发成功!');
  1476. }
  1477. modalTitle.value = '';
  1478. })
  1479. .catch(() => {
  1480. message.error('指令下发失败');
  1481. });
  1482. }
  1483. }
  1484. };
  1485. }
  1486. function cancel() {
  1487. modalTitle.value = '';
  1488. modalIsShow.value = false;
  1489. gasWarningVal.value = 0;
  1490. }
  1491. function handleChangeSensor(value: string) {
  1492. console.log(value);
  1493. }
  1494. function addPlayVideo() {
  1495. if (player1.value && player1.value.play) {
  1496. if (!player1.value.paused()) player1.value.play();
  1497. document.body.removeEventListener('mousedown', addPlayVideo);
  1498. }
  1499. }
  1500. function deviceEdit(e: Event, type: string, record) {
  1501. e.stopPropagation();
  1502. openModal(true, {
  1503. type,
  1504. deviceId: record['deviceID'],
  1505. });
  1506. }
  1507. onBeforeMount(() => {
  1508. getDeviceBaseList();
  1509. });
  1510. onMounted(() => {
  1511. const { query } = unref(currentRoute);
  1512. if (query['deviceType']) devicekide.value = query['deviceType'] as string;
  1513. mountedThree(player1.value).then(async () => {
  1514. await getMonitor(true);
  1515. nextTick(async () => {
  1516. addCssText();
  1517. });
  1518. });
  1519. document.body.addEventListener('mousedown', addPlayVideo, false);
  1520. });
  1521. onUnmounted(() => {
  1522. destroy();
  1523. removeCamera();
  1524. if (timer) {
  1525. clearTimeout(timer);
  1526. timer = undefined;
  1527. }
  1528. });
  1529. </script>
  1530. <style scoped lang="less">
  1531. @import '/@/design/theme.less';
  1532. @import '/@/design/vent/modal.less';
  1533. :deep(.@{ventSpace}-tabs-tabpane-active) {
  1534. height: 100%;
  1535. }
  1536. :deep(.zxm-tabs-content) {
  1537. height: 100%;
  1538. }
  1539. @{theme-deepblue} {
  1540. .scene-box {
  1541. --image-lr-top-bg: url('/@/assets/images/themify/deepblue/vent/lr-top-bg.png');
  1542. --image-lr-tab-bg: url('/@/assets/images/themify/deepblue/vent/lr-tab-bg.png');
  1543. --image-l-tab-active: url('/@/assets/images/themify/deepblue/vent/l-tab-active.png');
  1544. --image-r-tab-active: url('/@/assets/images/themify/deepblue/vent/r-tab-active.png');
  1545. --image-plane-bottom: url('/@/assets/images/themify/deepblue/vent/plane-bottom.png');
  1546. --image-plane-icon-bg: url('/@/assets/images/themify/deepblue/vent/plane-icon-bg.png');
  1547. --container-group-bg: linear-gradient(to right, #ffffff22, #53576305);
  1548. }
  1549. }
  1550. .scene-box {
  1551. --image-lr-top-bg: url('/@/assets/images/vent/lr-top-bg.png');
  1552. --image-lr-tab-bg: url('/@/assets/images/vent/lr-tab-bg.png');
  1553. --image-l-tab-active: url('/@/assets/images/vent/l-tab-active.png');
  1554. --image-r-tab-active: url('/@/assets/images/vent/r-tab-active.png');
  1555. --image-plane-bottom: url('/@/assets/images/vent/plane-bottom.png');
  1556. --image-plane-icon-bg: url('/@/assets/images/vent/plane-icon-bg.png');
  1557. --container-group-bg: linear-gradient(to right, #00deff22, #2081ff05);
  1558. .title-text {
  1559. height: 32px;
  1560. }
  1561. .bottom-tabs-box {
  1562. height: 280px;
  1563. .tabs-box {
  1564. position: relative !important;
  1565. }
  1566. }
  1567. }
  1568. .data-show-box {
  1569. position: relative;
  1570. display: flex;
  1571. flex-direction: row;
  1572. justify-content: space-between;
  1573. padding: 10px 5px;
  1574. color: var(--vent-font-color);
  1575. z-index: 999;
  1576. top: 60px;
  1577. .data-item {
  1578. pointer-events: auto;
  1579. .item-header {
  1580. width: 374px;
  1581. background: var(--image-lr-top-bg) no-repeat;
  1582. background-size: auto;
  1583. height: 32px;
  1584. text-align: center;
  1585. line-height: 34px;
  1586. font-size: 15px;
  1587. font-weight: 600;
  1588. color: #fafafa;
  1589. }
  1590. .item-container {
  1591. width: 346px;
  1592. margin: 0 14px;
  1593. padding: 10px;
  1594. background: #00377c33;
  1595. backdrop-filter: blur(2px);
  1596. .tab {
  1597. width: 323px;
  1598. background: var(--image-lr-tab-bg) no-repeat;
  1599. display: flex;
  1600. .tab-item {
  1601. flex: 1;
  1602. text-align: center;
  1603. padding-top: 2px;
  1604. color: #ffffff99;
  1605. cursor: pointer;
  1606. }
  1607. .tab-item-active-l {
  1608. color: var(--vent-font-action-link);
  1609. background-image: var(--image-l-tab-active);
  1610. background-repeat: no-repeat;
  1611. background-size: auto;
  1612. background-position: 6px 3px;
  1613. }
  1614. .tab-item-active-r {
  1615. color: var(--vent-font-action-link);
  1616. background-image: var(--image-r-tab-active);
  1617. background-repeat: no-repeat;
  1618. background-position: 0 3px;
  1619. }
  1620. }
  1621. .container-group {
  1622. width: 314px;
  1623. margin: 0px 4px;
  1624. padding: 10px 0;
  1625. background: var(--container-group-bg);
  1626. max-height: 440px;
  1627. overflow-y: auto;
  1628. }
  1629. .container-item {
  1630. width: 100%;
  1631. height: 60px;
  1632. display: flex;
  1633. padding: 10px 0 0 20px;
  1634. margin-bottom: 5px;
  1635. position: relative;
  1636. background: var(--image-plane-bottom) no-repeat;
  1637. background-size: auto;
  1638. background-position: bottom;
  1639. &::before {
  1640. content: '';
  1641. display: block;
  1642. width: 100%;
  1643. height: 5px;
  1644. position: absolute;
  1645. top: 62px;
  1646. left: 0;
  1647. background-color: #73f4ff66;
  1648. backdrop-filter: blur(5px);
  1649. }
  1650. .item-icon {
  1651. width: 54px;
  1652. height: 45px;
  1653. background: var(--image-plane-icon-bg) no-repeat;
  1654. background-size: cover;
  1655. .icon-style {
  1656. font-size: 18px;
  1657. margin: 10px 0 0 20px;
  1658. color: #ffc800;
  1659. }
  1660. }
  1661. .item-name {
  1662. width: 180px;
  1663. display: flex;
  1664. align-items: center; /* 垂直居中 */
  1665. word-wrap: break-word;
  1666. white-space: normal;
  1667. }
  1668. .item-value {
  1669. position: relative;
  1670. height: 26px;
  1671. line-height: 24px;
  1672. margin: 15px 0;
  1673. text-align: center;
  1674. width: 80px;
  1675. border: 1px solid var(--vent-base-border);
  1676. border-radius: 13px;
  1677. background: linear-gradient(to right, #00f5fe44, #0090ff44);
  1678. &::before {
  1679. width: 6px;
  1680. height: 6px;
  1681. content: '';
  1682. position: absolute;
  1683. left: -3px;
  1684. top: 8px;
  1685. background: #ffa500;
  1686. border-radius: 3px;
  1687. }
  1688. }
  1689. .text-red-bold {
  1690. color: red;
  1691. font-weight: bold;
  1692. }
  1693. }
  1694. .warning-header {
  1695. display: flex;
  1696. font-size: 14px;
  1697. .header-item {
  1698. flex: 1;
  1699. display: flex;
  1700. justify-content: center;
  1701. align-items: center;
  1702. .header-title {
  1703. width: 100%;
  1704. text-align: center;
  1705. padding: 1px 0;
  1706. color: var(--vent-font-action-link);
  1707. margin-top: 10px;
  1708. background: #1eb0ff22;
  1709. }
  1710. .header-value {
  1711. // width: 133px;
  1712. height: 36px;
  1713. font-weight: 600;
  1714. font-family: 'douyuFont';
  1715. font-size: 16px;
  1716. color: #ffa500;
  1717. display: flex;
  1718. justify-content: center;
  1719. align-items: center;
  1720. margin-top: 15px;
  1721. margin-left: 8px;
  1722. }
  1723. }
  1724. }
  1725. .warning-group {
  1726. padding: 0 10px;
  1727. position: relative;
  1728. .warning-item {
  1729. display: flex;
  1730. flex-direction: row;
  1731. justify-content: space-between;
  1732. align-items: center;
  1733. height: 38px;
  1734. .item-name {
  1735. display: flex;
  1736. align-items: center;
  1737. // padding-left: 5px;
  1738. .icon {
  1739. width: 6px;
  1740. height: 6px;
  1741. display: inline-block;
  1742. background-color: var(--vent-base-light-bg);
  1743. border-radius: 3px;
  1744. position: relative;
  1745. margin-right: 8px;
  1746. &::before {
  1747. content: '';
  1748. width: 10px;
  1749. height: 10px;
  1750. display: block;
  1751. border: 1px solid #34edff99;
  1752. border-radius: 5px;
  1753. position: absolute;
  1754. top: -2px;
  1755. left: -2px;
  1756. }
  1757. }
  1758. &::before {
  1759. content: '';
  1760. display: block;
  1761. width: 1px;
  1762. height: 38px;
  1763. position: absolute;
  1764. left: 12px;
  1765. background-color: var(--vent-base-light-bg);
  1766. }
  1767. }
  1768. }
  1769. }
  1770. .warning-group-r {
  1771. &::before {
  1772. content: '';
  1773. display: block;
  1774. width: 1px;
  1775. height: 100%;
  1776. position: absolute;
  1777. left: 12px;
  1778. background-color: var(--vent-base-light-bg);
  1779. }
  1780. }
  1781. }
  1782. }
  1783. }
  1784. .input-box {
  1785. display: flex;
  1786. align-items: center;
  1787. .input-title {
  1788. color: #73e8fe;
  1789. width: auto;
  1790. }
  1791. margin-right: 10px;
  1792. }
  1793. .label {
  1794. max-width: 220px;
  1795. }
  1796. #fanLocalSelectDom {
  1797. :deep(.@{ventSpace}-select-dropdown) {
  1798. left: 0px !important;
  1799. top: 35px !important;
  1800. }
  1801. }
  1802. .@{ventSpace}-input {
  1803. width: 150px;
  1804. }
  1805. :deep(#LivePlayerBox) {
  1806. display: flex;
  1807. flex-direction: row;
  1808. justify-content: flex-end;
  1809. padding-right: 380px;
  1810. pointer-events: none;
  1811. .video-parent {
  1812. height: 208px;
  1813. pointer-events: auto !important;
  1814. }
  1815. }
  1816. .to-right {
  1817. :deep(#LivePlayerBox) {
  1818. padding-right: 0px;
  1819. }
  1820. }
  1821. :deep(.button-box) {
  1822. position: relative;
  1823. padding: 5px;
  1824. // border: 1px transparent solid;
  1825. border-radius: 5px;
  1826. margin-left: 8px;
  1827. margin-right: 8px;
  1828. width: auto;
  1829. // height: 40px;
  1830. // border: 1px solid #65dbea;
  1831. height: 35px !important;
  1832. display: flex;
  1833. align-items: center;
  1834. justify-content: center;
  1835. color: var(--vent-font-color);
  1836. padding: 0 15px 5px 15px;
  1837. cursor: pointer;
  1838. &:hover {
  1839. background: var(--vent-device-manager-control-btn-hover);
  1840. }
  1841. &::before {
  1842. width: calc(100% - 6px);
  1843. height: 27px;
  1844. content: '';
  1845. position: absolute;
  1846. top: 3px;
  1847. right: 0;
  1848. left: 3px;
  1849. bottom: 0;
  1850. z-index: -1;
  1851. border-radius: inherit;
  1852. /*important*/
  1853. background: var(--vent-device-manager-control-btn);
  1854. }
  1855. &::after {
  1856. width: calc(100% + 32px);
  1857. height: 10px;
  1858. content: '';
  1859. position: absolute;
  1860. top: 28px;
  1861. right: 0;
  1862. left: -16px;
  1863. bottom: 0;
  1864. z-index: -1;
  1865. border-radius: inherit;
  1866. /*important*/
  1867. background-position: center;
  1868. background-size: 100%;
  1869. z-index: 999;
  1870. }
  1871. }
  1872. .video-icon {
  1873. width: 30px;
  1874. height: 38px;
  1875. position: absolute;
  1876. top: 580px;
  1877. right: 395px;
  1878. color: var(--vent-font-color);
  1879. z-index: 1;
  1880. font-size: 28px;
  1881. }
  1882. .no-play {
  1883. &::after {
  1884. position: absolute;
  1885. width: 80%;
  1886. height: 100%;
  1887. content: '';
  1888. left: 12%;
  1889. top: -5px;
  1890. background: linear-gradient(
  1891. to bottom left,
  1892. transparent 0%,
  1893. transparent calc(50% - 2px),
  1894. #ffffff 50%,
  1895. transparent calc(50% + 2px),
  1896. transparent 100%
  1897. );
  1898. }
  1899. }
  1900. </style>