diff --git a/index.html b/index.html index b281629..4c8a89f 100644 --- a/index.html +++ b/index.html @@ -1,226 +1,263 @@ + + + + + + + 若依管理系统 + + - - - - - - - 若依管理系统 - - - - - - - - - - - - - - - - -
-
-
-
-
-
正在加载系统资源,请耐心等待
-
-
- - + + + + + + + + + + + + + +
+
+
+
+
+
正在加载系统资源,请耐心等待
+
+
+ + + diff --git a/src/components/NavigationBar/index.vue b/src/components/NavigationBar/index.vue index 848d2a8..097cd1a 100644 --- a/src/components/NavigationBar/index.vue +++ b/src/components/NavigationBar/index.vue @@ -8,7 +8,7 @@ const props = defineProps({ title: { type: String, - default: "南通市公安局政务服务实景三维地图", + default: "政务服务实景三维地图", }, }); diff --git a/src/router/index.js b/src/router/index.js index 2ccbde4..11fe529 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -166,7 +166,7 @@ export const dynamicRoutes = [ ] const router = createRouter({ - history: createWebHistory(), + history: createWebHistory(process.env.NODE_ENV === 'production' ? '/nantong-police/' : '/'), routes: constantRoutes, scrollBehavior(to, from, savedPosition) { if (savedPosition) { diff --git a/src/views/map.vue b/src/views/map.vue index b1f6a5d..593328b 100644 --- a/src/views/map.vue +++ b/src/views/map.vue @@ -90,7 +90,7 @@ width="30%" class="info-dialog" > -
+
基本信息
地址:
@@ -157,7 +157,7 @@ v-model="innerVisible" class="info-dialog" > -
+
业务名称:
{{ businessInfo.businessName }}
@@ -221,7 +221,8 @@ import { getbusinessById, getEnterpriseTree, } from "@/api/mapApi"; -import { ref, reactive, onMounted, onUnmounted } from "vue"; +import { ref, reactive, onMounted, onUnmounted, nextTick } from "vue"; + const baseUrl = import.meta.env.VITE_APP_BASE_API; let options = reactive({ scene: { @@ -253,10 +254,10 @@ let options = reactive({ enableCollisionDetection: false, // 允许进入地下 }, }, - control:{ - toolbar:false, - homeButton:false, - zoom:false + control: { + toolbar: false, + homeButton: false, + zoom: false, }, terrain: { show: false, @@ -281,6 +282,8 @@ let options = reactive({ }, ], }); +const infoDialog = ref(null); +const businessDialog = ref(null); //地图图层 const mapModel = reactive(["二维地图", "三维地图"]); //图标类型图层 @@ -360,6 +363,10 @@ const handleInfoByyewu = async (id) => { businessInfo = res.data; innerVisible.value = true; + + nextTick(() => { + scrollToTop(businessDialog.value); + }); }; /** @@ -478,6 +485,10 @@ const initMarker = (item, flyTo = false, markerLength = 0) => { info = await getInfo(infoItem.id, infoItem.lonLat); queryParams.name = info.pointName; dialogVisible.value = true; + + nextTick(() => { + scrollToTop(infoDialog.value); + }); }); if (markerLength > 0) { @@ -625,14 +636,11 @@ const changeModel = (index) => { } }; - - /** * 地图初始化完毕 * @param mapInstance */ const mapLoad = (mapInstance) => { - map = mapInstance; //创建marker图层 mapLayer.markerLayer = new mars3d.layer.GraphicLayer({ @@ -661,6 +669,18 @@ const getdictList = async () => { let res = await getdicts(); dictList = res.result; }; + +/** + * 平滑滚动顶部 + */ +const scrollToTop = (elementItem) => { + if (elementItem) { + elementItem.scrollTo({ + top: 0, + behavior: "smooth", + }); + } +};