提交 82a77d57 作者: ZhangLingKun

功能:课程判空

上级 28a5dd69
#请求接口地址
VITE_REQUEST_BASE_URL='https://www.iuav.shop'
#VITE_REQUEST_BASE_URL='https://test.iuav.shop'
#VITE_REQUEST_BASE_URL='https://iuav.mmcuav.cn'
VITE_REQUEST_BASE_URL='https://test.iuav.shop'
#VITE_REQUEST_BASE_URL='/api'
#旧版接口地址
#VITE_REQUEST_BASE_URL='https://iuav.mmcuav.cn'
......
......@@ -79,13 +79,14 @@ const AddEditModal: React.FC<propType> = (props) => {
type: 3,
});
if (res && res.code === '200') {
const arr = res.result
?.filter((i) => i.categoriesInfoListDTO)
.map((i) => ({
label: i.name,
value: i.directoryId,
children: i.categoriesInfoListDTO?.map((j) => ({ label: j.name, value: j.id })),
}));
const arr =
res.result
?.filter((i) => i.categoriesInfoListDTO)
.map((i) => ({
label: i.name,
value: i.directoryId,
children: i.categoriesInfoListDTO?.map((j) => ({ label: j.name, value: j.id })),
})) || [];
setCurriculumSkillList(arr);
// 回显数据
// 回显数据
......
......@@ -102,7 +102,7 @@ const CourseManageView = () => {
label: i.name,
value: i.directoryId,
children: i.categoriesInfoListDTO?.map((j) => ({ label: j.name, value: j.id })),
})),
})) || [],
);
}
};
......@@ -121,7 +121,7 @@ const CourseManageView = () => {
width: '150px',
render: (text) => {
// 反向找数据回显
const item = curriculumSkillList.find((i) => i.children?.find((j) => j.value === text));
const item = curriculumSkillList?.find((i) => i.children?.find((j) => j.value === text));
const childrenItem = item?.children?.find((i) => i.value === text);
return `${item?.label}/${childrenItem?.label}`;
},
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论