index.vue 83 KB

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