index.vue 46 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136
  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="deviceDetail" class="device-detail">
  5. <div id="deviceCard" class="device-card" style="z-index: -1; position: absolute">
  6. <div class="title">KJ-980-F矿用本安型监控分站</div>
  7. <div class="detail-box">
  8. <div class="left-box"></div>
  9. <div class="right-box">
  10. <div><span class="detail-title">规格型号:</span> <span>KJ-980-F</span></div>
  11. <div
  12. ><span class="detail-title">技术参数:</span>
  13. <span
  14. >380V,电机功率22kW,50Hz,B级绝缘,额定电流42.2A,效率90.5%,能效等级3,接法角型,2940r/min,轴承6311/CM 6211/CM,功率因数0.89</span
  15. >
  16. </div>
  17. </div>
  18. </div>
  19. </div>
  20. </div>
  21. <div id="damper3D" style="width: 100%; height: 100%; position: absolute; overflow: hidden"></div>
  22. </div>
  23. <div class="scene-box">
  24. <div class="top-box">
  25. <div class="top-center row">
  26. <div v-if="hasPermission('btn:control')" class="button-box" @click="playAnimation(1)">打开前门</div>
  27. <div v-if="hasPermission('btn:control')" class="button-box" @click="playAnimation(2)">关闭前门</div>
  28. <div v-if="hasPermission('btn:control') && selectData.ndoorcount == '3'" class="button-box" @click="playAnimation(8)">打开中间门</div>
  29. <div v-if="hasPermission('btn:control') && selectData.ndoorcount == '3'" class="button-box" @click="playAnimation(9)">关闭中间门</div>
  30. <div v-if="hasPermission('btn:control')" class="button-box" @click="playAnimation(3)">打开后门</div>
  31. <div v-if="hasPermission('btn:control')" class="button-box" @click="playAnimation(4)">关闭后门</div>
  32. <div v-if="hasPermission('btn:totalControl') || selectData['isShowGatesContrl'] == 1" class="button-box" @click="playAnimation(5)"
  33. >同时打开</div
  34. >
  35. <div v-if="hasPermission('btn:totalControl') || selectData['isShowGatesContrl'] == 1" class="button-box" @click="playAnimation(6)"
  36. >同时关闭</div
  37. >
  38. <template v-if="selectData['gateStyle'] && selectData['gateStyle'].includes('fm_fc')">
  39. <div v-if="hasPermission('btn:controlWindow')" class="button-box" @click="playAnimation(10)">A窗控制</div>
  40. <div v-if="hasPermission('btn:controlWindow')" class="button-box" @click="playAnimation(11)">B窗控制</div>
  41. <div v-if="hasPermission('btn:controlWindow')" class="button-box" @click="playAnimation(12)">C窗控制</div>
  42. <div v-if="hasPermission('btn:controlWindow')" class="button-box" @click="playAnimation(13)">D窗控制</div>
  43. </template>
  44. </div>
  45. <!-- 控制模式 -->
  46. <div class="top-right row" v-if="hasPermission('btn:remote')">
  47. <!-- -->
  48. <div class="vent-flex-m row" v-if="selectData.contrlMod == 'loopCtrl' && modelList.length > 0">
  49. <div class="control-title">控制模式:</div>
  50. <a-radio-group v-model:value="selectData.autoRoManual">
  51. <template v-for="(item, index) in modelList" :key="index">
  52. <a-radio :value="item.value" :disabled="true">{{ item.text }}</a-radio>
  53. </template>
  54. </a-radio-group>
  55. <div class="button-box" @click="playAnimation(7)">切换模式</div>
  56. </div>
  57. <!-- 控制指令是多个,每个状态需要下发单独的指令 -->
  58. <div class="vent-flex-m row" v-else-if="selectData.contrlMod == 'codeCtrl' && modelList.length > 0">
  59. <div class="control-title">控制模式:</div>
  60. <a-radio-group v-model:value="selectData.autoRoManual">
  61. <template v-for="(item, index) in modelList" :key="index">
  62. <a-radio :value="item.value" :disabled="true">{{ item.text }}</a-radio>
  63. </template>
  64. </a-radio-group>
  65. <div class="button-box" v-for="(item, index) in modelList" @click="playAnimation(7, item.value)" :key="index">{{ item.text }}</div>
  66. </div>
  67. <!-- 济南嘉鸿远程、就地、自动控制,自动切换,点位为true就是选中状态 -->
  68. <div class="vent-flex-m row" v-else-if="selectData.contrlMod == 'jnjhCtrl' && modelList.length > 0">
  69. <div class="control-title">控制模式:</div>
  70. <a-radio v-model:checked="selectData['autoRoManual']" :disabled="true">远程</a-radio>
  71. <a-radio v-model:checked="selectData['autoRoManual1']" :disabled="true">自动</a-radio>
  72. <a-radio v-model:checked="selectData['autoRoManual2']" :disabled="true">手动</a-radio>
  73. <div class="button-box" @click="playAnimation(7)">模式切换</div>
  74. </div>
  75. <div class="vent-flex-m row" v-else-if="modelList.length > 0">
  76. <div class="control-title">控制模式:</div>
  77. <a-radio-group v-model:value="selectData.autoRoManual">
  78. <template v-for="(item, index) in modelList" :key="index">
  79. <a-radio :value="item.value" :disabled="true">{{ item.text }}</a-radio>
  80. </template>
  81. </a-radio-group>
  82. <div class="button-box" v-for="(item, index) in modelList" @click="playAnimation(7, item.value)" :key="index">{{ item.text }}</div>
  83. </div>
  84. <!-- <div class="run-type row">
  85. <div class="control-title">运行状态:</div>
  86. <a-radio-group v-model:value="selectData.runRoRecondition">
  87. <a-radio :value="`0`">检修</a-radio>
  88. <a-radio :value="`1`">运行</a-radio>
  89. </a-radio-group>
  90. </div> -->
  91. </div>
  92. </div>
  93. <div class="title-text">
  94. {{ selectData.supplyAirAddr || selectData.strinstallpos || selectData.strname }}
  95. </div>
  96. <div class="bottom-tabs-box" @mousedown="setDivHeight($event, 350, scroll)">
  97. <dv-border-box8 :dur="5" :style="`padding: 5px; height: ${scroll.y + 120}px`">
  98. <a-tabs class="tabs-box" v-model:activeKey="activeKey" @change="tabChange">
  99. <a-tab-pane v-if="!hasPermission('show:noMonitor')" key="1" tab="实时监测">
  100. <MonitorTable
  101. v-if="activeKey === '1'"
  102. ref="MonitorDataTable"
  103. class="monitor-table"
  104. :columnsType="deviceType"
  105. :isShowActionColumn="true"
  106. :dataSource="dataSource"
  107. design-scope="gate-monitor"
  108. @selectRow="getSelectRow"
  109. :scroll="{ y: scroll.y - 40 }"
  110. title="风门监测"
  111. :isShowPagination="true"
  112. >
  113. <template #filterCell="{ column, record }">
  114. <a-tag v-if="column.dataIndex === 'frontGateOpen' && record.frontGateOpen == '0' && record.frontGateClose == '0'" color="red"
  115. >正在运行</a-tag
  116. >
  117. <a-tag v-else-if="column.dataIndex === 'frontGateOpen' && record.frontGateOpen == '0' && record.frontGateClose == 1" color="default"
  118. >关闭</a-tag
  119. >
  120. <a-tag v-else-if="column.dataIndex === 'frontGateOpen' && record.frontGateOpen == '1' && record.frontGateClose == '0'" color="#46C66F"
  121. >打开</a-tag
  122. >
  123. <a-tag v-else-if="column.dataIndex === 'frontGateOpen' && record.frontGateOpen == '1' && record.frontGateClose == '1'" color="#FF0000"
  124. >点位异常</a-tag
  125. >
  126. <a-tag v-if="column.dataIndex === 'rearGateOpen' && record.rearGateOpen == '0' && record.rearGateClose == '0'" color="red"
  127. >正在运行</a-tag
  128. >
  129. <a-tag v-else-if="column.dataIndex === 'rearGateOpen' && record.rearGateOpen == '0' && record.rearGateClose == '1'" color="default"
  130. >关闭</a-tag
  131. >
  132. <a-tag v-else-if="column.dataIndex === 'rearGateOpen' && record.rearGateOpen == '1' && record.rearGateClose == '0'" color="#46C66F"
  133. >打开</a-tag
  134. >
  135. <a-tag v-else-if="column.dataIndex === 'rearGateOpen' && record.rearGateOpen == '1' && record.rearGateClose == '1'" color="#FF0000"
  136. >点位异常</a-tag
  137. >
  138. <a-tag v-if="column.dataIndex === 'midGateOpen' && record.midGateOpen == '0' && record.midGateClose == '0'" color="red"
  139. >正在运行</a-tag
  140. >
  141. <a-tag v-else-if="column.dataIndex === 'midGateOpen' && record.midGateOpen == '0' && record.midGateClose == 1" color="default"
  142. >关闭</a-tag
  143. >
  144. <a-tag v-else-if="column.dataIndex === 'midGateOpen' && record.midGateOpen == '1' && record.midGateClose == '0'" color="#46C66F"
  145. >打开</a-tag
  146. >
  147. <a-tag v-else-if="column.dataIndex === 'midGateOpen' && record.midGateOpen == '1' && record.midGateClose == '1'" color="#FF0000"
  148. >点位异常</a-tag
  149. >
  150. <template v-if="column.dataIndex === 'ndoortype'">
  151. <span>{{ render.renderDictText(record.ndoortype, 'ndoortype') }}</span>
  152. </template>
  153. <template v-if="column.dataIndex === 'doorUse'">
  154. <span>{{ render.renderDictText(record.doorUse, 'doorUse') }}</span>
  155. </template>
  156. <template v-else-if="column.dataIndex === 'warnLevel'">
  157. <a-tag v-if="record.warnLevel == '101'" color="green">低风险</a-tag>
  158. <a-tag v-else-if="record.warnLevel == '102'" color="#FF5812">一般风险</a-tag>
  159. <a-tag v-else-if="record.warnLevel == '103'" color="#FF5812">较大风险</a-tag>
  160. <a-tag v-else-if="record.warnLevel == '104'" color="#FF5812">重大风险</a-tag>
  161. <a-tag v-else-if="record.warnLevel == '201'" color="#FF0000">报警</a-tag>
  162. <a-tag v-else-if="record.warnLevel == '10000'" color="#FF5812">数据超限</a-tag>
  163. <a-tag v-else-if="record.warnLevel == '1001'" color="default">网络中断</a-tag>
  164. <a-tag v-else color="green">正常</a-tag>
  165. </template>
  166. <a-tag v-else-if="column.dataIndex === 'warnFlag'" :color="record.warnFlag == '0' ? 'green' : 'red'">{{
  167. record.warnFlag == '0' ? '正常' : '报警'
  168. }}</a-tag>
  169. <a-tag v-if="column.dataIndex === 'netStatus'" :color="record.netStatus == '0' ? '#f00' : 'green'">{{
  170. record.netStatus == '0' ? '断开' : '连接'
  171. }}</a-tag>
  172. </template>
  173. <template #action="{ record }">
  174. <a v-if="globalConfig?.showReport" class="table-action-link" @click="deviceEdit($event, 'reportInfo', record)">报表录入</a>
  175. <a class="table-action-link" @click="deviceEdit($event, 'deviceInfo', record)">设备编辑</a>
  176. </template>
  177. </MonitorTable>
  178. </a-tab-pane>
  179. <!-- <a-tab-pane key="2" tab="实时曲线图" force-render>
  180. <div class="tab-item" v-if="activeKey === '2'">
  181. <DeviceEcharts chartsColumnsType="gate_chart" xAxisPropType="strname" :dataSource="dataSource" height="100%"
  182. :chartsColumns="chartsColumns" :device-list-api="list" device-type="gate" />
  183. </div>
  184. </a-tab-pane> -->
  185. <a-tab-pane v-if="!hasPermission('show:noHistory')" key="3" tab="历史数据">
  186. <div class="tab-item" v-if="activeKey === '3'">
  187. <HistoryTable :columnsType="deviceType" :device-type="deviceType" designScope="gate-history" :scroll="scroll">
  188. <template #filterCell="{ column, record }">
  189. <a-tag v-if="column.dataIndex === 'frontGateOpen' && record.frontGateOpen == '0' && record.frontGateClose == '0'" color="red"
  190. >正在运行</a-tag
  191. >
  192. <a-tag v-else-if="column.dataIndex === 'frontGateOpen' && record.frontGateOpen == '0' && record.frontGateClose == 1" color="default"
  193. >关闭</a-tag
  194. >
  195. <a-tag
  196. v-else-if="column.dataIndex === 'frontGateOpen' && record.frontGateOpen == '1' && record.frontGateClose == '0'"
  197. color="#46C66F"
  198. >打开</a-tag
  199. >
  200. <a-tag
  201. v-else-if="column.dataIndex === 'frontGateOpen' && record.frontGateOpen == '1' && record.frontGateClose == '1'"
  202. color="#FF0000"
  203. >点位异常</a-tag
  204. >
  205. <a-tag v-if="column.dataIndex === 'rearGateOpen' && record.rearGateOpen == '0' && record.rearGateClose == '0'" color="red"
  206. >正在运行</a-tag
  207. >
  208. <a-tag v-else-if="column.dataIndex === 'rearGateOpen' && record.rearGateOpen == '0' && record.rearGateClose == '1'" color="default"
  209. >关闭</a-tag
  210. >
  211. <a-tag v-else-if="column.dataIndex === 'rearGateOpen' && record.rearGateOpen == '1' && record.rearGateClose == '0'" color="#46C66F"
  212. >打开</a-tag
  213. >
  214. <a-tag v-else-if="column.dataIndex === 'rearGateOpen' && record.rearGateOpen == '1' && record.rearGateClose == '1'" color="#FF0000"
  215. >点位异常</a-tag
  216. >
  217. <a-tag v-if="column.dataIndex === 'midGateOpen' && record.midGateOpen == '0' && record.midGateClose == '0'" color="red"
  218. >正在运行</a-tag
  219. >
  220. <a-tag v-else-if="column.dataIndex === 'midGateOpen' && record.midGateOpen == '0' && record.midGateClose == 1" color="default"
  221. >关闭</a-tag
  222. >
  223. <a-tag v-else-if="column.dataIndex === 'midGateOpen' && record.midGateOpen == '1' && record.midGateClose == '0'" color="#46C66F"
  224. >打开</a-tag
  225. >
  226. <a-tag v-else-if="column.dataIndex === 'midGateOpen' && record.midGateOpen == '1' && record.midGateClose == '1'" color="#FF0000"
  227. >点位异常</a-tag
  228. >
  229. <template v-if="column.dataIndex === 'ndoortype'">
  230. <span v-if="record.ndoortype == '0'">气动风门</span>
  231. <span v-else color="default">液压风门</span>
  232. </template>
  233. <template v-if="column.dataIndex === 'doorUse'">
  234. <span v-if="record.doorUse == 1" color="default">行车风门</span>
  235. <span v-else-if="record.doorUse == 2">行人风门</span>
  236. <span v-else-if="record.doorUse == 3">短路风门</span>
  237. <span v-else-if="record.doorUse == 4">行车/短路风门</span>
  238. </template>
  239. <template v-else-if="column.dataIndex === 'warnLevel'">
  240. <a-tag v-if="record.warnLevel == '101'" color="green">低风险</a-tag>
  241. <a-tag v-else-if="record.warnLevel == '102'" color="#FF5812">一般风险</a-tag>
  242. <a-tag v-else-if="record.warnLevel == '103'" color="#FF5812">较大风险</a-tag>
  243. <a-tag v-else-if="record.warnLevel == '104'" color="#FF5812">重大风险</a-tag>
  244. <a-tag v-else-if="record.warnLevel == '201'" color="#FF0000">报警</a-tag>
  245. <a-tag v-else-if="record.warnLevel == '10000'" color="#FF5812">数据超限</a-tag>
  246. <a-tag v-else-if="record.warnLevel == '1001'" color="default">网络中断</a-tag>
  247. <a-tag v-else color="green">正常</a-tag>
  248. </template>
  249. </template>
  250. </HistoryTable>
  251. </div>
  252. </a-tab-pane>
  253. <a-tab-pane v-if="!hasPermission('show:noAlarm')" key="4" tab="报警历史">
  254. <div class="tab-item" v-if="activeKey === '4'">
  255. <template v-if="sysOrgCode != 'zmhjhzmy'">
  256. <AlarmHistoryTable
  257. columns-type="alarm"
  258. :device-type="deviceType"
  259. :device-list-api="getTableList"
  260. designScope="alarm-history"
  261. :scroll="scroll"
  262. >
  263. <template #filterCell="{ column, record }">
  264. <a-tag
  265. v-if="column.dataIndex === 'warnFlag'"
  266. :color="record.warnFlag == '0' ? 'green' : record.warnFlag == 1 ? '#FF5812' : 'gray'"
  267. >
  268. {{ record.warnFlag == '0' ? '正常' : record.warnFlag == 1 ? '报警' : record.warnFlag == 2 ? '断开' : '未监测' }}</a-tag
  269. >
  270. <a-tag v-if="column.dataIndex === 'netStatus'" :color="record.netStatus == '0' ? '#f00' : 'green'">{{
  271. record.netStatus == '0' ? '断开' : '连接'
  272. }}</a-tag>
  273. </template>
  274. </AlarmHistoryTable>
  275. </template>
  276. <template v-else>
  277. <AlarmHistoryTableHj :scroll="scroll" />
  278. </template>
  279. </div>
  280. </a-tab-pane>
  281. <a-tab-pane v-if="!hasPermission('show:noHandleHistory')" key="5" tab="操作历史">
  282. <div class="tab-item" v-if="activeKey === '5'">
  283. <HandlerHistoryTable
  284. columns-type="operator_history"
  285. :device-type="deviceType"
  286. :device-list-api="getTableList"
  287. designScope="operator_history"
  288. :scroll="scroll"
  289. />
  290. </div>
  291. </a-tab-pane>
  292. </a-tabs>
  293. </dv-border-box8>
  294. </div>
  295. </div>
  296. <div ref="playerRef" style="z-index: 999; position: absolute; top: 100px; right: 15px; width: 300px; height: 280px; margin: auto"> </div>
  297. <LivePlayer
  298. id="fm-player1"
  299. style="height: 220px; width: 300px; position: absolute; top: 0px; z-index: -1"
  300. ref="player1"
  301. :videoUrl="flvURL1()"
  302. muted
  303. live
  304. loading
  305. controls
  306. />
  307. <HandleModal
  308. v-if="!globalConfig?.simulatedPassword"
  309. :modal-is-show="modalIsShow"
  310. :modal-title="modalTitle"
  311. :modal-type="modalType"
  312. @handle-ok="handleOK"
  313. @handle-cancel="handleCancel"
  314. />
  315. <DeviceBaseInfo @register="registerModal" :device-type="selectData['deviceType']" />
  316. </template>
  317. <script setup lang="ts">
  318. import { onBeforeUnmount, onUnmounted, onMounted, ref, reactive, nextTick, inject, unref } from 'vue';
  319. import MonitorTable from '../comment/MonitorTable.vue';
  320. import HistoryTable from '../comment/HistoryTable.vue';
  321. import AlarmHistoryTable from '../comment/AlarmHistoryTable.vue';
  322. import HandlerHistoryTable from '../comment/HandlerHistoryTable.vue';
  323. import AlarmHistoryTableHj from './components/AlarmHistoryTableHj.vue';
  324. import HandleModal from './modal.vue';
  325. import DeviceBaseInfo from '../comment/components/DeviceBaseInfo.vue';
  326. import { mountedThree, addMonitorText, play, destroy, setModelType, computePlay } from './gate.threejs';
  327. import { deviceControlApi } from '/@/api/vent/index';
  328. import { message } from 'ant-design-vue';
  329. import { list, getTableList, cameraList, cameraAddrList } from './gate.api';
  330. import lodash from 'lodash';
  331. import { setDivHeight } from '/@/utils/event';
  332. import { BorderBox8 as DvBorderBox8 } from '@kjgl77/datav-vue3';
  333. import { useRouter } from 'vue-router';
  334. import LivePlayer from '@liveqing/liveplayer-v3';
  335. import { useModal } from '/@/components/Modal';
  336. import { useCamera } from '/@/hooks/system/useCamera';
  337. import { usePermission } from '/@/hooks/web/usePermission';
  338. import { getDictItems } from '/@/api/common/api';
  339. import { render } from '/@/utils/common/renderUtils';
  340. import { useGlobSetting } from '/@/hooks/setting';
  341. import { getDictItemsByCode } from '/@/utils/dict';
  342. const { hasPermission } = usePermission();
  343. const { sysOrgCode } = useGlobSetting();
  344. const globalConfig = inject('globalConfig');
  345. const { currentRoute } = useRouter();
  346. const MonitorDataTable = ref();
  347. let contrlValue = '';
  348. const playerRef = ref();
  349. const deviceType = ref('gate');
  350. const activeKey = ref('1'); // tab
  351. const loading = ref(false);
  352. const scroll = reactive({
  353. y: 230,
  354. });
  355. const modelList = ref<{ text: string; value: string }[]>([]);
  356. const frontDoorIsOpen = ref(false); //前门是否开启
  357. const backDoorIsOpen = ref(false); //后门是否开启
  358. const midDoorIsOpen = ref(false); //中间门是否开启
  359. const modalIsShow = ref<boolean>(false); // 是否显示模态框
  360. const modalTitle = ref(''); // 模态框标题显示内容,根据设备操作类型决定
  361. const modalType = ref(''); // 模态框内容显示类型,设备操作类型
  362. const selectRowIndex = ref(-1); // 选中行
  363. const dataSource = ref([]);
  364. const deviceBaseList = ref([]); // 设备基本信息
  365. const [registerModal, { openModal, closeModal }] = useModal();
  366. const { getCamera, removeCamera } = useCamera();
  367. const tabChange = (activeKeyVal) => {
  368. activeKey.value = activeKeyVal;
  369. if (activeKeyVal == 1) {
  370. nextTick(() => {
  371. if (MonitorDataTable.value) MonitorDataTable.value.setSelectedRowKeys([selectData.deviceID]);
  372. });
  373. }
  374. };
  375. const initData = {
  376. deviceID: '',
  377. deviceType: '',
  378. strname: '',
  379. frontRearDP: '-', //压差
  380. // sourcePressure: '-', //气源压力
  381. runRoRecondition: null,
  382. autoRoManual: null,
  383. netStatus: '0', //通信状态
  384. frontGateOpen: '0',
  385. frontGateClose: '1',
  386. rearGateOpen: '0',
  387. rearGateClose: '1',
  388. midGateOpen: '0',
  389. midGateClose: '1',
  390. fault: '气源压力超限',
  391. masterComputer: 0,
  392. frontGateOpenCtrl: false,
  393. rearGateOpenCtrl: false,
  394. cameras: [],
  395. };
  396. // 监测数据
  397. const selectData = reactive(lodash.cloneDeep(initData));
  398. const flvURL1 = () => {
  399. // return ''
  400. return `/video/gate.mp4`;
  401. };
  402. function deviceEdit(e: Event, type: string, record) {
  403. e.stopPropagation();
  404. openModal(true, {
  405. type,
  406. deviceId: record['deviceID'],
  407. });
  408. }
  409. // 获取设备基本信息列表
  410. function getDeviceBaseList() {
  411. getTableList({ pageSize: 1000 }).then((res) => {
  412. deviceBaseList.value = res.records;
  413. });
  414. }
  415. // https获取监测数据
  416. let timer: null | NodeJS.Timeout = null;
  417. async function getMonitor(flag?) {
  418. if (Object.prototype.toString.call(timer) === '[object Null]') {
  419. timer = await setTimeout(
  420. async () => {
  421. const res = await list({ devicetype: deviceType.value, pagetype: 'normal' });
  422. if (res.msgTxt && res.msgTxt[0]) {
  423. dataSource.value = res.msgTxt[0].datalist || [];
  424. dataSource.value.forEach((data: any) => {
  425. const readData = data.readData;
  426. data = Object.assign(data, readData);
  427. });
  428. if (dataSource.value.length > 0 && selectRowIndex.value == -1 && MonitorDataTable.value) {
  429. // 初始打开页面
  430. if (currentRoute.value && currentRoute.value['query'] && currentRoute.value['query']['id']) {
  431. MonitorDataTable.value.setSelectedRowKeys([currentRoute.value['query']['id']]);
  432. } else {
  433. MonitorDataTable.value.setSelectedRowKeys([dataSource.value[0]['deviceID']]);
  434. }
  435. }
  436. Object.assign(selectData, dataSource.value[selectRowIndex.value]);
  437. if (selectData.contrlMod == 'jnjhCtrl') {
  438. selectData['autoRoManual'] = selectData['autoRoManual'] == 1 ? true : false;
  439. selectData['autoRoManual1'] = selectData['autoRoManual1'] == 1 ? true : false;
  440. selectData['autoRoManual2'] = selectData['autoRoManual2'] == 1 ? true : false;
  441. }
  442. addMonitorText(selectData);
  443. monitorAnimation(selectData);
  444. if (timer) {
  445. timer = null;
  446. }
  447. getMonitor();
  448. }
  449. },
  450. flag ? 0 : 1000
  451. );
  452. }
  453. }
  454. // 切换检测数据
  455. async function getSelectRow(selectRow, index) {
  456. if (!selectRow) return;
  457. loading.value = true;
  458. selectRowIndex.value = index;
  459. const baseData: any = deviceBaseList.value.find((baseData: any) => baseData.id === selectRow.deviceID);
  460. Object.assign(selectData, initData, selectRow, baseData);
  461. isFrontOpenRunning = false; //开关门动作是否在进行
  462. isRearOpenRunning = false; //开关门动作是否在进行
  463. isMidOpenRunning = false; //开关门动作是否在进行
  464. frontDeviceState = 0; //记录设备状态,为了与下一次监测数据做比较
  465. rearDeviceState = 0; //记录设备状态,为了与下一次监测数据做比较
  466. midDeviceState = 0; //记录设备状态,为了与下一次监测数据做比较
  467. let type;
  468. const dictCodes = getDictItemsByCode('gateStyle');
  469. if (selectData && dictCodes && dictCodes.length > 0) {
  470. const gateStyle = selectData['gateStyle'];
  471. switch (gateStyle) {
  472. case 'gate_qd':
  473. type = 'fm3';
  474. break;
  475. case 'fmtl3':
  476. type = 'fmThreeTl';
  477. break;
  478. case 'fmSs':
  479. type = 'fmTwoSs';
  480. break;
  481. case 'fm_fc':
  482. type = 'fmWindow';
  483. break;
  484. case 'fmXr':
  485. type = 'fmXr';
  486. break;
  487. case 'fmYy':
  488. type = 'fm1';
  489. break;
  490. case 'fmSs3':
  491. type = 'fm2';
  492. break;
  493. case 'fm_fc_hjg':
  494. type = 'fmWindowHjg';
  495. break;
  496. }
  497. } else {
  498. type = selectData.nwindownum == 1 ? 'singleWindow' : 'doubleWindow';
  499. if (selectData['doorUse'] == 2) {
  500. type = 'fmXr';
  501. } else if (selectData.ndoorcount == '3' || selectData.deviceType == 'gate_nomal3') {
  502. type = 'fmThreeTl';
  503. } else {
  504. if (selectData.deviceType == 'gate_ss') {
  505. type = 'fm2';
  506. // type = 'fmWindow';
  507. } else if (selectData.deviceType == 'gate_qd' || selectData.deviceType == 'gate_normal') {
  508. type = 'fm3';
  509. } else if (selectData.deviceType == 'gate_ss_two' || selectData.deviceType == 'gate_ss_two1') {
  510. type = 'fmTwoSs';
  511. } else if (selectData.deviceType == 'gate_tj') {
  512. type = 'fmWindow';
  513. } else {
  514. type = 'fm1'; // 液压
  515. }
  516. }
  517. }
  518. debugger;
  519. setModelType(type).then(async () => {
  520. addMonitorText(selectData);
  521. loading.value = false;
  522. });
  523. await getCamera(selectRow.deviceID, playerRef.value);
  524. }
  525. // 播放动画
  526. function playAnimation(handlerState, data: any = null) {
  527. const value = data;
  528. switch (handlerState) {
  529. case 1: // 打开前门
  530. if (selectData.frontGateOpen == '0' && selectData.frontGateClose == '1') {
  531. modalTitle.value = '打开前门';
  532. modalType.value = '1';
  533. modalIsShow.value = true;
  534. } else {
  535. // message.warning('前门已经打开或正在打开,请勿重新操作');
  536. message.warning('没有监测到前门关到位,无法进行指令下发操作');
  537. }
  538. break;
  539. case 2: // 关闭前门
  540. if (selectData.frontGateOpen == '1' && selectData.frontGateClose == '0') {
  541. modalTitle.value = '关闭前门';
  542. modalType.value = '2';
  543. modalIsShow.value = true;
  544. } else {
  545. // message.warning('前门已经关闭或正在关闭,请勿重新操作');
  546. message.warning('没有监测到前门开到位,无法进行指令下发操作');
  547. }
  548. break;
  549. case 3: // 打开后门
  550. if (selectData.rearGateOpen == '0' && selectData.rearGateClose == '1') {
  551. modalTitle.value = '打开后门';
  552. modalType.value = '3';
  553. modalIsShow.value = true;
  554. } else {
  555. // message.warning('后门已经打开或正在打开,请勿重新操作');
  556. message.warning('没有监测到后门关到位,无法进行指令下发操作');
  557. }
  558. break;
  559. case 4: // 关闭后门
  560. if (selectData.rearGateOpen == '1' && selectData.rearGateClose == '0') {
  561. modalTitle.value = '关闭后门';
  562. modalType.value = '4';
  563. modalIsShow.value = true;
  564. } else {
  565. // message.warning('后门已经关闭或正在关闭,请勿重新操作');
  566. message.warning('没有监测到后门开到位,无法进行指令下发操作');
  567. }
  568. break;
  569. case 8: // 打开中间门
  570. if (selectData.midGateOpen == '0' && selectData.midGateClose == '1') {
  571. modalTitle.value = '打开中间门';
  572. modalType.value = '8';
  573. modalIsShow.value = true;
  574. } else {
  575. // message.warning('后门已经打开或正在打开,请勿重新操作');
  576. message.warning('没有监测到中间门关到位,无法进行指令下发操作');
  577. }
  578. break;
  579. case 9: // 关闭中间门
  580. if (selectData.midGateOpen == '1' && selectData.midGateClose == '0') {
  581. modalTitle.value = '关闭中间门';
  582. modalType.value = '9';
  583. modalIsShow.value = true;
  584. } else {
  585. // message.warning('后门已经关闭或正在关闭,请勿重新操作');
  586. message.warning('没有监测到中间门开到位,无法进行指令下发操作');
  587. }
  588. break;
  589. case 5: // 打开前后门
  590. if (
  591. selectData.frontGateOpen == '0' &&
  592. selectData.frontGateClose == '1' &&
  593. selectData.rearGateOpen == '0' &&
  594. selectData.rearGateClose == '1'
  595. ) {
  596. modalTitle.value = '打开前后门';
  597. modalType.value = '5';
  598. modalIsShow.value = true;
  599. } else {
  600. // message.warning('前后门已经打开或正在打开,请勿重新操作');
  601. message.warning('没有监测到前门、后门关到位,无法进行指令下发操作');
  602. }
  603. break;
  604. case 6: // 关闭前后门
  605. if (
  606. selectData.frontGateOpen == '1' &&
  607. selectData.frontGateClose == '0' &&
  608. selectData.rearGateOpen == '1' &&
  609. selectData.rearGateClose == '0'
  610. ) {
  611. modalTitle.value = '关闭前后门';
  612. modalType.value = '6';
  613. modalIsShow.value = true;
  614. } else {
  615. // message.warning('前后门已经关闭或正在关闭,请勿重新操作');
  616. message.warning('没有监测到前门、后门开到位,无法进行指令下发操作');
  617. }
  618. break;
  619. case 7: // 控制模式切换
  620. modalTitle.value = '控制模式切换';
  621. modalType.value = '7';
  622. modalIsShow.value = true;
  623. break;
  624. case 10: // 风窗控制
  625. modalTitle.value = 'A窗控制';
  626. modalType.value = '10';
  627. modalIsShow.value = true;
  628. break;
  629. case 11: // 风窗控制
  630. modalTitle.value = 'B窗控制';
  631. modalType.value = '11';
  632. modalIsShow.value = true;
  633. break;
  634. case 12: // 风窗控制
  635. modalTitle.value = 'C窗控制';
  636. modalType.value = '12';
  637. modalIsShow.value = true;
  638. break;
  639. case 13: // 风窗控制
  640. modalTitle.value = 'D窗控制';
  641. modalType.value = '13';
  642. modalIsShow.value = true;
  643. break;
  644. }
  645. if (globalConfig?.simulatedPassword) {
  646. handleOK('', handlerState + '');
  647. }
  648. contrlValue = value;
  649. }
  650. // 保德缺打开状态
  651. // function playAnimation(handlerState, data: any = null) {
  652. // const value = data;
  653. // switch (handlerState) {
  654. // case 1: // 打开前门
  655. // modalTitle.value = '打开前门';
  656. // modalType.value = '1';
  657. // modalIsShow.value = true;
  658. // break;
  659. // case 2: // 关闭前门
  660. // modalTitle.value = '关闭前门';
  661. // modalType.value = '2';
  662. // modalIsShow.value = true;
  663. // break;
  664. // case 3: // 打开后门
  665. // modalTitle.value = '打开后门';
  666. // modalType.value = '3';
  667. // modalIsShow.value = true;
  668. // break;
  669. // case 4: // 关闭后门
  670. // modalTitle.value = '关闭后门';
  671. // modalType.value = '4';
  672. // modalIsShow.value = true;
  673. // break;
  674. // case 8: // 打开中间门
  675. // modalTitle.value = '打开中间门';
  676. // modalType.value = '8';
  677. // modalIsShow.value = true;
  678. // break;
  679. // case 9: // 关闭中间门
  680. // modalTitle.value = '关闭中间门';
  681. // modalType.value = '9';
  682. // modalIsShow.value = true;
  683. // break;
  684. // case 5: // 打开前后门
  685. // modalTitle.value = '打开前后门';
  686. // modalType.value = '5';
  687. // modalIsShow.value = true;
  688. // break;
  689. // case 6: // 关闭前后门
  690. // modalTitle.value = '关闭前后门';
  691. // modalType.value = '6';
  692. // modalIsShow.value = true;
  693. // break;
  694. // case 7: // 控制模式切换
  695. // modalTitle.value = '控制模式切换';
  696. // modalType.value = '7';
  697. // modalIsShow.value = true;
  698. // break;
  699. // case 10: // 风窗控制
  700. // modalTitle.value = '风窗控制';
  701. // modalType.value = '10';
  702. // modalIsShow.value = true;
  703. // break;
  704. // }
  705. // if (globalConfig?.simulatedPassword) {
  706. // handleOK('', handlerState + '');
  707. // }
  708. // contrlValue = value;
  709. // }
  710. function handleOK(passWord, handlerState, value?) {
  711. if (!passWord && !globalConfig?.simulatedPassword) {
  712. message.warning('请输入密码');
  713. return;
  714. }
  715. if (isOpenRunning) {
  716. message.warning('风门正在运行。。。');
  717. modalIsShow.value = false;
  718. return;
  719. }
  720. const data = {
  721. deviceid: selectData.deviceID,
  722. devicetype: selectData.deviceType,
  723. paramcode: '',
  724. value: contrlValue,
  725. password: passWord || globalConfig?.simulatedPassword,
  726. masterComputer: selectData.masterComputer,
  727. };
  728. let handler = () => {};
  729. debugger;
  730. switch (handlerState) {
  731. case '1': // 打开前门
  732. if (selectData.frontGateOpen == '0' && selectData.frontGateClose == '1') {
  733. handler = () => {
  734. frontDoorIsOpen.value = true;
  735. };
  736. data.paramcode = 'frontGateOpen_S';
  737. } else {
  738. message.warning('前门已打开。。。');
  739. modalIsShow.value = false;
  740. }
  741. break;
  742. case '2': // 关闭前门
  743. if (selectData.frontGateOpen == '1' && selectData.frontGateClose == '0') {
  744. handler = () => {
  745. frontDoorIsOpen.value = false;
  746. };
  747. data.paramcode = 'frontGateClose_S';
  748. } else {
  749. message.warning('前门已关闭。。。');
  750. modalIsShow.value = false;
  751. }
  752. break;
  753. case '3': // 打开后门
  754. if (selectData.rearGateOpen == '0' && selectData.rearGateClose == '1') {
  755. handler = () => {
  756. backDoorIsOpen.value = true;
  757. };
  758. data.paramcode = 'rearGateOpen_S';
  759. } else {
  760. message.warning('后门已打开。。。');
  761. modalIsShow.value = false;
  762. }
  763. break;
  764. case '4': // 关闭后门
  765. if (selectData.rearGateOpen == '1' && selectData.rearGateClose == '0') {
  766. handler = () => {
  767. backDoorIsOpen.value = false;
  768. };
  769. data.paramcode = 'rearGateClose_S';
  770. } else {
  771. message.warning('后门已关闭。。。');
  772. modalIsShow.value = false;
  773. }
  774. break;
  775. case '8': // 打开中间门
  776. if (selectData.midGateOpen == '0' && selectData.midGateClose == '1') {
  777. handler = () => {
  778. midDoorIsOpen.value = true;
  779. };
  780. data.paramcode = 'midGateOpen_S';
  781. } else {
  782. message.warning('中间风门已打开。。。');
  783. modalIsShow.value = false;
  784. }
  785. break;
  786. case '9': // 关闭中间门
  787. if (selectData.midGateOpen == '1' && selectData.midGateClose == '0') {
  788. handler = () => {
  789. midDoorIsOpen.value = false;
  790. };
  791. data.paramcode = 'midGateClose_S';
  792. } else {
  793. message.warning('中间风门已关闭。。。');
  794. modalIsShow.value = false;
  795. }
  796. break;
  797. case '5': // 打开前后门
  798. if (
  799. selectData.frontGateOpen == '0' &&
  800. selectData.frontGateClose == '1' &&
  801. selectData.rearGateOpen == '0' &&
  802. selectData.rearGateClose == '1'
  803. ) {
  804. handler = () => {
  805. frontDoorIsOpen.value = true;
  806. backDoorIsOpen.value = true;
  807. };
  808. data.paramcode = 'sameTimeOpen';
  809. }
  810. break;
  811. case '6': // 关闭前后门
  812. if (
  813. selectData.frontGateOpen == '1' &&
  814. selectData.frontGateClose == '0' &&
  815. selectData.rearGateOpen == '1' &&
  816. selectData.rearGateClose == '0'
  817. ) {
  818. handler = () => {
  819. frontDoorIsOpen.value = false;
  820. backDoorIsOpen.value = false;
  821. };
  822. data.paramcode = 'sameTimeClose';
  823. }
  824. break;
  825. case '7': // 远程与就地
  826. if (selectData.contrlMod == 'codeCtrl') {
  827. if (contrlValue == '1') {
  828. data.paramcode = 'autoRoManualControl1';
  829. } else if (contrlValue == '0') {
  830. data.paramcode = 'autoRoManualControl2';
  831. } else {
  832. data.paramcode = 'autoRoManualControl0';
  833. }
  834. data.value = '';
  835. selectData.autoRoManual = null;
  836. } else if (selectData.contrlMod == 'loopCtrl' || selectData.contrlMod == 'jnjhCtrl') {
  837. data.paramcode = 'autoRoManualControl';
  838. data.value = '';
  839. selectData.autoRoManual = null;
  840. } else {
  841. data.paramcode = 'autoRoManualControl';
  842. data.value = contrlValue;
  843. selectData.autoRoManual = null;
  844. }
  845. break;
  846. case '10': // 前(A)窗控制
  847. data.paramcode = 'frontSetValue1';
  848. data.value = value;
  849. break;
  850. case '11': // 后(B)窗控制
  851. data.paramcode = 'frontSetValue2';
  852. data.value = value;
  853. break;
  854. case '12': // 后(B)窗控制
  855. data.paramcode = 'rearSetValue1';
  856. data.value = value;
  857. break;
  858. case '13': // 后(B)窗控制
  859. data.paramcode = 'rearSetValue2';
  860. data.value = value;
  861. break;
  862. }
  863. if (data.paramcode) {
  864. deviceControlApi(data).then((res) => {
  865. // 模拟时开启
  866. if (res.success) {
  867. modalIsShow.value = false;
  868. if (globalConfig.History_Type == 'remote') {
  869. message.success('指令已下发至生产管控平台成功!');
  870. } else {
  871. message.success('指令已下发成功!');
  872. }
  873. } else {
  874. message.error(res.message);
  875. }
  876. });
  877. }
  878. }
  879. let isOpenRunning = false; //开关门动作是否在进行
  880. /** 开关门动画调用 */
  881. let isFrontOpenRunning = false; //开关门动作是否在进行
  882. // let isFrontCloseRunning = false; //开关门动作是否在进行
  883. let isRearOpenRunning = false; //开关门动作是否在进行
  884. // let isRearCloseRunning = false; //开关门动作是否在进行
  885. let isMidOpenRunning = false; //中间门动作是否在进行
  886. // let isMidCloseRunning = false; //中间门动作是否在进行
  887. // 0 关闭 1 正在打开 2 打开 3正在关闭
  888. let frontDeviceState = 0; //记录设备状态,为了与下一次监测数据做比较
  889. let rearDeviceState = 0; //记录设备状态,为了与下一次监测数据做比较
  890. let midDeviceState = 0; //记录设备状态,为了与下一次监测数据做比较
  891. function monitorAnimation(selectData) {
  892. const timeScale = 0.005;
  893. // 带风窗 风窗动画
  894. if (selectData['gateStyle'] && selectData['gateStyle'].includes('fm_fc')) playWindowAnimation(selectData);
  895. if (selectData.frontGateOpen == '1' && selectData.frontGateClose == '0' && !isFrontOpenRunning) {
  896. isFrontOpenRunning = true;
  897. if (frontDeviceState != 1) {
  898. // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(1, timeScale) : play(1);
  899. play(1, timeScale);
  900. frontDeviceState = 1;
  901. frontDoorIsOpen.value = false;
  902. backDoorIsOpen.value = true;
  903. }
  904. }
  905. if (selectData.frontGateOpen == '0' && selectData.frontGateClose == '0' && !isFrontOpenRunning) {
  906. isFrontOpenRunning = true;
  907. if (frontDeviceState != 1) {
  908. // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(1, timeScale) : play(1);
  909. play(1, timeScale);
  910. frontDeviceState = 1;
  911. frontDoorIsOpen.value = false;
  912. backDoorIsOpen.value = true;
  913. }
  914. }
  915. if (selectData.frontGateClose == '1' && selectData.frontGateOpen == '0' && isFrontOpenRunning) {
  916. isFrontOpenRunning = false;
  917. if (frontDeviceState != 0) {
  918. // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(2, timeScale) : play(2);
  919. play(2, timeScale);
  920. frontDeviceState = 0;
  921. frontDoorIsOpen.value = false;
  922. // backDoorIsOpen.value = false
  923. }
  924. }
  925. if (selectData.rearGateOpen == '1' && selectData.rearGateClose == '0' && !isRearOpenRunning) {
  926. isRearOpenRunning = true;
  927. if (rearDeviceState != 1) {
  928. rearDeviceState = 1;
  929. // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(3, timeScale) : play(3);
  930. play(3, timeScale);
  931. backDoorIsOpen.value = false;
  932. frontDoorIsOpen.value = true;
  933. }
  934. }
  935. if (selectData.rearGateOpen == '0' && selectData.rearGateClose == '0' && !isRearOpenRunning) {
  936. isRearOpenRunning = true;
  937. if (rearDeviceState != 1) {
  938. rearDeviceState = 1;
  939. // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(3, timeScale) : play(3);
  940. play(3, timeScale);
  941. backDoorIsOpen.value = false;
  942. frontDoorIsOpen.value = true;
  943. }
  944. }
  945. if (selectData.rearGateClose == '1' && selectData.rearGateOpen == '0' && isRearOpenRunning) {
  946. isRearOpenRunning = false;
  947. if (rearDeviceState != 0) {
  948. rearDeviceState = 0;
  949. // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(4, timeScale) : play(4);
  950. play(4, timeScale);
  951. backDoorIsOpen.value = false;
  952. }
  953. }
  954. if (selectData.midGateOpen == '1' && selectData.midGateClose == '0' && !isMidOpenRunning) {
  955. isMidOpenRunning = true;
  956. if (midDeviceState != 1) {
  957. midDeviceState = 1;
  958. // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(3, timeScale) : play(3);
  959. play(8, timeScale);
  960. backDoorIsOpen.value = false;
  961. frontDoorIsOpen.value = true;
  962. }
  963. }
  964. if (selectData.midGateOpen == '0' && selectData.midGateClose == '0' && !isMidOpenRunning) {
  965. isMidOpenRunning = true;
  966. if (midDeviceState != 1) {
  967. midDeviceState = 1;
  968. // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(3, timeScale) : play(3);
  969. play(8, timeScale);
  970. backDoorIsOpen.value = false;
  971. frontDoorIsOpen.value = true;
  972. }
  973. }
  974. if (selectData.midGateClose == '1' && selectData.midGateOpen == '0' && isMidOpenRunning) {
  975. isMidOpenRunning = false;
  976. if (midDeviceState != 0) {
  977. midDeviceState = 0;
  978. // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(4, timeScale) : play(4);
  979. play(9, timeScale);
  980. backDoorIsOpen.value = false;
  981. }
  982. }
  983. }
  984. function playWindowAnimation(data, maxarea = 90, isFirst = false) {
  985. computePlay(data, maxarea, isFirst);
  986. }
  987. function handleCancel() {
  988. modalIsShow.value = false;
  989. modalTitle.value = '';
  990. modalType.value = '';
  991. }
  992. // // 远程、就地切换
  993. // function changeType() {
  994. // const data = {
  995. // deviceid: selectData.deviceID,
  996. // devicetype: selectData.deviceType,
  997. // paramcode: 'autoRoManualControl',
  998. // value: selectData.autoRoManual,
  999. // };
  1000. // deviceControlApi(data).then(() => {
  1001. // if (globalConfig.History_Type == 'remote') {
  1002. // message.success('指令已下发至生产管控平台成功!');
  1003. // } else {
  1004. // message.success('指令已下发成功!');
  1005. // }
  1006. // });
  1007. // }
  1008. onMounted(async () => {
  1009. const { query } = unref(currentRoute);
  1010. if (query['deviceType']) deviceType.value = query['deviceType'] as string;
  1011. modelList.value = await getDictItems('gateModel');
  1012. loading.value = true;
  1013. const playerDom = document.getElementById('fm-player1')?.getElementsByClassName('vjs-tech')[0];
  1014. debugger;
  1015. mountedThree(playerDom)
  1016. .then(async () => {
  1017. if (sysOrgCode != 'zmhjhzmy') {
  1018. await getMonitor(true);
  1019. loading.value = false;
  1020. } else {
  1021. // 韩咀无风门设备,只有报警历史数据,无其他数据
  1022. setModelType('fm1').then(async () => {
  1023. loading.value = false;
  1024. dataSource.value = [];
  1025. addMonitorText(selectData);
  1026. });
  1027. }
  1028. })
  1029. .catch(() => {
  1030. debugger;
  1031. });
  1032. });
  1033. onBeforeUnmount(() => {
  1034. getDeviceBaseList();
  1035. });
  1036. onUnmounted(() => {
  1037. removeCamera();
  1038. if (timer) {
  1039. clearTimeout(timer);
  1040. timer = undefined;
  1041. }
  1042. destroy();
  1043. });
  1044. </script>
  1045. ,
  1046. <style lang="less" scoped>
  1047. @import '/@/design/theme.less';
  1048. @import '/@/design/vent/modal.less';
  1049. .scene-box {
  1050. .bottom-tabs-box {
  1051. height: 350px;
  1052. }
  1053. }
  1054. .button-box {
  1055. border: none !important;
  1056. height: 34px !important;
  1057. &:hover {
  1058. background: var(--vent-device-manager-control-btn-hover) !important;
  1059. }
  1060. &::before {
  1061. height: 27px !important;
  1062. background: var(--vent-device-manager-control-btn) !important;
  1063. }
  1064. &::after {
  1065. top: 35px !important;
  1066. }
  1067. }
  1068. :deep(.@{ventSpace}-tabs-tabpane-active) {
  1069. height: 100%;
  1070. }
  1071. ::-webkit-scrollbar-thumb {
  1072. -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  1073. background: #4288a444;
  1074. }
  1075. :deep(.zxm-radio-disabled + span) {
  1076. color: var(--vent-font-color) !important;
  1077. }
  1078. :deep(.zxm-radio-disabled .zxm-radio-inner::after) {
  1079. background-color: #127cb5 !important;
  1080. }
  1081. :deep(.@{ventSpace}-picker-datetime-panel) {
  1082. height: 200px !important;
  1083. overflow-y: auto !important;
  1084. }
  1085. </style>