优化
This commit is contained in:
@@ -140,13 +140,13 @@ describe('CarrierRatesView price-book source contract', () => {
|
||||
const queryToolbarBlock = source.slice(source.indexOf('<QueryToolbar'), queryToolbarEnd + 2)
|
||||
expect(queryToolbarBlock).not.toContain('#actions')
|
||||
expect(source).toContain('<template #toolbar-actions><el-button v-if="canEdit" type="primary" @click="openUpload">')
|
||||
expect(source).not.toContain('#toolbar-start')
|
||||
expect(source).toContain('<template #toolbar-start><h1>船期价格表</h1></template>')
|
||||
expect(source).toContain('<template #pagination-left>共 {{ rows.length }} 个版本')
|
||||
})
|
||||
|
||||
it('keeps list spacing and error state mutually exclusive', () => {
|
||||
expect(source).toContain('<template v-if="loadError" #state>')
|
||||
expect(source).toContain('<section v-if="!loadError" class="surface-panel table-panel"')
|
||||
expect(source).toContain('<template #notices>')
|
||||
expect(source).toContain(':results-visible="!loadError"')
|
||||
expect(source).not.toContain('<template #state>')
|
||||
})
|
||||
|
||||
|
||||
@@ -319,30 +319,11 @@ onMounted(() => {
|
||||
<template>
|
||||
<AdminPage as="div" class="price-book-page admin-density" spacing="normal">
|
||||
<ListPageLayout aria-label="承运商报价版本管理">
|
||||
<template #toolbar>
|
||||
<QueryToolbar
|
||||
v-model="filters"
|
||||
class="surface-panel"
|
||||
ariaLabel="船期价格表筛选"
|
||||
:fields="queryFields"
|
||||
preference-key="price-book-query"
|
||||
@search="applyQuery"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<template v-if="loadError" #state>
|
||||
<LoadErrorState
|
||||
title="船期价格表版本加载失败"
|
||||
:message="loadErrorMessage"
|
||||
:loading="loading"
|
||||
@retry="loadPriceBooks()"
|
||||
>
|
||||
<template #details><ApiErrorMeta :details="loadError" /></template>
|
||||
</LoadErrorState>
|
||||
</template>
|
||||
|
||||
<section v-if="!loadError" class="surface-panel table-panel" aria-live="polite">
|
||||
<DataTable
|
||||
|
||||
|
||||
<section aria-live="polite"><DataTable appearance="integrated" :stripe="false" column-settings-mode="show" :results-visible="!loadError"
|
||||
v-model:page="page"
|
||||
v-model:page-size="pageSize"
|
||||
:data="pagedRows"
|
||||
@@ -353,13 +334,33 @@ onMounted(() => {
|
||||
:page-sizes="[10, 20, 50]"
|
||||
row-key="id"
|
||||
border
|
||||
stripe
|
||||
aria-label="船期价格表版本列表"
|
||||
empty-text="暂无船期价格表版本"
|
||||
>
|
||||
<template #toolbar-start><h1>船期价格表</h1></template>
|
||||
<template #filters>
|
||||
<QueryToolbar
|
||||
v-model="filters"
|
||||
ariaLabel="船期价格表筛选"
|
||||
:fields="queryFields"
|
||||
preference-key="price-book-query"
|
||||
@search="applyQuery"
|
||||
/>
|
||||
</template>
|
||||
<template #notices><template v-if="loadError">
|
||||
<LoadErrorState
|
||||
title="船期价格表版本加载失败"
|
||||
:message="loadErrorMessage"
|
||||
:loading="loading"
|
||||
@retry="loadPriceBooks()"
|
||||
>
|
||||
<template #details><ApiErrorMeta :details="loadError" /></template>
|
||||
</LoadErrorState>
|
||||
</template></template>
|
||||
|
||||
|
||||
<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 density-actions">
|
||||
<template #actions="{ row }"><div class="table-actions density-actions row-actions admin-text-actions">
|
||||
<el-button data-tone="neutral" class="density-action" size="small" @click="openDetail(row as PlatformPriceBookVersion)">{{ detailActionLabel(row as PlatformPriceBookVersion) }}</el-button>
|
||||
<el-button data-tone="neutral" class="density-action"
|
||||
size="small"
|
||||
@@ -375,8 +376,7 @@ onMounted(() => {
|
||||
:loading="voidingIds.has((row as PlatformPriceBookVersion).id)"
|
||||
@click="voidPending(row as PlatformPriceBookVersion)"
|
||||
>作废</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</div></template>
|
||||
<template #version="{ row }"><div class="version-cell"><strong>V{{ (row as PlatformPriceBookVersion).versionNo }}</strong></div></template>
|
||||
<template #scope="{ row }"><el-tag :type="(row as PlatformPriceBookVersion).customerId === '0' ? 'info' : 'warning'" effect="light">{{ priceBookScopeLabel((row as PlatformPriceBookVersion).customerId) }}</el-tag></template>
|
||||
<template #status="{ row }"><el-tag :type="priceBookStatusMeta((row as PlatformPriceBookVersion).status).type" effect="light">{{ priceBookStatusMeta((row as PlatformPriceBookVersion).status).label }}</el-tag></template>
|
||||
@@ -384,8 +384,7 @@ onMounted(() => {
|
||||
<template #issues="{ row }"><div class="issue-counts"><span :class="{ 'is-blocking': (row as PlatformPriceBookVersion).blockingErrorCount }">阻断 {{ (row as PlatformPriceBookVersion).blockingErrorCount }}</span><span>警告 {{ (row as PlatformPriceBookVersion).warningCount }}</span></div></template>
|
||||
<template #empty><el-empty description="暂无船期价格表版本" /></template>
|
||||
<template #pagination-left>共 {{ rows.length }} 个版本 · {{ activeCount }} 个生效中 · {{ pendingCount }} 个待确认</template>
|
||||
</DataTable>
|
||||
</section>
|
||||
</DataTable></section>
|
||||
</ListPageLayout>
|
||||
|
||||
<AppDialog class="admin-density-dialog"
|
||||
|
||||
@@ -5,7 +5,7 @@ export const fbaPricingRoutes = [
|
||||
path: 'first-leg-pricing/carrier-rates',
|
||||
name: 'fba-carrier-rates',
|
||||
component: () => import('./carrier-rates/pages/CarrierRatesView.vue'),
|
||||
meta: {
|
||||
meta: { showPageHeading: false,
|
||||
title: '船期价格表',
|
||||
description: '上传、确认并查询平台公共船期价格表版本',
|
||||
permission: 'firstleg:fba-pricing:rate:view',
|
||||
|
||||
Reference in New Issue
Block a user