Merge branch 'main' of https://github.com/vbenjs/vue-vben-admin into dev
commit
879de80857
|
@ -395,7 +395,7 @@ export interface FormCommonConfig {
|
||||||
* 所有表单项的栅格布局
|
* 所有表单项的栅格布局
|
||||||
* @default ""
|
* @default ""
|
||||||
*/
|
*/
|
||||||
formItemClass?: string;
|
formItemClass?: (() => string) | string;
|
||||||
/**
|
/**
|
||||||
* 隐藏所有表单项label
|
* 隐藏所有表单项label
|
||||||
* @default false
|
* @default false
|
||||||
|
|
|
@ -12,7 +12,12 @@ import type {
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
|
|
||||||
import { Form } from '@vben-core/shadcn-ui';
|
import { Form } from '@vben-core/shadcn-ui';
|
||||||
import { cn, isString, mergeWithArrayOverride } from '@vben-core/shared/utils';
|
import {
|
||||||
|
cn,
|
||||||
|
isFunction,
|
||||||
|
isString,
|
||||||
|
mergeWithArrayOverride,
|
||||||
|
} from '@vben-core/shared/utils';
|
||||||
|
|
||||||
import { provideFormRenderProps } from './context';
|
import { provideFormRenderProps } from './context';
|
||||||
import { useExpandable } from './expandable';
|
import { useExpandable } from './expandable';
|
||||||
|
@ -110,6 +115,17 @@ const computedSchema = computed(
|
||||||
? keepIndex <= index
|
? keepIndex <= index
|
||||||
: false;
|
: false;
|
||||||
|
|
||||||
|
// 处理函数形式的formItemClass
|
||||||
|
let resolvedSchemaFormItemClass = schema.formItemClass;
|
||||||
|
if (isFunction(schema.formItemClass)) {
|
||||||
|
try {
|
||||||
|
resolvedSchemaFormItemClass = schema.formItemClass();
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error calling formItemClass function:', error);
|
||||||
|
resolvedSchemaFormItemClass = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
colon,
|
colon,
|
||||||
disabled,
|
disabled,
|
||||||
|
@ -133,7 +149,7 @@ const computedSchema = computed(
|
||||||
'flex-shrink-0',
|
'flex-shrink-0',
|
||||||
{ hidden },
|
{ hidden },
|
||||||
formItemClass,
|
formItemClass,
|
||||||
schema.formItemClass,
|
resolvedSchemaFormItemClass,
|
||||||
),
|
),
|
||||||
labelClass: cn(labelClass, schema.labelClass),
|
labelClass: cn(labelClass, schema.labelClass),
|
||||||
};
|
};
|
||||||
|
|
|
@ -176,10 +176,10 @@ export interface FormCommonConfig {
|
||||||
*/
|
*/
|
||||||
formFieldProps?: FormFieldOptions;
|
formFieldProps?: FormFieldOptions;
|
||||||
/**
|
/**
|
||||||
* 所有表单项的栅格布局
|
* 所有表单项的栅格布局,支持函数形式
|
||||||
* @default ""
|
* @default ""
|
||||||
*/
|
*/
|
||||||
formItemClass?: string;
|
formItemClass?: (() => string) | string;
|
||||||
/**
|
/**
|
||||||
* 隐藏所有表单项label
|
* 隐藏所有表单项label
|
||||||
* @default false
|
* @default false
|
||||||
|
|
|
@ -85,7 +85,7 @@ useScrollLock();
|
||||||
<transition name="slide-left">
|
<transition name="slide-left">
|
||||||
<div v-show="!showUnlockForm" class="size-full">
|
<div v-show="!showUnlockForm" class="size-full">
|
||||||
<div
|
<div
|
||||||
class="flex-col-center text-foreground/80 hover:text-foreground group my-4 cursor-pointer text-xl font-semibold"
|
class="flex-col-center text-foreground/80 hover:text-foreground group fixed left-1/2 top-6 z-[2001] -translate-x-1/2 cursor-pointer text-xl font-semibold"
|
||||||
@click="toggleUnlockForm"
|
@click="toggleUnlockForm"
|
||||||
>
|
>
|
||||||
<LockKeyhole
|
<LockKeyhole
|
||||||
|
@ -93,22 +93,26 @@ useScrollLock();
|
||||||
/>
|
/>
|
||||||
<span>{{ $t('ui.widgets.lockScreen.unlock') }}</span>
|
<span>{{ $t('ui.widgets.lockScreen.unlock') }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex h-full justify-center px-[10%]">
|
<div class="flex h-full w-full items-center justify-center">
|
||||||
|
<div class="flex w-full justify-center gap-4 px-4 sm:gap-6 md:gap-8">
|
||||||
<div
|
<div
|
||||||
class="bg-accent flex-center relative mb-14 mr-20 h-4/5 w-2/5 flex-auto rounded-3xl text-center text-[260px]"
|
class="bg-accent relative flex h-[140px] w-[140px] items-center justify-center rounded-xl text-[36px] sm:h-[160px] sm:w-[160px] sm:text-[42px] md:h-[200px] md:w-[200px] md:text-[72px]"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
class="absolute left-3 top-3 text-xs font-semibold sm:text-sm md:text-xl"
|
||||||
>
|
>
|
||||||
<span class="absolute left-4 top-4 text-xl font-semibold">
|
|
||||||
{{ meridiem }}
|
{{ meridiem }}
|
||||||
</span>
|
</span>
|
||||||
{{ hour }}
|
{{ hour }}
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="bg-accent flex-center mb-14 h-4/5 w-2/5 flex-auto rounded-3xl text-center text-[260px]"
|
class="bg-accent flex h-[140px] w-[140px] items-center justify-center rounded-xl text-[36px] sm:h-[160px] sm:w-[160px] sm:text-[42px] md:h-[200px] md:w-[200px] md:text-[72px]"
|
||||||
>
|
>
|
||||||
{{ minute }}
|
{{ minute }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
|
|
||||||
<transition name="slide-right">
|
<transition name="slide-right">
|
||||||
|
@ -117,9 +121,8 @@ useScrollLock();
|
||||||
class="flex-center size-full"
|
class="flex-center size-full"
|
||||||
@keydown.enter.prevent="handleSubmit"
|
@keydown.enter.prevent="handleSubmit"
|
||||||
>
|
>
|
||||||
<div class="flex-col-center mb-10 w-[300px]">
|
<div class="flex-col-center mb-10 w-[90%] max-w-[300px] px-4">
|
||||||
<VbenAvatar :src="avatar" class="enter-x mb-6 size-20" />
|
<VbenAvatar :src="avatar" class="enter-x mb-6 size-20" />
|
||||||
|
|
||||||
<div class="enter-x mb-2 w-full items-center">
|
<div class="enter-x mb-2 w-full items-center">
|
||||||
<Form />
|
<Form />
|
||||||
</div>
|
</div>
|
||||||
|
@ -145,12 +148,13 @@ useScrollLock();
|
||||||
</transition>
|
</transition>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="enter-y absolute bottom-5 w-full text-center xl:text-xl 2xl:text-3xl"
|
class="enter-y absolute bottom-5 w-full text-center text-xl md:text-2xl xl:text-xl 2xl:text-3xl"
|
||||||
>
|
>
|
||||||
<div v-if="showUnlockForm" class="enter-x mb-2 text-3xl">
|
<div v-if="showUnlockForm" class="enter-x mb-2 text-2xl md:text-3xl">
|
||||||
{{ hour }}:{{ minute }} <span class="text-lg">{{ meridiem }}</span>
|
{{ hour }}:{{ minute }}
|
||||||
|
<span class="text-base md:text-lg">{{ meridiem }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-3xl">{{ date }}</div>
|
<div class="text-xl md:text-3xl">{{ date }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -300,7 +300,7 @@ async function init() {
|
||||||
const enableProxyConfig = options.value.proxyConfig?.enabled;
|
const enableProxyConfig = options.value.proxyConfig?.enabled;
|
||||||
if (enableProxyConfig && autoLoad) {
|
if (enableProxyConfig && autoLoad) {
|
||||||
props.api.grid.commitProxy?.(
|
props.api.grid.commitProxy?.(
|
||||||
'_init',
|
'initial',
|
||||||
formOptions.value ? ((await formApi.getValues()) ?? {}) : {},
|
formOptions.value ? ((await formApi.getValues()) ?? {}) : {},
|
||||||
);
|
);
|
||||||
// props.api.reload(formApi.form?.values ?? {});
|
// props.api.reload(formApi.form?.values ?? {});
|
||||||
|
|
|
@ -55,7 +55,7 @@ const gridOptions: VxeGridProps<RowType> = {
|
||||||
custom: true,
|
custom: true,
|
||||||
export: true,
|
export: true,
|
||||||
// import: true,
|
// import: true,
|
||||||
refresh: { code: 'query' },
|
refresh: true,
|
||||||
zoom: true,
|
zoom: true,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -204,8 +204,8 @@ catalog:
|
||||||
vue-router: ^4.5.1
|
vue-router: ^4.5.1
|
||||||
vue-tippy: ^6.7.1
|
vue-tippy: ^6.7.1
|
||||||
vue-tsc: 2.2.10
|
vue-tsc: 2.2.10
|
||||||
vxe-pc-ui: ^4.6.42
|
vxe-pc-ui: ^4.7.12
|
||||||
vxe-table: ^4.13.51
|
vxe-table: ^4.14.4
|
||||||
watermark-js-plus: ^1.6.2
|
watermark-js-plus: ^1.6.2
|
||||||
zod: ^3.25.67
|
zod: ^3.25.67
|
||||||
zod-defaults: ^0.1.3
|
zod-defaults: ^0.1.3
|
||||||
|
|
Loading…
Reference in New Issue