index.vue 15 KB

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