index.vue 58 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588
  1. <template>
  2. <div
  3. v-show="activeBtn == 'fanLocal-ssjc'"
  4. class="bg"
  5. style="width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; overflow: hidden"
  6. >
  7. <a-spin :spinning="loading" />
  8. <div id="fanLocal3D" style="width: 100%; height: 100%; position: absolute; overflow: hidden"> </div>
  9. <div id="fanLocal3DCSS" class="threejs-Object-CSS" style="width: 100%; height: 100%; position: absolute; overflow: hidden; pointer-events: none">
  10. <div style="z-index: -1; position: relative" v-if="hasPermission('show:sensorMonitor')">
  11. <div class="elementTag" id="inputBox1">
  12. <div class="elementContent" v-if="selectData.windSpeed1 || selectData.gas3 || selectData.windSpeed_merge || selectData.windQuantity1">
  13. <p v-if="selectData.windSpeed1 || selectData.windSpeed_merge"
  14. >风筒入口风速:<span class="value">{{
  15. selectData.windSpeed1 ? selectData.windSpeed1 : selectData.windSpeed_merge ? selectData.windSpeed_merge : '-'
  16. }}</span>
  17. <span class="unit"> m/s</span>
  18. </p>
  19. <p v-if="selectData.windInputSpeed1 || selectData.windInputSpeed_merge"
  20. >风筒入口风速:<span class="value">{{
  21. selectData.windInputSpeed1 ? selectData.windInputSpeed1 : selectData.windInputSpeed_merge ? selectData.windInputSpeed_merge : '-'
  22. }}</span>
  23. <span class="unit"> m/s</span>
  24. </p>
  25. <p v-if="selectData.windQuantity1 || selectData.inletAirVolume_merge"
  26. >风筒入口风量:<span class="value">{{
  27. selectData.windQuantity1 ? selectData.windQuantity1 : selectData.inletAirVolume_merge ? selectData.inletAirVolume_merge : '-'
  28. }}</span>
  29. <span class="unit"> m³/min</span>
  30. </p>
  31. <p v-if="selectData.gas3"
  32. >风筒入口瓦斯浓度: <span class="value">{{ selectData.gas3 ? selectData.gas3 : '-' }}</span>
  33. <span class="unit"> %</span>
  34. </p>
  35. </div>
  36. </div>
  37. <div class="elementTag" id="outBox">
  38. <div
  39. class="elementContent elementContent-r"
  40. v-if="
  41. selectData.windQuantity2 ||
  42. selectData.gas1 ||
  43. (selectData.windOutSpeed1 && selectData.windOutSpeed_merge) ||
  44. selectData.ductOutletAirVolume_merge
  45. "
  46. >
  47. <p v-if="selectData.windQuantity2 || selectData.m3 || selectData.ductOutletAirVolume_merge || selectData.windOutSpeed_merge">
  48. 迎头供风量:<span class="value">{{
  49. selectData.windQuantity2
  50. ? selectData.windQuantity2
  51. : selectData.m3
  52. ? selectData.m3
  53. : selectData.ductOutletAirVolume_merge
  54. ? selectData.ductOutletAirVolume_merge
  55. : '-'
  56. }}</span>
  57. <span class="unit"> m³/min</span>
  58. </p>
  59. <p v-if="selectData.gas1"
  60. >迎头瓦斯浓度:<span class="value">{{ selectData.gas1 ? selectData.gas1 : '-' }}</span>
  61. <span class="unit"> %</span>
  62. </p>
  63. <p v-if="selectData.windOutSpeed1 || selectData.windOutSpeed_merge"
  64. >风筒出口风速<span class="value">{{
  65. selectData.windOutSpeed1 ? selectData.windOutSpeed1 : selectData.windOutSpeed_merge ? selectData.windOutSpeed_merge : '-'
  66. }}</span>
  67. <span class="unit"> %</span>
  68. </p>
  69. </div>
  70. </div>
  71. <div class="elementTag" id="returnBox">
  72. <div class="elementContent elementContent-r" v-if="selectData.gas2">
  73. <p v-if="selectData.gas2"
  74. >回风流瓦斯浓度:<span class="value">{{ selectData.gas2 ? selectData.gas2 : '-' }}</span>
  75. <span class="unit"> %</span>
  76. </p>
  77. </div>
  78. </div>
  79. <div class="elementTag" id="gateBox">
  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>
  106. </div>
  107. </div>
  108. <div class="scene-box">
  109. <div class="top-box" v-if="!loading && activeBtn == 'fanLocal-ssjc'">
  110. <div class="top-center row">
  111. <!-- <div class="vent-flex-row" id="fanLocalSelectDom" v-if="!globalConfig?.simulatedPassword && getDictItemsByCode('fanlocaltype')">
  112. <span style="color: #00f5fe; margin-left: 5px">风机类型:</span>
  113. <JDictSelectTag
  114. style="width: 180px"
  115. v-model:value="devicekide"
  116. dictCode="fanlocaltype"
  117. :showChooseOption="false"
  118. :getPopupContainer="getPopupContainer"
  119. @change="changeDeviceKind"
  120. />
  121. </div> -->
  122. <!-- fanlocal_systeml_zj 模拟局部风机,不显示操作按钮 -->
  123. <template v-for="(item, index) in modalTypeArr.leftBtnArr" :key="index">
  124. <div
  125. v-if="!(selectData.fanFrequencyType == 'fandp' && item.permission.startsWith('btn:frequency')) && hasPermission(item.permission)"
  126. :class="{ 'button-box': btnClick, 'button-disable': !btnClick }"
  127. @click="showModal(item)"
  128. >{{ item.value }}
  129. </div>
  130. </template>
  131. </div>
  132. <div class="top-right row">
  133. <template v-for="(item, index) in modalTypeArr.rightBtnArr" :key="index">
  134. <div
  135. v-if="
  136. !(selectData.fanFrequencyType == 'fandp' && (item.permission === 'fanLocal:gasAlarmSet' || item.permission === 'fanLocal:kkjc')) &&
  137. hasPermission(item.permission)
  138. "
  139. :class="{ 'button-box': btnClick, 'button-disable': !btnClick }"
  140. @click="showModal(item)"
  141. >{{ item.value }}</div
  142. >
  143. </template>
  144. </div>
  145. </div>
  146. <div class="title-text">
  147. {{ selectData.supplyAirAddr || selectData.strinstallpos || selectData.stationname }}
  148. </div>
  149. <div class="data-show-box" v-if="!loading && activeBtn == 'fanLocal-ssjc'">
  150. <div class="data-item" v-if="leftColumns.length > 0">
  151. <div class="item-header">设备监测</div>
  152. <div class="item-container">
  153. <div class="tab">
  154. <div class="tab-item" :class="{ 'tab-item-active-r': warningMonitorRowIndex === 0 }" @click="selectDevice('warningMonitorRowIndex', 0)"
  155. >1#风机</div
  156. >
  157. <div class="tab-item" :class="{ 'tab-item-active-r': warningMonitorRowIndex === 1 }" @click="selectDevice('warningMonitorRowIndex', 1)"
  158. >2#风机</div
  159. >
  160. </div>
  161. <div class="container-group">
  162. <div class="warning-group">
  163. <template v-if="selectData.deviceType">
  164. <div class="container-item" v-for="(data, index) in leftColumns" :key="index">
  165. <div class="item-icon">
  166. <CaretRightOutlined class="icon-style" />
  167. </div>
  168. <div class="item-name">{{ data.title }}</div>
  169. <div v-if="data.dataIndex.startsWith('Fan')">
  170. <div class="item-value" v-if="warningMonitorRowIndex == 0">{{
  171. selectData[data.dataIndex.replace('Fan', 'Fan1')] ? selectData[data.dataIndex.replace('Fan', 'Fan1')] : '-'
  172. }}</div>
  173. <div class="item-value" v-if="warningMonitorRowIndex == 1">{{
  174. selectData[data.dataIndex.replace('Fan', 'Fan2')] ? selectData[data.dataIndex.replace('Fan', 'Fan2')] : '-'
  175. }}</div>
  176. </div>
  177. <div v-else>
  178. <div class="item-value">{{ selectData[data.dataIndex] ? selectData[data.dataIndex] : '-' }}</div>
  179. </div>
  180. </div>
  181. </template>
  182. </div>
  183. </div>
  184. </div>
  185. </div>
  186. <div>
  187. <div class="data-item" v-if="rightColumns.length > 0">
  188. <div class="item-header">环境监测/设备报警</div>
  189. <div class="item-container">
  190. <div class="tab">
  191. <div class="tab-item" :class="{ 'tab-item-active-r': dataMonitorRowIndex == 0 }" @click="selectDevice('dataMonitorRowIndex', 0)"
  192. >1#风机</div
  193. >
  194. <div class="tab-item" :class="{ 'tab-item-active-r': dataMonitorRowIndex == 1 }" @click="selectDevice('dataMonitorRowIndex', 1)"
  195. >2#风机</div
  196. >
  197. </div>
  198. <div class="container-group container-group-l">
  199. <div class="warning-group" style="max-height: 50%; overflow-y: auto">
  200. <template v-if="deviceType">
  201. <div v-for="(state, index) in rightColumns" :key="index">
  202. <template v-if="!state.dataIndex.endsWith('_w')">
  203. <div class="container-item">
  204. <div class="item-icon">
  205. <CaretRightOutlined class="icon-style" />
  206. </div>
  207. <div class="item-name">{{ state.title }}</div>
  208. <div v-if="state.dataIndex.startsWith('Fan')">
  209. <div class="item-value" v-if="dataMonitorRowIndex == 0">{{
  210. selectData[state.dataIndex.replace('Fan', 'Fan1')] ? selectData[state.dataIndex.replace('Fan', 'Fan1')] : '-'
  211. }}</div>
  212. <div class="item-value" v-if="dataMonitorRowIndex == 1">{{
  213. selectData[state.dataIndex.replace('Fan', 'Fan2')] ? selectData[state.dataIndex.replace('Fan', 'Fan2')] : '-'
  214. }}</div>
  215. </div>
  216. <div v-else>
  217. <div class="item-value">{{ selectData[state.dataIndex] ? selectData[state.dataIndex] : '-' }} </div>
  218. </div>
  219. </div>
  220. </template>
  221. </div>
  222. </template>
  223. </div>
  224. <div class="warning-group" style="max-height: 50%; overflow-y: auto">
  225. <div class="warning-header">
  226. <div class="header-item">
  227. <div class="header-title">报警数量</div>
  228. <div class="header-value">{{ selectData['warnLogNotOkCount'] }} </div>
  229. </div>
  230. </div>
  231. <template v-if="deviceType">
  232. <div v-for="(state, index) in leftColumns" :key="index">
  233. <template v-if="state.dataIndex.endsWith('_w')">
  234. <div class="warning-item">
  235. <div class="item-name"> <div class="icon"></div> {{ state.title }} </div>
  236. <div v-if="state.dataIndex.startsWith('Fan')">
  237. <div class="signal-item" v-if="warningMonitorRowIndex == 0">
  238. <div
  239. class="signal-round"
  240. :class="{
  241. 'signal-round-run': selectData[state.dataIndex.replace('Fan', 'Fan1')] == '0',
  242. 'signal-round-warning':
  243. selectData[state.dataIndex.replace('Fan', 'Fan1')] !== undefined &&
  244. selectData[state.dataIndex.replace('Fan', 'Fan1')] == '1',
  245. 'signal-round-gry': selectData[state.dataIndex.replace('Fan', 'Fan1')] === undefined,
  246. }"
  247. ></div>
  248. <div class="vent-margin-l-8">{{
  249. selectData[state.dataIndex.replace('Fan', 'Fan1')] === undefined
  250. ? '无状态'
  251. : selectData[state.dataIndex.replace('Fan', 'Fan1')] == '0'
  252. ? '正常'
  253. : '异常'
  254. }}</div>
  255. </div>
  256. <div class="signal-item" v-if="warningMonitorRowIndex == 1">
  257. <div
  258. class="signal-round"
  259. :class="{
  260. 'signal-round-run': selectData[state.dataIndex.replace('Fan', 'Fan2')] == '0',
  261. 'signal-round-warning':
  262. selectData[state.dataIndex.replace('Fan', 'Fan2')] != undefined &&
  263. selectData[state.dataIndex.replace('Fan', 'Fan2')] == '1',
  264. 'signal-round-gry': selectData[state.dataIndex.replace('Fan', 'Fan2')] == undefined,
  265. }"
  266. ></div>
  267. <div class="vent-margin-l-8">{{
  268. selectData[state.dataIndex.replace('Fan', 'Fan2')] == undefined
  269. ? '无状态'
  270. : selectData[state.dataIndex.replace('Fan', 'Fan2')] == '0'
  271. ? '正常'
  272. : '异常'
  273. }}</div>
  274. </div>
  275. </div>
  276. <div v-else>
  277. <div class="signal-item">
  278. <div
  279. class="signal-round vent-margin-l-8"
  280. :class="{
  281. 'signal-round-run': selectData[state.dataIndex] == '0',
  282. 'signal-round-warning': selectData[state.dataIndex] !== undefined && selectData[state.dataIndex] == '1',
  283. 'signal-round-gry': selectData[state.dataIndex] === undefined,
  284. }"
  285. ></div>
  286. <div class="vent-margin-l-8">{{
  287. selectData[state.dataIndex] === undefined ? '无状态' : selectData[state.dataIndex] == '0' ? '正常' : '异常'
  288. }}</div>
  289. </div>
  290. </div>
  291. </div>
  292. </template>
  293. </div>
  294. </template>
  295. </div>
  296. </div>
  297. </div>
  298. </div>
  299. </div>
  300. </div>
  301. </div>
  302. <div
  303. v-show="activeBtn == 'fanLocal-ssjc'"
  304. ref="playerRef"
  305. :class="{ 'to-right': rightColumns.length < 1 || leftColumns.length < 1, 'to-no-right': rightColumns.length > 0 && leftColumns.length > 0 }"
  306. style="z-index: 999; position: absolute; top: 100px; right: 15px; width: 100%; height: 100%; margin: auto; pointer-events: none"
  307. >
  308. </div>
  309. <a-modal v-model:visible="modalIsShow" :title="modalTitle" :maskStyle="{ backgroundColor: '#000000aa', backdropFilter: 'blur(3px)' }">
  310. <template #footer>
  311. <div v-if="controlType != 'startFan'">
  312. <a-button key="back" @click="cancel">返回</a-button>
  313. <a-button key="submit" type="primary" :loading="loading" @click="handleOk">确定</a-button>
  314. </div>
  315. </template>
  316. <div class="modal-container">
  317. <div class="vent-flex-row">
  318. <ExclamationCircleFilled style="color: #ffb700; font-size: 30px" />
  319. <div class="warning-text">您是否要进行{{ modalTitle }}操作?</div>
  320. </div>
  321. <div class="" v-if="controlType == 'startSmoke'">
  322. <!-- 互斥控制 -->
  323. <div class="startSmoke-select">
  324. <div class="label">1#风机</div>
  325. <a-radio-group v-model:value="mainWindIsShow1" @change="changeMotor" name="localWind1">
  326. <a-radio value="open">开启</a-radio>
  327. <a-radio value="stop">停止</a-radio>
  328. </a-radio-group>
  329. </div>
  330. <div class="startSmoke-select">
  331. <div class="label">2#风机</div>
  332. <a-radio-group v-model:value="mainWindIsShow2" @change="changeMotor" name="localWind2">
  333. <a-radio value="open">开启</a-radio>
  334. <a-radio value="stop">停止</a-radio>
  335. </a-radio-group>
  336. </div>
  337. </div>
  338. <div class="" v-if="controlType == 'startFan'">
  339. <!-- 不互斥控制 -->
  340. <div class="startSmoke-select">
  341. <div class="label">1#风机:</div>
  342. <div :class="{ 'button-box': true, 'button-disable': false }" @click="handleOk('Fan1Open')">开启</div>
  343. <div :class="{ 'button-box': true, 'button-disable': false }" @click="handleOk('Fan1Stop')">停止</div>
  344. <div :class="{ 'button-box': true, 'button-disable': false }" @click="handleOk('Fan1Reset')">复位</div>
  345. </div>
  346. <div class="startSmoke-select">
  347. <div class="label">2#风机:</div>
  348. <div :class="{ 'button-box': true, 'button-disable': false }" @click="handleOk('Fan2Open')">开启</div>
  349. <div :class="{ 'button-box': true, 'button-disable': false }" @click="handleOk('Fan2Stop')">停止</div>
  350. <div :class="{ 'button-box': true, 'button-disable': false }" @click="handleOk('Fan2Reset')">复位</div>
  351. </div>
  352. </div>
  353. <!-- 调频 -->
  354. <div class="vent-flex-row input-box" v-if="controlType == 'Fan1Frequency'">
  355. <div class="label">1#机运行频率(Hz):</div>
  356. <a-input-number size="small" v-model:value="fan1FrequencyVal" :min="20" :max="50" :step="0.1" />
  357. </div>
  358. <div class="vent-flex-row input-box" v-if="controlType == 'Fan2Frequency'">
  359. <div class="label">2#机运行频率(Hz):</div>
  360. <a-input-number size="small" v-model:value="fan2FrequencyVal" :min="20" :max="50" :step="0.1" />
  361. </div>
  362. <div class="vent-flex-row input-box" v-if="controlType == 'FanFrequency'">
  363. <div class="label">风机运行频率(Hz):</div>
  364. <a-input-number size="small" v-model:value="fan1FrequencyVal" :min="20" :max="50" :step="0.1" />
  365. </div>
  366. <div class="vent-flex-row input-box" v-if="controlType == 'disAirAlarm'">
  367. <div class="label">漏风率(%):</div>
  368. <a-input-number size="small" v-model:value="frequencyVal" :min="0" :max="50" :step="0.1" />
  369. </div>
  370. <div class="vent-flex-row input-box" v-if="controlType == 'diameter'">
  371. <div class="label">风筒直径(m):</div>
  372. <a-input-number size="small" v-model:value="frequencyVal" :min="0" :max="50" :step="0.1" />
  373. </div>
  374. <div class="vent-flex-row input-box" v-if="controlType == 'len'">
  375. <div class="label">风筒长度(m):</div>
  376. <a-input-number size="small" v-model:value="frequencyVal" :min="0" :max="50" :step="0.1" />
  377. </div>
  378. <div class="vent-flex-row input-box" v-if="controlType == 'windPowerLimit'">
  379. <div class="label">风电闭锁限值(m³/min):</div>
  380. <a-input-number size="small" v-model:value="frequencyVal" :min="0" :max="50" :step="0.1" />
  381. </div>
  382. <div class="vent-flex-row input-box" v-if="controlType == 'gasPowerLimit'">
  383. <div class="label">瓦斯电闭锁限值(m³/min):</div>
  384. <a-input-number size="small" v-model:value="frequencyVal" :min="0" :max="50" :step="0.1" />
  385. </div>
  386. <div v-if="controlType == 'gasAlarmSet'">
  387. <div class="vent-flex-row input-box">
  388. <div class="label">设置瓦斯超限浓度:</div>
  389. <a-input-number size="small" v-model:value="gasWarningVal" :min="0" :max="1" :step="0.01" />
  390. </div>
  391. </div>
  392. <div v-if="controlType == 'gasAlarm'">
  393. <div class="vent-flex-row input-box">
  394. <div class="label">传感器名称:</div>
  395. <a-select placeholder="传感器" @change="handleChangeSensor" :options="sensorList" v-model:value="modalSensor" />
  396. </div>
  397. <div class="vent-flex-row input-box">
  398. <div class="label">传感器值:</div>
  399. <a-input-number size="small" v-model:value="frequencyVal" :min="0" :max="50" :step="0.1" />
  400. </div>
  401. </div>
  402. <div v-if="controlType == 'airVolumeAlarm'">
  403. <div class="vent-flex-row input-box">
  404. <div class="label">风量上限(m³/min):</div>
  405. <a-input-number size="small" v-model:value="modalTypeArr.rightBtnArr[3].min" :min="0" :max="50" :step="0.1" />
  406. </div>
  407. <div class="vent-flex-row input-box">
  408. <div class="label">风量下限(m³/min):</div>
  409. <a-input-number size="small" v-model:value="modalTypeArr.rightBtnArr[3].max" :min="0" :max="50" :step="0.1" />
  410. </div>
  411. </div>
  412. <div class="vent-flex-row input-box" v-if="controlType == 'zhlk'">
  413. <div class="label">目标风量(m³/min):</div>
  414. <a-input-number size="small" v-model:value="targetVolume" />
  415. </div>
  416. <div v-if="controlType == 'gasOverSet'">
  417. <div class="vent-flex-row input-box">
  418. <div class="label">设置瓦斯超限浓度:</div>
  419. <a-input-number size="small" v-model:value="gasWarningVal" :min="0" :max="1" :step="0.01" />
  420. </div>
  421. </div>
  422. <!-- 启动或停止 -->
  423. <div class="" v-if="controlType == 'startSmoke'"> </div>
  424. <div v-if="!globalConfig?.simulatedPassword" class="vent-flex-row input-box">
  425. <div class="label">操作密码:</div>
  426. <a-input size="small" type="password" v-model:value="passWord" />
  427. </div>
  428. </div>
  429. </a-modal>
  430. <fanlocalHistory v-if="activeBtn == 'fanLocal-history'" :selectData="selectData" :devicekide="devicekide" :deviceId="deviceId" />
  431. <fanlocalWarnHistory v-if="activeBtn == 'fanLocal-warn'" :devicekide="devicekide" :deviceId="deviceId" />
  432. <fanlocalOperateHistory v-if="activeBtn == 'fanLocal-operate'" :devicekide="devicekide" :deviceId="deviceId" />
  433. <fanlocalEchartLine v-if="activeBtn == 'fanLocal-wind'" :historyList="historyList" :chartsColumns="chartsColumns" :deviceId="deviceId" />
  434. <BottomMenu :nav-list="navList" @change="changeActive" />
  435. </template>
  436. <script setup lang="ts">
  437. import { ExclamationCircleFilled, ArrowRightOutlined } from '@ant-design/icons-vue';
  438. import { onBeforeMount, ref, watch, onMounted, nextTick, defineAsyncComponent, reactive, onUnmounted, inject, unref } from 'vue';
  439. import BottomMenu from '/@/views/vent/comment/components/bottomMenu.vue';
  440. import fanlocalHistory from './components/fanlocal-history.vue';
  441. import fanlocalWarnHistory from './components/fanlocal-warn-history.vue';
  442. import fanlocalOperateHistory from './components/fanlocal-operate-history.vue';
  443. import fanlocalEchartLine from './components/fanlocal-echart-line.vue';
  444. import { mountedThree, setModelType, destroy, addCssText, addText, playSmoke } from './fanLocal.three';
  445. import lodash from 'lodash';
  446. import { getTableList, list, autoAdjust } from '/@/views/vent/monitorManager/fanLocalMonitor/fanLocal.api';
  447. import { chartsColumns1, navList } from './fanLocal.data';
  448. import { deviceControlApi } from '/@/api/vent/index';
  449. import { getTableHeaderColumns } from '/@/hooks/web/useWebColumns';
  450. import { useRouter } from 'vue-router';
  451. import type { BasicColumn } from '/@/components/Table/src/types/table';
  452. import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
  453. import { getPopupContainer } from '/@/utils';
  454. import { getDictItemsByCode } from '/@/utils/dict';
  455. import { message } from 'ant-design-vue';
  456. import { useCamera } from '/@/hooks/system/useCamera';
  457. import { CaretRightOutlined } from '@ant-design/icons-vue';
  458. import { usePermission } from '/@/hooks/web/usePermission';
  459. import { useGlobSetting } from '/@/hooks/setting';
  460. import { useMessage } from '/@/hooks/web/useMessage';
  461. const globalConfig = inject('globalConfig');
  462. const { hasPermission } = usePermission();
  463. const { currentRoute } = useRouter();
  464. const router = useRouter();
  465. const { createConfirm } = useMessage();
  466. const globSetting = useGlobSetting();
  467. const modalTypeArr = reactive({
  468. leftBtnArr: [
  469. {
  470. key: 'startSmoke',
  471. value: '启停风机',
  472. permission: 'btn:openclose',
  473. },
  474. {
  475. key: 'startFan',
  476. value: '启停风机',
  477. permission: 'btn:openclose1',
  478. },
  479. {
  480. key: 'changeSmoke', // 主备两个点位
  481. value: '一键倒机',
  482. permission: 'btn:change',
  483. },
  484. {
  485. key: 'changeFan', // 主备一个点位
  486. value: '一键倒机',
  487. permission: 'btn:CtrlFanChange',
  488. },
  489. {
  490. key: 'fan1ToFan2',
  491. value: '1#倒2#',
  492. permission: 'btn:ctrlFan1ToFan2',
  493. },
  494. {
  495. key: 'fan2ToFan1',
  496. value: '2#倒1#',
  497. permission: 'btn:ctrlFan2ToFan1',
  498. },
  499. {
  500. key: 'Fan1Frequency',
  501. value: '1#调频',
  502. permission: 'btn:frequency',
  503. },
  504. {
  505. key: 'Fan2Frequency',
  506. value: '2#调频',
  507. permission: 'btn:frequency',
  508. },
  509. {
  510. key: 'FanFrequency',
  511. value: '风机调频',
  512. permission: 'btn:frequencyMerge',
  513. },
  514. {
  515. key: 'windPower',
  516. value: '风电闭锁',
  517. permission: 'fanLocal:fdbs',
  518. },
  519. {
  520. key: 'gasPower',
  521. value: '瓦斯电闭锁',
  522. permission: 'fanLocal:wsdbs',
  523. },
  524. {
  525. key: 'needAir',
  526. value: '需风量',
  527. permission: 'fanLocal:control',
  528. },
  529. ],
  530. rightBtnArr: [
  531. {
  532. key: 'gasAlarmSet',
  533. value: '瓦斯限值设定',
  534. permission: 'fanLocal:gasAlarmSet',
  535. },
  536. {
  537. key: 'gasOverSet', //
  538. value: '瓦斯限值设定',
  539. permission: 'fanLocal:gasOverSet',
  540. },
  541. {
  542. key: 'kkjc',
  543. value: '工况辅助决策',
  544. permission: 'fanLocal:kkjc',
  545. },
  546. {
  547. key: 'zhlk',
  548. value: '自主联控',
  549. permission: 'fanLocal:zhlk',
  550. },
  551. {
  552. key: 'diameter',
  553. value: '风筒直径',
  554. permission: 'fanLocal:control',
  555. },
  556. {
  557. key: 'diameter',
  558. value: '风筒直径',
  559. permission: 'fanLocal:control',
  560. },
  561. {
  562. key: 'len',
  563. value: '风筒长度',
  564. permission: 'fanLocal:control',
  565. },
  566. // {
  567. // key: 'frequency',
  568. // value: '调频',
  569. // permission: 'fanLocal:control',
  570. // },
  571. {
  572. key: 'windPowerLimit',
  573. value: '风电闭锁限值',
  574. permission: 'fanLocal:control',
  575. },
  576. {
  577. key: 'gasPowerLimit',
  578. value: '瓦斯电闭锁限值',
  579. permission: 'fanLocal:control',
  580. },
  581. {
  582. key: 'airVolumeAlarm',
  583. value: '风量报警',
  584. permission: 'fanLocal:control',
  585. min: 0,
  586. max: 100,
  587. },
  588. {
  589. key: 'disAirAlarm',
  590. value: '漏风率报警',
  591. permission: 'fanLocal:control',
  592. },
  593. // {
  594. // key: 'gasAlarm',
  595. // value: '瓦斯报警',
  596. // permission: 'fanLocal:control',
  597. // },
  598. ],
  599. });
  600. const sensorList = ref<any[]>([
  601. {
  602. value: '1',
  603. label: 'T1',
  604. },
  605. {
  606. value: '2',
  607. label: 'T2',
  608. },
  609. {
  610. value: '3',
  611. label: 'T3',
  612. },
  613. ]);
  614. const scroll = reactive({
  615. y: 180,
  616. });
  617. const deviceTypeDicts = getDictItemsByCode('fanlocaltype');
  618. const gasWarningVal = ref(0.6); // 瓦斯最大报警值
  619. const playerRef = ref();
  620. const modalSensor = ref(null);
  621. const loading = ref(false);
  622. const player1 = ref();
  623. const modalIsShow = ref<boolean>(false); // 是否显示模态框
  624. const modalTitle = ref(''); // 模态框标题显示内容,根据设备操作类型决定
  625. const fan1FrequencyVal = ref(40); //主机频率
  626. const fan2FrequencyVal = ref(40); //备机频率
  627. const mainWindIsShow1 = ref('open'); // 主机默认启动leftColumns
  628. const mainWindIsShow2 = ref('stop'); // 备机默认不启动
  629. const fanControl = ref('');
  630. const targetVolume = ref(600);
  631. const historyList = ref([]);
  632. const remoteChartsColumns = getTableHeaderColumns('fanlocal_chart');
  633. const chartsColumns = remoteChartsColumns && remoteChartsColumns.length > 0 ? remoteChartsColumns : chartsColumns1;
  634. const passWord = ref('');
  635. // 默认初始是第一行
  636. const selectRowIndex = ref(0);
  637. const dataMonitorRowIndex = ref(0);
  638. // 默认数据右边监测的是主机
  639. const warningMonitorRowIndex = ref(0);
  640. const xAxisDataGas = ref([]);
  641. // 设备数据
  642. const controlType = ref('');
  643. const modalType = ref('');
  644. // 监测数据
  645. const initData = {
  646. deviceID: '',
  647. deviceType: '',
  648. strname: '',
  649. dataDh: '-', //压差
  650. dataDtestq: '-', //测试风量
  651. sourcePressure: '-', //气源压力
  652. dataDequivalarea: '-',
  653. netStatus: '0', //通信状态
  654. warnLevel_str: '',
  655. stationname: '',
  656. fanFrequencyType: '',
  657. };
  658. const frequencyVal = ref(0);
  659. const dataSource = ref([]);
  660. // const historySource = ref([]);
  661. // 关联设备信息
  662. const linkDeviceInfo = ref({});
  663. // 监测数据
  664. let selectData = reactive(lodash.cloneDeep(initData));
  665. const rightColumns = ref<BasicColumn[]>([]);
  666. const leftColumns = ref<BasicColumn[]>([]);
  667. const devicekide = ref('');
  668. const deviceType = ref(selectData.deviceType);
  669. const deviceId = ref('');
  670. const headElHeight = ref(0);
  671. let btnClick = ref(true); // 判断按钮是否可点
  672. //报表导出
  673. // let editID = ref<any>('');
  674. // let fileType = ref('');
  675. // https获取监测数据
  676. let timer: null | NodeJS.Timeout | undefined = null;
  677. const { getCamera, removeCamera } = useCamera();
  678. watch(deviceType, (type) => {
  679. rightColumns.value = getTableHeaderColumns(type + '_monitor_right') as [];
  680. if (rightColumns.value && rightColumns.value.length < 1) {
  681. rightColumns.value = getTableHeaderColumns(type.split('_')[0] + '_monitor_right') as [];
  682. }
  683. leftColumns.value = getTableHeaderColumns(type + '_monitor_left') as [];
  684. if (leftColumns.value && leftColumns.value.length < 1) {
  685. leftColumns.value = getTableHeaderColumns(type.split('_')[0] + '_monitor_left') as [];
  686. }
  687. });
  688. const flvURL1 = () => {
  689. // return `https://sf1-hscdn-tos.pstatp.com/obj/media-fe/xgplayer_doc_video/flv/xgplayer-demo-360p.flv`;
  690. return '';
  691. };
  692. const activeBtn = ref('fanLocal-ssjc');
  693. async function changeActive(activeValue) {
  694. activeBtn.value = activeValue;
  695. if (activeBtn.value !== 'fanLocal-ssjc') {
  696. timer = undefined;
  697. clearTimeout(timer);
  698. } else {
  699. timer = null;
  700. await getMonitor(true);
  701. }
  702. }
  703. const selectDevice = (key, val) => {
  704. if (key === 'dataMonitorRowIndex') {
  705. dataMonitorRowIndex.value = val;
  706. } else {
  707. warningMonitorRowIndex.value = val;
  708. }
  709. };
  710. function goDetailDevice(linkDeviceCode) {
  711. let linkDeviceId = '';
  712. if (linkDeviceCode.startsWith('window')) {
  713. linkDeviceId = linkDeviceInfo.value[linkDeviceCode] ? linkDeviceInfo.value[linkDeviceCode]['id'] : '';
  714. router.push({ path: '/monitorChannel/monitor-window', query: { id: linkDeviceId } });
  715. }
  716. }
  717. //
  718. async function getDataSource() {
  719. if (devicekide.value) {
  720. const res = await list({ devicetype: devicekide.value, ids: deviceId.value, pagetype: 'normal' });
  721. // const res = await list({ devicetype: 'fanlocal', pagetype: 'normal' });
  722. if (res.msgTxt && res.msgTxt[0] && res.msgTxt[0].datalist && res.msgTxt[0].datalist.length > 0) {
  723. const dataArr = res.msgTxt[0].datalist || [];
  724. dataSource.value = [];
  725. selectRowIndex.value = dataArr.findIndex((item) => item.deviceID === deviceId.value);
  726. debugger;
  727. if (selectRowIndex.value > -1) {
  728. if (!deviceType.value) deviceType.value = dataArr[selectRowIndex.value]['deviceType'];
  729. let data = dataArr[selectRowIndex.value];
  730. const readData = data.readData;
  731. data = Object.assign(data, readData);
  732. if (data['Fan1StartStatus'] && data['Fan1StartStatus'] === '1.0') data['Fan1StartStatus'] = '1';
  733. if (data['Fan2StartStatus'] && data['Fan2StartStatus'] === '1.0') data['Fan2StartStatus'] = '1';
  734. if (data['Fan1StartStatus'] && data['Fan1StartStatus'] === '0.0') data['Fan1StartStatus'] = '0';
  735. if (data['Fan2StartStatus'] && data['Fan2StartStatus'] === '0.0') data['Fan2StartStatus'] = '0';
  736. data['windQuantity2'] =
  737. data['windQuantity2'] ||
  738. data['m3'] ||
  739. data['ductOutletAirVolume_merge'] ||
  740. data['windOutSpeed_merge'] ||
  741. data['windOutSpeed1'] ||
  742. data['windOutSpeed2'] ||
  743. data['windOutSpeed_merge'];
  744. // if (globSetting.sysOrgCode === 'sdmtjtbetmk') {
  745. // if (data['m3']) data['ductOutletAirVolume_merge'] = data['m3'];
  746. // if (data['m3']) data['inletAirVolume_merge'] = (Number(data['m3']) * 1.08).toFixed(2);
  747. // }
  748. Object.assign(selectData, data);
  749. if (selectRowIndex.value > -1) {
  750. let echartsData = dataArr[selectRowIndex.value]['history'] || [];
  751. echartsData = echartsData.filter((item) => {
  752. item['FanfHz'] = data['Fan1StartStatus'] == '1' ? item['Fan1fHz'] : data['Fan2StartStatus'] == '1' ? item['Fan2fHz'] : 0;
  753. item['windQuantity2'] =
  754. item['windQuantity2'] ||
  755. item['m3'] ||
  756. item['ductOutletAirVolume_merge'] ||
  757. item['windOutSpeed_merge'] ||
  758. item['windOutSpeed1'] ||
  759. item['windOutSpeed2'] ||
  760. item['windOutSpeed_merge'];
  761. return true;
  762. });
  763. historyList.value = echartsData;
  764. }
  765. }
  766. } else {
  767. return (dataSource.value = []);
  768. }
  769. } else {
  770. dataSource.value = [];
  771. }
  772. }
  773. async function getMonitor(flag?) {
  774. if (Object.prototype.toString.call(timer) === '[object Null]') {
  775. timer = await setTimeout(
  776. async () => {
  777. // debugger;
  778. // for (const key in selectData) {
  779. // selectData[key] = '';
  780. // }
  781. await getDataSource();
  782. // if (dataSource.value.length > 0 && dataSource.value[selectRowIndex.value]) {
  783. // deviceType.value = dataSource.value[selectRowIndex.value]['deviceType'];
  784. // if (dataSource.value.length > 0 && dataSource.value[selectRowIndex.value]) {
  785. // Object.assign(selectData, dataSource.value[selectRowIndex.value]);
  786. // }
  787. // }
  788. playSmoke(selectData);
  789. addText(selectData);
  790. // historySource.value = selectData.history;
  791. if (timer) {
  792. timer = null;
  793. }
  794. getMonitor();
  795. },
  796. flag ? 0 : 1000
  797. );
  798. }
  799. }
  800. // 获取设备基本信息列表
  801. const deviceBaseList = ref([]);
  802. function getDeviceBaseList() {
  803. getTableList({ pageSize: 1000 }).then((res) => {
  804. deviceBaseList.value = res.records;
  805. });
  806. }
  807. // 打开并设置modal的标题
  808. function showModal(obj) {
  809. if (!btnClick.value) return;
  810. if (obj.key == 'kkjc') {
  811. gasWarningVal.value = 0.6;
  812. // 工况辅助决策
  813. openAssistance(true, {});
  814. return;
  815. }
  816. controlType.value = obj.key;
  817. modalTitle.value = obj.value;
  818. passWord.value = '';
  819. modalIsShow.value = true;
  820. }
  821. function changeMotor(e) {
  822. const target = e.target;
  823. if (target.name === 'localWind1') {
  824. if (target.value === 'open') {
  825. mainWindIsShow2.value = 'stop';
  826. }
  827. } else if (target.name === 'localWind2') {
  828. if (target.value === 'open') {
  829. mainWindIsShow1.value = 'stop';
  830. }
  831. }
  832. }
  833. function handleOk(control?) {
  834. if (passWord.value == '') {
  835. message.warning('请输入密码!');
  836. return;
  837. }
  838. createConfirm({
  839. iconType: 'warning',
  840. title: '控制',
  841. content: '您确定要控制吗?',
  842. onOk: () => handerFn(),
  843. });
  844. const handerFn = () => {
  845. const handType = controlType.value;
  846. const data = {
  847. deviceid: selectData.deviceID,
  848. devicetype: selectData.deviceType,
  849. paramcode: '',
  850. password: passWord.value || globalConfig?.simulatedPassword,
  851. value: null,
  852. };
  853. if (handType === 'startSmoke') {
  854. // 启动风机
  855. // 以下是互斥
  856. if (mainWindIsShow1.value === 'open' && mainWindIsShow2.value === 'stop') {
  857. // playSmoke(handType, 'top', frequency, 'open');
  858. data.paramcode = 'CtrlFan1Start';
  859. deviceControlApi(data)
  860. .then((res) => {
  861. if (res.success) {
  862. if (globalConfig.History_Type == 'remote') {
  863. message.success('指令已下发至生产管控平台成功!');
  864. } else {
  865. message.success('指令已下发成功!');
  866. }
  867. modalTitle.value = '';
  868. modalIsShow.value = false;
  869. } else {
  870. message.error(res.message);
  871. }
  872. })
  873. .catch((err) => {
  874. // modalIsShow.value = true;
  875. });
  876. } else if (mainWindIsShow2.value === 'open' && mainWindIsShow1.value === 'stop') {
  877. // playSmoke(handType, 'down', frequency, 'open');
  878. data.paramcode = 'CtrlFan2Start';
  879. deviceControlApi(data)
  880. .then(() => {
  881. if (res.success) {
  882. if (globalConfig.History_Type == 'remote') {
  883. message.success('指令已下发至生产管控平台成功!');
  884. } else {
  885. message.success('指令已下发成功!');
  886. }
  887. modalTitle.value = '';
  888. modalIsShow.value = false;
  889. } else {
  890. message.error(res.message);
  891. }
  892. })
  893. .catch((err) => {});
  894. } else if (mainWindIsShow1.value === 'stop' && mainWindIsShow2.value === 'stop') {
  895. // playSmoke(handType, '', frequency, 'stop');
  896. }
  897. } else if (handType === 'startFan') {
  898. if (control === 'Fan1Open') {
  899. data.paramcode = 'CtrlFan1Start';
  900. } else if (control === 'Fan2Open') {
  901. data.paramcode = 'CtrlFan2Start';
  902. } else if (control === 'Fan1Stop') {
  903. data.paramcode = 'CtrlFan1Stop';
  904. } else if (control === 'Fan2Stop') {
  905. data.paramcode = 'CtrlFan2Stop';
  906. } else if (control === 'Fan1Reset') {
  907. data.paramcode = 'CtrlFan1Reset';
  908. } else if (control === 'Fan2Reset') {
  909. data.paramcode = 'CtrlFan2Reset';
  910. }
  911. deviceControlApi(data)
  912. .then((res) => {
  913. if (res.success) {
  914. if (globalConfig.History_Type == 'remote') {
  915. message.success('指令已下发至生产管控平台成功!');
  916. } else {
  917. message.success('指令已下发成功!');
  918. }
  919. modalTitle.value = '';
  920. modalIsShow.value = false;
  921. } else {
  922. message.error(res.message);
  923. }
  924. })
  925. .catch((err) => {
  926. btnClick.value = true;
  927. });
  928. } else if (handType === 'Fan1Frequency' || handType === 'Fan2Frequency' || handType === 'FanFrequency') {
  929. // 调频
  930. if (handType === 'Fan1Frequency') {
  931. data.paramcode = 'Fan1FreqHz';
  932. data.value = fan1FrequencyVal.value;
  933. } else if (handType === 'Fan2Frequency') {
  934. data.paramcode = 'Fan2FreqHz';
  935. data.value = fan2FrequencyVal.value;
  936. } else if (handType === 'FanFrequency') {
  937. data.paramcode = 'FreqHz_merge';
  938. data.value = fan1FrequencyVal.value;
  939. }
  940. deviceControlApi(data)
  941. .then((res) => {
  942. if (res.success) {
  943. if (globalConfig.History_Type == 'remote') {
  944. message.success('指令已下发至生产管控平台成功!');
  945. } else {
  946. message.success('指令已下发成功!');
  947. }
  948. modalTitle.value = '';
  949. modalIsShow.value = false;
  950. } else {
  951. message.error(res.message);
  952. }
  953. })
  954. .catch((err) => {});
  955. } else if (handType === 'changeSmoke') {
  956. if (selectData['Fan1StartStatus'] == '0' || !selectData['Fan1StartStatus']) {
  957. data.paramcode = 'CtrlFan1Start';
  958. deviceControlApi(data)
  959. .then((res) => {
  960. if (res.success) {
  961. if (globalConfig.History_Type == 'remote') {
  962. message.success('指令已下发至生产管控平台成功!');
  963. } else {
  964. message.success('指令已下发成功!');
  965. }
  966. modalTitle.value = '';
  967. modalIsShow.value = false;
  968. } else {
  969. message.error(res.message);
  970. }
  971. mainWindIsShow1.value = 'stop';
  972. mainWindIsShow2.value = 'open';
  973. })
  974. .catch((err) => {});
  975. } else if (selectData['Fan2StartStatus'] == '0' || !selectData['Fan2StartStatus']) {
  976. data.paramcode = 'CtrlFan2Start';
  977. deviceControlApi(data)
  978. .then((res) => {
  979. if (res.success) {
  980. if (globalConfig.History_Type == 'remote') {
  981. message.success('指令已下发至生产管控平台成功!');
  982. } else {
  983. message.success('指令已下发成功!');
  984. }
  985. modalTitle.value = '';
  986. modalIsShow.value = false;
  987. } else {
  988. message.error(res.message);
  989. }
  990. mainWindIsShow1.value = 'open';
  991. mainWindIsShow2.value = 'stop';
  992. })
  993. .catch((err) => {});
  994. }
  995. // // 一键倒机
  996. // if (mainWindIsShow1.value === 'open' && mainWindIsShow2.value === 'stop') {
  997. // // playSmoke('startSmoke', 'down', frequency, 'open');
  998. // data.paramcode = 'CtrlFan2Start';
  999. // deviceControlApi(data).then((res) => {
  1000. // console.log('设备操作结果', res);
  1001. // modalTitle.value = '';
  1002. // modalIsShow.value = false;
  1003. // }).catch((err) => {
  1004. // });
  1005. // mainWindIsShow1.value = 'stop';
  1006. // mainWindIsShow2.value = 'open';
  1007. // } else if (mainWindIsShow2.value === 'open' && mainWindIsShow1.value === 'stop') {
  1008. // // playSmoke('startSmoke', 'top', frequency, 'open');
  1009. // data.paramcode = 'CtrlFan1Start';
  1010. // deviceControlApi(data).then((res) => {
  1011. // console.log('设备操作结果', res);
  1012. // modalTitle.value = '';
  1013. // modalIsShow.value = false;
  1014. // }).catch((err) => {
  1015. // });
  1016. // mainWindIsShow1.value = 'open';
  1017. // mainWindIsShow2.value = 'stop';
  1018. // } else if (mainWindIsShow1.value === 'stop' && mainWindIsShow2.value === 'stop') {
  1019. // // playSmoke(handType, '', frequency, 'stop');
  1020. // }
  1021. } else if (handType === 'changeFan') {
  1022. data.paramcode = 'CtrlFanStart';
  1023. deviceControlApi(data)
  1024. .then((res) => {
  1025. if (res.success) {
  1026. if (globalConfig.History_Type == 'remote') {
  1027. message.success('指令已下发至生产管控平台成功!');
  1028. } else {
  1029. message.success('指令已下发成功!');
  1030. }
  1031. } else {
  1032. message.error(res.message);
  1033. }
  1034. modalTitle.value = '';
  1035. modalIsShow.value = false;
  1036. })
  1037. .catch((err) => {});
  1038. } else if (handType === 'fan1ToFan2') {
  1039. data.paramcode = 'CtrlFan1ToFan2';
  1040. deviceControlApi(data).then((res) => {
  1041. if (res.success) {
  1042. if (globalConfig.History_Type == 'remote') {
  1043. message.success('指令已下发至生产管控平台成功!');
  1044. } else {
  1045. message.success('指令已下发成功!');
  1046. }
  1047. modalTitle.value = '';
  1048. modalIsShow.value = false;
  1049. } else {
  1050. message.error(res.message);
  1051. }
  1052. });
  1053. } else if (handType === 'fan2ToFan1') {
  1054. data.paramcode = 'CtrlFan2ToFan1';
  1055. deviceControlApi(data).then((res) => {
  1056. if (res.success) {
  1057. if (globalConfig.History_Type == 'remote') {
  1058. message.success('指令已下发至生产管控平台成功!');
  1059. } else {
  1060. message.success('指令已下发成功!');
  1061. }
  1062. modalTitle.value = '';
  1063. modalIsShow.value = false;
  1064. } else {
  1065. message.error(res.message);
  1066. }
  1067. });
  1068. } else if (handType === 'gasAlarmSet') {
  1069. if (passWord.value != '123456') {
  1070. message.error('密码错误,请重新输入!');
  1071. return;
  1072. }
  1073. if (gasWarningVal.value) {
  1074. modalTitle.value = '';
  1075. modalIsShow.value = false;
  1076. setTimeout(() => {
  1077. passWord.value = '';
  1078. modalIsShow.value = true;
  1079. controlType.value = 'toGkjc';
  1080. modalTitle.value = '工况决策辅助';
  1081. }, 500);
  1082. } else {
  1083. message.error('请核对瓦斯超限浓度值!');
  1084. }
  1085. } else if (handType === 'toGkjc') {
  1086. if (passWord.value != '123456') {
  1087. message.error('密码错误,请重新输入!');
  1088. return;
  1089. }
  1090. //进行工况决策
  1091. if (selectData.Fan1StartStatus == '1') {
  1092. openAssistance(true, {
  1093. // m3: selectData.m3 || 675.87,
  1094. m3: 675.87,
  1095. frequency: 30,
  1096. // m3: 525.87, //5.0测试数据
  1097. // frequency: 35,
  1098. // frequency: selectData.Fan1fHz || selectData.Fan1FreqHz || selectData.Fan1Loop_Frequency,
  1099. gasWarningVal: gasWarningVal.value,
  1100. isCompute: false,
  1101. });
  1102. } else if (selectData.Fan2StartStatus == '1') {
  1103. openAssistance(true, {
  1104. // m3: selectData.m3 || 675.87,
  1105. m3: 675.87,
  1106. frequency: 30,
  1107. // frequency: selectData.Fan2fHz || selectData.Fan2FreqHz || selectData.Fan2Loop_Frequency,
  1108. gasWarningVal: gasWarningVal.value,
  1109. isCompute: false,
  1110. });
  1111. } else {
  1112. // openAssistance(true, { m3: 635.04, dataDh: 5748 });
  1113. openAssistance(true);
  1114. }
  1115. modalTitle.value = '';
  1116. modalIsShow.value = false;
  1117. } else if (handType === 'zhlk' || handType === 'gasOverSet') {
  1118. if (targetVolume.value) {
  1119. const params =
  1120. handType === 'zhlk'
  1121. ? { auto: 1, fanlocalId: selectData.deviceID, xufengliang: targetVolume.value }
  1122. : { auto: 1, fanlocalId: selectData.deviceID, gasMax: gasWarningVal.value };
  1123. autoAdjust(params).then(() => {
  1124. if (res.success) {
  1125. if (globalConfig.History_Type == 'remote') {
  1126. message.success('指令已下发至生产管控平台成功!');
  1127. } else {
  1128. message.success('指令已下发成功!');
  1129. }
  1130. modalTitle.value = '';
  1131. modalIsShow.value = false;
  1132. } else {
  1133. message.error(res.message);
  1134. }
  1135. });
  1136. }
  1137. }
  1138. };
  1139. }
  1140. function cancel() {
  1141. modalTitle.value = '';
  1142. modalIsShow.value = false;
  1143. gasWarningVal.value = 0;
  1144. }
  1145. function handleChangeSensor(value: string) {
  1146. console.log(value);
  1147. }
  1148. function addPlayVideo() {
  1149. if (player1.value && player1.value.play) {
  1150. if (!player1.value.paused()) player1.value.play();
  1151. document.body.removeEventListener('mousedown', addPlayVideo);
  1152. }
  1153. }
  1154. onBeforeMount(() => {
  1155. getDeviceBaseList();
  1156. });
  1157. onMounted(async () => {
  1158. const { query } = unref(currentRoute);
  1159. if (query['deviceType']) {
  1160. devicekide.value = query['deviceType'] as string;
  1161. deviceId.value = query['id'] as string;
  1162. }
  1163. mountedThree(player1.value).then(async () => {
  1164. await getMonitor(true);
  1165. nextTick(async () => {
  1166. setModelType('fc');
  1167. addCssText();
  1168. });
  1169. });
  1170. await getCamera(deviceId.value, playerRef.value);
  1171. document.body.addEventListener('mousedown', addPlayVideo, false);
  1172. });
  1173. onUnmounted(() => {
  1174. destroy();
  1175. removeCamera();
  1176. if (timer) {
  1177. clearTimeout(timer);
  1178. timer = undefined;
  1179. }
  1180. });
  1181. </script>
  1182. <style scoped lang="less">
  1183. @import '/@/design/theme.less';
  1184. @import '/@/design/vent/modal.less';
  1185. :deep(.@{ventSpace}-tabs-tabpane-active) {
  1186. height: 100%;
  1187. }
  1188. :deep(.zxm-tabs-content) {
  1189. height: 100%;
  1190. }
  1191. @{theme-deepblue} {
  1192. .scene-box {
  1193. --image-lr-top-bg: url('/@/assets/images/themify/deepblue/vent/lr-top-bg.png');
  1194. --image-lr-tab-bg: url('/@/assets/images/themify/deepblue/vent/lr-tab-bg.png');
  1195. --image-l-tab-active: url('/@/assets/images/themify/deepblue/vent/l-tab-active.png');
  1196. --image-r-tab-active: url('/@/assets/images/themify/deepblue/vent/r-tab-active.png');
  1197. --image-plane-bottom: url('/@/assets/images/themify/deepblue/vent/plane-bottom.png');
  1198. --image-plane-icon-bg: url('/@/assets/images/themify/deepblue/vent/plane-icon-bg.png');
  1199. --container-group-bg: linear-gradient(to right, #ffffff22, #53576305);
  1200. }
  1201. }
  1202. .scene-box {
  1203. --image-lr-top-bg: url('/@/assets/images/vent/lr-top-bg.png');
  1204. --image-lr-tab-bg: url('/@/assets/images/vent/lr-tab-bg.png');
  1205. --image-l-tab-active: url('/@/assets/images/vent/l-tab-active.png');
  1206. --image-r-tab-active: url('/@/assets/images/vent/r-tab-active.png');
  1207. --image-plane-bottom: url('/@/assets/images/vent/plane-bottom.png');
  1208. --image-plane-icon-bg: url('/@/assets/images/vent/plane-icon-bg.png');
  1209. --container-group-bg: linear-gradient(to right, #00deff22, #2081ff05);
  1210. .title-text {
  1211. height: 32px;
  1212. }
  1213. }
  1214. .data-show-box {
  1215. position: relative;
  1216. display: flex;
  1217. flex-direction: row;
  1218. justify-content: space-between;
  1219. padding: 10px 5px;
  1220. color: var(--vent-font-color);
  1221. z-index: 999;
  1222. top: 60px;
  1223. .data-item {
  1224. pointer-events: auto;
  1225. .item-header {
  1226. width: 374px;
  1227. background: var(--image-lr-top-bg) no-repeat;
  1228. background-size: auto;
  1229. height: 32px;
  1230. text-align: center;
  1231. line-height: 34px;
  1232. font-size: 15px;
  1233. font-weight: 600;
  1234. color: #fafafa;
  1235. }
  1236. .item-container {
  1237. width: 346px;
  1238. margin: 0 14px;
  1239. padding: 10px;
  1240. background: #00377c33;
  1241. backdrop-filter: blur(2px);
  1242. .tab {
  1243. width: 323px;
  1244. background: var(--image-lr-tab-bg) no-repeat;
  1245. display: flex;
  1246. .tab-item {
  1247. flex: 1;
  1248. text-align: center;
  1249. padding-top: 2px;
  1250. color: #ffffff99;
  1251. cursor: pointer;
  1252. }
  1253. .tab-item-active-l {
  1254. color: var(--vent-font-action-link);
  1255. background-image: var(--image-l-tab-active);
  1256. background-repeat: no-repeat;
  1257. background-size: auto;
  1258. background-position: 6px 3px;
  1259. }
  1260. .tab-item-active-r {
  1261. color: var(--vent-font-action-link);
  1262. background-image: var(--image-r-tab-active);
  1263. background-repeat: no-repeat;
  1264. background-position: 0 3px;
  1265. }
  1266. }
  1267. .container-group {
  1268. width: 314px;
  1269. margin: 0px 4px;
  1270. padding: 10px 0;
  1271. min-height: 432px;
  1272. background: var(--container-group-bg);
  1273. max-height: 440px;
  1274. overflow-y: auto;
  1275. }
  1276. .container-item {
  1277. width: 100%;
  1278. height: 60px;
  1279. display: flex;
  1280. padding: 10px 0 0 20px;
  1281. margin-bottom: 5px;
  1282. position: relative;
  1283. background: var(--image-plane-bottom) no-repeat;
  1284. background-size: auto;
  1285. background-position: bottom;
  1286. &::before {
  1287. content: '';
  1288. display: block;
  1289. width: 100%;
  1290. height: 5px;
  1291. position: absolute;
  1292. top: 62px;
  1293. left: 0;
  1294. background-color: #73f4ff66;
  1295. backdrop-filter: blur(5px);
  1296. }
  1297. .item-icon {
  1298. width: 54px;
  1299. height: 45px;
  1300. background: var(--image-plane-icon-bg) no-repeat;
  1301. background-size: cover;
  1302. .icon-style {
  1303. font-size: 18px;
  1304. margin: 10px 0 0 20px;
  1305. color: #ffc800;
  1306. }
  1307. }
  1308. .item-name {
  1309. width: 180px;
  1310. line-height: 60px;
  1311. }
  1312. .item-value {
  1313. position: relative;
  1314. height: 26px;
  1315. line-height: 24px;
  1316. margin: 15px 0;
  1317. text-align: center;
  1318. width: 80px;
  1319. border: 1px solid var(--vent-base-border);
  1320. border-radius: 13px;
  1321. background: linear-gradient(to right, #00f5fe44, #0090ff44);
  1322. &::before {
  1323. width: 6px;
  1324. height: 6px;
  1325. content: '';
  1326. position: absolute;
  1327. left: -3px;
  1328. top: 8px;
  1329. background: #ffa500;
  1330. border-radius: 3px;
  1331. }
  1332. }
  1333. }
  1334. .warning-header {
  1335. display: flex;
  1336. font-size: 14px;
  1337. .header-item {
  1338. flex: 1;
  1339. display: flex;
  1340. justify-content: center;
  1341. align-items: center;
  1342. .header-title {
  1343. color: var(--vent-font-color);
  1344. margin-top: 10px;
  1345. }
  1346. .header-value {
  1347. // width: 133px;
  1348. height: 36px;
  1349. font-weight: 600;
  1350. font-family: 'douyuFont';
  1351. font-size: 16px;
  1352. color: #ffa500;
  1353. display: flex;
  1354. justify-content: center;
  1355. align-items: center;
  1356. margin-top: 15px;
  1357. margin-left: 8px;
  1358. }
  1359. }
  1360. }
  1361. .warning-group {
  1362. padding: 0 10px;
  1363. position: relative;
  1364. .warning-item {
  1365. display: flex;
  1366. flex-direction: row;
  1367. justify-content: space-between;
  1368. align-items: center;
  1369. height: 38px;
  1370. .item-name {
  1371. display: flex;
  1372. align-items: center;
  1373. // padding-left: 5px;
  1374. .icon {
  1375. width: 6px;
  1376. height: 6px;
  1377. display: inline-block;
  1378. background-color: var(--vent-base-light-bg);
  1379. border-radius: 3px;
  1380. position: relative;
  1381. margin-right: 8px;
  1382. &::before {
  1383. content: '';
  1384. width: 10px;
  1385. height: 10px;
  1386. display: block;
  1387. border: 1px solid #34edff99;
  1388. border-radius: 5px;
  1389. position: absolute;
  1390. top: -2px;
  1391. left: -2px;
  1392. }
  1393. }
  1394. &::before {
  1395. content: '';
  1396. display: block;
  1397. width: 1px;
  1398. height: 38px;
  1399. position: absolute;
  1400. left: 12px;
  1401. background-color: var(--vent-base-light-bg);
  1402. }
  1403. }
  1404. }
  1405. }
  1406. .warning-group-r {
  1407. &::before {
  1408. content: '';
  1409. display: block;
  1410. width: 1px;
  1411. height: 100%;
  1412. position: absolute;
  1413. left: 12px;
  1414. background-color: var(--vent-base-light-bg);
  1415. }
  1416. }
  1417. }
  1418. }
  1419. }
  1420. .input-box {
  1421. display: flex;
  1422. align-items: center;
  1423. .input-title {
  1424. color: #73e8fe;
  1425. width: auto;
  1426. }
  1427. margin-right: 10px;
  1428. }
  1429. .label {
  1430. max-width: 220px;
  1431. }
  1432. #fanLocalSelectDom {
  1433. :deep(.@{ventSpace}-select-dropdown) {
  1434. left: 0px !important;
  1435. top: 35px !important;
  1436. }
  1437. }
  1438. .@{ventSpace}-input {
  1439. width: 150px;
  1440. }
  1441. :deep(#LivePlayerBox) {
  1442. display: flex;
  1443. flex-direction: row;
  1444. justify-content: flex-end;
  1445. padding-right: 380px;
  1446. pointer-events: none;
  1447. .video-parent {
  1448. height: 208px;
  1449. pointer-events: auto !important;
  1450. }
  1451. }
  1452. .to-right {
  1453. :deep(#LivePlayerBox) {
  1454. padding-right: 0px;
  1455. }
  1456. }
  1457. :deep(.button-box) {
  1458. position: relative;
  1459. padding: 5px;
  1460. // border: 1px transparent solid;
  1461. border-radius: 5px;
  1462. margin-left: 8px;
  1463. margin-right: 8px;
  1464. width: auto;
  1465. // height: 40px;
  1466. // border: 1px solid #65dbea;
  1467. height: 35px !important;
  1468. display: flex;
  1469. align-items: center;
  1470. justify-content: center;
  1471. color: var(--vent-font-color);
  1472. padding: 0 15px 5px 15px;
  1473. cursor: pointer;
  1474. &:hover {
  1475. background: var(--vent-device-manager-control-btn-hover);
  1476. }
  1477. &::before {
  1478. width: calc(100% - 6px);
  1479. height: 27px;
  1480. content: '';
  1481. position: absolute;
  1482. top: 3px;
  1483. right: 0;
  1484. left: 3px;
  1485. bottom: 0;
  1486. z-index: -1;
  1487. border-radius: inherit;
  1488. /*important*/
  1489. background: var(--vent-device-manager-control-btn);
  1490. }
  1491. &::after {
  1492. width: calc(100% + 32px);
  1493. height: 10px;
  1494. content: '';
  1495. position: absolute;
  1496. top: 28px;
  1497. right: 0;
  1498. left: -16px;
  1499. bottom: 0;
  1500. z-index: -1;
  1501. border-radius: inherit;
  1502. /*important*/
  1503. background-position: center;
  1504. background-size: 100%;
  1505. z-index: 999;
  1506. }
  1507. }
  1508. </style>