index.vue 15 KB

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