feat(admin): family-level size/package/SKU union tabs in edit dialog; searchable merge-sibling list in config dialog

This commit is contained in:
yeuimu
2026-08-28 17:26:41 +08:00
parent 6d9305b878
commit c7e6c35fbf
2 changed files with 84 additions and 1 deletions
@@ -52,6 +52,17 @@ watch(() => props.visible, (v) => {
if (v) checkedIds.value = [...props.defaultCheckedIds]
})
// 合并同名候选搜索(本地过滤同分类链接)
const mergeKeyword = ref('')
watch(() => props.visible, (v) => {
if (v) mergeKeyword.value = ''
})
const filteredSiblings = computed(() => {
const kw = mergeKeyword.value.trim()
if (!kw) return props.siblings
return props.siblings.filter((s) => (s.goodName ?? '').includes(kw))
})
function onCascaderChange(val: any) {
form.value.categoryId = val.length ? val[val.length - 1] : ''
}
@@ -126,11 +137,19 @@ async function handleSubmit() {
</el-form-item>
<el-form-item v-if="siblings.length" label="合并同名">
<div class="config-merge-box">
<el-input
v-model="mergeKeyword"
size="small"
clearable
placeholder="搜索同分类链接…"
style="margin-bottom:8px"
/>
<el-checkbox-group v-model="checkedIds">
<el-checkbox v-for="s in siblings" :key="s.rawId" :value="String(s.rawId)">
<el-checkbox v-for="s in filteredSiblings" :key="s.rawId" :value="String(s.rawId)">
{{ s.goodName }}<template v-if="s.goodPrice"> · ¥{{ s.goodPrice }}</template>
</el-checkbox>
</el-checkbox-group>
<div v-if="!filteredSiblings.length" class="config-merge-empty">没有匹配的链接</div>
</div>
</el-form-item>
<el-form-item label="图片">
@@ -149,5 +168,6 @@ async function handleSubmit() {
.config-og-name { font-weight: 600; font-size: 14px; }
.config-og-meta { color: #909399; font-size: 12px; margin-top: 2px; }
.config-merge-box { width: 100%; }
.config-merge-empty { font-size: 12px; color: #909399; padding: 4px 0; }
.config-merge-box .el-checkbox-group { display: flex; flex-direction: column; align-items: flex-start; max-height: 200px; overflow-y: auto; }
</style>