Sfoglia il codice sorgente

feat: update role selection API to include all roles in fieldPermissions.vue

Yannay 1 settimana fa
parent
commit
0a00ebd66e
2 ha cambiato i file con 5 aggiunte e 1 eliminazioni
  1. 1 1
      pages/wareHouse/components/fieldPermissions.vue
  2. 4 0
      utils/api.js

+ 1 - 1
pages/wareHouse/components/fieldPermissions.vue

@@ -167,7 +167,7 @@ export default {
167 167
 			return FIELD_LABELS[name] || name;
168 168
 		},
169 169
 		fetchRoleList() {
170
-			uni.$u.api.getRoleOptionSelect({ custom: { loading: false } })
170
+			uni.$u.api.getRoleOptionSelectAll({ custom: { loading: false } })
171 171
 				.then((res) => {
172 172
 					const list = (res && res.data) ? (Array.isArray(res.data) ? res.data : []) : [];
173 173
 					this.roleList = list.map((r) => ({ roleId: r.roleId, roleName: r.roleName || r.roleKey || '', roleKey: r.roleKey || '' }));

+ 4 - 0
utils/api.js

@@ -113,6 +113,8 @@ const install = (Vue, vm) => {
113 113
 		getCustomerManagerAllList: () => http.post('/system/user/getCustomerManagerAllList'),
114 114
 		/** 角色下拉列表(系统模块,用于仓库字段权限配置选择角色) */
115 115
 		getRoleOptionSelect: (config = {}) => http.get('/system/role/optionselect', config),
116
+		/** 角色下拉列表(含超级管理员 admin,用于仓库字段/按钮权限配置) */
117
+		getRoleOptionSelectAll: (config = {}) => http.get('/system/role/optionselect/all', config),
116 118
 		getClueSendFormVoByOrderId: (params) => http.get(store.state.user.path + '/clueSendForm/getClueSendFormVoByOrderId?' + qs.stringify(params)),
117 119
 		statisticsSendStatus: (data, config = {}) => http.post(store.state.user.path + '/clueSendForm/statisticsSendStatus', data), // 统计线索阶段
118 120
 
@@ -132,6 +134,8 @@ const install = (Vue, vm) => {
132 134
 		wareHouseDetail:(params)=>http.get(store.state.user.path+'/warehouse/wareHouseDetail',{ params }),//仓库中心-获取仓库详情
133 135
 		/** 仓库字段权限:不传参时按当前登录用户 roles 合并返回 [{ fieldName, read, edit }, ...] */
134 136
 		wareHouseFieldPermissions:(params)=>http.get(store.state.user.path+'/warehouse/fieldPermissions',{ params }),//仓库中心-字段读/编辑权限
137
+		/** 仓库按钮权限:按当前登录用户角色合并返回 [{ buttonKey, enabled }, ...],用于列表/详情页控制编辑、删除按钮 */
138
+		wareHouseButtonPermissions:(params)=>http.get(store.state.user.path+'/warehouse/buttonPermissions',{ params }),
135 139
 		/** 仓库字段权限-配置:按角色查询/保存(管理端) */
136 140
 		wareHouseFieldPermissionsConfigGet:(params)=>http.get(store.state.user.path+'/warehouse/fieldPermissions/config',{ params }),
137 141
 		wareHouseFieldPermissionsConfigSave:(data)=>http.post(store.state.user.path+'/warehouse/fieldPermissions/config', data),