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