index.vue 78 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068
  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.threejs';
  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. const mainModelType = ref('fanLocal');
  891. // 监测数据
  892. const initData = {
  893. deviceID: '',
  894. deviceType: '',
  895. strname: '',
  896. dataDh: '-', //压差
  897. dataDtestq: '-', //测试风量
  898. sourcePressure: '-', //气源压力
  899. dataDequivalarea: '-',
  900. netStatus: '0', //通信状态
  901. warnLevel_str: '',
  902. stationname: '',
  903. fanFrequencyType: '',
  904. };
  905. const frequencyVal = ref(0);
  906. const dataSource = ref([]);
  907. const historySource = ref([]);
  908. // 关联设备信息
  909. const linkDeviceInfo = ref({});
  910. // 监测数据
  911. let selectData = shallowReactive(lodash.cloneDeep(initData));
  912. const currentDeviceData = ref({});
  913. const rightColumns = ref<BasicColumn[]>([]);
  914. const leftColumns = ref<BasicColumn[]>([]);
  915. const leftColumns1 = ref<any[]>([
  916. { title: '供风充足评价', value: '' },
  917. { title: '回风流超限评价', value: '' },
  918. { title: '漏风率评价', value: '' },
  919. ]);
  920. const devicekide = ref(deviceTypeDicts && deviceTypeDicts.length > 0 ? deviceTypeDicts[0]['value'] : 'fanlocal');
  921. const deviceType = ref(selectData.deviceType);
  922. const headElHeight = ref(0);
  923. let btnClick = ref(true); // 判断按钮是否可点
  924. //报表导出
  925. let editID = ref<any>('');
  926. let fileType = ref('');
  927. const { getCamera, removeCamera } = useCamera();
  928. const echartsDataList = ref<any[]>([]);
  929. const remoteChartsColumns = getTableHeaderColumns('fanlocal_chart');
  930. const chartsColumns = remoteChartsColumns && remoteChartsColumns.length > 0 ? remoteChartsColumns : [];
  931. let chartsColumnsFan1 = [],
  932. chartsColumnsFan2 = [];
  933. // 这里需要处理主备echartColumns
  934. if (chartsColumns.length > 0) {
  935. console.log(chartsColumns);
  936. for (let i = 0; i < chartsColumns.length; i++) {
  937. let itemColumn = chartsColumns[i];
  938. let dataIndexFan1, dataIndexFan2;
  939. if (itemColumn['dataIndex']) {
  940. const dataIndex = itemColumn['dataIndex'] as string;
  941. dataIndexFan1 = dataIndex.startsWith('Fan') ? dataIndex.replace('Fan', 'Fan1') : dataIndex.replace('fan', 'fan1');
  942. dataIndexFan2 = dataIndex.startsWith('Fan') ? dataIndex.replace('Fan', 'Fan2') : dataIndex.replace('fan', 'fan2');
  943. chartsColumnsFan1.push({ ...itemColumn, dataIndex: dataIndexFan1, legend: '主机' + itemColumn['legend'] });
  944. chartsColumnsFan2.push({ ...itemColumn, dataIndex: dataIndexFan2, legend: '备机' + itemColumn['legend'] });
  945. }
  946. }
  947. }
  948. watch(deviceType, (type) => {
  949. rightColumns.value = getTableHeaderColumns(type + '_monitor_right') as [];
  950. if (rightColumns.value && rightColumns.value.length < 1) {
  951. rightColumns.value = getTableHeaderColumns(type.split('_')[0] + '_monitor_right') as [];
  952. }
  953. leftColumns.value = getTableHeaderColumns(type + '_monitor_left') as [];
  954. if (leftColumns.value && leftColumns.value.length < 1) {
  955. leftColumns.value = getTableHeaderColumns(type.split('_')[0] + '_monitor_left') as [];
  956. }
  957. });
  958. const flvURL1 = () => {
  959. // return `https://sf1-hscdn-tos.pstatp.com/obj/media-fe/xgplayer_doc_video/flv/xgplayer-demo-360p.flv`;
  960. return '';
  961. };
  962. const changeDeviceKind = (e) => {
  963. devicekide.value = e;
  964. loading.value = true;
  965. selectRowIndex.value = -1;
  966. nextTick(() => {
  967. selectData = lodash.cloneDeep(initData);
  968. loading.value = false;
  969. if (selectData.deviceID) MonitorDataTable.value.setSelectedRowKeys([selectData.deviceID]);
  970. const headEl = document.querySelector(`.zxm-table-thead`);
  971. if (headEl) {
  972. headElHeight.value = headEl.clientHeight;
  973. }
  974. });
  975. };
  976. const changePlay = () => {
  977. showPlay.value = !showPlay.value;
  978. };
  979. const tabChange = (activeKeyVal) => {
  980. activeKey.value = activeKeyVal;
  981. if (activeKeyVal == 1) {
  982. nextTick(() => {
  983. MonitorDataTable.value.setSelectedRowKeys([selectData.deviceID]);
  984. });
  985. }
  986. };
  987. const selectDevice = (key, val) => {
  988. if (key === 'dataMonitorRowIndex') {
  989. dataMonitorRowIndex.value = val;
  990. } else {
  991. warningMonitorRowIndex.value = val;
  992. }
  993. };
  994. //报表导出点击
  995. async function reportDown() {
  996. openModal1();
  997. let res = await save({ reportType: 'fanlocal' });
  998. console.log(res, 'res-----------');
  999. let list = await reportList({ id: res.id });
  1000. console.log(list, 'list-----------');
  1001. let index = list.records[0].fileName.indexOf('.');
  1002. fileType.value = list.records[0].fileName.substring(index + 1);
  1003. editID.value = list.records[0].id;
  1004. openModal1();
  1005. }
  1006. //详情
  1007. function goDetail() {
  1008. openModal();
  1009. }
  1010. function goDetailDevice(link需风量DeviceCode) {
  1011. let linkDeviceId = '';
  1012. if (linkDeviceCode.startsWith('window')) {
  1013. linkDeviceId = linkDeviceInfo.value[linkDeviceCode] ? linkDeviceInfo.value[linkDeviceCode]['id'] : '';
  1014. router.push({ path: '/monitorChannel/monitor-window', query: { id: linkDeviceId } });
  1015. }
  1016. }
  1017. //
  1018. async function getDataSource() {
  1019. if (devicekide.value) {
  1020. const res = await list({ devicetype: devicekide.value, pagetype: 'normal' });
  1021. // const res = await list({ devicetype: 'fanlocal', pagetype: 'normal' });
  1022. if (res.msgTxt && res.msgTxt[0] && res.msgTxt[0].datalist && res.msgTxt[0].datalist.length > 0) {
  1023. const dataArr = res.msgTxt[0].datalist || [];
  1024. dataSource.value = [];
  1025. dataArr.forEach((data) => {
  1026. const readData = data.readData;
  1027. data = Object.assign(data, readData);
  1028. if (data['Fan1StartStatus'] && data['Fan1StartStatus'] === '1.0') data['Fan1StartStatus'] = '1';
  1029. if (data['Fan2StartStatus'] && data['Fan2StartStatus'] === '1.0') data['Fan2StartStatus'] = '1';
  1030. if (data['Fan1StartStatus'] && data['Fan1StartStatus'] === '0.0') data['Fan1StartStatus'] = '0';
  1031. if (data['Fan2StartStatus'] && data['Fan2StartStatus'] === '0.0') data['Fan2StartStatus'] = '0';
  1032. data['windQuantity2'] =
  1033. data['windQuantity2'] ||
  1034. data['m3'] ||
  1035. data['ductOutletAirVolume_merge'] ||
  1036. data['windOutSpeed_merge'] ||
  1037. data['windOutSpeed1'] ||
  1038. data['windOutSpeed2'] ||
  1039. data['windOutSpeed_merge'];
  1040. // if (globSetting.sysOrgCode === 'sdmtjtbetmk') {
  1041. // if (data['m3']) data['ductOutletAirVolume_merge'] = data['m3'];
  1042. // if (data['m3']) data['inletAirVolume_merge'] = (Number(data['m3']) * 1.08).toFixed(2);
  1043. // }
  1044. dataSource.value.push(data);
  1045. const m3 = data.windSpeed_merge;
  1046. const fsectarea = data.windSectionArea_merge;
  1047. const needq = data.needq;
  1048. const airVolume = m3 * fsectarea; // 计算风量
  1049. // 更新供风充足评价
  1050. leftColumns1.value[0].value = airVolume >= needq ? '正常' : '不充足';
  1051. if (data.tunnelType === 'coalTunnel') {
  1052. leftColumns1.value[1].value = m3 < 0.25 ? '超限' : '正常';
  1053. } else if (data.tunnelType === 'rockTunnel' || data.tunnelType === 'coalRockTunnel') {
  1054. leftColumns1.value[1].value = m3 < 0.15 ? '超限' : '正常';
  1055. }
  1056. if (!data.airLeakageRatePerHundredX || !data.airLeakageRatePerHundred_merge) {
  1057. leftColumns1.value[2].value = '-';
  1058. } else {
  1059. leftColumns1.value[2].value = data.airLeakageRatePerHundred_merge <= data.airLeakageRatePerHundredX ? '正常' : '不满足';
  1060. }
  1061. });
  1062. if (selectRowIndex.value > -1) {
  1063. const data = dataArr[selectRowIndex.value];
  1064. currentDeviceData.value = data;
  1065. // 存放echarts数据
  1066. if (data && data['readTime']) {
  1067. const dataList = cloneDeep(echartsDataList.value);
  1068. if (dataList.length == 0 || dataList[dataList.length - 1]['readTime'] !== data['readTime']) {
  1069. if (dataList.length < 15) {
  1070. dataList.push({ ...data });
  1071. } else {
  1072. dataList.shift();
  1073. dataList.push({ ...data });
  1074. }
  1075. echartsDataList.value = dataList;
  1076. }
  1077. }
  1078. // 制动控制echarts数据获取
  1079. let echartsData = dataArr[selectRowIndex.value]['history'] || [];
  1080. echartsData = echartsData.filter((item) => {
  1081. item['FanfHz'] = data['Fan1StartStatus'] == '1' ? item['Fan1fHz'] : data['Fan2StartStatus'] == '1' ? item['Fan2fHz'] : 0;
  1082. item['windQuantity2'] =
  1083. item['windQuantity2'] ||
  1084. item['m3'] ||
  1085. item['ductOutletAirVolume_merge'] ||
  1086. item['windOutSpeed_merge'] ||
  1087. item['windOutSpeed1'] ||
  1088. item['windOutSpeed2'] ||
  1089. item['windOutSpeed_merge'];
  1090. return true;
  1091. });
  1092. historyList.value = echartsData;
  1093. }
  1094. } else {
  1095. return (dataSource.value = []);
  1096. }
  1097. } else {
  1098. dataSource.value = [];
  1099. }
  1100. }
  1101. // https获取监测数据
  1102. let timer: null | NodeJS.Timeout = null;
  1103. async function getMonitor(flag?) {
  1104. if (Object.prototype.toString.call(timer) === '[object Null]') {
  1105. timer = await setTimeout(
  1106. async () => {
  1107. // debugger;
  1108. await getDataSource();
  1109. if (dataSource.value.length > 0 && selectRowIndex.value == -1 && MonitorDataTable.value) {
  1110. // 初始打开页面
  1111. if (flag && currentRoute.value && currentRoute.value['query'] && currentRoute.value['query']['id']) {
  1112. MonitorDataTable.value.setSelectedRowKeys(currentRoute.value['query']['id']);
  1113. } else {
  1114. MonitorDataTable.value.setSelectedRowKeys(dataSource.value[0]['deviceID']);
  1115. }
  1116. }
  1117. for (const key in selectData) {
  1118. selectData[key] = '';
  1119. }
  1120. if (dataSource.value.length > 0 && dataSource.value[selectRowIndex.value]) {
  1121. deviceType.value = dataSource.value[selectRowIndex.value]['deviceType'];
  1122. if (dataSource.value.length > 0 && dataSource.value[selectRowIndex.value]) {
  1123. Object.assign(selectData, dataSource.value[selectRowIndex.value]);
  1124. }
  1125. playSmoke(selectData);
  1126. addText(selectData);
  1127. }
  1128. historySource.value = selectData.history;
  1129. if (timer) {
  1130. timer = null;
  1131. }
  1132. getMonitor();
  1133. },
  1134. flag ? 0 : 1000
  1135. );
  1136. }
  1137. }
  1138. // 获取设备基本信息列表
  1139. const deviceBaseList = ref([]);
  1140. function getDeviceBaseList() {
  1141. getTableList({ pageSize: 1000 }).then((res) => {
  1142. deviceBaseList.value = res.records;
  1143. });
  1144. }
  1145. // 切换检测数据
  1146. async function getSelectRow(id) {
  1147. console.log('选中的设备id------->', id);
  1148. if (!id || id == selectData['deviceID']) return;
  1149. // loading.value = true;
  1150. const selectIndex: any = dataSource.value.findIndex((baseData: any) => baseData.deviceID == id);
  1151. selectRowIndex.value = selectIndex;
  1152. nextTick(() => {
  1153. const headEl = document.querySelector(`.zxm-table-thead`);
  1154. if (headEl) {
  1155. headElHeight.value = headEl.clientHeight;
  1156. }
  1157. const data = dataSource.value[selectIndex];
  1158. if (data) {
  1159. if (selectData['linkInfo']) linkDeviceInfo.value = JSON.parse(selectData['linkInfo']);
  1160. if (linkDeviceInfo.value['window_fWindowM3']) {
  1161. modalType.value = 'fc';
  1162. }
  1163. // 主备互斥控制
  1164. if (data['Fan1StartStatus'] == '1') {
  1165. mainWindIsShow1.value = 'open';
  1166. mainWindIsShow2.value = 'stop';
  1167. selectDevice('warningMonitorRowIndex', 0);
  1168. selectDevice('dataMonitorRowIndex', 0);
  1169. } else if (data['Fan2StartStatus'] == '1') {
  1170. mainWindIsShow2.value = 'open';
  1171. mainWindIsShow1.value = 'stop';
  1172. selectDevice('warningMonitorRowIndex', 1);
  1173. selectDevice('dataMonitorRowIndex', 1);
  1174. }
  1175. const xAxisDataGasArr = [];
  1176. for (const key in selectData) {
  1177. if (key.startsWith('gas') && key.length < 5) {
  1178. xAxisDataGasArr.push({ key: 'T' + key.substring(3), valueKey: key });
  1179. }
  1180. }
  1181. xAxisDataGas.value = xAxisDataGasArr;
  1182. }
  1183. setModelType(mainModelType.value, modalType.value);
  1184. });
  1185. await getCamera(id, playerRef.value);
  1186. return;
  1187. }
  1188. // 打开并设置modal的标题
  1189. function showModal(obj) {
  1190. if (!btnClick.value) return;
  1191. if (obj.key == 'kkjc') {
  1192. gasWarningVal.value = 0.6;
  1193. // 工况辅助决策
  1194. openAssistance(true, {});
  1195. return;
  1196. }
  1197. controlType.value = obj.key;
  1198. modalTitle.value = obj.value;
  1199. passWord.value = '';
  1200. modalIsShow.value = true;
  1201. }
  1202. function changeMotor(e) {
  1203. const target = e.target;
  1204. if (target.name === 'localWind1') {
  1205. if (target.value === 'open') {
  1206. mainWindIsShow2.value = 'stop';
  1207. }
  1208. } else if (target.name === 'localWind2') {
  1209. if (target.value === 'open') {
  1210. mainWindIsShow1.value = 'stop';
  1211. }
  1212. }
  1213. }
  1214. function handleOk(control?) {
  1215. if (passWord.value == '') {
  1216. message.warning('请输入密码!');
  1217. return;
  1218. }
  1219. createConfirm({
  1220. iconType: 'warning',
  1221. title: '控制',
  1222. content: '您确定要控制吗?',
  1223. onOk: () => handerFn(),
  1224. });
  1225. const handerFn = () => {
  1226. const handType = controlType.value;
  1227. const data = {
  1228. deviceid: selectData.deviceID,
  1229. devicetype: selectData.deviceType,
  1230. paramcode: '',
  1231. password: passWord.value || globalConfig?.simulatedPassword,
  1232. value: null,
  1233. };
  1234. if (handType === 'startSmoke') {
  1235. // 启动风机
  1236. // 以下是互斥
  1237. if (mainWindIsShow1.value === 'open' && mainWindIsShow2.value === 'stop') {
  1238. // playSmoke(handType, 'top', frequency, 'open');
  1239. data.paramcode = 'CtrlFan1Start';
  1240. deviceControlApi(data)
  1241. .then((res) => {
  1242. if (res.success) {
  1243. if (globalConfig.History_Type == 'remote') {
  1244. message.success('指令已下发至生产管控平台成功!');
  1245. } else {
  1246. message.success('指令已下发成功!');
  1247. }
  1248. modalTitle.value = '';
  1249. modalIsShow.value = false;
  1250. } else {
  1251. message.error(res.message);
  1252. }
  1253. })
  1254. .catch((err) => {
  1255. // modalIsShow.value = true;
  1256. });
  1257. } else if (mainWindIsShow2.value === 'open' && mainWindIsShow1.value === 'stop') {
  1258. // playSmoke(handType, 'down', frequency, 'open');
  1259. data.paramcode = 'CtrlFan2Start';
  1260. deviceControlApi(data)
  1261. .then(() => {
  1262. if (res.success) {
  1263. if (globalConfig.History_Type == 'remote') {
  1264. message.success('指令已下发至生产管控平台成功!');
  1265. } else {
  1266. message.success('指令已下发成功!');
  1267. }
  1268. modalTitle.value = '';
  1269. modalIsShow.value = false;
  1270. } else {
  1271. message.error(res.message);
  1272. }
  1273. })
  1274. .catch((err) => {});
  1275. } else if (mainWindIsShow1.value === 'stop' && mainWindIsShow2.value === 'stop') {
  1276. // playSmoke(handType, '', frequency, 'stop');
  1277. }
  1278. } else if (handType === 'startFan') {
  1279. if (control === 'Fan1Open') {
  1280. data.paramcode = 'CtrlFan1Start';
  1281. } else if (control === 'Fan2Open') {
  1282. data.paramcode = 'CtrlFan2Start';
  1283. } else if (control === 'Fan1Stop') {
  1284. data.paramcode = 'CtrlFan1Stop';
  1285. } else if (control === 'Fan2Stop') {
  1286. data.paramcode = 'CtrlFan2Stop';
  1287. } else if (control === 'Fan1Reset') {
  1288. data.paramcode = 'CtrlFan1Reset';
  1289. } else if (control === 'Fan2Reset') {
  1290. data.paramcode = 'CtrlFan2Reset';
  1291. }
  1292. deviceControlApi(data)
  1293. .then((res) => {
  1294. if (res.success) {
  1295. if (globalConfig.History_Type == 'remote') {
  1296. message.success('指令已下发至生产管控平台成功!');
  1297. } else {
  1298. message.success('指令已下发成功!');
  1299. }
  1300. modalTitle.value = '';
  1301. modalIsShow.value = false;
  1302. } else {
  1303. message.error(res.message);
  1304. }
  1305. })
  1306. .catch((err) => {
  1307. btnClick.value = true;
  1308. });
  1309. } else if (handType === 'Fan1Frequency' || handType === 'Fan2Frequency' || handType === 'FanFrequency') {
  1310. // 调频
  1311. if (handType === 'Fan1Frequency') {
  1312. data.paramcode = 'Fan1FreqHz';
  1313. data.value = fan1FrequencyVal.value;
  1314. } else if (handType === 'Fan2Frequency') {
  1315. data.paramcode = 'Fan2FreqHz';
  1316. data.value = fan2FrequencyVal.value;
  1317. } else if (handType === 'FanFrequency') {
  1318. data.paramcode = 'FreqHz_merge';
  1319. data.value = fan1FrequencyVal.value;
  1320. }
  1321. deviceControlApi(data)
  1322. .then((res) => {
  1323. if (res.success) {
  1324. if (globalConfig.History_Type == 'remote') {
  1325. message.success('指令已下发至生产管控平台成功!');
  1326. } else {
  1327. message.success('指令已下发成功!');
  1328. }
  1329. modalTitle.value = '';
  1330. modalIsShow.value = false;
  1331. } else {
  1332. message.error(res.message);
  1333. }
  1334. })
  1335. .catch((err) => {});
  1336. } else if (handType === 'changeSmoke') {
  1337. if (selectData['Fan1StartStatus'] == '0' || !selectData['Fan1StartStatus']) {
  1338. data.paramcode = 'CtrlFan1Start';
  1339. deviceControlApi(data)
  1340. .then((res) => {
  1341. if (res.success) {
  1342. if (globalConfig.History_Type == 'remote') {
  1343. message.success('指令已下发至生产管控平台成功!');
  1344. } else {
  1345. message.success('指令已下发成功!');
  1346. }
  1347. modalTitle.value = '';
  1348. modalIsShow.value = false;
  1349. } else {
  1350. message.error(res.message);
  1351. }
  1352. mainWindIsShow1.value = 'stop';
  1353. mainWindIsShow2.value = 'open';
  1354. })
  1355. .catch((err) => {});
  1356. } else if (selectData['Fan2StartStatus'] == '0' || !selectData['Fan2StartStatus']) {
  1357. data.paramcode = 'CtrlFan2Start';
  1358. deviceControlApi(data)
  1359. .then((res) => {
  1360. if (res.success) {
  1361. if (globalConfig.History_Type == 'remote') {
  1362. message.success('指令已下发至生产管控平台成功!');
  1363. } else {
  1364. message.success('指令已下发成功!');
  1365. }
  1366. modalTitle.value = '';
  1367. modalIsShow.value = false;
  1368. } else {
  1369. message.error(res.message);
  1370. }
  1371. mainWindIsShow1.value = 'open';
  1372. mainWindIsShow2.value = 'stop';
  1373. })
  1374. .catch((err) => {});
  1375. }
  1376. // // 一键倒机
  1377. // if (mainWindIsShow1.value === 'open' && mainWindIsShow2.value === 'stop') {
  1378. // // playSmoke('startSmoke', 'down', frequency, 'open');
  1379. // data.paramcode = 'CtrlFan2Start';
  1380. // deviceControlApi(data).then((res) => {
  1381. // console.log('设备操作结果', res);
  1382. // modalTitle.value = '';
  1383. // modalIsShow.value = false;
  1384. // }).catch((err) => {
  1385. // });
  1386. // mainWindIsShow1.value = 'stop';
  1387. // mainWindIsShow2.value = 'open';
  1388. // } else if (mainWindIsShow2.value === 'open' && mainWindIsShow1.value === 'stop') {
  1389. // // playSmoke('startSmoke', 'top', frequency, 'open');
  1390. // data.paramcode = 'CtrlFan1Start';
  1391. // deviceControlApi(data).then((res) => {
  1392. // console.log('设备操作结果', res);
  1393. // modalTitle.value = '';
  1394. // modalIsShow.value = false;
  1395. // }).catch((err) => {
  1396. // });
  1397. // mainWindIsShow1.value = 'open';
  1398. // mainWindIsShow2.value = 'stop';
  1399. // } else if (mainWindIsShow1.value === 'stop' && mainWindIsShow2.value === 'stop') {
  1400. // // playSmoke(handType, '', frequency, 'stop');
  1401. // }
  1402. } else if (handType === 'changeFan') {
  1403. data.paramcode = 'CtrlFanStart';
  1404. deviceControlApi(data)
  1405. .then((res) => {
  1406. if (res.success) {
  1407. if (globalConfig.History_Type == 'remote') {
  1408. message.success('指令已下发至生产管控平台成功!');
  1409. } else {
  1410. message.success('指令已下发成功!');
  1411. }
  1412. } else {
  1413. message.error(res.message);
  1414. }
  1415. modalTitle.value = '';
  1416. modalIsShow.value = false;
  1417. })
  1418. .catch((err) => {});
  1419. } else if (handType === 'fan1ToFan2') {
  1420. data.paramcode = 'CtrlFan1ToFan2';
  1421. deviceControlApi(data).then((res) => {
  1422. if (res.success) {
  1423. if (globalConfig.History_Type == 'remote') {
  1424. message.success('指令已下发至生产管控平台成功!');
  1425. } else {
  1426. message.success('指令已下发成功!');
  1427. }
  1428. modalTitle.value = '';
  1429. modalIsShow.value = false;
  1430. } else {
  1431. message.error(res.message);
  1432. }
  1433. });
  1434. } else if (handType === 'fan2ToFan1') {
  1435. data.paramcode = 'CtrlFan2ToFan1';
  1436. deviceControlApi(data).then((res) => {
  1437. if (res.success) {
  1438. if (globalConfig.History_Type == 'remote') {
  1439. message.success('指令已下发至生产管控平台成功!');
  1440. } else {
  1441. message.success('指令已下发成功!');
  1442. }
  1443. modalTitle.value = '';
  1444. modalIsShow.value = false;
  1445. } else {
  1446. message.error(res.message);
  1447. }
  1448. });
  1449. } else if (handType === 'gasAlarmSet') {
  1450. if (passWord.value != '123456') {
  1451. message.error('密码错误,请重新输入!');
  1452. return;
  1453. }
  1454. if (gasWarningVal.value) {
  1455. modalTitle.value = '';
  1456. modalIsShow.value = false;
  1457. setTimeout(() => {
  1458. passWord.value = '';
  1459. modalIsShow.value = true;
  1460. controlType.value = 'toGkjc';
  1461. modalTitle.value = '工况决策辅助';
  1462. }, 500);
  1463. } else {
  1464. message.error('请核对瓦斯超限浓度值!');
  1465. }
  1466. } else if (handType === 'toGkjc') {
  1467. if (passWord.value != '123456') {
  1468. message.error('密码错误,请重新输入!');
  1469. return;
  1470. }
  1471. //进行工况决策
  1472. if (selectData.Fan1StartStatus == '1') {
  1473. openAssistance(true, {
  1474. // m3: selectData.m3 || 675.87,
  1475. m3: 675.87,
  1476. frequency: 30,
  1477. // m3: 525.87, //5.0测试数据
  1478. // frequency: 35,
  1479. // frequency: selectData.Fan1fHz || selectData.Fan1FreqHz || selectData.Fan1Loop_Frequency,
  1480. gasWarningVal: gasWarningVal.value,
  1481. isCompute: false,
  1482. });
  1483. } else if (selectData.Fan2StartStatus == '1') {
  1484. openAssistance(true, {
  1485. // m3: selectData.m3 || 675.87,
  1486. m3: 675.87,
  1487. frequency: 30,
  1488. // frequency: selectData.Fan2fHz || selectData.Fan2FreqHz || selectData.Fan2Loop_Frequency,
  1489. gasWarningVal: gasWarningVal.value,
  1490. isCompute: false,
  1491. });
  1492. } else {
  1493. // openAssistance(true, { m3: 635.04, dataDh: 5748 });
  1494. openAssistance(true);
  1495. }
  1496. modalTitle.value = '';
  1497. modalIsShow.value = false;
  1498. } else if (handType === 'zhlk' || handType === 'gasOverSet') {
  1499. modalIsShow.value = false;
  1500. if (targetVolume.value) {
  1501. const params =
  1502. handType === 'zhlk'
  1503. ? { auto: 1, fanlocalId: selectData.deviceID, xufengliang: targetVolume.value }
  1504. : { auto: 1, fanlocalId: selectData.deviceID, gasMax: gasWarningVal.value };
  1505. autoAdjust(params)
  1506. .then(() => {
  1507. if (hasPermission('echart:show')) activeKey.value = '2';
  1508. if (globalConfig.History_Type == 'remote') {
  1509. message.success('指令已下发至生产管控平台成功!');
  1510. } else {
  1511. message.success('指令已下发成功!');
  1512. }
  1513. modalTitle.value = '';
  1514. })
  1515. .catch(() => {
  1516. message.error('指令下发失败');
  1517. });
  1518. }
  1519. } else if (handType === 'supplyAir') {
  1520. modalIsShow.value = false;
  1521. if (targetVolume1.value) {
  1522. const params = { auto: 1, fanlocalId: selectData.deviceID, xufengliang: targetVolume1.value };
  1523. autoAdjust(params)
  1524. .then(() => {
  1525. if (hasPermission('echart:show')) activeKey.value = '2';
  1526. if (globalConfig.History_Type == 'remote') {
  1527. message.success('指令已下发至生产管控平台成功!');
  1528. } else {
  1529. message.success('指令已下发成功!');
  1530. }
  1531. modalTitle.value = '';
  1532. })
  1533. .catch(() => {
  1534. message.error('指令下发失败');
  1535. });
  1536. }
  1537. openModal2(true, {});
  1538. } else if (handType === 'dischargeGas') {
  1539. modalIsShow.value = false;
  1540. if (gasWarningVal1.value) {
  1541. const params = { auto: 1, fanlocalId: selectData.deviceID, gasMax: gasWarningVal1.value };
  1542. autoAdjust(params)
  1543. .then(() => {
  1544. if (hasPermission('echart:show')) activeKey.value = '2';
  1545. if (globalConfig.History_Type == 'remote') {
  1546. message.success('指令已下发至生产管控平台成功!');
  1547. } else {
  1548. message.success('指令已下发成功!');
  1549. }
  1550. modalTitle.value = '';
  1551. })
  1552. .catch(() => {
  1553. message.error('指令下发失败');
  1554. });
  1555. }
  1556. openModal3(true, {});
  1557. }
  1558. };
  1559. }
  1560. function cancel() {
  1561. modalTitle.value = '';
  1562. modalIsShow.value = false;
  1563. gasWarningVal.value = 0;
  1564. }
  1565. function handleChangeSensor(value: string) {
  1566. console.log(value);
  1567. }
  1568. function addPlayVideo() {
  1569. if (player1.value && player1.value.play) {
  1570. if (!player1.value.paused()) player1.value.play();
  1571. document.body.removeEventListener('mousedown', addPlayVideo);
  1572. }
  1573. }
  1574. function deviceEdit(e: Event, type: string, record) {
  1575. e.stopPropagation();
  1576. openModal(true, {
  1577. type,
  1578. deviceId: record['deviceID'],
  1579. });
  1580. }
  1581. onBeforeMount(() => {
  1582. getDeviceBaseList();
  1583. });
  1584. onMounted(() => {
  1585. const { query } = unref(currentRoute);
  1586. if (query['deviceType']) devicekide.value = query['deviceType'] as string;
  1587. mountedThree('#fanLocal3D', ['#fanLocal3DCSS']).then(async () => {
  1588. await getMonitor(true);
  1589. nextTick(async () => {
  1590. addCssText();
  1591. setModelType(mainModelType.value, modalType.value);
  1592. });
  1593. });
  1594. document.body.addEventListener('mousedown', addPlayVideo, false);
  1595. });
  1596. onUnmounted(() => {
  1597. destroy();
  1598. removeCamera();
  1599. if (timer) {
  1600. clearTimeout(timer);
  1601. timer = undefined;
  1602. }
  1603. });
  1604. </script>
  1605. <style scoped lang="less">
  1606. @import '/@/design/theme.less';
  1607. @import '/@/design/vent/modal.less';
  1608. :deep(.@{ventSpace}-tabs-tabpane-active) {
  1609. height: 100%;
  1610. }
  1611. :deep(.zxm-tabs-content) {
  1612. height: 100%;
  1613. }
  1614. @{theme-deepblue} {
  1615. .scene-box {
  1616. --image-lr-top-bg: url('/@/assets/images/themify/deepblue/vent/lr-top-bg.png');
  1617. --image-lr-tab-bg: url('/@/assets/images/themify/deepblue/vent/lr-tab-bg.png');
  1618. --image-l-tab-active: url('/@/assets/images/themify/deepblue/vent/l-tab-active.png');
  1619. --image-r-tab-active: url('/@/assets/images/themify/deepblue/vent/r-tab-active.png');
  1620. --image-plane-bottom: url('/@/assets/images/themify/deepblue/vent/plane-bottom.png');
  1621. --image-plane-icon-bg: url('/@/assets/images/themify/deepblue/vent/plane-icon-bg.png');
  1622. --container-group-bg: linear-gradient(to right, #ffffff22, #53576305);
  1623. }
  1624. }
  1625. .scene-box {
  1626. --image-lr-top-bg: url('/@/assets/images/vent/lr-top-bg.png');
  1627. --image-lr-tab-bg: url('/@/assets/images/vent/lr-tab-bg.png');
  1628. --image-l-tab-active: url('/@/assets/images/vent/l-tab-active.png');
  1629. --image-r-tab-active: url('/@/assets/images/vent/r-tab-active.png');
  1630. --image-plane-bottom: url('/@/assets/images/vent/plane-bottom.png');
  1631. --image-plane-icon-bg: url('/@/assets/images/vent/plane-icon-bg.png');
  1632. --container-group-bg: linear-gradient(to right, #00deff22, #2081ff05);
  1633. .title-text {
  1634. height: 32px;
  1635. }
  1636. .bottom-tabs-box {
  1637. height: 280px;
  1638. .tabs-box {
  1639. position: relative !important;
  1640. }
  1641. }
  1642. }
  1643. .data-show-box {
  1644. position: relative;
  1645. display: flex;
  1646. flex-direction: row;
  1647. justify-content: space-between;
  1648. padding: 10px 5px;
  1649. color: var(--vent-font-color);
  1650. z-index: 999;
  1651. top: 60px;
  1652. .data-item {
  1653. pointer-events: auto;
  1654. .item-header {
  1655. width: 374px;
  1656. background: var(--image-lr-top-bg) no-repeat;
  1657. background-size: auto;
  1658. height: 32px;
  1659. text-align: center;
  1660. line-height: 34px;
  1661. font-size: 15px;
  1662. font-weight: 600;
  1663. color: #fafafa;
  1664. }
  1665. .item-container {
  1666. width: 346px;
  1667. margin: 0 14px;
  1668. padding: 10px;
  1669. background: #00377c33;
  1670. backdrop-filter: blur(2px);
  1671. .tab {
  1672. width: 323px;
  1673. background: var(--image-lr-tab-bg) no-repeat;
  1674. display: flex;
  1675. .tab-item {
  1676. flex: 1;
  1677. text-align: center;
  1678. padding-top: 2px;
  1679. color: #ffffff99;
  1680. cursor: pointer;
  1681. }
  1682. .tab-item-active-l {
  1683. color: var(--vent-font-action-link);
  1684. background-image: var(--image-l-tab-active);
  1685. background-repeat: no-repeat;
  1686. background-size: auto;
  1687. background-position: 6px 3px;
  1688. }
  1689. .tab-item-active-r {
  1690. color: var(--vent-font-action-link);
  1691. background-image: var(--image-r-tab-active);
  1692. background-repeat: no-repeat;
  1693. background-position: 0 3px;
  1694. }
  1695. }
  1696. .container-group {
  1697. width: 314px;
  1698. margin: 0px 4px;
  1699. background: var(--container-group-bg);
  1700. max-height: 440px;
  1701. overflow-y: auto;
  1702. }
  1703. .container-item {
  1704. width: 100%;
  1705. height: 60px;
  1706. display: flex;
  1707. padding: 10px 0 0 20px;
  1708. margin-bottom: 5px;
  1709. position: relative;
  1710. background: var(--image-plane-bottom) no-repeat;
  1711. background-size: auto;
  1712. background-position: bottom;
  1713. &::before {
  1714. content: '';
  1715. display: block;
  1716. width: 100%;
  1717. height: 5px;
  1718. position: absolute;
  1719. top: 62px;
  1720. left: 0;
  1721. background-color: #73f4ff66;
  1722. backdrop-filter: blur(5px);
  1723. }
  1724. .item-icon {
  1725. width: 54px;
  1726. height: 45px;
  1727. background: var(--image-plane-icon-bg) no-repeat;
  1728. background-size: cover;
  1729. .icon-style {
  1730. font-size: 18px;
  1731. margin: 10px 0 0 20px;
  1732. color: #ffc800;
  1733. }
  1734. }
  1735. .item-name {
  1736. width: 180px;
  1737. display: flex;
  1738. align-items: center; /* 垂直居中 */
  1739. word-wrap: break-word;
  1740. white-space: normal;
  1741. }
  1742. .item-value {
  1743. position: relative;
  1744. height: 26px;
  1745. line-height: 24px;
  1746. margin: 15px 0;
  1747. text-align: center;
  1748. width: 80px;
  1749. border: 1px solid var(--vent-base-border);
  1750. border-radius: 13px;
  1751. background: linear-gradient(to right, #00f5fe44, #0090ff44);
  1752. &::before {
  1753. width: 6px;
  1754. height: 6px;
  1755. content: '';
  1756. position: absolute;
  1757. left: -3px;
  1758. top: 8px;
  1759. background: #ffa500;
  1760. border-radius: 3px;
  1761. }
  1762. }
  1763. .text-red-bold {
  1764. color: red;
  1765. font-weight: bold;
  1766. }
  1767. }
  1768. .warning-header {
  1769. display: flex;
  1770. font-size: 14px;
  1771. .header-item {
  1772. flex: 1;
  1773. display: flex;
  1774. justify-content: center;
  1775. align-items: center;
  1776. .header-title {
  1777. width: 100%;
  1778. text-align: center;
  1779. padding: 1px 0;
  1780. color: var(--vent-font-action-link);
  1781. margin-top: 10px;
  1782. background: #1eb0ff22;
  1783. }
  1784. .header-value {
  1785. // width: 133px;
  1786. height: 36px;
  1787. font-weight: 600;
  1788. font-family: 'douyuFont';
  1789. font-size: 16px;
  1790. color: #ffa500;
  1791. display: flex;
  1792. justify-content: center;
  1793. align-items: center;
  1794. margin-top: 15px;
  1795. margin-left: 8px;
  1796. }
  1797. }
  1798. }
  1799. .warning-group {
  1800. padding: 0 10px;
  1801. position: relative;
  1802. .warning-item {
  1803. display: flex;
  1804. flex-direction: row;
  1805. justify-content: space-between;
  1806. align-items: center;
  1807. height: 38px;
  1808. .item-name {
  1809. display: flex;
  1810. align-items: center;
  1811. // padding-left: 5px;
  1812. .icon {
  1813. width: 6px;
  1814. height: 6px;
  1815. display: inline-block;
  1816. background-color: var(--vent-base-light-bg);
  1817. border-radius: 3px;
  1818. position: relative;
  1819. margin-right: 8px;
  1820. &::before {
  1821. content: '';
  1822. width: 10px;
  1823. height: 10px;
  1824. display: block;
  1825. border: 1px solid #34edff99;
  1826. border-radius: 5px;
  1827. position: absolute;
  1828. top: -2px;
  1829. left: -2px;
  1830. }
  1831. }
  1832. &::before {
  1833. content: '';
  1834. display: block;
  1835. width: 1px;
  1836. height: 38px;
  1837. position: absolute;
  1838. left: 12px;
  1839. background-color: var(--vent-base-light-bg);
  1840. }
  1841. }
  1842. }
  1843. }
  1844. .warning-group-r {
  1845. &::before {
  1846. content: '';
  1847. display: block;
  1848. width: 1px;
  1849. height: 100%;
  1850. position: absolute;
  1851. left: 12px;
  1852. background-color: var(--vent-base-light-bg);
  1853. }
  1854. }
  1855. }
  1856. }
  1857. }
  1858. .input-box {
  1859. display: flex;
  1860. align-items: center;
  1861. .input-title {
  1862. color: #73e8fe;
  1863. width: auto;
  1864. }
  1865. margin-right: 10px;
  1866. }
  1867. .label {
  1868. max-width: 220px;
  1869. }
  1870. #fanLocalSelectDom {
  1871. :deep(.@{ventSpace}-select-dropdown) {
  1872. left: 0px !important;
  1873. top: 35px !important;
  1874. }
  1875. }
  1876. .@{ventSpace}-input {
  1877. width: 150px;
  1878. }
  1879. :deep(#LivePlayerBox) {
  1880. display: flex;
  1881. flex-direction: row;
  1882. justify-content: flex-end;
  1883. padding-right: 380px;
  1884. pointer-events: none;
  1885. .video-parent {
  1886. height: 208px;
  1887. pointer-events: auto !important;
  1888. }
  1889. }
  1890. .to-right {
  1891. :deep(#LivePlayerBox) {
  1892. padding-right: 0px;
  1893. }
  1894. }
  1895. :deep(.button-box) {
  1896. position: relative;
  1897. padding: 5px;
  1898. // border: 1px transparent solid;
  1899. border-radius: 5px;
  1900. margin-left: 8px;
  1901. margin-right: 8px;
  1902. width: auto;
  1903. // height: 40px;
  1904. // border: 1px solid #65dbea;
  1905. height: 35px !important;
  1906. display: flex;
  1907. align-items: center;
  1908. justify-content: center;
  1909. color: var(--vent-font-color);
  1910. padding: 0 15px 5px 15px;
  1911. cursor: pointer;
  1912. &:hover {
  1913. background: var(--vent-device-manager-control-btn-hover);
  1914. }
  1915. &::before {
  1916. width: calc(100% - 6px);
  1917. height: 27px;
  1918. content: '';
  1919. position: absolute;
  1920. top: 3px;
  1921. right: 0;
  1922. left: 3px;
  1923. bottom: 0;
  1924. z-index: -1;
  1925. border-radius: inherit;
  1926. /*important*/
  1927. background: var(--vent-device-manager-control-btn);
  1928. }
  1929. &::after {
  1930. width: calc(100% + 32px);
  1931. height: 10px;
  1932. content: '';
  1933. position: absolute;
  1934. top: 28px;
  1935. right: 0;
  1936. left: -16px;
  1937. bottom: 0;
  1938. z-index: -1;
  1939. border-radius: inherit;
  1940. /*important*/
  1941. background-position: center;
  1942. background-size: 100%;
  1943. z-index: 999;
  1944. }
  1945. }
  1946. .video-icon {
  1947. width: 30px;
  1948. height: 38px;
  1949. position: absolute;
  1950. top: 580px;
  1951. right: 395px;
  1952. color: var(--vent-font-color);
  1953. z-index: 1;
  1954. font-size: 28px;
  1955. }
  1956. .no-play {
  1957. &::after {
  1958. position: absolute;
  1959. width: 80%;
  1960. height: 100%;
  1961. content: '';
  1962. left: 12%;
  1963. top: -5px;
  1964. background: linear-gradient(
  1965. to bottom left,
  1966. transparent 0%,
  1967. transparent calc(50% - 2px),
  1968. #ffffff 50%,
  1969. transparent calc(50% + 2px),
  1970. transparent 100%
  1971. );
  1972. }
  1973. }
  1974. </style>