| | |
| | | class="upload-file-uploader" |
| | | ref="fileUploadRef" |
| | | :auto-upload="false" |
| | | :on-exceed="handleExceed" |
| | | > |
| | | <!-- 上传按钮 --> |
| | | <el-button type="primary">选取文件</el-button> |
| | |
| | | const props = defineProps({ |
| | | modelValue: [String, Object, Array], |
| | | // 数量限制 |
| | | limit: propTypes.number.def(10), |
| | | limit: propTypes.number.def(1), |
| | | // 大小限制(MB) |
| | | fileSize: propTypes.number.def(5), |
| | | fileSize: propTypes.number.def(200), |
| | | // 文件类型, 例如['png', 'jpg', 'jpeg'] |
| | | fileType: propTypes.array.def(["doc","docx","xlsx", "xls", "ppt", "txt", "pdf"]), |
| | | // 是否显示提示 |
| | |
| | | // 上传成功回调 |
| | | const handleUploadSuccess = (res: any, file: UploadFile) => { |
| | | if (res.code === 200) { |
| | | emit('closePopup') |
| | | console.log('调用父组件'); |
| | | emit('closePopup',res.data) |
| | | |
| | | console.log('调用父组件',res); |
| | | fileUploadRef.value!.clearFiles() |
| | | downloadLoadingInstance.close(); |
| | | uploadList.value.push({ name: res.data.fileName, url: res.data.url, ossId: res.data.ossId }); |