mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
chore: 重构字典封装(还有问题)
This commit is contained in:
@ -40,6 +40,10 @@ const visible = defineModel<boolean>('visible', {
|
||||
default: false
|
||||
});
|
||||
|
||||
const { getDictOptions } = useDict();
|
||||
const showHideOptions = getDictOptions('sys_show_hide');
|
||||
const enableStatusOptions = getDictOptions('sys_normal_disable');
|
||||
|
||||
const iconType = ref<Api.System.IconType>('1');
|
||||
const { formRef, validate, restoreValidation } = useNaiveForm();
|
||||
const { defaultRequiredRule } = useFormRules();
|
||||
@ -217,7 +221,6 @@ watch(visible, () => {
|
||||
if (visible.value) {
|
||||
handleInitModel();
|
||||
restoreValidation();
|
||||
initDictData();
|
||||
}
|
||||
});
|
||||
|
||||
@ -251,16 +254,6 @@ const FormTipComponent = defineComponent({
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
const enableStatusOptions = ref<CommonType.Option[]>([]);
|
||||
const showHideOptions = ref<CommonType.Option[]>([]);
|
||||
|
||||
async function initDictData() {
|
||||
const { getDictOptions } = useDict();
|
||||
const { sys_show_hide, sys_normal_disable } = await getDictOptions('sys_show_hide', 'sys_normal_disable');
|
||||
enableStatusOptions.value = sys_normal_disable;
|
||||
showHideOptions.value = sys_show_hide;
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
Reference in New Issue
Block a user