From c0eb3f1a1932fca1248ebe820ed78540272ff540 Mon Sep 17 00:00:00 2001 From: zhaocl97 Date: Fri, 19 Aug 2022 09:19:49 +0800 Subject: [PATCH] perf(appSettings): split and make it async component --- src/components/App/AppSettings/form/app.vue | 204 +++++ .../App/AppSettings/form/breadcrumb.vue | 61 ++ .../App/AppSettings/form/header.vue | 85 ++ src/components/App/AppSettings/form/menu.vue | 119 +++ src/components/App/AppSettings/form/tab.vue | 87 ++ src/components/App/AppSettings/form/theme.vue | 192 +++++ src/components/App/AppSettings/index.vue | 788 +----------------- src/components/App/AppSettings/shared.ts | 14 + 8 files changed, 808 insertions(+), 742 deletions(-) create mode 100644 src/components/App/AppSettings/form/app.vue create mode 100644 src/components/App/AppSettings/form/breadcrumb.vue create mode 100644 src/components/App/AppSettings/form/header.vue create mode 100644 src/components/App/AppSettings/form/menu.vue create mode 100644 src/components/App/AppSettings/form/tab.vue create mode 100644 src/components/App/AppSettings/form/theme.vue create mode 100644 src/components/App/AppSettings/shared.ts diff --git a/src/components/App/AppSettings/form/app.vue b/src/components/App/AppSettings/form/app.vue new file mode 100644 index 00000000..48bc812c --- /dev/null +++ b/src/components/App/AppSettings/form/app.vue @@ -0,0 +1,204 @@ + + + diff --git a/src/components/App/AppSettings/form/breadcrumb.vue b/src/components/App/AppSettings/form/breadcrumb.vue new file mode 100644 index 00000000..cd42bbf4 --- /dev/null +++ b/src/components/App/AppSettings/form/breadcrumb.vue @@ -0,0 +1,61 @@ + + + diff --git a/src/components/App/AppSettings/form/header.vue b/src/components/App/AppSettings/form/header.vue new file mode 100644 index 00000000..064bd303 --- /dev/null +++ b/src/components/App/AppSettings/form/header.vue @@ -0,0 +1,85 @@ + + + diff --git a/src/components/App/AppSettings/form/menu.vue b/src/components/App/AppSettings/form/menu.vue new file mode 100644 index 00000000..d539880d --- /dev/null +++ b/src/components/App/AppSettings/form/menu.vue @@ -0,0 +1,119 @@ + + + diff --git a/src/components/App/AppSettings/form/tab.vue b/src/components/App/AppSettings/form/tab.vue new file mode 100644 index 00000000..3b35aa43 --- /dev/null +++ b/src/components/App/AppSettings/form/tab.vue @@ -0,0 +1,87 @@ + + + diff --git a/src/components/App/AppSettings/form/theme.vue b/src/components/App/AppSettings/form/theme.vue new file mode 100644 index 00000000..38b18786 --- /dev/null +++ b/src/components/App/AppSettings/form/theme.vue @@ -0,0 +1,192 @@ + + + diff --git a/src/components/App/AppSettings/index.vue b/src/components/App/AppSettings/index.vue index dc18574d..30df8f40 100644 --- a/src/components/App/AppSettings/index.vue +++ b/src/components/App/AppSettings/index.vue @@ -1,9 +1,15 @@ + + + {{ t('form.app.app.reset') }} + - + - const [register4] = useForm({ - localeUniqueKey: 'app.bc', - showFeedback: false, - xGap: 0, - formItemClass: 'flex flex-row justify-between mb-2', - formItemComponentClass: 'w-32 flex justify-end', - size: 'small', - disabled: computed( - () => - !appRelatives.value.showHeader || !headerRelatives.value.showBreadcrumb - ), - schemas: [ - { - type: 'Extend:Divider', - componentProp: { - title: 'app.settings.breadcrumb', - prefix: 'bar', - titlePlacement: 'left', - foldable: true, - }, - extraProp: { - sticky: true, - bgColor: modalColor, - }, - }, - { - type: 'Base:Switch', - formProp: { - path: 'showIcon', - }, - }, - { - type: 'Base:Switch', - formProp: { - path: 'showDropdown', - }, - }, - { - type: 'Base:Select', - formProp: { - path: 'separator', - }, - componentProp: { - options: ['>', '/'].map((i) => ({ value: i, label: i })), - }, - }, - ], - }) + diff --git a/src/components/App/AppSettings/shared.ts b/src/components/App/AppSettings/shared.ts new file mode 100644 index 00000000..2455a853 --- /dev/null +++ b/src/components/App/AppSettings/shared.ts @@ -0,0 +1,14 @@ +import { getMergedTheme } from '@/App/src/naive/src/theme' + +export const modalColor = computed( + () => getMergedTheme.value?.Drawer.common?.modalColor +) + +export const appSetting = useAppStoreSetting() +export const lightThemeRelatives = ref(appSetting.settings.themes.light) +export const darkThemeRelatives = ref(appSetting.settings.themes.dark) +export const appRelatives = ref(appSetting.settings.app) +export const menuRelatives = ref(appSetting.settings.menu) +export const headerRelatives = ref(appSetting.settings.header) +export const breadcrumbRelatives = ref(appSetting.settings.breadcrumb) +export const tabRelatives = ref(appSetting.settings.tab)