feat: 完成菜单接入

This commit is contained in:
橙子
2024-09-07 13:43:00 +08:00
parent 978a7fab4c
commit 40b5f33c4e
12 changed files with 41 additions and 18 deletions

View File

@@ -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",

View File

@@ -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;

View File

@@ -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">

View File

@@ -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%",

View File

@@ -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;

View File

@@ -48,7 +48,8 @@ export function usePost() {
const columns: TableColumnList = [
{
label: "岗位编号",
prop: "id"
prop: "id",
width: 300
},
{
label: "岗位名称",

View File

@@ -66,7 +66,9 @@ export function useRole(treeRef: Ref) {
const columns: TableColumnList = [
{
label: "角色编号",
prop: "id"
prop: "id",
width: "300",
fixed: true
},
{
label: "角色名称",

View File

@@ -84,7 +84,7 @@ export function useUser(tableRef: Ref, treeRef: Ref) {
{
label: "用户编号",
prop: "id",
width: 200
width: 300
},
{
label: "用户头像",