index.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703
  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="window3D" style="width: 100%; height: 100%; position: absolute; overflow: hidden"> </div>
  5. </div>
  6. <div class="scene-box">
  7. <div class="top-box">
  8. <div class="top-center row">
  9. <!-- <div class="button-box" @click="start(0)">复位</div> -->
  10. <div class="button-box" @click="testPlay('')">模拟动画</div>
  11. <div class="button-box" @click="clearPlay()">自动清洁</div>
  12. <div class="button-box" @click="startRun()">启动测风</div>
  13. <!-- <div class="button-box" @click="testPlay('up')">上</div>
  14. <div class="button-box" @click="testPlay('center')">中</div>
  15. <div class="button-box" @click="testPlay('down')">下</div>
  16. <div class="button-box" @click="testPlay('reset')">复位</div> -->
  17. </div>
  18. <div class="top-right row">
  19. <div class="control-type row">
  20. <div class="control-title">控制模式:</div>
  21. <a-radio-group v-model:value="controlType">
  22. <a-radio :value="1">就地</a-radio>
  23. <a-radio :value="2">远程</a-radio>
  24. </a-radio-group>
  25. </div>
  26. <div class="run-type row">
  27. <div class="control-title">运行状态:</div>
  28. <a-radio-group v-model:value="controlType">
  29. <a-radio :value="1">检修</a-radio>
  30. </a-radio-group>
  31. </div>
  32. <div class="run-state row">
  33. <div class="control-title">网络状态:</div>
  34. <a-radio-group v-model:value="controlType">
  35. <a-radio :value="1">运行</a-radio>
  36. </a-radio-group>
  37. </div>
  38. </div>
  39. </div>
  40. <div class="title-text">
  41. {{ selectData.strname }}
  42. </div>
  43. <div class="bottom-tabs-box">
  44. <div class="tabs-button-group">
  45. <a-button class="tabs-button" type="primary" @click="openModel">一键测风</a-button>
  46. <!-- <a-button class="tabs-button" type="primary" @click="exportExcel()">导出报表</a-button> -->
  47. </div>
  48. <a-tabs class="tabs-box" v-model:activeKey="activeKey" @change="tabChange">
  49. <a-tab-pane key="1" tab="实时监测">
  50. <MonitorTable
  51. columnsType="windrect_monitor"
  52. :dataSource="dataSource"
  53. design-scope="windrect-monitor"
  54. @selectRow="getSelectRow"
  55. title="测风装置监测"
  56. >
  57. <template #filterCell="{ column, record }">
  58. <a-tag v-if="column.dataIndex === 'netStatus'" :color="record.netStatus == 0 ? '#FF5812' : 'green'">{{
  59. record.netStatus == 0 ? '断开' : '连接'
  60. }}</a-tag>
  61. <a-tag v-if="column.dataIndex === 'warnFlag'" :color="record.warnFlag == 0 ? 'green' : record.warnFlag == 1 ? '#FF5812' : 'gray' "> {{
  62. record.warnFlag == 0 ? '正常' : record.warnFlag == 1 ? '报警' : record.warnFlag == 2 ? '断开' : '未监测'
  63. }}</a-tag>
  64. <a-tag v-if="column.dataIndex === 'sign'" :color="record.sign == 0 ? '#95CF65' : record.sign == 1 ? '#4590EA' : '#9876AA'"> {{
  65. record.sign == 0 ? '高位' : record.sign == 1 ? '中位' : '低位'
  66. }}</a-tag>
  67. <template v-if="record && column && column.dataIndex === 'isRun' && record.isRun">
  68. <a-tag v-if="record.isRun == -2 || record.isRun == -1" :color="record.isRun == -2 ? '#95CF65' : '#ED5700'">{{
  69. record.isRun == -2 ? '空闲' : '等待'
  70. }}</a-tag>
  71. <a-tag v-else-if="record.isRun == 100" color="#4693FF">完成</a-tag>
  72. <Progress v-else :percent="Number(record.isRun)" size="small" status="active" />
  73. </template>
  74. </template>
  75. </MonitorTable>
  76. </a-tab-pane>
  77. <a-tab-pane key="2" tab="监测曲线图" force-render>
  78. <div class="tab-item" v-if="activeKey === '2'">
  79. <DeviceEcharts
  80. chartsColumnsType="windrect_chart"
  81. xAxisPropType="strname"
  82. :dataSource="dataSource"
  83. height="100%"
  84. :chartsColumns="chartsColumns"
  85. :device-list-api="baseList"
  86. device-type="windrect"
  87. />
  88. </div>
  89. </a-tab-pane>
  90. <a-tab-pane key="3" tab="历史数据">
  91. <div class="tab-item">
  92. <HistoryTable columns-type="windrect" device-type="windrect" :device-list-api="baseList" designScope="windrect-history" >
  93. <template #filterCell="{ column, record }">
  94. <a-tag v-if="column.dataIndex === 'warnFlag'" :color="record.warnFlag == 0 ? 'green' : record.warnFlag == 1 ? '#FF5812' : 'gray'"> {{
  95. record.warnFlag == 0 ? '正常' : record.warnFlag == 1 ? '报警' : record.warnFlag == 2 ? '断开' : '未监测'
  96. }}</a-tag>
  97. </template>
  98. </HistoryTable>
  99. </div>
  100. </a-tab-pane>
  101. <a-tab-pane key="4" tab="报警历史">
  102. <div class="tab-item">
  103. <AlarmHistoryTable columns-type="alarm" device-type="windrect" :device-list-api="baseList" designScope="alarm-history" />
  104. </div>
  105. </a-tab-pane>
  106. <a-tab-pane key="5" tab="操作历史">
  107. <div class="tab-item">
  108. <HandlerHistoryTable columns-type="operator_history" device-type="fanlocal" :device-list-api="baseList" designScope="operator_history" />
  109. </div>
  110. </a-tab-pane>
  111. <a-tab-pane key="6" tab="测风结果">
  112. <ResultTable v-if="activeKey == 6" deviceType="windrect_list" />
  113. </a-tab-pane>
  114. </a-tabs>
  115. </div>
  116. </div>
  117. <div style="z-index: -1; position: absolute; top: 50px; right: 10px; width: 300px; height: 280px; margin: auto" class="palyer">
  118. <LivePlayer id="cf-player1" ref="player1" :videoUrl="flvURL1()" alt="无信号" muted live loading controls />
  119. <LivePlayer id="cf-player2" ref="player2" :videoUrl="flvURL1()" alt="无信号" muted live loading controls style="margin-top: 10px" />
  120. </div>
  121. <BasicModal v-bind="$attrs" @register="registerModal" title="一键测风" width="900px" @ok="handleOk" @cancel="handleCancel">
  122. <div class="head-line">
  123. <div class="vent-flex-row">
  124. <span>同时运行数量:</span>
  125. <a-input-number v-model:value="runNum" :min="1" :max="10" />
  126. </div>
  127. <div class="vent-flex-row">
  128. <div v-for="(criticalPath, index) in criticalPathList" :key="index" class="button-box" @click="selectCriticalPath(criticalPath.id)">{{
  129. criticalPath.systemname
  130. }}</div>
  131. </div>
  132. </div>
  133. <div>
  134. <ModalTable ref="modalTable" deviceType="windrect_list" />
  135. </div>
  136. </BasicModal>
  137. </template>
  138. <script setup lang="ts">
  139. import DeviceEcharts from '../comment/DeviceEcharts.vue';
  140. import { onBeforeMount, computed, ComputedRef, ref, onMounted, onUnmounted, reactive, toRaw, toRef, toRefs, Ref } from 'vue';
  141. import { BasicModal, useModalInner } from '/@/components/Modal';
  142. import MonitorTable from '../comment/MonitorTable.vue';
  143. import ModalTable from './components/modalTable.vue';
  144. import ResultTable from './components/resultTable.vue';
  145. import HistoryTable from '../comment/HistoryTable.vue';
  146. import AlarmHistoryTable from '../comment/AlarmHistoryTable.vue';
  147. import HandlerHistoryTable from '../comment/HandlerHistoryTable.vue';
  148. import { initWebSocket, getRecordList } from '/@/hooks/web/useVentWebSocket';
  149. import { deviceControlApi } from '/@/api/vent/index';
  150. import { mountedThree, destroy, addFmText, play, setModelType, playCamera } from './windrect.threejs';
  151. import LivePlayer from '@liveqing/liveplayer-v3';
  152. import { list, pathList, deviceList, testWind } from './windrect.api';
  153. import { list as baseList } from '../../deviceManager/windfindingTabel/windfinding.api';
  154. import { message, Progress } from 'ant-design-vue';
  155. import { chartsColumns } from './windrect.data';
  156. const modalTable = ref();
  157. const runNum = ref(5); //设备运行数量
  158. const criticalPathList = ref([]);
  159. const player1 = ref<HTMLDivElement | null>(null);
  160. const player2 = ref<HTMLDivElement | null>(null);
  161. const activeKey = ref('1');
  162. const loading = ref(false);
  163. // 默认初始是第一行
  164. const selectRowIndex = ref(0);
  165. // 监测数据
  166. const selectData = reactive({
  167. deviceID: '',
  168. deviceType: '',
  169. strname: '',
  170. dataDh: '-', //压差
  171. dataDtestq: '-', //测试风量
  172. sourcePressure: '-', //气源压力
  173. dataDequivalarea: '-',
  174. netStatus: '0', //通信状态
  175. fault: '气源压力超限',
  176. sign: -1,
  177. sensorRight: 0,
  178. sensorMiddle: 1,
  179. sensorLeft: 0
  180. });
  181. const flvURL1 = () => {
  182. // return `https://sf1-hscdn-tos.pstatp.com/obj/media-fe/xgplayer_doc_video/flv/xgplayer-demo-360p.flv`;
  183. return ''
  184. };
  185. const flvURL2 = () => {
  186. return `https://sf1-hscdn-tos.pstatp.com/obj/media-fe/xgplayer_doc_video/flv/xgplayer-demo-360p.flv`;
  187. };
  188. // const dataSource = computed(() => {
  189. // const data = [...getRecordList()] || [];
  190. // Object.assign(selectData, toRaw(data[selectRowIndex.value]));
  191. // addFmText(selectData);
  192. // return data;
  193. // });
  194. const dataSource = ref([]);
  195. const tabChange = (activeKeyVal) => {
  196. activeKey.value = activeKeyVal;
  197. };
  198. // 设备数据
  199. const controlType = ref(1);
  200. //表单赋值
  201. const [registerModal, { setModalProps, closeModal }] = useModalInner();
  202. // https获取监测数据
  203. let timer: null | NodeJS.Timeout = null;
  204. function getMonitor() {
  205. if (Object.prototype.toString.call(timer) === '[object Null]') {
  206. timer = setTimeout(() => {
  207. list({ devicetype: 'windrect', pagetype: 'normal' }).then((res) => {
  208. dataSource.value = res.msgTxt[0].datalist || [];
  209. if(dataSource.value.length > 0){
  210. dataSource.value.forEach((data: any) => {
  211. const readData = data.readData;
  212. data = Object.assign(data, readData);
  213. });
  214. const data: any = toRaw(dataSource.value[selectRowIndex.value]); //maxarea
  215. Object.assign(selectData, data);
  216. addFmText(selectData);
  217. palyAnimation(selectData)
  218. }
  219. if (timer) {
  220. timer = null;
  221. }
  222. getMonitor();
  223. });
  224. }, 1000);
  225. }
  226. };
  227. let deviceRunState = '', tanTouRunState= '';
  228. // 根据3个点位分别执行动画
  229. function palyAnimation(selectData) {
  230. if (selectData.deviceType == "windrect_fold") {
  231. if (selectData['apparatusRun'] == 1) {
  232. const flag = selectData.sign == 0 ? 'up' : selectData.sign == 1 ? 'center' : selectData.sign == 2 ? 'down' : null
  233. if (flag) play(flag);
  234. } else {
  235. const flag = selectData.sign == 1 ? 'center' : selectData.sign == 2 ? 'down' : null
  236. if (flag) play(flag, true);
  237. }
  238. }
  239. // 运行中是0,运行到达是1
  240. if (selectData.deviceType == "windrect_rect_single") {
  241. if(selectData['apparatusRun'] == 1){
  242. // 镜头指向横杆
  243. // if(!deviceRunState && !tanTouRunState)playCamera('start')
  244. // 正在执行或是开始执行
  245. //开始执行时,
  246. // selectData['poleIncipient'] == 1 selectData.sensorMiddle == 1 代表可是执行 或是 执行结束
  247. // 1. selectData['poleIncipient'] == 1 selectData.sensorMiddle == 1, 执行 play('up', true),play('middle', true)
  248. // 2. 探头左移play('left')
  249. // 3. 探头右移play('right')
  250. // 4. 横杆向中位移动,探头在右边
  251. // 5. 探头移到中间play('middle')
  252. // 6. 探头移到左边play('left')
  253. // 7. 横杆向低位移动,探头在左边
  254. // 8. 探头移到中间play('middle')
  255. // 9. 探头右移play('right')
  256. // 10. 测风结束,探头移到中间play('middle'),横杆向高位移动
  257. if(selectData['poleIncipient'] == 1){
  258. // 横杆在高位,开始执行 或是 执行结束
  259. if(selectData.sensorMiddle == 1 && !deviceRunState && !tanTouRunState){
  260. // 1. 开始执行
  261. deviceRunState = 'up'
  262. tanTouRunState= 'middle'
  263. play('up', true)
  264. play('middle', true)
  265. }
  266. if (deviceRunState == 'up-m') {
  267. play('up', true)
  268. play('middle', true)
  269. deviceRunState = ''
  270. tanTouRunState = ''
  271. playCamera('end')
  272. }
  273. // 初始已经在运行
  274. if(selectData.sensorLeft == 0 && selectData.sensorMiddle == 0 && selectData.sensorRight == 0) {
  275. //2.探头左移play('left')
  276. if(tanTouRunState == 'middle'){
  277. tanTouRunState = 'left-m'
  278. play('left')
  279. }
  280. //3. 探头右移play('right')
  281. if (tanTouRunState == 'left') {
  282. tanTouRunState = 'right-m'
  283. play('right')
  284. }
  285. }
  286. if(selectData.sensorLeft == 1){
  287. tanTouRunState = 'left'
  288. if (!tanTouRunState || tanTouRunState == 'left-m') {
  289. play('left', true)
  290. }
  291. }
  292. if (selectData.sensorRight == 1) {
  293. tanTouRunState = 'right'
  294. if (!tanTouRunState || tanTouRunState == 'right-m') {
  295. play('right', true)
  296. }
  297. }
  298. }else if (selectData['poleMiddle'] == 1) {
  299. if(deviceRunState == 'center-m'){
  300. play('center', true)
  301. deviceRunState = 'center'
  302. tanTouRunState = 'right'
  303. play('right', true)
  304. }
  305. if (!deviceRunState) {
  306. deviceRunState = 'center'
  307. play('center', true)
  308. }
  309. if (!tanTouRunState) {
  310. play('right', true)
  311. }
  312. // 横杆在中位
  313. if (selectData.sensorLeft == 0 && selectData.sensorMiddle == 0 && selectData.sensorRight == 0) {
  314. //5. 探头移到中间play('middle')
  315. if (tanTouRunState == 'right') {
  316. tanTouRunState = 'middle-m'
  317. play('middle')
  318. }
  319. //6. 探头移到左边play('left')
  320. if (tanTouRunState == 'middle') {
  321. tanTouRunState = 'left-m'
  322. play('left')
  323. }
  324. }
  325. if (selectData.sensorMiddle == 1) {
  326. tanTouRunState = 'middle'
  327. if (!tanTouRunState || tanTouRunState == 'middle-m') {
  328. play('middle', true)
  329. }
  330. }
  331. if (selectData.sensorLeft == 1) {
  332. tanTouRunState = 'left'
  333. if (!tanTouRunState || tanTouRunState == 'left-m') {
  334. play('left', true)
  335. }
  336. }
  337. }else if (selectData['poleNether'] == 1) {
  338. if (deviceRunState == 'down-m') {
  339. play('down', true)
  340. deviceRunState = 'down'
  341. tanTouRunState = 'left'
  342. play('left', true)
  343. }
  344. if(!deviceRunState) {
  345. play('down', true)
  346. deviceRunState = 'down'
  347. }
  348. if (!tanTouRunState) {
  349. play('left', true)
  350. }
  351. // 横杆在低位
  352. if (selectData.sensorLeft == 0 && selectData.sensorMiddle == 0 && selectData.sensorRight == 0) {
  353. //8. 探头移到中间play('middle')
  354. if (tanTouRunState == 'left') {
  355. tanTouRunState = 'left-middle-m'
  356. play('middle')
  357. }
  358. //9. 探头右移play('right')
  359. if (tanTouRunState == 'middle1') {
  360. tanTouRunState = 'right-m'
  361. play('right')
  362. }
  363. // 10. 测风结束,探头移到中间play('middle'),横杆向高位移动
  364. if (tanTouRunState == 'right') {
  365. tanTouRunState = 'right-middle-m'
  366. play('middle')
  367. }
  368. }
  369. if (selectData.sensorMiddle == 1) {
  370. if(tanTouRunState == 'left-middle-m')tanTouRunState = 'middle1'
  371. if (tanTouRunState == 'right-middle-m') tanTouRunState = 'middle2'
  372. if (!tanTouRunState || tanTouRunState == 'left-middle-m' || tanTouRunState == 'right-middle-m') {
  373. play('middle', true)
  374. }
  375. }
  376. if (selectData.sensorRight == 1) {
  377. tanTouRunState = 'right'
  378. if (!tanTouRunState || tanTouRunState == 'right-m') {
  379. play('right', true)
  380. }
  381. }
  382. }else {
  383. // 横杆正在运行
  384. if(deviceRunState == 'up'){
  385. deviceRunState = 'center-m'
  386. play('center')
  387. }
  388. if (deviceRunState == 'center') {
  389. deviceRunState = 'down-m'
  390. play('down')
  391. }
  392. if (deviceRunState == 'down') {
  393. deviceRunState = 'up-m'
  394. play('up')
  395. }
  396. }
  397. // //正在执行时
  398. // // 判断上中下是否都为0
  399. // if(selectData['poleIncipient'] == 0 && selectData['poleMiddle'] == 0 && selectData['poleNether'] == 0) {
  400. // // 判断是否有前一个状态值,有的话执行
  401. // //没有前一个状态
  402. // //有前一个状态
  403. // // 横杆前状态在上位时,横杆中位移动,探头在右边
  404. // // 横杆前状态在中位时,横杆下位移动,探头在左边
  405. // // 横杆前状态在下位时,横杆上位移动,探头在中间
  406. // }else{
  407. // // 判断当前动画停在固定位置
  408. // if(selectData['poleIncipient'] == 1) {
  409. // // 滑杆停在上面,探头在中间
  410. // }else if (selectData['poleMiddle'] == 1) {
  411. // // 滑杆停在中间面,初始探头在右边
  412. // } else if (selectData['poleNether'] == 1) {
  413. // // 滑杆停在下面,初始探头在左边
  414. // }
  415. // }
  416. }else {
  417. // if(selectData['poleIncipient'] == 1){
  418. // deviceRunState = ''
  419. // tanTouRunState = ''
  420. // }
  421. }
  422. }
  423. if (selectData.deviceType == "windrect_rect") {
  424. if (selectData['apparatusRun'] == 1) {
  425. const flag = selectData.sign == 0 ? 'center' : selectData.sign == 1 ? 'down' : selectData.sign == 2 ? 'up' : null
  426. if (flag) play(flag);
  427. } else {
  428. const flag = selectData.sign == 1 ? 'center' : selectData.sign == 2 ? 'down' : selectData.sign == 0 ? 'up' : null
  429. if (flag) play(flag, true);
  430. }
  431. }
  432. if (selectData.deviceType == "windrect_ds") {
  433. if (selectData['apparatusRun'] == 1) {
  434. if(!deviceRunState) {
  435. deviceRunState = 'start'
  436. play('start')
  437. }
  438. } else {
  439. deviceRunState = ''
  440. play('start', true)
  441. }
  442. }
  443. }
  444. // 自测动画方法
  445. function testPlay(flag) {
  446. if (selectData.deviceType == 'windrect_rect') {
  447. setTimeout(() => {
  448. play('center')
  449. }, 0)
  450. setTimeout(() => {
  451. play('down')
  452. }, 4000)
  453. setTimeout(() => {
  454. play('up')
  455. }, 10000)
  456. }
  457. if(selectData.deviceType == 'windrect_fold') {
  458. setTimeout(() => {
  459. play('up')
  460. }, 0)
  461. setTimeout(() => {
  462. play('center')
  463. }, 10000)
  464. setTimeout(() => {
  465. play('down')
  466. }, 18000)
  467. setTimeout(() => {
  468. play('up')
  469. }, 21000)
  470. }
  471. if(selectData.deviceType == 'windrect_ds') {
  472. play('moni')
  473. }
  474. };
  475. function clearPlay() {
  476. const data = {
  477. deviceid: selectData.deviceID,
  478. devicetype: selectData.deviceType,
  479. paramcode: 'autoClear',
  480. value: null,
  481. masterComputer: selectData.masterComputer,
  482. };
  483. deviceControlApi(data)
  484. .then((res) => {
  485. // 模拟时开启
  486. if (res.success) {
  487. message.success('自清洁功能启动成功!')
  488. }
  489. })
  490. }
  491. function startRun() {
  492. testWind({ ids: [selectData.deviceID], maxnum: runNum.value }).then((res) => {
  493. message.success('开始测风。。。');
  494. });
  495. }
  496. // 切换检测数据
  497. async function getSelectRow(selectRow, index) {
  498. if(selectRow){
  499. loading.value = true;
  500. selectRowIndex.value = index;
  501. // Object.assign(selectData, selectRow);
  502. let type = ''
  503. if(selectRow.deviceType == 'windrect_rect') {
  504. type = 'lmWindRect'
  505. }
  506. if (selectRow.deviceType == 'windrect_fold') {
  507. type = 'zdWindRect'
  508. }
  509. if (selectRow.deviceType == 'windrect_rect_single') {
  510. type = 'lmWindSide'
  511. }
  512. if (selectRow.deviceType == 'windrect_ds') {
  513. type = 'dsWindRect_move'
  514. }
  515. if (selectRow.deviceType == 'windrect_ds_four') {
  516. type = 'dsWindRect_four'
  517. }
  518. if (selectRow.deviceType == 'windrect_ds_two') {
  519. type = 'dsWindRect_two'
  520. }
  521. // const type = selectRowIndex.value >= 1 ? 'lmWindRect' : selectRowIndex.value <= 3 ? 'zdWindRect' : 'dsWindRect';
  522. await setModelType(type);
  523. loading.value = false;
  524. deviceRunState = ''
  525. tanTouRunState = ''
  526. }
  527. };
  528. function addPlayVideo(event) {
  529. event.preventDefault();
  530. if (player1.value.play && player2.value.play) {
  531. player1.value.play();
  532. player2.value.play();
  533. document.body.removeEventListener('mousedown', addPlayVideo);
  534. }
  535. };
  536. /* 一键测风 */
  537. function handleOk() {
  538. const ids = toRaw(modalTable.value.selectedRowKeys);
  539. testWind({ ids: ids, maxnum: runNum.value }).then((res) => {
  540. message.success(res);
  541. setModalProps({ visible: false });
  542. modalTable.value.clearSelectedRowKeys();
  543. });
  544. };
  545. /* 打开一键测风弹窗 */
  546. function openModel() {
  547. setModalProps({ visible: true });
  548. };
  549. function exportExcel(id) {
  550. exportXls({ testid: id })
  551. }
  552. /* 关闭一键测风弹窗 */
  553. function handleCancel() {
  554. setModalProps({ visible: false });
  555. modalTable.value.clearSelectedRowKeys();
  556. };
  557. /** 避灾路线上的测风装置 */
  558. async function getPathList() {
  559. const pathArr = await pathList({});
  560. criticalPathList.value = pathArr.records.filter((item) => {
  561. return item.strsystype == 3;
  562. });
  563. };
  564. /* 根据路线选择测风装置 */
  565. function selectCriticalPath(pathId) {
  566. deviceList({ deviceType: 'wind', sysId: pathId }).then((res) => {
  567. const ids: string[] = [];
  568. res.records.forEach((item) => {
  569. ids.push(item.id);
  570. });
  571. if (modalTable.value) modalTable.value.setSelectedRowKeys(ids);
  572. });
  573. };
  574. onBeforeMount(() => {
  575. getPathList();
  576. });
  577. onMounted(() => {
  578. loading.value = true;
  579. mountedThree(player1.value, player2.value).then(async () => {
  580. getMonitor();
  581. // loading.value = false;
  582. });
  583. document.body.addEventListener('mousedown', addPlayVideo, false);
  584. });
  585. onUnmounted(() => {
  586. destroy();
  587. if (timer) {
  588. clearTimeout(timer);
  589. timer = undefined;
  590. }
  591. });
  592. </script>
  593. <style scoped lang="less">
  594. @import '/@/design/vent/modal.less';
  595. @ventSpace: zxm;
  596. :deep(.@{ventSpace}-tabs-tabpane-active) {
  597. overflow: auto;
  598. }
  599. .head-line {
  600. display: flex;
  601. flex-direction: row;
  602. justify-content: space-between;
  603. .button-box {
  604. position: relative;
  605. padding: 5px;
  606. border: 1px transparent solid;
  607. border-radius: 5px;
  608. margin-left: 8px;
  609. margin-right: 8px;
  610. width: auto;
  611. height: 34px;
  612. border: 1px solid #65dbea;
  613. display: flex;
  614. align-items: center;
  615. justify-content: center;
  616. color: #fff;
  617. padding: 0 15px;
  618. cursor: pointer;
  619. pointer-events: auto;
  620. &:hover {
  621. background: linear-gradient(#3eb2ff55, #00c3ff55);
  622. }
  623. &::before {
  624. width: calc(100% - 6px);
  625. height: 26px;
  626. content: '';
  627. position: absolute;
  628. top: 3px;
  629. right: 0;
  630. left: 3px;
  631. bottom: 0;
  632. z-index: -1;
  633. border-radius: inherit; /*important*/
  634. background: linear-gradient(#014978, #3bf3fc);
  635. }
  636. }
  637. }
  638. .@{ventSpace}-tabs-tabpane {
  639. overflow-y: auto !important;
  640. }
  641. </style>