Bläddra i källkod

fix:修复平面图显示逻辑

jinx 3 år sedan
förälder
incheckning
a81b46b2cb
4 ändrade filer med 57 tillägg och 18 borttagningar
  1. 26 4
      components/upload-titlemap/index.js
  2. 29 13
      locat/addDataSet.html
  3. 1 0
      main.js
  4. 1 1
      style.css

+ 26 - 4
components/upload-titlemap/index.js

@@ -107,11 +107,12 @@
             refreshConfirm() {
                 this.$parent.showLoading('更新中...')
                 axios.get(`/indoor/${sceneNum}/api/tiled_maps/init`).then(res => {
-                    this.$parent.hideLoading()
+                    // this.$parent.hideLoading()
                     if (res.data.code == 0) {
                         this.getDetaile()
                         IV.api.AuthenticationService.sendAuthenticationChanged()
                     } else {
+                        this.$parent.hideLoading()
                         this.$message({
                             message: res.data.msg,
                             type: 'error',
@@ -138,10 +139,12 @@
                 }
                 this.$parent.showLoading('切换中...')
                 axios.get(`/indoor/${sceneNum}/api/tiled_maps/updateDisplay/${this.info.display}`).then(res => {
-                    this.$parent.hideLoading()
+
                     if (res.data.code == 0) {
+                   
                         IV.api.AuthenticationService.sendAuthenticationChanged()
                     } else {
+                        this.$parent.hideLoading()
                         this.$message({
                             message: res.data.msg,
                             type: 'error',
@@ -183,10 +186,11 @@
                 this.$parent.showLoading('上传中...')
 
                 axios.post(`/indoor/${sceneNum}/api/tiled_maps/upload`, params).then(res => {
-                    this.$parent.hideLoading()
                     let file = this.$refs.files
                     file.value = ''
                     if (res.data.code == 0) {
+                      
+
                         this.$message({
                             message: '上传成功',
                             type: 'success',
@@ -246,6 +250,12 @@
                     });
 
                 })
+            },
+            openMap() {
+                this.$parent.hideLoading()
+                if (IV.getMainView().ViewService.primaryView != 'map') {
+                    IV.swapScenes()
+                }
             }
 
         },
@@ -253,9 +263,21 @@
 
         },
         destroyed() {
-
+            if (IV.getMainView().ViewService.primaryView == 'map') {
+                IV.swapScenes()
+            }
         },
         mounted() {
+            this.openMap()
+            window.eventBus.off('openMap', this.openMap);
+            window.eventBus.on('openMap', this.openMap);
+
+            // function openMap() {
+            //       this.$parent.hideLoading()
+            //     if (IV.getMainView().ViewService.primaryView != 'map') {
+            //         IV.swapScenes()
+            //     }
+            // }
             this.getDetaile()
         },
     })

+ 29 - 13
locat/addDataSet.html

@@ -10,7 +10,7 @@
         [v-cloak] {
             display: none;
         }
-        
+
         #editor {
             height: 200px;
         }
@@ -100,13 +100,15 @@
                                 <div class="inputItem">
                                     <div class="name">经度</div>
                                     <div class="ipt">
-                                        <input type="text" @input="limtInput('alon')" v-model="alon" name="alon" id="alon" value="120" />
+                                        <input type="text" @input="limtInput('alon')" v-model="alon" name="alon"
+                                            id="alon" value="120" />
                                     </div>
                                 </div>
                                 <div class="inputItem">
                                     <div class="name">纬度</div>
                                     <div class="ipt">
-                                        <input type="text" @input="limtInput('alat')" v-model="alat" name="alat" id="alat" value="22" />
+                                        <input type="text" @input="limtInput('alat')" v-model="alat" name="alat"
+                                            id="alat" value="22" />
                                     </div>
                                 </div>
 
@@ -149,13 +151,15 @@
                                 <div class="inputItem">
                                     <div class="name">经度</div>
                                     <div class="ipt">
-                                        <input type="text" @input="limtInput('blon')" v-model="blon" name="blon" id="blon" value="123" />
+                                        <input type="text" @input="limtInput('blon')" v-model="blon" name="blon"
+                                            id="blon" value="123" />
                                     </div>
                                 </div>
                                 <div class="inputItem">
                                     <div class="name">纬度</div>
                                     <div class="ipt">
-                                        <input type="text" @input="limtInput('blat')" v-model="blat" name="blat" id="blat" value="22" />
+                                        <input type="text" @input="limtInput('blat')" v-model="blat" name="blat"
+                                            id="blat" value="22" />
                                     </div>
                                 </div>
                                 <!-- <div class="inputItem">
@@ -309,9 +313,21 @@
                 }
             },
             created() {
+                window.eventBus.off('closeMenu', closeMenu);
+                window.eventBus.on('closeMenu', closeMenu);
+
+                function closeMenu() {
+                    if (IV.SidebarMenuService.navigationStack[0].title == '设置') {
+                        if (IV.getMainView().ViewService.primaryView == 'map') {
+                            IV.swapScenes()
+                        }
+                    }
 
+                }
             },
+            destroyed() {
 
+            },
             mounted() {
                 const origin = window.location.origin + window.location.pathname
                 const tokenKry = 'ls.' + origin + '#JWT'
@@ -319,12 +335,12 @@
                 axios.defaults.headers.common['X-Authorization'] = this.token;
                 // alert(sceneNum)
                 this.getContorlPoint()
-                    // this.sceneNum = window.location.pathname.split('/')[2]
-                    // this.$nextTick(() => {
-                    //     let t = setTimeout(() => {
-                    //         this.map = this.initMap('map');
-                    //     }, 100)
-                    // })
+                // this.sceneNum = window.location.pathname.split('/')[2]
+                // this.$nextTick(() => {
+                //     let t = setTimeout(() => {
+                //         this.map = this.initMap('map');
+                //     }, 100)
+                // })
 
 
 
@@ -470,7 +486,7 @@
                             });
                         }
 
-                    }).catch(function(error) {
+                    }).catch(function (error) {
                         this.hideLoading()
                         this.$message({
                             message: '控制点上传失败',
@@ -486,7 +502,7 @@
                     this.ageControlLocation2 = []
                     this.gpsControlCoordinate1 = []
                     this.gpsControlCoordinate2 = []
-                        //
+                    //
                     this.ageControlLocation1.push(this.ax - 0)
                     this.ageControlLocation1.push(this.ay - 0)
                     this.ageControlLocation1.push(this.az - 0)

+ 1 - 0
main.js

@@ -62209,6 +62209,7 @@ and limitations under the License.
        }
        ,
        t.prototype.closeMenu = function() {
+		   window.eventBus.emit('closeMenu');
            var t = this;
            this.checkActiveItemOnExit((function() {
                return t.closeMenu()

+ 1 - 1
style.css

@@ -494,7 +494,7 @@ input::-webkit-input-placeholder {
     position: fixed;
     top: 0;
     left: 0;
-    z-index: 999;
+    z-index: 1999;
     background: rgba(0, 0, 0, 0.8);
 }