index.vue 15 KB

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