index.vue 13 KB

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