index.vue 25 KB

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