|
@@ -79,17 +79,27 @@ export default {
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
changeFillId(fileList) {
|
|
changeFillId(fileList) {
|
|
|
- this.data.answer.answer_list = [fileList[0].response.file_info_list[0]];
|
|
|
|
|
- let path = `${this.file_preview_url}onlinePreview?url=${Base64.encode(fileList[0].response.file_info_list[0].file_url)}`;
|
|
|
|
|
- this.data.answer.answer_list[0].newpath = path;
|
|
|
|
|
- this.$forceUpdate();
|
|
|
|
|
|
|
+ if (fileList.length > 0) {
|
|
|
|
|
+ this.data.answer.answer_list = [fileList[0].response.file_info_list[0]];
|
|
|
|
|
+ let path = `${this.file_preview_url}onlinePreview?url=${Base64.encode(fileList[0].response.file_info_list[0].file_url)}`;
|
|
|
|
|
+ this.data.answer.answer_list[0].newpath = path;
|
|
|
|
|
+ this.$forceUpdate();
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
remove() {
|
|
remove() {
|
|
|
if (!this.isJudgingRightWrong) {
|
|
if (!this.isJudgingRightWrong) {
|
|
|
if (this.data.answer.answer_list.length > 0) {
|
|
if (this.data.answer.answer_list.length > 0) {
|
|
|
- this.data.answer.answer_list = [];
|
|
|
|
|
- this.$message.success('删除成功');
|
|
|
|
|
- this.$forceUpdate();
|
|
|
|
|
|
|
+ this.$confirm('确定要删除此文件吗?', '提示', {
|
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
|
+ type: 'warning',
|
|
|
|
|
+ })
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ this.data.answer.answer_list = [];
|
|
|
|
|
+ this.$message.success('删除成功');
|
|
|
|
|
+ this.$forceUpdate();
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(() => {});
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|