revert 解决冲突
This commit is contained in:
2025-11-27 15:38:24 +08:00
parent 3da220526b
commit 64abd3d4ab
28 changed files with 1059 additions and 705 deletions

View File

@@ -52,26 +52,30 @@ const subCategoryList = ref<ICategory[]>([]) // 子级分类列表
* 获取分类下的子级分类
*/
const getSubCategoryList = async () => {
let res: any = null
switch (subject.value) {
case '医学':
res = await courseSubjectClassificationApi.getCourseMedicalChildLabels(categoryId.value)
break
case '心理学':
res = await courseSubjectClassificationApi.getCourseSoulChildLabels(categoryId.value)
break
}
if (res && res.code === 0) {
if (res.labels && res.labels.length > 0) {
subCategoryList.value = res.labels
// 默认选中第一个tab
tab_category_id.value = res.labels[0].id
radio_category_id.value = res.labels[0].children[0] && res.labels[0].children[0].id || 0
} else {
subCategoryList.value = []
tab_category_id.value = 0
radio_category_id.value = 0
try {
let res: any = null
switch (subject.value) {
case '医学':
res = await courseSubjectClassificationApi.getCourseMedicalChildLabels(categoryId.value)
break
case '心理学':
res = await courseSubjectClassificationApi.getCourseSoulChildLabels(categoryId.value)
break
}
if (res && res.code === 0) {
if (res.labels && res.labels.length > 0) {
subCategoryList.value = res.labels
// 默认选中第一个tab
tab_category_id.value = res.labels[0].id
radio_category_id.value = res.labels[0].children[0] && res.labels[0].children[0].id || 0
} else {
subCategoryList.value = []
tab_category_id.value = 0
radio_category_id.value = 0
}
}
} catch (error) {
console.error('获取分类下的子级分类失败:', error)
}
}