diff --git a/admin/src/pages/questionbank/index.tsx b/admin/src/pages/questionbank/index.tsx index e741483..ffa49a3 100644 --- a/admin/src/pages/questionbank/index.tsx +++ b/admin/src/pages/questionbank/index.tsx @@ -71,6 +71,7 @@ console.log('first'); * @param selectedRows */ const handleRemove = async (selectedRows: TableListItem[]) => { + console.log('selectedRows--', selectedRows) const hide = message.loading('正在删除'); if (!selectedRows) return true; @@ -118,21 +119,29 @@ const QuestionBank = () => { { title: '标签', valueType: 'select', - dataIndex: 'tags', + dataIndex: 'tag_ids', sorter: false, hideInTable: true, hideInForm: false, - hideInSearch: true, + hideInSearch: false, fieldProps: { mode: "multiple" }, + formItemProps: { + rules: [ + { + required: true, + message: '请填标签', + }, + ] + }, renderText: (val: string) => `${val}`, request: async () => { const { data: Items } = await queryTagList({}); console.log('queryTagList...') const tags = [] for (let i = 0; i < Items.length; i++) { - tags.push({ label: Items[i].tag_name, value: Items[i].tag_id }) + tags.push({ label: Items[i]?.tag_name, value: Items[i]?.tag_id }) } console.log(tags, 'tags:::'); return tags; @@ -145,7 +154,7 @@ const QuestionBank = () => { sorter: false, hideInTable: false, hideInForm: false, - hideInSearch: true, + hideInSearch: false, fieldProps: { //mode: "multiple" }, @@ -158,10 +167,10 @@ const QuestionBank = () => { ] }, renderText: (val: string) => `${val}`, - dependencies: ['tags'], + dependencies: ['tag_ids'], request: async (params) => { - const {tags} = params; - const { data: Items } = await queryCourseListByTag({tag_ids: tags?.toString()}); + const {tag_ids} = params; + const { data: Items } = await queryCourseListByTag({tag_ids: tag_ids?.toString()}); console.log('queryCourseListByTag...') const courses = [] for (let i = 0; i < Items?.length; i++) { @@ -178,7 +187,7 @@ const QuestionBank = () => { hideInTable: false, hideInDescriptions: false, hideInForm: false, - hideInSearch: true, + hideInSearch: false, formItemProps: { rules: [ { @@ -283,6 +292,19 @@ const QuestionBank = () => { /> ), }, + { + title: '创建时间', + dataIndex: 'create_time', + valueType: 'text', + sorter: false, + hideInTable: true, + hideInForm: true, + hideInSearch: false, + // renderText: (val: string) => (
), + renderFormItem: (item, { defaultRender, ...rest }, form) => ( +<>> + ), + }, ] @@ -310,6 +332,7 @@ const QuestionBank = () => { return (