1
0

index.vue 57 KB

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