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