index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644
  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 } 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. onMounted(() => {
  26. const {type, deviceType } = route.query
  27. if(type === 'network'){
  28. routerParam.value = 'network'
  29. actions.setGlobalState({ pageObj: { pageType: 'network' } });
  30. }else if(type === 'home'){
  31. actions.setGlobalState({ pageObj: { pageType: 'home' } });
  32. }else if(type === 'tunMonitor') {
  33. if(deviceType){
  34. pageData.value = { pageType: deviceType }
  35. actions.setGlobalState({ pageObj: { pageType: deviceType } });
  36. }
  37. }
  38. actions.onGlobalStateChange((newState) => {
  39. for (const key in newState) {
  40. if (key === 'pageObj') {
  41. const pageObj = newState[key]
  42. if (pageObj && pageObj.pageType) {
  43. routerParam.value = pageObj.pageType
  44. pageData.value = pageObj
  45. console.log('页面参数类型----------->', pageData.value, routerParam.value, pageObj)
  46. if (pageObj.timesolution) {
  47. pageResult.value = pageObj.timesolution
  48. }
  49. }
  50. } else if (key === 'isMounted' && newState[key]) {
  51. if(deviceType){
  52. console.log('qqqqqqqqqqqqqqqqq', newState)
  53. // actions.setGlobalState({ pageObj: { pageType: 'tunMonitor', deviceType } });
  54. }
  55. }
  56. }
  57. })
  58. })
  59. onUnmounted(() => {
  60. })
  61. </script>
  62. <style lang="less" scoped >
  63. @import '/@/design/vent/modal.less';
  64. @ventSpace: zxm;
  65. .device-header {
  66. position: fixed;
  67. width: 100%;
  68. height: 56px;
  69. background: url('/@/assets/images/vent/home/modal-top.png');
  70. text-align: center;
  71. line-height: 56px;
  72. font-size: 28px;
  73. color: #ffffffdd;
  74. font-weight: 600;
  75. z-index: -1;
  76. }
  77. .select-node {
  78. position: fixed;
  79. top: 60px;
  80. left: 10px;
  81. color: #fff;
  82. display: flex;
  83. justify-content: center;
  84. font-size: 22px;
  85. .title {
  86. margin-left: 10px;
  87. }
  88. }
  89. .expansion-icon {
  90. background: url('/@/assets/images/vent/home/tree-icon-bg.png') no-repeat;
  91. background-size: contain;
  92. position: absolute;
  93. left: 190px;
  94. top: 25px;
  95. &:hover {
  96. background: url('/@/assets/images/vent/home/tree-icon-hover-bg.png') no-repeat;
  97. background-size: contain;
  98. }
  99. }
  100. .device-select {
  101. width: 250px;
  102. height: 500px;
  103. background: url('/@/assets/images/vent/home/tree-bg.png') no-repeat;
  104. position: fixed;
  105. top: 60px;
  106. left: 10px;
  107. background-size: contain;
  108. pointer-events: auto;
  109. padding: 20px 10px 30px 10px;
  110. }
  111. .is-expansion-icon {
  112. padding: 5px;
  113. pointer-events: auto;
  114. z-index: 999;
  115. }
  116. .device-select-show {
  117. left: 10px;
  118. animation-name: treeShow;
  119. /* 持续时间 */
  120. animation-duration: 1s;
  121. transition: all 1s cubic-bezier(0.165, 0.84, 0.44, 1) .5s;
  122. }
  123. .device-select-hide {
  124. left: -250px;
  125. animation-name: treeHide;
  126. /* 持续时间 */
  127. animation-duration: 1s;
  128. transition: all 1s cubic-bezier(0.165, 0.84, 0.44, 1) .5s;
  129. }
  130. .node-select-show {
  131. width: 276px;
  132. height: 44px;
  133. background: url('/@/assets/images/vent/home/tree-expansion-bg.png') no-repeat;
  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. display: flex;
  140. align-items: center;
  141. margin-left: 0;
  142. justify-content: flex-start;
  143. pointer-events: auto;
  144. &:hover {
  145. background: url('/@/assets/images/vent/home/tree-expansion-hover-bg.png') no-repeat;
  146. }
  147. .put-away-icon {
  148. position: relative;
  149. display: inline-block;
  150. left: 4px;
  151. }
  152. }
  153. .node-select-hide {
  154. left: -400px;
  155. animation-name: treeHide;
  156. /* 持续时间 */
  157. animation-duration: 1s;
  158. transition: all 1s cubic-bezier(0.165, 0.84, 0.44, 1) .5s;
  159. }
  160. .device-select-box {
  161. width: 208px;
  162. height: 450px;
  163. overflow-y: auto;
  164. color: #fff;
  165. :deep(.zxm-tree) {
  166. background: transparent !important;
  167. color: #fff !important;
  168. .zxm-tree-switcher {
  169. background: transparent !important;
  170. }
  171. .zxm-tree-node-content-wrapper.zxm-tree-node-selected {
  172. background-color: #00b1c8;
  173. }
  174. .zxm-tree-node-content-wrapper:hover {
  175. background-color: #00b1c855;
  176. }
  177. input {
  178. height: 0px !important;
  179. }
  180. }
  181. &::-webkit-scrollbar-track {
  182. -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  183. border-radius: 10px;
  184. background: #ededed22;
  185. height: 100px;
  186. }
  187. &::-webkit-scrollbar-thumb {
  188. -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  189. background: #4288A444;
  190. }
  191. }
  192. .location-icon {
  193. width: 46px;
  194. height: 178px;
  195. position: absolute;
  196. top: 60px;
  197. // right: 0;
  198. background: url('/@/assets/images/vent/home/location-bg.png') no-repeat;
  199. background-size: contain;
  200. writing-mode: vertical-lr;
  201. line-height: 46px;
  202. color: #fff;
  203. padding-top: 10px;
  204. pointer-events: auto;
  205. cursor: pointer;
  206. &:hover {
  207. background: url('/@/assets/images/vent/home/location-hover-bg.png') no-repeat;
  208. }
  209. .location-text {
  210. padding-top: 20px;
  211. letter-spacing: 3px;
  212. font-size: 16px;
  213. }
  214. }
  215. .location-select {
  216. position: fixed;
  217. top: 60px;
  218. // right: 240px;
  219. pointer-events: auto;
  220. .location-select-box {
  221. width: 100%;
  222. height: 100%;
  223. position: relative;
  224. &::before {
  225. content: "";
  226. position: absolute;
  227. width: 230px;
  228. height: 500px;
  229. top: 0;
  230. left: 0;
  231. background: url('/@/assets/images/vent/home/tree-bg.png') no-repeat;
  232. background-size: contain;
  233. transform: rotateY(180deg);
  234. z-index: -1;
  235. // &:hover {
  236. // background: url('/@/assets/images/vent/home/tree-icon-hover-bg.png') no-repeat;
  237. // background-size: contain;
  238. // }
  239. }
  240. .location-top-title {
  241. color: #fff;
  242. position: absolute;
  243. width: 225px;
  244. height: 68px;
  245. background: url('/@/assets/images/vent/home/turn-location-top-bg.png') no-repeat;
  246. background-size: contain;
  247. top: 5px;
  248. left: 5px;
  249. display: flex;
  250. flex-direction: row;
  251. justify-content: space-between;
  252. align-items: flex-end;
  253. .title {
  254. font-size: 18px;
  255. position: relative;
  256. top: -14px;
  257. right: 15px;
  258. }
  259. }
  260. .location-expansion-icon {
  261. background: url('/@/assets/images/vent/home/tree-icon-cover-bg.png') no-repeat;
  262. background-size: contain;
  263. position: relative;
  264. left: 10px;
  265. top: -15px;
  266. padding: 5px;
  267. &:hover {
  268. background: url('/@/assets/images/vent/home/tree-icon-cover-hover-bg.png') no-repeat;
  269. background-size: contain;
  270. }
  271. }
  272. }
  273. .location-container {
  274. width: 200px;
  275. height: 390px;
  276. position: absolute;
  277. display: flex;
  278. flex-direction: column;
  279. top: 80px;
  280. left: 18px;
  281. overflow-y: auto;
  282. .location-item {
  283. color: #fff;
  284. line-height: 30px;
  285. display: flex;
  286. justify-content: space-between;
  287. background-image: linear-gradient(to left, #39f5ff05, #39f5ff10);
  288. margin: 3px 0;
  289. .item-title {
  290. width: 80px;
  291. text-align: right;
  292. color: #87f1ff;
  293. }
  294. }
  295. .location-bottom-btn {
  296. width: 100%;
  297. color: #fff;
  298. display: flex;
  299. justify-content: flex-end;
  300. margin-top: 20px;
  301. span {
  302. display: inline-block;
  303. width: 100%;
  304. background: #00709955;
  305. border-radius: 3px;
  306. border: 1px solid rgba(174, 243, 255, 0.3);
  307. text-align: center;
  308. padding: 2px 0;
  309. cursor: pointer;
  310. &:hover {
  311. background: #00557422;
  312. }
  313. }
  314. }
  315. }
  316. }
  317. .location-select-show {
  318. right: 240px;
  319. animation-name: locationShow;
  320. /* 持续时间 */
  321. animation-duration: 1s;
  322. transition: all 1s cubic-bezier(0.165, 0.84, 0.44, 1) .5s;
  323. }
  324. .location-select-hide {
  325. right: -2px;
  326. animation-name: locationHide;
  327. /* 持续时间 */
  328. animation-duration: 1s;
  329. transition: all 1s cubic-bezier(0.165, 0.84, 0.44, 1) .5s;
  330. }
  331. .location-btn-show {
  332. right: -0px;
  333. animation-name: locationBtnShow;
  334. /* 持续时间 */
  335. animation-duration: 1s;
  336. transition: all 1s cubic-bezier(0.165, 0.84, 0.44, 1) .5s;
  337. }
  338. .location-btn-hide {
  339. right: -240px;
  340. animation-name: locationBtnHide;
  341. /* 持续时间 */
  342. animation-duration: 1s;
  343. transition: all 1s cubic-bezier(0.165, 0.84, 0.44, 1) .5s;
  344. }
  345. .bottom-tabs-box {
  346. position: relative;
  347. .to-small {
  348. width: 60px;
  349. height: 60px;
  350. background: url('/@/assets/images/vent/home/tosmall.png') no-repeat center;
  351. background-size: auto;
  352. position: absolute;
  353. top: -65px;
  354. right: 36px;
  355. border-radius: 10px;
  356. padding: 8px;
  357. backdrop-filter: blur(10px);
  358. background-color: rgba(45, 86, 137, 0.418);
  359. &:hover {
  360. background-color: rgba(79, 104, 134, 0.418);
  361. }
  362. }
  363. .device-button-group {
  364. position: absolute;
  365. top: -30px;
  366. display: flex;
  367. width: 100%;
  368. .device-button {
  369. height: 26px;
  370. padding: 0 20px;
  371. background: linear-gradient(45deg, #04e6fb55, #0c5cab55);
  372. clip-path: polygon(10px 0,
  373. 0 50%,
  374. 10px 100%,
  375. 100% 100%,
  376. calc(100% - 10px) 50%,
  377. 100% 0);
  378. display: flex;
  379. justify-content: center;
  380. align-items: center;
  381. color: #FFF;
  382. position: relative;
  383. cursor: pointer;
  384. &:nth-child(1) {
  385. left: calc(-6px * 1);
  386. }
  387. &:nth-child(2) {
  388. left: calc(-6px * 2);
  389. }
  390. &:nth-child(3) {
  391. left: calc(-6px * 3);
  392. }
  393. &:nth-child(4) {
  394. left: calc(-6px * 4);
  395. }
  396. &:nth-child(5) {
  397. left: calc(-6px * 5);
  398. }
  399. &:nth-child(6) {
  400. left: calc(-6px * 6);
  401. }
  402. &:nth-child(7) {
  403. left: calc(-6px * 7);
  404. }
  405. &:nth-child(8) {
  406. left: calc(-6px * 8);
  407. }
  408. &:nth-child(9) {
  409. left: calc(-6px * 9);
  410. }
  411. &:nth-child(10) {
  412. left: calc(-6px * 10);
  413. }
  414. &:nth-child(11) {
  415. left: calc(-6px * 11);
  416. }
  417. &:nth-child(12) {
  418. left: calc(-6px * 12);
  419. }
  420. &:nth-child(13) {
  421. left: calc(-6px * 13);
  422. }
  423. &:nth-child(14) {
  424. left: calc(-6px * 14);
  425. }
  426. &:nth-child(15) {
  427. left: calc(-6px * 15);
  428. }
  429. &:first-child {
  430. clip-path: polygon(0 0,
  431. 10px 50%,
  432. 0 100%,
  433. 100% 100%,
  434. calc(100% - 10px) 50%,
  435. 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. }</style>