Commit a15a203b by 姜雷

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

parent c47641bb
......@@ -35,7 +35,7 @@
:changeCampusHandle="changeCampusHandle"
:updateCampusName="updateCampusName"
/>
<div class="SeviceRatio-title">{{areaName}}</div>
<div class="SeviceRatio-title">{{areaInfo.areaName}}</div>
</div>
</template>
......@@ -50,7 +50,7 @@ export default {
...mapGetters('Dashboard', [
'campusRankList',
'filters',
'areaName',
'areaInfo',
'loading',
]),
},
......@@ -69,7 +69,7 @@ export default {
areaId: data.areaId,
updatePercentList: true,
}).then(() => {
this.updateCampusName(data.areaName);
this.updateCampusName(data);
});
},
},
......
......@@ -101,7 +101,7 @@ export default {
this.chartGeom.setSelected(this.data[0]);
this.changeSelected(this.data[0]);
this.updateCampusName(this.data[0].areaName);
this.updateCampusName(this.data[0]);
this.SelectedDataIndex = this.data[0];
} else {
this.updateCampusName();
......
......@@ -35,7 +35,10 @@ const state = () => ({
regist: false,
},
consume: {
areaName: '',
areaInfo: {
areaName: '',
areaId: undefined,
},
consumeAfterVos: [],
consumeHardVos: [],
list: [],
......@@ -62,7 +65,7 @@ const getters = {
registePerMonth: state => state.report.registePerMonth,
activeUser: state => state.report.activeUser,
titleData: state => state.title,
areaName: state => state.consume.areaName,
areaInfo: state => state.consume.areaInfo,
consumeAfterVos: state => state.consume.consumeAfterVos,
consumeHardVos: state => state.consume.consumeHardVos,
campusRankList: state => state.consume.list,
......@@ -90,6 +93,7 @@ const actions = {
commit(LOADING_SERVICE, true);
} else if (data && data.updateEuipmentList) {
entity.serviceId = data.serviceId;
entity.areaId = getters.areaInfo.areaId;
commit(LOADING_EQUIPMENT, true);
} else {
commit(LOADING_AREA, true);
......@@ -137,8 +141,15 @@ const actions = {
commit(GET_TITLE_DATA, data);
});
},
updateCampusName({ commit }, name) {
commit(GET_CAMPUS_DATA, name);
updateCampusName({ commit }, data) {
if (data) {
commit(GET_CAMPUS_DATA, data);
} else {
commit(GET_CAMPUS_DATA, {
areaId: undefined,
areaName: '',
});
}
},
};
......@@ -196,7 +207,7 @@ const mutations = {
state.title = data;
},
[GET_CAMPUS_DATA](state, name) {
state.consume.areaName = name;
state.consume.areaInfo = name;
},
[LOADING_AREA](state, fetching) {
state.loading.area = fetching;
......
......@@ -14,7 +14,7 @@
:data="seviceRatioList"
:changeServiceHandle="changeServiceHandle"
/>
<div class="SeviceRatio-title">{{areaName}}</div>
<div class="SeviceRatio-title">{{areaInfo.areaName}}</div>
</div>
</template>
......@@ -25,7 +25,7 @@ export default {
name: 'SeviceRatio',
components: { SeviceRatioChart },
computed: {
...mapGetters('Dashboard', ['seviceRatioList', 'areaName', 'loading']),
...mapGetters('Dashboard', ['seviceRatioList', 'areaInfo', 'loading']),
},
methods: {
...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