|  |  |  | 
|---|
|  |  |  | <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: '请输入名称' }]"> | 
|---|
|  |  |  | 
|---|
|  |  |  | :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="[ | 
|---|
|  |  |  | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | type Form = { | 
|---|
|  |  |  | title?: string; | 
|---|
|  |  |  | id?: string; | 
|---|
|  |  |  | categoryId: string; | 
|---|
|  |  |  | content: string; | 
|---|
|  |  |  | 
|---|
|  |  |  | 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; | 
|---|