Merge remote-tracking branch 'refs/remotes/yudao/dev' into develop

This commit is contained in:
puhui999
2025-05-03 13:49:52 +08:00
283 changed files with 10304 additions and 3435 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@vben/access",
"version": "5.5.4",
"version": "5.5.5",
"homepage": "https://github.com/vbenjs/vue-vben-admin",
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
"repository": {

View File

@@ -42,7 +42,15 @@ async function generateAccessible(
delete route.component;
}
// 根据router name判断如果路由已经存在则不再添加
if (!names?.includes(route.name)) {
if (names?.includes(route.name)) {
// 找到已存在的路由索引并更新不更新会造成切换用户时一级目录未更新homePath 在二级目录导致的404问题
const index = root.children?.findIndex(
(item) => item.name === route.name,
);
if (index !== undefined && index !== -1 && root.children) {
root.children[index] = route;
}
} else {
root.children?.push(route);
}
} else {

View File

@@ -1,6 +1,6 @@
{
"name": "@vben/common-ui",
"version": "5.5.4",
"version": "5.5.5",
"homepage": "https://github.com/vbenjs/vue-vben-admin",
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
"repository": {

View File

@@ -9,7 +9,7 @@ export function useCaptchaPoints() {
}
function clearPoints() {
points.splice(0, points.length);
points.splice(0);
}
return {
addPoint,

View File

@@ -165,13 +165,18 @@ const searchInputProps = computed(() => {
};
});
function updateCurrentSelect(v: string) {
currentSelect.value = v;
}
defineExpose({ toggleOpenState, open, close });
</script>
<template>
<VbenPopover
v-model:open="visible"
:content-props="{ align: 'end', alignOffset: -11, sideOffset: 8 }"
content-class="p-0 pt-3"
content-class="p-0 pt-3 w-full"
trigger-class="w-full"
>
<template #trigger>
<template v-if="props.type === 'input'">
@@ -183,6 +188,7 @@ defineExpose({ toggleOpenState, open, close });
role="combobox"
:aria-label="$t('ui.iconPicker.placeholder')"
aria-expanded="visible"
:[`onUpdate:${modelValueProp}`]="updateCurrentSelect"
v-bind="$attrs"
>
<template #[iconSlot]>

View File

@@ -65,7 +65,7 @@
&.jv-string {
color: hsl(var(--primary));
word-break: break-word;
overflow-wrap: break-word;
white-space: normal;
}
}

View File

@@ -12,7 +12,8 @@ defineOptions({
name: 'Page',
});
const { autoContentHeight = false } = defineProps<PageProps>();
const { autoContentHeight = false, heightOffset = 0 } =
defineProps<PageProps>();
const headerHeight = ref(0);
const footerHeight = ref(0);
@@ -26,7 +27,7 @@ const docRef = useTemplateRef<HTMLDivElement>('docRef');
const contentStyle = computed<StyleValue>(() => {
if (autoContentHeight) {
return {
height: `calc(var(${CSS_VARIABLE_LAYOUT_CONTENT_HEIGHT}) - ${headerHeight.value}px - ${docHeight.value}px)`,
height: `calc(var(${CSS_VARIABLE_LAYOUT_CONTENT_HEIGHT}) - ${headerHeight.value}px - ${docHeight.value}px - ${typeof heightOffset === 'number' ? `${heightOffset}px` : heightOffset})`,
overflowY: shouldAutoHeight.value ? 'auto' : 'unset',
};
}
@@ -61,7 +62,9 @@ onMounted(() => {
v-if="$slots.doc && isDocAlertEnable()"
ref="docRef"
:class="
cn('bg-card border-border relative flex items-end border-b px-6 py-4')
cn(
'bg-card border-border relative flex items-end rounded-md border-b p-4',
)
"
>
<div class="flex-auto">

View File

@@ -8,4 +8,10 @@ export interface PageProps {
autoContentHeight?: boolean;
headerClass?: string;
footerClass?: string;
/**
* Custom height offset value (in pixels) to adjust content area sizing
* when used with autoContentHeight
* @default 0
*/
heightOffset?: number;
}

View File

@@ -37,7 +37,7 @@ defineOptions({
面试手册
</a>
<a
href="http://static.yudao.iocoder.cn/mp/Aix9975.jpeg"
href="http://static.yudao.iocoder.cn/mp/xinyu370.jpeg"
target="_blank"
class="text-primary hover:text-primary/80 text-sm"
>

View File

@@ -35,6 +35,16 @@ const getZIndex = computed(() => {
return props.zIndex || calcZIndex();
});
/**
* 排除ant-message和loading:9999的z-index
*/
const zIndexExcludeClass = ['ant-message', 'loading'];
function isZIndexExcludeClass(element: Element) {
return zIndexExcludeClass.some((className) =>
element.classList.contains(className),
);
}
/**
* 获取最大的zIndex值
*/
@@ -44,7 +54,11 @@ function calcZIndex() {
[...elements].forEach((element) => {
const style = window.getComputedStyle(element);
const zIndex = style.getPropertyValue('z-index');
if (zIndex && !Number.isNaN(Number.parseInt(zIndex))) {
if (
zIndex &&
!Number.isNaN(Number.parseInt(zIndex)) &&
!isZIndexExcludeClass(element)
) {
maxZ = Math.max(maxZ, Number.parseInt(zIndex));
}
});

View File

@@ -18,7 +18,7 @@ import DocLink from './doc-link.vue';
import ThirdPartyLogin from './third-party-login.vue';
interface Props extends AuthenticationProps {
formSchema: VbenFormSchema[];
formSchema?: VbenFormSchema[];
}
defineOptions({

View File

@@ -14,7 +14,7 @@ import { VbenButton } from '@vben-core/shadcn-ui';
import Title from './auth-title.vue';
interface Props {
formSchema: VbenFormSchema[];
formSchema?: VbenFormSchema[];
/**
* @zh_CN 是否处于加载处理状态
*/

View File

@@ -6,7 +6,7 @@ import { computed } from 'vue';
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@vben-core/shadcn-ui';
interface Props {
tabs: TabOption[];
tabs?: TabOption[];
}
defineOptions({

View File

@@ -12,7 +12,7 @@ import {
} from '@vben-core/shadcn-ui';
interface Props {
items: AnalysisOverviewItem[];
items?: AnalysisOverviewItem[];
}
defineOptions({

View File

@@ -10,7 +10,7 @@ import {
} from '@vben-core/shadcn-ui';
interface Props {
items: WorkbenchProjectItem[];
items?: WorkbenchProjectItem[];
title: string;
}
@@ -37,6 +37,8 @@ defineEmits(['click']);
'border-r-0': index % 3 === 2,
'border-b-0': index < 3,
'pb-4': index > 2,
'rounded-bl-xl': index === items.length - 3,
'rounded-br-xl': index === items.length - 1,
}"
class="border-border group w-full cursor-pointer border-r border-t p-4 transition-all hover:shadow-xl md:w-1/2 lg:w-1/3"
>

View File

@@ -10,7 +10,7 @@ import {
} from '@vben-core/shadcn-ui';
interface Props {
items: WorkbenchQuickNavItem[];
items?: WorkbenchQuickNavItem[];
title: string;
}
@@ -35,8 +35,10 @@ defineEmits(['click']);
<div
:class="{
'border-r-0': index % 3 === 2,
'pb-4': index > 2,
'border-b-0': index < 3,
'pb-4': index > 2,
'rounded-bl-xl': index === items.length - 3,
'rounded-br-xl': index === items.length - 1,
}"
class="flex-col-center border-border group w-1/3 cursor-pointer border-r border-t py-8 hover:shadow-xl"
@click="$emit('click', item)"

View File

@@ -10,7 +10,7 @@ import {
} from '@vben-core/shadcn-ui';
interface Props {
items: WorkbenchTodoItem[];
items?: WorkbenchTodoItem[];
title: string;
}

View File

@@ -10,7 +10,7 @@ import {
} from '@vben-core/shadcn-ui';
interface Props {
items: WorkbenchTrendItem[];
items?: WorkbenchTrendItem[];
title: string;
}

View File

@@ -1,6 +1,6 @@
{
"name": "@vben/hooks",
"version": "5.5.4",
"version": "5.5.5",
"homepage": "https://github.com/vbenjs/vue-vben-admin",
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
"repository": {

View File

@@ -1,6 +1,6 @@
{
"name": "@vben/layouts",
"version": "5.5.4",
"version": "5.5.5",
"homepage": "https://github.com/vbenjs/vue-vben-admin",
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
"repository": {

View File

@@ -1,8 +1,8 @@
<script lang="ts" setup>
interface Props {
companyName: string;
companyName?: string;
companySiteLink?: string;
date: string;
date?: string;
icp?: string;
icpLink?: string;
}

View File

@@ -12,7 +12,7 @@ import {
updatePreferences,
usePreferences,
} from '@vben/preferences';
import { useLockStore } from '@vben/stores';
import { useAccessStore } from '@vben/stores';
import { cloneDeep, mapTree } from '@vben/utils';
import { VbenAdminLayout } from '@vben-core/layout-ui';
@@ -49,7 +49,7 @@ const {
sidebarCollapsed,
theme,
} = usePreferences();
const lockStore = useLockStore();
const accessStore = useAccessStore();
const { refresh } = useRefresh();
const sidebarTheme = computed(() => {
@@ -356,7 +356,7 @@ const headerSlots = computed(() => {
/>
<Transition v-if="preferences.widget.lockScreen" name="slide-up">
<slot v-if="lockStore.isLockScreen" name="lock-screen"></slot>
<slot v-if="accessStore.isLockScreen" name="lock-screen"></slot>
</Transition>
<template v-if="preferencesButtonPosition.fixed">

View File

@@ -11,7 +11,7 @@ import { useNavigation } from './use-navigation';
interface Props extends MenuProps {
collapse?: boolean;
menus: MenuRecordRaw[];
menus?: MenuRecordRaw[];
}
withDefaults(defineProps<Props>(), {

View File

@@ -6,7 +6,7 @@ import type { MenuProps } from '@vben-core/menu-ui';
import { Menu } from '@vben-core/menu-ui';
interface Props extends MenuProps {
menus: MenuRecordRaw[];
menus?: MenuRecordRaw[];
}
const props = withDefaults(defineProps<Props>(), {

View File

@@ -24,7 +24,7 @@ defineOptions({
});
const props = withDefaults(
defineProps<{ enableShortcutKey?: boolean; menus: MenuRecordRaw[] }>(),
defineProps<{ enableShortcutKey?: boolean; menus?: MenuRecordRaw[] }>(),
{
enableShortcutKey: true,
menus: () => [],

View File

@@ -18,7 +18,7 @@ defineOptions({
});
const props = withDefaults(
defineProps<{ keyword: string; menus: MenuRecordRaw[] }>(),
defineProps<{ keyword?: string; menus?: MenuRecordRaw[] }>(),
{
keyword: '',
menus: () => [],

View File

@@ -3,7 +3,7 @@ import { computed, reactive, ref } from 'vue';
import { LockKeyhole } from '@vben/icons';
import { $t, useI18n } from '@vben/locales';
import { storeToRefs, useLockStore } from '@vben/stores';
import { storeToRefs, useAccessStore } from '@vben/stores';
import { useScrollLock } from '@vben-core/composables';
import { useVbenForm, z } from '@vben-core/form-ui';
@@ -26,7 +26,7 @@ withDefaults(defineProps<Props>(), {
defineEmits<{ toLogin: [] }>();
const { locale } = useI18n();
const lockStore = useLockStore();
const accessStore = useAccessStore();
const now = useNow();
const meridiem = useDateFormat(now, 'A');
@@ -35,7 +35,7 @@ const minute = useDateFormat(now, 'mm');
const date = useDateFormat(now, 'YYYY-MM-DD dddd', { locales: locale.value });
const showUnlockForm = ref(false);
const { lockScreenPassword } = storeToRefs(lockStore);
const { lockScreenPassword } = storeToRefs(accessStore);
const [Form, { form, validate }] = useVbenForm(
reactive({
@@ -66,7 +66,7 @@ async function handleSubmit() {
const { valid } = await validate();
if (valid) {
if (validPass.value) {
lockStore.unlockScreen();
accessStore.unlockScreen();
} else {
form.setFieldError('password', $t('authentication.passwordErrorTip'));
}

View File

@@ -14,7 +14,7 @@ defineOptions({
withDefaults(
defineProps<{
disabled?: boolean;
items: SelectOption[];
items?: SelectOption[];
multiple?: boolean;
onBtnClick?: (value: string) => void;
placeholder?: string;

View File

@@ -79,14 +79,14 @@ const handleCheckboxChange = () => {
</SwitchItem>
<CheckboxItem
:items="[
{ label: '收缩按钮', value: 'collapsed' },
{ label: '固定按钮', value: 'fixed' },
{ label: $t('preferences.sidebar.buttonCollapsed'), value: 'collapsed' },
{ label: $t('preferences.sidebar.buttonFixed'), value: 'fixed' },
]"
multiple
v-model="sidebarButtons"
:on-btn-click="handleCheckboxChange"
>
按钮配置
{{ $t('preferences.sidebar.buttons') }}
</CheckboxItem>
<NumberFieldItem
v-model="sidebarWidth"

View File

@@ -7,7 +7,7 @@ defineOptions({
name: 'PreferenceToggleItem',
});
withDefaults(defineProps<{ disabled?: boolean; items: SelectOption[] }>(), {
withDefaults(defineProps<{ disabled?: boolean; items?: SelectOption[] }>(), {
disabled: false,
items: () => [],
});

View File

@@ -9,7 +9,7 @@ import { useHoverToggle } from '@vben/hooks';
import { LockKeyhole, LogOut } from '@vben/icons';
import { $t } from '@vben/locales';
import { preferences, usePreferences } from '@vben/preferences';
import { useLockStore } from '@vben/stores';
import { useAccessStore } from '@vben/stores';
import { isWindowsOs } from '@vben/utils';
import { useVbenModal } from '@vben-core/popup-ui';
@@ -82,7 +82,7 @@ const emit = defineEmits<{ logout: [] }>();
const { globalLockScreenShortcutKey, globalLogoutShortcutKey } =
usePreferences();
const lockStore = useLockStore();
const accessStore = useAccessStore();
const [LockModal, lockModalApi] = useVbenModal({
connectedComponent: LockScreenModal,
});
@@ -133,7 +133,7 @@ function handleOpenLock() {
function handleSubmitLock(lockScreenPassword: string) {
lockModalApi.close();
lockStore.lockScreen(lockScreenPassword);
accessStore.lockScreen(lockScreenPassword);
}
function handleLogout() {

View File

@@ -1,6 +1,6 @@
{
"name": "@vben/plugins",
"version": "5.5.4",
"version": "5.5.5",
"homepage": "https://github.com/vbenjs/vue-vben-admin",
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
"repository": {

View File

@@ -24,8 +24,8 @@ export function useVbenVxeGrid(options: VxeGridProps) {
return () => h(VxeGrid, { ...props, ...attrs, api: extendedApi }, slots);
},
{
inheritAttrs: false,
name: 'VbenVxeGrid',
inheritAttrs: false,
},
);
// Add reactivity support

View File

@@ -1,6 +1,6 @@
{
"name": "@vben/request",
"version": "5.5.4",
"version": "5.5.5",
"homepage": "https://github.com/vbenjs/vue-vben-admin",
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
"repository": {