groupOptions 拍平组织树时完整路径分隔符由 " / " 改为 "/", 使所在组显示为 教育云中心/信阳教育局/…/202601。
This commit is contained in:
@@ -110,8 +110,8 @@ const groupOptions = computed(() => {
|
||||
const flat: { id: number; name: string }[] = [];
|
||||
const walk = (list: any[], prefix = '') => {
|
||||
list.forEach(n => {
|
||||
flat.push({ id: n.id, name: prefix ? `${prefix} / ${n.name}` : n.name });
|
||||
if (n.children?.length) walk(n.children, prefix ? `${prefix} / ${n.name}` : n.name);
|
||||
flat.push({ id: n.id, name: prefix ? `${prefix}/${n.name}` : n.name });
|
||||
if (n.children?.length) walk(n.children, prefix ? `${prefix}/${n.name}` : n.name);
|
||||
});
|
||||
};
|
||||
walk(treeData.value);
|
||||
|
||||
Reference in New Issue
Block a user