|
@@ -63,7 +63,7 @@
|
|
|
<div class="upload-row">
|
|
|
<el-upload
|
|
|
style="display: inline-block; margin-right: 8px"
|
|
|
- accept=".pptx,.pdf"
|
|
|
+ accept=".pptx,.pdf,.docx,.doc"
|
|
|
action=""
|
|
|
:http-request="handleUpload"
|
|
|
:before-upload="handleBeforeUpload"
|
|
@@ -71,7 +71,7 @@
|
|
|
:disabled="startUploadAudio">
|
|
|
<img src="~@/assets/img/icons/ai-upload.png" />
|
|
|
</el-upload>
|
|
|
- <span>支持格式:PDF、PPTX;大小不超过50MB</span>
|
|
|
+ <span>支持格式:PDF、PPTX、DOC、DOCX;大小不超过50MB</span>
|
|
|
</div>
|
|
|
<textarea rows="6" v-model="inputText" placeholder="请输入提问,Shift+Enter换行" @keydown.enter="handleSendMsg"></textarea>
|
|
|
<div class="send-btn" @click="handleSendMsg"><img src="~@/assets/img/ai_m/send.png" />发送</div>
|
|
@@ -131,7 +131,8 @@ export default {
|
|
|
companyName:'',
|
|
|
aiFileIds:[],
|
|
|
// 上传窗口的队列
|
|
|
- windowSet:new Set()
|
|
|
+ windowSet:new Set(),
|
|
|
+ fileTypeRule:new RegExp(/\.pdf|\.pptx|\.doc(x)?$/,'i')
|
|
|
};
|
|
|
},
|
|
|
watch:{
|
|
@@ -453,14 +454,14 @@ export default {
|
|
|
return this.$message.error("单次只能上传一个文件,请重试");
|
|
|
}else{
|
|
|
let file = DataTransferItemList[0]
|
|
|
- if(file.type && (file.name.endsWith('.pdf')||file.name.endsWith('.pptx'))){
|
|
|
+ if(file.type && this.fileTypeRule.test(file.name)){
|
|
|
if(file.size/1024/1024 > 50.1){
|
|
|
this.$message.error("上传文件大小不超过50MB");
|
|
|
return false;
|
|
|
}
|
|
|
this.handleUpload({file})
|
|
|
}else{
|
|
|
- return this.$message.error("上传文件格式只支持PDF、PPTX");
|
|
|
+ return this.$message.error("上传文件格式只支持PDF、PPTX、DOC、DOCX");
|
|
|
}
|
|
|
}
|
|
|
}else{
|
|
@@ -470,8 +471,8 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
handleBeforeUpload(e) {
|
|
|
- if(!(e.name.endsWith('.pdf') || e.name.endsWith('.pptx'))){
|
|
|
- this.$message.error("上传文件格式只支持PDF、PPTX");
|
|
|
+ if(!this.fileTypeRule.test(e.name)){
|
|
|
+ this.$message.error("上传文件格式只支持PDF、PPTX、DOC、DOCX");
|
|
|
return false;
|
|
|
}
|
|
|
if(!(e.size/1024/1024 < 50.1)){
|