|
|
@ -35,7 +35,9 @@ const getmarket = async () => { |
|
|
|
console.log('获取地区数据成功', result) |
|
|
|
// 假设后端返回的是字符串数组,转换为 { value, label } 格式 |
|
|
|
if (Array.isArray(result.data) && typeof result.data[0] === 'string') { |
|
|
|
market.value = result.data.map(item => ({ value: item, label: item })); |
|
|
|
market.value = result.data |
|
|
|
.filter(item => item !== null && item !== undefined && item.trim() !== '') // 过滤空值 |
|
|
|
.map(item => ({ value: item, label: item })); |
|
|
|
} else { |
|
|
|
market.value = result.data; |
|
|
|
} |
|
|
|