修复: 用户管理编辑弹窗角色不回显——下拉value统一转字符串与roleIds对齐
CI/CD Deploy (Web) / 构建前端镜像并部署 (push) Successful in 37s

This commit is contained in:
张家训
2026-10-20 18:57:22 +08:00
parent fd18675883
commit 030c239bda
+3
View File
@@ -312,6 +312,9 @@ export default {
// 加载角色下拉列表
getRoleSelectList().then(res => {
let roleSelectList = res.data.data || []
// value 统一转字符串:列表接口的 roleIds 是 "1,2" 字符串 split 而来,
// iview Select 严格相等匹配,数字与字符串对不上会导致编辑不回显
roleSelectList = roleSelectList.map(item => ({ value: String(item.value), label: item.label }))
this.roleSelectList = roleSelectList
this.isDefaultRoleId = roleSelectList.length > 0 ? [roleSelectList[0].value] : []
this.formItem.roleIds = this.isDefaultRoleId