feat(ui): add userPanel component

This commit is contained in:
songlh
2024-10-22 13:59:38 +08:00
parent 00ceee3408
commit e6be756e42
9 changed files with 547 additions and 47 deletions

View File

@@ -0,0 +1,11 @@
const company = {
state: {
name: undefined
},
mutations: {
SET_COMPANY_NAME: (state, name) => {
state.name = name
},
},
}
export default company

View File

@@ -46,7 +46,8 @@ const user = {
sex: '',
position_name: '',
direct_supervisor_id: null,
auth_enable: {}
auth_enable: {},
notice_info: {}
},
mutations: {
@@ -54,7 +55,7 @@ const user = {
state.token = token
},
SET_USER_INFO: (state, { name, welcome, avatar, roles, info, uid, rid, username, mobile, department_id, employee_id, email, nickname, sex, position_name, direct_supervisor_id, annual_leave }) => {
SET_USER_INFO: (state, { name, welcome, avatar, roles, info, uid, rid, username, mobile, department_id, employee_id, email, nickname, sex, position_name, direct_supervisor_id, annual_leave, notice_info }) => {
state.name = name
state.welcome = welcome
state.avatar = avatar
@@ -73,6 +74,7 @@ const user = {
state.position_name = position_name
state.direct_supervisor_id = direct_supervisor_id
state.annual_leave = annual_leave
state.notice_info = notice_info
},
LOAD_ALL_USERS: (state, users) => {
@@ -160,7 +162,8 @@ const user = {
sex: res.sex,
position_name: res.position_name,
direct_supervisor_id: res.direct_supervisor_id,
annual_leave: res.annual_leave
annual_leave: res.annual_leave,
notice_info: res.notice_info
})
})
}).catch(error => {

View File

@@ -7,6 +7,7 @@ import user from './global/user'
import routes from './global/routes'
import notice from './global/notice'
import getters from './global/getters'
import company from './global/company'
import appConfig from '@/config/app'
Vue.use(Vuex)
@@ -16,7 +17,8 @@ const store = new Vuex.Store({
app,
user,
routes,
notice
notice,
company
},
state: {
windowWidth: 800,