index1.vue 14 KB

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