From 26390b55f722e3f5a4bac991307a9eb543d31164 Mon Sep 17 00:00:00 2001 From: zhujiyan <17812234322@163.com> Date: Tue, 3 Sep 2024 10:52:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=B7=BB=E5=8A=A0=E8=BF=9B?= =?UTF-8?q?=E5=BA=A6=E6=9D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/govern/device/fileService/index.vue | 68 +++++++++++++------ 1 file changed, 46 insertions(+), 22 deletions(-) diff --git a/src/views/govern/device/fileService/index.vue b/src/views/govern/device/fileService/index.vue index 46049cd..610fe96 100644 --- a/src/views/govern/device/fileService/index.vue +++ b/src/views/govern/device/fileService/index.vue @@ -28,19 +28,24 @@ 搜索 重置 - - 文件上传 - - + > + + 文件上传 + + + +
+ {{ fileName }} 上传中... +
@@ -87,7 +92,7 @@

- + @@ -123,18 +128,20 @@ const nodeClick = (e: any) => { loading.value = true if (e.level == 2) { nDid.value = e.ndid - getDeviceRootPath(nDid.value).then(res => { - loading.value = false - dirList.value = [res.data] - activePath.value = res.data.prjDataPath - activePathList.value.map((item: any, index: any) => { - if (item.path.indexOf(res.data.prjDataPath) == -1) { - activePathList.value.push({ path: activePath.value }) - } + getDeviceRootPath(nDid.value) + .then(res => { + loading.value = false + dirList.value = [res.data] + activePath.value = res.data.prjDataPath + activePathList.value.map((item: any, index: any) => { + if (item.path.indexOf(res.data.prjDataPath) == -1) { + activePathList.value.push({ path: activePath.value }) + } + }) + }) + .catch(e => { + loading.value = false }) - }).catch((e)=>{ - loading.value = false - }) } } //搜索文件或文件夹 @@ -231,15 +238,20 @@ const handleDownLoad = async (row: any) => { ;(await nDid.value) && fileRef.value && fileRef.value.open(row, nDid.value) } //上传文件 +const progressVisibile = ref(false) +const fileName = ref('') const handleUpload = (e: any, fileList: any, row: any) => { + fileName.value = e.name const obj = { id: nDid.value, file: e.raw, - filePath: row|| row.prjDataPath + filePath: row || row.prjDataPath } + progressVisibile.value = true uploadDeviceFile(obj).then(res => { if (res.code == 'A0000') { ElMessage.success(res.message) + progressVisibile.value = false } }) } @@ -300,6 +312,18 @@ watch( .el-button { margin-left: 10px; } + .upload_progress { + flex: 1; + height: 30px; + display: flex; + align-items: center; + justify-content: flex-start; + margin-left: 10px; + .el-progress { + width: 300px; + margin-left: 10px; + } + } } .list { display: flex;