Commit ed162585 by 姜雷

添加获取服务类型时状态字段

parent 1fd5fe7c
......@@ -3,16 +3,24 @@ import store from './store';
export default {
props: {
// null所有/1自助/2三方
// 服务类型:null所有/1自助/2三方
ServiceType: {
type: Number,
default: null,
},
// 服务状态:null所有/1开启/0关闭
ServiceState: {
type: Number,
default: null,
},
},
created() {
store.install(this.$store);
if (!this.serviceTypeLists[this.ServiceType].length) {
this.fetchServiceTypeList(this.ServiceType);
this.fetchServiceTypeList({
serviceType: this.ServiceType,
state: this.ServiceState,
});
}
},
computed: {
......
......@@ -21,11 +21,11 @@ const getters = {
};
const actions = {
fetchServiceTypeList({ state, commit }, serviceType) {
fetchServiceTypeList({ state, commit }, { serviceType, state }) {
if (state.fetching[serviceType]) return;
commit(FETCH_STATE, { value: true, index: serviceType });
return fetchServiceList({
params: { serviceType },
params: { serviceType, state },
}).then(res => {
const { selfService } = res;
commit(SERVICE_TYPE_LIST, { list: selfService, index: serviceType });
......
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