index.vue 59 KB

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