From d2724643e79d4e1675adf496a26267be1bc22dcf Mon Sep 17 00:00:00 2001 From: liufumingren Date: Tue, 3 Nov 2026 17:20:41 +0800 Subject: [PATCH] =?UTF-8?q?style(frontend):=20=E5=95=86=E5=93=81=20/=20?= =?UTF-8?q?=E7=BB=84=E5=90=88=E5=95=86=E5=93=81=E7=9A=84=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E6=94=B9=E4=B8=BA=E7=82=B9=E5=87=BB=E8=A1=8C?= =?UTF-8?q?=E4=B8=8B=E6=96=B9=E5=B1=95=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 与店铺商品页统一风格: - 去掉操作列的「日志」按钮(操作列宽度 180 → 140) - 点击行在表格下方(分页之后)展开操作记录面板,再次点击同一行收起 - 表格保持内部滚动,展开面板后表格自动让出高度 - 点击行内「编辑 / 删除」按钮不会误触发展开 - 移除原日志弹窗与 log-dialog-body 样式,补充 log-wrap / log-head / log-body 样式 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- frontend/src/views/ComboProduct/Index.vue | 78 +++++++++++++++++------ frontend/src/views/Product/Index.vue | 78 +++++++++++++++++------ 2 files changed, 114 insertions(+), 42 deletions(-) diff --git a/frontend/src/views/ComboProduct/Index.vue b/frontend/src/views/ComboProduct/Index.vue index eaf0286..25b6a05 100644 --- a/frontend/src/views/ComboProduct/Index.vue +++ b/frontend/src/views/ComboProduct/Index.vue @@ -221,19 +221,30 @@ async function handleDelete(row: ComboProductItem) { } } -/* -------------------- 操作记录 -------------------- */ -const logVisible = ref(false) +/* -------------------- 操作记录(点击行后在下方展开,与店铺商品一致) -------------------- */ const logRow = ref(null) +const logPanelHeight = ref(240) -function openLog(row: ComboProductItem) { +function onRowClick(row: ComboProductItem, _column?: unknown, event?: Event) { + // 点行内按钮(编辑/删除)时不展开操作记录 + const target = event && (event.target as HTMLElement | null) + if (target && target.closest && target.closest('button')) return + // 再次点击同一行则收起 + if (logRow.value && logRow.value.id === row.id) { + closeLog() + return + } logRow.value = row - logVisible.value = true } -const logTitle = computed(() => { +function closeLog() { + logRow.value = null +} + +const logTargetName = computed(() => { const row = logRow.value if (!row) return '操作记录' - return `操作记录:${row.name || ''}(${row.code || ''})` + return `${row.name || ''}(${row.code || ''})` }) onMounted(fetchList) @@ -272,8 +283,8 @@ onMounted(fetchList) -
- +
+ @@ -289,10 +300,9 @@ onMounted(fetchList) - + @@ -308,21 +318,21 @@ onMounted(fetchList) @size-change="handleSizeChange" /> - - -
+ +
+
+ {{ logTargetName }} + 收起 +
+
- - +
(null) +const logPanelHeight = ref(240) -function openLog(row: ProductItem) { +function onRowClick(row: ProductItem, _column?: unknown, event?: Event) { + // 点行内按钮(编辑/删除)时不展开操作记录 + const target = event && (event.target as HTMLElement | null) + if (target && target.closest && target.closest('button')) return + // 再次点击同一行则收起 + if (logRow.value && logRow.value.id === row.id) { + closeLog() + return + } logRow.value = row - logVisible.value = true } -const logTitle = computed(() => { +function closeLog() { + logRow.value = null +} + +const logTargetName = computed(() => { const row = logRow.value if (!row) return '操作记录' - return `操作记录:${row.item_name || ''}(${row.item_code || ''})` + return `${row.item_name || ''}(${row.item_code || ''})` }) /* -------------------- 批量导入 -------------------- */ @@ -513,8 +524,8 @@ onMounted(async () => { -
- +
+ @@ -561,10 +572,9 @@ onMounted(async () => { - + @@ -580,21 +590,21 @@ onMounted(async () => { @size-change="handleSizeChange" /> - - -
+ +
+
+ {{ logTargetName }} + 收起 +
+
- - +
@@ -856,10 +866,36 @@ onMounted(async () => { justify-content: space-between; font-weight: 600; } -.log-dialog-body { - height: 420px; +/* 底部展开操作记录后,表格让出一部分高度(表格内部仍可滚动) */ +.log-wrap { + flex: 0 0 auto; display: flex; flex-direction: column; + min-height: 0; + margin-top: 8px; + padding-top: 8px; + border-top: 1px solid var(--el-border-color-lighter); +} +.log-head { + flex: 0 0 auto; + display: flex; + align-items: center; + gap: 8px; + margin-bottom: 4px; +} +.log-name { + font-size: 12px; + font-weight: 600; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} +.log-close { + margin-left: auto; +} +.log-body { + flex: 1 1 auto; + min-height: 0; } .import-body { display: flex;