Browse Source

地图图层

hanfucheng 1 year ago
parent
commit
2561e535b7

+ 2 - 3
data-ui/src/api/components/supermap.js

@@ -9,14 +9,13 @@ export function getSuperMap(codes) {
 }
 
 // 获取地图配置
-export function queryMap(state) {
+export function queryMap(state,deptId) {
   return request({
     url: '/system/sysMenuVisuMap/queryMap',
     method: 'post',
     data: {
       visuId: state,
-      // deptId: 365
-      deptId:Cookies.get("deptId")
+      deptId
     }
   })
 }

+ 4 - 14
data-ui/src/views/components/supermap-2.5d.vue

@@ -62,24 +62,14 @@
       putSmUserID_layer: null,
     },
     methods: {
-      superMapInfo(type, obj,NB) {
+      superMapInfo(type, obj,NB, state) {
         getConfigKey('superMap.iServer').then(response => {
           this.superMapRootUrl = response.msg;
         })
-        let state = 6;
-        if (this.$route.path.indexOf("/water")>-1){
-          state=4;
+        if (state==undefined){
+          state = 6;
         }
-        if (this.$route.path.indexOf("/traffic")>-1){
-          state=7;
-        }
-        if (this.$route.path.indexOf("/forest")>-1){
-          state=2;
-        }
-        if (this.$route.path.indexOf("/resource")>-1){
-          state=8;
-        }
-        queryMap(state).then(req => {
+        queryMap(state,this.$store.state.user.dept.deptId).then(req => {
             req = req.sort(function(a, b) {
               return a.sort - b.sort
             })

+ 14 - 1
data-ui/src/views/data/digitaltraffic/level/IForm.vue

@@ -197,9 +197,22 @@
       showMap() {
         this.showLongitude = true;
         this.uuid = uuidv4();
+        let state = undefined;
+        if (this.$route.query.type == '2'){
+          state=4;
+        }
+        if (this.$route.query.type == '3'){
+          state=7;
+        }
+        if (this.$route.query.type == '1'){
+          state=2;
+        }
+        if (this.$route.query.type == '6'){
+          state=8;
+        }
         setTimeout(() => {
           this.$refs.supermap.clearM(false);
-          this.$refs.supermap.superMapInfo(this.sign, {longitude: this.form.longitude, latitude: this.form.latitude});
+          this.$refs.supermap.superMapInfo(this.sign, {longitude: this.form.longitude, latitude: this.form.latitude},null,state);
         }, 500);
         // setTimeout(() => {
         //   this.form.type == 1 ? this.$refs.supermap.loadLindi() : (this.form.type == 2 ? this.$refs.supermap.loadShuixi() : (this.form.type == 3 ? this.$refs.supermap.loadRoad() : this.$refs.supermap.loadNongtian()))