mirror of https://github.com/certd/certd
chore: 优化
parent
0c8a84656a
commit
0f5b9564c6
|
@ -1,7 +1,11 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
import TutorialSteps from "/@/components/tutorial/tutorial-steps.vue";
|
import TutorialSteps from "/@/components/tutorial/tutorial-steps.vue";
|
||||||
import { useSettingStore } from "/@/store/modules/settings";
|
|
||||||
|
const props = defineProps<{
|
||||||
|
showIcon?: boolean;
|
||||||
|
}>();
|
||||||
|
|
||||||
const openedRef = ref(false);
|
const openedRef = ref(false);
|
||||||
function open() {
|
function open() {
|
||||||
openedRef.value = true;
|
openedRef.value = true;
|
||||||
|
@ -12,8 +16,8 @@ const slots = defineSlots();
|
||||||
<template>
|
<template>
|
||||||
<div class="tutorial-button pointer" @click="open">
|
<div class="tutorial-button pointer" @click="open">
|
||||||
<template v-if="!slots.default">
|
<template v-if="!slots.default">
|
||||||
<fs-icon icon="ant-design:question-circle-outlined"></fs-icon>
|
<fs-icon v-if="showIcon" icon="ant-design:question-circle-outlined"></fs-icon>
|
||||||
<div class="hidden md:block ml-0.5">使用教程</div>
|
<div class="hidden md:block">使用教程</div>
|
||||||
</template>
|
</template>
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
<a-modal v-model:open="openedRef" class="tutorial-modal" width="90%">
|
<a-modal v-model:open="openedRef" class="tutorial-modal" width="90%">
|
||||||
|
|
|
@ -63,9 +63,6 @@ onMounted(async () => {
|
||||||
<LockScreen :avatar @to-login="handleLogout" />
|
<LockScreen :avatar @to-login="handleLogout" />
|
||||||
</template>
|
</template>
|
||||||
<template #header-right-0>
|
<template #header-right-0>
|
||||||
<div class="hover:bg-accent ml-1 mr-2 cursor-pointer rounded-full hidden md:block">
|
|
||||||
<tutorial-button v-if="!settingStore.isComm" class="flex-center header-btn" />
|
|
||||||
</div>
|
|
||||||
<div class="hover:bg-accent ml-1 mr-2 cursor-pointer rounded-full">
|
<div class="hover:bg-accent ml-1 mr-2 cursor-pointer rounded-full">
|
||||||
<vip-button class="flex-center header-btn" mode="nav" />
|
<vip-button class="flex-center header-btn" mode="nav" />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,54 +1,40 @@
|
||||||
import { IFrameView } from "/@/vben/layouts";
|
import { IFrameView } from "/@/vben/layouts";
|
||||||
import { useSettingStore } from "/@/store/modules/settings";
|
import { useSettingStore } from "/@/store/modules/settings";
|
||||||
import { computed } from "vue";
|
import { computed } from "vue";
|
||||||
|
import TutorialButton from "/@/components/tutorial/index.vue";
|
||||||
export const aboutResource = [
|
export const aboutResource = [
|
||||||
{
|
{
|
||||||
title: "文档",
|
title: "文档",
|
||||||
name: "about",
|
name: "document",
|
||||||
path: "/about",
|
path: "/about/doc",
|
||||||
redirect: "/about/doc",
|
component: IFrameView,
|
||||||
|
meta: {
|
||||||
|
icon: "lucide:book-open-text",
|
||||||
|
link: "https://certd.docmirror.cn",
|
||||||
|
title: "文档",
|
||||||
|
order: 9999,
|
||||||
|
show: () => {
|
||||||
|
const settingStore = useSettingStore();
|
||||||
|
return !settingStore.isComm;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "教程",
|
||||||
|
name: "help",
|
||||||
|
path: "/help",
|
||||||
meta: {
|
meta: {
|
||||||
icon: "lucide:copyright",
|
icon: "lucide:copyright",
|
||||||
order: 9999,
|
order: 9999,
|
||||||
show: () => {
|
show: () => {
|
||||||
const settingStore = useSettingStore();
|
const settingStore = useSettingStore();
|
||||||
return !settingStore.isComm;
|
return !settingStore.isComm;
|
||||||
}
|
|
||||||
},
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
title: "文档",
|
|
||||||
name: "document",
|
|
||||||
path: "/about/doc",
|
|
||||||
component: IFrameView,
|
|
||||||
meta: {
|
|
||||||
icon: "lucide:book-open-text",
|
|
||||||
link: "https://certd.docmirror.cn",
|
|
||||||
title: "文档"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
slot() {
|
||||||
name: "Github",
|
return <TutorialButton className="flex-center" show-icon={false} />;
|
||||||
path: "/about/github",
|
|
||||||
component: IFrameView,
|
|
||||||
meta: {
|
|
||||||
icon: "mdi:github",
|
|
||||||
link: "https://github.com/certd/certd",
|
|
||||||
title: "Github"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
click() {}
|
||||||
name: "Gitee",
|
}
|
||||||
path: "/about/gitee",
|
|
||||||
component: IFrameView,
|
|
||||||
meta: {
|
|
||||||
icon: "ion:logo-octocat",
|
|
||||||
link: "https://gitee.com/certd/certd",
|
|
||||||
title: "Gite"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -48,6 +48,10 @@ function handleClick() {
|
||||||
if (props.disabled) {
|
if (props.disabled) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (props.click) {
|
||||||
|
props.click();
|
||||||
|
return;
|
||||||
|
}
|
||||||
rootMenu?.handleMenuItemClick?.({
|
rootMenu?.handleMenuItemClick?.({
|
||||||
parentPaths: parentPaths.value,
|
parentPaths: parentPaths.value,
|
||||||
path: props.path
|
path: props.path
|
||||||
|
|
|
@ -40,14 +40,14 @@ const hasChildren = computed(() => {
|
||||||
:badge-variants="menu.badgeVariants"
|
:badge-variants="menu.badgeVariants"
|
||||||
:icon="menu.icon"
|
:icon="menu.icon"
|
||||||
:path="menu.path"
|
:path="menu.path"
|
||||||
@click="menu.meta?.onClick"
|
:click="menu.meta?.click"
|
||||||
>
|
>
|
||||||
<template #title>
|
|
||||||
<span>{{ menu.name }}</span>
|
|
||||||
</template>
|
|
||||||
<template v-if="menu.meta?.slot" #default>
|
<template v-if="menu.meta?.slot" #default>
|
||||||
<fs-render :render-func="menu.meta.slot" />
|
<fs-render :render-func="menu.meta.slot" />
|
||||||
</template>
|
</template>
|
||||||
|
<template v-else #title>
|
||||||
|
<span>{{ menu.name }}</span>
|
||||||
|
</template>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<SubMenuComp v-else :key="`${menu.path}_sub`" :active-icon="menu.activeIcon" :icon="menu.icon" :path="menu.path">
|
<SubMenuComp v-else :key="`${menu.path}_sub`" :active-icon="menu.activeIcon" :icon="menu.icon" :path="menu.path">
|
||||||
<template #content>
|
<template #content>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import type { Component, Ref } from 'vue';
|
import type { Component, Ref } from "vue";
|
||||||
|
|
||||||
import type { MenuRecordBadgeRaw, ThemeModeType } from '/@/vben/typings';
|
import type { MenuRecordBadgeRaw, ThemeModeType } from "/@/vben/typings";
|
||||||
|
|
||||||
interface MenuProps {
|
interface MenuProps {
|
||||||
/**
|
/**
|
||||||
|
@ -34,7 +34,7 @@ interface MenuProps {
|
||||||
* @zh_CN 菜单模式
|
* @zh_CN 菜单模式
|
||||||
* @default vertical
|
* @default vertical
|
||||||
*/
|
*/
|
||||||
mode?: 'horizontal' | 'vertical';
|
mode?: "horizontal" | "vertical";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @zh_CN 是否圆润风格
|
* @zh_CN 是否圆润风格
|
||||||
|
@ -85,6 +85,7 @@ interface MenuItemProps extends MenuRecordBadgeRaw {
|
||||||
* @zh_CN menuitem 名称
|
* @zh_CN menuitem 名称
|
||||||
*/
|
*/
|
||||||
path: string;
|
path: string;
|
||||||
|
click?: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface MenuItemRegistered {
|
interface MenuItemRegistered {
|
||||||
|
@ -128,12 +129,4 @@ interface SubMenuProvider {
|
||||||
removeSubMenu: (item: MenuItemRegistered) => void;
|
removeSubMenu: (item: MenuItemRegistered) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type {
|
export type { MenuItemClicked, MenuItemProps, MenuItemRegistered, MenuProps, MenuProvider, SubMenuProps, SubMenuProvider };
|
||||||
MenuItemClicked,
|
|
||||||
MenuItemProps,
|
|
||||||
MenuItemRegistered,
|
|
||||||
MenuProps,
|
|
||||||
MenuProvider,
|
|
||||||
SubMenuProps,
|
|
||||||
SubMenuProvider,
|
|
||||||
};
|
|
||||||
|
|
Loading…
Reference in New Issue