update: 编辑人员页面 手机号字段置灰 不可更改

This commit is contained in:
admin 2024-07-18 17:25:55 +08:00
parent 98c4ab41ba
commit 1e6937966b
1 changed files with 7 additions and 2 deletions

View File

@ -49,7 +49,7 @@
border="none"
:maxlength="item.key === 'password' ? 8 : -1"
@change="(e:any) => {handleInput(e, item)}"
:disabled="item.type === 'select'"
:disabled="item.type === 'select' || isEditPhone(item)"
:disabledColor="
['性别', '用户角色'].indexOf(item.name) > -1 ? '#ffffff' : '#f5f7fa'
"
@ -100,6 +100,12 @@ const handleInput = (e: any, item: any) => {
}, 10);
}
};
const isEditPhone = (item:any) => {
if (model1.formData.id && item.key === 'phone') {
return true
}
}
const model1 = reactive<any>({
formData: {
gender: 1
@ -272,7 +278,6 @@ onLoad((option: any) => {
if (option.item) {
const obj = JSON.parse(option.item);
model1.formData = { ...obj, genderName: ["未知", "男", "女"][obj.gender] };
debugger
if (obj.roleVos.length > 0) {
model1.formData.roleIds = [obj.roleVos[0].id];
model1.formData.roleName = obj.roleVos[0].roleName;