优化商品管理界面 快速点击筛选
This commit is contained in:
@@ -525,22 +525,22 @@ function readError(error: unknown, fallback: string) {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="review-summary">
|
<div class="review-summary">
|
||||||
<div>
|
<button class="summary-card" :class="{ active: filters.risk === 'all' }" @click="filters.risk = 'all'">
|
||||||
<span>待审核</span>
|
<span>待审核</span>
|
||||||
<strong>{{ listings.length }}</strong>
|
<strong>{{ listings.length }}</strong>
|
||||||
</div>
|
</button>
|
||||||
<div>
|
<button class="summary-card" :class="{ active: filters.risk === 'external' }" @click="filters.risk = 'external'">
|
||||||
<span>外部上传</span>
|
<span>外部上传</span>
|
||||||
<strong>{{ listings.filter(isExternalUpload).length }}</strong>
|
<strong>{{ listings.filter(isExternalUpload).length }}</strong>
|
||||||
</div>
|
</button>
|
||||||
<div>
|
<button class="summary-card" :class="{ active: filters.risk === 'defaultImage' }" @click="filters.risk = 'defaultImage'">
|
||||||
<span>默认截图</span>
|
<span>默认截图</span>
|
||||||
<strong>{{ listings.filter(hasDefaultScreenshot).length }}</strong>
|
<strong>{{ listings.filter(hasDefaultScreenshot).length }}</strong>
|
||||||
</div>
|
</button>
|
||||||
<div>
|
<button class="summary-card" :class="{ active: filters.risk === 'ban' }" @click="filters.risk = 'ban'">
|
||||||
<span>封禁风险</span>
|
<span>封禁风险</span>
|
||||||
<strong>{{ listings.filter(hasBanRecord).length }}</strong>
|
<strong>{{ listings.filter(hasBanRecord).length }}</strong>
|
||||||
</div>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="review-workbench">
|
<div class="review-workbench">
|
||||||
@@ -810,12 +810,36 @@ function readError(error: unknown, fallback: string) {
|
|||||||
margin-bottom: 14px;
|
margin-bottom: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.review-summary div {
|
.summary-card {
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
|
border: 1px solid #e8edf4;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
padding: 14px 16px;
|
padding: 14px 16px;
|
||||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
|
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
|
||||||
|
text-align: left;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.2s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.summary-card:hover {
|
||||||
|
border-color: #1477ff;
|
||||||
|
box-shadow: 0 2px 8px rgba(20, 119, 255, 0.15);
|
||||||
|
transform: translateY(-1px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.summary-card.active {
|
||||||
|
border-color: #1477ff;
|
||||||
|
background: #1477ff;
|
||||||
|
box-shadow: 0 2px 8px rgba(20, 119, 255, 0.25);
|
||||||
|
}
|
||||||
|
|
||||||
|
.summary-card.active span {
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.summary-card.active strong {
|
||||||
|
color: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.review-summary span,
|
.review-summary span,
|
||||||
|
|||||||
@@ -83,6 +83,18 @@ function resetFilters() {
|
|||||||
void queryListings()
|
void queryListings()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setStatusFilter(status: string) {
|
||||||
|
filters.status = filters.status === status ? '' : status
|
||||||
|
filters.review_status = ''
|
||||||
|
void queryListings()
|
||||||
|
}
|
||||||
|
|
||||||
|
function setReviewStatusFilter(reviewStatus: string) {
|
||||||
|
filters.review_status = filters.review_status === reviewStatus ? '' : reviewStatus
|
||||||
|
filters.status = ''
|
||||||
|
void queryListings()
|
||||||
|
}
|
||||||
|
|
||||||
async function handlePageSizeChange(size: number) {
|
async function handlePageSizeChange(size: number) {
|
||||||
pageSize.value = size
|
pageSize.value = size
|
||||||
currentPage.value = 1
|
currentPage.value = 1
|
||||||
@@ -332,40 +344,87 @@ function formatQuantity(value: number) {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="listing-control-panel">
|
<div class="listing-control-panel">
|
||||||
<div class="listing-metric-strip">
|
<!-- 统计指标行 -->
|
||||||
<span>结果 <strong>{{ totalListings }}</strong></span>
|
<div class="listing-stats-row">
|
||||||
<span>本页 <strong>{{ listings.length }}</strong></span>
|
<div
|
||||||
<span>已上架 <strong>{{ publishedCount }}</strong></span>
|
class="stat-card clickable"
|
||||||
<span>已锁定 <strong>{{ rentedCount }}</strong></span>
|
:class="{ active: !filters.status && !filters.review_status }"
|
||||||
<span>待审核 <strong>{{ pendingCount }}</strong></span>
|
@click="resetFilters"
|
||||||
|
>
|
||||||
|
<span class="stat-label">全部商品</span>
|
||||||
|
<strong class="stat-value">{{ totalListings }}</strong>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="stat-card clickable"
|
||||||
|
:class="{ active: filters.status === 'published' }"
|
||||||
|
@click="setStatusFilter('published')"
|
||||||
|
>
|
||||||
|
<span class="stat-label">已上架</span>
|
||||||
|
<strong class="stat-value">{{ publishedCount }}</strong>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="stat-card clickable"
|
||||||
|
:class="{ active: filters.status === 'rented' }"
|
||||||
|
@click="setStatusFilter('rented')"
|
||||||
|
>
|
||||||
|
<span class="stat-label">已锁定</span>
|
||||||
|
<strong class="stat-value">{{ rentedCount }}</strong>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="stat-card clickable"
|
||||||
|
:class="{ active: filters.review_status === 'pending' }"
|
||||||
|
@click="setReviewStatusFilter('pending')"
|
||||||
|
>
|
||||||
|
<span class="stat-label">待审核</span>
|
||||||
|
<strong class="stat-value">{{ pendingCount }}</strong>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<el-form class="listing-filter-bar" label-position="top">
|
|
||||||
<el-form-item label="号主 ID">
|
<!-- 筛选和操作行 -->
|
||||||
<el-input v-model="filters.owner_id" clearable placeholder="按号主筛选" />
|
<div class="listing-filter-row">
|
||||||
</el-form-item>
|
<el-form class="listing-filter-bar" inline>
|
||||||
<el-form-item label="商品状态">
|
<el-form-item label="号主 ID">
|
||||||
<el-select v-model="filters.status" clearable placeholder="全部状态" class="full-control">
|
<el-input
|
||||||
<el-option label="草稿" value="draft" />
|
v-model="filters.owner_id"
|
||||||
<el-option label="已上架" value="published" />
|
clearable
|
||||||
<el-option label="已锁定" value="rented" />
|
placeholder="筛选号主"
|
||||||
<el-option label="已下架" value="offline" />
|
style="width: 160px"
|
||||||
<el-option label="异常" value="abnormal" />
|
/>
|
||||||
</el-select>
|
</el-form-item>
|
||||||
</el-form-item>
|
<el-form-item label="商品状态">
|
||||||
<el-form-item label="审核状态">
|
<el-select
|
||||||
<el-select v-model="filters.review_status" clearable placeholder="全部审核状态" class="full-control">
|
v-model="filters.status"
|
||||||
<el-option label="未提交" value="none" />
|
clearable
|
||||||
<el-option label="待审核" value="pending" />
|
placeholder="全部状态"
|
||||||
<el-option label="已通过" value="approved" />
|
style="width: 140px"
|
||||||
<el-option label="已拒绝" value="rejected" />
|
>
|
||||||
</el-select>
|
<el-option label="草稿" value="draft" />
|
||||||
</el-form-item>
|
<el-option label="已上架" value="published" />
|
||||||
</el-form>
|
<el-option label="已锁定" value="rented" />
|
||||||
<div class="listing-action-strip">
|
<el-option label="已下架" value="offline" />
|
||||||
<el-button @click="resetFilters">重置</el-button>
|
<el-option label="异常" value="abnormal" />
|
||||||
<el-button type="primary" :icon="Search" :loading="loading" @click="queryListings">查询</el-button>
|
</el-select>
|
||||||
<el-button :disabled="!listings.length" @click="copyTableScreenshot">复制截图</el-button>
|
</el-form-item>
|
||||||
<el-button :disabled="!listings.length" @click="downloadTableScreenshot">下载截图</el-button>
|
<el-form-item label="审核状态">
|
||||||
|
<el-select
|
||||||
|
v-model="filters.review_status"
|
||||||
|
clearable
|
||||||
|
placeholder="全部审核"
|
||||||
|
style="width: 140px"
|
||||||
|
>
|
||||||
|
<el-option label="未提交" value="none" />
|
||||||
|
<el-option label="待审核" value="pending" />
|
||||||
|
<el-option label="已通过" value="approved" />
|
||||||
|
<el-option label="已拒绝" value="rejected" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div class="listing-action-strip">
|
||||||
|
<el-button @click="resetFilters">重置</el-button>
|
||||||
|
<el-button type="primary" :icon="Search" :loading="loading" @click="queryListings">查询</el-button>
|
||||||
|
<el-button :disabled="!listings.length" @click="copyTableScreenshot">复制截图</el-button>
|
||||||
|
<el-button :disabled="!listings.length" @click="downloadTableScreenshot">下载截图</el-button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -442,64 +442,114 @@ h1 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.listing-control-panel {
|
.listing-control-panel {
|
||||||
display: grid;
|
display: flex;
|
||||||
grid-template-columns: minmax(340px, 0.65fr) minmax(520px, 1fr) auto;
|
flex-direction: column;
|
||||||
align-items: end;
|
gap: 16px;
|
||||||
gap: 14px;
|
margin-bottom: 16px;
|
||||||
margin-bottom: 14px;
|
border-radius: 12px;
|
||||||
border-radius: 14px;
|
|
||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
padding: 14px 16px;
|
padding: 20px;
|
||||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
|
||||||
}
|
}
|
||||||
|
|
||||||
.listing-metric-strip {
|
/* 统计卡片行 */
|
||||||
|
.listing-stats-row {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(4, 1fr);
|
||||||
|
gap: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.stat-card {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-direction: column;
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
|
padding: 16px 18px;
|
||||||
|
border: 1px solid #e8edf4;
|
||||||
|
border-radius: 10px;
|
||||||
|
background: #ffffff;
|
||||||
|
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
|
||||||
|
transition: all 0.2s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.listing-metric-strip span {
|
.stat-card.clickable {
|
||||||
display: inline-flex;
|
cursor: pointer;
|
||||||
align-items: baseline;
|
}
|
||||||
gap: 6px;
|
|
||||||
min-height: 34px;
|
.stat-card.clickable:hover {
|
||||||
border-radius: 8px;
|
border-color: #1477ff;
|
||||||
background: #f8f9fe;
|
box-shadow: 0 2px 8px rgba(20, 119, 255, 0.15);
|
||||||
padding: 8px 10px;
|
transform: translateY(-1px);
|
||||||
color: #8f9bba;
|
}
|
||||||
font-size: 12px;
|
|
||||||
|
.stat-card.active {
|
||||||
|
border-color: #1477ff;
|
||||||
|
background: #1477ff;
|
||||||
|
box-shadow: 0 2px 8px rgba(20, 119, 255, 0.25);
|
||||||
|
}
|
||||||
|
|
||||||
|
.stat-card .stat-label {
|
||||||
|
color: #6b7785;
|
||||||
|
font-size: 13px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
|
line-height: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.listing-metric-strip strong {
|
.stat-card.active .stat-label {
|
||||||
color: #1b2559;
|
color: #ffffff;
|
||||||
font-size: 16px;
|
}
|
||||||
|
|
||||||
|
.stat-card .stat-value {
|
||||||
|
color: #17233d;
|
||||||
|
font-size: 28px;
|
||||||
font-weight: 800;
|
font-weight: 800;
|
||||||
|
line-height: 1;
|
||||||
|
letter-spacing: -0.5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.stat-card.active .stat-value {
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 筛选和操作行 */
|
||||||
|
.listing-filter-row {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 16px;
|
||||||
|
padding-top: 4px;
|
||||||
|
border-top: 1px solid #f0f3f7;
|
||||||
}
|
}
|
||||||
|
|
||||||
.listing-filter-bar {
|
.listing-filter-bar {
|
||||||
display: grid;
|
display: flex;
|
||||||
grid-template-columns: minmax(180px, 1fr) minmax(160px, 0.8fr) minmax(170px, 0.8fr);
|
align-items: center;
|
||||||
gap: 12px;
|
gap: 0;
|
||||||
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.listing-filter-bar .el-form-item {
|
.listing-filter-bar .el-form-item {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
|
margin-right: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.listing-filter-bar .el-form-item:last-child {
|
||||||
|
margin-right: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.listing-filter-bar .el-form-item__label {
|
.listing-filter-bar .el-form-item__label {
|
||||||
color: #8f9bba;
|
color: #6b7785;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
letter-spacing: 0.2px;
|
margin-bottom: 6px;
|
||||||
|
line-height: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.listing-action-strip {
|
.listing-action-strip {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: flex-end;
|
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
padding-bottom: 1px;
|
padding-bottom: 1px;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user