mirror of
http://112.124.100.131/ebiz-ai/ebiz-ai-knowledge-manage.git
synced 2025-12-16 14:26:50 +08:00
feat(knowledge): 文件上传组件添加提示
- 重构文件上传成功后的显示界面,使用 el-result组件展示上传成功信息 - 添加重新上传按钮 - 优化上传文件的样式和交互
This commit is contained in:
@@ -14,13 +14,23 @@
|
||||
<!-- 文件上传-->
|
||||
<el-form-item label="" required prop="file">
|
||||
<div @click="createFiled" class="upload-demo">
|
||||
<el-empty v-if="!uploadLoading">
|
||||
<el-empty v-if="!filed">
|
||||
<template #description>
|
||||
<p>点击或将文件拖拽到这里上传</p>
|
||||
<p>支持扩展名:.xlsx .doc .docx .pdf .txt...</p>
|
||||
</template>
|
||||
</el-empty>
|
||||
<div v-else v-loading="uploadLoading" :element-loading-text="'文件上传中...'" style="height: 100%"></div>
|
||||
<el-result
|
||||
v-else
|
||||
icon="success"
|
||||
title="文件上传成功"
|
||||
:sub-title="`已上传文件:${filed.name}`"
|
||||
style="height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center;"
|
||||
>
|
||||
<template slot="extra">
|
||||
<el-button type="primary" size="medium" @click.stop="createFiled">重新上传</el-button>
|
||||
</template>
|
||||
</el-result>
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
||||
@@ -101,6 +111,7 @@ export default {
|
||||
input.onchange = e => {
|
||||
// this.$emit('getFile', e.target.files[0])
|
||||
this.filed = e.target.files[0]
|
||||
console.log(this.filed.name)
|
||||
}
|
||||
input.click()
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user