From fb3c6183b4bcbd20f57c95ec3c33563f23f64990 Mon Sep 17 00:00:00 2001 From: fz Date: Thu, 11 Jan 2024 18:49:17 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=81=E6=8D=AE=E4=B8=8A=E4=BC=A0=EF=BC=8C?= =?UTF-8?q?=E8=AF=81=E6=8D=AE=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../caseManagement/components/addCase.vue | 68 ++++++++++++++++++- 1 file changed, 67 insertions(+), 1 deletion(-) 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) => { -- 2.54.0