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:
chenxf 2026-01-06 16:19:27 +08:00
parent d0a629570e
commit dab5ba623c
4 changed files with 12 additions and 3 deletions

View File

@ -5,6 +5,7 @@ const getters = {
name: state => state.user.name, name: state => state.user.name,
roles: state => state.user.roles, roles: state => state.user.roles,
userId: state => state.user.userId, userId: state => state.user.userId,
orgId: state => state.user.userInfo?.orgId,
permission_routes: state => state.permission.routes permission_routes: state => state.permission.routes
} }
export default getters export default getters

View File

@ -6,7 +6,8 @@ const state = {
name: '', name: '',
avatar: '', avatar: '',
roles: [], roles: [],
userId: '' userId: '',
userInfo: {}
} }
const mutations = { const mutations = {
@ -21,6 +22,9 @@ const mutations = {
}, },
SET_USERId: (state, userId) => { SET_USERId: (state, userId) => {
state.userId = userId state.userId = userId
},
SET_USERINFO: (state, userInfo) => {
state.userInfo = userInfo
} }
} }
@ -67,6 +71,7 @@ const actions = {
commit('SET_NAME', nickname) commit('SET_NAME', nickname)
commit('SET_AVATAR', avatar) commit('SET_AVATAR', avatar)
commit('SET_USERId', primaryKey) commit('SET_USERId', primaryKey)
commit('SET_USERINFO', data)
resolve(data) resolve(data)
}).catch(error => { }).catch(error => {
reject(error) reject(error)

View File

@ -152,7 +152,10 @@ export default {
span: 6, span: 6,
tableProps: { tableProps: {
width: '200px', width: '200px',
showOverflowTooltip: true showOverflowTooltip: true,
formatter: (row, column, cellValue, index) => {
return `${row.busName || row.entName}`
}
}, },
showInTable: () => { showInTable: () => {
return this.type === 'history' return this.type === 'history'

View File

@ -197,7 +197,7 @@ export default {
{ {
type: 'input', type: 'input',
label: '主体名称', label: '主体名称',
prop: 'entname', prop: 'entName',
span: 6, span: 6,
tableProps: { tableProps: {
width: '200px', width: '200px',