From 6dc83b17186833600b247d785177d9963189abc6 Mon Sep 17 00:00:00 2001 From: wangxk Date: Fri, 14 Mar 2025 09:00:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=8B=E7=BC=A9=E6=96=87=E4=BB=B6=E5=9B=BE?= =?UTF-8?q?=E6=A0=87=E6=98=BE=E7=A4=BA=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/testdata/datamanagement/index.vue | 45 ++++++++-------- .../testdata/fileSynchronization/index.vue | 52 +++++++++++++++---- 2 files changed, 65 insertions(+), 32 deletions(-) diff --git a/web/src/views/testdata/datamanagement/index.vue b/web/src/views/testdata/datamanagement/index.vue index d17b23f..01b1622 100644 --- a/web/src/views/testdata/datamanagement/index.vue +++ b/web/src/views/testdata/datamanagement/index.vue @@ -639,21 +639,6 @@ const loacalselect = ref() const radio1 = ref() const diffloding = ref(false) const diffdata: any = ref({}) -function opendifference(row: any) { - diffloding.value = true - compare({ localPath: creatform.value.workPath ? creatform.value.workPath : '/', minioPath: creatform.value.workPath ? creatform.value.workPath : '/' }).then((res: any) => { - if (res.code == 0) { - diffdata.value = res.data - diffloding.value = false - difference.value = true - } - - }) - minioselect.value = '' - loacalselect.value = '' - radio1.value = '' - -} function differenceClose() { difference.value = false } @@ -1101,9 +1086,10 @@ async function submitcreat(formEl: any) { //路径导航条 const patharr = ref([]) function pathclick(row: any, index: any) { + patharr.value.splice(index + 1) creatform.value.parentId = row.id - creatform.value.workPath = convertArrayToPath(patharr.value) + creatform.value.workPath = convertArrayToPath1(patharr.value) getdata() } // 压缩文件 @@ -1160,7 +1146,7 @@ async function submitzip(formEl: any) { }) zipObj.value.ids = idsarr.join(',') zipObj.value.parentId = zipParentid.value - gettreedata() + // gettreedata() getdata() zipfiles.value = false compress(zipObj.value).then((res: any) => { @@ -1174,14 +1160,16 @@ async function submitzip(formEl: any) { }) } else { // loading.value = true - Decompression({ id: jiezip.value.id, parentId: jiezip.value.parentId, decompressionPath: jieFilearr.value.workPath }).then((res: any) => { + Decompression({ id: jiezip.value.id, parentId: zipParentid.value, decompressionPath: jieFilearr.value.workPath?jieFilearr.value.workPath : filetsobj.value.path }).then((res: any) => { if (res.code == 0) { ElMessage.success('解压成功') - gettreedata() + // // gettreedata() + // pathclick({ id: '' }, -1) getdata() zipfiles.value = false tableIdarr.value.length = 0 } + jieFilearr.value.workPath = '' }) } @@ -1195,7 +1183,7 @@ function zipClose() { } //查询文件夹 const listFilesarr = ref([]) -const filetsobj = ref({ +const filetsobj:any = ref({ id: '', path: '', }) @@ -1203,6 +1191,8 @@ const multipleTableRef = ref() const jieFilearr: any = ref({}) const jiepatharr: any = ref([]) function gettsfiles() { + filetsobj.value.nodeId = pathid.value + filetsobj.value.taskId = projectId.value listTsFiles(filetsobj.value).then((res: any) => { listFilesarr.value = res.data if (res.data[0]) { @@ -1241,6 +1231,7 @@ function fileSelection(row: any) { jieFilearr.value = row[0] } function pathFile(index: any) { + jiepatharr.value.splice(index + 1) filetsobj.value.path = convertArrayToPath(jiepatharr.value) gettsfiles() @@ -1293,12 +1284,22 @@ function convertPathToArray(fullPath: string): string[] { } // 路径转换方法(数组转路径) function convertArrayToPath(segments: string[]): string { + // 处理空数组返回根路径 if (segments.length === 0) return '/' // 过滤空值并拼接路径 return '/' + segments.filter(Boolean).join('/') + '/' } +function convertArrayToPath1(segments: string[]): string { + + // 处理空数组返回根路径 + if (segments.length === 0) return '/' + + // 过滤空值并拼接路径 + + return '/' + segments.map((item:any) => item.fileName).join('/') + '/' +} function removeSuffix(filename: any) { // 使用正则表达式匹配文件名中的后缀部分 // 这个正则表达式匹配从最后一个点开始到字符串末尾的所有字符 @@ -1410,7 +1411,7 @@ function removeSuffix(filename: any) { @click="openPreview(scope.row)" src="@/assets/fileimg/mp4.png" alt="" style="cursor: pointer;"> - @@ -1575,7 +1576,7 @@ function removeSuffix(filename: any) { - + - +