fix: 优化后台列表与系统设置布局
This commit is contained in:
@@ -1,80 +1,77 @@
|
||||
<template>
|
||||
<div class="page table-page outbound-page">
|
||||
<n-card :bordered="false" class="outbound-card">
|
||||
<template #header>出库批量导入</template>
|
||||
<template #header-extra>
|
||||
<n-space>
|
||||
<n-button @click="downloadTemplate">
|
||||
<template #icon><n-icon :component="DownloadOutline" /></template>
|
||||
下载 ZIP 模板
|
||||
</n-button>
|
||||
<n-upload
|
||||
:show-file-list="false"
|
||||
accept=".zip"
|
||||
:custom-request="uploadPreview"
|
||||
:disabled="busy || !auth.canWrite"
|
||||
>
|
||||
<n-button type="primary" :loading="previewing">
|
||||
<template #icon><n-icon :component="CloudUploadOutline" /></template>
|
||||
上传 ZIP 并预览
|
||||
</n-button>
|
||||
</n-upload>
|
||||
</n-space>
|
||||
</template>
|
||||
<div class="page-toolbar outbound-toolbar">
|
||||
<div class="section-title">出库批量导入</div>
|
||||
<div class="spacer" />
|
||||
<n-button @click="downloadTemplate">
|
||||
<template #icon><n-icon :component="DownloadOutline" /></template>
|
||||
下载 ZIP 模板
|
||||
</n-button>
|
||||
<n-upload
|
||||
:show-file-list="false"
|
||||
accept=".zip"
|
||||
:custom-request="uploadPreview"
|
||||
:disabled="busy || !auth.canWrite"
|
||||
>
|
||||
<n-button type="primary" :loading="previewing">
|
||||
<template #icon><n-icon :component="CloudUploadOutline" /></template>
|
||||
上传 ZIP 并预览
|
||||
</n-button>
|
||||
</n-upload>
|
||||
</div>
|
||||
|
||||
<n-alert type="info" :show-icon="true" class="section-alert">
|
||||
ZIP 内需要包含 1 个 xlsx 文件和 images 文件夹;xlsx 中出库实况图路径填写 images/xxx.jpg,多张用英文分号分隔。
|
||||
</n-alert>
|
||||
<n-alert type="info" :show-icon="true" class="section-alert">
|
||||
ZIP 内需要包含 1 个 xlsx 文件和 images 文件夹;xlsx 中出库实况图路径填写 images/xxx.jpg,多张用英文分号分隔。
|
||||
</n-alert>
|
||||
|
||||
<n-card v-if="session" embedded class="summary-card" :bordered="false">
|
||||
<n-space align="center" size="large" wrap>
|
||||
<n-statistic label="总行数" :value="session.total || 0" />
|
||||
<n-statistic label="有效行">
|
||||
<span class="success-text">{{ session.validCount || 0 }}</span>
|
||||
</n-statistic>
|
||||
<n-statistic label="错误行">
|
||||
<span class="danger-text">{{ session.invalidCount || 0 }}</span>
|
||||
</n-statistic>
|
||||
<n-tag :type="statusType(session.status)">{{ session.status }}</n-tag>
|
||||
<n-progress
|
||||
v-if="busy"
|
||||
type="line"
|
||||
:percentage="progressPercent"
|
||||
:indicator-placement="'inside'"
|
||||
class="progress"
|
||||
/>
|
||||
<n-button
|
||||
v-if="auth.canWrite"
|
||||
type="primary"
|
||||
:disabled="!canCommit"
|
||||
:loading="committing"
|
||||
@click="commitImport"
|
||||
>
|
||||
确认导入
|
||||
</n-button>
|
||||
<n-button v-if="result?.resultFileUrl" tag="a" :href="result.resultFileUrl" target="_blank">
|
||||
<template #icon><n-icon :component="DownloadOutline" /></template>
|
||||
下载导入结果
|
||||
</n-button>
|
||||
</n-space>
|
||||
<n-text v-if="session.error" type="error" class="session-error">{{ session.error }}</n-text>
|
||||
</n-card>
|
||||
|
||||
<n-data-table
|
||||
:columns="columns"
|
||||
:data="rows"
|
||||
:loading="loading"
|
||||
:pagination="false"
|
||||
class="table-fill"
|
||||
flex-height
|
||||
remote
|
||||
:scroll-x="1320"
|
||||
:row-key="(r) => r.id"
|
||||
/>
|
||||
<div class="table-pagination">
|
||||
<n-pagination v-bind="pagination" :disabled="loading" />
|
||||
</div>
|
||||
<n-card v-if="session" embedded class="summary-card" :bordered="false">
|
||||
<n-space align="center" size="large" wrap>
|
||||
<n-statistic label="总行数" :value="session.total || 0" />
|
||||
<n-statistic label="有效行">
|
||||
<span class="success-text">{{ session.validCount || 0 }}</span>
|
||||
</n-statistic>
|
||||
<n-statistic label="错误行">
|
||||
<span class="danger-text">{{ session.invalidCount || 0 }}</span>
|
||||
</n-statistic>
|
||||
<n-tag :type="statusType(session.status)">{{ session.status }}</n-tag>
|
||||
<n-progress
|
||||
v-if="busy"
|
||||
type="line"
|
||||
:percentage="progressPercent"
|
||||
:indicator-placement="'inside'"
|
||||
class="progress"
|
||||
/>
|
||||
<n-button
|
||||
v-if="auth.canWrite"
|
||||
type="primary"
|
||||
:disabled="!canCommit"
|
||||
:loading="committing"
|
||||
@click="commitImport"
|
||||
>
|
||||
确认导入
|
||||
</n-button>
|
||||
<n-button v-if="result?.resultFileUrl" tag="a" :href="result.resultFileUrl" target="_blank">
|
||||
<template #icon><n-icon :component="DownloadOutline" /></template>
|
||||
下载导入结果
|
||||
</n-button>
|
||||
</n-space>
|
||||
<n-text v-if="session.error" type="error" class="session-error">{{ session.error }}</n-text>
|
||||
</n-card>
|
||||
|
||||
<n-data-table
|
||||
:columns="columns"
|
||||
:data="rows"
|
||||
:loading="loading"
|
||||
:pagination="false"
|
||||
class="table-fill"
|
||||
flex-height
|
||||
remote
|
||||
:scroll-x="1320"
|
||||
:row-key="(r) => r.id"
|
||||
/>
|
||||
<div class="table-pagination">
|
||||
<n-pagination v-bind="pagination" :disabled="loading" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -267,20 +264,20 @@ async function loadRows() {
|
||||
.outbound-page {
|
||||
min-width: 0;
|
||||
}
|
||||
.outbound-card {
|
||||
flex: 1 1 auto;
|
||||
min-height: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.outbound-toolbar {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
.outbound-card :deep(.n-card__content) {
|
||||
flex: 1 1 auto;
|
||||
min-height: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.outbound-toolbar :deep(.n-upload) {
|
||||
width: auto;
|
||||
}
|
||||
.section-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.section-alert {
|
||||
margin-bottom: 12px;
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
.summary-card {
|
||||
margin-bottom: 12px;
|
||||
|
||||
Reference in New Issue
Block a user