index.vue 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904
  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
  5. id="main3DCSS"
  6. class="threejs-Object-CSS"
  7. v-show="!loading"
  8. style="width: 100%; height: 100%; position: absolute; pointer-events: none; overflow: hidden; z-index: 1; top: 0"
  9. >
  10. <div style="position: relative">
  11. <div class="elementTag" id="inputBox">
  12. <div class="elementContent elementContent-r" v-if="selectData.DataPa && backMonitorIsShow">
  13. <p><span class="data-title">风机气压(Pa):</span>{{ selectData.DataPa ? selectData.DataPa : '-' }}</p>
  14. <p><span class="data-title">风机静压(Pa):</span>{{ selectData.Fan2Negative ? selectData.Fan2Negative : '-' }}</p>
  15. <p><span class="data-title">风机风量(m³/s):</span>{{ selectData.Fan2m3 ? selectData.Fan2m3 : '-' }}</p>
  16. </div>
  17. </div>
  18. <div class="elementTag" id="inputBox1">
  19. <div class="elementContent elementContent-r" v-if="selectData.DataPa && frontMonitorIsShow">
  20. <p><span class="data-title">风机全压(Pa):</span>{{ selectData.DataPa ? selectData.DataPa : '-' }}</p>
  21. <p><span class="data-title">风机静压(Pa):</span>{{ selectData.Fan1Negative ? selectData.Fan1Negative : '-' }}</p>
  22. <p><span class="data-title">风机风量(m³/s):</span>{{ selectData.Fan1m3 ? selectData.Fan1m3 : '-' }}</p>
  23. </div>
  24. </div>
  25. </div>
  26. </div>
  27. <div id="main3D" style="width: 100%; height: 100%; position: absolute; overflow: hidden"> </div>
  28. <FanEchrats id="fan-echarts" :chartData="selectData" style="position: absolute; z-index: -1" />
  29. </div>
  30. <div class="scene-box" style="z-index: 999">
  31. <div class="title-text" style="position: absolute; z-index: 9999; width: 100%; text-align: center">{{ selectData.strname }}</div>
  32. <div class="top-box control-group">
  33. <div class="button-box" v-for="(item, index) in modalTypeArr.centerBtnArr" :key="index" @click="showModal(item)">{{ item.value }}</div>
  34. </div>
  35. <div class="data-show-box">
  36. <div class="data-item">
  37. <div class="item-header">环境监测</div>
  38. <div class="item-container">
  39. <div class="tab">
  40. <div class="tab-item" :class="{ 'tab-item-active-r': dataMonitorRowIndex == 0 }" @click="selectDevice('dataMonitorRowIndex', 0)"
  41. >1#风机</div
  42. >
  43. <div class="tab-item" :class="{ 'tab-item-active-r': dataMonitorRowIndex == 1 }" @click="selectDevice('dataMonitorRowIndex', 1)"
  44. >2#风机</div
  45. >
  46. </div>
  47. <div class="container-group container-group-l">
  48. <template v-if="deviceType">
  49. <div class="container-item" v-for="(data, index) in getTableHeaderColumns(deviceType + '_monitor_left')" :key="index">
  50. <div class="item-icon">
  51. <SvgIcon class="icon-style" size="18" name="temperature" />
  52. </div>
  53. <div class="item-name">{{ data.title }}</div>
  54. <div v-if="data.dataIndex.startsWith('Fan')">
  55. <div class="item-value" v-if="dataMonitorRowIndex == 0">{{
  56. selectData[data.dataIndex.replace('Fan', 'Fan1')] ? selectData[data.dataIndex.replace('Fan', 'Fan1')] : '-'
  57. }}</div>
  58. <div class="item-value" v-if="dataMonitorRowIndex == 1">{{
  59. selectData[data.dataIndex.replace('Fan', 'Fan2')] ? selectData[data.dataIndex.replace('Fan', 'Fan2')] : '-'
  60. }}</div>
  61. </div>
  62. <div v-else>
  63. <div class="item-value">{{ selectData[data.dataIndex] ? selectData[data.dataIndex] : '-' }}</div>
  64. </div>
  65. </div>
  66. </template>
  67. </div>
  68. </div>
  69. </div>
  70. <div class="data-item">
  71. <div class="item-header">设备状态</div>
  72. <div class="item-container">
  73. <div class="tab">
  74. <div class="tab-item" :class="{ 'tab-item-active-r': warningMonitorRowIndex === 0 }" @click="selectDevice('warningMonitorRowIndex', 0)"
  75. >1#风机</div
  76. >
  77. <div class="tab-item" :class="{ 'tab-item-active-r': warningMonitorRowIndex === 1 }" @click="selectDevice('warningMonitorRowIndex', 1)"
  78. >2#风机</div
  79. >
  80. </div>
  81. <div class="container-group">
  82. <div class="warning-header">
  83. <div class="header-item">
  84. <div class="header-title">报警总数</div>
  85. <div class="header-value">0</div>
  86. </div>
  87. <div class="header-item">
  88. <div class="header-title"> 未处理数</div>
  89. <div class="header-value">0</div>
  90. </div>
  91. </div>
  92. <div class="warning-group">
  93. <template v-if="deviceType">
  94. <div class="warning-item" v-for="(state, index) in getTableHeaderColumns(deviceType + '_monitor_right')" :key="index">
  95. <div class="item-name"><div class="icon"></div> {{ state.title }}</div>
  96. <div v-if="state.dataIndex.startsWith('Fan')">
  97. <div class="signal-item" v-if="warningMonitorRowIndex == 0">
  98. <div
  99. class="signal-round"
  100. :class="{
  101. 'signal-round-run': selectData[state.dataIndex.replace('Fan', 'Fan1')],
  102. 'signal-round-warning':
  103. selectData[state.dataIndex.replace('Fan', 'Fan1')] !== undefined && !selectData[state.dataIndex.replace('Fan', 'Fan1')],
  104. 'signal-round-gry': selectData[state.dataIndex.replace('Fan', 'Fan1')] === undefined,
  105. }"
  106. ></div>
  107. <div>{{
  108. selectData[state.dataIndex.replace('Fan', 'Fan1')] === undefined
  109. ? '无状态'
  110. : selectData[state.dataIndex.replace('Fan', 'Fan1')]
  111. ? '正常'
  112. : '异常'
  113. }}</div>
  114. </div>
  115. <div class="signal-item" v-if="warningMonitorRowIndex == 1">
  116. <div
  117. class="signal-round"
  118. :class="{
  119. 'signal-round-run': selectData[state.dataIndex.replace('Fan', 'Fan2')],
  120. 'signal-round-warning':
  121. selectData[state.dataIndex.replace('Fan', 'Fan2')] !== undefined && !selectData[state.dataIndex.replace('Fan', 'Fan2')],
  122. 'signal-round-gry': selectData[state.dataIndex.replace('Fan', 'Fan2')] === undefined,
  123. }"
  124. ></div>
  125. <div>{{
  126. selectData[state.dataIndex.replace('Fan', 'Fan2')] === undefined
  127. ? '无状态'
  128. : selectData[state.dataIndex.replace('Fan', 'Fan2')]
  129. ? '正常'
  130. : '异常'
  131. }}</div>
  132. </div>
  133. </div>
  134. <div v-else>
  135. <div class="signal-item" v-if="warningMonitorRowIndex == 0">
  136. <div
  137. class="signal-round"
  138. :class="{
  139. 'signal-round-run': selectData[state.dataIndex],
  140. 'signal-round-warning': selectData[state.dataIndex] !== undefined && !selectData[state.dataIndex],
  141. 'signal-round-gry': selectData[state.dataIndex] === undefined,
  142. }"
  143. ></div>
  144. <div>{{ selectData[state.dataIndex] === undefined ? '无状态' : selectData[state.dataIndex] ? '正常' : '异常' }}</div>
  145. </div>
  146. </div>
  147. </div>
  148. </template>
  149. </div>
  150. </div>
  151. </div>
  152. </div>
  153. </div>
  154. <div class="bottom-tabs-box">
  155. <a-tabs class="tabs-box" v-model:activeKey="activeKey" @change="tabChange">
  156. <a-tab-pane key="1" tab="实时监测">
  157. <GroupMonitorTable :dataSource="dataSource" columnsType="fanmain_monitor" @selectRow="getSelectRow" />
  158. </a-tab-pane>
  159. <!-- <a-tab-pane key="2" tab="实时曲线图" force-render>
  160. <div class="tab-item" v-if="activeKey === '2'">
  161. <Bar :chartData="dataSource" xAxisPropType="strname" :propTypeArr="propTypeArr" height="40vh" width="100%" />
  162. </div>
  163. </a-tab-pane> -->
  164. <a-tab-pane key="3" tab="历史数据">
  165. <div class="tab-item">
  166. <HistoryTable columns-type="fanmain" device-type="fanmain" :device-list-api="baseList" designScope="fanmain-history" />
  167. </div>
  168. </a-tab-pane>
  169. <a-tab-pane key="4" tab="报警历史">
  170. <div class="tab-item">
  171. <AlarmHistoryTable columns-type="alarm" device-type="fanmain" :device-list-api="baseList" designScope="alarm-history" />
  172. </div>
  173. </a-tab-pane>
  174. <a-tab-pane key="5" tab="操作历史">
  175. <div class="tab-item">
  176. <HandlerHistoryTable columns-type="operatorhistory" device-type="fanlocal" :device-list-api="baseList" designScope="alarm-history" />
  177. </div>
  178. </a-tab-pane>
  179. </a-tabs>
  180. </div>
  181. </div>
  182. <div style="z-index: -1; position: absolute; top: -100px; right: 10px; width: 300px; height: 280px; margin: auto" class="palyer">
  183. <!-- <LivePlayer id="main-player1" ref="player1" :videoUrl="flvURL1()" muted live loading controls /> -->
  184. <LivePlayer id="main-player1" ref="player1" :videoUrl="flvURL1()" muted loop loading controls />
  185. </div>
  186. <a-modal v-model:visible="modalIsShow" :title="modalTitle" @ok="handleOk" @cancel="handleCancel">
  187. <div class="modal-container">
  188. <div class="vent-flex-row">
  189. <ExclamationCircleFilled style="color: #ffb700; font-size: 30px" />
  190. <div class="warning-text">您是否要进行{{ modalTitle }}操作?</div>
  191. </div>
  192. <!-- 调频 -->
  193. <div class="vent-flex-row input-box" v-if="modalType == 'frequency'">
  194. <div class="label">运行频率(单位):</div>
  195. <a-input-number v-model:value="frequencyVal" :min="0" :max="50" :step="0.1" />
  196. </div>
  197. <!-- 启动或停止 -->
  198. <div class="" v-if="modalType == 'startSmoke'">
  199. <div class="startSmoke-select">
  200. <div class="label">1#风机:</div>
  201. <a-radio-group v-model:value="mainWindIsShow1" @change="changeMotor" name="mainWind1">
  202. <a-radio value="open">开启</a-radio>
  203. <a-radio value="stop">停止</a-radio>
  204. </a-radio-group>
  205. </div>
  206. <div class="startSmoke-select">
  207. <div class="label">2#风机:</div>
  208. <a-radio-group v-model:value="mainWindIsShow2" @change="changeMotor" name="mainWind2">
  209. <a-radio value="open">开启</a-radio>
  210. <a-radio value="stop">停止</a-radio>
  211. </a-radio-group>
  212. </div>
  213. </div>
  214. <div class="vent-flex-row input-box">
  215. <div class="label">操作密码:</div>
  216. <a-input size="small" type="password" v-model:value="passWord" />
  217. </div>
  218. </div>
  219. </a-modal>
  220. </template>
  221. <script setup lang="ts">
  222. import { ExclamationCircleFilled } from '@ant-design/icons-vue';
  223. import FanEchrats from '/@/views/vent/monitorManager/mainFanMonitor/fanEchrats.vue';
  224. import { onBeforeMount, computed, ComputedRef, ref, onMounted, nextTick, onUnmounted, reactive, toRaw, toRef, toRefs } from 'vue';
  225. import GroupMonitorTable from '../comment/GroupMonitorTable.vue';
  226. import HistoryTable from '../comment/HistoryTable.vue';
  227. import AlarmHistoryTable from '../comment/AlarmHistoryTable.vue';
  228. import HandlerHistoryTable from '../comment/HandlerHistoryTable.vue';
  229. import { dataColumns, stateColumns, getData, getMonitorData } from './main.data';
  230. import { deviceControlApi } from '/@/api/vent/index';
  231. import { mountedThree, destroy, addText, play, setModelType, playAnimate, resetEcharts } from './main.threejs';
  232. import LivePlayer from '@liveqing/liveplayer-v3';
  233. import { SvgIcon } from '/@/components/Icon';
  234. import { list, pathList, deviceList, testWind } from './main.api';
  235. import { list as baseList } from '../../deviceManager/fanTabel/fan.api';
  236. import { getTableList } from '/@/views/vent/monitorManager/fanLocalMonitor/fanLocal.api';
  237. import { getTableHeaderColumns } from '/@/hooks/web/useWebColumns';
  238. const modalTypeArr = reactive({
  239. centerBtnArr: [
  240. {
  241. key: 'startSmoke',
  242. value: '启动/停止',
  243. },
  244. {
  245. key: 'changeSmoke',
  246. value: '不停风倒机',
  247. },
  248. {
  249. key: 'changeDirection',
  250. value: '一键反风',
  251. },
  252. {
  253. key: 'frequency',
  254. value: '一键调频',
  255. },
  256. ],
  257. });
  258. const player1 = ref(null);
  259. const activeKey = ref('1');
  260. const loading = ref(false);
  261. const modalIsShow = ref<boolean>(false); // 是否显示模态框
  262. const modalTitle = ref(''); // 模态框标题显示内容,根据设备操作类型决定
  263. const modalType = ref(''); // 模态框内容显示类型,设备操作类型
  264. const frequencyVal = ref(40); //频率
  265. const mainWindIsShow1 = ref('stop'); // 1#风机默认启动
  266. const mainWindIsShow2 = ref('stop'); // 2#风机默认不启动
  267. const frontMonitorIsShow = ref(false); // 存放1#风机临时状态,保存模态框取消时,还需要返回之前的值
  268. const backMonitorIsShow = ref(false); // 存放2#风机临时状态,保存模态框取消时,还需要返回之前的值
  269. const passWord = ref('');
  270. // 默认初始是第一行 (默认n%2==0时是主机,n%2==1时是备机)
  271. const selectRowIndex = ref(0);
  272. // 默认数据左边监测的是1#风机
  273. const dataMonitorRowIndex = ref(0);
  274. // 默认数据右边监测的是1#风机
  275. const warningMonitorRowIndex = ref(0);
  276. // 监测数据
  277. const selectData = reactive({
  278. deviceID: '',
  279. Fan1Negative: '-', // 静压
  280. Fan2Negative: '-', // 静压
  281. DataPa: '-', //全压
  282. Fan1m3: '-', //电机流量
  283. Fan2m3: '-', //电机流量
  284. deviceType: '',
  285. });
  286. const deviceType = computed(() => selectData.deviceType);
  287. const flvURL1 = () => {
  288. // return `https://sf1-hscdn-tos.pstatp.com/obj/media-fe/xgplayer_doc_video/flv/xgplayer-demo-360p.flv`;
  289. return `/video/mainWind.mp4`;
  290. };
  291. // const dataSource = computed(() => {
  292. // const data = [...getRecordList()] || [];
  293. // Object.assign(selectData, toRaw(data[selectRowIndex.value]));
  294. // addFmText(selectData);
  295. // return data;
  296. // });
  297. const dataSource = ref([]);
  298. const propTypeArr = new Map([
  299. ['incipientWindSpeed1', 'V1风速'],
  300. ['incipientWindSpeed2', 'V2风速'],
  301. ['incipientWindSpeed3', 'V3风速'],
  302. ['sourcePressure', '气源压力'],
  303. ]);
  304. const tabChange = (activeKeyVal) => {
  305. activeKey.value = activeKeyVal;
  306. };
  307. // 设备数据
  308. const controlType = ref(1);
  309. const getDataSource = async () => {
  310. const res = await list({ devicetype: 'fanmain', pagetype: 'normal' });
  311. const dataArr = res.msgTxt[0].datalist || [];
  312. dataSource.value = [];
  313. dataArr.forEach((data) => {
  314. const readData = data.readData;
  315. data = Object.assign(data, readData);
  316. dataSource.value.push(data);
  317. });
  318. const data: any = toRaw(dataSource.value[selectRowIndex.value]); //maxarea
  319. return data;
  320. };
  321. // https获取监测数据
  322. let timer: null | NodeJS.Timeout = null;
  323. const getMonitor = () => {
  324. if (Object.prototype.toString.call(timer) === '[object Null]') {
  325. timer = setTimeout(async () => {
  326. await getDataSource();
  327. Object.assign(selectData, deviceBaseList.value, dataSource.value[selectRowIndex.value]);
  328. addText(selectData);
  329. playAnimate(selectData);
  330. if (timer) {
  331. timer = null;
  332. }
  333. getMonitor();
  334. }, 1000);
  335. }
  336. };
  337. // const getMonitor = () => {
  338. // if (Object.prototype.toString.call(timer) === '[object Null]') {
  339. // timer = setTimeout(() => {
  340. // if (timer) {
  341. // timer = null;
  342. // }
  343. // dataSource.value = getData();
  344. // // 默认前两行(主、备)是正在监测的主通风机, 实际中需要手动选中
  345. // const monitorData = getMonitorData();
  346. // Object.assign(dataSource.value[selectRowIndex.value], monitorData);
  347. // const data: any = toRaw(dataSource.value[selectRowIndex.value]);
  348. // Object.assign(selectData, data);
  349. // resetEcharts('mainWindRect');
  350. // getMonitor();
  351. // }, 1000);
  352. // }
  353. // };
  354. const deviceBaseList = ref([]);
  355. const getDeviceBaseList = () => {
  356. getTableList({ pageSize: 1000 }).then((res) => {
  357. deviceBaseList.value = res.records;
  358. });
  359. };
  360. // 切换检测数据
  361. const getSelectRow = (id) => {
  362. if (!id) return;
  363. loading.value = true;
  364. const baseDataIndex: any = dataSource.value.findIndex((baseData: any) => baseData.deviceID === id);
  365. selectRowIndex.value = baseDataIndex;
  366. const type = 'mainWindRect';
  367. // const type = baseDataIndex > 0 ? 'fm' : 'fc';
  368. setModelType(type).then(() => {
  369. loading.value = false;
  370. });
  371. const data = dataSource.value[baseDataIndex];
  372. if (data['Fan1StartStatus'] == 1) {
  373. mainWindIsShow1.value = 'open';
  374. frontMonitorIsShow.value = true
  375. }else {
  376. mainWindIsShow1.value = 'stop';
  377. frontMonitorIsShow.value = false
  378. }
  379. if (data['Fan2StartStatus'] == 1) {
  380. mainWindIsShow2.value = 'open';
  381. backMonitorIsShow.value = true
  382. }else {
  383. mainWindIsShow2.value = 'stop';
  384. backMonitorIsShow.value = false
  385. }
  386. // play('initiatePlay', 'front', frequencyVal.value, 'open', 'tubPositivePath');
  387. return;
  388. };
  389. const start = (paramcode) => {
  390. const data = {
  391. deviceid: selectData.deviceID,
  392. devicetype: selectData.deviceType,
  393. paramcode: paramcode,
  394. };
  395. deviceControlApi(data).then((res) => {
  396. if (res.success) {
  397. //
  398. console.log('8888888888888888');
  399. }
  400. });
  401. };
  402. // 切换左右两边1#、2#风机的监测数据
  403. const selectDevice = (key, val) => {
  404. if (key === 'dataMonitorRowIndex') {
  405. dataMonitorRowIndex.value = val;
  406. } else {
  407. warningMonitorRowIndex.value = val;
  408. }
  409. };
  410. // 打开并设置modal的标题
  411. const showModal = (obj) => {
  412. modalType.value = obj.key;
  413. modalTitle.value = obj.value;
  414. modalIsShow.value = true;
  415. };
  416. const changeMotor = (e) => {
  417. const target = e.target;
  418. if (target.name === 'mainWind1') {
  419. if (target.value === 'open') {
  420. mainWindIsShow2.value = 'stop';
  421. }
  422. } else if (target.name === 'mainWind2') {
  423. if (target.value === 'open') {
  424. mainWindIsShow1.value = 'stop';
  425. }
  426. }
  427. };
  428. // 根据实时监测的数据执行动画
  429. const getState = (data) => {
  430. // 根据监测数据判断哪个风机在运行
  431. if (data['fanStart1'] == 1) {
  432. mainWindIsShow1.value = 'open';
  433. } else if (data['fanStart2'] == 1) {
  434. mainWindIsShow2.value = 'open';
  435. }
  436. }
  437. // 风机操作
  438. // const handleOk = (e: MouseEvent) => {
  439. // if (passWord.value !== '123456') {
  440. // message.warning('密码不正确,请重新输入');
  441. // return;
  442. // }
  443. // const frequency = frequencyVal.value;
  444. // if (modalType.value == 'startSmoke') {
  445. // if (mainWindIsShow1.value === 'open' && mainWindIsShow2.value === 'stop') {
  446. // frontMonitorIsShow.value = true;
  447. // backMonitorIsShow.value = false;
  448. // play('startSmoke', 'front', frequency, 'open', 'tubPositivePath');
  449. // play('startSmoke', 'back', null, 'close', '');
  450. // } else if (mainWindIsShow2.value === 'open' && mainWindIsShow1.value === 'stop') {
  451. // frontMonitorIsShow.value = false;
  452. // backMonitorIsShow.value = true;
  453. // play('startSmoke', 'back', frequency, 'open', 'tubPositivePath');
  454. // play('startSmoke', 'front', null, 'close', '');
  455. // } else if (mainWindIsShow1.value === 'stop' && mainWindIsShow2.value === 'stop') {
  456. // frontMonitorIsShow.value = false;
  457. // backMonitorIsShow.value = false;
  458. // play('startSmoke', 'back', null, 'stop', '');
  459. // play('startSmoke', 'front', null, 'close', '');
  460. // }
  461. // } else if (modalType.value == 'changeDirection') {
  462. // if (mainWindIsShow1.value == 'open') {
  463. // play('changeDirection', 'front', frequency, null, 'tubInversePath');
  464. // } else if (mainWindIsShow2.value == 'open') {
  465. // play('changeDirection', 'back', null, null, 'tubInversePath');
  466. // }
  467. // } else if (modalType.value == 'changeSmoke') {
  468. // // 不停风倒机的同时要切换当前监测数据
  469. // if (mainWindIsShow1.value == 'open') {
  470. // frontMonitorIsShow.value = false;
  471. // backMonitorIsShow.value = true;
  472. // // 切换到后面那台风,并需要设置后面风机的频率
  473. // // play('changeSmoke', 'back', dataSource.value[selectRowIndex.value + 1]['frequency'], null, 'tubInversePath');
  474. // play('changeSmoke', 'back', frequency, null, 'tubPositivePath');
  475. // } else if (mainWindIsShow2.value == 'open') {
  476. // frontMonitorIsShow.value = true;
  477. // backMonitorIsShow.value = false;
  478. // // 切换到前面那台风,并需要设置前面风机的频率
  479. // play('changeSmoke', 'front', frequency, null, 'tubPositivePath');
  480. // }
  481. // } else if (modalType.value == 'frequency') {
  482. // if (mainWindIsShow1.value == 'open') {
  483. // play('frequency', 'front', frequency);
  484. // } else if (mainWindIsShow2.value == 'open') {
  485. // play('frequency', 'back', frequency);
  486. // }
  487. // }
  488. // modalTitle.value = '';
  489. // modalIsShow.value = false;
  490. // };
  491. const handleOk = (e: MouseEvent) => {
  492. if (modalType.value == 'startSmoke') {
  493. if (mainWindIsShow1.value === 'open' && mainWindIsShow2.value === 'stop') {
  494. frontMonitorIsShow.value = true;
  495. backMonitorIsShow.value = false;
  496. start('CtrlFan1Start');
  497. } else if (mainWindIsShow2.value === 'open' && mainWindIsShow1.value === 'stop') {
  498. frontMonitorIsShow.value = false;
  499. backMonitorIsShow.value = true;
  500. start('CtrlFan2Start');
  501. } else if (mainWindIsShow1.value === 'stop' && mainWindIsShow2.value === 'stop') {
  502. frontMonitorIsShow.value = false;
  503. backMonitorIsShow.value = false;
  504. }
  505. } else if (modalType.value == 'changeDirection') {
  506. if (mainWindIsShow1.value == 'open') {
  507. } else if (mainWindIsShow2.value == 'open') {
  508. }
  509. } else if (modalType.value == 'changeSmoke') {
  510. // 不停风倒机的同时要切换当前监测数据
  511. if (mainWindIsShow1.value == 'open') {
  512. frontMonitorIsShow.value = false;
  513. backMonitorIsShow.value = true;
  514. // 切换到后面那台风,并需要设置后面风机的频率
  515. // play('changeSmoke', 'back', dataSource.value[selectRowIndex.value + 1]['frequency'], null, 'tubInversePath');
  516. } else if (mainWindIsShow2.value == 'open') {
  517. frontMonitorIsShow.value = true;
  518. backMonitorIsShow.value = false;
  519. // 切换到前面那台风,并需要设置前面风机的频率
  520. }
  521. } else if (modalType.value == 'frequency') {
  522. if (mainWindIsShow1.value == 'open') {
  523. } else if (mainWindIsShow2.value == 'open') {
  524. }
  525. }
  526. modalTitle.value = '';
  527. modalIsShow.value = false;
  528. };
  529. // 取消
  530. const handleCancel = () => {
  531. if (modalType.value == 'startSmoke') {
  532. const data = dataSource.value[selectRowIndex.value];
  533. mainWindIsShow1.value = 'stop';
  534. mainWindIsShow2.value = 'stop';
  535. if (data['fanStart1'] == 1) {
  536. mainWindIsShow1.value = 'open';
  537. } else if (data['fanStart2'] == 1) {
  538. mainWindIsShow2.value = 'open';
  539. }
  540. }
  541. };
  542. onBeforeMount(() => {
  543. // document.body.addEventListener('mousedown', addPlayVideo, true);
  544. getDeviceBaseList();
  545. });
  546. onMounted(() => {
  547. loading.value = true;
  548. mountedThree(player1.value).then(async () => {
  549. // await setModelType('mainWindRect');
  550. getMonitor();
  551. addText('mainWindRect');
  552. // play('initiatePlay', 'front', frequencyVal.value, 'open', 'tubPositivePath');
  553. });
  554. });
  555. onUnmounted(() => {
  556. destroy();
  557. if (timer) {
  558. clearTimeout(timer);
  559. timer = undefined;
  560. }
  561. });
  562. </script>
  563. <style scoped lang="less">
  564. @import '/@/design/vent/modal.less';
  565. :deep(.@{ventSpace}-tabs-tabpane-active) {
  566. overflow: auto;
  567. }
  568. .head-line {
  569. display: flex;
  570. flex-direction: row;
  571. justify-content: space-between;
  572. .button-box {
  573. position: relative;
  574. padding: 5px;
  575. border: 1px transparent solid;
  576. border-radius: 5px;
  577. margin-left: 8px;
  578. margin-right: 8px;
  579. width: auto;
  580. height: 34px;
  581. border: 1px solid #65dbea;
  582. display: flex;
  583. align-items: center;
  584. justify-content: center;
  585. color: #fff;
  586. padding: 0 15px;
  587. cursor: pointer;
  588. &:hover {
  589. background: linear-gradient(#3eb2ff55, #00c3ff55);
  590. }
  591. &::before {
  592. width: calc(100% - 6px);
  593. height: 26px;
  594. content: '';
  595. position: absolute;
  596. top: 3px;
  597. right: 0;
  598. left: 3px;
  599. bottom: 0;
  600. z-index: -1;
  601. border-radius: inherit; /*important*/
  602. background: linear-gradient(#014978, #3bf3fc);
  603. }
  604. }
  605. }
  606. .control-group,
  607. .top-box {
  608. display: flex !important;
  609. align-items: center !important;
  610. justify-content: center !important;
  611. position: absolute !important;
  612. width: 915px !important;
  613. height: 75px !important;
  614. left: 50% !important;
  615. top: 85px !important;
  616. transform: translateX(-50%) !important;
  617. background: url('/@/assets/images/vent/tab-group-bg.png') no-repeat !important;
  618. padding: 0 30px !important;
  619. .button-box {
  620. height: 35px !important;
  621. margin-left: 15px !important;
  622. margin-right: 15px !important;
  623. padding: 0 30px !important;
  624. border: 1px transparent solid;
  625. border: 1px solid #65dbea;
  626. &:hover {
  627. background: linear-gradient(#2cd1ff55, #1eb0ff55) !important;
  628. }
  629. &::before {
  630. height: 27px !important;
  631. background: linear-gradient(#1fa6cb, #127cb5) !important;
  632. }
  633. &::after {
  634. top: 35px !important;
  635. }
  636. }
  637. }
  638. .data-show-box {
  639. position: relative;
  640. display: flex;
  641. flex-direction: row;
  642. justify-content: space-between;
  643. padding: 10px;
  644. color: #ffffff;
  645. z-index: 999;
  646. top: 50px;
  647. .data-item {
  648. pointer-events: auto;
  649. .item-header {
  650. width: 374px;
  651. background: url('/@/assets/images/vent/lr-top-bg.png') no-repeat;
  652. background-size: auto;
  653. height: 32px;
  654. text-align: center;
  655. line-height: 34px;
  656. font-size: 15px;
  657. font-weight: 600;
  658. color: #fafafa;
  659. }
  660. .item-container {
  661. width: 346px;
  662. margin: 0 14px;
  663. padding: 10px;
  664. background: #004aac33;
  665. backdrop-filter: blur(2px);
  666. .tab {
  667. width: 323px;
  668. background: url('/@/assets/images/vent/lr-tab-bg.png') no-repeat;
  669. display: flex;
  670. .tab-item {
  671. flex: 1;
  672. text-align: center;
  673. padding-top: 2px;
  674. color: #ffffff99;
  675. cursor: pointer;
  676. &:hover {
  677. color: #ffffff;
  678. }
  679. }
  680. .tab-item-active-l {
  681. color: #ffffff;
  682. background-image: url('/@/assets/images/vent/l-tab-active.png');
  683. background-repeat: no-repeat;
  684. background-size: auto;
  685. background-position: 6px 3px;
  686. }
  687. .tab-item-active-r {
  688. color: #ffffff;
  689. background-image: url('/@/assets/images/vent/r-tab-active.png');
  690. background-repeat: no-repeat;
  691. background-position: 0 3px;
  692. }
  693. }
  694. .container-group {
  695. width: 314px;
  696. margin: 0px 4px;
  697. padding: 10px 0;
  698. min-height: 472px;
  699. background: linear-gradient(to right, #007bff22, #2081ff05);
  700. max-height: 480px;
  701. overflow-y: auto;
  702. }
  703. .container-group-l {
  704. .container-item {
  705. width: 100%;
  706. height: 63px;
  707. display: flex;
  708. padding: 10px 0 0 20px;
  709. margin-bottom: 5px;
  710. position: relative;
  711. background: url('/@/assets/images/vent/plane-bottom.png') no-repeat;
  712. background-size: auto;
  713. background-position: bottom;
  714. &::before {
  715. content: '';
  716. display: block;
  717. width: 100%;
  718. height: 5px;
  719. position: absolute;
  720. top: 62px;
  721. left: 0;
  722. background-color: #73f4ff66;
  723. backdrop-filter: blur(5px);
  724. }
  725. .item-icon {
  726. width: 54px;
  727. height: 45px;
  728. background: url('/@/assets/images/vent/plane-icon-bg.png') no-repeat;
  729. background-size: cover;
  730. .icon-style {
  731. margin: 10px 0 0 18px;
  732. }
  733. }
  734. .item-name {
  735. width: 180px;
  736. line-height: 60px;
  737. }
  738. .item-value {
  739. position: relative;
  740. height: 26px;
  741. line-height: 24px;
  742. margin: 15px 0;
  743. text-align: center;
  744. width: 80px;
  745. border: 1px solid #00f5fe;
  746. border-radius: 13px;
  747. background: linear-gradient(to right, #00f5fe44, #0090ff44);
  748. &::before {
  749. width: 6px;
  750. height: 6px;
  751. content: '';
  752. position: absolute;
  753. left: -3px;
  754. top: 8px;
  755. background: #ffa500;
  756. border-radius: 3px;
  757. }
  758. }
  759. }
  760. }
  761. .warning-header {
  762. display: flex;
  763. font-size: 14px;
  764. .header-item {
  765. flex: 1;
  766. display: flex;
  767. flex-direction: column;
  768. margin: 5px 10px;
  769. justify-content: center;
  770. align-items: center;
  771. .header-title {
  772. color: #39e7fe;
  773. }
  774. .header-value {
  775. width: 133px;
  776. height: 56px;
  777. font-weight: 600;
  778. font-family: 'douyuFont';
  779. font-size: 16px;
  780. color: #ffa500;
  781. display: flex;
  782. justify-content: center;
  783. align-items: center;
  784. background: url('/@/assets/images/vent/count-header-bg.png') no-repeat;
  785. }
  786. }
  787. }
  788. .warning-group {
  789. padding: 0 10px;
  790. position: relative;
  791. &::before {
  792. content: '';
  793. display: block;
  794. width: 1px;
  795. height: 100%;
  796. position: absolute;
  797. left: 12px;
  798. background-color: #00f5fe;
  799. }
  800. .warning-item {
  801. display: flex;
  802. flex-direction: row;
  803. justify-content: space-between;
  804. align-items: center;
  805. height: 38px;
  806. .item-name {
  807. .icon {
  808. width: 6px;
  809. height: 6px;
  810. display: inline-block;
  811. background-color: #1cd5ff;
  812. border-radius: 3px;
  813. position: relative;
  814. margin-right: 5px;
  815. &::before {
  816. content: '';
  817. width: 10px;
  818. height: 10px;
  819. display: block;
  820. border: 1px solid #34edff99;
  821. border-radius: 5px;
  822. position: absolute;
  823. top: -2px;
  824. left: -2px;
  825. }
  826. }
  827. }
  828. }
  829. }
  830. }
  831. }
  832. }
  833. .threejs-Object-CSS {
  834. .elementTag {
  835. backdrop-filter: blur(2px);
  836. .elementContent {
  837. width: 220px;
  838. background-color: rgba(0, 0, 0, 0.3);
  839. box-shadow: 0px 0px 40px rgb(0 90 131 / 55%) inset;
  840. border: 2px solid rgb(153 176 195 / 55%);
  841. padding: 15px 20px 0px 20px;
  842. font-size: 15px;
  843. p {
  844. color: #f2a500;
  845. }
  846. span {
  847. // color: #74e9fe;
  848. color: #fff;
  849. }
  850. }
  851. .elementContent-r {
  852. &::before {
  853. right: 120px;
  854. }
  855. &::after {
  856. right: 270px;
  857. border: 4px solid rgb(0, 221, 255); //rgb(0 220 255 / 75%)
  858. background: #a7a7a766;
  859. }
  860. }
  861. }
  862. }
  863. ::v-deep(.@{ventSpace}-table-wrapper) {
  864. height: 100% !important;
  865. }
  866. ::v-deep(.@{ventSpace}-spin-container) {
  867. height: 100% !important;
  868. overflow-y: auto;
  869. }
  870. .label {
  871. max-width: 220px;
  872. }
  873. .@{ventSpace}-input {
  874. width: 150px;
  875. }
  876. </style>