index.vue 13 KB

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