mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-09-17 17:26:38 +08:00
Compare commits
4 Commits
5f51a8e09d
...
28be236c02
Author | SHA1 | Date | |
---|---|---|---|
|
28be236c02 | ||
|
6aee778d3d | ||
|
5699e0a1f5 | ||
|
09c5f29c8d |
13
.vscode/settings.json
vendored
13
.vscode/settings.json
vendored
@ -4,7 +4,18 @@
|
|||||||
"source.organizeImports": "never"
|
"source.organizeImports": "never"
|
||||||
},
|
},
|
||||||
"editor.formatOnSave": false,
|
"editor.formatOnSave": false,
|
||||||
"eslint.validate": ["html", "css", "scss", "json", "jsonc"],
|
"eslint.validate": [
|
||||||
|
"html",
|
||||||
|
"css",
|
||||||
|
"scss",
|
||||||
|
"json",
|
||||||
|
"jsonc",
|
||||||
|
"javascript",
|
||||||
|
"javascriptreact",
|
||||||
|
"typescript",
|
||||||
|
"typescriptreact",
|
||||||
|
"vue"
|
||||||
|
],
|
||||||
"i18n-ally.displayLanguage": "zh-cn",
|
"i18n-ally.displayLanguage": "zh-cn",
|
||||||
"i18n-ally.enabledParsers": ["ts"],
|
"i18n-ally.enabledParsers": ["ts"],
|
||||||
"i18n-ally.enabledFrameworks": ["vue"],
|
"i18n-ally.enabledFrameworks": ["vue"],
|
||||||
|
42
src/components/common/icon-tooltip.vue
Normal file
42
src/components/common/icon-tooltip.vue
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
<script lang="ts" setup>
|
||||||
|
import { computed, useSlots } from 'vue';
|
||||||
|
import type { PopoverPlacement } from 'naive-ui';
|
||||||
|
|
||||||
|
defineOptions({ name: 'IconTooltip' });
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
icon?: string;
|
||||||
|
localIcon?: string;
|
||||||
|
desc?: string;
|
||||||
|
placement?: PopoverPlacement;
|
||||||
|
}
|
||||||
|
|
||||||
|
const props = withDefaults(defineProps<Props>(), {
|
||||||
|
icon: 'mdi-help-circle',
|
||||||
|
localIcon: '',
|
||||||
|
desc: '',
|
||||||
|
placement: 'top'
|
||||||
|
});
|
||||||
|
|
||||||
|
const slots = useSlots();
|
||||||
|
const hasCustomTrigger = computed(() => Boolean(slots.trigger));
|
||||||
|
|
||||||
|
if (!hasCustomTrigger.value && !props.icon && !props.localIcon) {
|
||||||
|
throw new Error('icon or localIcon is required when no custom trigger slot is provided');
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<NTooltip :placement="placement">
|
||||||
|
<template #trigger>
|
||||||
|
<slot name="trigger">
|
||||||
|
<div class="cursor-pointer">
|
||||||
|
<SvgIcon :icon="icon" :local-icon="localIcon" />
|
||||||
|
</div>
|
||||||
|
</slot>
|
||||||
|
</template>
|
||||||
|
<slot>
|
||||||
|
<span>{{ desc }}</span>
|
||||||
|
</slot>
|
||||||
|
</NTooltip>
|
||||||
|
</template>
|
@ -80,7 +80,7 @@ function handleChangeMode(mode: UnionKey.ThemeLayoutMode) {
|
|||||||
class="flex-col-center cursor-pointer"
|
class="flex-col-center cursor-pointer"
|
||||||
@click="handleChangeMode(key)"
|
@click="handleChangeMode(key)"
|
||||||
>
|
>
|
||||||
<NTooltip :placement="item.placement">
|
<IconTooltip :placement="item.placement">
|
||||||
<template #trigger>
|
<template #trigger>
|
||||||
<div
|
<div
|
||||||
class="h-64px w-96px gap-6px rd-4px p-6px shadow ring-2 ring-transparent transition-all hover:ring-primary"
|
class="h-64px w-96px gap-6px rd-4px p-6px shadow ring-2 ring-transparent transition-all hover:ring-primary"
|
||||||
@ -92,7 +92,7 @@ function handleChangeMode(mode: UnionKey.ThemeLayoutMode) {
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
{{ $t(`theme.layout.layoutMode.${key}_detail`) }}
|
{{ $t(`theme.layout.layoutMode.${key}_detail`) }}
|
||||||
</NTooltip>
|
</IconTooltip>
|
||||||
<p class="mt-8px text-12px">{{ $t(themeLayoutModeRecord[key]) }}</p>
|
<p class="mt-8px text-12px">{{ $t(themeLayoutModeRecord[key]) }}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -13,7 +13,7 @@ defineProps<Props>();
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="w-full flex-y-center justify-between">
|
<div class="w-full flex-y-center justify-between">
|
||||||
<div>
|
<div class="flex-y-center">
|
||||||
<span class="pr-8px text-base-text">{{ label }}</span>
|
<span class="pr-8px text-base-text">{{ label }}</span>
|
||||||
<slot name="suffix"></slot>
|
<slot name="suffix"></slot>
|
||||||
</div>
|
</div>
|
||||||
|
@ -36,27 +36,28 @@ const swatches: string[] = [
|
|||||||
<template>
|
<template>
|
||||||
<NDivider>{{ $t('theme.appearance.themeColor.title') }}</NDivider>
|
<NDivider>{{ $t('theme.appearance.themeColor.title') }}</NDivider>
|
||||||
<div class="flex-col-stretch gap-12px">
|
<div class="flex-col-stretch gap-12px">
|
||||||
<NTooltip placement="top-start">
|
<SettingItem key="recommend-color" :label="$t('theme.appearance.recommendColor')">
|
||||||
<template #trigger>
|
<template #suffix>
|
||||||
<SettingItem key="recommend-color" :label="$t('theme.appearance.recommendColor')">
|
<IconTooltip>
|
||||||
<NSwitch v-model:value="themeStore.recommendColor" />
|
<p>
|
||||||
</SettingItem>
|
<span class="pr-12px">{{ $t('theme.appearance.recommendColorDesc') }}</span>
|
||||||
|
<br />
|
||||||
|
<NButton
|
||||||
|
text
|
||||||
|
tag="a"
|
||||||
|
href="https://uicolors.app/create"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
class="text-gray"
|
||||||
|
>
|
||||||
|
https://uicolors.app/create
|
||||||
|
</NButton>
|
||||||
|
</p>
|
||||||
|
</IconTooltip>
|
||||||
</template>
|
</template>
|
||||||
<p>
|
<NSwitch v-model:value="themeStore.recommendColor" />
|
||||||
<span class="pr-12px">{{ $t('theme.appearance.recommendColorDesc') }}</span>
|
</SettingItem>
|
||||||
<br />
|
|
||||||
<NButton
|
|
||||||
text
|
|
||||||
tag="a"
|
|
||||||
href="https://uicolors.app/create"
|
|
||||||
target="_blank"
|
|
||||||
rel="noopener noreferrer"
|
|
||||||
class="text-gray"
|
|
||||||
>
|
|
||||||
https://uicolors.app/create
|
|
||||||
</NButton>
|
|
||||||
</p>
|
|
||||||
</NTooltip>
|
|
||||||
<SettingItem
|
<SettingItem
|
||||||
v-for="(_, key) in themeStore.themeColors"
|
v-for="(_, key) in themeStore.themeColors"
|
||||||
:key="key"
|
:key="key"
|
||||||
|
@ -19,6 +19,9 @@ const isWrapperScrollMode = computed(() => themeStore.layout.scrollMode === 'wra
|
|||||||
<NDivider>{{ $t('theme.layout.content.title') }}</NDivider>
|
<NDivider>{{ $t('theme.layout.content.title') }}</NDivider>
|
||||||
<TransitionGroup tag="div" name="setting-list" class="flex-col-stretch gap-12px">
|
<TransitionGroup tag="div" name="setting-list" class="flex-col-stretch gap-12px">
|
||||||
<SettingItem key="1" :label="$t('theme.layout.content.scrollMode.title')">
|
<SettingItem key="1" :label="$t('theme.layout.content.scrollMode.title')">
|
||||||
|
<template #suffix>
|
||||||
|
<IconTooltip :desc="$t('theme.layout.content.scrollMode.tip')" />
|
||||||
|
</template>
|
||||||
<NSelect
|
<NSelect
|
||||||
v-model:value="themeStore.layout.scrollMode"
|
v-model:value="themeStore.layout.scrollMode"
|
||||||
:options="translateOptions(themeScrollModeOptions)"
|
:options="translateOptions(themeScrollModeOptions)"
|
||||||
|
@ -27,6 +27,9 @@ const themeStore = useThemeStore();
|
|||||||
<NSwitch v-model:value="themeStore.tab.visible" />
|
<NSwitch v-model:value="themeStore.tab.visible" />
|
||||||
</SettingItem>
|
</SettingItem>
|
||||||
<SettingItem v-if="themeStore.tab.visible" key="2" :label="$t('theme.layout.tab.cache')">
|
<SettingItem v-if="themeStore.tab.visible" key="2" :label="$t('theme.layout.tab.cache')">
|
||||||
|
<template #suffix>
|
||||||
|
<IconTooltip :desc="$t('theme.layout.tab.cacheTip')" />
|
||||||
|
</template>
|
||||||
<NSwitch v-model:value="themeStore.tab.cache" />
|
<NSwitch v-model:value="themeStore.tab.cache" />
|
||||||
</SettingItem>
|
</SettingItem>
|
||||||
<SettingItem v-if="themeStore.tab.visible" key="3" :label="$t('theme.layout.tab.height')">
|
<SettingItem v-if="themeStore.tab.visible" key="3" :label="$t('theme.layout.tab.height')">
|
||||||
|
@ -109,6 +109,7 @@ const local: App.I18n.Schema = {
|
|||||||
title: 'Tab Settings',
|
title: 'Tab Settings',
|
||||||
visible: 'Tab Visible',
|
visible: 'Tab Visible',
|
||||||
cache: 'Tag Bar Info Cache',
|
cache: 'Tag Bar Info Cache',
|
||||||
|
cacheTip: 'One-click to open/close global keepalive',
|
||||||
height: 'Tab Height',
|
height: 'Tab Height',
|
||||||
mode: {
|
mode: {
|
||||||
title: 'Tab Mode',
|
title: 'Tab Mode',
|
||||||
@ -144,6 +145,7 @@ const local: App.I18n.Schema = {
|
|||||||
title: 'Content Area Settings',
|
title: 'Content Area Settings',
|
||||||
scrollMode: {
|
scrollMode: {
|
||||||
title: 'Scroll Mode',
|
title: 'Scroll Mode',
|
||||||
|
tip: 'The theme scroll only scrolls the main part, the outer scroll can carry the header and footer together',
|
||||||
wrapper: 'Wrapper',
|
wrapper: 'Wrapper',
|
||||||
content: 'Content'
|
content: 'Content'
|
||||||
},
|
},
|
||||||
|
@ -106,6 +106,7 @@ const local: App.I18n.Schema = {
|
|||||||
title: '标签栏设置',
|
title: '标签栏设置',
|
||||||
visible: '显示标签栏',
|
visible: '显示标签栏',
|
||||||
cache: '标签栏信息缓存',
|
cache: '标签栏信息缓存',
|
||||||
|
cacheTip: '一键开启/关闭全局 keepalive',
|
||||||
height: '标签栏高度',
|
height: '标签栏高度',
|
||||||
mode: {
|
mode: {
|
||||||
title: '标签栏风格',
|
title: '标签栏风格',
|
||||||
@ -141,6 +142,7 @@ const local: App.I18n.Schema = {
|
|||||||
title: '内容区域设置',
|
title: '内容区域设置',
|
||||||
scrollMode: {
|
scrollMode: {
|
||||||
title: '滚动模式',
|
title: '滚动模式',
|
||||||
|
tip: '主题滚动仅 main 部分滚动,外层滚动可携带头部底部一起滚动',
|
||||||
wrapper: '外层滚动',
|
wrapper: '外层滚动',
|
||||||
content: '主体滚动'
|
content: '主体滚动'
|
||||||
},
|
},
|
||||||
|
3
src/typings/app.d.ts
vendored
3
src/typings/app.d.ts
vendored
@ -387,6 +387,7 @@ declare namespace App {
|
|||||||
title: string;
|
title: string;
|
||||||
visible: string;
|
visible: string;
|
||||||
cache: string;
|
cache: string;
|
||||||
|
cacheTip: string;
|
||||||
height: string;
|
height: string;
|
||||||
mode: { title: string } & Record<UnionKey.ThemeTabMode, string>;
|
mode: { title: string } & Record<UnionKey.ThemeTabMode, string>;
|
||||||
};
|
};
|
||||||
@ -416,7 +417,7 @@ declare namespace App {
|
|||||||
};
|
};
|
||||||
content: {
|
content: {
|
||||||
title: string;
|
title: string;
|
||||||
scrollMode: { title: string } & Record<UnionKey.ThemeScrollMode, string>;
|
scrollMode: { title: string; tip: string } & Record<UnionKey.ThemeScrollMode, string>;
|
||||||
page: {
|
page: {
|
||||||
animate: string;
|
animate: string;
|
||||||
mode: { title: string } & Record<UnionKey.ThemePageAnimateMode, string>;
|
mode: { title: string } & Record<UnionKey.ThemePageAnimateMode, string>;
|
||||||
|
2
src/typings/components.d.ts
vendored
2
src/typings/components.d.ts
vendored
@ -25,6 +25,7 @@ declare module 'vue' {
|
|||||||
IconMdiArrowUpThin: typeof import('~icons/mdi/arrow-up-thin')['default']
|
IconMdiArrowUpThin: typeof import('~icons/mdi/arrow-up-thin')['default']
|
||||||
IconMdiKeyboardEsc: typeof import('~icons/mdi/keyboard-esc')['default']
|
IconMdiKeyboardEsc: typeof import('~icons/mdi/keyboard-esc')['default']
|
||||||
IconMdiKeyboardReturn: typeof import('~icons/mdi/keyboard-return')['default']
|
IconMdiKeyboardReturn: typeof import('~icons/mdi/keyboard-return')['default']
|
||||||
|
IconTooltip: typeof import('./../components/common/icon-tooltip.vue')['default']
|
||||||
IconUilSearch: typeof import('~icons/uil/search')['default']
|
IconUilSearch: typeof import('~icons/uil/search')['default']
|
||||||
LangSwitch: typeof import('./../components/common/lang-switch.vue')['default']
|
LangSwitch: typeof import('./../components/common/lang-switch.vue')['default']
|
||||||
LookForward: typeof import('./../components/custom/look-forward.vue')['default']
|
LookForward: typeof import('./../components/custom/look-forward.vue')['default']
|
||||||
@ -56,6 +57,7 @@ declare module 'vue' {
|
|||||||
NMessageProvider: typeof import('naive-ui')['NMessageProvider']
|
NMessageProvider: typeof import('naive-ui')['NMessageProvider']
|
||||||
NModal: typeof import('naive-ui')['NModal']
|
NModal: typeof import('naive-ui')['NModal']
|
||||||
NNotificationProvider: typeof import('naive-ui')['NNotificationProvider']
|
NNotificationProvider: typeof import('naive-ui')['NNotificationProvider']
|
||||||
|
NPopover: typeof import('naive-ui')['NPopover']
|
||||||
NScrollbar: typeof import('naive-ui')['NScrollbar']
|
NScrollbar: typeof import('naive-ui')['NScrollbar']
|
||||||
NSelect: typeof import('naive-ui')['NSelect']
|
NSelect: typeof import('naive-ui')['NSelect']
|
||||||
NSpace: typeof import('naive-ui')['NSpace']
|
NSpace: typeof import('naive-ui')['NSpace']
|
||||||
|
Loading…
Reference in New Issue
Block a user