index.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564
  1. <template>
  2. <div v-if="pageType == 'home'" style="position: relative; width: 100%; height: 100%">
  3. <div class="home-container">
  4. <div class="header">
  5. <div class="head-time">
  6. <span>{{ nowTimeYear }}</span>
  7. <span>{{ nowTimeWeek }}</span>
  8. <span>{{ nowTime }}</span>
  9. </div>
  10. <div class="main-title"
  11. ><img v-if="hasPermission('home:logo')" class="logo" :src="`${baseUrl}/sys/common/static/${logoUrl}`" />{{ title }}</div
  12. >
  13. </div>
  14. <div class="home-contents">
  15. <div class="left-content">
  16. <!-- 主通风机 -->
  17. <div class="monitor-box">
  18. <mainMonitor :maindata="mainList" @goDetail="goDetail" />
  19. </div>
  20. <!-- 局部通风机 -->
  21. <div class="monitor-box monitor-box1">
  22. <fanMonitor @goDetail="goDetail" :fandata="fanLocalList" />
  23. </div>
  24. <!-- 通风设备远程控制 -->
  25. <div class="monitor-box">
  26. <windDevice :devicedata="deviceData" @goDetail="goDetail" />
  27. </div>
  28. </div>
  29. <div class="center-content">
  30. <!-- 三维模型 -->
  31. <div class="three-box">
  32. <div class="three-nav" v-if="!hasPermission('monitor:show')">
  33. <template v-for="(item, index) in navList" :key="index">
  34. <div class="nav-item" v-if="(item.valList && item.valList.length > 0) || item.val">
  35. <div class="item-label">{{ item.name }}</div>
  36. <div class="item-value">
  37. <template v-if="item.isShow">
  38. <div class="bg-box" v-for="(ite, ind) in item.valList" :key="ind">
  39. <div class="box-line"></div>
  40. <div class="value-text">{{ ite.val }}</div>
  41. </div>
  42. </template>
  43. <div v-else class="value-text1">{{ item.val }}</div>
  44. </div>
  45. </div>
  46. </template>
  47. </div>
  48. <div class="three-modal" id="modalBox" style="position: relative">
  49. <!-- <div class="btn-icon" @click="goModalDetail"></div> -->
  50. <!-- 展会不显示按钮 -->
  51. <div v-if="sysOrgCode !== 'mkyzhpt'" class="btn-icon" @click="goModalDetail"></div>
  52. <VentModal
  53. ref="centerModalRef"
  54. style="width: calc(100% - 30px); height: calc(100% - 30px); position: absolute; background-color: #fff"
  55. />
  56. </div>
  57. </div>
  58. <!-- 风量监测 -->
  59. <div class="wind-box">
  60. <windMonitor :flList="flList" @goDetail="goDetail" />
  61. </div>
  62. </div>
  63. <div class="right-content">
  64. <!-- 关键通风路线 -->
  65. <div class="monitor-box">
  66. <windLine :lineList="lineList" @goDetail="goDetail" />
  67. </div>
  68. <!-- 工作面智能管控 -->
  69. <div class="monitor-box monitor-box1">
  70. <workMonitor :workList="workList" @goDetail="goDetail" />
  71. </div>
  72. <!-- 设备预警 -->
  73. <div class="monitor-box">
  74. <deviceWarn :warnData="warnData" @goDetail="goDetail" />
  75. </div>
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. <Network ref="NetworkRef" v-if="pageType == 'timesolution'" :pageResult="pageResult" @changePageType="changePageType" style="position: absolute" />
  81. <VentModal
  82. v-if="pageType == 'model3D' || pageType == 'timesolution'"
  83. ref="fullModalRef"
  84. style="width: calc(100% - 30px); height: calc(100% - 30px); position: absolute"
  85. />
  86. </template>
  87. <script lang="ts" setup>
  88. import { reactive, onMounted, ref, nextTick, computed, unref, inject, onBeforeUnmount, onUnmounted } from 'vue';
  89. import fanMonitor from './components/fan-monitor.vue';
  90. import mainMonitor from './components/main-monitor.vue';
  91. import windDevice from './components/wind-device.vue';
  92. import windMonitor from './components/wind-monitor.vue';
  93. import windLine from './components/wind-line.vue';
  94. import workMonitor from './components/work-monitor.vue';
  95. import deviceWarn from './components/device-warn.vue';
  96. import { useGlobSetting } from '/@/hooks/setting';
  97. import { list } from './clique.api';
  98. import Network from '../../monitorManager/deviceMonitor/components/network/index.vue';
  99. import { useRouter } from 'vue-router';
  100. import { router } from '/@/router';
  101. // import { Modal } from 'ant-design-vue';
  102. // import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
  103. import dayjs from 'dayjs';
  104. import { getActions } from '/@/qiankun/state';
  105. import { unmountMicroApps, mountMicroApp } from '/@/qiankun';
  106. import { getDate } from './clique.data';
  107. import VentModal from '/@/components/vent/micro/ventModal.vue';
  108. import { usePermission } from '/@/hooks/web/usePermission';
  109. const { currentRoute } = useRouter();
  110. const { hasPermission } = usePermission();
  111. const { title, logoUrl, sysOrgCode } = useGlobSetting();
  112. const baseUrl = VUE_APP_URL.baseUrl;
  113. const actions = getActions();
  114. let timer: NodeJS.Timeout | null = null;
  115. let fanLocalList = reactive<any[]>([]); //局部风机数据
  116. let mainList = ref<any[]>([]); //主通风机数据
  117. let centerList = reactive<any[]>([]); //中间区域数据
  118. let flList = ref<any[]>([]); //风量监测数据
  119. let lineList = ref<any>([]); //关键路线数据
  120. let workList = ref<any>([]); //工作面数据
  121. let warnData = ref<any>([]); //预警数据
  122. let deviceData = ref<any>({}); //设备监测数据
  123. let navList = reactive([
  124. { name: '总回风量(m³/min)', isShow: true, valList: [] },
  125. { name: '总进风量(m³/min)', isShow: true, valList: [] },
  126. { name: '计划风量(m³/min)', isShow: true, valList: [] },
  127. // { name: '有效风量(m³/min)', isShow: true, valList: [] },
  128. // { name: '等积孔(m²)', isShow: true, valList: [] },
  129. { name: '有效风量率', isShow: false, val: '0%' },
  130. { name: '外部漏风率', isShow: false, val: 0 },
  131. ]);
  132. let nowTimeYear = ref('');
  133. let nowTimeWeek = ref('');
  134. let nowTime = ref('');
  135. const centerModalRef = ref();
  136. const fullModalRef = ref();
  137. const pageType = ref('');
  138. let router = useRouter();
  139. const pageResult = ref({});
  140. function goDetail(deviceType) {
  141. //lxh
  142. // pageType.value = deviceType;
  143. if (deviceType == 'fanMain') {
  144. router.push('/monitorChannel/monitor-fanmain');
  145. } else if (deviceType == 'fanLocal') {
  146. if (sysOrgCode !== 'ymdnymdn') {
  147. router.push('/monitorChannel/monitor-fanlocal');
  148. } else {
  149. router.push('/fanlocal-page/home');
  150. }
  151. } else if (deviceType == 'windrect') {
  152. router.push('/monitorChannel/monitor-windrect');
  153. } else if (deviceType == 'warning') {
  154. router.push('/monitorChannel/monitor-alarm-home');
  155. }
  156. }
  157. function goHome() {
  158. pageType.value = 'home';
  159. }
  160. function getList() {
  161. list({}).then((res) => {
  162. fanLocalList.length = 0;
  163. fanLocalList.push(res.fanlocal);
  164. mainList.value = res.fanmain || [];
  165. if (res.midinfo[0].sysdata) {
  166. centerList = res.midinfo[0].sysdata;
  167. // 总回
  168. navList[0].valList =
  169. centerList && centerList.zonghuifeng
  170. ? centerList.zonghuifeng.split('').map((el) => {
  171. return { val: el };
  172. })
  173. : [];
  174. // 总进
  175. navList[1].valList =
  176. centerList && centerList.zongjinfeng
  177. ? centerList.zongjinfeng
  178. .toString()
  179. .split('')
  180. .map((el) => {
  181. return { val: el };
  182. })
  183. : [];
  184. // 计划风量
  185. navList[2].valList =
  186. centerList && centerList.xufengliang
  187. ? centerList.xufengliang
  188. .toString()
  189. .split('')
  190. .map((el) => {
  191. return { val: el };
  192. })
  193. : [];
  194. // 有效风量率
  195. navList[3].val = `${res.midinfo[0].sysinfo.useM3Perent}%` || '--';
  196. // 外部漏风率
  197. navList[4].val =
  198. (
  199. ((Number(res.midinfo[0].sysdata.zongfengliang) - Number(res.midinfo[0].sysdata.zongjinfeng)) /
  200. Number(res.midinfo[0].sysdata.zongfengliang)) *
  201. 100
  202. ).toFixed(1) + '%';
  203. }
  204. flList.value = res.windrect || res.sys_wind;
  205. if (res.sys_majorpath.length != 0) {
  206. lineList.value = res.sys_majorpath;
  207. } else {
  208. let paramArr: any = [];
  209. lineList.value = paramArr;
  210. }
  211. // if (res.sys_surface_caimei.length != 0) {
  212. // workList.value = res.sys_surface_caimei;
  213. // } else {
  214. // let paramArr: any = [];
  215. // workList.value = getDate(paramArr);
  216. // }
  217. let paramArr: any = [
  218. {
  219. deviceName:'25216采煤工作面',
  220. deviceID:'1',
  221. }
  222. ];
  223. workList.value = getDate(paramArr);
  224. warnData.value = res.warn || [];
  225. deviceData.value = res.device || {};
  226. // 大海则、红柳林不需要漏风率
  227. if (sysOrgCode === 'sdtljtdhzmk' || sysOrgCode === 'smjthllmk') {
  228. navList[4].val = 0;
  229. }
  230. });
  231. }
  232. //获取当前时间年月日时分秒
  233. function getNowTime() {
  234. setInterval(() => {
  235. nowTimeYear.value = dayjs().format('YYYY/MM/DD');
  236. let week = dayjs(new Date().getTime()).day();
  237. switch (week) {
  238. case 0:
  239. nowTimeWeek.value = '星期日';
  240. break;
  241. case 1:
  242. nowTimeWeek.value = '星期一';
  243. break;
  244. case 2:
  245. nowTimeWeek.value = '星期二';
  246. break;
  247. case 3:
  248. nowTimeWeek.value = '星期三';
  249. break;
  250. case 4:
  251. nowTimeWeek.value = '星期四';
  252. break;
  253. case 5:
  254. nowTimeWeek.value = '星期五';
  255. break;
  256. case 6:
  257. nowTimeWeek.value = '星期六';
  258. break;
  259. }
  260. let date = new Date();
  261. let hours = date.getHours();
  262. let minutes = date.getMinutes();
  263. let seconds = date.getSeconds();
  264. if (minutes >= 0 && minutes <= 9) {
  265. minutes = `0${minutes}`;
  266. }
  267. if (seconds >= 0 && seconds <= 9) {
  268. seconds = `0${seconds}`;
  269. }
  270. nowTime.value = `${hours}:${minutes}:${seconds}`;
  271. }, 1000);
  272. }
  273. function goModalDetail() {
  274. router.push('/micro-vent-3dModal/dashboard/analysis?type=model3D');
  275. }
  276. const changePageType = (pageType) => {
  277. actions.setGlobalState({ pageObj: { pageType: pageType } });
  278. };
  279. onMounted(() => {
  280. const currentRouteObj = unref(currentRoute);
  281. if (currentRouteObj && currentRouteObj['query'] && currentRouteObj['query']['deviceType']) {
  282. pageType.value = 'model3D';
  283. } else {
  284. pageType.value = 'home';
  285. }
  286. actions.onGlobalStateChange((newState) => {
  287. for (const key in newState) {
  288. if (key === 'pageObj') {
  289. const pageObj = newState[key];
  290. if (pageObj && pageObj.pageType) {
  291. pageType.value = pageObj.pageType;
  292. if (pageObj.timesolution) {
  293. pageResult.value = pageObj.timesolution;
  294. }
  295. }
  296. }
  297. }
  298. });
  299. getNowTime();
  300. getList();
  301. timer = Number(
  302. setInterval(() => {
  303. getList();
  304. }, 10000)
  305. );
  306. });
  307. onBeforeUnmount(() => {
  308. clearInterval(timer);
  309. timer = null;
  310. });
  311. onUnmounted(() => {
  312. pageType.value = '';
  313. });
  314. </script>
  315. <style lang="less" scoped>
  316. @font-face {
  317. font-family: 'douyuFont';
  318. src: url('../../../../assets/font/douyuFont.otf');
  319. }
  320. @font-face {
  321. font-family: 'yjsz';
  322. src: url('../../../../assets/font/yjsz.TTF');
  323. }
  324. .home-container {
  325. width: 100%;
  326. height: 100%;
  327. position: relative;
  328. .header {
  329. width: 100%;
  330. height: 76px;
  331. position: relative;
  332. background: url('../../../../assets//images//home-container/header-nav.png') no-repeat;
  333. .head-time {
  334. position: absolute;
  335. top: 14px;
  336. left: 15px;
  337. color: #b5c9e9;
  338. font-size: 14px;
  339. span {
  340. margin-right: 20px;
  341. letter-spacing: 2px;
  342. }
  343. }
  344. .main-title {
  345. position: absolute;
  346. left: 50%;
  347. top: 50%;
  348. transform: translate(-50%, -50%);
  349. color: #fff;
  350. font-size: 28px;
  351. font-weight: 600;
  352. display: flex;
  353. align-items: center;
  354. .logo {
  355. width: 32px;
  356. height: 32px;
  357. margin-right: 5px;
  358. }
  359. }
  360. }
  361. .home-contents {
  362. display: flex;
  363. justify-content: space-between;
  364. height: calc(100% - 76px);
  365. padding: 10px;
  366. box-sizing: border-box;
  367. .left-content {
  368. display: flex;
  369. flex-direction: column;
  370. flex: 1;
  371. justify-content: space-between;
  372. height: 100%;
  373. .monitor-box {
  374. display: flex;
  375. flex: 1;
  376. width: 100%;
  377. background: url('../../../../assets/images/home-container/dialog.png') no-repeat;
  378. background-size: 100% 100%;
  379. }
  380. .monitor-box1 {
  381. margin: 10px 0px;
  382. }
  383. }
  384. .center-content {
  385. display: flex;
  386. flex-direction: column;
  387. justify-content: space-between;
  388. flex: 2;
  389. height: 100%;
  390. margin: 0px 10px;
  391. .three-box {
  392. position: relative;
  393. display: flex;
  394. background-color: #fff;
  395. flex: 2;
  396. width: 100%;
  397. margin-bottom: 15px;
  398. background: url('../../../../assets/images/home-container/three-dialog.png') no-repeat;
  399. background-size: 100% 100%;
  400. .three-nav {
  401. position: absolute;
  402. z-index: 9999;
  403. left: 50%;
  404. top: 38px;
  405. transform: translate(-50%, 0);
  406. width: 812px;
  407. height: 89px;
  408. padding: 0px 20px;
  409. box-sizing: border-box;
  410. display: flex;
  411. justify-content: space-around;
  412. align-items: center;
  413. background: url('../../../../assets/images/home-container/three-nav.png') no-repeat;
  414. .nav-item {
  415. display: flex;
  416. flex: 1;
  417. flex-direction: column;
  418. justify-content: space-around;
  419. align-items: center;
  420. height: 80%;
  421. .item-label {
  422. color: #98f5ff;
  423. }
  424. .item-value {
  425. position: relative;
  426. width: 125px;
  427. height: 37px;
  428. padding: 0px 5px;
  429. box-sizing: border-box;
  430. display: flex;
  431. justify-content: space-between;
  432. align-items: center;
  433. background: url('../../../../assets/images/home-container/item-value.png') no-repeat;
  434. .bg-box {
  435. position: relative;
  436. width: 20px;
  437. height: 26px;
  438. border-bottom: 2px solid #063493;
  439. background: linear-gradient(to right, rgba(1, 194, 249), rgba(0, 125, 252));
  440. .box-line {
  441. position: absolute;
  442. left: 0;
  443. top: 50%;
  444. transform: translate(0, -50%);
  445. height: 1px;
  446. width: 100%;
  447. background-color: rgba(6, 52, 147, 0.6);
  448. }
  449. .value-text {
  450. position: absolute;
  451. left: 50%;
  452. top: 50%;
  453. transform: translate(-50%, -50%);
  454. color: #fff;
  455. font-size: 22px;
  456. font-family: 'yjsz';
  457. font-weight: 500;
  458. }
  459. }
  460. .value-text1 {
  461. width: 100%;
  462. text-align: center;
  463. color: #fff;
  464. font-size: 22px;
  465. font-family: 'yjsz';
  466. font-weight: 500;
  467. }
  468. }
  469. }
  470. }
  471. .three-modal {
  472. width: 100%;
  473. height: 100%;
  474. padding: 20px 17px 20px 15px;
  475. box-sizing: border-box;
  476. // position: absolute;
  477. // background-color: var(--vent-base-color);
  478. .btn-icon {
  479. width: 40px;
  480. height: 40px;
  481. background: url('/@/assets/images/vent/home/tosmall.png') no-repeat center;
  482. background-size: 100% 100%;
  483. position: absolute;
  484. z-index: 99999;
  485. bottom: 30px;
  486. right: 30px;
  487. }
  488. }
  489. }
  490. .wind-box {
  491. display: flex;
  492. flex: 1;
  493. width: 100%;
  494. background: url('../../../../assets/images/home-container/dialog1.png') no-repeat;
  495. background-size: 100% 100%;
  496. }
  497. }
  498. .right-content {
  499. display: flex;
  500. flex-direction: column;
  501. justify-content: space-between;
  502. flex: 1;
  503. height: 100%;
  504. .monitor-box {
  505. display: flex;
  506. flex: 1;
  507. width: 100%;
  508. background: url('../../../../assets/images/home-container/dialog.png') no-repeat;
  509. background-size: 100% 100%;
  510. }
  511. .monitor-box1 {
  512. margin: 10px 0px;
  513. }
  514. }
  515. }
  516. }
  517. // #__qiankun_microapp_wrapper_for_micro_vent_3_d_modal__{
  518. // width: 100% !important;
  519. // height: 100% !important;
  520. // }
  521. </style>