refactor(Home): 重构市场组件中的数据获取逻辑
-移除了对 parentCode 的判断,保留了所有列表项 -优化了代码格式,调整了缩进和空格 - 保留了原有的功能逻辑,没有引入新的变化
This commit is contained in:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user