优化
This commit is contained in:
@@ -111,7 +111,7 @@ describe('ExpressCompaniesView query and table migration', () => {
|
||||
expect(wrapper.text()).toContain('顺丰速运')
|
||||
expect(wrapper.text()).toContain('平台公共数据 · 共 1 家快递公司')
|
||||
expect(wrapper.find('.metric-strip').exists()).toBe(false)
|
||||
expect(wrapper.find('.list-page-layout__state').exists()).toBe(false)
|
||||
expect(wrapper.find('.data-table__notices').exists()).toBe(false)
|
||||
expect(listPlatformExpressCompanies).toHaveBeenCalledWith(1, 20, '', '')
|
||||
expect(wrapper.find('.data-table').text()).not.toContain('轨迹查询模板')
|
||||
expect(wrapper.find('.data-table').text()).not.toContain('测试数据')
|
||||
@@ -121,8 +121,8 @@ describe('ExpressCompaniesView query and table migration', () => {
|
||||
vi.mocked(listPlatformExpressCompanies).mockRejectedValueOnce(new Error('Gateway unavailable'))
|
||||
const wrapper = await mountView()
|
||||
|
||||
expect(wrapper.find('.list-page-layout__state').exists()).toBe(true)
|
||||
expect(wrapper.find('.table-panel').exists()).toBe(false)
|
||||
expect(wrapper.find('.data-table__notices').exists()).toBe(true)
|
||||
expect(wrapper.find('.el-table').exists()).toBe(false)
|
||||
expect(wrapper.text()).toContain('快递公司加载失败')
|
||||
expect(wrapper.text()).not.toContain('Gateway unavailable')
|
||||
})
|
||||
|
||||
@@ -284,20 +284,10 @@ onMounted(() => {
|
||||
<AdminPage class="admin-density">
|
||||
<div class="business-page express-company-page">
|
||||
<ListPageLayout ariaLabel="快递公司列表">
|
||||
<template #toolbar>
|
||||
<QueryToolbar v-model="filters" class="surface-panel" ariaLabel="快递公司筛选" :fields="queryFields" preference-key="express-companies-query" @search="applyFilters" />
|
||||
</template>
|
||||
<template v-if="loadError" #state>
|
||||
<el-alert type="error" :closable="false" show-icon class="state-alert">
|
||||
<template #title>快递公司加载失败</template>
|
||||
<p>{{ loadError.message }}</p>
|
||||
<ApiErrorMeta :details="loadError" />
|
||||
<el-button size="small" @click="loadExpressCompanies()">重新查询</el-button>
|
||||
</el-alert>
|
||||
</template>
|
||||
|
||||
<section v-if="!loadError" class="surface-panel table-panel">
|
||||
<DataTable
|
||||
|
||||
|
||||
<section><DataTable appearance="integrated" :stripe="false" column-settings-mode="show" :results-visible="!loadError"
|
||||
v-model:page="page"
|
||||
v-model:page-size="pageSize"
|
||||
:data="rows"
|
||||
@@ -310,8 +300,22 @@ onMounted(() => {
|
||||
row-key="id"
|
||||
:empty-text="appliedFilters.keyword.trim() || appliedFilters.status ? '暂无符合筛选条件的快递公司' : '暂无快递公司档案'"
|
||||
>
|
||||
<template #toolbar-start><h1>快递公司</h1></template>
|
||||
<template #filters>
|
||||
<QueryToolbar v-model="filters" ariaLabel="快递公司筛选" :fields="queryFields" preference-key="express-companies-query" @search="applyFilters" />
|
||||
</template>
|
||||
<template #notices><template v-if="loadError">
|
||||
<el-alert type="error" :closable="false" show-icon class="state-alert">
|
||||
<template #title>快递公司加载失败</template>
|
||||
<p>{{ loadError.message }}</p>
|
||||
<ApiErrorMeta :details="loadError" />
|
||||
<el-button size="small" @click="loadExpressCompanies()">重新查询</el-button>
|
||||
</el-alert>
|
||||
</template></template>
|
||||
|
||||
|
||||
<template #toolbar-actions><div class="table-actions"><el-button v-if="access.can('platform:express:import')" :disabled="loading" @click="openImport"><FileUp :size="16" />批量导入</el-button><el-button v-if="access.can('platform:express:create')" type="primary" :disabled="loading" @click="openCreate"><Plus :size="16" />新增快递公司</el-button></div></template>
|
||||
<template #actions="{ row }">
|
||||
<template #actions="{ row }"><div class="row-actions density-actions admin-text-actions">
|
||||
<div v-if="access.can('platform:express:edit') || access.can('platform:express:status')" class="table-actions density-actions">
|
||||
<el-button data-tone="neutral" class="density-action"
|
||||
v-if="access.can('platform:express:edit')"
|
||||
@@ -333,7 +337,7 @@ onMounted(() => {
|
||||
>{{ (row as PlatformExpressCompanyResource).status === 'ACTIVE' ? '停用' : '启用' }}</el-button>
|
||||
</div>
|
||||
<span v-else class="muted-value">仅查看</span>
|
||||
</template>
|
||||
</div></template>
|
||||
<template #company="{ row }"><div class="express-company-cell"><span><Truck :size="17" /></span><div><strong>{{ (row as PlatformExpressCompanyResource).companyName }}</strong></div></div></template>
|
||||
<template #website="{ row }">
|
||||
<a v-if="safeHttpUrl((row as PlatformExpressCompanyResource).website)" class="external-link" :href="safeHttpUrl((row as PlatformExpressCompanyResource).website)!" target="_blank" rel="noopener noreferrer">访问官网<ExternalLink :size="13" /></a>
|
||||
@@ -346,8 +350,7 @@ onMounted(() => {
|
||||
</el-empty>
|
||||
</template>
|
||||
<template #pagination-left="{ total: tableTotal }"><span>平台公共数据 · 共 {{ tableTotal }} 家快递公司</span></template>
|
||||
</DataTable>
|
||||
</section>
|
||||
</DataTable></section>
|
||||
</ListPageLayout>
|
||||
|
||||
<BatchImportDialog class="admin-density-dialog"
|
||||
|
||||
Reference in New Issue
Block a user