index.vue 75 KB

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