|
|
@@ -733,6 +733,21 @@ const getBusinessSectionList = async () => {
|
|
|
const res: any = await getFirstLevelList({});
|
|
|
if (res && res.code === 200 && res.data) {
|
|
|
businessSectionList.value = res.data;
|
|
|
+ // 如果有数据,自动加载第一个经营板块的二级分类(经营种类)
|
|
|
+ if (res.data && res.data.length > 0) {
|
|
|
+ const firstSection = res.data[0];
|
|
|
+ const firstDictId = firstSection.dictId || firstSection.id;
|
|
|
+ if (firstDictId) {
|
|
|
+ try {
|
|
|
+ const secondRes: any = await getSecondLevelList({ parentDictId: String(firstDictId) });
|
|
|
+ if (secondRes && (secondRes.code === 200 || secondRes.code === "200") && secondRes.data) {
|
|
|
+ secondLevelList.value = secondRes.data;
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.error("获取二级分类失败:", error);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
} catch (error) {
|
|
|
console.error("获取一级分类失败:", error);
|