1
0

index.vue 17 KB

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