index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671
  1. <template>
  2. <div class="scene-box">
  3. <template v-if="isShow && routerParam !== 'timesolution' && routerParam !== 'home' && routerParam !== 'model3D'">
  4. <!-- <Emergency ref="NetworkRef" v-if="deviceKind === 'emergency'" :pageResult="pageResult" @changePageType="changePageType" />
  5. <DeviceVue ref="DeviceRef" v-else :pageData="pageData" /> -->
  6. <DeviceVue ref="DeviceRef" :pageData="pageData" />
  7. </template>
  8. <Network ref="NetworkRef" v-if="routerParam === 'timesolution'" :pageResult="pageResult" @changePageType="changePageType" />
  9. <VentModal style="width: 100%; height: 100%; position: absolute" />
  10. </div>
  11. </template>
  12. <script setup lang="ts">
  13. import { ref, onMounted, watch, onUnmounted } from 'vue';
  14. import DeviceVue from './components/device/index.vue';
  15. import Network from './components/network/index.vue';
  16. import Emergency from './components/emergency/index.vue';
  17. import { getActions } from '/@/qiankun/state';
  18. import { useRoute } from 'vue-router';
  19. import { onBeforeUnmount } from 'vue';
  20. import VentModal from '/@/components/vent/micro/ventModal.vue';
  21. import { unmountMicroApps } from '/@/qiankun';
  22. const route = useRoute();
  23. const actions = getActions();
  24. const DeviceRef = ref(null);
  25. const NetworkRef = ref(null);
  26. const isShow = ref(true);
  27. const routerParam = ref('home');
  28. const deviceKind = ref('');
  29. const pageData = ref({});
  30. const pageResult = ref({});
  31. // actions.setGlobalState({ url: { path: '/micro-vent-3dModal/dashboard/analysis', query: { type, deviceType } } });
  32. const changePageType = (pageType) => {
  33. console.log('页面类型', pageType);
  34. routerParam.value = pageType;
  35. actions.setGlobalState({ pageObj: { pageType: pageType } });
  36. };
  37. watch(
  38. () => route.fullPath,
  39. (fullPath) => {
  40. debugger;
  41. // const { type, deviceType } = routeVal.query
  42. // if (type === 'tunMonitor') {
  43. // pageData.value = { pageType: deviceType }
  44. // actions.setGlobalState({ pageObj: { pageType: deviceType } });
  45. // }
  46. console.log('fullPath------------------->', fullPath);
  47. }
  48. );
  49. onMounted(() => {
  50. debugger;
  51. const { type, deviceType, topage } = route.query;
  52. deviceKind.value = deviceType as string;
  53. if (!topage) {
  54. isShow.value = true;
  55. if (type === 'network') {
  56. routerParam.value = 'network';
  57. actions.setGlobalState({ pageObj: { pageType: 'network' } });
  58. } else if (type === 'tunMonitor') {
  59. routerParam.value = 'tunMonitor';
  60. if (deviceType) {
  61. pageData.value = { pageType: deviceType };
  62. actions.setGlobalState({ pageObj: { pageType: deviceType } });
  63. } // else if (type === 'emergency') {
  64. // if (deviceType) {
  65. // pageData.value = { pageType: deviceType };
  66. // actions.setGlobalState({ pageObj: { pageType: 'emergency' } });
  67. // }
  68. // }
  69. } else {
  70. routerParam.value = 'home';
  71. actions.setGlobalState({ pageObj: { pageType: 'home' } });
  72. }
  73. } else {
  74. isShow.value = false;
  75. }
  76. actions.onGlobalStateChange((newState) => {
  77. for (const key in newState) {
  78. if (key === 'pageObj') {
  79. const pageObj = newState[key];
  80. if (pageObj && pageObj.pageType) {
  81. routerParam.value = pageObj.pageType;
  82. pageData.value = pageObj;
  83. console.log('页面参数类型----------->', pageData.value, routerParam.value, pageObj);
  84. if (pageObj.timesolution) {
  85. pageResult.value = pageObj.timesolution;
  86. }
  87. if (pageObj.pageType != 'netcal') {
  88. isShow.value = true;
  89. }
  90. }
  91. }
  92. }
  93. });
  94. });
  95. onBeforeUnmount(async () => {
  96. //
  97. });
  98. onUnmounted(() => {
  99. // unmountMicroApps(['/micro-vent-3dModal']);
  100. });
  101. </script>
  102. <style lang="less" scoped>
  103. @import '/@/design/vent/modal.less';
  104. @ventSpace: zxm;
  105. .device-header {
  106. position: fixed;
  107. width: 100%;
  108. height: 56px;
  109. background: url('/@/assets/images/vent/home/modal-top.png');
  110. text-align: center;
  111. line-height: 56px;
  112. font-size: 28px;
  113. color: #ffffffdd;
  114. font-weight: 600;
  115. z-index: -1;
  116. }
  117. .select-node {
  118. position: fixed;
  119. top: 60px;
  120. left: 10px;
  121. color: #fff;
  122. display: flex;
  123. justify-content: center;
  124. font-size: 22px;
  125. .title {
  126. margin-left: 10px;
  127. }
  128. }
  129. .expansion-icon {
  130. background: url('/@/assets/images/vent/home/tree-icon-bg.png') no-repeat;
  131. background-size: contain;
  132. position: absolute;
  133. left: 190px;
  134. top: 25px;
  135. &:hover {
  136. background: url('/@/assets/images/vent/home/tree-icon-hover-bg.png') no-repeat;
  137. background-size: contain;
  138. }
  139. }
  140. .device-select {
  141. width: 250px;
  142. height: 500px;
  143. background: url('/@/assets/images/vent/home/tree-bg.png') no-repeat;
  144. position: fixed;
  145. top: 60px;
  146. left: 10px;
  147. background-size: contain;
  148. pointer-events: auto;
  149. padding: 20px 10px 30px 10px;
  150. }
  151. .is-expansion-icon {
  152. padding: 5px;
  153. pointer-events: auto;
  154. z-index: 999;
  155. }
  156. .device-select-show {
  157. left: 10px;
  158. animation-name: treeShow;
  159. /* 持续时间 */
  160. animation-duration: 1s;
  161. transition: all 1s cubic-bezier(0.165, 0.84, 0.44, 1) 0.5s;
  162. }
  163. .device-select-hide {
  164. left: -250px;
  165. animation-name: treeHide;
  166. /* 持续时间 */
  167. animation-duration: 1s;
  168. transition: all 1s cubic-bezier(0.165, 0.84, 0.44, 1) 0.5s;
  169. }
  170. .node-select-show {
  171. width: 276px;
  172. height: 44px;
  173. background: url('/@/assets/images/vent/home/tree-expansion-bg.png') no-repeat;
  174. left: 10px;
  175. animation-name: treeShow;
  176. /* 持续时间 */
  177. animation-duration: 1s;
  178. transition: all 1s cubic-bezier(0.165, 0.84, 0.44, 1) 0.5s;
  179. display: flex;
  180. align-items: center;
  181. margin-left: 0;
  182. justify-content: flex-start;
  183. pointer-events: auto;
  184. &:hover {
  185. background: url('/@/assets/images/vent/home/tree-expansion-hover-bg.png') no-repeat;
  186. }
  187. .put-away-icon {
  188. position: relative;
  189. display: inline-block;
  190. left: 4px;
  191. }
  192. }
  193. .node-select-hide {
  194. left: -400px;
  195. animation-name: treeHide;
  196. /* 持续时间 */
  197. animation-duration: 1s;
  198. transition: all 1s cubic-bezier(0.165, 0.84, 0.44, 1) 0.5s;
  199. }
  200. .device-select-box {
  201. width: 208px;
  202. height: 450px;
  203. overflow-y: auto;
  204. color: #fff;
  205. :deep(.zxm-tree) {
  206. background: transparent !important;
  207. color: #fff !important;
  208. .zxm-tree-switcher {
  209. background: transparent !important;
  210. }
  211. .zxm-tree-node-content-wrapper.zxm-tree-node-selected {
  212. background-color: #00b1c8;
  213. }
  214. .zxm-tree-node-content-wrapper:hover {
  215. background-color: #00b1c855;
  216. }
  217. input {
  218. height: 0px !important;
  219. }
  220. }
  221. &::-webkit-scrollbar-track {
  222. -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  223. border-radius: 10px;
  224. background: #ededed22;
  225. height: 100px;
  226. }
  227. &::-webkit-scrollbar-thumb {
  228. -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  229. background: #4288a444;
  230. }
  231. }
  232. .location-icon {
  233. width: 46px;
  234. height: 178px;
  235. position: absolute;
  236. top: 60px;
  237. // right: 0;
  238. background: url('/@/assets/images/vent/home/location-bg.png') no-repeat;
  239. background-size: contain;
  240. writing-mode: vertical-lr;
  241. line-height: 46px;
  242. color: #fff;
  243. padding-top: 10px;
  244. pointer-events: auto;
  245. cursor: pointer;
  246. &:hover {
  247. background: url('/@/assets/images/vent/home/location-hover-bg.png') no-repeat;
  248. }
  249. .location-text {
  250. padding-top: 20px;
  251. letter-spacing: 3px;
  252. font-size: 16px;
  253. }
  254. }
  255. .location-select {
  256. position: fixed;
  257. top: 60px;
  258. // right: 240px;
  259. pointer-events: auto;
  260. .location-select-box {
  261. width: 100%;
  262. height: 100%;
  263. position: relative;
  264. &::before {
  265. content: '';
  266. position: absolute;
  267. width: 230px;
  268. height: 500px;
  269. top: 0;
  270. left: 0;
  271. background: url('/@/assets/images/vent/home/tree-bg.png') no-repeat;
  272. background-size: contain;
  273. transform: rotateY(180deg);
  274. z-index: -1;
  275. // &:hover {
  276. // background: url('/@/assets/images/vent/home/tree-icon-hover-bg.png') no-repeat;
  277. // background-size: contain;
  278. // }
  279. }
  280. .location-top-title {
  281. color: #fff;
  282. position: absolute;
  283. width: 225px;
  284. height: 68px;
  285. background: url('/@/assets/images/vent/home/turn-location-top-bg.png') no-repeat;
  286. background-size: contain;
  287. top: 5px;
  288. left: 5px;
  289. display: flex;
  290. flex-direction: row;
  291. justify-content: space-between;
  292. align-items: flex-end;
  293. .title {
  294. font-size: 18px;
  295. position: relative;
  296. top: -14px;
  297. right: 15px;
  298. }
  299. }
  300. .location-expansion-icon {
  301. background: url('/@/assets/images/vent/home/tree-icon-cover-bg.png') no-repeat;
  302. background-size: contain;
  303. position: relative;
  304. left: 10px;
  305. top: -15px;
  306. padding: 5px;
  307. &:hover {
  308. background: url('/@/assets/images/vent/home/tree-icon-cover-hover-bg.png') no-repeat;
  309. background-size: contain;
  310. }
  311. }
  312. }
  313. .location-container {
  314. width: 200px;
  315. height: 390px;
  316. position: absolute;
  317. display: flex;
  318. flex-direction: column;
  319. top: 80px;
  320. left: 18px;
  321. overflow-y: auto;
  322. .location-item {
  323. color: #fff;
  324. line-height: 30px;
  325. display: flex;
  326. justify-content: space-between;
  327. background-image: linear-gradient(to left, #39f5ff05, #39f5ff10);
  328. margin: 3px 0;
  329. .item-title {
  330. width: 80px;
  331. text-align: right;
  332. color: #87f1ff;
  333. }
  334. }
  335. .location-bottom-btn {
  336. width: 100%;
  337. color: #fff;
  338. display: flex;
  339. justify-content: flex-end;
  340. margin-top: 20px;
  341. span {
  342. display: inline-block;
  343. width: 100%;
  344. background: #00709955;
  345. border-radius: 3px;
  346. border: 1px solid rgba(174, 243, 255, 0.3);
  347. text-align: center;
  348. padding: 2px 0;
  349. cursor: pointer;
  350. &:hover {
  351. background: #00557422;
  352. }
  353. }
  354. }
  355. }
  356. }
  357. .location-select-show {
  358. right: 240px;
  359. animation-name: locationShow;
  360. /* 持续时间 */
  361. animation-duration: 1s;
  362. transition: all 1s cubic-bezier(0.165, 0.84, 0.44, 1) 0.5s;
  363. }
  364. .location-select-hide {
  365. right: -2px;
  366. animation-name: locationHide;
  367. /* 持续时间 */
  368. animation-duration: 1s;
  369. transition: all 1s cubic-bezier(0.165, 0.84, 0.44, 1) 0.5s;
  370. }
  371. .location-btn-show {
  372. right: -0px;
  373. animation-name: locationBtnShow;
  374. /* 持续时间 */
  375. animation-duration: 1s;
  376. transition: all 1s cubic-bezier(0.165, 0.84, 0.44, 1) 0.5s;
  377. }
  378. .location-btn-hide {
  379. right: -240px;
  380. animation-name: locationBtnHide;
  381. /* 持续时间 */
  382. animation-duration: 1s;
  383. transition: all 1s cubic-bezier(0.165, 0.84, 0.44, 1) 0.5s;
  384. }
  385. .bottom-tabs-box {
  386. position: relative;
  387. .to-small {
  388. width: 60px;
  389. height: 60px;
  390. background: url('/@/assets/images/vent/home/tosmall.png') no-repeat center;
  391. background-size: auto;
  392. position: absolute;
  393. top: -65px;
  394. right: 36px;
  395. border-radius: 10px;
  396. padding: 8px;
  397. backdrop-filter: blur(10px);
  398. background-color: rgba(45, 86, 137, 0.418);
  399. &:hover {
  400. background-color: rgba(79, 104, 134, 0.418);
  401. }
  402. }
  403. .device-button-group {
  404. position: absolute;
  405. top: -30px;
  406. display: flex;
  407. width: 100%;
  408. .device-button {
  409. height: 26px;
  410. padding: 0 20px;
  411. background: linear-gradient(45deg, #04e6fb55, #0c5cab55);
  412. clip-path: polygon(10px 0, 0 50%, 10px 100%, 100% 100%, calc(100% - 10px) 50%, 100% 0);
  413. display: flex;
  414. justify-content: center;
  415. align-items: center;
  416. color: #fff;
  417. position: relative;
  418. cursor: pointer;
  419. &:nth-child(1) {
  420. left: calc(-6px * 1);
  421. }
  422. &:nth-child(2) {
  423. left: calc(-6px * 2);
  424. }
  425. &:nth-child(3) {
  426. left: calc(-6px * 3);
  427. }
  428. &:nth-child(4) {
  429. left: calc(-6px * 4);
  430. }
  431. &:nth-child(5) {
  432. left: calc(-6px * 5);
  433. }
  434. &:nth-child(6) {
  435. left: calc(-6px * 6);
  436. }
  437. &:nth-child(7) {
  438. left: calc(-6px * 7);
  439. }
  440. &:nth-child(8) {
  441. left: calc(-6px * 8);
  442. }
  443. &:nth-child(9) {
  444. left: calc(-6px * 9);
  445. }
  446. &:nth-child(10) {
  447. left: calc(-6px * 10);
  448. }
  449. &:nth-child(11) {
  450. left: calc(-6px * 11);
  451. }
  452. &:nth-child(12) {
  453. left: calc(-6px * 12);
  454. }
  455. &:nth-child(13) {
  456. left: calc(-6px * 13);
  457. }
  458. &:nth-child(14) {
  459. left: calc(-6px * 14);
  460. }
  461. &:nth-child(15) {
  462. left: calc(-6px * 15);
  463. }
  464. &:first-child {
  465. clip-path: polygon(0 0, 10px 50%, 0 100%, 100% 100%, calc(100% - 10px) 50%, 100% 0);
  466. }
  467. }
  468. .device-active {
  469. background: linear-gradient(45deg, #04e6fb, #0c5cab);
  470. &::before {
  471. border-color: #0efcff;
  472. box-shadow: 1px 1px 3px 1px #0efcff inset;
  473. }
  474. }
  475. }
  476. .enter-detail {
  477. color: #fff;
  478. cursor: pointer;
  479. position: absolute;
  480. right: 120px;
  481. top: -6px;
  482. padding: 5px;
  483. border-radius: 5px;
  484. margin-left: 8px;
  485. margin-right: 8px;
  486. width: auto;
  487. height: 33px !important;
  488. display: flex;
  489. align-items: center;
  490. justify-content: center;
  491. color: #fff;
  492. padding: 5px 15px 5px 15px;
  493. cursor: pointer;
  494. &:hover {
  495. background: linear-gradient(#2cd1ff55, #1eb0ff55);
  496. }
  497. &::before {
  498. width: calc(100% - 6px);
  499. height: 27px;
  500. content: '';
  501. position: absolute;
  502. top: 3px;
  503. right: 0;
  504. left: 3px;
  505. bottom: 0;
  506. z-index: -1;
  507. border-radius: inherit;
  508. /*important*/
  509. background: linear-gradient(#1fa6cb, #127cb5);
  510. }
  511. }
  512. }
  513. @keyframes treeShow {
  514. 0% {
  515. left: -400px;
  516. opacity: 0;
  517. }
  518. 100% {
  519. left: 10px;
  520. opacity: 1;
  521. }
  522. }
  523. @keyframes treeHide {
  524. 0% {
  525. left: 10px;
  526. opacity: 1;
  527. }
  528. 100% {
  529. left: -400px;
  530. opacity: 0;
  531. }
  532. }
  533. @keyframes locationShow {
  534. 0% {
  535. right: 0px;
  536. opacity: 0;
  537. }
  538. 100% {
  539. right: 240px;
  540. opacity: 1;
  541. }
  542. }
  543. @keyframes locationHide {
  544. 0% {
  545. right: 240px;
  546. opacity: 1;
  547. }
  548. 100% {
  549. right: 0;
  550. opacity: 0;
  551. }
  552. }
  553. @keyframes locationBtnShow {
  554. 0% {
  555. right: -240px;
  556. opacity: 0;
  557. }
  558. 100% {
  559. right: -2px;
  560. opacity: 1;
  561. }
  562. }
  563. @keyframes locationBtnHide {
  564. 0% {
  565. right: -2px;
  566. opacity: 1;
  567. }
  568. 100% {
  569. right: -240px;
  570. opacity: 0;
  571. }
  572. }
  573. :deep(.@{ventSpace}-tabs-tabpane-active) {
  574. // overflow: auto;
  575. height: 100%;
  576. }
  577. :deep(.zxm-select-dropdown) {
  578. left: 0 !important;
  579. color: #000000 !important;
  580. }
  581. </style>