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