feat: 完善首页交互,完善上传页面分类及标签

This commit is contained in:
秋水浮尘
2023-10-19 00:56:23 +08:00
parent 9322d1b71b
commit 668d1e0a52
8 changed files with 119 additions and 393 deletions

View File

@@ -52,16 +52,21 @@ const QuestionBank = () => {
const onChangeCategory = (item: Record<string, any>) => {
setLabelList('')
setPromaryCategoryId(item.id)
setQuestionList([])
setPageIndex(1)
setTotal(0)
};
const [secondCategoryId, setSecondCategoryId] = useState('')
/**
* 选择标签时,请求列表数据
* @param {*} primaryCategoryId 一级分类id
* @param {*} assembleIds 三级标签 assembleIds
*/
const onChangeLabel = (primaryCategory: any, assembleIds: string) => {
setPromaryCategoryId(primaryCategory)
const onChangeLabel = (secondCategoryId: any, assembleIds: string) => {
// setPromaryCategoryId(primaryCategory)
setSecondCategoryId(secondCategoryId)
setLabelList(assembleIds)
setPageIndex(1)
};
@@ -71,7 +76,7 @@ const QuestionBank = () => {
pageNo: pageIndex,
pageSize: 10,
labelId: labelList,
categoryId: primaryCategoryId,
categoryId: secondCategoryId,
subjectDifficult: 1
}
req({