pull/243/head
xiaojunnuo 2024-11-08 17:47:09 +08:00
parent 19294db942
commit e8b571590e
1 changed files with 13 additions and 4 deletions

View File

@ -126,7 +126,13 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
component: {
onDictChange: ({ form, dict }: any) => {
if (!form.cnameProviderId) {
const item = dict.data.find((item: any) => item.isDefault && !item.disabled);
const list = dict.data.filter((item) => {
return !item.disabled;
});
let item = list.find((item: any) => item.isDefault);
if (!item && list.length > 0) {
item = list[0];
}
if (item) {
form.cnameProviderId = item.id;
}
@ -146,9 +152,12 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
crudExpose.getFormWrapperRef().close();
};
return (
<router-link to={"/sys/cname/provider"} onClick={closeForm}>
CNAME
</router-link>
<div>
CNAME
<router-link to={"/sys/cname/provider"} onClick={closeForm}>
CNAME
</router-link>
</div>
);
}
}