From a4978ef36ce6dc9c6723b61b20fd27cffd907ad9 Mon Sep 17 00:00:00 2001 From: wupengfei <834520024@qq.com> Date: 星期五, 08 八月 2025 14:56:05 +0800 Subject: [PATCH] feat: 任务 --- src/views/DictionaryManage/components/AddOrEditDictionaryDialog.vue | 23 ++++++----------------- 1 files changed, 6 insertions(+), 17 deletions(-) diff --git a/src/views/DictionaryManage/components/AddOrEditDictionaryDialog.vue b/src/views/DictionaryManage/components/AddOrEditDictionaryDialog.vue index 59d0336..e4f873e 100644 --- a/src/views/DictionaryManage/components/AddOrEditDictionaryDialog.vue +++ b/src/views/DictionaryManage/components/AddOrEditDictionaryDialog.vue @@ -1,6 +1,6 @@ <template> <ProDialog - :title="`${title}瀛楀吀`" + :title="form.title" v-model="visible" @close="onDialogClose" destroy-on-close @@ -33,15 +33,17 @@ :controls="false" :min="0" :max="999999" + :value-on-clear="0" ></ProFormInputNumber> </ProFormItemV2> <ProFormItemV2 label="缂栧彿:" prop="code" :check-rules="[{ message: '璇疯緭鍏ョ紪鍙�' }]"> - <ProFormText v-model.trim="form.code"></ProFormText> + <ProFormText v-model.trim="form.code" :disabled="!!form.id"></ProFormText> </ProFormItemV2> <ProFormItemV2 label="鍥剧墖:" prop="field2" v-if="category?.data?.code === CategoryCode.Welfare" + :check-rules="[{ type: 'upload', message: '璇蜂笂浼犲浘鐗�' }]" > <ProFormImageUpload v-model:file-url="form.field2" :limitFileCount="1"></ProFormImageUpload> </ProFormItemV2> @@ -85,6 +87,7 @@ }); type Form = { + title?: string; id?: string; categoryId: string; content: string; @@ -98,29 +101,15 @@ const form = defineModel<Form>('form'); const visible = defineModel<boolean>('modelValue'); -const title = computed(() => (form.value.id ? '缂栬緫' : '鏂板')); - const { getDictionaryCategoryById } = useGetDictionaryCategorySelect(); -const { dictionaryDataList, refetch, getDictionaryDataNameById } = useDictionaryDataSelect({ +const { dictionaryDataList } = useDictionaryDataSelect({ categoryCode: computed(() => CategoryCode.IndustryCategory), }); const category = computed(() => { return getDictionaryCategoryById(form.value.categoryId); }); - -watch( - () => visible.value, - (value) => { - if (value) { - refetch(); - } - }, - { - immediate: true, - } -); const emit = defineEmits<{ (e: 'onConfirm'): void; -- Gitblit v1.9.1