From f6e4553a70301f29ecf6f99aac0c742466dcfaf3 Mon Sep 17 00:00:00 2001 From: wangxk Date: Tue, 25 Mar 2025 11:29:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E6=A1=A3=E7=AE=A1=E7=90=86bug?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/testdata/datamanagement/index.vue | 26 ++++++----- .../testdata/fileSynchronization/index.vue | 46 +++++++++++++------ 2 files changed, 47 insertions(+), 25 deletions(-) diff --git a/web/src/views/testdata/datamanagement/index.vue b/web/src/views/testdata/datamanagement/index.vue index 3531c06..6926147 100644 --- a/web/src/views/testdata/datamanagement/index.vue +++ b/web/src/views/testdata/datamanagement/index.vue @@ -101,11 +101,16 @@ function gettreedata() { getTsNodesTree(treeForm.value).then((res: any) => { treedata.value = res.data treeloading.value = false - pathid.value = treedata.value[0].nodeId - nextTick(() => { - treeRef.value?.setCurrentKey(pathid.value); - }); - getdata() + if (treedata.value[0]) { + pathid.value = treedata.value[0].nodeId + nextTick(() => { + treeRef.value?.setCurrentKey(pathid.value); + }); + getdata() + } else { + tableData.value.length = 0 + } + }) } const pathid = ref() @@ -590,9 +595,7 @@ const title1 = ref('') const isViewfile = ref(false) const fileType = ref('') function openPreview(row: any) { - // debugger? if (getFileExtension(row.fileName) == 'pdf' || getFileExtension(row.fileName) == 'pptx' || getFileExtension(row.fileName) == 'xlsx' || getFileExtension(row.fileName) == 'xls' || getFileExtension(row.fileName) == 'docx' || getFileExtension(row.fileName) == 'doc' || getFileExtension(row.fileName) == 'bin') { - // debugger title1.value = row.fileName ViewfileUrl.value = row.url isViewfile.value = true @@ -794,7 +797,7 @@ function paste() { //直接走覆盖方法 copyarr.value.forEach((items: any) => { - repeatObj.oldpaths ='/' + pathid.value + items.workPath + repeatObj.oldpaths = '/' + pathid.value + items.workPath repeatObj.newFileName.push(items.fileName) }) repeatObj.newFileName = repeatObj.newFileName.join(',') @@ -1188,7 +1191,6 @@ async function submitzip(formEl: any) { // gettreedata() getdata() zipfiles.value = false - // debugger zipObj.value.compressedPath = '/' + pathid.value + zipObj.value.compressedPath compress(zipObj.value).then((res: any) => { if (res.code == 0) { @@ -1234,7 +1236,7 @@ const jiepatharr: any = ref([]) function gettsfiles() { filetsobj.value.nodeId = pathid.value filetsobj.value.taskId = projectId.value - filetsobj.value.path ='/' + pathid.value+filetsobj.value.path + filetsobj.value.path = '/' + pathid.value + filetsobj.value.path listTsFiles(filetsobj.value).then((res: any) => { listFilesarr.value = res.data if (res.data[0]) { @@ -1568,8 +1570,8 @@ function textClose() {
- 创建文件/文件夹 - 上传 + 创建文件/文件夹 + 上传 删除 下载
diff --git a/web/src/views/testdata/fileSynchronization/index.vue b/web/src/views/testdata/fileSynchronization/index.vue index 61ebf62..b842b18 100644 --- a/web/src/views/testdata/fileSynchronization/index.vue +++ b/web/src/views/testdata/fileSynchronization/index.vue @@ -149,11 +149,17 @@ function gettreedata() { getTsNodesTree(treeForm.value).then((res: any) => { treedata.value = res.data treeloading.value = false - pathid.value = treedata.value[0].nodeId + if(treedata.value[0].nodeId ){ + pathid.value = treedata.value[0].nodeId nextTick(() => { treeRef.value?.setCurrentKey(pathid.value); }); getWorkData() + }else{ + workdata.value.length = 0 + backupsdata.value.length = 0 + } + }) } function handleNodeClick(data: any, node: any) { @@ -273,7 +279,7 @@ const handleMenuClick = (action: string, type: any) => { ) .then(() => { const params = [{ - path: currentNode.value.path, + path: '/' + pathid.value + currentNode.value.path, name: currentNode.value.fileName, size: currentNode.value.fileSize, type: currentNode.value.isFile @@ -301,7 +307,7 @@ const handleMenuClick = (action: string, type: any) => { ) .then(() => { const params = [{ - path: currentNode.value.path, + path: '/' + pathid.value + currentNode.value.path, name: currentNode.value.fileName, size: currentNode.value.fileSize, type: currentNode.value.isFile @@ -352,7 +358,7 @@ function tableBeifen(row: any) { ) .then(() => { const params = [{ - path: row.path, + path: '/' + pathid.value + row.path, name: row.name, size: row.size, type: row.type @@ -382,7 +388,11 @@ function moretableBeifen() { } ) .then(() => { - uploadToBackup({ parameterLists: beifenArr.value }).then((res: any) => { + let beifenArr2 = JSON.parse(JSON.stringify(beifenArr.value)) + beifenArr2.forEach((items: any) => { + items.path = '/' + pathid.value + items.path + }) + uploadToBackup({ parameterLists: beifenArr2 }).then((res: any) => { if (res.code == '0') { ElMessage.success("上传成功") beifenArr.value.forEach((items: any) => { @@ -408,7 +418,7 @@ function tablerestore(row: any) { ) .then(() => { const params = [{ - path: row.path, + path: '/' + pathid.value + row.path, name: row.name, size: row.size, type: row.type @@ -437,7 +447,11 @@ function moretablerestore() { } ) .then(() => { - downloadToLocal({ parameterLists: restoreArr.value }).then((res: any) => { + let restoreArr2 = JSON.parse(JSON.stringify(restoreArr.value)) + restoreArr2.forEach((items: any) => { + items.path = '/' + pathid.value + items.path + }) + downloadToLocal({ parameterLists: restoreArr2 }).then((res: any) => { if (res.code == '0') { ElMessage.success("恢复成功") restoreArr.value.forEach((items: any) => { @@ -499,8 +513,11 @@ function bfclick(type: any) { ) .then(() => { if (type == 'bf') { - - uploadToBackup({ parameterLists: changeclick.value }).then((res: any) => { + let beifenArr2 = JSON.parse(JSON.stringify(changeclick.value)) + beifenArr2.forEach((items: any) => { + items.path = '/' + pathid.value + items.path + }) + uploadToBackup({ parameterLists: beifenArr2 }).then((res: any) => { if (res.code == '0') { ElMessage.success("上传成功") changeclick.value.forEach((items: any) => { @@ -509,8 +526,11 @@ function bfclick(type: any) { } }) } else { - - downloadToLocal({ parameterLists: changeclick.value }).then((res: any) => { + let restoreArr2 = JSON.parse(JSON.stringify(changeclick.value)) + restoreArr2.forEach((items: any) => { + items.path = '/' + pathid.value + items.path + }) + downloadToLocal({ parameterLists: restoreArr2 }).then((res: any) => { if (res.code == '0') { ElMessage.success("恢复成功") changeclick.value.forEach((items: any) => { @@ -681,8 +701,8 @@ function CloseView() {
- 文件差异性对比 - 查看本次差异性对比 + 文件差异性对比 + 查看本次差异性对比