index.vue 59 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592
  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
  97. v-if="!(selectData.fanFrequencyType == 'fandp' && item.permission.startsWith('btn:frequency')) && hasPermission(item.permission)"
  98. :class="{ 'button-box': btnClick, 'button-disable': !btnClick }"
  99. @click="showModal(item)"
  100. >{{ item.value }}</div
  101. >
  102. </template>
  103. </div>
  104. <div class="top-right row">
  105. <template v-for="(item, index) in modalTypeArr.rightBtnArr" :key="index">
  106. <div
  107. v-if="
  108. !(selectData.fanFrequencyType == 'fandp' && (item.permission === 'fanLocal:gasAlarmSet' || item.permission === 'fanLocal:kkjc')) &&
  109. hasPermission(item.permission)
  110. "
  111. :class="{ 'button-box': btnClick, 'button-disable': !btnClick }"
  112. @click="showModal(item)"
  113. >{{ item.value }}</div
  114. >
  115. </template>
  116. </div>
  117. </div>
  118. <div class="title-text">
  119. {{ selectData.supplyAirAddr || selectData.strinstallpos || selectData.stationname }}
  120. </div>
  121. <div class="data-show-box" v-if="!loading">
  122. <div class="data-item" v-if="leftColumns.length > 0">
  123. <div class="item-header">环境监测</div>
  124. <div class="item-container">
  125. <div class="tab">
  126. <div class="tab-item" :class="{ 'tab-item-active-r': warningMonitorRowIndex === 0 }" @click="selectDevice('warningMonitorRowIndex', 0)"
  127. >主机</div
  128. >
  129. <div class="tab-item" :class="{ 'tab-item-active-r': warningMonitorRowIndex === 1 }" @click="selectDevice('warningMonitorRowIndex', 1)"
  130. >备机</div
  131. >
  132. </div>
  133. <div class="container-group">
  134. <!-- <div class="warning-header">
  135. <div class="header-item">
  136. <div class="header-title">报警总数</div>
  137. <div class="header-value">0</div>
  138. </div>
  139. <div class="header-item">
  140. <div class="header-title">未处理数</div>
  141. <div class="header-value">0</div>
  142. </div>
  143. </div> -->
  144. <div class="warning-group">
  145. <template v-if="selectData.deviceType">
  146. <!-- <div class="warning-item" v-for="(state, index) in leftColumns" :key="index">
  147. <div class="item-name"><div class="icon"></div> {{ state.title }}</div>
  148. <div v-if="state.dataIndex.startsWith('Fan')">
  149. <div class="signal-item" v-if="warningMonitorRowIndex == 0">
  150. <div
  151. class="signal-round"
  152. :class="{
  153. 'signal-round-run': selectData[state.dataIndex.replace('Fan', 'Fan1')],
  154. 'signal-round-warning':
  155. selectData[state.dataIndex.replace('Fan', 'Fan1')] !== undefined && !selectData[state.dataIndex.replace('Fan', 'Fan1')],
  156. 'signal-round-gry': selectData[state.dataIndex.replace('Fan', 'Fan1')] === undefined,
  157. }"
  158. ></div>
  159. <div class="vent-margin-l-8">{{
  160. selectData[state.dataIndex.replace('Fan', 'Fan1')] === undefined
  161. ? '无状态'
  162. : selectData[state.dataIndex.replace('Fan', 'Fan1')]
  163. ? '正常'
  164. : '异常'
  165. }}</div>
  166. </div>
  167. <div class="signal-item" v-if="warningMonitorRowIndex == 1">
  168. <div
  169. class="signal-round"
  170. :class="{
  171. 'signal-round-run': selectData[state.dataIndex.replace('Fan', 'Fan2')],
  172. 'signal-round-warning':
  173. selectData[state.dataIndex.replace('Fan', 'Fan2')] !== undefined && !selectData[state.dataIndex.replace('Fan', 'Fan2')],
  174. 'signal-round-gry': selectData[state.dataIndex.replace('Fan', 'Fan2')] === undefined,
  175. }"
  176. ></div>
  177. <div class="vent-margin-l-8">{{
  178. selectData[state.dataIndex.replace('Fan', 'Fan2')] === undefined
  179. ? '无状态'
  180. : selectData[state.dataIndex.replace('Fan', 'Fan2')]
  181. ? '正常'
  182. : '异常'
  183. }}</div>
  184. </div>
  185. </div>
  186. <div v-else>
  187. <div class="signal-item">
  188. <div
  189. class="signal-round vent-margin-l-8"
  190. :class="{
  191. 'signal-round-run': selectData[state.dataIndex],
  192. 'signal-round-warning': selectData[state.dataIndex] !== undefined && !selectData[state.dataIndex],
  193. 'signal-round-gry': selectData[state.dataIndex] === undefined,
  194. }"
  195. ></div>
  196. <div class="vent-margin-l-8">{{ selectData[state.dataIndex] === undefined ? '无状态' : selectData[state.dataIndex] ? '正常' : '异常' }}</div>
  197. </div>
  198. </div>
  199. </div> -->
  200. <div class="container-item" v-for="(data, index) in leftColumns" :key="index">
  201. <div class="item-icon">
  202. <!-- <SvgIcon class="icon-style" size="18" name="temperature" /> -->
  203. <CaretRightOutlined class="icon-style" />
  204. </div>
  205. <div class="item-name">{{ data.title }}</div>
  206. <div v-if="data.dataIndex.startsWith('Fan')">
  207. <div class="item-value" v-if="warningMonitorRowIndex == 0">{{
  208. selectData[data.dataIndex.replace('Fan', 'Fan1')] ? selectData[data.dataIndex.replace('Fan', 'Fan1')] : '-'
  209. }}</div>
  210. <div class="item-value" v-if="warningMonitorRowIndex == 1">{{
  211. selectData[data.dataIndex.replace('Fan', 'Fan2')] ? selectData[data.dataIndex.replace('Fan', 'Fan2')] : '-'
  212. }}</div>
  213. </div>
  214. <div v-else>
  215. <div class="item-value">{{ selectData[data.dataIndex] ? selectData[data.dataIndex] : '-' }}</div>
  216. </div>
  217. </div>
  218. </template>
  219. </div>
  220. </div>
  221. </div>
  222. </div>
  223. <div class="data-item" v-if="rightColumns.length > 0">
  224. <div class="item-header">设备监测</div>
  225. <div class="item-container">
  226. <div class="tab">
  227. <div class="tab-item" :class="{ 'tab-item-active-r': dataMonitorRowIndex == 0 }" @click="selectDevice('dataMonitorRowIndex', 0)"
  228. >主机</div
  229. >
  230. <div class="tab-item" :class="{ 'tab-item-active-r': dataMonitorRowIndex == 1 }" @click="selectDevice('dataMonitorRowIndex', 1)"
  231. >备机</div
  232. >
  233. </div>
  234. <div class="container-group container-group-l">
  235. <template v-if="!loading">
  236. <div class="container-item" v-for="(data, index) in rightColumns" :key="index">
  237. <div class="item-icon">
  238. <!-- <SvgIcon class="icon-style" size="18" name="temperature" /> -->
  239. <!-- <StarOutlined /> -->
  240. <CaretRightOutlined class="icon-style" />
  241. </div>
  242. <div class="item-name">{{ data.title }}</div>
  243. <div v-if="data.dataIndex.startsWith('Fan')">
  244. <div class="item-value" v-if="dataMonitorRowIndex == 0">{{
  245. selectData[data.dataIndex.replace('Fan', 'Fan1')] ? selectData[data.dataIndex.replace('Fan', 'Fan1')] : '-'
  246. }}</div>
  247. <div class="item-value" v-if="dataMonitorRowIndex == 1">{{
  248. selectData[data.dataIndex.replace('Fan', 'Fan2')] ? selectData[data.dataIndex.replace('Fan', 'Fan2')] : '-'
  249. }}</div>
  250. </div>
  251. <div v-else>
  252. <div class="item-value">{{ selectData[data.dataIndex] ? selectData[data.dataIndex] : '-' }}</div>
  253. </div>
  254. </div>
  255. </template>
  256. </div>
  257. </div>
  258. </div>
  259. </div>
  260. <div class="bottom-tabs-box" @mousedown="setDivHeight($event, 170, scroll, 180)">
  261. <dv-border-box8 :dur="5" class="dv_border_8" :style="`bottom: 20px; padding: 5px; height: ${scroll.y + 140}px`">
  262. <!-- <div class="enter-detail" @click="goDetail()">
  263. <send-outlined class=""/>风机运行详情
  264. </div> -->
  265. <a-tabs class="tabs-box" v-model:activeKey="activeKey" @change="tabChange">
  266. <a-tab-pane key="1" tab="实时监测">
  267. <GroupMonitorTable
  268. v-if="activeKey === '1'"
  269. ref="MonitorDataTable"
  270. :dataSource="dataSource"
  271. :columnsType="`${selectData.deviceType}_monitor`"
  272. @selectRow="getSelectRow"
  273. :scroll="scroll"
  274. :is-action="true"
  275. >
  276. <template #action="{ record }">
  277. <a v-if="globalConfig?.showReport" class="table-action-link" @click="deviceEdit($event, 'reportInfo', record)">报表录入</a>
  278. <a class="table-action-link" @click="deviceEdit($event, 'deviceInfo', record)">设备编辑</a>
  279. </template>
  280. </GroupMonitorTable>
  281. </a-tab-pane>
  282. <a-tab-pane key="2" tab="实时曲线图" force-render v-if="hasPermission('echart:show')">
  283. <div class="tab-item" v-if="activeKey === '2'">
  284. <div class="vent-flex-row-between" style="height: 100%">
  285. <BarSingle
  286. :xAxisData="xAxisDataGas"
  287. :dataSource="dataSource[selectRowIndex]"
  288. height="100%"
  289. :chartsColumns="chartsColumns"
  290. style="flex: 3"
  291. />
  292. <BarSingle
  293. v-if="globalConfig?.simulatedPassword"
  294. :xAxisData="[
  295. { key: 'F1', valueKey: 'windQuantity1' },
  296. { key: 'F2', valueKey: 'windQuantity2' },
  297. ]"
  298. :dataSource="dataSource[selectRowIndex]"
  299. height="100%"
  300. :chartsColumns="chartsColumns1"
  301. style="flex: 2"
  302. />
  303. </div>
  304. </div>
  305. </a-tab-pane>
  306. <a-tab-pane key="3" tab="历史数据">
  307. <div class="tab-item" v-if="activeKey === '3'">
  308. <HistoryTable :columns-type="`${selectData.deviceType}`" :device-type="`${devicekide}`" designScope="fanlocal-history" :scroll="scroll">
  309. <template #filterCell="{ column, record }">
  310. <a-tag v-if="column.dataIndex === 'warnFlag'" :color="record.warnFlag == '0' ? 'green' : 'red'">{{
  311. record.warnFlag == '0' ? '正常' : '报警'
  312. }}</a-tag>
  313. <a-tag v-if="column.dataIndex === 'netStatus'" :color="record.netStatus == '0' ? 'default' : 'green'">{{
  314. record.netStatus == '0' ? '断开' : '连接'
  315. }}</a-tag>
  316. <div v-if="record.nwindownum == 1 && column.dataIndex === 'rearArea'">/</div>
  317. </template>
  318. </HistoryTable>
  319. <!-- <HistoryTable class="w-100% h-100% mt-100px" :device-code="`${devicekide}`" :scroll="scroll" dict-code="fanlocal_dict" /> -->
  320. </div>
  321. </a-tab-pane>
  322. <a-tab-pane key="4" tab="报警历史">
  323. <div class="tab-item" v-if="activeKey === '4'">
  324. <AlarmHistoryTable columns-type="alarm" :device-type="`${devicekide}`" designScope="alarm-history" :scroll="scroll" />
  325. </div>
  326. </a-tab-pane>
  327. <a-tab-pane key="5" tab="操作历史">
  328. <div class="tab-item" v-if="activeKey === '5'">
  329. <HandlerHistoryTable
  330. columns-type="operator_history"
  331. :device-type="`${devicekide}`"
  332. :device-list-api="baseList"
  333. designScope="alarm-history"
  334. :scroll="scroll"
  335. />
  336. </div>
  337. </a-tab-pane>
  338. </a-tabs>
  339. <a-button
  340. v-if="hasPermission('btn:reportDown')"
  341. type="primary"
  342. size="small"
  343. preIcon="ant-design:download-outlined"
  344. style="position: absolute; right: 15px; top: 10px"
  345. @click="reportDown"
  346. >
  347. 报表导出
  348. </a-button>
  349. </dv-border-box8>
  350. </div>
  351. </div>
  352. <div
  353. ref="playerRef"
  354. :class="{ 'to-right': rightColumns.length < 1 || leftColumns.length < 1, 'to-no-right': rightColumns.length > 0 && leftColumns.length > 0 }"
  355. style="z-index: 999; position: absolute; top: 100px; right: 15px; width: 100%; height: 100%; margin: auto; pointer-events: none"
  356. >
  357. </div>
  358. <a-modal v-model:visible="modalIsShow" :title="modalTitle" :maskStyle="{ backgroundColor: '#000000aa', backdropFilter: 'blur(3px)' }">
  359. <template #footer>
  360. <div v-if="controlType != 'startFan'">
  361. <a-button key="back" @click="cancel">返回</a-button>
  362. <a-button key="submit" type="primary" :loading="loading" @click="handleOk">确定</a-button>
  363. </div>
  364. </template>
  365. <div class="modal-container">
  366. <div class="vent-flex-row">
  367. <ExclamationCircleFilled style="color: #ffb700; font-size: 30px" />
  368. <div class="warning-text">您是否要进行{{ modalTitle }}操作?</div>
  369. </div>
  370. <div class="" v-if="controlType == 'startSmoke'">
  371. <!-- 互斥控制 -->
  372. <div class="startSmoke-select">
  373. <div class="label">主机:</div>
  374. <a-radio-group v-model:value="mainWindIsShow1" @change="changeMotor" name="localWind1">
  375. <a-radio value="open">开启</a-radio>
  376. <a-radio value="stop">停止</a-radio>
  377. </a-radio-group>
  378. </div>
  379. <div class="startSmoke-select">
  380. <div class="label">备机:</div>
  381. <a-radio-group v-model:value="mainWindIsShow2" @change="changeMotor" name="localWind2">
  382. <a-radio value="open">开启</a-radio>
  383. <a-radio value="stop">停止</a-radio>
  384. </a-radio-group>
  385. </div>
  386. </div>
  387. <div class="" v-if="controlType == 'startFan'">
  388. <!-- 不互斥控制 -->
  389. <div class="startSmoke-select">
  390. <div class="label">主机:</div>
  391. <div :class="{ 'button-box': true, 'button-disable': false }" @click="handleOk('Fan1Open')">开启</div>
  392. <div :class="{ 'button-box': true, 'button-disable': false }" @click="handleOk('Fan1Stop')">停止</div>
  393. <div :class="{ 'button-box': true, 'button-disable': false }" @click="handleOk('Fan1Reset')">复位</div>
  394. </div>
  395. <div class="startSmoke-select">
  396. <div class="label">备机:</div>
  397. <div :class="{ 'button-box': true, 'button-disable': false }" @click="handleOk('Fan2Open')">开启</div>
  398. <div :class="{ 'button-box': true, 'button-disable': false }" @click="handleOk('Fan2Stop')">停止</div>
  399. <div :class="{ 'button-box': true, 'button-disable': false }" @click="handleOk('Fan2Reset')">复位</div>
  400. </div>
  401. </div>
  402. <!-- 调频 -->
  403. <div class="vent-flex-row input-box" v-if="controlType == 'Fan1Frequency'">
  404. <div class="label">主风机运行频率(Hz):</div>
  405. <a-input-number size="small" v-model:value="fan1FrequencyVal" :min="20" :max="50" :step="0.1" />
  406. </div>
  407. <div class="vent-flex-row input-box" v-if="controlType == 'Fan2Frequency'">
  408. <div class="label">备风机运行频率(Hz):</div>
  409. <a-input-number size="small" v-model:value="fan2FrequencyVal" :min="20" :max="50" :step="0.1" />
  410. </div>
  411. <div class="vent-flex-row input-box" v-if="controlType == 'FanFrequency'">
  412. <div class="label">风机运行频率(Hz):</div>
  413. <a-input-number size="small" v-model:value="fan1FrequencyVal" :min="20" :max="50" :step="0.1" />
  414. </div>
  415. <div class="vent-flex-row input-box" v-if="controlType == 'needAir'">
  416. <div class="label">需风量(单位):</div>
  417. <a-input-number size="small" v-model:value="frequencyVal" :min="30" :max="50" :step="0.1" />
  418. </div>
  419. <div class="vent-flex-row input-box" v-if="controlType == 'disAirAlarm'">
  420. <div class="label">漏风率(%):</div>
  421. <a-input-number size="small" v-model:value="frequencyVal" :min="0" :max="50" :step="0.1" />
  422. </div>
  423. <div class="vent-flex-row input-box" v-if="controlType == 'diameter'">
  424. <div class="label">风筒直径(m):</div>
  425. <a-input-number size="small" v-model:value="frequencyVal" :min="0" :max="50" :step="0.1" />
  426. </div>
  427. <div class="vent-flex-row input-box" v-if="controlType == 'len'">
  428. <div class="label">风筒长度(m):</div>
  429. <a-input-number size="small" v-model:value="frequencyVal" :min="0" :max="50" :step="0.1" />
  430. </div>
  431. <div class="vent-flex-row input-box" v-if="controlType == 'windPowerLimit'">
  432. <div class="label">风电闭锁限值(m³/min):</div>
  433. <a-input-number size="small" v-model:value="frequencyVal" :min="0" :max="50" :step="0.1" />
  434. </div>
  435. <div class="vent-flex-row input-box" v-if="controlType == 'gasPowerLimit'">
  436. <div class="label">瓦斯电闭锁限值(m³/min):</div>
  437. <a-input-number size="small" v-model:value="frequencyVal" :min="0" :max="50" :step="0.1" />
  438. </div>
  439. <div v-if="controlType == 'gasAlarmSet'">
  440. <div class="vent-flex-row input-box">
  441. <div class="label">设置瓦斯超限浓度:</div>
  442. <a-input-number size="small" v-model:value="gasWarningVal" :min="0" :max="1" :step="0.01" />
  443. </div>
  444. </div>
  445. <div v-if="controlType == 'gasAlarm'">
  446. <div class="vent-flex-row input-box">
  447. <div class="label">传感器名称:</div>
  448. <a-select placeholder="传感器" @change="handleChangeSensor" :options="sensorList" v-model:value="modalSensor" />
  449. </div>
  450. <div class="vent-flex-row input-box">
  451. <div class="label">传感器值:</div>
  452. <a-input-number size="small" v-model:value="frequencyVal" :min="0" :max="50" :step="0.1" />
  453. </div>
  454. </div>
  455. <div v-if="controlType == 'airVolumeAlarm'">
  456. <div class="vent-flex-row input-box">
  457. <div class="label">风量上限(m³/min):</div>
  458. <a-input-number size="small" v-model:value="modalTypeArr.rightBtnArr[3].min" :min="0" :max="50" :step="0.1" />
  459. </div>
  460. <div class="vent-flex-row input-box">
  461. <div class="label">风量下限(m³/min):</div>
  462. <a-input-number size="small" v-model:value="modalTypeArr.rightBtnArr[3].max" :min="0" :max="50" :step="0.1" />
  463. </div>
  464. </div>
  465. <!-- 启动或停止 -->
  466. <div class="" v-if="controlType == 'startSmoke'"> </div>
  467. <div v-if="!globalConfig?.simulatedPassword" class="vent-flex-row input-box">
  468. <div class="label">操作密码:</div>
  469. <a-input size="small" type="password" v-model:value="passWord" />
  470. </div>
  471. </div>
  472. </a-modal>
  473. <ConditionAssistance @register="registerModalAssistance" :dataSource="historySource" />
  474. <DeviceBaseInfo @register="registerModal" :device-type="selectData['deviceType']" />
  475. <reportInfo @register="registerModal1" :editID="editID" :fileType="fileType" />
  476. </template>
  477. <script setup lang="ts">
  478. import { ExclamationCircleFilled, ArrowRightOutlined } from '@ant-design/icons-vue';
  479. import { onBeforeMount, ref, watch, onMounted, nextTick, toRaw, reactive, onUnmounted, inject, unref } from 'vue';
  480. import BarSingle from '../../../../components/chart/BarSingle.vue';
  481. import GroupMonitorTable from '../comment/GroupMonitorTable.vue';
  482. import HistoryTable from '../comment/HistoryTable.vue';
  483. // import HistoryTable from '/@/views/vent/comment/history/HistoryTable.vue';
  484. import AlarmHistoryTable from '../comment/AlarmHistoryTable.vue';
  485. import HandlerHistoryTable from '../comment/HandlerHistoryTable.vue';
  486. import DeviceBaseInfo from '../comment/components/DeviceBaseInfo.vue';
  487. import { mountedThree, setModelType, destroy, addCssText, addText, playSmoke } from './fanLocal.three';
  488. import lodash from 'lodash';
  489. import { getTableList, list } from '/@/views/vent/monitorManager/fanLocalMonitor/fanLocal.api';
  490. import { list as baseList } from '../../deviceManager/fanTabel/fan.api';
  491. import { chartsColumns, chartsColumns1 } from './fanLocal.data';
  492. import { deviceControlApi } from '/@/api/vent/index';
  493. import { setDivHeight } from '/@/utils/event';
  494. import { BorderBox8 as DvBorderBox8 } from '@kjgl77/datav-vue3';
  495. import { getTableHeaderColumns } from '/@/hooks/web/useWebColumns';
  496. import { useRouter } from 'vue-router';
  497. import { useModal } from '/@/components/Modal';
  498. import type { BasicColumn } from '/@/components/Table/src/types/table';
  499. import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
  500. import { getPopupContainer } from '/@/utils';
  501. import { getDictItemsByCode } from '/@/utils/dict';
  502. import { message } from 'ant-design-vue';
  503. import { useCamera } from '/@/hooks/system/useCamera';
  504. import { CaretRightOutlined } from '@ant-design/icons-vue';
  505. import ConditionAssistance from './components/conditionAssistance.vue';
  506. import reportInfo from '../comment/components/reportInfo.vue';
  507. import { save, reportList } from '../../reportManager/reportManager.api';
  508. import { usePermission } from '/@/hooks/web/usePermission';
  509. import { useGlobSetting } from '/@/hooks/setting';
  510. import { useMessage } from '/@/hooks/web/useMessage';
  511. const { hasPermission } = usePermission();
  512. const globalConfig = inject('globalConfig');
  513. const [registerModal, { openModal, closeModal }] = useModal();
  514. const [registerModal1, { openModal: openModal1, closeModal: closeModal1 }] = useModal();
  515. const [registerModalAssistance, { openModal: openAssistance, closeModal: closeAssistance }] = useModal();
  516. const { currentRoute } = useRouter();
  517. const router = useRouter();
  518. const { createConfirm } = useMessage();
  519. const globSetting = useGlobSetting();
  520. const modalTypeArr = reactive({
  521. leftBtnArr: [
  522. {
  523. key: 'startSmoke',
  524. value: '启停风机',
  525. permission: 'btn:openclose',
  526. },
  527. {
  528. key: 'startFan',
  529. value: '启停风机',
  530. permission: 'btn:openclose1',
  531. },
  532. {
  533. key: 'changeSmoke', // 主备两个点位
  534. value: '一键倒机',
  535. permission: 'btn:change',
  536. },
  537. {
  538. key: 'changeFan', // 主备一个点位
  539. value: '一键倒机',
  540. permission: 'btn:CtrlFanChange',
  541. },
  542. {
  543. key: 'fan1ToFan2',
  544. value: '主机倒备机',
  545. permission: 'btn:ctrlFan1ToFan2',
  546. },
  547. {
  548. key: 'fan2ToFan1',
  549. value: '备机倒主机',
  550. permission: 'btn:ctrlFan2ToFan1',
  551. },
  552. {
  553. key: 'Fan1Frequency',
  554. value: '主机调频',
  555. permission: 'btn:frequency',
  556. },
  557. {
  558. key: 'Fan2Frequency',
  559. value: '备机调频',
  560. permission: 'btn:frequency',
  561. },
  562. {
  563. key: 'FanFrequency',
  564. value: '风机调频',
  565. permission: 'btn:frequencyMerge',
  566. },
  567. {
  568. key: 'windPower',
  569. value: '风电闭锁',
  570. permission: 'fanLocal:control',
  571. },
  572. {
  573. key: 'gasPower',
  574. value: '瓦斯电闭锁',
  575. permission: 'fanLocal:control',
  576. },
  577. {
  578. key: 'needAir',
  579. value: '需风量',
  580. permission: 'fanLocal:control',
  581. },
  582. ],
  583. rightBtnArr: [
  584. {
  585. key: 'gasAlarmSet',
  586. value: '瓦斯限值设定',
  587. permission: 'fanLocal:gasAlarmSet',
  588. },
  589. {
  590. key: 'kkjc',
  591. value: '工况辅助决策',
  592. permission: 'fanLocal:kkjc',
  593. },
  594. {
  595. key: 'diameter',
  596. value: '风筒直径',
  597. permission: 'fanLocal:control',
  598. },
  599. {
  600. key: 'diameter',
  601. value: '风筒直径',
  602. permission: 'fanLocal:control',
  603. },
  604. {
  605. key: 'len',
  606. value: '风筒长度',
  607. permission: 'fanLocal:control',
  608. },
  609. // {
  610. // key: 'frequency',
  611. // value: '调频',
  612. // permission: 'fanLocal:control',
  613. // },
  614. {
  615. key: 'windPowerLimit',
  616. value: '风电闭锁限值',
  617. permission: 'fanLocal:control',
  618. },
  619. {
  620. key: 'gasPowerLimit',
  621. value: '瓦斯电闭锁限值',
  622. permission: 'fanLocal:control',
  623. },
  624. {
  625. key: 'airVolumeAlarm',
  626. value: '风量报警',
  627. permission: 'fanLocal:control',
  628. min: 0,
  629. max: 100,
  630. },
  631. {
  632. key: 'disAirAlarm',
  633. value: '漏风率报警',
  634. permission: 'fanLocal:control',
  635. },
  636. // {
  637. // key: 'gasAlarm',
  638. // value: '瓦斯报警',
  639. // permission: 'fanLocal:control',
  640. // },
  641. ],
  642. });
  643. const sensorList = ref<any[]>([
  644. {
  645. value: '1',
  646. label: 'T1',
  647. },
  648. {
  649. value: '2',
  650. label: 'T2',
  651. },
  652. {
  653. value: '3',
  654. label: 'T3',
  655. },
  656. ]);
  657. const scroll = reactive({
  658. y: 180,
  659. });
  660. const gasWarningVal = ref(0.6); // 瓦斯最大报警值
  661. const playerRef = ref();
  662. const MonitorDataTable = ref();
  663. const modalSensor = ref(null);
  664. const loading = ref(false);
  665. const activeKey = ref('1');
  666. const player1 = ref();
  667. const modalIsShow = ref<boolean>(false); // 是否显示模态框
  668. const modalTitle = ref(''); // 模态框标题显示内容,根据设备操作类型决定
  669. const fan1FrequencyVal = ref(40); //主机频率
  670. const fan2FrequencyVal = ref(40); //备机频率
  671. const mainWindIsShow1 = ref('open'); // 主机默认启动leftColumns
  672. const mainWindIsShow2 = ref('stop'); // 备机默认不启动
  673. const fanControl = ref('');
  674. const passWord = ref('');
  675. // 默认初始是第一行
  676. const selectRowIndex = ref(-1);
  677. const dataMonitorRowIndex = ref(0);
  678. // 默认数据右边监测的是主机
  679. const warningMonitorRowIndex = ref(0);
  680. const xAxisDataGas = ref([]);
  681. // 设备数据
  682. const controlType = ref('');
  683. const modalType = ref('');
  684. // 监测数据
  685. const initData = {
  686. deviceID: '',
  687. deviceType: '',
  688. strname: '',
  689. dataDh: '-', //压差
  690. dataDtestq: '-', //测试风量
  691. sourcePressure: '-', //气源压力
  692. dataDequivalarea: '-',
  693. netStatus: '0', //通信状态
  694. warnLevel_str: '',
  695. stationname: '',
  696. fanFrequencyType: '',
  697. };
  698. const frequencyVal = ref(0);
  699. const dataSource = ref([]);
  700. const historySource = ref([]);
  701. // 关联设备信息
  702. const linkDeviceInfo = ref({});
  703. // 监测数据
  704. let selectData = reactive(lodash.cloneDeep(initData));
  705. const rightColumns = ref<BasicColumn[]>([]);
  706. const leftColumns = ref<BasicColumn[]>([]);
  707. const devicekide = ref('fanlocal');
  708. const deviceType = ref(selectData.deviceType);
  709. const headElHeight = ref(0);
  710. let btnClick = ref(true); // 判断按钮是否可点
  711. //报表导出
  712. let editID = ref<any>('');
  713. let fileType = ref('');
  714. const { getCamera, removeCamera } = useCamera();
  715. watch(deviceType, (type) => {
  716. rightColumns.value = getTableHeaderColumns(type + '_monitor_right') as [];
  717. if (rightColumns.value && rightColumns.value.length < 1) {
  718. rightColumns.value = getTableHeaderColumns(type.split('_')[0] + '_monitor_right') as [];
  719. }
  720. leftColumns.value = getTableHeaderColumns(type + '_monitor_left') as [];
  721. if (leftColumns.value && leftColumns.value.length < 1) {
  722. leftColumns.value = getTableHeaderColumns(type.split('_')[0] + '_monitor_left') as [];
  723. }
  724. });
  725. const flvURL1 = () => {
  726. // return `https://sf1-hscdn-tos.pstatp.com/obj/media-fe/xgplayer_doc_video/flv/xgplayer-demo-360p.flv`;
  727. return '';
  728. };
  729. const changeDeviceKind = (e) => {
  730. devicekide.value = e;
  731. loading.value = true;
  732. selectRowIndex.value = -1;
  733. nextTick(() => {
  734. selectData = lodash.cloneDeep(initData);
  735. loading.value = false;
  736. if (selectData.deviceID) MonitorDataTable.value.setSelectedRowKeys([selectData.deviceID]);
  737. const headEl = document.querySelector(`.zxm-table-thead`);
  738. if (headEl) {
  739. headElHeight.value = headEl.clientHeight;
  740. }
  741. });
  742. };
  743. const tabChange = (activeKeyVal) => {
  744. activeKey.value = activeKeyVal;
  745. if (activeKeyVal == 1) {
  746. nextTick(() => {
  747. MonitorDataTable.value.setSelectedRowKeys([selectData.deviceID]);
  748. });
  749. }
  750. };
  751. const selectDevice = (key, val) => {
  752. if (key === 'dataMonitorRowIndex') {
  753. dataMonitorRowIndex.value = val;
  754. } else {
  755. warningMonitorRowIndex.value = val;
  756. }
  757. };
  758. //报表导出点击
  759. async function reportDown() {
  760. openModal1();
  761. let res = await save({ reportType: 'fanlocal' });
  762. console.log(res, 'res-----------');
  763. let list = await reportList({ id: res.id });
  764. console.log(list, 'list-----------');
  765. let index = list.records[0].fileName.indexOf('.');
  766. fileType.value = list.records[0].fileName.substring(index + 1);
  767. editID.value = list.records[0].id;
  768. openModal1();
  769. }
  770. //详情
  771. function goDetail() {
  772. openModal();
  773. }
  774. function goDetailDevice(linkDeviceCode) {
  775. let linkDeviceId = '';
  776. if (linkDeviceCode.startsWith('window')) {
  777. linkDeviceId = linkDeviceInfo.value[linkDeviceCode] ? linkDeviceInfo.value[linkDeviceCode]['id'] : '';
  778. router.push({ path: '/monitorChannel/monitor-window', query: { id: linkDeviceId } });
  779. }
  780. }
  781. //
  782. async function getDataSource() {
  783. if (devicekide.value) {
  784. // const res = await list({ devicetype: devicekide.value, pagetype: 'normal' });
  785. const res = await list({ devicetype: 'fanlocal', pagetype: 'normal' });
  786. if (res.msgTxt && res.msgTxt[0] && res.msgTxt[0].datalist && res.msgTxt[0].datalist.length > 0) {
  787. const dataArr = res.msgTxt[0].datalist || [];
  788. dataSource.value = [];
  789. dataArr.forEach((data) => {
  790. const readData = data.readData;
  791. data = Object.assign(data, readData);
  792. if (data['Fan1StartStatus'] && data['Fan1StartStatus'] === '1.0') data['Fan1StartStatus'] = '1';
  793. if (data['Fan2StartStatus'] && data['Fan2StartStatus'] === '1.0') data['Fan2StartStatus'] = '1';
  794. if (data['Fan1StartStatus'] && data['Fan1StartStatus'] === '0.0') data['Fan1StartStatus'] = '0';
  795. if (data['Fan2StartStatus'] && data['Fan2StartStatus'] === '0.0') data['Fan2StartStatus'] = '0';
  796. // if (globSetting.sysOrgCode === 'sdmtjtbetmk') {
  797. // if (data['m3']) data['ductOutletAirVolume_merge'] = data['m3'];
  798. // if (data['m3']) data['inletAirVolume_merge'] = (Number(data['m3']) * 1.08).toFixed(2);
  799. // }
  800. dataSource.value.push(data);
  801. });
  802. } else {
  803. return (dataSource.value = []);
  804. }
  805. } else {
  806. dataSource.value = [];
  807. }
  808. }
  809. // https获取监测数据
  810. let timer: null | NodeJS.Timeout = null;
  811. async function getMonitor(flag?) {
  812. if (Object.prototype.toString.call(timer) === '[object Null]') {
  813. timer = await setTimeout(
  814. async () => {
  815. // debugger;
  816. await getDataSource();
  817. if (dataSource.value.length > 0 && selectRowIndex.value == -1 && MonitorDataTable.value) {
  818. // 初始打开页面
  819. if (flag && currentRoute.value && currentRoute.value['query'] && currentRoute.value['query']['id']) {
  820. MonitorDataTable.value.setSelectedRowKeys(currentRoute.value['query']['id']);
  821. } else {
  822. MonitorDataTable.value.setSelectedRowKeys(dataSource.value[0]['deviceID']);
  823. }
  824. }
  825. for (const key in selectData) {
  826. selectData[key] = '';
  827. }
  828. if (dataSource.value.length > 0 && dataSource.value[selectRowIndex.value]) {
  829. deviceType.value = dataSource.value[selectRowIndex.value]['deviceType'];
  830. if (dataSource.value.length > 0 && dataSource.value[selectRowIndex.value]) {
  831. Object.assign(selectData, dataSource.value[selectRowIndex.value]);
  832. }
  833. playSmoke(selectData);
  834. addText(selectData);
  835. }
  836. historySource.value = selectData.history;
  837. if (timer) {
  838. timer = null;
  839. }
  840. getMonitor();
  841. },
  842. flag ? 0 : 1000
  843. );
  844. }
  845. }
  846. // 获取设备基本信息列表
  847. const deviceBaseList = ref([]);
  848. function getDeviceBaseList() {
  849. getTableList({ pageSize: 1000 }).then((res) => {
  850. deviceBaseList.value = res.records;
  851. });
  852. }
  853. // 切换检测数据
  854. async function getSelectRow(id) {
  855. console.log('选中的设备id------->', id);
  856. if (!id || id == selectData['deviceID']) return;
  857. // loading.value = true;
  858. const selectIndex: any = dataSource.value.findIndex((baseData: any) => baseData.deviceID == id);
  859. selectRowIndex.value = selectIndex;
  860. nextTick(() => {
  861. const headEl = document.querySelector(`.zxm-table-thead`);
  862. if (headEl) {
  863. headElHeight.value = headEl.clientHeight;
  864. }
  865. const data = dataSource.value[selectIndex];
  866. if (data) {
  867. if (selectData['linkInfo']) linkDeviceInfo.value = JSON.parse(selectData['linkInfo']);
  868. if (linkDeviceInfo.value['window_fWindowM3']) {
  869. modalType.value = 'fc';
  870. }
  871. // 主备互斥控制
  872. if (data['Fan1StartStatus'] == '1') {
  873. mainWindIsShow1.value = 'open';
  874. mainWindIsShow2.value = 'stop';
  875. selectDevice('warningMonitorRowIndex', 0);
  876. selectDevice('dataMonitorRowIndex', 0);
  877. } else if (data['Fan2StartStatus'] == '1') {
  878. mainWindIsShow2.value = 'open';
  879. mainWindIsShow1.value = 'stop';
  880. selectDevice('warningMonitorRowIndex', 1);
  881. selectDevice('dataMonitorRowIndex', 1);
  882. }
  883. const xAxisDataGasArr = [];
  884. for (const key in selectData) {
  885. if (key.startsWith('gas') && key.length < 5) {
  886. xAxisDataGasArr.push({ key: 'T' + key.substring(3), valueKey: key });
  887. }
  888. }
  889. xAxisDataGas.value = xAxisDataGasArr;
  890. }
  891. setModelType(modalType.value);
  892. });
  893. await getCamera(id, playerRef.value);
  894. return;
  895. }
  896. // 打开并设置modal的标题
  897. function showModal(obj) {
  898. if (!btnClick.value) return;
  899. if (obj.key == 'kkjc') {
  900. gasWarningVal.value = 0.6;
  901. // 工况辅助决策
  902. openAssistance(true, {});
  903. return;
  904. }
  905. controlType.value = obj.key;
  906. modalTitle.value = obj.value;
  907. passWord.value = '';
  908. modalIsShow.value = true;
  909. }
  910. function changeMotor(e) {
  911. const target = e.target;
  912. if (target.name === 'localWind1') {
  913. if (target.value === 'open') {
  914. mainWindIsShow2.value = 'stop';
  915. }
  916. } else if (target.name === 'localWind2') {
  917. if (target.value === 'open') {
  918. mainWindIsShow1.value = 'stop';
  919. }
  920. }
  921. }
  922. function handleOk(control?) {
  923. if (passWord.value == '') {
  924. message.warning('请输入密码!');
  925. return;
  926. }
  927. createConfirm({
  928. iconType: 'warning',
  929. title: '控制',
  930. content: '您确定要控制吗?',
  931. onOk: () => handerFn(),
  932. });
  933. const handerFn = () => {
  934. const handType = controlType.value;
  935. const data = {
  936. deviceid: selectData.deviceID,
  937. devicetype: selectData.deviceType,
  938. paramcode: '',
  939. password: passWord.value || globalConfig?.simulatedPassword,
  940. value: null,
  941. };
  942. if (handType === 'startSmoke') {
  943. // 启动风机
  944. // 以下是互斥
  945. if (mainWindIsShow1.value === 'open' && mainWindIsShow2.value === 'stop') {
  946. // playSmoke(handType, 'top', frequency, 'open');
  947. data.paramcode = 'CtrlFan1Start';
  948. deviceControlApi(data)
  949. .then((res) => {
  950. if (res.success) {
  951. if (globalConfig.History_Type == 'remote') {
  952. message.success('指令已下发至生产管控平台成功!');
  953. } else {
  954. message.success('指令已下发成功!');
  955. }
  956. modalTitle.value = '';
  957. modalIsShow.value = false;
  958. } else {
  959. message.error(res.message);
  960. }
  961. })
  962. .catch((err) => {
  963. // modalIsShow.value = true;
  964. });
  965. } else if (mainWindIsShow2.value === 'open' && mainWindIsShow1.value === 'stop') {
  966. // playSmoke(handType, 'down', frequency, 'open');
  967. data.paramcode = 'CtrlFan2Start';
  968. deviceControlApi(data)
  969. .then(() => {
  970. if (res.success) {
  971. if (globalConfig.History_Type == 'remote') {
  972. message.success('指令已下发至生产管控平台成功!');
  973. } else {
  974. message.success('指令已下发成功!');
  975. }
  976. modalTitle.value = '';
  977. modalIsShow.value = false;
  978. } else {
  979. message.error(res.message);
  980. }
  981. })
  982. .catch((err) => {});
  983. } else if (mainWindIsShow1.value === 'stop' && mainWindIsShow2.value === 'stop') {
  984. // playSmoke(handType, '', frequency, 'stop');
  985. }
  986. } else if (handType === 'startFan') {
  987. if (control === 'Fan1Open') {
  988. data.paramcode = 'CtrlFan1Start';
  989. } else if (control === 'Fan2Open') {
  990. data.paramcode = 'CtrlFan2Start';
  991. } else if (control === 'Fan1Stop') {
  992. data.paramcode = 'Fan1Stop';
  993. } else if (control === 'Fan2Stop') {
  994. data.paramcode = 'Fan2Stop';
  995. } else if (control === 'Fan1Reset') {
  996. data.paramcode = 'Fan1Reset';
  997. } else if (control === 'Fan2Reset') {
  998. data.paramcode = 'Fan2Reset';
  999. }
  1000. deviceControlApi(data)
  1001. .then((res) => {
  1002. if (res.success) {
  1003. if (globalConfig.History_Type == 'remote') {
  1004. message.success('指令已下发至生产管控平台成功!');
  1005. } else {
  1006. message.success('指令已下发成功!');
  1007. }
  1008. modalTitle.value = '';
  1009. modalIsShow.value = false;
  1010. } else {
  1011. message.error(res.message);
  1012. }
  1013. })
  1014. .catch((err) => {
  1015. btnClick.value = true;
  1016. });
  1017. } else if (handType === 'Fan1Frequency' || handType === 'Fan2Frequency' || handType === 'FanFrequency') {
  1018. // 调频
  1019. if (handType === 'Fan1Frequency') {
  1020. data.paramcode = 'Fan1FreqHz';
  1021. data.value = fan1FrequencyVal.value;
  1022. } else if (handType === 'Fan2Frequency') {
  1023. data.paramcode = 'Fan2FreqHz';
  1024. data.value = fan2FrequencyVal.value;
  1025. } else if (handType === 'FanFrequency') {
  1026. data.paramcode = 'FreqHz_merge';
  1027. data.value = fan1FrequencyVal.value;
  1028. }
  1029. deviceControlApi(data)
  1030. .then((res) => {
  1031. if (res.success) {
  1032. if (globalConfig.History_Type == 'remote') {
  1033. message.success('指令已下发至生产管控平台成功!');
  1034. } else {
  1035. message.success('指令已下发成功!');
  1036. }
  1037. modalTitle.value = '';
  1038. modalIsShow.value = false;
  1039. } else {
  1040. message.error(res.message);
  1041. }
  1042. })
  1043. .catch((err) => {});
  1044. } else if (handType === 'changeSmoke') {
  1045. if (selectData['Fan1StartStatus'] == '0' || !selectData['Fan1StartStatus']) {
  1046. data.paramcode = 'CtrlFan1Start';
  1047. deviceControlApi(data)
  1048. .then((res) => {
  1049. if (res.success) {
  1050. if (globalConfig.History_Type == 'remote') {
  1051. message.success('指令已下发至生产管控平台成功!');
  1052. } else {
  1053. message.success('指令已下发成功!');
  1054. }
  1055. modalTitle.value = '';
  1056. modalIsShow.value = false;
  1057. } else {
  1058. message.error(res.message);
  1059. }
  1060. mainWindIsShow1.value = 'stop';
  1061. mainWindIsShow2.value = 'open';
  1062. })
  1063. .catch((err) => {});
  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. // if (mainWindIsShow1.value === 'open' && mainWindIsShow2.value === 'stop') {
  1086. // // playSmoke('startSmoke', 'down', frequency, 'open');
  1087. // data.paramcode = 'CtrlFan2Start';
  1088. // deviceControlApi(data).then((res) => {
  1089. // console.log('设备操作结果', res);
  1090. // modalTitle.value = '';
  1091. // modalIsShow.value = false;
  1092. // }).catch((err) => {
  1093. // });
  1094. // mainWindIsShow1.value = 'stop';
  1095. // mainWindIsShow2.value = 'open';
  1096. // } else if (mainWindIsShow2.value === 'open' && mainWindIsShow1.value === 'stop') {
  1097. // // playSmoke('startSmoke', 'top', frequency, 'open');
  1098. // data.paramcode = 'CtrlFan1Start';
  1099. // deviceControlApi(data).then((res) => {
  1100. // console.log('设备操作结果', res);
  1101. // modalTitle.value = '';
  1102. // modalIsShow.value = false;
  1103. // }).catch((err) => {
  1104. // });
  1105. // mainWindIsShow1.value = 'open';
  1106. // mainWindIsShow2.value = 'stop';
  1107. // } else if (mainWindIsShow1.value === 'stop' && mainWindIsShow2.value === 'stop') {
  1108. // // playSmoke(handType, '', frequency, 'stop');
  1109. // }
  1110. } else if (handType === 'changeFan') {
  1111. data.paramcode = 'CtrlFanStart';
  1112. deviceControlApi(data)
  1113. .then((res) => {
  1114. if (res.success) {
  1115. if (globalConfig.History_Type == 'remote') {
  1116. message.success('指令已下发至生产管控平台成功!');
  1117. } else {
  1118. message.success('指令已下发成功!');
  1119. }
  1120. modalTitle.value = '';
  1121. modalIsShow.value = false;
  1122. } else {
  1123. message.error(res.message);
  1124. }
  1125. })
  1126. .catch((err) => {});
  1127. } else if (handType === 'fan1ToFan2') {
  1128. data.paramcode = 'CtrlFan1ToFan2';
  1129. deviceControlApi(data).then(() => {
  1130. if (res.success) {
  1131. if (globalConfig.History_Type == 'remote') {
  1132. message.success('指令已下发至生产管控平台成功!');
  1133. } else {
  1134. message.success('指令已下发成功!');
  1135. }
  1136. modalTitle.value = '';
  1137. modalIsShow.value = false;
  1138. } else {
  1139. message.error(res.message);
  1140. }
  1141. });
  1142. } else if (handType === 'fan2ToFan1') {
  1143. data.paramcode = 'CtrlFan2ToFan1';
  1144. deviceControlApi(data).then(() => {
  1145. if (res.success) {
  1146. if (globalConfig.History_Type == 'remote') {
  1147. message.success('指令已下发至生产管控平台成功!');
  1148. } else {
  1149. message.success('指令已下发成功!');
  1150. }
  1151. modalTitle.value = '';
  1152. modalIsShow.value = false;
  1153. } else {
  1154. message.error(res.message);
  1155. }
  1156. });
  1157. } else if (handType === 'gasAlarmSet') {
  1158. if (passWord.value != '123456') {
  1159. message.error('密码错误,请重新输入!');
  1160. return;
  1161. }
  1162. if (gasWarningVal.value) {
  1163. modalTitle.value = '';
  1164. modalIsShow.value = false;
  1165. setTimeout(() => {
  1166. passWord.value = '';
  1167. modalIsShow.value = true;
  1168. controlType.value = 'toGkjc';
  1169. modalTitle.value = '工况决策辅助';
  1170. }, 500);
  1171. } else {
  1172. message.error('请核对瓦斯超限浓度值!');
  1173. }
  1174. } else if (handType === 'toGkjc') {
  1175. if (passWord.value != '123456') {
  1176. message.error('密码错误,请重新输入!');
  1177. return;
  1178. }
  1179. //进行工况决策
  1180. if (selectData.Fan1StartStatus == '1') {
  1181. openAssistance(true, {
  1182. // m3: selectData.m3 || 675.87,
  1183. m3: 675.87,
  1184. frequency: 30,
  1185. // m3: 525.87, //5.0测试数据
  1186. // frequency: 35,
  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. .to-right {
  1494. :deep(#LivePlayerBox) {
  1495. padding-right: 0px;
  1496. }
  1497. }
  1498. :deep(.button-box) {
  1499. position: relative;
  1500. padding: 5px;
  1501. // border: 1px transparent solid;
  1502. border-radius: 5px;
  1503. margin-left: 8px;
  1504. margin-right: 8px;
  1505. width: auto;
  1506. // height: 40px;
  1507. // border: 1px solid #65dbea;
  1508. height: 35px !important;
  1509. display: flex;
  1510. align-items: center;
  1511. justify-content: center;
  1512. color: #fff;
  1513. padding: 0 15px 5px 15px;
  1514. cursor: pointer;
  1515. &:hover {
  1516. background: linear-gradient(#2cd1ff55, #1eb0ff55);
  1517. }
  1518. &::before {
  1519. width: calc(100% - 6px);
  1520. height: 27px;
  1521. content: '';
  1522. position: absolute;
  1523. top: 3px;
  1524. right: 0;
  1525. left: 3px;
  1526. bottom: 0;
  1527. z-index: -1;
  1528. border-radius: inherit; /*important*/
  1529. background: linear-gradient(#1fa6cb, #127cb5);
  1530. }
  1531. &::after {
  1532. width: calc(100% + 32px);
  1533. height: 10px;
  1534. content: '';
  1535. position: absolute;
  1536. top: 28px;
  1537. right: 0;
  1538. left: -16px;
  1539. bottom: 0;
  1540. z-index: -1;
  1541. border-radius: inherit; /*important*/
  1542. background-position: center;
  1543. background-size: 100%;
  1544. z-index: 999;
  1545. }
  1546. }
  1547. </style>