From 6616b60bf48914a71af08c166f1b2b9abdb9ca3e Mon Sep 17 00:00:00 2001 From: "DESKTOP-VMMLSOQ\\wangzg" <1161909281@qq.com> Date: Mon, 19 Aug 2024 22:26:28 +0800 Subject: [PATCH] 1111 --- components/Map.vue | 34 +++++++++++------------ components/smallCommon/ProgressDesc.vue | 2 +- layouts/default.vue | 36 +++++++++++++++++++++++++ layouts/loginLayout.vue | 17 ++++++++++++ pages/cleanTravel/home.vue | 8 +----- pages/home/index.vue | 14 +++++----- pages/manager/login.vue | 1 + pages/wuzuzhi/huanjingzhili.vue | 6 ----- plugins/setup.js | 1 - store/system.js | 6 +++-- webpack.config.js | 9 +++++++ 11 files changed, 93 insertions(+), 41 deletions(-) create mode 100644 layouts/default.vue create mode 100644 layouts/loginLayout.vue create mode 100644 webpack.config.js diff --git a/components/Map.vue b/components/Map.vue index 4150bd1..a99ce72 100644 --- a/components/Map.vue +++ b/components/Map.vue @@ -20,11 +20,6 @@ const mapLayerTypeToPointIcon = { } export default { - async asyncData({ $axios }) { - const { data } = await $axios.$get('http://101.43.201.20:5000/api/Home/view'); - return { pageTitle: data.home.title }; // 假设接口返回格式为 { data: '标题内容' } - }, - name: "Map", data () { return { @@ -41,18 +36,23 @@ export default { default: 'big' } }, - mounted() { - this.$nextTick(() => { - if (this.$refs.mapRef) { - const win = window.top - this.$http.get('http://101.43.201.20:5000/api/Home/view').then(({ data }) => { - win.document.title = data.home.title - this.setTitle(data.home.title) - this.setInfo(data) - this.initMap(data.home.center) - }) + watch: { + info: { + immediate: true, + deep: true, + handler (info) { + if (info) { + this.$nextTick(() => { + if (this.$refs.mapRef) { + this.initMap(info.home.center) + } + }) + } } - }) + } + }, + + mounted() { this.$evBus.$on('setVisibility', (layerType, show) => { this.setVisibility(layerType, show) }) @@ -70,6 +70,7 @@ export default { shisc: state => state.map.shisc, wz: state => state.map.wz, jkd: state => state.map.jkd, + info: state => state.system.info }) }, methods: { @@ -79,7 +80,6 @@ export default { const { lon, lat } = center ms3dConfig.scene.center.lng = lon ms3dConfig.scene.center.lat = lat - console.log('ms3dConfig:', ms3dConfig); this.map = new mars3d.Map(this.$refs.mapRef, ms3dConfig) this.map.on("load", () => { Object.keys(mapLayerTypeToPointIcon).forEach(layerType => { diff --git a/components/smallCommon/ProgressDesc.vue b/components/smallCommon/ProgressDesc.vue index 07ba0ed..287fd1f 100644 --- a/components/smallCommon/ProgressDesc.vue +++ b/components/smallCommon/ProgressDesc.vue @@ -5,7 +5,7 @@
- {{ item.val * 100 }} + {{ (item.val * 100).toFixed(0) }}
%
diff --git a/layouts/default.vue b/layouts/default.vue new file mode 100644 index 0000000..dc04802 --- /dev/null +++ b/layouts/default.vue @@ -0,0 +1,36 @@ + + + + + + + diff --git a/layouts/loginLayout.vue b/layouts/loginLayout.vue new file mode 100644 index 0000000..c8fc5ee --- /dev/null +++ b/layouts/loginLayout.vue @@ -0,0 +1,17 @@ + + + + + + + diff --git a/pages/cleanTravel/home.vue b/pages/cleanTravel/home.vue index a60e5fc..28d61fb 100644 --- a/pages/cleanTravel/home.vue +++ b/pages/cleanTravel/home.vue @@ -2,7 +2,7 @@