zhengyiming
2 天以前 97334831995a7a442af237dd44eaf3fc7edc120b
src/views/DictionaryManage/components/AddOrEditDictionaryDialog.vue
@@ -20,6 +20,51 @@
          :convertEnumValue="false"
        />
      </ProFormItemV2>
      <ProFormItemV2
        label="保险通道:"
        prop="field1"
        v-if="category?.data?.code === CategoryCode.InsuranceCompany"
        :check-rules="[{ message: '请选择保险通道' }]"
      >
        <ProFormSelect
          v-model="form.field1"
          :value-enum="EnumInsuranceSupplierAccessText"
          :convertEnumValue="false"
        />
      </ProFormItemV2>
      <template
        v-if="
          category?.data?.code === CategoryCode.InsuranceType ||
          category?.data?.code === CategoryCode.SumInsured ||
          category?.data?.code === CategoryCode.InsureWay ||
          category?.data?.code === CategoryCode.JobCategory ||
          category?.data?.code === CategoryCode.InsuranceVersion
        "
      >
        <ProFormItemV2
          label="保险公司:"
          prop="field1"
          :check-rules="[{ message: '请选择保险公司' }]"
        >
          <ProFormSelect
            v-model="form.field1"
            :value-enum="insuranceCompanyList"
            enum-value-key="code"
            :convertEnumValue="false"
          />
        </ProFormItemV2>
        <ProFormItemV2 label="代码:" prop="field4" :check-rules="[{ message: '请输入代码' }]">
          <ProFormText placeholder="请输入代码" v-model="form.field4"></ProFormText>
        </ProFormItemV2>
        <ProFormItemV2 label="保险险种:" prop="field3">
          <ProFormSelect
            v-model="form.field3"
            :value-enum="insuranceTypeList"
            enum-value-key="code"
            :convertEnumValue="false"
          />
        </ProFormItemV2>
      </template>
      <ProFormItemV2 label="名称:" prop="content" :check-rules="[{ message: '请输入名称' }]">
        <ProFormText
          placeholder="请输入名称"
@@ -39,14 +84,23 @@
      <ProFormItemV2 label="编号:" prop="code" :check-rules="[{ message: '请输入编号' }]">
        <ProFormText v-model.trim="form.code" :disabled="!!form.id"></ProFormText>
      </ProFormItemV2>
      <ProFormItemV2
        label="参数字段名:"
        prop="field3"
        :check-rules="[{ message: '请输入参数字段名' }]"
        v-if="category?.data?.code === CategoryCode.ElectronSignParam"
      >
        <ProFormText v-model.trim="form.field3"></ProFormText>
      </ProFormItemV2>
      <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"
@@ -88,7 +142,7 @@
  ProFormImageUpload,
} from '@bole-core/components';
import { useDictionaryDataSelect, useGetDictionaryCategorySelect } from '@/hooks';
import { CategoryCode } from '@/constants';
import { CategoryCode, EnumInsuranceSupplierAccessText } from '@/constants';
defineOptions({
  name: 'AddOrEditDictionaryDialog',
@@ -105,6 +159,7 @@
  field1?: string;
  field2?: UploadUserFile[];
  field3?: string;
  field4?: string;
};
const form = defineModel<Form>('form');
@@ -116,6 +171,14 @@
  categoryCode: computed(() => CategoryCode.IndustryCategory),
});
const { dictionaryDataList: insuranceCompanyList } = useDictionaryDataSelect({
  categoryCode: computed(() => CategoryCode.InsuranceCompany),
});
const { dictionaryDataList: insuranceTypeList } = useDictionaryDataSelect({
  categoryCode: computed(() => CategoryCode.InsuranceType),
});
const category = computed(() => {
  return getDictionaryCategoryById(form.value.categoryId);
});