From e88750b00c450a8bde57d39c249cd39464210be4 Mon Sep 17 00:00:00 2001 From: wangxk Date: Mon, 23 Jun 2025 17:29:34 +0800 Subject: [PATCH] =?UTF-8?q?2025-06-23=E4=BC=9A=E8=AE=AE=E6=9B=B4=E6=94=B9?= =?UTF-8?q?=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/views/special/document/index.vue | 45 ++++++++------ web/src/views/special/project/index.vue | 14 ++--- .../views/testdata/datamanagement/index.vue | 62 +++++++++++-------- .../testdata/fileSynchronization/index.vue | 18 +++--- web/src/views/testdata/testtask/index.vue | 39 ++++++------ 5 files changed, 100 insertions(+), 78 deletions(-) diff --git a/web/src/views/special/document/index.vue b/web/src/views/special/document/index.vue index e09fc8f..9066380 100644 --- a/web/src/views/special/document/index.vue +++ b/web/src/views/special/document/index.vue @@ -51,7 +51,7 @@ onBeforeUnmount(() => { } }) const projectId = ref() -const storageKey:any = ref() +const storageKey: any = ref() //websocket let ws1 function setupWebSocket() { @@ -100,14 +100,12 @@ const vMove = { const projectArr = ref([]) const projectName = ref('') -const localStorageId = ref('') //获取所有项目 function getProject() { projectList().then((res: any) => { projectArr.value = res.data projectId.value = projectArr.value[0].id storageKey.value = projectArr.value[0].key - localStorageId.value = projectArr.value[0].localStorageId projectName.value = projectArr.value[0].projectName ws1 = new WebSocket(userStore.WebSocketUrl + '/websocket/' + 'projectId_' + projectId.value) setupWebSocket() @@ -150,7 +148,7 @@ const filePath = ref('') function gettreedata() { treeloading.value = true treeForm.value.projectId = projectId.value - let keyar = projectArr.value.find(item => item.localStorageId === localStorageId.value); + let keyar = projectArr.value.find(item => item.id == projectId.value); storageKey.value = keyar.key getNodesTree(treeForm.value).then((res: any) => { treedata.value = res.data @@ -158,7 +156,12 @@ function gettreedata() { if (treedata.value[0]) { pathid.value = treedata.value[0].id nodename.value = res.data[0].nodeName - filePath.value = res.data[0].path + res.data[0].nodeName + '/' + if (nodename.value == '根节点') { + filePath.value = res.data[0].path + } else { + filePath.value = res.data[0].path + nodename.value + '/' + } + nextTick(() => { treeRef.value?.setCurrentKey(pathid.value); }); @@ -175,8 +178,12 @@ const pathid = ref() const nodename = ref('') function handleNodeClick(data: any, node: any) { pathid.value = data.id - filePath.value = data.path + data.nodeName + '/' nodename.value = data.nodeName + if (nodename.value == '根节点') { + filePath.value = data.path + } else { + filePath.value = data.path + nodename.value + '/' + } getdata() } //子项目配置 @@ -534,7 +541,7 @@ function delfile(row: any) { } ) .then(() => { - deleteFilesById({ id: row.id,projectId:projectId.value }).then((res: any) => { + deleteFilesById({ id: row.id, projectId: projectId.value }).then((res: any) => { if (res.code == 0) { getdata() ElMessage({ @@ -569,7 +576,7 @@ function delprojectArr() { } ) .then(() => { - deleteFilesByIds({ ids: ids.join(','),projectId:projectId.value }).then((res: any) => { + deleteFilesByIds({ ids: ids.join(','), projectId: projectId.value }).then((res: any) => { if (res.code == 0) { ElMessage({ type: 'success', @@ -594,7 +601,7 @@ function xiafile(row: any) { } ) .then(() => { - sdLocalUrl({ id: row.id,projectId:projectId.value }).then((res: any) => { + sdLocalUrl({ id: row.id, projectId: projectId.value }).then((res: any) => { window.open(res.data.url); }) @@ -615,8 +622,10 @@ function xiafilemony() { ) .then(() => { tableIdarr.value.forEach((item: any) => { - if (item.url) { - downloadFileUseIframeMode(item.url); + if (item.id) { + sdLocalUrl({ id: item.id, projectId: projectId.value }).then((res: any) => { + downloadFileUseIframeMode(res.data.url); + }) } }) }) @@ -709,7 +718,7 @@ function openPreview(row: any) { } function geturl(row: any, pan: any) { - sdLocalUrl({ id: row.id,projectId:projectId.value }).then((res: any) => { + sdLocalUrl({ id: row.id, projectId: projectId.value }).then((res: any) => { if (pan) { ViewfileUrl.value = res.data.url isViewfile.value = true @@ -849,7 +858,7 @@ function tonstatus() {