index.vue 13 KB

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