|
|
|
@ -1,9 +1,10 @@
|
|
|
|
|
import * as api from '@/api/system/user.js';
|
|
|
|
|
import { ElMessage, ElMessageBox } from '@/plugins/element-plus';
|
|
|
|
|
const state = () => ({
|
|
|
|
|
code: 'UserManagement',
|
|
|
|
|
condition: {},
|
|
|
|
|
list: [],
|
|
|
|
|
total: 0,
|
|
|
|
|
page: { pageIndex: 1, length: 10 },
|
|
|
|
|
opts: {
|
|
|
|
|
init: false,
|
|
|
|
|
sex: [],
|
|
|
|
@ -11,13 +12,15 @@ const state = () => ({
|
|
|
|
|
});
|
|
|
|
|
const getters = {};
|
|
|
|
|
const mutations = {
|
|
|
|
|
setCode: (state, data) => (state.code = data),
|
|
|
|
|
setCondition: (state, data) => (state.condition = data),
|
|
|
|
|
setList: (state, data) => (state.list = data),
|
|
|
|
|
setTotal: (state, data) => (state.total = data),
|
|
|
|
|
setOpts: (state, data) => (state.opts = data),
|
|
|
|
|
};
|
|
|
|
|
const actions = {
|
|
|
|
|
search: async ({ state, commit }, data = {}) => {
|
|
|
|
|
let res = await api.findUserList({ ...state.page, ...data });
|
|
|
|
|
search: async ({ state, commit, rootGetters }) => {
|
|
|
|
|
let res = await api.findUserList({ ...rootGetters['local/page'](state.code), ...state.condition });
|
|
|
|
|
if (res) {
|
|
|
|
|
commit('setList', res.content);
|
|
|
|
|
commit('setTotal', res.totalElements);
|
|
|
|
|