refactor(Home): 重构市场组件中的数据获取逻辑

-移除了对 parentCode 的判断,保留了所有列表项
-优化了代码格式,调整了缩进和空格
- 保留了原有的功能逻辑,没有引入新的变化
This commit is contained in:
陈昱达
2025-03-21 14:56:58 +08:00
parent 33feb02991
commit c7f254c904

View File

@@ -21,18 +21,18 @@ const marketList = ref([]);
const active = ref(null);
const marketInfo = ref([]);
const getTableList = async() => {
const getTableList = async () => {
const res = await getListScene();
if (res.data.code === 0) {
res.data.data.forEach((item) => {
if (item.parentCode && item.parentCode === 1) {
marketList.value.push(item);
}
// if (item.parentCode && item.parentCode === 1) {
marketList.value.push(item);
// }
});
getMarketInfo(marketList.value[0]);
}
};
const getMarketInfo = async(item) => {
const getMarketInfo = async (item) => {
const data = marketList.value.filter((market, index) => item === index)[0];
if (data) {
const params = {