index.vue 15 KB

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