。。。

This commit is contained in:
TimSpan 2024-09-11 09:22:32 +08:00
parent 18e7d30b9c
commit c849afb43b
8 changed files with 108 additions and 4 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@ -57,10 +57,12 @@ declare module 'vue' {
IconFont: typeof import('./src/components/iconfont/IconFont.vue')['default']
Layout: typeof import('./src/components/layout/layout.vue')['default']
LayoutHeader: typeof import('./src/components/layout/header/LayoutHeader.vue')['default']
MenuItem: typeof import('./src/components/layout/MenuItem.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
SingleImageFileUpload: typeof import('./src/components/upload/SingleImageFileUpload.vue')['default']
Sliber: typeof import('./src/components/layout/sliber/sliber.vue')['default']
SystemMenus: typeof import('./src/components/layout/SystemMenus.vue')['default']
TableProMax: typeof import('./src/components/table/TableProMax.vue')['default']
TelephoneLogin: typeof import('./src/components/login/TelephoneLogin.vue')['default']
}

View File

@ -1,12 +1,12 @@
<template>
<i v-if="type === 'class'" :class="[`iconfont ${fontClass}`]" :style="{ fontSize: `${size}px` }" />
<i v-if="type === 'class'" :class="[`iconfont ${fontClass}`]" :style="{ fontSize: `${size}px` }"/>
<svg v-else-if="type === 'svg'" :style="{ width: `${size}px`, height: `${size}px` }">
<use :href="`#${fontClass}`" />
<use :href="`#${fontClass}`"/>
</svg>
</template>
<script setup lang="ts">
import { IconFontProps } from '@/types/components/iconfont/IconFont'
import {IconFontProps} from '@/types/components/iconfont/IconFont'
withDefaults(defineProps<IconFontProps>(), {
size: 25,

View File

@ -0,0 +1,46 @@
<template>
<template v-for="item in menuList">
<a-sub-menu
v-if="item.type === 'dir'"
:key="item.path"
>
<template #icon>
<icon-font :font-class="item.icon"/>
</template>
<template #title>
<span class="margin-left-xs">{{ item.title }}</span>
</template>
<menu-item :menu-list="item.children"/>
</a-sub-menu>
<a-menu-item
v-else
:key="item.path as any"
@click="router.push(item.path)"
>
<template #icon>
<icon-font :font-class="item.icon" :size="item.size"/>
</template>
<span class="margin-left-xs">{{ item.title }}</span>
</a-menu-item>
</template>
</template>
<script setup lang="ts">
import {SystemMenu} from "@/types/config";
import {useRouter} from "vue-router";
import IconFont from "@/components/iconfont/IconFont.vue";
const router = useRouter()
withDefaults(defineProps<{
menuList?: SystemMenu[]
}>(), {
menuList: (): SystemMenu[] => {
return [];
}
})
</script>
<style scoped lang="scss">
</style>

View File

@ -0,0 +1,25 @@
<template>
<a-menu
:selectedKeys="activeMenus"
mode="inline"
:inline-collapsed="false"
class="system-menus"
>
<menu-item :menu-list="SYSTEM_MENUS"/>
</a-menu>
</template>
<script setup lang="ts">
import {computed} from "vue";
import {useRoute} from "vue-router";
import {SYSTEM_MENUS} from "@/config";
import MenuItem from "@/components/layout/MenuItem.vue";
const route = useRoute()
const activeMenus = computed(() => [route.path]);
</script>
<style scoped lang="scss">
.system-menus {
height: calc(100% - 100px);
overflow-y: auto;
}
</style>

View File

@ -1,2 +1,33 @@
export const CLIENT_TYPE = "MANAGEMENT_POLICE"; //登录平台类型
export const ROUTER_WHITE_LIST: string[] = ['/login', '/test', '/register-index'];
export const SYSTEM_MENUS: SystemMenu[] = [
{
title: '首页',
name: 'index',
path: '/index',
type: "menu",
component: () => import('@/views/index.vue')
}, {
title: '单位管理',
name: 'unitManage',
path: '/unitManage',
type: 'dir',
children: [
{
title: '公安单位',
name: 'policeUnit',
path: '/policeUnit',
type: 'menu',
// icon: 'icon-policeman-full',
// size: '16',
component: () => import('@/views/unitManage/policeUnit/index.vue')
}, {
title: '保安单位',
name: 'securityUnit',
path: '/securityUnit',
type: 'menu',
component: () => import('@/views/unitManage/securityUnit/index.vue')
}
]
}
]

View File

@ -1,5 +1,5 @@
export interface IconFontProps {
fontClass?: string,
size?: number,
size?: number | string,
type?: 'class' | 'svg'
}

Binary file not shown.