index.vue 15 KB

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