Commit ba9d0af5499afc8140204cc1160e3d4538a4c7ca
1 parent
0de4491c
fix: 客户角色和平台租户角色可以在编辑界面自由禁用(演示图为客户角色
Showing
1 changed file
with
14 additions
and
1 deletions
... | ... | @@ -61,7 +61,7 @@ |
61 | 61 | const spinning = ref(false); |
62 | 62 | const checkedKeysWithHalfChecked = ref<string[]>([]); |
63 | 63 | |
64 | - const [registerForm, { resetFields, setFieldsValue, validate }] = useForm({ | |
64 | + const [registerForm, { resetFields, setFieldsValue, validate, updateSchema }] = useForm({ | |
65 | 65 | labelWidth: 100, |
66 | 66 | schemas: formSchema, |
67 | 67 | showActionButtonGroup: false, |
... | ... | @@ -80,6 +80,19 @@ |
80 | 80 | const { isTenantAdmin, isSysadmin, getRole } = useRole(); |
81 | 81 | const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner( |
82 | 82 | async (data: { isUpdate: boolean; record: RoleListItem }) => { |
83 | + if (data?.record) { | |
84 | + updateSchema({ | |
85 | + field: 'status', | |
86 | + componentProps: { | |
87 | + options: [ | |
88 | + { label: '启用', value: 1 }, | |
89 | + { label: '停用', value: 0 }, | |
90 | + ], | |
91 | + disabled: data.record.status == 1 ? true : false, | |
92 | + }, | |
93 | + }); | |
94 | + } | |
95 | + | |
83 | 96 | resetFields(); |
84 | 97 | roleId.value = ''; |
85 | 98 | // 在打开弹窗时清除所有选择的菜单 | ... | ... |