修改资源管理的上传数据校验
This commit is contained in:
parent
e697f76529
commit
3b2bc2cc2e
|
|
@ -6,12 +6,12 @@
|
|||
<a-row>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="资源类型" v-bind="validateInfos.resourcesType" id="NuResourcesManagementForm-resourcesType" name="resourcesType">
|
||||
<j-dict-select-tag v-model:value="formData.resourcesType" dictCode="resources_type" placeholder="请选择类型" allow-clear />
|
||||
<j-dict-select-tag v-model:value="formData.resourcesType" dictCode="resources_type" placeholder="请选择类型" @change="changeFileType" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="附件类型" v-bind="validateInfos.fileType" id="NuResourcesManagementForm-fileType" name="fileType">
|
||||
<j-dict-select-tag v-model:value="formData.fileType" dictCode="file_type" placeholder="请选择附件类型" allow-clear />
|
||||
<j-dict-select-tag v-model:value="formData.fileType" dictCode="file_type" placeholder="请选择附件类型" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
|
|
@ -20,12 +20,12 @@
|
|||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" v-if="formData.fileType == 'image'">
|
||||
<a-form-item label="附件" v-bind="validateInfos.filePath" id="NuResourcesManagementForm-filePath" name="filePath">
|
||||
<a-form-item label="默认图标" v-bind="validateInfos.filePath" id="NuResourcesManagementForm-filePath" name="filePath">
|
||||
<j-image-upload :fileMax="1" v-model:value="formData.filePath" ></j-image-upload>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" v-if="formData.fileType == 'image'">
|
||||
<a-form-item label="选中图片" v-bind="validateInfos.checkPicPath" id="NuResourcesManagementForm-checkPicPath" name="checkPicPath">
|
||||
<a-form-item label="焦点图标" v-bind="validateInfos.checkPicPath" id="NuResourcesManagementForm-checkPicPath" name="checkPicPath">
|
||||
<j-image-upload :fileMax="1" v-model:value="formData.checkPicPath" ></j-image-upload>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
|
@ -94,6 +94,11 @@ import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue
|
|||
fileType: [{ required: true, message: '请选择附件类型' }],
|
||||
name: [{ required: true, message: '请输入名称' }],
|
||||
filePath: [{ required: true, message: '请上传附件' }],
|
||||
checkPicPath:computed(() =>
|
||||
formData.resourcesType == '1' && formData.fileType == 'image'
|
||||
? [{ required: true, message: '请上传附件' }]
|
||||
: []
|
||||
)
|
||||
});
|
||||
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
|
||||
|
||||
|
|
@ -109,6 +114,13 @@ import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue
|
|||
return props.formDisabled;
|
||||
});
|
||||
|
||||
function changeFileType(value) {
|
||||
console.log("🚀 ~ changeFileType ~ value:", value)
|
||||
if(value == '1'){
|
||||
formData.fileType = 'image';
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
|
|
|
|||
Loading…
Reference in New Issue