|
|
|
@ -29,7 +29,13 @@ import { usePriorityValues } from '@vben/hooks';
|
|
|
|
import { EmptyIcon } from '@vben/icons';
|
|
|
|
import { EmptyIcon } from '@vben/icons';
|
|
|
|
import { $t } from '@vben/locales';
|
|
|
|
import { $t } from '@vben/locales';
|
|
|
|
import { usePreferences } from '@vben/preferences';
|
|
|
|
import { usePreferences } from '@vben/preferences';
|
|
|
|
import { cloneDeep, cn, isEqual, mergeWithArrayOverride } from '@vben/utils';
|
|
|
|
import {
|
|
|
|
|
|
|
|
cloneDeep,
|
|
|
|
|
|
|
|
cn,
|
|
|
|
|
|
|
|
isBoolean,
|
|
|
|
|
|
|
|
isEqual,
|
|
|
|
|
|
|
|
mergeWithArrayOverride,
|
|
|
|
|
|
|
|
} from '@vben/utils';
|
|
|
|
|
|
|
|
|
|
|
|
import { VbenHelpTooltip, VbenLoading } from '@vben-core/shadcn-ui';
|
|
|
|
import { VbenHelpTooltip, VbenLoading } from '@vben-core/shadcn-ui';
|
|
|
|
|
|
|
|
|
|
|
|
@ -67,10 +73,30 @@ const {
|
|
|
|
tableTitle,
|
|
|
|
tableTitle,
|
|
|
|
tableTitleHelp,
|
|
|
|
tableTitleHelp,
|
|
|
|
showSearchForm,
|
|
|
|
showSearchForm,
|
|
|
|
|
|
|
|
separator,
|
|
|
|
} = usePriorityValues(props, state);
|
|
|
|
} = usePriorityValues(props, state);
|
|
|
|
|
|
|
|
|
|
|
|
const { isMobile } = usePreferences();
|
|
|
|
const { isMobile } = usePreferences();
|
|
|
|
|
|
|
|
const isSeparator = computed(() => {
|
|
|
|
|
|
|
|
if (
|
|
|
|
|
|
|
|
!formOptions.value ||
|
|
|
|
|
|
|
|
showSearchForm.value === false ||
|
|
|
|
|
|
|
|
separator.value === false
|
|
|
|
|
|
|
|
) {
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (separator.value === true || separator.value === undefined) {
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return separator.value.show !== false;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
const separatorBg = computed(() => {
|
|
|
|
|
|
|
|
return !separator.value ||
|
|
|
|
|
|
|
|
isBoolean(separator.value) ||
|
|
|
|
|
|
|
|
!separator.value.backgroundColor
|
|
|
|
|
|
|
|
? undefined
|
|
|
|
|
|
|
|
: separator.value.backgroundColor;
|
|
|
|
|
|
|
|
});
|
|
|
|
const slots: SetupContext['slots'] = useSlots();
|
|
|
|
const slots: SetupContext['slots'] = useSlots();
|
|
|
|
|
|
|
|
|
|
|
|
const [Form, formApi] = useTableForm({
|
|
|
|
const [Form, formApi] = useTableForm({
|
|
|
|
@ -375,7 +401,18 @@ onUnmounted(() => {
|
|
|
|
<div
|
|
|
|
<div
|
|
|
|
v-if="formOptions"
|
|
|
|
v-if="formOptions"
|
|
|
|
v-show="showSearchForm !== false"
|
|
|
|
v-show="showSearchForm !== false"
|
|
|
|
:class="cn('relative rounded py-3', isCompactForm ? 'pb-8' : 'pb-4')"
|
|
|
|
:class="
|
|
|
|
|
|
|
|
cn(
|
|
|
|
|
|
|
|
'relative rounded py-3',
|
|
|
|
|
|
|
|
isCompactForm
|
|
|
|
|
|
|
|
? isSeparator
|
|
|
|
|
|
|
|
? 'pb-8'
|
|
|
|
|
|
|
|
: 'pb-4'
|
|
|
|
|
|
|
|
: isSeparator
|
|
|
|
|
|
|
|
? 'pb-4'
|
|
|
|
|
|
|
|
: 'pb-0',
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<slot name="form">
|
|
|
|
<slot name="form">
|
|
|
|
<Form>
|
|
|
|
<Form>
|
|
|
|
@ -404,6 +441,10 @@ onUnmounted(() => {
|
|
|
|
</Form>
|
|
|
|
</Form>
|
|
|
|
</slot>
|
|
|
|
</slot>
|
|
|
|
<div
|
|
|
|
<div
|
|
|
|
|
|
|
|
v-if="isSeparator"
|
|
|
|
|
|
|
|
:style="{
|
|
|
|
|
|
|
|
...(separatorBg ? { backgroundColor: separatorBg } : undefined),
|
|
|
|
|
|
|
|
}"
|
|
|
|
class="bg-background-deep z-100 absolute -left-2 bottom-1 h-2 w-[calc(100%+1rem)] overflow-hidden md:bottom-2 md:h-3"
|
|
|
|
class="bg-background-deep z-100 absolute -left-2 bottom-1 h-2 w-[calc(100%+1rem)] overflow-hidden md:bottom-2 md:h-3"
|
|
|
|
></div>
|
|
|
|
></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|