From 3427dcd39e1914a52ca6566f74263fd8798fced9 Mon Sep 17 00:00:00 2001 From: liuguancen Date: Thu, 2 Apr 2026 13:01:42 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=89=8D=E7=AB=AF]=20checkbox=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E6=89=B9=E9=87=8F=E5=88=A0=E9=99=A4=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E6=89=8D=E6=98=BE=E7=A4=BA=EF=BC=9B=E4=BF=AE=E5=A4=8D=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E6=96=87=E4=BB=B6=E5=90=8D=E6=97=B6=E4=B8=8D=E5=B1=95?= =?UTF-8?q?=E5=BC=80=E6=96=87=E4=BB=B6=E5=A4=B9=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chat_web_front/src/views/reading/index.vue | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/chat_web_front/src/views/reading/index.vue b/chat_web_front/src/views/reading/index.vue index 45f390b..2daafaa 100644 --- a/chat_web_front/src/views/reading/index.vue +++ b/chat_web_front/src/views/reading/index.vue @@ -27,8 +27,9 @@ node-key="treeId" :expand-on-click-node="false" :default-expand-all="false" + :default-expanded-keys="expandedKeys" highlight-current - show-checkbox + :show-checkbox="batchMode" @node-click="handleNodeClick" @check-change="handleCheckChange" > @@ -64,10 +65,18 @@ @@ -249,6 +258,7 @@ const searchWord = ref(''); const treeData = ref([]); const treeProps = { children: 'children', label: 'label' }; const checkedNodes = ref([]); +const batchMode = ref(false); // ===================== 选中文件 ===================== const selectedFile = ref(null); @@ -380,6 +390,11 @@ const filteredTreeData = computed(() => { })); }); +const expandedKeys = computed(() => { + if (!searchWord.value.trim()) return []; + return filteredTreeData.value.map((f: any) => f.treeId); +}); + const handleNodeClick = async (data: any) => { if (data.isFolder) { await loadFolderFiles(data); @@ -757,10 +772,11 @@ onMounted(async () => { .left-footer { padding: 8px 12px; border-top: 1px solid #E6EDFF; .batch-del-btn { - display: flex; align-items: center; justify-content: center; height: 30px; + display: flex; align-items: center; justify-content: center; height: 30px; flex: 1; border: 1px solid #004EA0; border-radius: 4px; cursor: pointer; color: #004EA0; font-size: 13px; img { width: 14px; margin-right: 4px; } &:hover { background: #F0F4FF; } + &.batch-confirm { background: #BE0000; color: #fff; border-color: #BE0000; &:hover { background: #a00; } } } } }