index.vue 24 KB

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