Merge branch 'main' into global-search
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
<script setup lang="ts">
|
||||
import type { SelectListItem } from '@vben/types';
|
||||
|
||||
import { useSlots } from 'vue';
|
||||
|
||||
import { MdiQuestionMarkCircleOutline } from '@vben-core/iconify';
|
||||
import { Input, VbenTooltip } from '@vben-core/shadcn-ui';
|
||||
|
||||
defineOptions({
|
||||
name: 'PreferenceSelectItem',
|
||||
});
|
||||
|
||||
withDefaults(
|
||||
defineProps<{
|
||||
disabled?: boolean;
|
||||
items?: SelectListItem[];
|
||||
placeholder?: string;
|
||||
}>(),
|
||||
{
|
||||
disabled: false,
|
||||
placeholder: '',
|
||||
items: () => [],
|
||||
},
|
||||
);
|
||||
|
||||
const inputValue = defineModel<string>();
|
||||
|
||||
const slots = useSlots();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div
|
||||
:class="{
|
||||
'hover:bg-accent': !slots.tip,
|
||||
'pointer-events-none opacity-50': disabled,
|
||||
}"
|
||||
class="my-1 flex w-full items-center justify-between rounded-md px-2 py-1"
|
||||
>
|
||||
<span class="flex items-center text-sm">
|
||||
<slot></slot>
|
||||
|
||||
<VbenTooltip v-if="slots.tip" side="bottom">
|
||||
<template #trigger>
|
||||
<MdiQuestionMarkCircleOutline class="ml-1 cursor-help" />
|
||||
</template>
|
||||
<slot name="tip"></slot>
|
||||
</VbenTooltip>
|
||||
</span>
|
||||
<Input v-model="inputValue" class="h-8 w-[160px]" />
|
||||
</div>
|
||||
</template>
|
@@ -1,6 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { $t } from '@vben/locales';
|
||||
|
||||
import InputItem from '../input-item.vue';
|
||||
import SwitchItem from '../switch-item.vue';
|
||||
|
||||
defineOptions({
|
||||
@@ -8,10 +9,34 @@ defineOptions({
|
||||
});
|
||||
|
||||
const copyrightEnable = defineModel<boolean>('copyrightEnable');
|
||||
const copyrightDate = defineModel<string>('copyrightDate');
|
||||
const copyrightIcp = defineModel<string>('copyrightIcp');
|
||||
const copyrightIcpLink = defineModel<string>('copyrightIcpLink');
|
||||
const copyrightCompanyName = defineModel<string>('copyrightCompanyName');
|
||||
const copyrightCompanySiteLink = defineModel<string>(
|
||||
'copyrightCompanySiteLink',
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<SwitchItem v-model="copyrightEnable">
|
||||
{{ $t('preferences.copyright.enable') }}
|
||||
</SwitchItem>
|
||||
|
||||
<InputItem v-model="copyrightCompanyName" :disabled="!copyrightEnable">
|
||||
{{ $t('preferences.copyright.company-name') }}
|
||||
</InputItem>
|
||||
<InputItem v-model="copyrightCompanySiteLink" :disabled="!copyrightEnable">
|
||||
{{ $t('preferences.copyright.company-site-link') }}
|
||||
</InputItem>
|
||||
<InputItem v-model="copyrightDate" :disabled="!copyrightEnable">
|
||||
{{ $t('preferences.copyright.date') }}
|
||||
</InputItem>
|
||||
|
||||
<InputItem v-model="copyrightIcp" :disabled="!copyrightEnable">
|
||||
{{ $t('preferences.copyright.icp') }}
|
||||
</InputItem>
|
||||
<InputItem v-model="copyrightIcpLink" :disabled="!copyrightEnable">
|
||||
{{ $t('preferences.copyright.icp-link') }}
|
||||
</InputItem>
|
||||
</template>
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { $t } from '@vben/locales';
|
||||
|
||||
import NumberFieldItem from '../number-field-item.vue';
|
||||
import SwitchItem from '../switch-item.vue';
|
||||
|
||||
defineOptions({
|
||||
@@ -10,6 +11,7 @@ defineOptions({
|
||||
defineProps<{ disabled: boolean }>();
|
||||
|
||||
const sidebarEnable = defineModel<boolean>('sidebarEnable');
|
||||
const sidebarWidth = defineModel<number>('sidebarWidth');
|
||||
const sidebarCollapsedShowTitle = defineModel<boolean>(
|
||||
'sidebarCollapsedShowTitle',
|
||||
);
|
||||
@@ -18,15 +20,24 @@ const sidebarCollapsed = defineModel<boolean>('sidebarCollapsed');
|
||||
|
||||
<template>
|
||||
<SwitchItem v-model="sidebarEnable" :disabled="disabled">
|
||||
{{ $t('preferences.side-visible') }}
|
||||
{{ $t('preferences.sidebar.visible') }}
|
||||
</SwitchItem>
|
||||
<SwitchItem v-model="sidebarCollapsed" :disabled="!sidebarEnable || disabled">
|
||||
{{ $t('preferences.collapse') }}
|
||||
{{ $t('preferences.sidebar.collapsed') }}
|
||||
</SwitchItem>
|
||||
<SwitchItem
|
||||
v-model="sidebarCollapsedShowTitle"
|
||||
:disabled="!sidebarEnable || disabled"
|
||||
>
|
||||
{{ $t('preferences.collapse-show-title') }}
|
||||
{{ $t('preferences.sidebar.collapsed-show-title') }}
|
||||
</SwitchItem>
|
||||
<NumberFieldItem
|
||||
v-model="sidebarWidth"
|
||||
:disabled="!sidebarEnable || disabled"
|
||||
:max="320"
|
||||
:min="160"
|
||||
:step="10"
|
||||
>
|
||||
{{ $t('preferences.sidebar.width') }}
|
||||
</NumberFieldItem>
|
||||
</template>
|
||||
|
@@ -20,7 +20,4 @@ const tabbarShowIcon = defineModel<boolean>('tabbarShowIcon');
|
||||
<SwitchItem v-model="tabbarShowIcon" :disabled="!tabbarEnable">
|
||||
{{ $t('preferences.tabbar.icon') }}
|
||||
</SwitchItem>
|
||||
<!-- <SwitchItem v-model="sideCollapseShowTitle" :disabled="!tabsVisible">
|
||||
{{ $t('preferences.collapse-show-title') }}
|
||||
</SwitchItem> -->
|
||||
</template>
|
||||
|
@@ -0,0 +1,65 @@
|
||||
<script setup lang="ts">
|
||||
import type { SelectListItem } from '@vben/types';
|
||||
|
||||
import { useSlots } from 'vue';
|
||||
|
||||
import { MdiQuestionMarkCircleOutline } from '@vben-core/iconify';
|
||||
import {
|
||||
NumberField,
|
||||
NumberFieldContent,
|
||||
NumberFieldDecrement,
|
||||
NumberFieldIncrement,
|
||||
NumberFieldInput,
|
||||
VbenTooltip,
|
||||
} from '@vben-core/shadcn-ui';
|
||||
|
||||
defineOptions({
|
||||
name: 'PreferenceSelectItem',
|
||||
});
|
||||
|
||||
withDefaults(
|
||||
defineProps<{
|
||||
disabled?: boolean;
|
||||
items?: SelectListItem[];
|
||||
placeholder?: string;
|
||||
}>(),
|
||||
{
|
||||
disabled: false,
|
||||
placeholder: '',
|
||||
items: () => [],
|
||||
},
|
||||
);
|
||||
|
||||
const inputValue = defineModel<number>();
|
||||
|
||||
const slots = useSlots();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div
|
||||
:class="{
|
||||
'hover:bg-accent': !slots.tip,
|
||||
'pointer-events-none opacity-50': disabled,
|
||||
}"
|
||||
class="my-1 flex w-full items-center justify-between rounded-md px-2 py-1"
|
||||
>
|
||||
<span class="flex items-center text-sm">
|
||||
<slot></slot>
|
||||
|
||||
<VbenTooltip v-if="slots.tip" side="bottom">
|
||||
<template #trigger>
|
||||
<MdiQuestionMarkCircleOutline class="ml-1 cursor-help" />
|
||||
</template>
|
||||
<slot name="tip"></slot>
|
||||
</VbenTooltip>
|
||||
</span>
|
||||
|
||||
<NumberField v-model="inputValue" v-bind="$attrs" class="w-[160px]">
|
||||
<NumberFieldContent>
|
||||
<NumberFieldDecrement />
|
||||
<NumberFieldInput />
|
||||
<NumberFieldIncrement />
|
||||
</NumberFieldContent>
|
||||
</NumberField>
|
||||
</div>
|
||||
</template>
|
@@ -54,7 +54,7 @@ const slots = useSlots();
|
||||
</VbenTooltip>
|
||||
</span>
|
||||
<Select v-model="selectValue">
|
||||
<SelectTrigger class="h-7 w-[140px]">
|
||||
<SelectTrigger class="h-8 w-[160px]">
|
||||
<SelectValue :placeholder="placeholder" />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
|
@@ -26,7 +26,7 @@ function handleClick() {
|
||||
:class="{
|
||||
'pointer-events-none opacity-50': disabled,
|
||||
}"
|
||||
class="hover:bg-accent my-1 flex w-full items-center justify-between rounded-md px-2 py-2"
|
||||
class="hover:bg-accent my-1 flex w-full items-center justify-between rounded-md px-2 py-2.5"
|
||||
@click="handleClick"
|
||||
>
|
||||
<span class="flex items-center text-sm">
|
||||
|
@@ -19,7 +19,12 @@ import Preferences from './preferences.vue';
|
||||
:breadcrumb-show-home="preferences.breadcrumb.showHome"
|
||||
:breadcrumb-show-icon="preferences.breadcrumb.showIcon"
|
||||
:breadcrumb-style-type="preferences.breadcrumb.styleType"
|
||||
:copyright-company-name="preferences.copyright.companyName"
|
||||
:copyright-company-site-link="preferences.copyright.companySiteLink"
|
||||
:copyright-date="preferences.copyright.date"
|
||||
:copyright-enable="preferences.copyright.enable"
|
||||
:copyright-icp="preferences.copyright.icp"
|
||||
:copyright-icp-link="preferences.copyright.icpLink"
|
||||
:footer-enable="preferences.footer.enable"
|
||||
:footer-fixed="preferences.footer.fixed"
|
||||
:header-enable="preferences.header.enable"
|
||||
@@ -36,6 +41,7 @@ import Preferences from './preferences.vue';
|
||||
:sidebar-collapsed="preferences.sidebar.collapsed"
|
||||
:sidebar-collapsed-show-title="preferences.sidebar.collapsedShowTitle"
|
||||
:sidebar-enable="preferences.sidebar.enable"
|
||||
:sidebar-width="preferences.sidebar.width"
|
||||
:tabbar-enable="preferences.tabbar.enable"
|
||||
:tabbar-show-icon="preferences.tabbar.showIcon"
|
||||
:theme-builtin-type="preferences.theme.builtinType"
|
||||
@@ -86,9 +92,24 @@ import Preferences from './preferences.vue';
|
||||
@update:breadcrumb-style-type="
|
||||
(val) => updatePreferences({ breadcrumb: { styleType: val } })
|
||||
"
|
||||
@update:copyright-company-name="
|
||||
(val) => updatePreferences({ copyright: { companyName: val } })
|
||||
"
|
||||
@update:copyright-company-site-link="
|
||||
(val) => updatePreferences({ copyright: { companySiteLink: val } })
|
||||
"
|
||||
@update:copyright-date="
|
||||
(val) => updatePreferences({ copyright: { date: val } })
|
||||
"
|
||||
@update:copyright-enable="
|
||||
(val) => updatePreferences({ copyright: { enable: val } })
|
||||
"
|
||||
@update:copyright-icp="
|
||||
(val) => updatePreferences({ copyright: { icp: val } })
|
||||
"
|
||||
@update:copyright-icp-link="
|
||||
(val) => updatePreferences({ copyright: { icpLink: val } })
|
||||
"
|
||||
@update:footer-enable="
|
||||
(val) => updatePreferences({ footer: { enable: val } })
|
||||
"
|
||||
@@ -129,6 +150,9 @@ import Preferences from './preferences.vue';
|
||||
@update:sidebar-enable="
|
||||
(val) => updatePreferences({ sidebar: { enable: val } })
|
||||
"
|
||||
@update:sidebar-width="
|
||||
(val) => updatePreferences({ sidebar: { width: val } })
|
||||
"
|
||||
@update:tabbar-enable="
|
||||
(val) => updatePreferences({ tabbar: { enable: val } })
|
||||
"
|
||||
|
@@ -77,6 +77,7 @@ const themeMode = defineModel<ThemeModeType>('themeMode');
|
||||
const themeRadius = defineModel<string>('themeRadius');
|
||||
|
||||
const sidebarEnable = defineModel<boolean>('sidebarEnable');
|
||||
const sidebarWidth = defineModel<number>('sidebarWidth');
|
||||
const sidebarCollapsed = defineModel<boolean>('sidebarCollapsed');
|
||||
const sidebarCollapsedShowTitle = defineModel<boolean>(
|
||||
'sidebarCollapsedShowTitle',
|
||||
@@ -108,6 +109,13 @@ const footerEnable = defineModel<boolean>('footerEnable');
|
||||
const footerFixed = defineModel<boolean>('footerFixed');
|
||||
|
||||
const copyrightEnable = defineModel<boolean>('copyrightEnable');
|
||||
const copyrightCompanyName = defineModel<string>('copyrightCompanyName');
|
||||
const copyrightCompanySiteLink = defineModel<string>(
|
||||
'copyrightCompanySiteLink',
|
||||
);
|
||||
const copyrightDate = defineModel<string>('copyrightDate');
|
||||
const copyrightIcp = defineModel<string>('copyrightIcp');
|
||||
const copyrightIcpLink = defineModel<string>('copyrightIcpLink');
|
||||
|
||||
const shortcutKeysEnable = defineModel<boolean>('shortcutKeysEnable');
|
||||
const shortcutKeysGlobalSearch = defineModel<boolean>(
|
||||
@@ -272,11 +280,12 @@ async function handleReset() {
|
||||
<Content v-model="appContentCompact" />
|
||||
</Block>
|
||||
|
||||
<Block :title="$t('preferences.sidebar')">
|
||||
<Block :title="$t('preferences.sidebar.title')">
|
||||
<Sidebar
|
||||
v-model:sidebar-collapsed="sidebarCollapsed"
|
||||
v-model:sidebar-collapsed-show-title="sidebarCollapsedShowTitle"
|
||||
v-model:sidebar-enable="sidebarEnable"
|
||||
v-model:sidebar-width="sidebarWidth"
|
||||
:disabled="!isSideMode"
|
||||
/>
|
||||
</Block>
|
||||
@@ -325,7 +334,14 @@ async function handleReset() {
|
||||
/>
|
||||
</Block>
|
||||
<Block :title="$t('preferences.copyright.title')">
|
||||
<Copyright v-model:copyright-enable="copyrightEnable" />
|
||||
<Copyright
|
||||
v-model:copyright-company-name="copyrightCompanyName"
|
||||
v-model:copyright-company-site-link="copyrightCompanySiteLink"
|
||||
v-model:copyright-date="copyrightDate"
|
||||
v-model:copyright-enable="copyrightEnable"
|
||||
v-model:copyright-icp="copyrightIcp"
|
||||
v-model:copyright-icp-link="copyrightIcpLink"
|
||||
/>
|
||||
</Block>
|
||||
</template>
|
||||
|
||||
|
Reference in New Issue
Block a user