index.vue 15 KB

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