fix: 订单数据流抽屉全量任务表占满剩余高度

This commit is contained in:
2026-09-05 18:14:43 +08:00
parent 2194fbe3c3
commit d99d8352b6
@@ -1,7 +1,7 @@
<script lang="ts" setup> <script lang="ts" setup>
/** /**
* 店铺订单管线抽屉:同步 / 转换 / 计算 三阶段合一。 * 店铺订单管线抽屉:同步 / 转换 / 计算 三阶段合一。
* 顶区状态+动作;历史全量任务用紧凑表;创建全量内联,不再套第二层弹窗。 * 顶区状态+动作;历史全量任务用紧凑表;创建全量走模态框。
* shopId 为经营店铺 id(API 约定);可由渠道店页传入仅含 id/name 的引用。 * shopId 为经营店铺 id(API 约定);可由渠道店页传入仅含 id/name 的引用。
*/ */
import type { PddOrderSyncVO } from '#/api/channel/pdd/order-sync'; import type { PddOrderSyncVO } from '#/api/channel/pdd/order-sync';
@@ -9,7 +9,9 @@ import type { PddOrderConvertVO } from '#/api/channel/pdd/order-convert';
import type { BiOrderStatCalcVO } from '#/api/bi/order-stat-calc'; import type { BiOrderStatCalcVO } from '#/api/bi/order-stat-calc';
import type { Dayjs } from 'dayjs'; import type { Dayjs } from 'dayjs';
import { computed, onBeforeUnmount, ref, watch } from 'vue'; import { computed, nextTick, onBeforeUnmount, ref, watch } from 'vue';
import { useVbenModal } from '@vben/common-ui';
import { import {
Alert, Alert,
@@ -18,7 +20,6 @@ import {
Drawer, Drawer,
Form, Form,
Progress, Progress,
Radio,
Segmented, Segmented,
Space, Space,
Switch, Switch,
@@ -112,16 +113,28 @@ const syncTasks = ref<PddOrderSyncVO.FullTask[]>([]);
const syncListLoading = ref(false); const syncListLoading = ref(false);
const syncActionLoading = ref(false); const syncActionLoading = ref(false);
const incSubmitting = ref(false); const incSubmitting = ref(false);
const createOpen = ref(false); /** 当前创建表单所属阶段 */
const createSubmitting = ref(false);
const createMode = ref<'day' | 'range'>('range');
/** 当前内联创建表单所属阶段 */
const createForStage = ref<PipelineStageKey>('sync'); const createForStage = ref<PipelineStageKey>('sync');
const confirmDate = ref<Dayjs>(dayjs().startOf('day'));
const range = ref<[Dayjs, Dayjs]>([ const range = ref<[Dayjs, Dayjs]>([
dayjs().startOf('day').subtract(FULL_SYNC_MAX_CALENDAR_DAYS - 1, 'day'), dayjs().startOf('day').subtract(FULL_SYNC_MAX_CALENDAR_DAYS - 1, 'day'),
dayjs().startOf('day'), dayjs().startOf('day'),
]); ]);
/**
* 与 ProductDetailModal 同款 useVbenModal。
* zIndex 须高于 ant DesignTokens.zIndexPopupBase(2000),否则会被本页 Drawer 挡住。
*/
const [CreateFullModal, createFullModalApi] = useVbenModal({
title: '创建全量任务',
class: 'w-[480px] max-w-[calc(100vw-2rem)]',
draggable: true,
zIndex: 2100,
confirmText: '创建并开始',
cancelText: '取消',
destroyOnClose: true,
onConfirm: () => handleCreateTask(),
});
let pollTimer: null | ReturnType<typeof setInterval> = null; let pollTimer: null | ReturnType<typeof setInterval> = null;
let unsubProgress: (() => void) | null = null; let unsubProgress: (() => void) | null = null;
const terminalNotifiedTaskIds = new Set<number>(); const terminalNotifiedTaskIds = new Set<number>();
@@ -151,6 +164,21 @@ const stageOptions = computed(() =>
const showStageTabs = computed(() => enabledStages.value.length > 1); const showStageTabs = computed(() => enabledStages.value.length > 1);
const createModalTitle = computed(() => {
const name = shop.value?.name ? ` · ${shop.value.name}` : '';
return `创建全量${STAGE_LABEL[createForStage.value]}${name}`;
});
const createDateRangeLabel = computed(() => {
if (createForStage.value === 'convert') {
return '成交日区间(近 90 天,按渠道镜像扫日)';
}
if (createForStage.value === 'calc') {
return '统计日区间(近 90 天,按内部订单重算)';
}
return '成交日区间(近 90 天)';
});
const hasActiveSyncTask = computed(() => const hasActiveSyncTask = computed(() =>
syncTasks.value.some((t) => t.status === 'PENDING' || t.status === 'RUNNING'), syncTasks.value.some((t) => t.status === 'PENDING' || t.status === 'RUNNING'),
); );
@@ -537,45 +565,47 @@ async function handleResumeFull(task: PddOrderSyncVO.FullTask) {
function openCreateForm(forStage: PipelineStageKey = 'sync') { function openCreateForm(forStage: PipelineStageKey = 'sync') {
createForStage.value = forStage; createForStage.value = forStage;
createMode.value = 'range';
confirmDate.value = fullSyncLatest();
range.value = [fullSyncEarliest(), fullSyncLatest()]; range.value = [fullSyncEarliest(), fullSyncLatest()];
createOpen.value = true; createFullModalApi.setState({ title: createModalTitle.value });
createFullModalApi.open();
}
/** 快捷将区间设为今天(单日全量) */
function setCreateRangeToToday() {
const today = fullSyncLatest();
range.value = [today, today];
} }
async function handleCreateTask() { async function handleCreateTask() {
if (!shop.value) return; if (!shop.value) {
if (createMode.value === 'day' && !confirmDate.value) { return Promise.reject(new Error('no shop'));
message.warning('请选择成交日期');
return;
} }
if (createMode.value === 'range' && (!range.value?.[0] || !range.value?.[1])) { if (!range.value?.[0] || !range.value?.[1]) {
message.warning('请选择日期区间'); message.warning('请选择日期区间');
return; return Promise.reject(new Error('invalid range'));
} }
const from = const from = range.value[0];
createMode.value === 'day' ? confirmDate.value : range.value[0]; const to = range.value[1];
const to = createMode.value === 'day' ? confirmDate.value : range.value[1];
if ( if (
disabledFullSyncDate(from) || disabledFullSyncDate(from) ||
disabledFullSyncDate(to) || disabledFullSyncDate(to) ||
to.isBefore(from, 'day') to.isBefore(from, 'day')
) { ) {
message.warning('日期须在近 90 天内,且结束不早于开始'); message.warning('日期须在近 90 天内,且结束不早于开始');
return; return Promise.reject(new Error('date out of range'));
} }
const stageKey = createForStage.value; const stageKey = createForStage.value;
if (stageKey === 'sync' && hasActiveSyncTask.value) { if (stageKey === 'sync' && hasActiveSyncTask.value) {
message.warning('已有进行中的全量同步任务'); message.warning('已有进行中的全量同步任务');
return; return Promise.reject(new Error('active sync'));
} }
if (stageKey === 'convert' && hasActiveConvertTask.value) { if (stageKey === 'convert' && hasActiveConvertTask.value) {
message.warning('已有进行中的全量转换任务'); message.warning('已有进行中的全量转换任务');
return; return Promise.reject(new Error('active convert'));
} }
if (stageKey === 'calc' && hasActiveCalcTask.value) { if (stageKey === 'calc' && hasActiveCalcTask.value) {
message.warning('已有进行中的全量计算任务'); message.warning('已有进行中的全量计算任务');
return; return Promise.reject(new Error('active calc'));
} }
const payload = { const payload = {
shopId: shop.value.id, shopId: shop.value.id,
@@ -583,7 +613,7 @@ async function handleCreateTask() {
dateTo: to.format('YYYY-MM-DD'), dateTo: to.format('YYYY-MM-DD'),
}; };
try { try {
createSubmitting.value = true; createFullModalApi.setState({ confirmLoading: true });
if (stageKey === 'sync') { if (stageKey === 'sync') {
const task = await createPddFullSyncTaskApi(payload); const task = await createPddFullSyncTaskApi(payload);
terminalNotifiedTaskIds.delete(task.id); terminalNotifiedTaskIds.delete(task.id);
@@ -599,12 +629,13 @@ async function handleCreateTask() {
calcTasks.value.unshift(task); calcTasks.value.unshift(task);
message.success('全量计算任务已创建'); message.success('全量计算任务已创建');
} }
createOpen.value = false; createFullModalApi.close();
emit('success'); emit('success');
} catch (e) { } catch (e) {
console.error(e); console.error(e);
return Promise.reject(e);
} finally { } finally {
createSubmitting.value = false; createFullModalApi.setState({ confirmLoading: false });
} }
} }
@@ -641,7 +672,7 @@ async function handleResumeCalc() {
function handleClose() { function handleClose() {
stopPoll(); stopPoll();
unsubscribeProgress(); unsubscribeProgress();
createOpen.value = false; createFullModalApi.close();
openFlag.value = false; openFlag.value = false;
} }
@@ -663,7 +694,7 @@ async function open(
convertTasks.value = []; convertTasks.value = [];
calcInc.value = null; calcInc.value = null;
calcTasks.value = []; calcTasks.value = [];
createOpen.value = false; createFullModalApi.close();
terminalNotifiedTaskIds.clear(); terminalNotifiedTaskIds.clear();
stopPoll(); stopPoll();
subscribeProgress(); subscribeProgress();
@@ -673,23 +704,84 @@ async function open(
await loadStage(stage.value); await loadStage(stage.value);
} finally { } finally {
pageLoading.value = false; pageLoading.value = false;
scheduleMeasureTableScrollY();
} }
} }
/** 全量任务表滚动高度:吃满抽屉剩余空间 */
const tableScrollY = ref(360);
const pipelineBodyRef = ref<HTMLElement | null>(null);
let tableHostRo: null | ResizeObserver = null;
/**
* v-show 隐藏时祖先 display:none,子节点 computed display 仍非 none,
* 必须用布局尺寸判断,否则会一直量到排在前面的同步宿主(高度 0 → scroll.y=120)。
*/
function measureTableScrollY() {
const root = pipelineBodyRef.value;
if (!root) return;
const hosts = root.querySelectorAll<HTMLElement>('.pipeline-table-host');
for (const host of hosts) {
if (host.getClientRects().length === 0 || host.clientHeight < 40) continue;
// small 表头约 39px,略留缝
tableScrollY.value = Math.max(120, Math.floor(host.clientHeight - 40));
return;
}
}
function scheduleMeasureTableScrollY() {
void nextTick(() => {
requestAnimationFrame(() => {
measureTableScrollY();
// 抽屉动画 / 分段切换后再量一次,避免首帧高度未撑开
requestAnimationFrame(measureTableScrollY);
});
});
}
function bindTableHostObserver() {
tableHostRo?.disconnect();
tableHostRo = null;
const root = pipelineBodyRef.value;
if (!root || typeof ResizeObserver === 'undefined') {
scheduleMeasureTableScrollY();
return;
}
tableHostRo = new ResizeObserver(() => measureTableScrollY());
tableHostRo.observe(root);
for (const host of root.querySelectorAll('.pipeline-table-host')) {
tableHostRo.observe(host);
}
scheduleMeasureTableScrollY();
}
watch(stage, async (s) => { watch(stage, async (s) => {
if (!openFlag.value || !shop.value) return; if (!openFlag.value || !shop.value) return;
createOpen.value = false; createFullModalApi.close();
pageLoading.value = true; pageLoading.value = true;
try { try {
await loadStage(s); await loadStage(s);
} finally { } finally {
pageLoading.value = false; pageLoading.value = false;
scheduleMeasureTableScrollY();
}
});
watch(openFlag, (open) => {
if (open) {
scheduleMeasureTableScrollY();
void nextTick(() => bindTableHostObserver());
} else {
tableHostRo?.disconnect();
tableHostRo = null;
} }
}); });
onBeforeUnmount(() => { onBeforeUnmount(() => {
stopPoll(); stopPoll();
unsubscribeProgress(); unsubscribeProgress();
tableHostRo?.disconnect();
tableHostRo = null;
}); });
defineExpose({ open, close: handleClose }); defineExpose({ open, close: handleClose });
@@ -702,18 +794,23 @@ defineExpose({ open, close: handleClose });
:width="640" :width="640"
destroy-on-close destroy-on-close
:mask-closable="!hasActiveSyncTask" :mask-closable="!hasActiveSyncTask"
root-class-name="shop-order-pipeline-drawer"
@close="handleClose" @close="handleClose"
> >
<div class="flex h-full min-h-0 flex-col gap-4"> <div
ref="pipelineBodyRef"
class="flex min-h-0 flex-1 flex-col gap-4"
>
<Segmented <Segmented
v-if="showStageTabs" v-if="showStageTabs"
v-model:value="stage" v-model:value="stage"
block block
class="shrink-0"
:options="stageOptions" :options="stageOptions"
/> />
<div <div
v-else v-else
class="text-sm font-medium text-slate-700 dark:text-slate-200" class="shrink-0 text-sm font-medium text-slate-700 dark:text-slate-200"
> >
{{ STAGE_LABEL[stage] }} {{ STAGE_LABEL[stage] }}
</div> </div>
@@ -721,10 +818,10 @@ defineExpose({ open, close: handleClose });
<!-- 同步 --> <!-- 同步 -->
<div <div
v-show="stage === 'sync'" v-show="stage === 'sync'"
class="flex min-h-0 flex-1 flex-col gap-3 overflow-y-auto" class="flex min-h-0 flex-1 flex-col gap-3 overflow-hidden"
> >
<div <div
class="rounded-lg border border-slate-200/80 px-3 py-2.5 dark:border-[hsl(240deg_3.7%_22%)]" class="shrink-0 rounded-lg border border-slate-200/80 px-3 py-2.5 dark:border-[hsl(240deg_3.7%_22%)]"
> >
<div class="mb-2 flex flex-wrap items-center justify-between gap-2"> <div class="mb-2 flex flex-wrap items-center justify-between gap-2">
<Space wrap> <Space wrap>
@@ -769,18 +866,13 @@ defineExpose({ open, close: handleClose });
/> />
</div> </div>
<div class="flex flex-wrap items-center justify-between gap-2"> <div class="flex shrink-0 flex-wrap items-center justify-between gap-2">
<span class="text-sm font-medium">全量任务</span> <span class="text-sm font-medium">全量任务</span>
<Space size="small"> <Space>
<Button <Button :loading="syncListLoading" @click="loadSyncTasks">
size="small"
:loading="syncListLoading"
@click="loadSyncTasks"
>
刷新 刷新
</Button> </Button>
<Button <Button
size="small"
type="primary" type="primary"
:disabled="hasActiveSyncTask" :disabled="hasActiveSyncTask"
@click="openCreateForm('sync')" @click="openCreateForm('sync')"
@@ -791,58 +883,20 @@ defineExpose({ open, close: handleClose });
</div> </div>
<div <div
v-if="createOpen && createForStage === 'sync'" v-if="syncTasks.some((x) => x.lastError)"
class="rounded-lg border border-dashed border-slate-300 px-3 py-2 dark:border-[hsl(240deg_3.7%_28%)]" class="shrink-0 space-y-2"
> >
<Form layout="vertical" class="!mb-0"> <Alert
<Form.Item label="类型" class="!mb-2"> v-for="t in syncTasks.filter((x) => x.lastError)"
<Radio.Group v-model:value="createMode" size="small"> :key="`err-${t.id}`"
<Radio.Button value="range">区间</Radio.Button> type="error"
<Radio.Button value="day">单日</Radio.Button> show-icon
</Radio.Group> class="!text-xs"
</Form.Item> :message="`#${t.id} ${t.lastError}`"
<Form.Item
v-if="createMode === 'range'"
label="成交日区间(近 90 天)"
class="!mb-2"
>
<DatePicker.RangePicker
v-model:value="range"
class="w-full"
size="small"
:allow-clear="false"
:disabled-date="disabledFullSyncDate"
format="YYYY-MM-DD"
/> />
</Form.Item>
<Form.Item
v-else
label="成交日"
class="!mb-2"
>
<DatePicker
v-model:value="confirmDate"
class="w-full"
size="small"
:allow-clear="false"
:disabled-date="disabledFullSyncDate"
format="YYYY-MM-DD"
/>
</Form.Item>
<Space>
<Button
type="primary"
size="small"
:loading="createSubmitting"
@click="handleCreateTask"
>
创建并开始
</Button>
<Button size="small" @click="createOpen = false">取消</Button>
</Space>
</Form>
</div> </div>
<div class="pipeline-table-host min-h-0 flex-1 overflow-hidden">
<Table <Table
size="small" size="small"
:columns="taskColumns" :columns="taskColumns"
@@ -850,7 +904,7 @@ defineExpose({ open, close: handleClose });
:loading="syncListLoading || pageLoading" :loading="syncListLoading || pageLoading"
:pagination="false" :pagination="false"
row-key="id" row-key="id"
:scroll="{ y: 360 }" :scroll="{ y: tableScrollY }"
> >
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'status'"> <template v-if="column.key === 'status'">
@@ -924,23 +978,16 @@ defineExpose({ open, close: handleClose });
</template> </template>
</template> </template>
</Table> </Table>
<Alert </div>
v-for="t in syncTasks.filter((x) => x.lastError)"
:key="`err-${t.id}`"
type="error"
show-icon
class="!text-xs"
:message="`#${t.id} ${t.lastError}`"
/>
</div> </div>
<!-- 转换 --> <!-- 转换 -->
<div <div
v-show="stage === 'convert'" v-show="stage === 'convert'"
class="flex min-h-0 flex-1 flex-col gap-3 overflow-y-auto" class="flex min-h-0 flex-1 flex-col gap-3 overflow-hidden"
> >
<div <div
class="rounded-lg border border-slate-200/80 px-3 py-2.5 dark:border-[hsl(240deg_3.7%_22%)]" class="shrink-0 rounded-lg border border-slate-200/80 px-3 py-2.5 dark:border-[hsl(240deg_3.7%_22%)]"
> >
<div class="mb-2 flex flex-wrap items-center justify-between gap-2"> <div class="mb-2 flex flex-wrap items-center justify-between gap-2">
<Space wrap> <Space wrap>
@@ -976,18 +1023,13 @@ defineExpose({ open, close: handleClose });
/> />
</div> </div>
<div class="flex flex-wrap items-center justify-between gap-2"> <div class="flex shrink-0 flex-wrap items-center justify-between gap-2">
<span class="text-sm font-medium">全量任务</span> <span class="text-sm font-medium">全量任务</span>
<Space size="small"> <Space>
<Button <Button :loading="convertListLoading" @click="loadConvertTasks">
size="small"
:loading="convertListLoading"
@click="loadConvertTasks"
>
刷新 刷新
</Button> </Button>
<Button <Button
size="small"
type="primary" type="primary"
:disabled="hasActiveConvertTask" :disabled="hasActiveConvertTask"
@click="openCreateForm('convert')" @click="openCreateForm('convert')"
@@ -997,55 +1039,7 @@ defineExpose({ open, close: handleClose });
</Space> </Space>
</div> </div>
<div <div class="pipeline-table-host min-h-0 flex-1 overflow-hidden">
v-if="createOpen && createForStage === 'convert'"
class="rounded-lg border border-dashed border-slate-300 px-3 py-2 dark:border-[hsl(240deg_3.7%_28%)]"
>
<Form layout="vertical" class="!mb-0">
<Form.Item label="类型" class="!mb-2">
<Radio.Group v-model:value="createMode" size="small">
<Radio.Button value="range">区间</Radio.Button>
<Radio.Button value="day">单日</Radio.Button>
</Radio.Group>
</Form.Item>
<Form.Item
v-if="createMode === 'range'"
label="成交日区间(近 90 天,按渠道镜像扫日)"
class="!mb-2"
>
<DatePicker.RangePicker
v-model:value="range"
class="w-full"
size="small"
:allow-clear="false"
:disabled-date="disabledFullSyncDate"
format="YYYY-MM-DD"
/>
</Form.Item>
<Form.Item v-else label="成交日" class="!mb-2">
<DatePicker
v-model:value="confirmDate"
class="w-full"
size="small"
:allow-clear="false"
:disabled-date="disabledFullSyncDate"
format="YYYY-MM-DD"
/>
</Form.Item>
<Space>
<Button
type="primary"
size="small"
:loading="createSubmitting"
@click="handleCreateTask"
>
创建并开始
</Button>
<Button size="small" @click="createOpen = false">取消</Button>
</Space>
</Form>
</div>
<Table <Table
size="small" size="small"
:columns="pipelineTaskColumns" :columns="pipelineTaskColumns"
@@ -1053,7 +1047,7 @@ defineExpose({ open, close: handleClose });
:loading="convertListLoading || pageLoading" :loading="convertListLoading || pageLoading"
:pagination="false" :pagination="false"
row-key="id" row-key="id"
:scroll="{ y: 360 }" :scroll="{ y: tableScrollY }"
> >
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'status'"> <template v-if="column.key === 'status'">
@@ -1106,14 +1100,15 @@ defineExpose({ open, close: handleClose });
</template> </template>
</Table> </Table>
</div> </div>
</div>
<!-- 计算 --> <!-- 计算 -->
<div <div
v-show="stage === 'calc'" v-show="stage === 'calc'"
class="flex min-h-0 flex-1 flex-col gap-3 overflow-y-auto" class="flex min-h-0 flex-1 flex-col gap-3 overflow-hidden"
> >
<div <div
class="rounded-lg border border-slate-200/80 px-3 py-2.5 dark:border-[hsl(240deg_3.7%_22%)]" class="shrink-0 rounded-lg border border-slate-200/80 px-3 py-2.5 dark:border-[hsl(240deg_3.7%_22%)]"
> >
<div class="mb-2 flex flex-wrap items-center justify-between gap-2"> <div class="mb-2 flex flex-wrap items-center justify-between gap-2">
<Space wrap> <Space wrap>
@@ -1151,18 +1146,13 @@ defineExpose({ open, close: handleClose });
/> />
</div> </div>
<div class="flex flex-wrap items-center justify-between gap-2"> <div class="flex shrink-0 flex-wrap items-center justify-between gap-2">
<span class="text-sm font-medium">全量任务</span> <span class="text-sm font-medium">全量任务</span>
<Space size="small"> <Space>
<Button <Button :loading="calcListLoading" @click="loadCalcTasks">
size="small"
:loading="calcListLoading"
@click="loadCalcTasks"
>
刷新 刷新
</Button> </Button>
<Button <Button
size="small"
type="primary" type="primary"
:disabled="hasActiveCalcTask" :disabled="hasActiveCalcTask"
@click="openCreateForm('calc')" @click="openCreateForm('calc')"
@@ -1172,55 +1162,7 @@ defineExpose({ open, close: handleClose });
</Space> </Space>
</div> </div>
<div <div class="pipeline-table-host min-h-0 flex-1 overflow-hidden">
v-if="createOpen && createForStage === 'calc'"
class="rounded-lg border border-dashed border-slate-300 px-3 py-2 dark:border-[hsl(240deg_3.7%_28%)]"
>
<Form layout="vertical" class="!mb-0">
<Form.Item label="类型" class="!mb-2">
<Radio.Group v-model:value="createMode" size="small">
<Radio.Button value="range">区间</Radio.Button>
<Radio.Button value="day">单日</Radio.Button>
</Radio.Group>
</Form.Item>
<Form.Item
v-if="createMode === 'range'"
label="统计日区间(近 90 天,按内部订单重算)"
class="!mb-2"
>
<DatePicker.RangePicker
v-model:value="range"
class="w-full"
size="small"
:allow-clear="false"
:disabled-date="disabledFullSyncDate"
format="YYYY-MM-DD"
/>
</Form.Item>
<Form.Item v-else label="统计日" class="!mb-2">
<DatePicker
v-model:value="confirmDate"
class="w-full"
size="small"
:allow-clear="false"
:disabled-date="disabledFullSyncDate"
format="YYYY-MM-DD"
/>
</Form.Item>
<Space>
<Button
type="primary"
size="small"
:loading="createSubmitting"
@click="handleCreateTask"
>
创建并开始
</Button>
<Button size="small" @click="createOpen = false">取消</Button>
</Space>
</Form>
</div>
<Table <Table
size="small" size="small"
:columns="pipelineTaskColumns" :columns="pipelineTaskColumns"
@@ -1228,7 +1170,7 @@ defineExpose({ open, close: handleClose });
:loading="calcListLoading || pageLoading" :loading="calcListLoading || pageLoading"
:pagination="false" :pagination="false"
row-key="id" row-key="id"
:scroll="{ y: 360 }" :scroll="{ y: tableScrollY }"
> >
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'status'"> <template v-if="column.key === 'status'">
@@ -1299,5 +1241,43 @@ defineExpose({ open, close: handleClose });
</Table> </Table>
</div> </div>
</div> </div>
</div>
</Drawer> </Drawer>
<CreateFullModal>
<Form layout="vertical" class="!mb-0 px-1 pt-1">
<Form.Item :label="createDateRangeLabel" class="!mb-0">
<div class="flex flex-wrap items-center gap-2">
<DatePicker.RangePicker
v-model:value="range"
class="min-w-0 flex-1"
:allow-clear="false"
:disabled-date="disabledFullSyncDate"
format="YYYY-MM-DD"
/>
<Button @click="setCreateRangeToToday">今天</Button>
</div>
</Form.Item>
</Form>
</CreateFullModal>
</template> </template>
<style scoped>
/* 抽屉内容撑满视口高度,body 吃掉标题以下剩余空间,供表格 flex 伸展 */
:global(.shop-order-pipeline-drawer .ant-drawer-content-wrapper),
:global(.shop-order-pipeline-drawer .ant-drawer-content) {
display: flex;
flex-direction: column;
height: 100%;
}
:global(.shop-order-pipeline-drawer .ant-drawer-body) {
display: flex;
flex: 1;
flex-direction: column;
min-height: 0;
overflow: hidden;
padding-top: 16px;
padding-bottom: 16px;
}
</style>