index.vue 76 KB

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