From b6917f19d5f7410d39476984a4a1ea415457a7f7 Mon Sep 17 00:00:00 2001
From: wupengfei <834520024@qq.com>
Date: 星期日, 19 十月 2025 13:53:49 +0800
Subject: [PATCH] feat: 1.2.0.1
---
src/views/DictionaryManage/components/AddOrEditDictionaryDialog.vue | 57 +++++++++++++++++++++++++++++++++++----------------------
1 files changed, 35 insertions(+), 22 deletions(-)
diff --git a/src/views/DictionaryManage/components/AddOrEditDictionaryDialog.vue b/src/views/DictionaryManage/components/AddOrEditDictionaryDialog.vue
index 9784ece..e34bf6a 100644
--- a/src/views/DictionaryManage/components/AddOrEditDictionaryDialog.vue
+++ b/src/views/DictionaryManage/components/AddOrEditDictionaryDialog.vue
@@ -1,22 +1,23 @@
<template>
<ProDialog
- :title="`${title}绫诲埆`"
+ :title="form.title"
v-model="visible"
@close="onDialogClose"
destroy-on-close
draggable
>
- <ProForm :model="form" ref="dialogForm" label-width="90px">
+ <ProForm :model="form" ref="dialogForm" label-width="120px">
<ProFormItemV2
label="琛屼笟绫诲瀷:"
prop="field1"
- v-if="category?.data?.code === '30'"
+ v-if="category?.data?.code === CategoryCode.Position"
:check-rules="[{ message: '璇烽�夋嫨琛屼笟绫诲瀷' }]"
>
<ProFormSelect
v-model="form.field1"
:value-enum="dictionaryDataList"
enum-value-key="code"
+ :convertEnumValue="false"
/>
</ProFormItemV2>
<ProFormItemV2 label="鍚嶇О:" prop="content" :check-rules="[{ message: '璇疯緭鍏ュ悕绉�' }]">
@@ -32,15 +33,38 @@
:controls="false"
:min="0"
:max="999999"
+ :value-on-clear="0"
></ProFormInputNumber>
</ProFormItemV2>
- <ProFormItemV2 label="缂栧彿:" prop="code">
- <ProFormText v-model.trim="form.code"></ProFormText>
+ <ProFormItemV2 label="缂栧彿:" prop="code" :check-rules="[{ message: '璇疯緭鍏ョ紪鍙�' }]">
+ <ProFormText v-model.trim="form.code" :disabled="!!form.id"></ProFormText>
</ProFormItemV2>
- <ProFormItemV2 label="鍥剧墖:" prop="src" v-if="category?.data?.code === '50'">
+ <template v-if="category?.data?.code === CategoryCode.ElectronSignParam">
+ <ProFormItemV2
+ label="鍙傛暟瀛楁鍚�:"
+ prop="field3"
+ :check-rules="[{ message: '璇疯緭鍏ュ弬鏁板瓧娈靛悕' }]"
+ >
+ <ProFormText v-model.trim="form.field3" placeholder="璇疯緭鍏ュ弬鏁板瓧娈靛悕"></ProFormText>
+ </ProFormItemV2>
+ <ProFormItemV2
+ label="缁戝畾瀛楁鍚�:"
+ prop="field4"
+ :check-rules="[{ message: '璇疯緭鍏ョ粦瀹氬瓧娈靛悕' }]"
+ >
+ <ProFormText v-model.trim="form.field4" placeholder="璇疯緭鍏ョ粦瀹氬瓧娈靛悕"></ProFormText>
+ </ProFormItemV2>
+ </template>
+
+ <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>
- <ProFormItemV2 label="鐘舵��:" prop="status">
+ <ProFormItemV2 label="鐘舵��:" prop="isDisabled" required>
<ProFormRadio
v-model="form.isDisabled"
:value-enum="[
@@ -80,6 +104,7 @@
});
type Form = {
+ title?: string;
id?: string;
categoryId: string;
content: string;
@@ -88,34 +113,22 @@
isDisabled: boolean;
field1?: string;
field2?: UploadUserFile[];
+ field3?: string;
+ field4?: string;
};
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