From a2ca694d0d4425b43c4a90592c4ffd1d0f8d1d50 Mon Sep 17 00:00:00 2001 From: ziijiawen Date: Tue, 22 Feb 2022 17:17:46 +0800 Subject: [PATCH 1/4] =?UTF-8?q?bugfix:=20=E5=AF=BC=E8=88=AA=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E5=85=BC=E5=AE=B9=E4=BD=8E=E7=89=88=E6=9C=ACchrome?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/components/nav/head-nav.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/web/src/components/nav/head-nav.vue b/web/src/components/nav/head-nav.vue index d2ca3fafa..e1ab37c43 100644 --- a/web/src/components/nav/head-nav.vue +++ b/web/src/components/nav/head-nav.vue @@ -511,11 +511,13 @@ export default { }); }, replaceMenuId(list) { + console.log(2333); list.forEach((item) => { if (item.id === 'search') { item.id = 'retrieve'; } - item.id = item.id.replaceAll('_', '-'); + // item.id = item.id.replaceAll('_', '-'); + item.id = item.id.replace(/_/g, '-'); if (item.children) { this.replaceMenuId(item.children); } @@ -755,7 +757,8 @@ export default { resMenu.children.forEach((item) => { item.id = this.routeMap[item.id] || item.id; if (resMenu.id === 'dashboard') { - item.id = item.id.replaceAll('-', '_'); + // item.id = item.id.replaceAll('-', '_'); + item.id = item.id.replace(/_/g, '-'); } const menu = oldMenu.children.find(menuItem => menuItem.id === item.id); if (menu) { From d4a89855bbdd9bfaf350bf17a8d806159da448bf Mon Sep 17 00:00:00 2001 From: ziijiawen Date: Tue, 22 Feb 2022 17:19:14 +0800 Subject: [PATCH 2/4] =?UTF-8?q?bugfix:=20=E5=AF=BC=E8=88=AA=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E5=85=BC=E5=AE=B9=E4=BD=8E=E7=89=88=E6=9C=ACchrome?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/components/nav/head-nav.vue | 3 --- 1 file changed, 3 deletions(-) diff --git a/web/src/components/nav/head-nav.vue b/web/src/components/nav/head-nav.vue index e1ab37c43..3a729bb75 100644 --- a/web/src/components/nav/head-nav.vue +++ b/web/src/components/nav/head-nav.vue @@ -511,12 +511,10 @@ export default { }); }, replaceMenuId(list) { - console.log(2333); list.forEach((item) => { if (item.id === 'search') { item.id = 'retrieve'; } - // item.id = item.id.replaceAll('_', '-'); item.id = item.id.replace(/_/g, '-'); if (item.children) { this.replaceMenuId(item.children); @@ -757,7 +755,6 @@ export default { resMenu.children.forEach((item) => { item.id = this.routeMap[item.id] || item.id; if (resMenu.id === 'dashboard') { - // item.id = item.id.replaceAll('-', '_'); item.id = item.id.replace(/_/g, '-'); } const menu = oldMenu.children.find(menuItem => menuItem.id === item.id); From 78767036a8564a9b33d9280643e7e3b809a3c010 Mon Sep 17 00:00:00 2001 From: ziijiawen Date: Tue, 22 Feb 2022 19:26:27 +0800 Subject: [PATCH 3/4] minor: fix coverity --- web/src/components/nav/head-nav.vue | 2 +- .../manage-extract-permission/ModuleSelect.vue | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/web/src/components/nav/head-nav.vue b/web/src/components/nav/head-nav.vue index 3a729bb75..0ccaf6648 100644 --- a/web/src/components/nav/head-nav.vue +++ b/web/src/components/nav/head-nav.vue @@ -623,7 +623,7 @@ export default { if (project?.permission?.view_business) { return true; } - this.$store.commit('updateProject', project.project_id); + this.$store.commit('updateProject', project?.project_id); this.$store.dispatch('getApplyData', { action_ids: ['view_business'], resources: [{ diff --git a/web/src/views/manage2/manage-extract/manage-extract-permission/ModuleSelect.vue b/web/src/views/manage2/manage-extract/manage-extract-permission/ModuleSelect.vue index f4a8347b1..a84cb32c4 100644 --- a/web/src/views/manage2/manage-extract/manage-extract-permission/ModuleSelect.vue +++ b/web/src/views/manage2/manage-extract/manage-extract-permission/ModuleSelect.vue @@ -172,7 +172,7 @@ export default { if (item.bk_obj_id === 'module' && !dict[item.bk_inst_name]) { dict[item.bk_inst_name] = item; } - if (item?.children?.length) { + if (item.children?.length) { this.filterList(item.children, dict); } }); @@ -203,7 +203,7 @@ export default { } } - if (treeNode?.children?.length) { + if (treeNode.children?.length) { this.recursiveFindDefault( treeNode.children, treeNode, @@ -231,7 +231,7 @@ export default { nodes.forEach((node) => { node.checked = bool; node.disabled = bool; - node?.children?.length && this.inheritCheckNode(node.children, bool); + node?.children.length && this.inheritCheckNode(node.children, bool); }); }, // 遍历树找到勾选的节点,如果父节点已勾选,子孙节点不算在列表内 @@ -244,7 +244,7 @@ export default { bk_obj_id: data.bk_obj_id, bk_biz_id: data.bk_biz_id, }); - } else if (node?.children?.length) { + } else if (node.children?.length) { node.children.forEach((child) => { this.recursiveFindTopoNodes(child, selectedTopoList); }); From 19e349cb9f3bcff0b883cbc032766130533400c5 Mon Sep 17 00:00:00 2001 From: ziijiawen Date: Tue, 22 Feb 2022 19:35:31 +0800 Subject: [PATCH 4/4] minor: fix coverity --- web/src/components/nav/head-nav.vue | 2 +- .../manage-extract/manage-extract-permission/ModuleSelect.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/components/nav/head-nav.vue b/web/src/components/nav/head-nav.vue index 0ccaf6648..12fe8151f 100644 --- a/web/src/components/nav/head-nav.vue +++ b/web/src/components/nav/head-nav.vue @@ -628,7 +628,7 @@ export default { action_ids: ['view_business'], resources: [{ type: 'biz', - id: project.bk_biz_id, + id: project?.bk_biz_id, }], }).then((res) => { this.$emit('auth', res.data); diff --git a/web/src/views/manage2/manage-extract/manage-extract-permission/ModuleSelect.vue b/web/src/views/manage2/manage-extract/manage-extract-permission/ModuleSelect.vue index a84cb32c4..2e55c5afc 100644 --- a/web/src/views/manage2/manage-extract/manage-extract-permission/ModuleSelect.vue +++ b/web/src/views/manage2/manage-extract/manage-extract-permission/ModuleSelect.vue @@ -231,7 +231,7 @@ export default { nodes.forEach((node) => { node.checked = bool; node.disabled = bool; - node?.children.length && this.inheritCheckNode(node.children, bool); + node.children?.length && this.inheritCheckNode(node.children, bool); }); }, // 遍历树找到勾选的节点,如果父节点已勾选,子孙节点不算在列表内