update 上传组件

这个提交包含在:
g7hoo 2022-08-12 16:09:07 +08:00
父节点 00343fa5b9
当前提交 302d1832df
共有 2 个文件被更改,包括 48 次插入4 次删除

查看文件

@ -1,9 +1,50 @@
<template>
<div class="base-upload"></div>
<div class="base-upload" style="border-radius: 8px; margin-top: 38px; padding: 0; max-height: 500px;">
<el-upload class="yd-upload" :action="$http.adornUrl(url)" multiple name="files" :file-list="fileList" :on-remove="handleRemove" :before-remove="beforeRemove">
<el-button size="small" type="primary">{{ buttonContent }}</el-button>
<div v-if="tip" slot="tip" class="el-upload__tip">{{ tip }}</div>
</el-upload>
</div>
</template>
<script>
export default {
name: 'BaseUpload',
props: {
url: String,
buttonContent: String,
tip: {
type: String,
default: null
}
},
data() {
return {
fileList: []
}
},
methods: {
beforeRemove(file, filelist) {
return this.$confirm(`确定移除 ${file.name}?`)
},
handleRemove(file, filelist) {}
}
}
</script>
</script>
<style scoped>
.base-upload >>> .yd-upload {
margin-bottom: 20px;
}
.base-upload >>> .el-upload--text {
width: 100px;
position: relative;
left: -72px;
}
.base-upload >>> .el-upload__tip {
margin-top: 0;
margin-left: 5px;
}
</style>

查看文件

@ -83,8 +83,11 @@ const addOrUpdateConfigs = {
{
name: 'file-upload-key',
label: '上传资料',
component: null,
component: () => import('@/components/base-upload'),
props: { // props
url: "/monitoring/attachment/uploadFileFormData?typeCode=EquipmentTypeFile",
buttonContent: '点击上传',
tip: '上传文件大小不要超过 2mb (2048kb)'
}
}
]