Skip to content

Commit

Permalink
Merge pull request #738 from ziijiawen/hotfix_nav-menu
Browse files Browse the repository at this point in the history
Hotfix nav menu
  • Loading branch information
EvildoerXiaoyy authored Feb 23, 2022
2 parents fb9d16e + 19e349c commit 1e331da
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions web/src/components/nav/head-nav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ export default {
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);
}
Expand Down Expand Up @@ -623,12 +623,12 @@ 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: [{
type: 'biz',
id: project.bk_biz_id,
id: project?.bk_biz_id,
}],
}).then((res) => {
this.$emit('auth', res.data);
Expand Down Expand Up @@ -755,7 +755,7 @@ 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);
if (menu) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
});
Expand Down Expand Up @@ -203,7 +203,7 @@ export default {
}
}

if (treeNode?.children?.length) {
if (treeNode.children?.length) {
this.recursiveFindDefault(
treeNode.children,
treeNode,
Expand Down Expand Up @@ -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);
});
},
// 遍历树找到勾选的节点,如果父节点已勾选,子孙节点不算在列表内
Expand All @@ -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);
});
Expand Down

0 comments on commit 1e331da

Please sign in to comment.