Jelajahi Sumber

feat: 😀增加菜单公共路由页配置字段

喵你个旺呀 1 tahun lalu
induk
melakukan
ef9ce11065

+ 6 - 0
Admin.NET/Admin.NET.Core/Entity/SysMenu.cs

@@ -107,6 +107,12 @@ public partial class SysMenu : EntityBase
     [SugarColumn(ColumnDescription = "是否固定")]
     public bool IsAffix { get; set; }
 
+    /// <summary>
+    /// 是否为公共路由(类似登录页)
+    /// </summary>
+    [SugarColumn(ColumnDescription = "是否为公共路由")]
+    public bool IsPublic { get; set; } = false;
+
     /// <summary>
     /// 排序
     /// </summary>

+ 6 - 0
Admin.NET/Admin.NET.Core/Service/Menu/Dto/MenuOutput.cs

@@ -112,6 +112,11 @@ public class SysMenuMeta
     /// </summary>
     public string Icon { get; set; }
 
+    /// <summary>
+    /// 是否为公共路由(类似登录页)
+    /// </summary>
+    public bool IsPublic { get; set; }
+
     /// <summary>
     /// 是否内嵌
     /// </summary>
@@ -148,6 +153,7 @@ public class SysMenuMapper : IRegister
         config.ForType<SysMenu, MenuOutput>()
             .Map(t => t.Meta.Title, o => o.Title)
             .Map(t => t.Meta.Icon, o => o.Icon)
+            .Map(t => t.Meta.IsPublic, o => o.IsPublic)
             .Map(t => t.Meta.IsIframe, o => o.IsIframe)
             .Map(t => t.Meta.IsLink, o => o.OutLink)
             .Map(t => t.Meta.IsHide, o => o.IsHide)

+ 6 - 0
Web/src/api-services/models/update-menu-input.ts

@@ -122,6 +122,12 @@ export interface UpdateMenuInput {
      * @memberof UpdateMenuInput
      */
     isIframe?: boolean;
+    /**
+     * 是否为公共路由(类似登录页)
+     * @type {boolean}
+     * @memberof UpdateMenuInput
+     */
+    isPublic?: boolean;
     /**
      * 外链链接
      * @type {string}

+ 8 - 0
Web/src/views/system/menu/component/editMenu.vue

@@ -97,6 +97,14 @@
 								</el-radio-group>
 							</el-form-item>
 						</el-col>
+						<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
+							<el-form-item label="公共路由" title="类似登录页,无需登录">
+								<el-radio-group v-model="state.ruleForm.isPublic">
+									<el-radio :value="true">是</el-radio>
+									<el-radio :value="false">否</el-radio>
+								</el-radio-group>
+							</el-form-item>
+						</el-col>
 					</template>
 					<template v-if="state.ruleForm.type === 3">
 						<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">

+ 1 - 1
Web/src/views/system/menu/index.vue

@@ -125,7 +125,7 @@ const getMenuTreeData = async () => {
 // 打开新增页面
 const openAddMenu = () => {
 	getMenuTreeData();
-	const data = { type: 2, isHide: false, isKeepAlive: true, isAffix: false, isIframe: false, tenantId: undefined, status: 1, orderNo: 100 };
+	const data = { type: 2, isHide: false, isPublic: false, isKeepAlive: true, isAffix: false, isIframe: false, tenantId: undefined, status: 1, orderNo: 100 };
 	data.tenantId = state.queryParams.tenantId;
 	state.editMenuTitle = '添加菜单';
 	editMenuRef.value?.openDialog(data);