feat: 完成菜单接入
This commit is contained in:
@@ -24,5 +24,7 @@ namespace Yi.Framework.Rbac.Application.Contracts.Dtos.Menu
|
||||
public string? Component { get; set; }
|
||||
public string? Query { get; set; }
|
||||
public int OrderNum { get; set; }
|
||||
public MenuSourceEnum MenuSource { get; set; } = MenuSourceEnum.Ruoyi;
|
||||
public string? RouterName { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Volo.Abp.Application.Dtos;
|
||||
using Yi.Framework.Rbac.Domain.Shared.Enums;
|
||||
|
||||
namespace Yi.Framework.Rbac.Application.Contracts.Dtos.Menu
|
||||
{
|
||||
@@ -7,6 +8,6 @@ namespace Yi.Framework.Rbac.Application.Contracts.Dtos.Menu
|
||||
|
||||
public bool? State { get; set; }
|
||||
public string? MenuName { get; set; }
|
||||
|
||||
public MenuSourceEnum MenuSource { get; set; } = MenuSourceEnum.Ruoyi;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,6 @@ namespace Yi.Framework.Rbac.Application.Contracts.Dtos.Menu
|
||||
public string? Component { get; set; }
|
||||
public string? Query { get; set; }
|
||||
public int OrderNum { get; set; }
|
||||
|
||||
//public List<MenuEntity>? Children { get; set; }
|
||||
public string? RouterName { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ namespace Yi.Framework.Rbac.Application.Services.System
|
||||
|
||||
var entities = await _repository._DbQueryable.WhereIF(!string.IsNullOrEmpty(input.MenuName), x => x.MenuName.Contains(input.MenuName!))
|
||||
.WhereIF(input.State is not null, x => x.State == input.State)
|
||||
.Where(x=>x.MenuSource==input.MenuSource)
|
||||
.OrderByDescending(x => x.OrderNum)
|
||||
.ToListAsync();
|
||||
//.ToPageListAsync(input.SkipCount, input.MaxResultCount, total);
|
||||
@@ -45,5 +46,15 @@ namespace Yi.Framework.Rbac.Application.Services.System
|
||||
|
||||
return await MapToGetListOutputDtosAsync(entities);
|
||||
}
|
||||
|
||||
public override Task<MenuGetOutputDto> UpdateAsync(Guid id, MenuUpdateInputVo input)
|
||||
{
|
||||
return base.UpdateAsync(id, input);
|
||||
}
|
||||
|
||||
public override Task<MenuGetOutputDto> CreateAsync(MenuCreateInputVo input)
|
||||
{
|
||||
return base.CreateAsync(input);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ const testRouter = [
|
||||
frameLoading: null,
|
||||
keepAlive: null,
|
||||
showLink: true
|
||||
},
|
||||
}
|
||||
},
|
||||
{
|
||||
path: "/monitor/operation-logs",
|
||||
@@ -50,7 +50,7 @@ const testRouter = [
|
||||
title: "操作日志",
|
||||
component: "monitor/logs/operation/index",
|
||||
showLink: true
|
||||
},
|
||||
}
|
||||
},
|
||||
{
|
||||
id: "580a7b97-15ab-6d43-d011-3a14dab3cadc",
|
||||
|
||||
@@ -28,7 +28,7 @@ const modulesRoutes = import.meta.glob("/src/views/**/*.{vue,tsx}");
|
||||
|
||||
// 动态路由
|
||||
// getAsyncRoutes
|
||||
import { getRoutes,getAsyncRoutes } from "@/api/routes";
|
||||
import { getRoutes } from "@/api/routes";
|
||||
|
||||
function handRank(routeInfo: any) {
|
||||
const { name, path, parentId, meta } = routeInfo;
|
||||
|
||||
@@ -28,11 +28,13 @@ const props = withDefaults(defineProps<FormProps>(), {
|
||||
router: "",
|
||||
component: "",
|
||||
orderNum: 0,
|
||||
icon: "",
|
||||
menuIcon: "",
|
||||
permissionCode: "",
|
||||
isShow: true,
|
||||
isLink: false,
|
||||
state: true
|
||||
state: true,
|
||||
routerName: "",
|
||||
menuSource: "Pure"
|
||||
})
|
||||
});
|
||||
|
||||
@@ -93,7 +95,7 @@ defineExpose({ getRef });
|
||||
:sm="24"
|
||||
>
|
||||
<el-form-item label="菜单图标">
|
||||
<IconSelect v-model="newFormInline.icon" class="w-full" />
|
||||
<IconSelect v-model="newFormInline.menuIcon" class="w-full" />
|
||||
</el-form-item>
|
||||
</re-col>
|
||||
<re-col :value="12" :xs="24" :sm="24">
|
||||
|
||||
@@ -18,7 +18,8 @@ import { menuTypeOptions } from "@/views/system/menu/utils/enums";
|
||||
|
||||
export function useMenu() {
|
||||
const form = reactive({
|
||||
menuName: ""
|
||||
menuName: "",
|
||||
menuSource: "Pure"
|
||||
});
|
||||
|
||||
const formRef = ref();
|
||||
@@ -44,7 +45,7 @@ export function useMenu() {
|
||||
cellRenderer: ({ row }) => (
|
||||
<>
|
||||
<span class="inline-block mr-1">
|
||||
{h(useRenderIcon(row.icon), {
|
||||
{h(useRenderIcon(row.menuIcon), {
|
||||
style: { paddingTop: "1px" }
|
||||
})}
|
||||
</span>
|
||||
@@ -137,7 +138,7 @@ export function useMenu() {
|
||||
async function openDialog(title = "新增", row?: FormItemProps) {
|
||||
let data: any = null;
|
||||
if (title == "修改") {
|
||||
data = await getMenu(row.id);
|
||||
data = (await getMenu(row.id)).data;
|
||||
}
|
||||
addDialog({
|
||||
title: `${title}菜单`,
|
||||
@@ -156,11 +157,13 @@ export function useMenu() {
|
||||
router: data?.router ?? "",
|
||||
component: data?.component ?? "",
|
||||
orderNum: data?.orderNum ?? 0,
|
||||
icon: data?.icon ?? "",
|
||||
menuIcon: data?.menuIcon ?? "",
|
||||
permissionCode: data?.permissionCode ?? "",
|
||||
showLink: data?.isShow ?? true,
|
||||
isLink: data?.isLink ?? false,
|
||||
state: data?.state ?? true
|
||||
state: data?.state ?? true,
|
||||
routerName: data?.routerName ?? "",
|
||||
menuSource: data?.menuSource ?? "Pure"
|
||||
}
|
||||
},
|
||||
width: "45%",
|
||||
|
||||
@@ -8,11 +8,13 @@ interface FormItemProps {
|
||||
router: string;
|
||||
component: string;
|
||||
orderNum: number;
|
||||
icon: string;
|
||||
menuIcon: string;
|
||||
permissionCode: string;
|
||||
isShow: boolean;
|
||||
isLink: boolean;
|
||||
state: boolean;
|
||||
routerName: string;
|
||||
menuSource: string;
|
||||
}
|
||||
interface FormProps {
|
||||
formInline: FormItemProps;
|
||||
|
||||
@@ -48,7 +48,8 @@ export function usePost() {
|
||||
const columns: TableColumnList = [
|
||||
{
|
||||
label: "岗位编号",
|
||||
prop: "id"
|
||||
prop: "id",
|
||||
width: 300
|
||||
},
|
||||
{
|
||||
label: "岗位名称",
|
||||
|
||||
@@ -66,7 +66,9 @@ export function useRole(treeRef: Ref) {
|
||||
const columns: TableColumnList = [
|
||||
{
|
||||
label: "角色编号",
|
||||
prop: "id"
|
||||
prop: "id",
|
||||
width: "300",
|
||||
fixed: true
|
||||
},
|
||||
{
|
||||
label: "角色名称",
|
||||
|
||||
@@ -84,7 +84,7 @@ export function useUser(tableRef: Ref, treeRef: Ref) {
|
||||
{
|
||||
label: "用户编号",
|
||||
prop: "id",
|
||||
width: 200
|
||||
width: 300
|
||||
},
|
||||
{
|
||||
label: "用户头像",
|
||||
|
||||
Reference in New Issue
Block a user