From 00b143c0f64147e41b497722ea4af29fe040ac14 Mon Sep 17 00:00:00 2001 From: dataeaseShu <106045316+dataeaseShu@users.noreply.github.com> Date: Fri, 26 May 2023 15:40:14 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E3=80=90=E7=B3=BB=E7=BB=9F=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E3=80=91=E4=BB=BB=E5=8A=A1=E7=AE=A1=E7=90=86-?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=90=8C=E6=AD=A5-=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E7=AD=9B=E9=80=89=EF=BC=8C=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9B=86=E6=B2=A1=E6=9C=89=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/system/task/FilterUserRecord.vue | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/frontend/src/views/system/task/FilterUserRecord.vue b/frontend/src/views/system/task/FilterUserRecord.vue index e79f9bda4c..6b0b7c0740 100644 --- a/frontend/src/views/system/task/FilterUserRecord.vue +++ b/frontend/src/views/system/task/FilterUserRecord.vue @@ -139,7 +139,7 @@ import { filterDatasetRecord, dateFormat } from './options' import { queryAuthModel } from '@/api/authModel/authModel' import DeDatePick from '@/components/deCustomCm/DeDatePick.vue' - +import _ from 'lodash' export default { components: { DeDatePick @@ -162,7 +162,7 @@ export default { }, computed: { datasetComputed() { - return this.dfs(this.treeData) + return this.dfs(_.cloneDeep(this.treeData), this.activeDataset) } }, watch: { @@ -194,14 +194,13 @@ export default { this.treeLoading = false }) }, - dfs(arr) { + dfs(arr, target) { return arr.reduce((pre, ele) => { - if (!this.activeDataset.includes(ele.id)) { + if (!target.includes(ele.id)) { if (ele.children?.length) { - pre.push(this.dfs(ele.children)) - } else { - pre.push(ele) + ele.children = this.dfs(ele.children, target) } + pre.push(ele) } return pre }, [])