map3d.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571
  1. <template>
  2. <div id="app">
  3. <div class="header">
  4. <div class="timeline">
  5. <div class="timeline-item" v-html="formattedText"></div>
  6. <div class="timeline-item timeline-item-time" v-html="formattedTime"></div>
  7. </div>
  8. <div class="menuClass" id="menuClass">
  9. <!-- <div
  10. v-for="(item, index) in menu"
  11. :key="index"
  12. :class="activeMenuId == index ? 'activemenu' : 'menu'"
  13. @click="chooseMenu(item, index)"
  14. >
  15. {{ item.title }}
  16. </div> -->
  17. <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleMenuSelect"
  18. background-color="rgba(4,16,36,0)" text-color="white" active-text-color="white">
  19. <template v-for="(item, index) in menu_left">
  20. <el-menu-item v-if="!item.children" :index="item.path">{{
  21. item.title
  22. }}</el-menu-item>
  23. <el-submenu :index="index" v-if="item.children && item.children.length > 0">
  24. <template slot="title">{{ item.title }}</template>
  25. <template v-for="(subitem, subindex) in item.children">
  26. <el-menu-item v-if="!subitem.children" popper-class="el-menu-item-popper" :index="subitem.path">{{
  27. subitem.title }}</el-menu-item>
  28. <el-submenu :index="index + '-' + subindex" v-if="subitem.children && subitem.children.length > 0">
  29. <template slot="title">{{ subitem.title }}</template>
  30. <el-menu-item :index="submenu.path" v-for="(submenu, sunindex) in subitem.children" :key="sunindex">{{
  31. submenu.title }}</el-menu-item>
  32. </el-submenu>
  33. </template>
  34. </el-submenu>
  35. </template>
  36. </el-menu>
  37. <el-menu :default-active="activeIndex" class="el-menu-demo1" mode="horizontal" @select="handleMenuSelect1"
  38. background-color="rgb(4,16,36)" text-color="white" active-text-color="white">
  39. <template v-for="(item, index) in menu_right">
  40. <el-menu-item v-if="!item.children" :index="item.path">{{
  41. item.title
  42. }}</el-menu-item>
  43. <el-submenu :index="index" v-if="item.children && item.children.length > 0">
  44. <template slot="title">{{ item.title }}</template>
  45. <template v-for="(subitem, subindex) in item.children">
  46. <el-menu-item v-if="!subitem.children" popper-class="el-menu-item-popper" :index="subitem.path">{{
  47. subitem.title }}</el-menu-item>
  48. <el-submenu :index="index + '-' + subindex" v-if="subitem.children && subitem.children.length > 0">
  49. <template slot="title">{{ subitem.title }}</template>
  50. <el-menu-item :index="submenu.path" v-for="(submenu, sunindex) in subitem.children" :key="sunindex">{{
  51. submenu.title }}</el-menu-item>
  52. </el-submenu>
  53. </template>
  54. </el-submenu>
  55. </template>
  56. </el-menu>
  57. </div>
  58. <div class="systemTitle">海南省国土空间智慧治理试点(三亚)</div>
  59. <tool-bar></tool-bar>
  60. <!-- <div class="timeline">
  61. <div class="timeline-item" v-html="formattedText"></div>
  62. <div
  63. class="timeline-item timeline-item-time"
  64. v-html="formattedTime"
  65. ></div>
  66. </div> -->
  67. <el-tooltip class="item" effect="dark" content="智能会话" placement="top">
  68. <i class="ai el-icon-chat-dot-round" @click="drawer = !drawer"></i>
  69. </el-tooltip>
  70. <div class="user">
  71. <span>admin</span>
  72. <el-tooltip class="item" effect="dark" content="退出" placement="top">
  73. <i style="width: 24px;height: 24px;background-image: url('/static/images/overview/icon_LogOut.png'); cursor: pointer;"
  74. @click="exit"></i>
  75. </el-tooltip>
  76. </div>
  77. </div>
  78. <div class="routerContainer">
  79. <router-view ref="routeViewRef"></router-view>
  80. </div>
  81. <sm-viewer @viewerChange="viewerChange"> </sm-viewer>
  82. <!-- <div class="masking_top">
  83. <div class="top_left"></div>
  84. <div class="top_right"></div>
  85. asdasd
  86. </div>
  87. <div class="masking_left"></div>
  88. <div class="masking_bottom"></div>
  89. <div class="masking_right"></div>
  90. <div class="masking_right"></div> -->
  91. <el-drawer :visible.sync="drawer" :with-header="false" :append-to-body="true" :show-close="false">
  92. <iframe :src="aiModel" style="width: 100%; height: 100%; position: absolute"></iframe>
  93. </el-drawer>
  94. </div>
  95. </template>
  96. <script>
  97. import { getRouters } from "@/api/menu";
  98. export default {
  99. name: "app",
  100. data() {
  101. return {
  102. menu_left: [],
  103. menu_right: [],
  104. activeIndex: 0,
  105. formattedText: "",
  106. formattedTime: "",
  107. activeMenuId: 0,
  108. drawer: false,
  109. aiModel: window.aiModel
  110. };
  111. },
  112. created() {
  113. this.GetRouters();
  114. },
  115. computed: {},
  116. mounted() {
  117. //动态时间回显
  118. setInterval(() => {
  119. this.updateTime();
  120. }, 1000);
  121. this.updateTime();
  122. },
  123. methods: {
  124. viewerChange(isbig) {
  125. // this.$refs.routeViewRef[ isbig ? 'switchPack_down':'switchPack_up']()
  126. this.$refs.routeViewRef["switch"]();
  127. },
  128. handleMenuSelect(item) {
  129. this.$router.push({ path: item });
  130. if (item == "/checkmodel") {
  131. store.setToolBarShow(true); //显示工具栏
  132. // this.$refs.routeViewRef["switch"]();
  133. } else {
  134. store.setToolBarShow(false); //显示工具栏
  135. // this.$refs.routeViewRef["switch"]();
  136. }
  137. // 菜单切换的时候取消左或者右高亮菜单
  138. // var lis = document.querySelectorAll('.el-menu-demo1 li');
  139. // console.log(lis, "lis");
  140. // lis.forEach(function (li) {
  141. // li.classList.remove('is-active');
  142. // });
  143. },
  144. handleMenuSelect1(item) {
  145. this.$router.push({ path: item });
  146. // var lis = document.querySelectorAll('.el-menu-demo li');
  147. // lis.forEach(function (li) {
  148. // li.classList.remove('is-active');
  149. // });
  150. },
  151. updateTime() {
  152. let s = new Date().toLocaleString().split(" ");
  153. this.formattedText = s[0];
  154. // this.formattedTime = s[1];
  155. var index = s[1].lastIndexOf(":");
  156. this.formattedTime = s[1].substring(0, index);
  157. },
  158. chooseMenu(item, index) {
  159. if (this.activeMenuId == index) {
  160. return;
  161. }
  162. console.log(item);
  163. this.activeMenuId = index;
  164. this.$router.push({ path: item.path });
  165. },
  166. GetRouters() {
  167. getRouters().then((res) => {
  168. this.menu_left = res.data[0].children.slice(0, 3);
  169. this.menu_right = res.data[0].children.slice(3, 5);
  170. let curRouter = this.$router.currentRoute.path;
  171. if (curRouter == "/") {
  172. this.activeIndex = this.menu[0].path;
  173. this.$router.push({ path: this.menu[0].path });
  174. } else {
  175. this.activeIndex = curRouter;
  176. this.$router.push({ path: curRouter });
  177. // for (let i = 0; i < this.menu.length; i++) {
  178. // if (this.menu[i].path == curRouter) {
  179. // this.activeMenuId = i;
  180. // this.$router.push({ path: this.menu[i].path });
  181. // break;
  182. // }
  183. // }
  184. }
  185. });
  186. },
  187. getDayOfWeek() {
  188. const days = [
  189. "星期日",
  190. "星期一",
  191. "星期二",
  192. "星期三",
  193. "星期四",
  194. "星期五",
  195. "星期六",
  196. ];
  197. const date = new Date();
  198. return days[date.getDay()];
  199. },
  200. exit() {
  201. this.$alert("确认退出登录吗?", "提示", {
  202. confirmButtonText: "确定",
  203. callback: (action) => {
  204. if (action != "cancel") {
  205. this.$store.dispatch("LogOut").then(() => {
  206. location.href = "/login";
  207. });
  208. }
  209. },
  210. });
  211. },
  212. },
  213. };
  214. </script>
  215. <style lang="scss" scoped>
  216. .exit {
  217. font-size: 30px;
  218. color: cornflowerblue;
  219. cursor: pointer;
  220. }
  221. .ai {
  222. position: absolute;
  223. right: 110px;
  224. top: 19px;
  225. color: cornflowerblue;
  226. font-size: 24px;
  227. }
  228. .user {
  229. width: 85px;
  230. height: 40px;
  231. position: absolute;
  232. right: 10px;
  233. top: 10px;
  234. display: flex;
  235. justify-content: space-between;
  236. align-items: center;
  237. }
  238. .user span {
  239. display: inline-block;
  240. width: 60px;
  241. height: 24px;
  242. padding-left: 5px;
  243. /* background-color: pink; */
  244. font-size: 14px;
  245. color: #bcd3e5;
  246. line-height: 24px;
  247. text-align: left;
  248. }
  249. .routerContainer {
  250. position: absolute;
  251. width: 100%;
  252. height: calc(100% - 60px);
  253. top: 60px;
  254. }
  255. .header {
  256. height: 60px;
  257. position: fixed;
  258. top: 0px;
  259. width: 100%;
  260. z-index: 100;
  261. // background: RGBA(31, 35, 41, 1);
  262. text-align: center;
  263. display: flex;
  264. justify-content: center;
  265. align-items: center;
  266. background-image: url("/static/images/overview/title_new.png");
  267. background-size: 100% 100%;
  268. }
  269. .masking_top {
  270. height: 60px;
  271. position: fixed;
  272. top: 0px;
  273. width: 100%;
  274. background: no-repeat;
  275. // // background-image: url("/static/images/overview/masking_top.png");
  276. // .top_left {
  277. // height: 100%;
  278. // width: 29%;
  279. // background: -webkit-linear-gradient(left, RGBA(11, 32, 61, 1), RGBA(8, 40, 60, 1));
  280. // }
  281. // .top_right {
  282. // background: -webkit-linear-gradient(right, RGBA(8, 40, 60, 1), RGBA(11, 32, 61, 1));
  283. // }
  284. }
  285. .masking_left {
  286. width: 415px;
  287. height: 100%;
  288. background: no-repeat;
  289. background-image: url("/static/images/overview/masking_left.png");
  290. }
  291. .masking_bottom {
  292. width: 100%;
  293. height: 140px;
  294. background: no-repeat;
  295. background-image: url("/static/images/overview/masking_bottom.png");
  296. position: fixed;
  297. bottom: 0.1rem;
  298. }
  299. .masking_right {
  300. width: 415px;
  301. height: 100%;
  302. background: no-repeat;
  303. background-image: url("/static/images/overview/masking_right.png");
  304. position: fixed;
  305. right: -1rem;
  306. top: 1rem;
  307. z-index: 1;
  308. }
  309. .systemTitle {
  310. height: 100%;
  311. width: 430;
  312. position: absolute;
  313. top: 0px;
  314. line-height: 60px;
  315. font-size: 25px;
  316. // color: white;
  317. background: linear-gradient(180deg, rgba(212, 250, 255, 1) 10%, rgba(54, 215, 215, 1) 100%);
  318. -webkit-background-clip: text;
  319. -webkit-text-fill-color: transparent;
  320. font-family: auto;
  321. font-weight: 600;
  322. }
  323. .menuClass {
  324. position: absolute;
  325. left: 40px;
  326. font-size: 14px;
  327. height: 32px;
  328. top: 20px;
  329. }
  330. .menu {
  331. display: inline-block;
  332. width: 108px;
  333. height: 100%;
  334. line-height: 35px;
  335. margin-left: 9px;
  336. cursor: pointer;
  337. background-image: url("/static/images/overview/menu.png");
  338. background-size: 100% 100%;
  339. }
  340. .activemenu {
  341. display: inline-block;
  342. width: 108px;
  343. height: 100%;
  344. line-height: 35px;
  345. margin-left: 9px;
  346. cursor: pointer;
  347. background-image: url("/static/images/overview/menuactive.png");
  348. background-size: 100% 100%;
  349. }
  350. .menu:hover,
  351. .activemenu:hover {
  352. /* background: blue; */
  353. font-weight: bold;
  354. }
  355. .timeline {
  356. position: absolute;
  357. left: 11px;
  358. top: 10px;
  359. height: 38px;
  360. line-height: 60px;
  361. font-size: 14px;
  362. width: 100px;
  363. color: white;
  364. /* background-image: url(/static/images/overview/time.png); */
  365. background-size: 100% 100%;
  366. z-index: 20;
  367. }
  368. .timeline-item {
  369. height: 25px;
  370. line-height: 25px;
  371. /* text-align: center; */
  372. text-align: left;
  373. width: 100%;
  374. display: inline-block;
  375. position: relative;
  376. top: -21px;
  377. letter-spacing: 1px;
  378. font-weight: 400;
  379. font-size: 14px;
  380. color: #bcd3e5;
  381. }
  382. .timeline-item-time {
  383. top: -62px;
  384. font-size: 14px;
  385. text-align: left;
  386. }
  387. .el-menu-demo {
  388. border: none !important;
  389. height: 5%;
  390. background-color: transparent;
  391. position: relative;
  392. background-color: rgba(4, 16, 36, 0) !important;
  393. position: fixed;
  394. left: 9.3rem;
  395. top: 1rem;
  396. font-weight: 700;
  397. .el-menu--horizontal>.el-menu-item.is-active,
  398. .el-menu-item.is-active,
  399. .el-submenu.is-active {
  400. background-image: url("/static/images/overview/left_mune_button_click.png");
  401. background-size: 100% 100%;
  402. }
  403. }
  404. .el-menu-demo1 {
  405. border: none !important;
  406. height: 5%;
  407. background-color: transparent;
  408. position: fixed;
  409. right: 16.9rem;
  410. top: 1.1rem;
  411. background-color: rgba(4, 16, 36, 0) !important;
  412. font-weight: 700;
  413. .el-menu-item {
  414. background-image: url("/static/images/overview/right_mune_button.png");
  415. background-size: 100% 100%;
  416. float: left;
  417. height: 34px;
  418. line-height: 34px !important;
  419. margin: 0;
  420. border: none;
  421. color: white;
  422. width: 120px;
  423. // margin-right: -1.2rem;
  424. margin-right: 1rem;
  425. }
  426. .el-menu-item:hover {
  427. font-weight: bold;
  428. color: white !important;
  429. background-image: url("/static/images/overview/right_mune_button_click.png");
  430. }
  431. // 暂时隐藏
  432. // .el-menu--horizontal>.el-menu-item.is-active,
  433. // .el-menu-item.is-active,
  434. // .el-submenu.is-active {
  435. // background-image: url("/static/images/overview/right_mune_button_click.png");
  436. // background-size: 100% 100%;
  437. // }
  438. }
  439. .el-menu-item {
  440. background-image: url("/static/images/overview/left_mune_button.png");
  441. background-size: 100% 100%;
  442. float: left;
  443. height: 37px;
  444. line-height: 43px !important;
  445. margin: 0;
  446. border: none;
  447. color: white;
  448. width: 120px;
  449. margin-right: 1rem;
  450. }
  451. .el-menu-item:hover {
  452. font-weight: bold;
  453. color: white !important;
  454. background-image: url("/static/images/overview/left_mune_button_click.png");
  455. }
  456. .el-submenu,
  457. .is-opend {
  458. background-image: url("/static/images/overview/left_mune_button.png");
  459. background-size: 100% 100%;
  460. height: 34px;
  461. line-height: 34px !important;
  462. margin: 0;
  463. border: none;
  464. color: white;
  465. width: 120px;
  466. margin-right: 1rem;
  467. }
  468. .el-menu--popup .el-submenu {
  469. width: 100% !important;
  470. }
  471. .el-submenu:hover {
  472. font-weight: bold;
  473. color: white !important;
  474. }
  475. .el-menu--horizontal>.el-submenu.is-active .el-submenu__title {
  476. border: none !important;
  477. color: white !important;
  478. }
  479. .el-submenu__title {
  480. height: 39px !important;
  481. line-height: 43px !important;
  482. border: none !important;
  483. color: white !important;
  484. }
  485. /deep/ .el-menu-item.is-active,
  486. /deep/.el-submenu.is-active,
  487. /deep/ .el-submenu.is-active,
  488. /deep/.el-submenu__title {
  489. border: none;
  490. color: white;
  491. }
  492. /deep/ .el-menu-item,
  493. /deep/ .el-submenu__title,
  494. /deep/ .is-opened {
  495. height: 34px !important;
  496. line-height: 34px !important;
  497. color: white !important;
  498. background-color: transparent !important;
  499. border: none !important;
  500. text-align: center !important;
  501. }
  502. </style>