...
|
...
|
@@ -6,16 +6,6 @@ import orderLogistics from './order-logistics'; |
|
|
import orderDeliver from './order-deliver';
|
|
|
import inSaleOrderList from './in-sale-order-list';
|
|
|
|
|
|
const initialState = {
|
|
|
priceChange: priceChange().state,
|
|
|
orderList: orderList().state,
|
|
|
orderConfirm: orderConfirm().state,
|
|
|
orderDetail: orderDetail().state,
|
|
|
logisticsInfo: orderLogistics().state,
|
|
|
orderDeliver: orderDeliver().state,
|
|
|
inSaleOrderList: inSaleOrderList().state,
|
|
|
};
|
|
|
|
|
|
export default function() {
|
|
|
return {
|
|
|
namespaced: true,
|
...
|
...
|
@@ -28,27 +18,5 @@ export default function() { |
|
|
orderDeliver: orderDeliver(),
|
|
|
inSaleOrderList: inSaleOrderList(),
|
|
|
},
|
|
|
state: {
|
|
|
resetFlag: false,
|
|
|
},
|
|
|
mutations: {
|
|
|
/**
|
|
|
* reset module state
|
|
|
* @param {*} state
|
|
|
* @param { Array | String} moduleNames 模块名
|
|
|
*/
|
|
|
reset(state, moduleNames = []) {
|
|
|
if (typeof moduleNames === 'string') {
|
|
|
moduleNames = [moduleNames];
|
|
|
}
|
|
|
console.log('------reset module name------------', moduleNames);
|
|
|
|
|
|
// 修改flag,监听后reload
|
|
|
state.resetFlag = !state.resetFlag;
|
|
|
for (const name of moduleNames) {
|
|
|
Object.assign(state[name], initialState[name]);
|
|
|
}
|
|
|
},
|
|
|
},
|
|
|
};
|
|
|
} |
...
|
...
|
|