index.vue 60 KB

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