755 lines
22 KiB
Vue
755 lines
22 KiB
Vue
<script setup lang="ts">
|
||
import { formatDateTime } from '@/utils/datetime'
|
||
/** 店铺数据记录页 · 像素复刻旧版 admin.html panel-shop-data-crawl-tasks(自绘:form-box 筛选[h4 筛选条件] + panel-box toolbar[全选/批量下载/权限配置/汇总] + 每店卡片网格 + 旧式分页(店铺级+卡片级 9/页))。
|
||
* script 逻辑沿用现有 Vue 实现(批量打包/删除结果文件[保留]/权限授权)。 */
|
||
import { computed, onMounted, reactive, ref } from 'vue'
|
||
import { ElMessage } from 'element-plus'
|
||
import { asinCountryLabel } from '../asin/asin-country.ts'
|
||
import { createShopDataFilter, type ShopDataFilter } from './shop-data-filter.ts'
|
||
import type { ShopDataResultRow, ShopDataTaskGroup } from './shop-data-model.ts'
|
||
import { isUsableShopDataResult } from './shop-data-model.ts'
|
||
import {
|
||
deleteShopDataResultHistory,
|
||
fetchShopDataResultDownload,
|
||
fetchShopDataTaskList,
|
||
fetchShopDataTaskPermissionUsers,
|
||
requestShopDataZipDownload,
|
||
saveShopDataTaskPermissions,
|
||
} from './shop-data-api.ts'
|
||
import { isTerminalStatus } from './image-video-view.ts'
|
||
import { grantedUserIds, type TaskPermissionItem } from './task-permission.ts'
|
||
import {
|
||
addShopDataSelection,
|
||
countShopDataSelection,
|
||
createShopDataSelection,
|
||
toggleShopDataSelection,
|
||
} from './shop-data-selection.ts'
|
||
import { useAdminSessionStore } from '@/stores/admin-session'
|
||
import OldPagination from '@/components/OldPagination.vue'
|
||
|
||
const session = useAdminSessionStore()
|
||
const loading = ref(false)
|
||
const groups = ref<ShopDataTaskGroup[]>([])
|
||
const totalShops = ref(0)
|
||
const page = ref(1)
|
||
// 店铺级一次全载(>200 家店铺时后端按页截断,可上调或恢复底部店铺级分页)。
|
||
const pageSize = ref(200)
|
||
// 卡片宫格分页:一行 4 个、一页 10 张卡片(在店铺分页的结果文件内翻页)。
|
||
const cardPage = ref(1)
|
||
const cardPageSize = ref(10)
|
||
const cardJump = ref('')
|
||
const cardTotalPages = computed(() => Math.max(1, Math.ceil(allResultRows.value.length / cardPageSize.value)))
|
||
|
||
const filter = reactive<ShopDataFilter & { dateRange: string[] }>({ ...createShopDataFilter(), dateRange: [] })
|
||
const selection = ref<Set<string>>(new Set())
|
||
|
||
const permissionVisible = ref(false)
|
||
const permissionItems = ref<TaskPermissionItem[]>([])
|
||
const permissionSaving = ref(false)
|
||
/** 权限弹窗用户表客户端分页(全量用户在表格内翻页,10/20/50/100 可选)。 */
|
||
const permPage = ref(1)
|
||
const permPageSize = ref(10)
|
||
const pagedPermissionItems = computed(() =>
|
||
permissionItems.value.slice((permPage.value - 1) * permPageSize.value, permPage.value * permPageSize.value),
|
||
)
|
||
|
||
const busyKey = ref('')
|
||
const deletingKey = ref('')
|
||
|
||
/** 旧版状态 label 映射(对齐 admin.js 状态徽章)。 */
|
||
function statusLabel(status: string): string {
|
||
const map: Record<string, string> = {
|
||
PENDING: '待执行',
|
||
WAITING: '排队中',
|
||
RUNNING: '执行中',
|
||
PROCESSING: '处理中',
|
||
SUCCESS: '已完成',
|
||
COMPLETED: '已完成',
|
||
FAILED: '失败',
|
||
ERROR: '失败',
|
||
CANCELLED: '已取消',
|
||
UNKNOWN: '未知',
|
||
}
|
||
const key = (status || '').toUpperCase()
|
||
if (map[key]) return map[key]
|
||
return key || '未知'
|
||
}
|
||
|
||
function statusType(status: string): 'pending' | 'running' | 'success' | 'failed' | 'cancelled' {
|
||
const key = (status || '').toUpperCase()
|
||
if (key === 'SUCCESS' || key === 'COMPLETED') return 'success'
|
||
if (key === 'FAILED' || key === 'ERROR') return 'failed'
|
||
if (key === 'CANCELLED') return 'cancelled'
|
||
if (key === 'PENDING' || key === 'WAITING') return 'pending'
|
||
return 'running'
|
||
}
|
||
|
||
function toFilter(): ShopDataFilter {
|
||
return {
|
||
shopName: filter.shopName.trim(),
|
||
groupName: filter.groupName.trim(),
|
||
country: filter.country.trim(),
|
||
createdFrom: filter.dateRange?.[0] || '',
|
||
createdTo: filter.dateRange?.[1] || '',
|
||
}
|
||
}
|
||
|
||
async function load() {
|
||
loading.value = true
|
||
try {
|
||
const result = await fetchShopDataTaskList(toFilter(), page.value, pageSize.value)
|
||
groups.value = result.items
|
||
totalShops.value = result.total
|
||
page.value = result.page
|
||
} catch (error) {
|
||
ElMessage.error(error instanceof Error ? error.message : '店铺数据记录加载失败')
|
||
} finally {
|
||
loading.value = false
|
||
}
|
||
}
|
||
|
||
function apply() {
|
||
page.value = 1
|
||
void load()
|
||
}
|
||
|
||
function reset() {
|
||
Object.assign(filter, createShopDataFilter())
|
||
filter.dateRange = []
|
||
page.value = 1
|
||
void load()
|
||
}
|
||
|
||
const allResultRows = computed(() => groups.value.flatMap((group) => group.results))
|
||
const pagedResultRows = computed(() =>
|
||
allResultRows.value.slice((cardPage.value - 1) * cardPageSize.value, cardPage.value * cardPageSize.value),
|
||
)
|
||
const selectionCount = computed(() => countShopDataSelection(selection.value))
|
||
|
||
function changeCardPage(p: number) {
|
||
cardPage.value = p
|
||
}
|
||
|
||
function changeCardSize(size: number) {
|
||
cardPageSize.value = size
|
||
cardPage.value = 1
|
||
}
|
||
|
||
function goCardJump() {
|
||
const n = Number.parseInt(cardJump.value, 10)
|
||
if (Number.isNaN(n)) {
|
||
ElMessage.warning('请输入页码')
|
||
return
|
||
}
|
||
changeCardPage(Math.min(Math.max(n, 1), cardTotalPages.value))
|
||
}
|
||
|
||
function resultFileCount(): number {
|
||
return groups.value.reduce((sum, group) => sum + group.results.length, 0)
|
||
}
|
||
|
||
/** 可勾选行(对齐 admin.js syncShopDataSelectionUi:file_ready && resultId>0,不附加终态约束)。 */
|
||
function selectableRows(): ShopDataResultRow[] {
|
||
return allResultRows.value.filter((row) => isUsableShopDataResult(row))
|
||
}
|
||
|
||
function toggleRow(row: ShopDataResultRow) {
|
||
selection.value = toggleShopDataSelection(selection.value, row.resultId)
|
||
}
|
||
|
||
function toggleSelectAllReady() {
|
||
const rows = selectableRows()
|
||
const allIn = rows.length > 0 && rows.every((row) => selection.value.has(row.resultId))
|
||
selection.value = allIn
|
||
? createShopDataSelection()
|
||
: addShopDataSelection(new Set(selection.value), rows.map((row) => row.resultId))
|
||
}
|
||
|
||
function rowSelected(row: ShopDataResultRow): boolean {
|
||
return selection.value.has(row.resultId)
|
||
}
|
||
|
||
function selectAllChecked(): boolean {
|
||
const rows = selectableRows()
|
||
return rows.length > 0 && rows.every((row) => selection.value.has(row.resultId))
|
||
}
|
||
|
||
function selectAllIndeterminate(): boolean {
|
||
const rows = selectableRows()
|
||
return selectionCount.value > 0 && selectionCount.value < rows.length
|
||
}
|
||
|
||
async function downloadRow(row: ShopDataResultRow) {
|
||
if (!row.fileReady) {
|
||
ElMessage.warning('文件未就绪,无法下载')
|
||
return
|
||
}
|
||
busyKey.value = row.resultId
|
||
try {
|
||
const { blob, filename } = await fetchShopDataResultDownload(row.resultId)
|
||
saveBlob(blob, filename)
|
||
ElMessage.success('下载已开始')
|
||
} catch (error) {
|
||
ElMessage.error(error instanceof Error ? error.message : '下载失败')
|
||
} finally {
|
||
busyKey.value = ''
|
||
}
|
||
}
|
||
|
||
async function downloadBatch() {
|
||
const resultIds = Array.from(selection.value)
|
||
if (!resultIds.length) {
|
||
ElMessage.warning('请先勾选要下载的结果文件')
|
||
return
|
||
}
|
||
busyKey.value = 'batch'
|
||
try {
|
||
const zip = await requestShopDataZipDownload(resultIds)
|
||
saveBlob(zip.blob, `店铺数据批量下载_${resultIds.length}.zip`)
|
||
const note = zip.errorCount ? `,${zip.errorCount} 个失败(详见包内错误清单)` : ''
|
||
ElMessage.success(`已下载 ${zip.fileCount ?? resultIds.length} 个文件${note}`)
|
||
} catch (error) {
|
||
ElMessage.error(error instanceof Error ? error.message : '批量下载失败')
|
||
} finally {
|
||
busyKey.value = ''
|
||
}
|
||
}
|
||
|
||
async function removeRowByRow(row: ShopDataResultRow) {
|
||
// 对齐旧版:原生 confirm。
|
||
if (!window.confirm(`确认删除店铺“${row.shopName}”的任务 ${row.taskNo || row.resultId} 及结果文件?`)) return
|
||
deletingKey.value = row.resultId
|
||
try {
|
||
await deleteShopDataResultHistory(row.resultId)
|
||
ElMessage.success('删除成功')
|
||
await load()
|
||
} catch (error) {
|
||
ElMessage.error(error instanceof Error ? error.message : `正在删除任务 ${row.taskNo || row.resultId}...`)
|
||
} finally {
|
||
deletingKey.value = ''
|
||
}
|
||
}
|
||
|
||
function saveBlob(blob: Blob, filename: string) {
|
||
const url = URL.createObjectURL(blob)
|
||
const anchor = document.createElement('a')
|
||
anchor.href = url
|
||
anchor.download = filename
|
||
anchor.click()
|
||
URL.revokeObjectURL(url)
|
||
}
|
||
|
||
async function openPermission() {
|
||
try {
|
||
permissionItems.value = await fetchShopDataTaskPermissionUsers()
|
||
permPage.value = 1
|
||
permissionVisible.value = true
|
||
} catch (error) {
|
||
ElMessage.error(error instanceof Error ? error.message : '权限用户加载失败')
|
||
}
|
||
}
|
||
|
||
function toggleGrant(item: TaskPermissionItem) {
|
||
item.granted = !item.granted
|
||
}
|
||
|
||
async function savePermission() {
|
||
permissionSaving.value = true
|
||
try {
|
||
const next = grantedUserIds(permissionItems.value)
|
||
await saveShopDataTaskPermissions(next)
|
||
ElMessage.success('保存成功')
|
||
permissionVisible.value = false
|
||
} catch (error) {
|
||
ElMessage.error(error instanceof Error ? error.message : '保存失败')
|
||
} finally {
|
||
permissionSaving.value = false
|
||
}
|
||
}
|
||
|
||
const grantedCount = computed(() => grantedUserIds(permissionItems.value).length)
|
||
|
||
onMounted(load)
|
||
</script>
|
||
|
||
<template>
|
||
<div class="sd-view">
|
||
<section class="form-box">
|
||
<h3>店铺数据记录</h3>
|
||
<h4 class="sd-filter-title">筛选条件</h4>
|
||
<div class="form-row">
|
||
<div class="form-group" style="min-width: 160px">
|
||
<label>店铺</label>
|
||
<input v-model="filter.shopName" type="text" placeholder="模糊搜索店铺名" @keyup.enter="apply" />
|
||
</div>
|
||
<div class="form-group" style="min-width: 150px">
|
||
<label>分组</label>
|
||
<input v-model="filter.groupName" type="text" placeholder="模糊搜索分组名" @keyup.enter="apply" />
|
||
</div>
|
||
<div class="form-group" style="min-width: 130px">
|
||
<label>国家</label>
|
||
<select v-model="filter.country">
|
||
<option value="">全部</option>
|
||
<option v-for="code in ['UK', 'DE', 'FR', 'ES', 'IT']" :key="code" :value="code">{{ asinCountryLabel(code) }}</option>
|
||
</select>
|
||
</div>
|
||
<div class="form-group" style="min-width: 176px">
|
||
<label>创建开始</label>
|
||
<input v-model="filter.dateRange[0]" type="datetime-local" />
|
||
</div>
|
||
<div class="form-group" style="min-width: 176px">
|
||
<label>创建结束</label>
|
||
<input v-model="filter.dateRange[1]" type="datetime-local" />
|
||
</div>
|
||
<button class="btn" type="button" @click="apply">查询</button>
|
||
<button class="btn btn-secondary" type="button" @click="reset">重置</button>
|
||
</div>
|
||
</section>
|
||
|
||
<section class="panel-box">
|
||
<div class="sd-toolbar">
|
||
<div class="sd-toolbar-main">
|
||
<label class="sd-select-all">
|
||
<input type="checkbox" :checked="selectAllChecked()" :indeterminate="selectAllIndeterminate()" @change="toggleSelectAllReady" />
|
||
全选可下载
|
||
</label>
|
||
<button class="btn" type="button" :disabled="selectionCount === 0 || busyKey === 'batch'" @click="downloadBatch">
|
||
批量下载{{ selectionCount ? `(${selectionCount})` : '' }}
|
||
</button>
|
||
<button v-if="session.isSuperAdmin" class="btn btn-secondary" type="button" @click="openPermission">权限配置</button>
|
||
</div>
|
||
<div class="sd-toolbar-side">
|
||
<span class="sd-summary">共 {{ totalShops }} 家店铺 · 本页 {{ resultFileCount() }} 个结果文件</span>
|
||
</div>
|
||
</div>
|
||
|
||
<div v-loading="loading" class="shop-card-grid">
|
||
<template v-if="allResultRows.length">
|
||
<article
|
||
v-for="row in pagedResultRows"
|
||
:key="row.resultId || `${row.taskNo}-${row.filename}`"
|
||
class="sd-card"
|
||
>
|
||
<header class="sd-card-head">
|
||
<span class="sd-shop-name" :title="row.shopName || '-'">{{ row.shopName || '-' }}</span>
|
||
</header>
|
||
<div class="sd-card-select-row">
|
||
<input type="checkbox" :checked="rowSelected(row)" :disabled="!isUsableShopDataResult(row)" @change="toggleRow(row)" />
|
||
<span class="shop-card-task-no" :title="`任务 ${row.taskNo || row.resultId}`">任务 {{ row.taskNo || row.resultId }}</span>
|
||
<span class="st-pill" :class="`is-${statusType(row.status)}`">{{ statusLabel(row.status) }}</span>
|
||
</div>
|
||
<div class="sd-card-row" v-if="row.groupName">
|
||
<span class="sd-card-label">分组</span>
|
||
<span class="sd-card-value">{{ row.groupName }}</span>
|
||
</div>
|
||
<div class="sd-card-row">
|
||
<span class="sd-card-label">最新</span>
|
||
<span class="sd-card-value">{{ formatDateTime(row.updatedAt || row.createdAt) || '-' }}</span>
|
||
</div>
|
||
<div class="sd-card-row">
|
||
<span class="sd-card-label">国家</span>
|
||
<span class="sd-card-value">
|
||
<span v-for="code in row.countryCodes" :key="code" class="country-chip">{{ asinCountryLabel(code) }}</span>
|
||
<span v-if="!row.countryCodes.length" class="dim">-</span>
|
||
</span>
|
||
</div>
|
||
<div class="sd-card-row">
|
||
<span class="sd-card-label">文件</span>
|
||
<span class="sd-card-value sd-card-file" :title="row.filename">{{ row.filename || '-' }}</span>
|
||
</div>
|
||
<div class="sd-card-actions">
|
||
<button
|
||
class="btn btn-sm"
|
||
type="button"
|
||
:disabled="!isUsableShopDataResult(row) || busyKey === row.resultId"
|
||
@click="downloadRow(row)"
|
||
>
|
||
{{ busyKey === row.resultId ? '下载中...' : '下载文件' }}
|
||
</button>
|
||
<button
|
||
v-if="isTerminalStatus(row.status) && !!row.resultId"
|
||
class="btn btn-sm btn-danger"
|
||
type="button"
|
||
:disabled="deletingKey === row.resultId"
|
||
@click="removeRowByRow(row)"
|
||
>
|
||
{{ deletingKey === row.resultId ? '删除中...' : '删除' }}
|
||
</button>
|
||
</div>
|
||
</article>
|
||
</template>
|
||
<div v-else-if="!loading" class="empty-tip">暂无符合条件的店铺数据记录</div>
|
||
</div>
|
||
|
||
<OldPagination v-if="allResultRows.length > 0" :total="allResultRows.length" :page="cardPage" :page-size="cardPageSize" @change="changeCardPage" @size-change="changeCardSize" />
|
||
</section>
|
||
|
||
<el-dialog v-model="permissionVisible" title="店铺数据记录数据范围授权" width="620px">
|
||
<p class="dim">勾选允许查看/操作店铺数据记录的用户(仅数据范围)。当前已授权 {{ grantedCount }} 人。</p>
|
||
<el-table :data="pagedPermissionItems" border size="small" max-height="420">
|
||
<el-table-column prop="id" label="ID" min-width="80" />
|
||
<el-table-column prop="username" label="用户名" min-width="180" />
|
||
<el-table-column label="授权" min-width="90" align="center">
|
||
<template #default="{ row }">
|
||
<el-checkbox :model-value="(row as TaskPermissionItem).granted" @change="toggleGrant(row as TaskPermissionItem)" />
|
||
</template>
|
||
</el-table-column>
|
||
</el-table>
|
||
<OldPagination v-if="permissionItems.length > permPageSize" :total="permissionItems.length" :page="permPage" :page-size="permPageSize" @change="permPage = $event" @size-change="(s: number) => { permPageSize = s; permPage = 1 }" />
|
||
<template #footer>
|
||
<el-button @click="permissionVisible = false">取消</el-button>
|
||
<el-button type="primary" :loading="permissionSaving" @click="savePermission">保存</el-button>
|
||
</template>
|
||
</el-dialog>
|
||
</div>
|
||
</template>
|
||
|
||
<style scoped>
|
||
/* 像素复刻旧版 admin.html panel-shop-data-crawl-tasks(蓝白末层)。 */
|
||
.sd-view {
|
||
font-family: inherit;
|
||
color: #24384d;
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 18px;
|
||
}
|
||
.form-box,
|
||
.panel-box {
|
||
width: 100%;
|
||
min-width: 0;
|
||
padding: 20px 22px 24px;
|
||
border: 1px solid #d8e3ee;
|
||
border-radius: 14px;
|
||
background: linear-gradient(145deg, #ffffff, #f9fbfd);
|
||
box-shadow: 0 1px 2px rgba(39, 67, 94, 0.04), 0 14px 30px -24px rgba(39, 67, 94, 0.28);
|
||
}
|
||
h3 {
|
||
margin: 0 0 14px;
|
||
font-size: 15px;
|
||
font-weight: 650;
|
||
color: #24384d;
|
||
letter-spacing: 0.2px;
|
||
}
|
||
.sd-filter-title {
|
||
margin: 0 0 14px;
|
||
font-size: 13.5px;
|
||
font-weight: 600;
|
||
color: #40586e;
|
||
}
|
||
.form-row {
|
||
display: flex;
|
||
flex-wrap: wrap;
|
||
align-items: flex-end;
|
||
gap: 14px 18px;
|
||
}
|
||
.form-group {
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 7px;
|
||
margin-bottom: 0;
|
||
}
|
||
.form-group label {
|
||
color: #5b6f83;
|
||
font-size: 12.5px;
|
||
font-weight: 600;
|
||
}
|
||
.form-group input,
|
||
.form-group select {
|
||
min-width: 0;
|
||
min-height: 42px;
|
||
padding: 8px 12px;
|
||
border: 1px solid #cbd9e6;
|
||
border-radius: 9px;
|
||
background: #f8fbfd;
|
||
color: #24384d;
|
||
font-size: 13.5px;
|
||
font-family: inherit;
|
||
color-scheme: light;
|
||
outline: none;
|
||
transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
|
||
}
|
||
.form-group input:hover,
|
||
.form-group select:hover {
|
||
border-color: #9fb7cd;
|
||
}
|
||
.form-group input:focus,
|
||
.form-group select:focus {
|
||
background: #ffffff;
|
||
border-color: #5f85ad;
|
||
box-shadow: 0 0 0 3px rgba(95, 133, 173, 0.16);
|
||
}
|
||
.btn {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
gap: 8px;
|
||
min-height: 42px;
|
||
padding: 9px 18px;
|
||
border: 1px solid #4f78a5;
|
||
border-radius: 9px;
|
||
background: linear-gradient(135deg, #5f85ad, #4f78a5);
|
||
color: #ffffff;
|
||
font-family: inherit;
|
||
font-size: 13.5px;
|
||
cursor: pointer;
|
||
box-shadow: 0 8px 18px -14px rgba(79, 120, 165, 0.72);
|
||
transition: background 160ms ease, box-shadow 160ms ease, transform 120ms ease;
|
||
}
|
||
.btn:hover:not(:disabled) {
|
||
background: linear-gradient(135deg, #7094ba, #5d83ac);
|
||
box-shadow: 0 11px 22px -14px rgba(79, 120, 165, 0.8);
|
||
}
|
||
.btn:disabled {
|
||
cursor: not-allowed;
|
||
opacity: 0.55;
|
||
}
|
||
.btn-secondary {
|
||
background: #ffffff;
|
||
color: #5b6f83;
|
||
border-color: #c7d7e5;
|
||
}
|
||
.btn-secondary:hover:not(:disabled) {
|
||
color: #2f5d8b;
|
||
border-color: #95b1cb;
|
||
background: #edf5fb;
|
||
}
|
||
.btn-danger {
|
||
background: linear-gradient(135deg, #c06d77, #b35f6a);
|
||
border-color: #b35f6a;
|
||
}
|
||
.btn-danger:hover:not(:disabled) {
|
||
background: linear-gradient(135deg, #cb7c84, #b96570);
|
||
}
|
||
.btn-sm {
|
||
min-height: 36px;
|
||
padding: 7px 12px;
|
||
}
|
||
.sd-toolbar {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
gap: 12px;
|
||
flex-wrap: wrap;
|
||
margin-bottom: 14px;
|
||
}
|
||
.sd-toolbar-main {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
gap: 14px;
|
||
flex-wrap: wrap;
|
||
}
|
||
.sd-toolbar-side {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
gap: 12px;
|
||
flex-wrap: wrap;
|
||
justify-content: flex-end;
|
||
}
|
||
.sd-select-all {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
gap: 7px;
|
||
font-size: 13px;
|
||
color: #5b6f83;
|
||
cursor: pointer;
|
||
}
|
||
.sd-summary {
|
||
color: #5b6f83;
|
||
font-size: 13px;
|
||
white-space: nowrap;
|
||
}
|
||
.sd-shop-pager {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
gap: 8px;
|
||
font-size: 13px;
|
||
color: #5b6f83;
|
||
}
|
||
.sd-shop-pager button,
|
||
.pagination button,
|
||
.jump-btn {
|
||
min-height: 30px;
|
||
padding: 4px 12px;
|
||
border: 1px solid #c7d7e5;
|
||
border-radius: 8px;
|
||
background: #ffffff;
|
||
color: #5b6f83;
|
||
font-family: inherit;
|
||
font-size: 13px;
|
||
cursor: pointer;
|
||
}
|
||
.sd-shop-pager button:hover:not(:disabled),
|
||
.pagination button:hover:not(:disabled) {
|
||
background: #edf5fb;
|
||
border-color: #95b1cb;
|
||
color: #2f5d8b;
|
||
}
|
||
.sd-shop-pager button:disabled,
|
||
.pagination button:disabled {
|
||
background: #eef3f7;
|
||
color: #9baaba;
|
||
cursor: not-allowed;
|
||
}
|
||
.sd-shop-pager input,
|
||
.page-jump input {
|
||
width: 52px;
|
||
min-height: 30px;
|
||
padding: 4px 8px;
|
||
border: 1px solid #cbd9e6;
|
||
border-radius: 8px;
|
||
background: #f8fbfd;
|
||
color: #24384d;
|
||
font-size: 13px;
|
||
font-family: inherit;
|
||
}
|
||
.shop-card-grid {
|
||
display: grid;
|
||
grid-template-columns: repeat(4, 1fr);
|
||
gap: 14px;
|
||
}
|
||
.sd-card {
|
||
border: 1px solid #d8e3ee;
|
||
border-radius: 12px;
|
||
background: #ffffff;
|
||
box-shadow: 0 1px 2px rgba(39, 67, 94, 0.04), 0 14px 30px -24px rgba(39, 67, 94, 0.28);
|
||
overflow: hidden;
|
||
}
|
||
.sd-card-head {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 10px;
|
||
padding: 12px 16px;
|
||
border-bottom: 1px solid #e6edf4;
|
||
}
|
||
.sd-shop-name {
|
||
font-weight: 600;
|
||
color: #24384d;
|
||
}
|
||
.sd-card-select-row {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 10px;
|
||
padding: 10px 16px 0;
|
||
}
|
||
.shop-card-task-no {
|
||
flex: 1 1 auto;
|
||
min-width: 0;
|
||
font-weight: 600;
|
||
font-size: 12px;
|
||
color: #24384d;
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
white-space: nowrap;
|
||
}
|
||
.sd-card-row {
|
||
display: flex;
|
||
align-items: flex-start;
|
||
gap: 10px;
|
||
padding: 6px 16px;
|
||
font-size: 13px;
|
||
}
|
||
.sd-card-label {
|
||
flex: none;
|
||
width: 52px;
|
||
color: #8293a5;
|
||
}
|
||
.sd-card-value {
|
||
color: #40586e;
|
||
min-width: 0;
|
||
}
|
||
.sd-card-file {
|
||
overflow: hidden;
|
||
white-space: nowrap;
|
||
text-overflow: ellipsis;
|
||
}
|
||
.sd-card-actions {
|
||
display: flex;
|
||
flex-wrap: wrap;
|
||
gap: 8px;
|
||
padding: 6px 16px 14px;
|
||
}
|
||
.st-pill {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
padding: 2px 10px;
|
||
border-radius: 999px;
|
||
font-size: 12px;
|
||
line-height: 1.7;
|
||
border: 1px solid transparent;
|
||
white-space: nowrap;
|
||
flex: none;
|
||
}
|
||
.st-pill.is-success {
|
||
color: #3d7158;
|
||
background: #e8f2eb;
|
||
border-color: #bdd7c5;
|
||
}
|
||
.st-pill.is-failed {
|
||
color: #91474f;
|
||
background: #f8ebeb;
|
||
border-color: #e4c2c5;
|
||
}
|
||
.st-pill.is-cancelled {
|
||
color: #5b6f83;
|
||
background: #f1f6fa;
|
||
border-color: #d6e2ec;
|
||
}
|
||
.st-pill.is-pending,
|
||
.st-pill.is-running {
|
||
color: #8a6d3b;
|
||
background: #fbf4ea;
|
||
border-color: #e7d3ae;
|
||
}
|
||
.country-chip {
|
||
padding: 1px 8px;
|
||
margin-right: 4px;
|
||
border-radius: 999px;
|
||
background: #eef4fa;
|
||
color: #40586e;
|
||
font-size: 12px;
|
||
}
|
||
.dim {
|
||
color: #8293a5;
|
||
font-size: 12px;
|
||
}
|
||
.empty-tip {
|
||
grid-column: 1 / -1;
|
||
padding: 44px 24px;
|
||
text-align: center;
|
||
color: #8293a5;
|
||
font-size: 13.5px;
|
||
}
|
||
.pagination {
|
||
display: flex;
|
||
flex-wrap: wrap;
|
||
align-items: center;
|
||
gap: 10px;
|
||
margin-top: 18px;
|
||
color: #5b6f83;
|
||
font-size: 13px;
|
||
}
|
||
.page-total {
|
||
margin-right: 4px;
|
||
}
|
||
.page-jump {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
gap: 6px;
|
||
}
|
||
@media (max-width: 1400px) {
|
||
.shop-card-grid {
|
||
grid-template-columns: repeat(3, 1fr);
|
||
}
|
||
}
|
||
@media (max-width: 1100px) {
|
||
.shop-card-grid {
|
||
grid-template-columns: repeat(2, 1fr);
|
||
}
|
||
}
|
||
@media (max-width: 760px) {
|
||
.shop-card-grid {
|
||
grid-template-columns: 1fr;
|
||
}
|
||
}
|
||
</style>
|