index.vue 15 KB

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