优化
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
import '@/styles/adminDensity.css'
|
||||
import { computed, onMounted, reactive, ref, watch } from 'vue'
|
||||
import { ElMessage, ElMessageBox, type UploadFile } from 'element-plus'
|
||||
import { ChevronDown, Download, FileSpreadsheet, FileUp, MapPin, Plus, Save, Warehouse as WarehouseIcon } from '@lucide/vue'
|
||||
import { ChevronDown, Download, FileSpreadsheet, FileUp, MapPin, Plus, Save } from '@lucide/vue'
|
||||
import AdminPage from '@/shared/components/AdminPage.vue'
|
||||
import AppDialog from '@/shared/components/AppDialog.vue'
|
||||
import DataTable, { type DataTableColumn } from '@/shared/components/DataTable.vue'
|
||||
@@ -692,27 +692,15 @@ onMounted(() => void loadWarehouses())
|
||||
<template>
|
||||
<AdminPage class="admin-density" as="div">
|
||||
<ListPageLayout aria-label="仓库列表页面">
|
||||
<template #toolbar>
|
||||
<QueryToolbar v-model="filters" class="surface-panel" ariaLabel="仓库筛选" :fields="queryFields" :loading="loading" preference-key="warehouses-query" @search="queryWarehouses" />
|
||||
</template>
|
||||
<template v-if="loadError" #state>
|
||||
<LoadErrorState
|
||||
title="仓库数据加载失败"
|
||||
:message="loadErrorDescription"
|
||||
:loading="loading"
|
||||
retry-text="重新查询"
|
||||
@retry="loadWarehouses"
|
||||
/>
|
||||
</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="rows"
|
||||
:columns="warehouseColumns"
|
||||
border
|
||||
stripe
|
||||
preference-key="warehouses-table"
|
||||
:loading="loading"
|
||||
:total="total"
|
||||
@@ -721,6 +709,21 @@ onMounted(() => void loadWarehouses())
|
||||
aria-label="公共仓库列表"
|
||||
:empty-text="loaded ? '暂无符合筛选条件的仓库' : '仓库数据暂不可用,请重新加载'"
|
||||
>
|
||||
<template #toolbar-start><h1>仓库管理</h1></template>
|
||||
<template #filters>
|
||||
<QueryToolbar v-model="filters" ariaLabel="仓库筛选" :fields="queryFields" :loading="loading" preference-key="warehouses-query" @search="queryWarehouses" />
|
||||
</template>
|
||||
<template #notices><template v-if="loadError">
|
||||
<LoadErrorState
|
||||
title="仓库数据加载失败"
|
||||
:message="loadErrorDescription"
|
||||
:loading="loading"
|
||||
retry-text="重新查询"
|
||||
@retry="loadWarehouses"
|
||||
/>
|
||||
</template></template>
|
||||
|
||||
|
||||
<template #toolbar-actions>
|
||||
<div v-if="access.can('platform:warehouse:create')" class="warehouse-primary-actions">
|
||||
<el-button :disabled="!warehouseReady" @click="openImport"><FileUp :size="16" />导入仓库</el-button>
|
||||
@@ -730,7 +733,7 @@ onMounted(() => void loadWarehouses())
|
||||
</el-dropdown>
|
||||
</div>
|
||||
</template>
|
||||
<template #actions="{ row }">
|
||||
<template #actions="{ row }"><div class="row-actions density-actions admin-text-actions">
|
||||
<div v-if="access.can('platform:warehouse:edit') || access.can('platform:warehouse:status')" class="table-actions density-actions">
|
||||
<el-button data-tone="neutral" class="density-action" v-if="access.can('platform:warehouse:edit')" size="small" :disabled="!warehouseReady || editLoading" @click="openEdit(row as WarehouseRow)">编辑</el-button>
|
||||
<el-button class="density-action"
|
||||
@@ -744,7 +747,7 @@ onMounted(() => void loadWarehouses())
|
||||
>{{ (row as WarehouseRow).status === 'ACTIVE' ? '停用' : '启用' }}</el-button>
|
||||
</div>
|
||||
<span v-else class="warehouse-subline">仅查看</span>
|
||||
</template>
|
||||
</div></template>
|
||||
<template #warehouse="{ row }"><div class="warehouse-cell"><div><strong>{{ (row as WarehouseRow).name }}</strong></div></div></template>
|
||||
<template #warehouseType="{ row }"><el-tag effect="plain">{{ warehouseTypeLabels[(row as WarehouseRow).warehouseType] }}</el-tag></template>
|
||||
<template #countryCode="{ row }">{{ formatCountryDisplay((row as WarehouseRow).countryCode) }}</template>
|
||||
@@ -752,8 +755,7 @@ onMounted(() => void loadWarehouses())
|
||||
<template #contact="{ row }"><strong>{{ (row as WarehouseRow).contactName || '-' }}</strong><span class="warehouse-subline">{{ (row as WarehouseRow).contactPhone || '-' }}</span></template>
|
||||
<template #status="{ row }"><el-tag :type="(row as WarehouseRow).status === 'ACTIVE' ? 'success' : 'info'" effect="light">{{ (row as WarehouseRow).status === 'ACTIVE' ? '启用' : '停用' }}</el-tag></template>
|
||||
<template #pagination-left="{ total: tableTotal }">共 {{ tableTotal }} 个公共仓库</template>
|
||||
</DataTable>
|
||||
</section>
|
||||
</DataTable></section>
|
||||
</ListPageLayout>
|
||||
|
||||
<AppDialog v-model="editorOpen" :title="editorLabel" width="min(650px, calc(100vw - 28px))" class="warehouse-editor-dialog admin-density-dialog" :close-on-click-modal="false" :confirm-loading="saving" :show-confirm="false" destroy-on-close>
|
||||
|
||||
@@ -5,6 +5,6 @@ export const warehouseRoutes = [
|
||||
path: 'warehouses',
|
||||
name: 'warehouses',
|
||||
component: () => import('@/modules/warehouses/pages/WarehousesView.vue'),
|
||||
meta: { title: '仓库管理', description: '统一维护国内收货仓、FBA 仓和海外仓', permission: 'platform:warehouse:list' },
|
||||
meta: { showPageHeading: false, title: '仓库管理', description: '统一维护国内收货仓、FBA 仓和海外仓', permission: 'platform:warehouse:list' },
|
||||
},
|
||||
] satisfies RouteRecordRaw[]
|
||||
|
||||
Reference in New Issue
Block a user