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 } })