index.vue 60 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616
  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: 'diameter',
  620. value: '风筒直径',
  621. permission: 'fanLocal:control',
  622. },
  623. {
  624. key: 'diameter',
  625. value: '风筒直径',
  626. permission: 'fanLocal:control',
  627. },
  628. {
  629. key: 'len',
  630. value: '风筒长度',
  631. permission: 'fanLocal:control',
  632. },
  633. // {
  634. // key: 'frequency',
  635. // value: '调频',
  636. // permission: 'fanLocal:control',
  637. // },
  638. {
  639. key: 'windPowerLimit',
  640. value: '风电闭锁限值',
  641. permission: 'fanLocal:control',
  642. },
  643. {
  644. key: 'gasPowerLimit',
  645. value: '瓦斯电闭锁限值',
  646. permission: 'fanLocal:control',
  647. },
  648. {
  649. key: 'airVolumeAlarm',
  650. value: '风量报警',
  651. permission: 'fanLocal:control',
  652. min: 0,
  653. max: 100,
  654. },
  655. {
  656. key: 'disAirAlarm',
  657. value: '漏风率报警',
  658. permission: 'fanLocal:control',
  659. },
  660. // {
  661. // key: 'gasAlarm',
  662. // value: '瓦斯报警',
  663. // permission: 'fanLocal:control',
  664. // },
  665. ],
  666. });
  667. const sensorList = ref<any[]>([
  668. {
  669. value: '1',
  670. label: 'T1',
  671. },
  672. {
  673. value: '2',
  674. label: 'T2',
  675. },
  676. {
  677. value: '3',
  678. label: 'T3',
  679. },
  680. ]);
  681. const scroll = reactive({
  682. y: 180,
  683. });
  684. const gasWarningVal = ref(0.6); // 瓦斯最大报警值
  685. const playerRef = ref();
  686. const MonitorDataTable = ref();
  687. const modalSensor = ref(null);
  688. const loading = ref(false);
  689. const activeKey = ref('1');
  690. const player1 = ref();
  691. const modalIsShow = ref<boolean>(false); // 是否显示模态框
  692. const modalTitle = ref(''); // 模态框标题显示内容,根据设备操作类型决定
  693. const fan1FrequencyVal = ref(40); //主机频率
  694. const fan2FrequencyVal = ref(40); //备机频率
  695. const mainWindIsShow1 = ref('open'); // 主机默认启动leftColumns
  696. const mainWindIsShow2 = ref('stop'); // 备机默认不启动
  697. const fanControl = ref('');
  698. const passWord = ref('');
  699. // 默认初始是第一行
  700. const selectRowIndex = ref(-1);
  701. const dataMonitorRowIndex = ref(0);
  702. // 默认数据右边监测的是主机
  703. const warningMonitorRowIndex = ref(0);
  704. const xAxisDataGas = ref([]);
  705. // 设备数据
  706. const controlType = ref('');
  707. const modalType = ref('');
  708. // 监测数据
  709. const initData = {
  710. deviceID: '',
  711. deviceType: '',
  712. strname: '',
  713. dataDh: '-', //压差
  714. dataDtestq: '-', //测试风量
  715. sourcePressure: '-', //气源压力
  716. dataDequivalarea: '-',
  717. netStatus: '0', //通信状态
  718. warnLevel_str: '',
  719. stationname: '',
  720. fanFrequencyType: '',
  721. };
  722. const frequencyVal = ref(0);
  723. const dataSource = ref([]);
  724. const historySource = ref([]);
  725. // 关联设备信息
  726. const linkDeviceInfo = ref({});
  727. // 监测数据
  728. let selectData = reactive(lodash.cloneDeep(initData));
  729. const rightColumns = ref<BasicColumn[]>([]);
  730. const leftColumns = ref<BasicColumn[]>([]);
  731. const devicekide = ref('fanlocal');
  732. const deviceType = ref(selectData.deviceType);
  733. const headElHeight = ref(0);
  734. let btnClick = ref(true); // 判断按钮是否可点
  735. //报表导出
  736. let editID = ref<any>('');
  737. let fileType = ref('');
  738. const { getCamera, removeCamera } = useCamera();
  739. watch(deviceType, (type) => {
  740. rightColumns.value = getTableHeaderColumns(type + '_monitor_right') as [];
  741. if (rightColumns.value && rightColumns.value.length < 1) {
  742. rightColumns.value = getTableHeaderColumns(type.split('_')[0] + '_monitor_right') as [];
  743. }
  744. leftColumns.value = getTableHeaderColumns(type + '_monitor_left') as [];
  745. if (leftColumns.value && leftColumns.value.length < 1) {
  746. leftColumns.value = getTableHeaderColumns(type.split('_')[0] + '_monitor_left') as [];
  747. }
  748. });
  749. const flvURL1 = () => {
  750. // return `https://sf1-hscdn-tos.pstatp.com/obj/media-fe/xgplayer_doc_video/flv/xgplayer-demo-360p.flv`;
  751. return '';
  752. };
  753. const changeDeviceKind = (e) => {
  754. devicekide.value = e;
  755. loading.value = true;
  756. selectRowIndex.value = -1;
  757. nextTick(() => {
  758. selectData = lodash.cloneDeep(initData);
  759. loading.value = false;
  760. if (selectData.deviceID) MonitorDataTable.value.setSelectedRowKeys([selectData.deviceID]);
  761. const headEl = document.querySelector(`.zxm-table-thead`);
  762. if (headEl) {
  763. headElHeight.value = headEl.clientHeight;
  764. }
  765. });
  766. };
  767. const tabChange = (activeKeyVal) => {
  768. activeKey.value = activeKeyVal;
  769. if (activeKeyVal == 1) {
  770. nextTick(() => {
  771. MonitorDataTable.value.setSelectedRowKeys([selectData.deviceID]);
  772. });
  773. }
  774. };
  775. const selectDevice = (key, val) => {
  776. if (key === 'dataMonitorRowIndex') {
  777. dataMonitorRowIndex.value = val;
  778. } else {
  779. warningMonitorRowIndex.value = val;
  780. }
  781. };
  782. //报表导出点击
  783. async function reportDown() {
  784. openModal1();
  785. let res = await save({ reportType: 'fanlocal' });
  786. console.log(res, 'res-----------');
  787. let list = await reportList({ id: res.id });
  788. console.log(list, 'list-----------');
  789. let index = list.records[0].fileName.indexOf('.');
  790. fileType.value = list.records[0].fileName.substring(index + 1);
  791. editID.value = list.records[0].id;
  792. openModal1();
  793. }
  794. //详情
  795. function goDetail() {
  796. openModal();
  797. }
  798. function goDetailDevice(linkDeviceCode) {
  799. let linkDeviceId = '';
  800. if (linkDeviceCode.startsWith('window')) {
  801. linkDeviceId = linkDeviceInfo.value[linkDeviceCode] ? linkDeviceInfo.value[linkDeviceCode]['id'] : '';
  802. router.push({ path: '/monitorChannel/monitor-window', query: { id: linkDeviceId } });
  803. }
  804. }
  805. //
  806. async function getDataSource() {
  807. if (devicekide.value) {
  808. // const res = await list({ devicetype: devicekide.value, pagetype: 'normal' });
  809. const res = await list({ devicetype: 'fanlocal', pagetype: 'normal' });
  810. if (res.msgTxt && res.msgTxt[0] && res.msgTxt[0].datalist && res.msgTxt[0].datalist.length > 0) {
  811. const dataArr = res.msgTxt[0].datalist || [];
  812. dataSource.value = [];
  813. dataArr.forEach((data) => {
  814. const readData = data.readData;
  815. data = Object.assign(data, readData);
  816. if (data['Fan1StartStatus'] && data['Fan1StartStatus'] === '1.0') data['Fan1StartStatus'] = '1';
  817. if (data['Fan2StartStatus'] && data['Fan2StartStatus'] === '1.0') data['Fan2StartStatus'] = '1';
  818. if (data['Fan1StartStatus'] && data['Fan1StartStatus'] === '0.0') data['Fan1StartStatus'] = '0';
  819. if (data['Fan2StartStatus'] && data['Fan2StartStatus'] === '0.0') data['Fan2StartStatus'] = '0';
  820. // if (globSetting.sysOrgCode === 'sdmtjtbetmk') {
  821. // if (data['m3']) data['ductOutletAirVolume_merge'] = data['m3'];
  822. // if (data['m3']) data['inletAirVolume_merge'] = (Number(data['m3']) * 1.08).toFixed(2);
  823. // }
  824. dataSource.value.push(data);
  825. });
  826. } else {
  827. return (dataSource.value = []);
  828. }
  829. } else {
  830. dataSource.value = [];
  831. }
  832. }
  833. // https获取监测数据
  834. let timer: null | NodeJS.Timeout = null;
  835. async function getMonitor(flag?) {
  836. if (Object.prototype.toString.call(timer) === '[object Null]') {
  837. timer = await setTimeout(
  838. async () => {
  839. // debugger;
  840. await getDataSource();
  841. if (dataSource.value.length > 0 && selectRowIndex.value == -1 && MonitorDataTable.value) {
  842. // 初始打开页面
  843. if (flag && currentRoute.value && currentRoute.value['query'] && currentRoute.value['query']['id']) {
  844. MonitorDataTable.value.setSelectedRowKeys(currentRoute.value['query']['id']);
  845. } else {
  846. MonitorDataTable.value.setSelectedRowKeys(dataSource.value[0]['deviceID']);
  847. }
  848. }
  849. for (const key in selectData) {
  850. selectData[key] = '';
  851. }
  852. if (dataSource.value.length > 0 && dataSource.value[selectRowIndex.value]) {
  853. deviceType.value = dataSource.value[selectRowIndex.value]['deviceType'];
  854. if (dataSource.value.length > 0 && dataSource.value[selectRowIndex.value]) {
  855. Object.assign(selectData, dataSource.value[selectRowIndex.value]);
  856. }
  857. playSmoke(selectData);
  858. addText(selectData);
  859. }
  860. historySource.value = selectData.history;
  861. if (timer) {
  862. timer = null;
  863. }
  864. getMonitor();
  865. },
  866. flag ? 0 : 1000
  867. );
  868. }
  869. }
  870. // 获取设备基本信息列表
  871. const deviceBaseList = ref([]);
  872. function getDeviceBaseList() {
  873. getTableList({ pageSize: 1000 }).then((res) => {
  874. deviceBaseList.value = res.records;
  875. });
  876. }
  877. // 切换检测数据
  878. async function getSelectRow(id) {
  879. console.log('选中的设备id------->', id);
  880. if (!id || id == selectData['deviceID']) return;
  881. // loading.value = true;
  882. const selectIndex: any = dataSource.value.findIndex((baseData: any) => baseData.deviceID == id);
  883. selectRowIndex.value = selectIndex;
  884. nextTick(() => {
  885. const headEl = document.querySelector(`.zxm-table-thead`);
  886. if (headEl) {
  887. headElHeight.value = headEl.clientHeight;
  888. }
  889. const data = dataSource.value[selectIndex];
  890. if (data) {
  891. if (selectData['linkInfo']) linkDeviceInfo.value = JSON.parse(selectData['linkInfo']);
  892. if (linkDeviceInfo.value['window_fWindowM3']) {
  893. modalType.value = 'fc';
  894. }
  895. // 主备互斥控制
  896. if (data['Fan1StartStatus'] == '1') {
  897. mainWindIsShow1.value = 'open';
  898. mainWindIsShow2.value = 'stop';
  899. selectDevice('warningMonitorRowIndex', 0);
  900. selectDevice('dataMonitorRowIndex', 0);
  901. } else if (data['Fan2StartStatus'] == '1') {
  902. mainWindIsShow2.value = 'open';
  903. mainWindIsShow1.value = 'stop';
  904. selectDevice('warningMonitorRowIndex', 1);
  905. selectDevice('dataMonitorRowIndex', 1);
  906. }
  907. const xAxisDataGasArr = [];
  908. for (const key in selectData) {
  909. if (key.startsWith('gas') && key.length < 5) {
  910. xAxisDataGasArr.push({ key: 'T' + key.substring(3), valueKey: key });
  911. }
  912. }
  913. xAxisDataGas.value = xAxisDataGasArr;
  914. }
  915. setModelType(modalType.value);
  916. });
  917. await getCamera(id, playerRef.value);
  918. return;
  919. }
  920. // 打开并设置modal的标题
  921. function showModal(obj) {
  922. if (!btnClick.value) return;
  923. if (obj.key == 'kkjc') {
  924. gasWarningVal.value = 0.6;
  925. // 工况辅助决策
  926. openAssistance(true, {});
  927. return;
  928. }
  929. controlType.value = obj.key;
  930. modalTitle.value = obj.value;
  931. passWord.value = '';
  932. modalIsShow.value = true;
  933. }
  934. function changeMotor(e) {
  935. const target = e.target;
  936. if (target.name === 'localWind1') {
  937. if (target.value === 'open') {
  938. mainWindIsShow2.value = 'stop';
  939. }
  940. } else if (target.name === 'localWind2') {
  941. if (target.value === 'open') {
  942. mainWindIsShow1.value = 'stop';
  943. }
  944. }
  945. }
  946. function handleOk(control?) {
  947. if (passWord.value == '') {
  948. message.warning('请输入密码!');
  949. return;
  950. }
  951. createConfirm({
  952. iconType: 'warning',
  953. title: '控制',
  954. content: '您确定要控制吗?',
  955. onOk: () => handerFn(),
  956. });
  957. const handerFn = () => {
  958. const handType = controlType.value;
  959. const data = {
  960. deviceid: selectData.deviceID,
  961. devicetype: selectData.deviceType,
  962. paramcode: '',
  963. password: passWord.value || globalConfig?.simulatedPassword,
  964. value: null,
  965. };
  966. if (handType === 'startSmoke') {
  967. // 启动风机
  968. // 以下是互斥
  969. if (mainWindIsShow1.value === 'open' && mainWindIsShow2.value === 'stop') {
  970. // playSmoke(handType, 'top', frequency, 'open');
  971. data.paramcode = 'CtrlFan1Start';
  972. deviceControlApi(data)
  973. .then((res) => {
  974. if (res.success) {
  975. if (globalConfig.History_Type == 'remote') {
  976. message.success('指令已下发至生产管控平台成功!');
  977. } else {
  978. message.success('指令已下发成功!');
  979. }
  980. modalTitle.value = '';
  981. modalIsShow.value = false;
  982. } else {
  983. message.error(res.message);
  984. }
  985. })
  986. .catch((err) => {
  987. // modalIsShow.value = true;
  988. });
  989. } else if (mainWindIsShow2.value === 'open' && mainWindIsShow1.value === 'stop') {
  990. // playSmoke(handType, 'down', frequency, 'open');
  991. data.paramcode = 'CtrlFan2Start';
  992. deviceControlApi(data)
  993. .then(() => {
  994. if (res.success) {
  995. if (globalConfig.History_Type == 'remote') {
  996. message.success('指令已下发至生产管控平台成功!');
  997. } else {
  998. message.success('指令已下发成功!');
  999. }
  1000. modalTitle.value = '';
  1001. modalIsShow.value = false;
  1002. } else {
  1003. message.error(res.message);
  1004. }
  1005. })
  1006. .catch((err) => {});
  1007. } else if (mainWindIsShow1.value === 'stop' && mainWindIsShow2.value === 'stop') {
  1008. // playSmoke(handType, '', frequency, 'stop');
  1009. }
  1010. } else if (handType === 'startFan') {
  1011. if (control === 'Fan1Open') {
  1012. data.paramcode = 'CtrlFan1Start';
  1013. } else if (control === 'Fan2Open') {
  1014. data.paramcode = 'CtrlFan2Start';
  1015. } else if (control === 'Fan1Stop') {
  1016. data.paramcode = 'Fan1Stop';
  1017. } else if (control === 'Fan2Stop') {
  1018. data.paramcode = 'Fan2Stop';
  1019. } else if (control === 'Fan1Reset') {
  1020. data.paramcode = 'Fan1Reset';
  1021. } else if (control === 'Fan2Reset') {
  1022. data.paramcode = 'Fan2Reset';
  1023. }
  1024. deviceControlApi(data)
  1025. .then((res) => {
  1026. if (res.success) {
  1027. if (globalConfig.History_Type == 'remote') {
  1028. message.success('指令已下发至生产管控平台成功!');
  1029. } else {
  1030. message.success('指令已下发成功!');
  1031. }
  1032. modalTitle.value = '';
  1033. modalIsShow.value = false;
  1034. } else {
  1035. message.error(res.message);
  1036. }
  1037. })
  1038. .catch((err) => {
  1039. btnClick.value = true;
  1040. });
  1041. } else if (handType === 'Fan1Frequency' || handType === 'Fan2Frequency' || handType === 'FanFrequency') {
  1042. // 调频
  1043. if (handType === 'Fan1Frequency') {
  1044. data.paramcode = 'Fan1FreqHz';
  1045. data.value = fan1FrequencyVal.value;
  1046. } else if (handType === 'Fan2Frequency') {
  1047. data.paramcode = 'Fan2FreqHz';
  1048. data.value = fan2FrequencyVal.value;
  1049. } else if (handType === 'FanFrequency') {
  1050. data.paramcode = 'FreqHz_merge';
  1051. data.value = fan1FrequencyVal.value;
  1052. }
  1053. deviceControlApi(data)
  1054. .then((res) => {
  1055. if (res.success) {
  1056. if (globalConfig.History_Type == 'remote') {
  1057. message.success('指令已下发至生产管控平台成功!');
  1058. } else {
  1059. message.success('指令已下发成功!');
  1060. }
  1061. modalTitle.value = '';
  1062. modalIsShow.value = false;
  1063. } else {
  1064. message.error(res.message);
  1065. }
  1066. })
  1067. .catch((err) => {});
  1068. } else if (handType === 'changeSmoke') {
  1069. if (selectData['Fan1StartStatus'] == '0' || !selectData['Fan1StartStatus']) {
  1070. data.paramcode = 'CtrlFan1Start';
  1071. deviceControlApi(data)
  1072. .then((res) => {
  1073. if (res.success) {
  1074. if (globalConfig.History_Type == 'remote') {
  1075. message.success('指令已下发至生产管控平台成功!');
  1076. } else {
  1077. message.success('指令已下发成功!');
  1078. }
  1079. modalTitle.value = '';
  1080. modalIsShow.value = false;
  1081. } else {
  1082. message.error(res.message);
  1083. }
  1084. mainWindIsShow1.value = 'stop';
  1085. mainWindIsShow2.value = 'open';
  1086. })
  1087. .catch((err) => {});
  1088. } else if (selectData['Fan2StartStatus'] == '0' || !selectData['Fan2StartStatus']) {
  1089. data.paramcode = 'CtrlFan2Start';
  1090. deviceControlApi(data)
  1091. .then((res) => {
  1092. if (res.success) {
  1093. if (globalConfig.History_Type == 'remote') {
  1094. message.success('指令已下发至生产管控平台成功!');
  1095. } else {
  1096. message.success('指令已下发成功!');
  1097. }
  1098. modalTitle.value = '';
  1099. modalIsShow.value = false;
  1100. } else {
  1101. message.error(res.message);
  1102. }
  1103. mainWindIsShow1.value = 'open';
  1104. mainWindIsShow2.value = 'stop';
  1105. })
  1106. .catch((err) => {});
  1107. }
  1108. // // 一键倒机
  1109. // if (mainWindIsShow1.value === 'open' && mainWindIsShow2.value === 'stop') {
  1110. // // playSmoke('startSmoke', 'down', frequency, 'open');
  1111. // data.paramcode = 'CtrlFan2Start';
  1112. // deviceControlApi(data).then((res) => {
  1113. // console.log('设备操作结果', res);
  1114. // modalTitle.value = '';
  1115. // modalIsShow.value = false;
  1116. // }).catch((err) => {
  1117. // });
  1118. // mainWindIsShow1.value = 'stop';
  1119. // mainWindIsShow2.value = 'open';
  1120. // } else if (mainWindIsShow2.value === 'open' && mainWindIsShow1.value === 'stop') {
  1121. // // playSmoke('startSmoke', 'top', frequency, 'open');
  1122. // data.paramcode = 'CtrlFan1Start';
  1123. // deviceControlApi(data).then((res) => {
  1124. // console.log('设备操作结果', res);
  1125. // modalTitle.value = '';
  1126. // modalIsShow.value = false;
  1127. // }).catch((err) => {
  1128. // });
  1129. // mainWindIsShow1.value = 'open';
  1130. // mainWindIsShow2.value = 'stop';
  1131. // } else if (mainWindIsShow1.value === 'stop' && mainWindIsShow2.value === 'stop') {
  1132. // // playSmoke(handType, '', frequency, 'stop');
  1133. // }
  1134. } else if (handType === 'changeFan') {
  1135. data.paramcode = 'CtrlFanStart';
  1136. deviceControlApi(data)
  1137. .then((res) => {
  1138. if (res.success) {
  1139. if (globalConfig.History_Type == 'remote') {
  1140. message.success('指令已下发至生产管控平台成功!');
  1141. } else {
  1142. message.success('指令已下发成功!');
  1143. }
  1144. modalTitle.value = '';
  1145. modalIsShow.value = false;
  1146. } else {
  1147. message.error(res.message);
  1148. }
  1149. })
  1150. .catch((err) => {});
  1151. } else if (handType === 'fan1ToFan2') {
  1152. data.paramcode = 'CtrlFan1ToFan2';
  1153. deviceControlApi(data).then(() => {
  1154. if (res.success) {
  1155. if (globalConfig.History_Type == 'remote') {
  1156. message.success('指令已下发至生产管控平台成功!');
  1157. } else {
  1158. message.success('指令已下发成功!');
  1159. }
  1160. modalTitle.value = '';
  1161. modalIsShow.value = false;
  1162. } else {
  1163. message.error(res.message);
  1164. }
  1165. });
  1166. } else if (handType === 'fan2ToFan1') {
  1167. data.paramcode = 'CtrlFan2ToFan1';
  1168. deviceControlApi(data).then(() => {
  1169. if (res.success) {
  1170. if (globalConfig.History_Type == 'remote') {
  1171. message.success('指令已下发至生产管控平台成功!');
  1172. } else {
  1173. message.success('指令已下发成功!');
  1174. }
  1175. modalTitle.value = '';
  1176. modalIsShow.value = false;
  1177. } else {
  1178. message.error(res.message);
  1179. }
  1180. });
  1181. } else if (handType === 'gasAlarmSet') {
  1182. if (passWord.value != '123456') {
  1183. message.error('密码错误,请重新输入!');
  1184. return;
  1185. }
  1186. if (gasWarningVal.value) {
  1187. modalTitle.value = '';
  1188. modalIsShow.value = false;
  1189. setTimeout(() => {
  1190. passWord.value = '';
  1191. modalIsShow.value = true;
  1192. controlType.value = 'toGkjc';
  1193. modalTitle.value = '工况决策辅助';
  1194. }, 500);
  1195. } else {
  1196. message.error('请核对瓦斯超限浓度值!');
  1197. }
  1198. } else if (handType === 'toGkjc') {
  1199. if (passWord.value != '123456') {
  1200. message.error('密码错误,请重新输入!');
  1201. return;
  1202. }
  1203. //进行工况决策
  1204. if (selectData.Fan1StartStatus == '1') {
  1205. openAssistance(true, {
  1206. // m3: selectData.m3 || 675.87,
  1207. m3: 675.87,
  1208. frequency: 30,
  1209. // m3: 525.87, //5.0测试数据
  1210. // frequency: 35,
  1211. // frequency: selectData.Fan1fHz || selectData.Fan1FreqHz || selectData.Fan1Loop_Frequency,
  1212. gasWarningVal: gasWarningVal.value,
  1213. isCompute: false,
  1214. });
  1215. } else if (selectData.Fan2StartStatus == '1') {
  1216. openAssistance(true, {
  1217. // m3: selectData.m3 || 675.87,
  1218. m3: 675.87,
  1219. frequency: 30,
  1220. // frequency: selectData.Fan2fHz || selectData.Fan2FreqHz || selectData.Fan2Loop_Frequency,
  1221. gasWarningVal: gasWarningVal.value,
  1222. isCompute: false,
  1223. });
  1224. } else {
  1225. // openAssistance(true, { m3: 635.04, dataDh: 5748 });
  1226. openAssistance(true);
  1227. }
  1228. modalTitle.value = '';
  1229. modalIsShow.value = false;
  1230. }
  1231. };
  1232. }
  1233. function cancel() {
  1234. modalTitle.value = '';
  1235. modalIsShow.value = false;
  1236. gasWarningVal.value = 0;
  1237. }
  1238. function handleChangeSensor(value: string) {
  1239. console.log(value);
  1240. }
  1241. function addPlayVideo() {
  1242. if (player1.value && player1.value.play) {
  1243. if (!player1.value.paused()) player1.value.play();
  1244. document.body.removeEventListener('mousedown', addPlayVideo);
  1245. }
  1246. }
  1247. function deviceEdit(e: Event, type: string, record) {
  1248. e.stopPropagation();
  1249. openModal(true, {
  1250. type,
  1251. deviceId: record['deviceID'],
  1252. });
  1253. }
  1254. onBeforeMount(() => {
  1255. getDeviceBaseList();
  1256. });
  1257. onMounted(() => {
  1258. const { query } = unref(currentRoute);
  1259. if (query['deviceType']) devicekide.value = query['deviceType'] as string;
  1260. mountedThree(player1.value).then(async () => {
  1261. await getMonitor(true);
  1262. nextTick(async () => {
  1263. addCssText();
  1264. });
  1265. });
  1266. document.body.addEventListener('mousedown', addPlayVideo, false);
  1267. });
  1268. onUnmounted(() => {
  1269. destroy();
  1270. removeCamera();
  1271. if (timer) {
  1272. clearTimeout(timer);
  1273. timer = undefined;
  1274. }
  1275. });
  1276. </script>
  1277. <style scoped lang="less">
  1278. @import '/@/design/vent/modal.less';
  1279. :deep(.@{ventSpace}-tabs-tabpane-active) {
  1280. height: 100%;
  1281. }
  1282. .scene-box {
  1283. .title-text {
  1284. height: 32px;
  1285. }
  1286. .bottom-tabs-box {
  1287. height: 280px;
  1288. .tabs-box {
  1289. position: relative !important;
  1290. }
  1291. }
  1292. }
  1293. .data-show-box {
  1294. position: relative;
  1295. display: flex;
  1296. flex-direction: row;
  1297. justify-content: space-between;
  1298. padding: 10px 5px;
  1299. color: #ffffff;
  1300. z-index: 999;
  1301. top: 60px;
  1302. .data-item {
  1303. pointer-events: auto;
  1304. .item-header {
  1305. width: 374px;
  1306. background: url('/@/assets/images/vent/lr-top-bg.png') no-repeat;
  1307. background-size: auto;
  1308. height: 32px;
  1309. text-align: center;
  1310. line-height: 34px;
  1311. font-size: 15px;
  1312. font-weight: 600;
  1313. color: #fafafa;
  1314. }
  1315. .item-container {
  1316. width: 346px;
  1317. margin: 0 14px;
  1318. padding: 10px;
  1319. background: #00377c33;
  1320. backdrop-filter: blur(2px);
  1321. .tab {
  1322. width: 323px;
  1323. background: url('/@/assets/images/vent/lr-tab-bg.png') no-repeat;
  1324. display: flex;
  1325. .tab-item {
  1326. flex: 1;
  1327. text-align: center;
  1328. padding-top: 2px;
  1329. color: #ffffff99;
  1330. cursor: pointer;
  1331. }
  1332. .tab-item-active-l {
  1333. color: #00ffea;
  1334. background-image: url('/@/assets/images/vent/l-tab-active.png');
  1335. background-repeat: no-repeat;
  1336. background-size: auto;
  1337. background-position: 6px 3px;
  1338. }
  1339. .tab-item-active-r {
  1340. color: #00ffea;
  1341. background-image: url('/@/assets/images/vent/r-tab-active.png');
  1342. background-repeat: no-repeat;
  1343. background-position: 0 3px;
  1344. }
  1345. }
  1346. .container-group {
  1347. width: 314px;
  1348. margin: 0px 4px;
  1349. padding: 10px 0;
  1350. min-height: 432px;
  1351. background: linear-gradient(to right, #00deff22, #2081ff05);
  1352. max-height: 440px;
  1353. overflow-y: auto;
  1354. }
  1355. .container-item {
  1356. width: 100%;
  1357. height: 60px;
  1358. display: flex;
  1359. padding: 10px 0 0 20px;
  1360. margin-bottom: 5px;
  1361. position: relative;
  1362. background: url('/@/assets/images/vent/plane-bottom.png') no-repeat;
  1363. background-size: auto;
  1364. background-position: bottom;
  1365. &::before {
  1366. content: '';
  1367. display: block;
  1368. width: 100%;
  1369. height: 5px;
  1370. position: absolute;
  1371. top: 62px;
  1372. left: 0;
  1373. background-color: #73f4ff66;
  1374. backdrop-filter: blur(5px);
  1375. }
  1376. .item-icon {
  1377. width: 54px;
  1378. height: 45px;
  1379. background: url('/@/assets/images/vent/plane-icon-bg.png') no-repeat;
  1380. background-size: cover;
  1381. .icon-style {
  1382. font-size: 18px;
  1383. margin: 10px 0 0 20px;
  1384. color: #ffc800;
  1385. }
  1386. }
  1387. .item-name {
  1388. width: 180px;
  1389. line-height: 60px;
  1390. }
  1391. .item-value {
  1392. position: relative;
  1393. height: 26px;
  1394. line-height: 24px;
  1395. margin: 15px 0;
  1396. text-align: center;
  1397. width: 80px;
  1398. border: 1px solid #00f5fe;
  1399. border-radius: 13px;
  1400. background: linear-gradient(to right, #00f5fe44, #0090ff44);
  1401. &::before {
  1402. width: 6px;
  1403. height: 6px;
  1404. content: '';
  1405. position: absolute;
  1406. left: -3px;
  1407. top: 8px;
  1408. background: #ffa500;
  1409. border-radius: 3px;
  1410. }
  1411. }
  1412. }
  1413. .warning-header {
  1414. display: flex;
  1415. font-size: 14px;
  1416. .header-item {
  1417. flex: 1;
  1418. display: flex;
  1419. flex-direction: column;
  1420. margin: 5px 10px;
  1421. justify-content: center;
  1422. align-items: center;
  1423. .header-title {
  1424. color: #39e7fe;
  1425. }
  1426. .header-value {
  1427. width: 133px;
  1428. height: 56px;
  1429. font-weight: 600;
  1430. font-family: 'douyuFont';
  1431. font-size: 16px;
  1432. color: #ffa500;
  1433. display: flex;
  1434. justify-content: center;
  1435. align-items: center;
  1436. background: url('/@/assets/images/vent/count-header-bg.png') no-repeat;
  1437. }
  1438. }
  1439. }
  1440. .warning-group {
  1441. padding: 0 10px;
  1442. position: relative;
  1443. // &::before {
  1444. // content: '';
  1445. // display: block;
  1446. // width: 1px;
  1447. // height: 100%;
  1448. // position: absolute;
  1449. // left: 12px;
  1450. // background-color: #00f5fe;
  1451. // }
  1452. .warning-item {
  1453. display: flex;
  1454. flex-direction: row;
  1455. justify-content: space-between;
  1456. align-items: center;
  1457. height: 38px;
  1458. .item-name {
  1459. .icon {
  1460. width: 6px;
  1461. height: 6px;
  1462. display: inline-block;
  1463. background-color: #1cd5ff;
  1464. border-radius: 3px;
  1465. position: relative;
  1466. margin-right: 5px;
  1467. &::before {
  1468. content: '';
  1469. width: 10px;
  1470. height: 10px;
  1471. display: block;
  1472. border: 1px solid #34edff99;
  1473. border-radius: 5px;
  1474. position: absolute;
  1475. top: -2px;
  1476. left: -2px;
  1477. }
  1478. }
  1479. }
  1480. }
  1481. }
  1482. }
  1483. }
  1484. }
  1485. .input-box {
  1486. display: flex;
  1487. align-items: center;
  1488. .input-title {
  1489. color: #73e8fe;
  1490. width: auto;
  1491. }
  1492. margin-right: 10px;
  1493. }
  1494. .label {
  1495. max-width: 220px;
  1496. }
  1497. #fanLocalSelectDom {
  1498. :deep(.@{ventSpace}-select-dropdown) {
  1499. left: 0px !important;
  1500. top: 35px !important;
  1501. }
  1502. }
  1503. .@{ventSpace}-input {
  1504. width: 150px;
  1505. }
  1506. :deep(#LivePlayerBox) {
  1507. display: flex;
  1508. flex-direction: row;
  1509. justify-content: flex-end;
  1510. padding-right: 380px;
  1511. pointer-events: none;
  1512. .video-parent {
  1513. height: 208px;
  1514. pointer-events: auto !important;
  1515. }
  1516. }
  1517. .to-right {
  1518. :deep(#LivePlayerBox) {
  1519. padding-right: 0px;
  1520. }
  1521. }
  1522. :deep(.button-box) {
  1523. position: relative;
  1524. padding: 5px;
  1525. // border: 1px transparent solid;
  1526. border-radius: 5px;
  1527. margin-left: 8px;
  1528. margin-right: 8px;
  1529. width: auto;
  1530. // height: 40px;
  1531. // border: 1px solid #65dbea;
  1532. height: 35px !important;
  1533. display: flex;
  1534. align-items: center;
  1535. justify-content: center;
  1536. color: #fff;
  1537. padding: 0 15px 5px 15px;
  1538. cursor: pointer;
  1539. &:hover {
  1540. background: linear-gradient(#2cd1ff55, #1eb0ff55);
  1541. }
  1542. &::before {
  1543. width: calc(100% - 6px);
  1544. height: 27px;
  1545. content: '';
  1546. position: absolute;
  1547. top: 3px;
  1548. right: 0;
  1549. left: 3px;
  1550. bottom: 0;
  1551. z-index: -1;
  1552. border-radius: inherit; /*important*/
  1553. background: linear-gradient(#1fa6cb, #127cb5);
  1554. }
  1555. &::after {
  1556. width: calc(100% + 32px);
  1557. height: 10px;
  1558. content: '';
  1559. position: absolute;
  1560. top: 28px;
  1561. right: 0;
  1562. left: -16px;
  1563. bottom: 0;
  1564. z-index: -1;
  1565. border-radius: inherit; /*important*/
  1566. background-position: center;
  1567. background-size: 100%;
  1568. z-index: 999;
  1569. }
  1570. }
  1571. </style>