feat(components): 菜单树选择组件新增隐藏禁用标识

This commit is contained in:
xlsea
2025-10-14 10:29:35 +08:00
parent 2400bf8cfa
commit 08cfa167a8
2 changed files with 19 additions and 1 deletions
+18
View File
@@ -66,6 +66,24 @@ function renderLabel({ option }: { option: TreeOption }) {
if (label?.startsWith('route.') || label?.startsWith('menu.')) {
label = $t(label as App.I18n.I18nKey);
}
// 禁用的菜单显示红色
if (option.status === '1') {
return (
<div class="flex items-center gap-4px text-error-200">
{label}
<SvgIcon icon="ri:prohibited-line" class="text-16px" />
</div>
);
}
// 隐藏的菜单显示灰色
if (option.visible === '1') {
return (
<div class="flex items-center gap-4px text-gray-400">
{label}
<SvgIcon icon="codex:hidden" class="text-21px" />
</div>
);
}
return <div>{label}</div>;
}
+1 -1
View File
@@ -234,7 +234,7 @@ function handleClickTree(keys: string[]) {
}
function handleResetTreeData() {
dictPattern.value = undefined;
dictPattern.value = '';
getTreeData();
}