整合通讯录组件渲染
This commit is contained in:
@@ -2,56 +2,28 @@ import Vue from 'vue'
|
||||
import Vuex from 'vuex'
|
||||
import preState from 'vuex-persistedstate'
|
||||
import request from '../router/axios'
|
||||
import * as modules from "dvcp-ui/lib/js/modules"
|
||||
|
||||
Vue.use(Vuex)
|
||||
|
||||
const user = {
|
||||
state: {
|
||||
info: {},
|
||||
token: '',
|
||||
financeUser: {}
|
||||
},
|
||||
mutations: {
|
||||
setFinanceUser(state) {
|
||||
request.post("appfinancialorganizationuser/checkUser").then(res => {
|
||||
state.financeUser = res.data
|
||||
})
|
||||
},
|
||||
setUserInfo(state, userInfo) {
|
||||
state.info = userInfo
|
||||
},
|
||||
setToken(state, token) {
|
||||
state.token = token
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default new Vuex.Store({
|
||||
state: {
|
||||
dicts: [],
|
||||
apps: []
|
||||
},
|
||||
mutations: {
|
||||
setDicts(state, payload) {
|
||||
if (payload) {
|
||||
payload.map(p => {
|
||||
if (state.dicts.some(d => d.key == p.key)) {
|
||||
const index = state.dicts.findIndex(d => d.key == p.key)
|
||||
state.dicts.splice(index, 1)
|
||||
state.dicts.push(p)
|
||||
} else {
|
||||
state.dicts.push(p)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
addApp(state, app) {
|
||||
state.apps.push(app)
|
||||
},
|
||||
cleanApps(state) {
|
||||
state.apps = []
|
||||
}
|
||||
},
|
||||
setFinanceUser(state) {
|
||||
request.post("appfinancialorganizationuser/checkUser").then(res => {
|
||||
state.user.financeUser = res.data
|
||||
})
|
||||
},
|
||||
},
|
||||
modules: {user},
|
||||
modules,
|
||||
plugins: [preState()]
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user