|
|
|
@@ -4,7 +4,6 @@ import { formatDateTime } from '@/utils/datetime'
|
|
|
|
|
* script 逻辑沿用现有 Vue 实现(查询/编辑/删除/导入轮询/导出秒表)。 */
|
|
|
|
|
import { computed, onMounted, reactive, ref } from 'vue'
|
|
|
|
|
import { ElMessage } from 'element-plus'
|
|
|
|
|
import { useAdminSessionStore } from '@/stores/admin-session'
|
|
|
|
|
import {
|
|
|
|
|
fetchDedupeTotalList,
|
|
|
|
|
updateDedupeTotal,
|
|
|
|
@@ -12,7 +11,7 @@ import {
|
|
|
|
|
fetchDedupeTotalGroups,
|
|
|
|
|
type DedupeGroupOption,
|
|
|
|
|
} from './dedupe-total-api.ts'
|
|
|
|
|
import { dedupeGroupSummaryOf, type DedupeTotalItem } from './dedupe-total-model.ts'
|
|
|
|
|
import type { DedupeTotalItem } from './dedupe-total-model.ts'
|
|
|
|
|
import { ASIN_COUNTRY_CODES, asinCountryLabel } from './asin-country.ts'
|
|
|
|
|
import { createDedupeTotalFilterState, toDedupeListParams } from './dedupe-total-filter.ts'
|
|
|
|
|
import {
|
|
|
|
@@ -25,7 +24,6 @@ import { importOutcomeText, importTaskFinished, isAllowedImportFile } from './de
|
|
|
|
|
import type { DedupeImportProgress } from './dedupe-import-model.ts'
|
|
|
|
|
import { toExportUrl } from './dedupe-total-export.ts'
|
|
|
|
|
|
|
|
|
|
const session = useAdminSessionStore()
|
|
|
|
|
const loading = ref(false)
|
|
|
|
|
const rows = ref<DedupeTotalItem[]>([])
|
|
|
|
|
const total = ref(0)
|
|
|
|
@@ -35,10 +33,6 @@ const filter = reactive(createDedupeTotalFilterState())
|
|
|
|
|
const groups = ref<DedupeGroupOption[]>([])
|
|
|
|
|
const jumpPage = ref('')
|
|
|
|
|
|
|
|
|
|
/** 页顶数据权限分组汇总(对齐 admin.js renderDedupeGroupSummary)。 */
|
|
|
|
|
const groupSummary = computed(() =>
|
|
|
|
|
dedupeGroupSummaryOf(groups.value, session.user?.id ?? null, session.user?.role || ''),
|
|
|
|
|
)
|
|
|
|
|
const totalPages = computed(() => Math.max(1, Math.ceil(total.value / pageSize)))
|
|
|
|
|
|
|
|
|
|
const editVisible = ref(false)
|
|
|
|
@@ -287,26 +281,6 @@ onMounted(() => {
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
<div class="dedupe-view">
|
|
|
|
|
<section class="form-box">
|
|
|
|
|
<div class="dedupe-group-access">
|
|
|
|
|
<div class="dedupe-group-access-main">
|
|
|
|
|
<span class="dedupe-group-access-title">数据权限分组</span>
|
|
|
|
|
<div class="dedupe-group-summary">
|
|
|
|
|
<template v-if="groupSummary.kind === 'all'">
|
|
|
|
|
<span class="dedupe-group-summary-chip">全部分组 · {{ groupSummary.count }} 个</span>
|
|
|
|
|
</template>
|
|
|
|
|
<span v-else-if="groupSummary.kind === 'none'" class="no-group">未加入分组</span>
|
|
|
|
|
<template v-else>
|
|
|
|
|
<span v-for="chip in groupSummary.chips" :key="chip.name" class="dedupe-group-summary-chip" :title="chip.name">
|
|
|
|
|
{{ chip.name }} · {{ chip.relation }}
|
|
|
|
|
</span>
|
|
|
|
|
<span v-if="groupSummary.extra > 0" class="extra-groups">另 {{ groupSummary.extra }} 个</span>
|
|
|
|
|
</template>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
<section class="panel-box">
|
|
|
|
|
<div class="dedupe-panel-head">
|
|
|
|
|
<h3>ASIN列表</h3>
|
|
|
|
@@ -505,54 +479,6 @@ h3 {
|
|
|
|
|
color: #24384d;
|
|
|
|
|
letter-spacing: 0.2px;
|
|
|
|
|
}
|
|
|
|
|
.dedupe-group-access {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
gap: 16px;
|
|
|
|
|
margin-bottom: 18px;
|
|
|
|
|
padding: 0 0 14px;
|
|
|
|
|
border-bottom: 1px solid #edf0f5;
|
|
|
|
|
}
|
|
|
|
|
.dedupe-group-access-main {
|
|
|
|
|
min-width: 0;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 12px;
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
}
|
|
|
|
|
.dedupe-group-access-title {
|
|
|
|
|
flex: 0 0 auto;
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
color: #24384d;
|
|
|
|
|
}
|
|
|
|
|
.dedupe-group-summary {
|
|
|
|
|
min-width: 0;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 6px;
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
color: #5b6f83;
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
}
|
|
|
|
|
.dedupe-group-summary-chip {
|
|
|
|
|
display: inline-flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
max-width: 220px;
|
|
|
|
|
padding: 4px 10px;
|
|
|
|
|
border: 1px solid #d8e3ee;
|
|
|
|
|
border-radius: 6px;
|
|
|
|
|
background: #f8f9fc;
|
|
|
|
|
color: #5b6f83;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
}
|
|
|
|
|
.no-group,
|
|
|
|
|
.extra-groups {
|
|
|
|
|
color: #8293a5;
|
|
|
|
|
}
|
|
|
|
|
.dedupe-panel-head {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|