优化
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
import '@/styles/adminDensity.css'
|
||||
import { computed, onMounted, reactive, ref } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { Cable, Edit3, RefreshCw, RotateCw } from '@lucide/vue'
|
||||
import { Cable, RefreshCw } from '@lucide/vue'
|
||||
import AdminPage from '@/shared/components/AdminPage.vue'
|
||||
import DataTable, { type DataTableColumn } from '@/shared/components/DataTable.vue'
|
||||
import ListPageLayout from '@/shared/components/ListPageLayout.vue'
|
||||
@@ -188,18 +188,10 @@ onMounted(() => { void Promise.all([loadConfig(), load()]) })
|
||||
<template>
|
||||
<AdminPage class="admin-density mojia-sku-sync-page">
|
||||
<ListPageLayout aria-label="称重机器">
|
||||
<section class="surface-panel table-panel" :aria-busy="loading">
|
||||
<el-alert v-if="error" type="error" :title="error" show-icon :closable="false" />
|
||||
<el-alert
|
||||
:type="autoSyncEnabled ? 'warning' : 'info'"
|
||||
:title="autoSyncEnabled ? '领星自动同步已开启' : '领星自动同步已关闭,仅支持人工推送'"
|
||||
description="开关由 Nacos 配置 firstleg.lingxing.auto-sync-enabled 控制。"
|
||||
show-icon
|
||||
:closable="false"
|
||||
/>
|
||||
<DataTable :data="rows" :columns="columns" :loading="loading" row-key="id" border stripe empty-text="暂无墨家机器上传记录">
|
||||
<template #toolbar-start>
|
||||
<div class="sync-filters">
|
||||
<DataTable v-model:page="page" v-model:page-size="size" :total="total" :page-sizes="[10, 20, 30, 40, 50, 100]" @update:page="load" @update:page-size="search" appearance="integrated" :stripe="false" column-settings-mode="show" preference-key="mojia-sku-sync-table" :data="rows" :columns="columns" :loading="loading" :aria-busy="loading" row-key="id" border empty-text="暂无墨家机器上传记录">
|
||||
<template #toolbar-start><h1>称重机器</h1></template>
|
||||
<template #filters>
|
||||
<div class="sync-filters query-toolbar">
|
||||
<el-input v-model.trim="form.code" clearable placeholder="搜索箱码或 SKU" @keyup.enter="search" />
|
||||
<el-select v-model="form.measurementKind" clearable placeholder="上传类型" style="width: 130px"><el-option label="箱码" value="BOX_LABEL" /><el-option label="SKU" value="SKU" /></el-select>
|
||||
<el-select v-model="form.syncStatus" clearable placeholder="同步状态" style="width: 140px">
|
||||
@@ -210,11 +202,20 @@ onMounted(() => { void Promise.all([loadConfig(), load()]) })
|
||||
<el-button :loading="testingConnection" @click="testConnection"><Cable :size="16" />测试连接</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<template #notices><el-alert v-if="error" type="error" :title="error" show-icon :closable="false" /><el-alert
|
||||
:type="autoSyncEnabled ? 'warning' : 'info'"
|
||||
:title="autoSyncEnabled ? '领星自动同步已开启' : '领星自动同步已关闭,仅支持人工推送'"
|
||||
description="开关由 Nacos 配置 firstleg.lingxing.auto-sync-enabled 控制。"
|
||||
show-icon
|
||||
:closable="false"
|
||||
/></template>
|
||||
|
||||
|
||||
<template #toolbar-actions><el-button :loading="loading" @click="load"><RefreshCw :size="16" />刷新</el-button></template>
|
||||
<template #actions="{ row }">
|
||||
<div class="density-actions">
|
||||
<el-button v-if="canEdit" class="density-action" @click="openEdit(asRecord(row))"><Edit3 :size="15" />编辑</el-button>
|
||||
<el-button v-if="canRetry && row.measurementKind === 'SKU' && row.syncStatus !== 'SUCCESS'" class="density-action" data-tone="primary" :loading="actionId === row.id" @click="retry(asRecord(row))"><RotateCw :size="15" />人工推送</el-button>
|
||||
<div class="density-actions row-actions admin-text-actions">
|
||||
<el-button v-if="canEdit" class="density-action" @click="openEdit(asRecord(row))">编辑</el-button>
|
||||
<el-button v-if="canRetry && row.measurementKind === 'SKU' && row.syncStatus !== 'SUCCESS'" class="density-action" data-tone="primary" :loading="actionId === row.id" @click="retry(asRecord(row))">人工推送</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<template #sourceCode="{ row }">{{ row.measurementKind === 'SKU' ? row.skuCode : row.boxCode }}</template>
|
||||
@@ -226,8 +227,6 @@ onMounted(() => { void Promise.all([loadConfig(), load()]) })
|
||||
<template #measuredAt="{ row }">{{ formatTime(row.measuredAt) }}</template>
|
||||
<template #failure="{ row }">{{ row.syncFailureReason || '—' }}</template>
|
||||
</DataTable>
|
||||
<div class="sync-pagination"><el-pagination v-model:current-page="page" v-model:page-size="size" :total="total" background layout="total, sizes, prev, pager, next" @current-change="load" @size-change="search" /></div>
|
||||
</section>
|
||||
</ListPageLayout>
|
||||
<AppDialog v-model="editOpen" class="admin-density-dialog" title="编辑 SKU 测量修正版" width="min(620px, calc(100vw - 28px))" confirm-text="保存并重新同步" :confirm-loading="Boolean(actionId)" @confirm="saveEdit">
|
||||
<el-form label-position="top" class="sync-edit-form">
|
||||
|
||||
Reference in New Issue
Block a user