|
|
|
@ -29,7 +29,13 @@ import { usePriorityValues } from '@vben/hooks'; |
|
|
|
import { EmptyIcon } from '@vben/icons'; |
|
|
|
import { $t } from '@vben/locales'; |
|
|
|
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'; |
|
|
|
|
|
|
|
@ -67,10 +73,30 @@ const { |
|
|
|
tableTitle, |
|
|
|
tableTitleHelp, |
|
|
|
showSearchForm, |
|
|
|
separator, |
|
|
|
} = usePriorityValues(props, state); |
|
|
|
|
|
|
|
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 [Form, formApi] = useTableForm({ |
|
|
|
@ -375,7 +401,18 @@ onUnmounted(() => { |
|
|
|
<div |
|
|
|
v-if="formOptions" |
|
|
|
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"> |
|
|
|
<Form> |
|
|
|
@ -404,6 +441,10 @@ onUnmounted(() => { |
|
|
|
</Form> |
|
|
|
</slot> |
|
|
|
<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" |
|
|
|
></div> |
|
|
|
</div> |
|
|
|
|