Commit a15a203b by 姜雷

请求设备列表添加区域参数

parent c47641bb
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
:changeCampusHandle="changeCampusHandle" :changeCampusHandle="changeCampusHandle"
:updateCampusName="updateCampusName" :updateCampusName="updateCampusName"
/> />
<div class="SeviceRatio-title">{{areaName}}</div> <div class="SeviceRatio-title">{{areaInfo.areaName}}</div>
</div> </div>
</template> </template>
...@@ -50,7 +50,7 @@ export default { ...@@ -50,7 +50,7 @@ export default {
...mapGetters('Dashboard', [ ...mapGetters('Dashboard', [
'campusRankList', 'campusRankList',
'filters', 'filters',
'areaName', 'areaInfo',
'loading', 'loading',
]), ]),
}, },
...@@ -69,7 +69,7 @@ export default { ...@@ -69,7 +69,7 @@ export default {
areaId: data.areaId, areaId: data.areaId,
updatePercentList: true, updatePercentList: true,
}).then(() => { }).then(() => {
this.updateCampusName(data.areaName); this.updateCampusName(data);
}); });
}, },
}, },
......
...@@ -101,7 +101,7 @@ export default { ...@@ -101,7 +101,7 @@ export default {
this.chartGeom.setSelected(this.data[0]); this.chartGeom.setSelected(this.data[0]);
this.changeSelected(this.data[0]); this.changeSelected(this.data[0]);
this.updateCampusName(this.data[0].areaName); this.updateCampusName(this.data[0]);
this.SelectedDataIndex = this.data[0]; this.SelectedDataIndex = this.data[0];
} else { } else {
this.updateCampusName(); this.updateCampusName();
......
...@@ -35,7 +35,10 @@ const state = () => ({ ...@@ -35,7 +35,10 @@ const state = () => ({
regist: false, regist: false,
}, },
consume: { consume: {
areaInfo: {
areaName: '', areaName: '',
areaId: undefined,
},
consumeAfterVos: [], consumeAfterVos: [],
consumeHardVos: [], consumeHardVos: [],
list: [], list: [],
...@@ -62,7 +65,7 @@ const getters = { ...@@ -62,7 +65,7 @@ const getters = {
registePerMonth: state => state.report.registePerMonth, registePerMonth: state => state.report.registePerMonth,
activeUser: state => state.report.activeUser, activeUser: state => state.report.activeUser,
titleData: state => state.title, titleData: state => state.title,
areaName: state => state.consume.areaName, areaInfo: state => state.consume.areaInfo,
consumeAfterVos: state => state.consume.consumeAfterVos, consumeAfterVos: state => state.consume.consumeAfterVos,
consumeHardVos: state => state.consume.consumeHardVos, consumeHardVos: state => state.consume.consumeHardVos,
campusRankList: state => state.consume.list, campusRankList: state => state.consume.list,
...@@ -90,6 +93,7 @@ const actions = { ...@@ -90,6 +93,7 @@ const actions = {
commit(LOADING_SERVICE, true); commit(LOADING_SERVICE, true);
} else if (data && data.updateEuipmentList) { } else if (data && data.updateEuipmentList) {
entity.serviceId = data.serviceId; entity.serviceId = data.serviceId;
entity.areaId = getters.areaInfo.areaId;
commit(LOADING_EQUIPMENT, true); commit(LOADING_EQUIPMENT, true);
} else { } else {
commit(LOADING_AREA, true); commit(LOADING_AREA, true);
...@@ -137,8 +141,15 @@ const actions = { ...@@ -137,8 +141,15 @@ const actions = {
commit(GET_TITLE_DATA, data); commit(GET_TITLE_DATA, data);
}); });
}, },
updateCampusName({ commit }, name) { updateCampusName({ commit }, data) {
commit(GET_CAMPUS_DATA, name); if (data) {
commit(GET_CAMPUS_DATA, data);
} else {
commit(GET_CAMPUS_DATA, {
areaId: undefined,
areaName: '',
});
}
}, },
}; };
...@@ -196,7 +207,7 @@ const mutations = { ...@@ -196,7 +207,7 @@ const mutations = {
state.title = data; state.title = data;
}, },
[GET_CAMPUS_DATA](state, name) { [GET_CAMPUS_DATA](state, name) {
state.consume.areaName = name; state.consume.areaInfo = name;
}, },
[LOADING_AREA](state, fetching) { [LOADING_AREA](state, fetching) {
state.loading.area = fetching; state.loading.area = fetching;
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
:data="seviceRatioList" :data="seviceRatioList"
:changeServiceHandle="changeServiceHandle" :changeServiceHandle="changeServiceHandle"
/> />
<div class="SeviceRatio-title">{{areaName}}</div> <div class="SeviceRatio-title">{{areaInfo.areaName}}</div>
</div> </div>
</template> </template>
...@@ -25,7 +25,7 @@ export default { ...@@ -25,7 +25,7 @@ export default {
name: 'SeviceRatio', name: 'SeviceRatio',
components: { SeviceRatioChart }, components: { SeviceRatioChart },
computed: { computed: {
...mapGetters('Dashboard', ['seviceRatioList', 'areaName', 'loading']), ...mapGetters('Dashboard', ['seviceRatioList', 'areaInfo', 'loading']),
}, },
methods: { methods: {
...mapActions('Dashboard', ['fetchConsumeList']), ...mapActions('Dashboard', ['fetchConsumeList']),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment