feat(property-marketing): 优化账号和计划选择组件,重构投放指南表格展示逻辑

perf: 移除冗余代码,优化空数据展示处理
style: 统一组件样式引用方式,调整表格标题显示
This commit is contained in:
林志军
2025-07-10 15:24:11 +08:00
parent a8ed7c21c2
commit a0516cf378
8 changed files with 55 additions and 73 deletions

View File

@ -1,11 +1,5 @@
<template>
<a-select
v-model="selectedValue"
placeholder="请选择账号"
allow-clear
filterable
@change="handleChange"
>
<a-select allow-search v-model="selectedValue" placeholder="请选择账号" allow-clear filterable @change="handleChange">
<a-option v-for="account in filteredAccounts" :key="account.id" :value="account.id" :label="account.name">
{{ account.name }}
</a-option>
@ -54,13 +48,17 @@ const fetchAccounts = async () => {
};
// 搜索处理
const handleSearch = (value: string) => {
};
const handleSearch = (value: string) => {};
// 值变化处理
const handleChange = (value: number | string) => {
emit('update:modelValue', [value]);
let data = [];
if (value === '') {
data = [];
} else {
data = [value];
}
emit('update:modelValue', data);
};
// 初始化获取数据

View File

@ -1,5 +1,5 @@
<template>
<a-select v-model="selectedValue" placeholder="请选择计划" allow-clear filterable @change="handleChange">
<a-select allow-search v-model="selectedValue" placeholder="请选择计划" allow-clear filterable @change="handleChange">
<a-option v-for="item in listData" :key="item.id" :value="item.id" :label="item.name">
{{ item.name }}
</a-option>
@ -47,11 +47,14 @@ const fetchData = async () => {
loading.value = false;
}
};
// 搜索处理
const handleSearch = (value: string) => {};
const handleChange = (value: any) => {
emit('update:modelValue', [value]);
let data = [];
if (value === '') {
data = [];
} else {
data = [value];
}
emit('update:modelValue', data);
};
onMounted(fetchData);