xieqy 2 years ago
parent
commit
2452ce16db

+ 10 - 3
src/store/modules/bigScreen.ts

@@ -13,7 +13,7 @@ const groupPageInfo = () => {
     currentMenuItem: null,//下拉切换
   }
 }
-const getDefaultState = () => {
+const projectInfo = () => {
   return {
     //初始范围
     initView: {
@@ -62,7 +62,7 @@ const getDefaultState = () => {
     wisdomWarningInfo: null
   }
 }
-const state = { ...groupPageInfo(), ...getDefaultState() }
+const state = { ...groupPageInfo(), ...projectInfo() }
 //检查是否存在已有数据方法
 function some(arr, str) {
   const result = arr.some((item) => {
@@ -110,8 +110,11 @@ const mutations = {
   DEL_ALLTOOL: (state) => {
     state.customToolList = []
   },
+  RESET_Project: (state) => {
+    Object.assign(state, projectInfo())
+  },
   RESET_ALL: (state) => {
-    Object.assign(state, getDefaultState())
+    Object.assign(state, { ...groupPageInfo(), ...projectInfo() })
   }
 }
 
@@ -184,6 +187,10 @@ const actions = {
   removeAllTool({ commit, state }, value) {
     commit('DEL_ALLTOOL', value)
   },
+  //重置项目state数据
+  resetProjectState({ commit, state }, value) {
+    commit('RESET_Project', value)
+  },
   //重置state数据
   resetState({ commit, state }, value) {
     commit('RESET_ALL', value)

+ 1 - 1
src/views/groupPage/baseMap/components/ProjectMap.vue

@@ -391,7 +391,7 @@ export default {
     },
     resetData() {
       window.viewer = null
-      this.$store.dispatch('bigScreen/resetState')
+      this.$store.dispatch('bigScreen/resetProjectState')
       if (this.monitorTreeInfo) this.monitorTreeInfo.clearDataSource()
     }
   }

+ 1 - 1
src/views/groupPage/components/BarChart/ComProgressChart.vue

@@ -57,7 +57,7 @@ export default {
         grid: {
           top: '10%',
           left: '5%',
-          right: '0%',
+          right: '15%',
           bottom: '-10%'
           // containLabel: true
         },

+ 1 - 0
src/views/groupPage/districtPageModules/customTools/monitorTree.vue

@@ -91,6 +91,7 @@ export default class monitorTree extends Vue {
     }, 10000) //600000
   }
   initCom() {
+    if (!this.$store.state.bigScreen.isInitViewer) return
     let init = (window as any).viewer
     if (init) {
       this.viewer = init

+ 1 - 0
src/views/groupPage/index.vue

@@ -137,6 +137,7 @@ export default {
   destroyed() {
     this.flexibleObject.removeflexible()
     this.flexibleObject = null
+    this.$store.dispatch('bigScreen/resetState')
   }
 }
 </script>

+ 4 - 4
src/views/widgets/InfoSearch/index.vue

@@ -98,7 +98,7 @@ export default {
   methods: {
     init() {
       this.apiurl.sjfw = this.AppX.appConfig.gisResource.tiplayers.config['sjfw'].url
-      this.apiurl.dtfw = this.AppX.appConfig.gisResource.maps.config['sjdt'].url
+      // this.apiurl.dtfw = this.AppX.appConfig.gisResource.maps.config['sjdt'].url
       this.apiurl.smiddtfw = this.AppX.appConfig.gisResource.tiplayers.config['bjsmidfw'].url
     },
     //搜索查询
@@ -779,11 +779,11 @@ export default {
     getCurrentInfo() {
       this.removeLabels()
       this.clearSelection()
-      let parentDom = $('#mainMapContainer .widget-infosearch-mapInfoLook')
+      let parentDom = $('.mainMapContainer .widget-infosearch-mapInfoLook')
       if (parentDom.length == 0) {
         let html = "<div class='widget-infosearch-mapInfoLook'></div>"
-        $('#mainMapContainer').append(html)
-        parentDom = $('#mainMapContainer .widget-infosearch-mapInfoLook')
+        $('.mainMapContainer').append(html)
+        parentDom = $('.mainMapContainer .widget-infosearch-mapInfoLook')
       }
       this.handler = new Cesium.ScreenSpaceEventHandler(this.viewer.canvas)
       this.handler.setInputAction(