From 4b38b96c3f5f3c5b26f63443b986d6efe3bcb4d6 Mon Sep 17 00:00:00 2001
From: zhujiyan <17812234322@163.com>
Date: Mon, 2 Sep 2024 19:58:45 +0800
Subject: [PATCH] =?UTF-8?q?1.loading=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B92.?=
=?UTF-8?q?=E4=B8=8A=E6=AC=A1=E6=89=93=E5=BC=80=E6=95=B0=E6=8D=AE=E6=B8=85?=
=?UTF-8?q?=E7=A9=BA=203.=E5=AF=BC=E8=88=AA=E6=A0=8F=E6=98=BE=E7=A4=BA?=
=?UTF-8?q?=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/govern/device/fileService/index.vue | 33 ++++++++++++-------
src/views/govern/device/fileService/popup.vue | 7 ++--
2 files changed, 26 insertions(+), 14 deletions(-)
diff --git a/src/views/govern/device/fileService/index.vue b/src/views/govern/device/fileService/index.vue
index 6aa2817..9beefbe 100644
--- a/src/views/govern/device/fileService/index.vue
+++ b/src/views/govern/device/fileService/index.vue
@@ -13,7 +13,8 @@
:key="index"
@click="handleIntoByPath(item)"
>
- {{ index > 1 ? item.path.replace(activePathList[1].path, ' ') : item.path }}
+
+ {{ outPutPath(item, index) }}
@@ -27,7 +28,7 @@
搜索
重置
-
+
@@ -60,7 +61,7 @@
v-if="item?.type == 'file'"
src="@/assets/img/wenjian.svg"
/>
- 暂无内容
+
{{
item &&
@@ -73,6 +74,7 @@
+
@@ -171,14 +173,21 @@ const handleIntoDir = (row: any) => {
})
}
-//上传文件
-const uploadFile = (file: any) => {
- const obj = {
- id: nDid.value,
- file: file,
- filePath: '/'
+//处理导航栏路径
+const outPutPath = (row: any, key: any) => {
+ let path = ''
+ if (key <= 1) {
+ path = row.path
}
- uploadDeviceFile().then(res => {})
+ if (key > 1) {
+ if (row.path.includes(activePathList.value[1].path)) {
+ path = row.path.replace(activePathList.value[1].path, ' ')
+ }
+ if (row.path.split('/').length !== 0) {
+ path = '/' + row.path.split('/')[row.path.split('/').length - 1]
+ }
+ }
+ return path
}
//根据面包屑导航切换
@@ -189,7 +198,7 @@ const handleIntoByPath = async (val: any) => {
type: 'dir'
}
activePath.value = val.path
- loading.value=true
+ loading.value = true
getFileServiceFileOrDir(obj).then(res => {
dirList.value = res.data
activePathList.value.map((item: any, index: any) => {
@@ -197,7 +206,7 @@ const handleIntoByPath = async (val: any) => {
activePathList.value.splice(index, 1)
}
})
- loading.value=false
+ loading.value = false
})
}
diff --git a/src/views/govern/device/fileService/popup.vue b/src/views/govern/device/fileService/popup.vue
index 53e9691..77db09a 100644
--- a/src/views/govern/device/fileService/popup.vue
+++ b/src/views/govern/device/fileService/popup.vue
@@ -41,6 +41,7 @@ const handleClose = () => {
//文件信息
const fileData: any = ref({})
const open = async (row: any, id: any) => {
+ fileData.value = {}
dialogVisible.value = true
loading.value = true
const obj = {
@@ -50,8 +51,10 @@ const open = async (row: any, id: any) => {
}
await getFileServiceFileOrDir(obj).then(res => {
if (res.code == 'A0000') {
- fileData.value = res.data[0]
- fileData.value.nDid = id
+ if (res.data && res.data.length != 0) {
+ fileData.value = res.data[0]
+ fileData.value.nDid = id
+ }
loading.value = false
}
})