diff --git a/src/components/site/previewOfSiteStatus.vue b/src/components/site/previewOfSiteStatus.vue index be5dda4..eac618f 100644 --- a/src/components/site/previewOfSiteStatus.vue +++ b/src/components/site/previewOfSiteStatus.vue @@ -132,13 +132,12 @@ class="selectWidth" v-model="ChecksplatformCodeTest" filterable - clearable placeholder="全部项目" @change="ListClick" size="medium" > = 10 && this.historyList.includes(gname)) { } else if (this.historyList.length >= 10) { this.historyList.pop(); } this.historyList = this.selectTag( this.historyList, - this.allPlatSite[index]["platformName"] + this.allProjectSite[index]["platformName"] ); this.setItem(this.historyList); @@ -1104,7 +1103,7 @@ // 点击历史搜索的文字 HistoryClick(item) { this.ChecksplatformCodeTest = item; - this.allPlatSite.forEach(item1 => { + this.allProjectSite.forEach(item1 => { if (item1["platformName"] == item) { this.ChecksplatformCode = item1["platformCode"]; //地图联动响应的项目 @@ -2725,7 +2724,7 @@ switchStatus: function() { return this.flag; // 直接监听props里的status状态 }, - ...mapGetters(["allPlatSite"]) + ...mapGetters(["allProjectSite"]) }, created() {}, mounted: function() { diff --git a/src/components/site/previewOfSiteStatus.vue b/src/components/site/previewOfSiteStatus.vue index be5dda4..eac618f 100644 --- a/src/components/site/previewOfSiteStatus.vue +++ b/src/components/site/previewOfSiteStatus.vue @@ -132,13 +132,12 @@ class="selectWidth" v-model="ChecksplatformCodeTest" filterable - clearable placeholder="全部项目" @change="ListClick" size="medium" > = 10 && this.historyList.includes(gname)) { } else if (this.historyList.length >= 10) { this.historyList.pop(); } this.historyList = this.selectTag( this.historyList, - this.allPlatSite[index]["platformName"] + this.allProjectSite[index]["platformName"] ); this.setItem(this.historyList); @@ -1104,7 +1103,7 @@ // 点击历史搜索的文字 HistoryClick(item) { this.ChecksplatformCodeTest = item; - this.allPlatSite.forEach(item1 => { + this.allProjectSite.forEach(item1 => { if (item1["platformName"] == item) { this.ChecksplatformCode = item1["platformCode"]; //地图联动响应的项目 @@ -2725,7 +2724,7 @@ switchStatus: function() { return this.flag; // 直接监听props里的status状态 }, - ...mapGetters(["allPlatSite"]) + ...mapGetters(["allProjectSite"]) }, created() {}, mounted: function() { diff --git a/src/store/getters.js b/src/store/getters.js index 1523fa1..dc221d9 100644 --- a/src/store/getters.js +++ b/src/store/getters.js @@ -6,6 +6,7 @@ allCity: state => state.common.allCity, //所有城市 allPlatSite: state => state.common.allPlatSite, //所有项目站点 allProject: state => state.common.allProject, //所有项目 + allProjectSite: state => state.common.allProjectSite, //所有项目(包含默认头部--全部项目) menu: state => state.user.menu, //用户权限范围菜单 } diff --git a/src/components/site/previewOfSiteStatus.vue b/src/components/site/previewOfSiteStatus.vue index be5dda4..eac618f 100644 --- a/src/components/site/previewOfSiteStatus.vue +++ b/src/components/site/previewOfSiteStatus.vue @@ -132,13 +132,12 @@ class="selectWidth" v-model="ChecksplatformCodeTest" filterable - clearable placeholder="全部项目" @change="ListClick" size="medium" > = 10 && this.historyList.includes(gname)) { } else if (this.historyList.length >= 10) { this.historyList.pop(); } this.historyList = this.selectTag( this.historyList, - this.allPlatSite[index]["platformName"] + this.allProjectSite[index]["platformName"] ); this.setItem(this.historyList); @@ -1104,7 +1103,7 @@ // 点击历史搜索的文字 HistoryClick(item) { this.ChecksplatformCodeTest = item; - this.allPlatSite.forEach(item1 => { + this.allProjectSite.forEach(item1 => { if (item1["platformName"] == item) { this.ChecksplatformCode = item1["platformCode"]; //地图联动响应的项目 @@ -2725,7 +2724,7 @@ switchStatus: function() { return this.flag; // 直接监听props里的status状态 }, - ...mapGetters(["allPlatSite"]) + ...mapGetters(["allProjectSite"]) }, created() {}, mounted: function() { diff --git a/src/store/getters.js b/src/store/getters.js index 1523fa1..dc221d9 100644 --- a/src/store/getters.js +++ b/src/store/getters.js @@ -6,6 +6,7 @@ allCity: state => state.common.allCity, //所有城市 allPlatSite: state => state.common.allPlatSite, //所有项目站点 allProject: state => state.common.allProject, //所有项目 + allProjectSite: state => state.common.allProjectSite, //所有项目(包含默认头部--全部项目) menu: state => state.user.menu, //用户权限范围菜单 } diff --git a/src/store/modules/common.js b/src/store/modules/common.js index 9600898..919ddcf 100644 --- a/src/store/modules/common.js +++ b/src/store/modules/common.js @@ -8,7 +8,8 @@ allRole:[], allCity:[], allPlatSite:[], - allProject:[] + allProject:[], + allProjectSite:[], }, mutations: { //设置所有部门 @@ -30,6 +31,10 @@ //设置所有项目 SET_ALLPROJECT:(state, allProject)=>{ state.allProject = allProject; + }, + //设置所有项目包含默认头部(全部项目) + SET_ALLPROJECTSITE:(state, allProjectSite)=>{ + state.allProjectSite = allProjectSite; } }, actions: { @@ -83,8 +88,16 @@ value: item.platformCode } }); + const preArr = [ + { + platformCode: "", + platformName: "全部项目", + } + ] + const allProjectSite = [...preArr, ...res.data.data]; commit('SET_ALLPROJECT',treeArr); commit('SET_ALLPLATSITE',res.data.data); + commit('SET_ALLPROJECTSITE',allProjectSite); } }).catch(e =>{ console.log(e);