1102提交

This commit is contained in:
fz
2023-11-02 14:30:57 +08:00
parent ec2afd10a5
commit 434d6e186f
10 changed files with 258 additions and 71 deletions
@@ -3,11 +3,17 @@
<el-dialog title="上传证据目录" :visible="uploadCaseVisable" @close="cancel" center :distroy-on-close="true">
<el-upload class="upload-demo" :before-upload="beforeUpload" ref="upload" accept=".zip"
action="https://jsonplaceholder.typicode.com/posts/" :action="UploadUrl()" :headers="headers"
:data="filedata" :on-preview="handlePreview" :on-remove="handleRemove" :on-success="handleSuccess" :file-list="fileList"
:auto-upload="false">
:data="filedata" :on-preview="handlePreview" :on-remove="handleRemove" :on-success="handleSuccess"
:file-list="fileList" :auto-upload="false">
<el-button slot="trigger" size="small" type="primary" :disabled="flagBtn">选取文件</el-button>
<el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload" :disabled="flagBtn">上传压缩包</el-button>
<div slot="tip" class="el-upload__tip">只能上传zip文件,并且格式为一级目录上传申请书证据材料,二级目录为申请书和证据材料</div>
<el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload"
:disabled="flagBtn">上传压缩包</el-button>
<div slot="tip" class="el-upload__tip">
<div>结构示例</div>
<el-tree :data="dataTip"></el-tree>
<div>说明:1、压缩包目录结构为三级目录,
2、第2级目录名称应为“申请书”或“证据材料”。</div>
</div>
</el-upload>
<div class="title">证据目录结构</div>
<el-tree :data="data" @node-click="handleNodeClick"></el-tree>
@@ -28,9 +34,25 @@ export default {
Authorization: "Bearer " + getToken(),
},
filedata: {
id:this.uploadCaseData.id
id: this.uploadCaseData.id
},
flagBtn:false
flagBtn: false,
dataTip: [{
label: '压缩包名称',
children: [{
label: '申请书',
children: [{
label: '申请书名称.pdf'
}]
}, {
label: '证据材料',
children: [{
label: '证据1.pdf'
}, {
label: '证据2.pdf'
}]
}]
},],
};
},
watch: {
@@ -62,6 +84,10 @@ export default {
},
handleNodeClick(data) {
console.log(data);
let headPath = window.location.origin + "/API";
if(data.annexPath){
window.open(headPath + data.annexPath, "_blank")
}
},
// 递归替换key
setData(data) {
@@ -75,14 +101,14 @@ export default {
evidenceTree(data).then(res => {
this.setData(res.data);
this.data = res.data;
if(this.data.length > 0){
if (this.data.length > 0) {
this.flagBtn = true;
}else{
} else {
this.flagBtn = false;
}
})
},
handleSuccess(){
handleSuccess() {
this.evidenceTreeFn({ caseId: this.uploadCaseData.id })
},
beforeUpload(file) {