feat(store): 添加组织ID和用户信息相关getter和state
- 添加orgId getter用于获取用户组织ID信息 - 在user module中添加userInfo state - 新增SET_USERINFO mutation用于设置用户信息 feat(table): 优化强制通知列表表格显示 - 在force/list.vue中为表格列添加formatter格式化函数 - 统一显示busName或entName字段内容 fix(form): 修正包含列表中的字段名 - 将inclusion/list.vue中的字段名从entname修正为entName
This commit is contained in:
parent
d0a629570e
commit
dab5ba623c
|
|
@ -5,6 +5,7 @@ const getters = {
|
|||
name: state => state.user.name,
|
||||
roles: state => state.user.roles,
|
||||
userId: state => state.user.userId,
|
||||
orgId: state => state.user.userInfo?.orgId,
|
||||
permission_routes: state => state.permission.routes
|
||||
}
|
||||
export default getters
|
||||
|
|
|
|||
|
|
@ -6,7 +6,8 @@ const state = {
|
|||
name: '',
|
||||
avatar: '',
|
||||
roles: [],
|
||||
userId: ''
|
||||
userId: '',
|
||||
userInfo: {}
|
||||
}
|
||||
|
||||
const mutations = {
|
||||
|
|
@ -21,6 +22,9 @@ const mutations = {
|
|||
},
|
||||
SET_USERId: (state, userId) => {
|
||||
state.userId = userId
|
||||
},
|
||||
SET_USERINFO: (state, userInfo) => {
|
||||
state.userInfo = userInfo
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -67,6 +71,7 @@ const actions = {
|
|||
commit('SET_NAME', nickname)
|
||||
commit('SET_AVATAR', avatar)
|
||||
commit('SET_USERId', primaryKey)
|
||||
commit('SET_USERINFO', data)
|
||||
resolve(data)
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
|
|
|
|||
|
|
@ -152,7 +152,10 @@ export default {
|
|||
span: 6,
|
||||
tableProps: {
|
||||
width: '200px',
|
||||
showOverflowTooltip: true
|
||||
showOverflowTooltip: true,
|
||||
formatter: (row, column, cellValue, index) => {
|
||||
return `${row.busName || row.entName}`
|
||||
}
|
||||
},
|
||||
showInTable: () => {
|
||||
return this.type === 'history'
|
||||
|
|
|
|||
|
|
@ -197,7 +197,7 @@ export default {
|
|||
{
|
||||
type: 'input',
|
||||
label: '主体名称',
|
||||
prop: 'entname',
|
||||
prop: 'entName',
|
||||
span: 6,
|
||||
tableProps: {
|
||||
width: '200px',
|
||||
|
|
|
|||
Loading…
Reference in New Issue