|
@@ -74,6 +74,7 @@
|
|
|
<el-upload
|
|
|
class="upload-demo"
|
|
|
drag
|
|
|
+ :file-list="fileList"
|
|
|
:action="uploadUrl"
|
|
|
:headers="uploadHeaders"
|
|
|
:on-success="uploadFileSuccess"
|
|
@@ -108,6 +109,7 @@
|
|
|
'1':'解析完成'
|
|
|
}
|
|
|
const title = ref('')
|
|
|
+ const fileList = ref([])
|
|
|
const list = ref([])
|
|
|
const show = ref(false)
|
|
|
const buttonLoading = ref(false)
|
|
@@ -128,6 +130,7 @@
|
|
|
})
|
|
|
|
|
|
const uploadFileSuccess = e =>{
|
|
|
+ fileList.value = [e.file];
|
|
|
fileDto.value.fileData = e.data;
|
|
|
proxy?.$modal.msgSuccess('上传成功');
|
|
|
}
|
|
@@ -164,10 +167,18 @@
|
|
|
}
|
|
|
|
|
|
const cancel = () => {
|
|
|
+ fileList.value = [];
|
|
|
+ fileDto.value = {
|
|
|
+ baseId:'',
|
|
|
+ fileData:'',
|
|
|
+ fileFormat:'',
|
|
|
+ fileName:''
|
|
|
+ }
|
|
|
show.value = false;
|
|
|
}
|
|
|
|
|
|
const submitForm = () => {
|
|
|
+ if(!fileDto.value.fileData) return proxy?.$modal.msgError('请上传文件')
|
|
|
buttonLoading.value = true;
|
|
|
addKnowledgeFile(fileDto.value).then((res) => {
|
|
|
if(res.code!==0) return proxy?.$modal.msgError(res.msg);
|