index.vue 15 KB

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