diff --git a/src/views/caseManagement/components/addCase.vue b/src/views/caseManagement/components/addCase.vue index 63b00b7..ec6c025 100644 --- a/src/views/caseManagement/components/addCase.vue +++ b/src/views/caseManagement/components/addCase.vue @@ -70,6 +70,27 @@ + + + + 点击上传 +
+ 文件支持上传.jpg,png,.doc,docx,.txt,.pdf文件 +
+
+
+
+ + +
+
{{ + item.annexName }}
+
+
+
@@ -303,6 +324,7 @@ import { import { getTemplate, } from "@/api/officialSeal/officialSeal.js"; +import { getToken } from "@/utils/auth"; export default { props: ["addVisable", "queryParams", "caseData", "caseDisabled"], dicts: ["case_built_type"], @@ -317,7 +339,15 @@ export default { caseAttachList: [] }, templateList: [], - modelFlag:false, + modelFlag: false, + fileURL: window.location.origin + "/API", + fileList: [], + filedata: { + annexType: 2, + }, + headers: { + Authorization: "Bearer " + getToken(), + }, }; }, watch: { @@ -372,6 +402,42 @@ export default { this.templateList = res.rows; }) }, + /** 查看证据 */ + fileDetil(val) { + window.open(this.fileURL + val) + }, + /** 文件上传地址 */ + UploadUrl() { + return window.location.origin + "/API/common/upload"; + }, + /**文件上传成功*/ + handlSuccess(res, file) { + this.formData.caseAttachList.push( + { + annexId:res.annexId, + } + ); + }, + /**文件超出个数限制时的钩子*/ + handleExceed(files, fileList) { + this.$message.warning( + `当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length + } 个文件` + ); + }, + // 删除文件之前的钩子,参数为上传的文件和文件列表,若返回 false 或者返回 Promise 且被 reject,则停止删除。 + beforeRemove(file, fileList) { + return this.$confirm(`确定移除 ${file.name}?`); + }, + handleRemove(file, fileList) { + this.caseAttachListArr = this.caseAttachListArr.filter(item => item.annexId != file.annexId) + }, + handlePreview(file) { + window.open( + window.location.origin + "/API" + file.certificatePath, + "_blank" + ); + }, // 提交form表单 submitForm() { this.$refs['ruleForm'].validate((valid) => {