修改上传文件的样式信息

main
于阔 9 months ago
parent 4e73acd1a5
commit fe5d0d1702

@ -10,7 +10,7 @@ import { REPORTING_STATUS_LIST } from '../constants';
const { required } = useValidator()
let fileData = null;
const props = defineProps({
currentRow: {
type: Object as PropType<any>,
@ -37,10 +37,10 @@ const formSchema = reactive<FormSchema[]>([
label: '报告分类',
component: 'Select',
optionApi: async () => {
const res = await getCategory({ paramName: 'reportingType_param', systemCode: 'ordb' });
return transfDictList(res.body.result);
},
value: '1',
const res = await getCategory({ paramName: 'reportingType_param', systemCode: 'ordb' });
return transfDictList(res.body.result);
},
value: '1',
formItemProps: {
rules: [required()],
},
@ -92,43 +92,40 @@ const formSchema = reactive<FormSchema[]>([
field: 'organCode',
label: '报告模版',
component: 'Upload',
colProps: { span: 160 },
colProps: { span: 24 },
componentProps: {
limit: 1,
drag:true,
accept:".doc,.docx",
action: 'https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15',
multiple: true,
onPreview: (uploadFile) => {
console.log(uploadFile)
},
onRemove: (file) => {
console.log(file)
},
action: null,
autoUpload:false,
fileList:[],
beforeRemove: (uploadFile) => {
return ElMessageBox.confirm(`Cancel the transfer of ${uploadFile.name} ?`).then(
return ElMessageBox.confirm(`是否取消上传${uploadFile.name}模板文件 ?`).then(
() => true,
() => false
)
},
onExceed: (files, uploadFiles) => {
ElMessage.warning(
`The limit is 1, you selected ${files.length} files this time, add up to ${
files.length + uploadFiles.length
} 总共`
)
onExceed: () => {
ElMessage.warning("上传模板失败,当前已有模板,只能上传一个模板")
},
slots: {
default: () =><div class="el-upload"><div class="el-upload__text">拖曳报告模版到这里或<em>上传报告模版</em></div></div>,
tip: () => <div class="el-upload__tip">doc,docx文件</div>
default: () =><div class="el-upload"><i class="fa fa-upload cursor-pointer"></i><br/><h1 class="el-upload__text">拖拽报告模版到这里...<br/><em>上传报告模版</em></h1></div>,
tip: () => <div class="el-upload__tip">doc,docx文件</div>,
file:(file)=>{
fileData = file.file.raw;
}
},
style:{
width:"100%",
}
},
}
])
const rules = reactive({
// tStatus:[required()],//
})
const submit = async () => {
@ -138,6 +135,7 @@ const submit = async () => {
})
if (valid) {
const formData = await getFormData()
formData.organCode = fileData;
return formData
}
}

Loading…
Cancel
Save