feat: 新增顶部菜单切换、菜单复制新增功能并优化侧边栏渲染

1.  新增顶部菜单选择器,支持切换顶级菜单并动态渲染对应侧边栏
2.  菜单管理页面添加复制新增按钮,可基于现有菜单快速创建新菜单
3.  重构侧边栏路由逻辑,支持自动匹配当前页面所属顶级菜单
4.  在vuex中新增顶部菜单状态管理,持久化激活的顶级菜单
This commit is contained in:
2026-06-25 10:52:46 +08:00
parent 24030dd93f
commit e994afb97f
6 changed files with 384 additions and 39 deletions

View File

@@ -100,6 +100,13 @@
@click="handleAdd(scope.row)"
v-hasPermi="['system:menu:add']"
>新增</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-document-copy"
@click="handleCopyAdd(scope.row)"
v-hasPermi="['system:menu:add']"
>复制新增</el-button>
<el-button
size="mini"
type="text"
@@ -410,6 +417,17 @@ export default {
this.open = true;
this.title = "添加菜单";
},
/** 复制新增按钮操作:将当前菜单信息填入新增弹窗 */
handleCopyAdd(row) {
this.reset();
this.getTreeselect();
// 直接使用当前行数据拷贝给表单,不拷贝 menuId 确保提交走新增
const data = { ...row };
data.menuId = undefined;
this.form = data;
this.open = true;
this.title = "复制新增菜单";
},
/** 展开/折叠操作 */
toggleExpandAll() {
this.refreshTable = false;