更改下载类型处理

This commit is contained in:
super
2026-04-06 16:58:58 +08:00
parent 9720453ac4
commit afffb7aad2
11 changed files with 87 additions and 18 deletions

View File

@@ -75,6 +75,24 @@
</div>
<div v-if="countryPrefSaving" class="country-pref-status">保存中</div>
<div class="section-title">商品列表筛选</div>
<p class="hint listing-filter-hint">推送到 Python 队列一并下发 Python 区分处理场景</p>
<div class="listing-filter-row">
<el-select
v-model="productRiskListingFilter"
class="listing-filter-select"
teleported
placeholder="选择筛选类型"
>
<el-option
v-for="opt in PRODUCT_RISK_LISTING_FILTER_OPTIONS"
:key="opt.value"
:label="opt.label"
:value="opt.value"
/>
</el-select>
</div>
<div class="run-row">
<button type="button" class="btn-run" :disabled="matching" @click="runMatch">
{{ matching ? '匹配中' : '匹配店铺' }}
@@ -271,7 +289,16 @@ const COUNTRY_OPTIONS = [
{ code: 'ES', label: '西班牙' },
] as const
/** 与 Python 约定:队列 payload.data.risk_listing_filter */
const PRODUCT_RISK_LISTING_FILTER_OPTIONS = [
{ value: 'SearchSuppressed', label: '在搜索结果中禁止显示' },
{ value: 'ApprovalRequired', label: '需要批准' },
] as const
type ProductRiskListingFilter = (typeof PRODUCT_RISK_LISTING_FILTER_OPTIONS)[number]['value']
const orderedCountryCodes = ref<string[]>(['DE', 'UK', 'FR', 'IT', 'ES'])
const productRiskListingFilter = ref<ProductRiskListingFilter>('SearchSuppressed')
const dragCountryIndex = ref<number | null>(null)
const countryPrefSaving = ref(false)
/** 用户已改过顺序/勾选后,忽略晚到的 GET避免把界面打回全选 */
@@ -928,6 +955,7 @@ async function pushToPythonQueue() {
taskId: created.taskId,
items: [item],
country_codes: [...orderedCountryCodes.value],
risk_listing_filter: productRiskListingFilter.value,
},
}
queuePayloadText.value = JSON.stringify(payload, null, 2)
@@ -1112,6 +1140,28 @@ onUnmounted(() => {
margin-bottom: 10px;
}
.listing-filter-hint {
margin-top: -4px;
}
.listing-filter-row {
margin-bottom: 16px;
}
.listing-filter-select {
width: 100%;
}
.listing-filter-row :deep(.el-select__wrapper) {
background-color: #2a2a2a;
box-shadow: 0 0 0 1px #3a3a3a inset;
}
.listing-filter-row :deep(.el-select__placeholder),
.listing-filter-row :deep(.el-select__selected-item) {
color: #ccc;
}
.input-row {
display: flex;
gap: 10px;