From f879cdaf094fdfaa039a82c414e381e67968587e Mon Sep 17 00:00:00 2001
From: zhujiyan <17812234322@163.com>
Date: Fri, 23 Aug 2024 08:51:36 +0800
Subject: [PATCH 01/17] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E7=9B=91=E6=8E=A7-?=
=?UTF-8?q?=E5=AE=9E=E6=97=B6=E6=95=B0=E6=8D=AE=E9=A1=B6=E9=83=A8=E6=8C=89?=
=?UTF-8?q?=E9=92=AE=E7=BB=84=E6=94=B9=E4=B8=BA=E4=BE=BF=E6=90=BA=E5=BC=8F?=
=?UTF-8?q?=E8=AE=BE=E5=A4=87=E6=89=80=E6=9C=89tab=E6=98=BE=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/tree/govern/pointTree.vue | 22 +++++----
src/components/tree/point.vue | 29 +++++++-----
.../device/control/analysisList/index.vue | 36 ++++++++++----
src/views/govern/device/control/index.vue | 47 +++++++++----------
.../govern/device/control/tabs/realtime.vue | 16 +++----
5 files changed, 85 insertions(+), 65 deletions(-)
diff --git a/src/components/tree/govern/pointTree.vue b/src/components/tree/govern/pointTree.vue
index 1f86e27..74e1fc7 100644
--- a/src/components/tree/govern/pointTree.vue
+++ b/src/components/tree/govern/pointTree.vue
@@ -1,5 +1,5 @@
-
{{ item.prjName }}>{{ item.prjDataPath }}
++ {{ + item && + item?.prjDataPath && + item?.prjDataPath.includes(activePath) && + item?.prjDataPath.length > activePath.length + ? item?.prjDataPath.replace(activePath, ' ') + : item?.prjDataPath + }} +
+{{ @@ -49,8 +83,13 @@ import DeviceTree from '@/components/tree/govern/deviceTree.vue' import { mainHeight } from '@/utils/layout' import { ref, reactive, watch } from 'vue' import { ElMessage } from 'element-plus' -import { ArrowLeft, ArrowRight, Download } from '@element-plus/icons-vue' -import { getDeviceRootPath, getFileServiceFileOrDir, downLoadDeviceFile,uploadDeviceFile } from '@/api/cs-device-boot/fileService.ts' +import { ArrowLeft, ArrowRight, Download, Upload } from '@element-plus/icons-vue' +import { + getDeviceRootPath, + getFileServiceFileOrDir, + downLoadDeviceFile, + uploadDeviceFile +} from '@/api/cs-device-boot/fileService.ts' import popup from './popup.vue' defineOptions({ name: 'govern/device/fileService' @@ -81,11 +120,34 @@ const nodeClick = (e: any) => { }) } } - +//搜索文件或文件夹 +const filterFileName = ref('') +const handleSearch = () => { + let filterList = [] + dirList.value = currentDirList.value + dirList.value.map(item => { + if (filterFileName.value && item.prjDataPath.includes(filterFileName.value)) { + filterList.push(item) + } + }) + if (filterList.length != 0) { + dirList.value = filterList + } + if (!filterFileName) { + dirList.value = currentDirList.value + } +} +//重置搜索 +const handleRefresh = () => { + filterFileName.value = '' + dirList.value = currentDirList.value +} // 进入文件夹 const dirList = ref([]) +// 村村当前目录数据 +const currentDirList = ref([]) const handleIntoDir = (row: any) => { - if (!row.type||row.type == 'file') return + if (!row.type || row.type == 'file') return loading.value = true const obj = { nDid: nDid.value, @@ -100,6 +162,7 @@ const handleIntoDir = (row: any) => { getFileServiceFileOrDir(obj).then(res => { dirList.value = res.data loading.value = false + currentDirList.value = res.data activePathList.value.map((item: any, index: any) => { if (item.path.includes(activePath.value) && item.path.length > activePath.value.length) { activePathList.value.splice(index, 1) @@ -109,15 +172,13 @@ const handleIntoDir = (row: any) => { } //上传文件 -const uploadFile=(file:any)=>{ - const obj={ - id:nDid.value, - file:file, - filePath:'/' +const uploadFile = (file: any) => { + const obj = { + id: nDid.value, + file: file, + filePath: '/' } - uploadDeviceFile().then((res)=>{ - - }) + uploadDeviceFile().then(res => {}) } //根据面包屑导航切换 @@ -141,7 +202,22 @@ const handleIntoByPath = async (val: any) => { //下载文件 const fileRef = ref() const handleDownLoad = async (row: any) => { - await fileRef.value && fileRef.value.open(row, nDid.value) + ;(await nDid.value) && fileRef.value && fileRef.value.open(row, nDid.value) +} +//上传文件 +const handleUpload = (e: any, fileList: any, row: any) => { + console.log(e, fileList, row) + const obj = { + id: nDid.value, + file: e.raw, + filePath: row.prjDataPath + } + uploadDeviceFile(obj).then(res => { + console.log(res, '上传文件毁掉') + if (res.code == 'A0000') { + ElMessage.success(res.message) + } + }) } watch( () => activePathList.value, @@ -191,12 +267,22 @@ watch( cursor: pointer; } } + .filter { + width: 100%; + height: 30px; + display: flex; + margin-top: 10px; + justify-content: flex-start; + .el-button { + margin-left: 10px; + } + } .list { display: flex; flex-wrap: wrap; align-items: flex-start; overflow-y: auto; - margin-top: 20px; + margin-top: 10px; height: 100%; padding-bottom: 200px; z-index: 100; @@ -214,7 +300,8 @@ watch( cursor: pointer; position: relative; z-index: 1001 !important; - .item_download { + .item_download, + .item_upload { position: absolute; top: 10px; right: 10px; diff --git a/src/views/govern/device/fileService/popup.vue b/src/views/govern/device/fileService/popup.vue index 7c7d2b8..1d2c77d 100644 --- a/src/views/govern/device/fileService/popup.vue +++ b/src/views/govern/device/fileService/popup.vue @@ -39,15 +39,15 @@ const handleClose = () => { } //文件信息 const fileData: any = ref({}) -const open = (row: any, id: any) => { +const open = async (row: any, id: any) => { dialogVisible.value = true + loading.value = true const obj = { nDid: id, name: row.prjDataPath, type: row.type } - loading.value = true - getFileServiceFileOrDir(obj).then(res => { + await getFileServiceFileOrDir(obj).then(res => { if (res.code == 'A0000') { fileData.value = res.data[0] fileData.value.nDid = id @@ -63,16 +63,18 @@ const handleDownLoad = () => { fileCheck: fileData.value.fileCheck } downLoading.value = true - downLoadDeviceFile(obj).then(res => { - if (res.code == 'A0000') { - window.open(res.data, '_blank') - downLoading.value = false - } - }).catch((e)=>{ - if(e){ - downLoading.value=false; - } - }) + downLoadDeviceFile(obj) + .then(res => { + if (res.code == 'A0000') { + window.open(res.data, '_blank') + downLoading.value = false + } + }) + .catch(e => { + if (e) { + downLoading.value = false + } + }) } onMounted(() => {}) onUnmounted(() => {}) From 3a1520aa9525f6e3c369d343a1745b80f4029bb0 Mon Sep 17 00:00:00 2001 From: zhujiyan <17812234322@163.com> Date: Mon, 2 Sep 2024 18:39:44 +0800 Subject: [PATCH 07/17] =?UTF-8?q?1.=E4=B8=8B=E8=BD=BD=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E5=90=8E=E5=85=B3=E9=97=AD=E5=BC=B9=E6=A1=862.=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E8=8F=9C=E5=8D=95=E6=A0=8F=E8=B7=B3=E8=BD=AC=E5=8A=A0?= =?UTF-8?q?loading?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/govern/device/fileService/index.vue | 2 ++ src/views/govern/device/fileService/popup.vue | 3 +++ vite.config.ts | 3 ++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/views/govern/device/fileService/index.vue b/src/views/govern/device/fileService/index.vue index da13c1c..6aa2817 100644 --- a/src/views/govern/device/fileService/index.vue +++ b/src/views/govern/device/fileService/index.vue @@ -189,6 +189,7 @@ const handleIntoByPath = async (val: any) => { type: 'dir' } activePath.value = val.path + loading.value=true getFileServiceFileOrDir(obj).then(res => { dirList.value = res.data activePathList.value.map((item: any, index: any) => { @@ -196,6 +197,7 @@ const handleIntoByPath = async (val: any) => { activePathList.value.splice(index, 1) } }) + loading.value=false }) } diff --git a/src/views/govern/device/fileService/popup.vue b/src/views/govern/device/fileService/popup.vue index 1d2c77d..53e9691 100644 --- a/src/views/govern/device/fileService/popup.vue +++ b/src/views/govern/device/fileService/popup.vue @@ -30,6 +30,7 @@ From 2bce41c561c418535167eb3320f302fb9c0f4380 Mon Sep 17 00:00:00 2001 From: zhujiyan <17812234322@163.com> Date: Mon, 2 Sep 2024 20:48:07 +0800 Subject: [PATCH 13/17] =?UTF-8?q?=E6=96=87=E4=BB=B6/=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=A4=B9=E6=B0=B4=E5=B9=B3=E4=BD=8D=E7=BD=AE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/govern/device/fileService/index.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/views/govern/device/fileService/index.vue b/src/views/govern/device/fileService/index.vue index d3dbcba..f060668 100644 --- a/src/views/govern/device/fileService/index.vue +++ b/src/views/govern/device/fileService/index.vue @@ -320,6 +320,7 @@ watch( display: flex; flex-wrap: wrap; align-items: flex-start; + justify-content: space-between; overflow-y: auto; margin-top: 10px; height: 100%; From 9fc5cc92a80caab64d7f018b29a2a0e25bbad33a Mon Sep 17 00:00:00 2001 From: zhujiyan <17812234322@163.com> Date: Mon, 2 Sep 2024 20:59:24 +0800 Subject: [PATCH 14/17] =?UTF-8?q?=E6=96=87=E4=BB=B6=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/govern/device/fileService/index.vue | 25 ++++--------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/src/views/govern/device/fileService/index.vue b/src/views/govern/device/fileService/index.vue index f060668..46049cd 100644 --- a/src/views/govern/device/fileService/index.vue +++ b/src/views/govern/device/fileService/index.vue @@ -43,21 +43,6 @@
{{ item && @@ -102,7 +87,7 @@