index.vue 15 KB

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