This commit is contained in:
2026-08-12 18:00:26 +08:00
parent 2a889a7d91
commit 9d9b8943b8
16 changed files with 114 additions and 16 deletions
@@ -87,6 +87,20 @@ describe('CarrierRatesView price-book source contract', () => {
expect(source).toContain('LoadErrorState')
expect(queryToolbarSource).toContain('flex-wrap: wrap')
expect(source).toContain('@media (max-width: 720px)')
expect(source).toContain('.table-actions :deep(.el-button) { min-height: 40px; }')
expect(source).toContain('@media (max-width: 420px)')
expect(source).toContain('.detail-grid { grid-template-columns: 1fr; }')
})
it('uses bordered striped tables and explicit semantic business buttons', () => {
expect(source).toContain('row-key="id"\n border\n stripe')
expect(source).toContain('<el-button size="small" plain type="primary" @click="openDetail')
expect(source).toContain('size="small"\n plain\n :loading="downloadingIds.has')
expect(source).toContain('<Eye :size="15" />{{ detailActionLabel')
expect(source).toContain('<Download :size="15" />原文件')
expect(source).toContain('<CircleCheck :size="16" />确认并立即生效')
expect(source).toContain('.price-book-footer :deep(.el-button) { min-height: 44px; }')
expect(source).not.toContain('<el-button link type="primary" @click="openDetail')
})
it('keeps upload actions in the table toolbar instead of the query toolbar', () => {
@@ -1,6 +1,6 @@
<script setup lang="ts">
import { computed, onMounted, ref, watch } from 'vue'
import { AlertTriangle, Download, Eye, FileSpreadsheet, FileUp, RefreshCw, Ship, Warehouse } from '@lucide/vue'
import { AlertTriangle, CircleCheck, Download, Eye, FileSpreadsheet, FileUp, RefreshCw, Ship, Warehouse } from '@lucide/vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { useAccessPreviewStore } from '@/core/access/accessPreview'
import { listAllPlatformWarehouses, type PlatformWarehouseResource } from '@/modules/warehouses'
@@ -631,16 +631,18 @@ onMounted(() => {
:total="rows.length"
:page-sizes="[10, 20, 50]"
row-key="id"
border
stripe
aria-label="船期价格表版本列表"
empty-text="暂无船期价格表版本"
>
<template #toolbar-actions><el-button v-if="canEdit" type="primary" @click="openUpload"><FileUp :size="16" />上传价格表</el-button></template>
<template #actions="{ row }">
<div class="table-actions">
<el-button link type="primary" @click="openDetail(row as PlatformPriceBookVersion)"><Eye :size="15" />{{ detailActionLabel(row as PlatformPriceBookVersion) }}</el-button>
<el-button size="small" plain type="primary" @click="openDetail(row as PlatformPriceBookVersion)"><Eye :size="15" />{{ detailActionLabel(row as PlatformPriceBookVersion) }}</el-button>
<el-button
link
type="primary"
size="small"
plain
:loading="downloadingIds.has((row as PlatformPriceBookVersion).id)"
@click="downloadSource(row as PlatformPriceBookVersion)"
><Download :size="15" />原文件</el-button>
@@ -692,6 +694,12 @@ onMounted(() => {
@confirm="confirmPriceBook"
@cancel="closeDetail"
>
<template #footer="{ close, submitting }">
<div class="price-book-footer">
<el-button :disabled="submitting" @click="close">取消</el-button>
<el-button type="primary" :loading="publishing" :disabled="detailLoading || !canConfirmDetail" @click="confirmPriceBook"><CircleCheck :size="16" />确认并立即生效</el-button>
</div>
</template>
<section v-if="detailError" class="detail-load-error" role="alert">
<strong>价格表详情暂时无法加载</strong>
<p>{{ detailError.message }}</p>
@@ -804,6 +812,8 @@ onMounted(() => {
.price-book-page { min-width: 0; }
.table-actions { display: flex; min-height: 32px; align-items: center; gap: 8px; }
.table-actions :deep(.el-button + .el-button) { margin-left: 0; }
.price-book-footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.price-book-footer :deep(.el-button) { margin-left: 0; }
.version-cell { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.version-cell strong { color: var(--cc-text); }
.version-cell span, .metric-cell span { color: var(--cc-muted); font-size: 11px; }
@@ -858,6 +868,7 @@ onMounted(() => {
.channel-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: -4px 0 8px; color: var(--cc-muted); font-size: 12px; }
@media (max-width: 720px) {
.table-actions :deep(.el-button) { min-height: 40px; }
.price-book-footer :deep(.el-button) { min-height: 44px; }
.upload-file-control, .detail-summary, .mapping-load-error { align-items: stretch; flex-direction: column; }
.detail-summary__actions { justify-content: flex-start; }
.detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }