From dab5ba623c2cc98d6da1b2157a89c4574eec0e4e Mon Sep 17 00:00:00 2001 From: chenxf Date: Tue, 6 Jan 2026 16:19:27 +0800 Subject: [PATCH] =?UTF-8?q?feat(store):=20=E6=B7=BB=E5=8A=A0=E7=BB=84?= =?UTF-8?q?=E7=BB=87ID=E5=92=8C=E7=94=A8=E6=88=B7=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E7=9B=B8=E5=85=B3getter=E5=92=8Cstate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加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 --- src/store/getters.js | 1 + src/store/modules/user.js | 7 ++++++- src/views/forceNotice/force/list.vue | 5 ++++- src/views/forceNotice/inclusion/list.vue | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/store/getters.js b/src/store/getters.js index 34ffa22..fe3ed06 100644 --- a/src/store/getters.js +++ b/src/store/getters.js @@ -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 diff --git a/src/store/modules/user.js b/src/store/modules/user.js index 38c3c16..0ac1ec7 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -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) diff --git a/src/views/forceNotice/force/list.vue b/src/views/forceNotice/force/list.vue index 9812797..525e820 100644 --- a/src/views/forceNotice/force/list.vue +++ b/src/views/forceNotice/force/list.vue @@ -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' diff --git a/src/views/forceNotice/inclusion/list.vue b/src/views/forceNotice/inclusion/list.vue index 51c1e42..31bacf3 100644 --- a/src/views/forceNotice/inclusion/list.vue +++ b/src/views/forceNotice/inclusion/list.vue @@ -197,7 +197,7 @@ export default { { type: 'input', label: '主体名称', - prop: 'entname', + prop: 'entName', span: 6, tableProps: { width: '200px',