+
{record.subjectName}
+
{item?.labelName?.length > 0 &&
- item.labelName.map((tagsItem) => {
+ item.labelName.map(tagsItem => {
return (
-
+
{tagsItem}
- );
+ )
})}
- );
- },
+ )
+ }
},
{
- title: "难度",
- dataIndex: "subjectDifficult",
- key: "subjectDifficult",
- align: "center",
+ title: '难度',
+ dataIndex: 'subjectDifficult',
+ key: 'subjectDifficult',
+ align: 'center',
filterDropdown: ({ close }) => (
-
e.stopPropagation()}>
-
请选择
-
-
- {
- filterDifficulty.map(item => {
- return {item.title}
- })
- }
+ e.stopPropagation()}>
+
+ 请选择
+
+
+
+ {filterDifficulty.map(item => {
+ return (
+
+ {item.title}
+
+ )
+ })}
-
),
+
+ ),
width: 90,
- render: (key) => {
- return (
-
{gradeObject?.[key]?.title}
- );
- },
- },
- ];
+ render: key => {
+ return
{gradeObject?.[key]?.title}
+ }
+ }
+ ]
/**
* 进入详情
@@ -106,61 +132,57 @@ const QuestionList = (props) => {
* @param {*} type
* @returns
*/
- const onChangeAction = (item) => () => {
- navigate("/brush-question/" + item.id)
+ const onChangeAction = item => () => {
+ navigate('/brush-question/' + item.id)
// let { isNotToDetail } = props;
- // !isNotToDetail &&
+ // !isNotToDetail &&
// if (!isNotToDetail) return;
- };
-
+ }
/**
* 过滤框-搜索框-模块
* @returns
*/
const renderFilterContainer = () => {
- const { total, isShowSearch, setSearchStr } = props;
+ const { total, isShowSearch, setSearchStr } = props
return (
-
+
{isShowSearch && (
setSearchStr(value)}
+ placeholder='请输入感兴趣的内容~'
+ onSearch={value => setSearchStr(value)}
style={{ width: 240 }}
allowClear
- size="small"
+ size='small'
/>
)}
- );
- };
+ )
+ }
- const { questionList, isHideSelect } = props;
+ const { questionList, isHideSelect } = props
return (
-
+
{!isHideSelect && renderFilterContainer()}
-
+
{
return {
- onClick: onChangeAction(record, index), // 点击行
- };
+ onClick: onChangeAction(record, index) // 点击行
+ }
}}
columns={questionColumns}
dataSource={questionList}
- rowKey="id"
+ rowKey='id'
pagination={false}
- rowClassName="question-table-row"
+ rowClassName='question-table-row'
/>
- );
-
-
+ )
}
-
-export default QuestionList;
+export default QuestionList
diff --git a/src/components/top-menu/index.jsx b/src/components/top-menu/index.jsx
index cb11af8..4f93719 100644
--- a/src/components/top-menu/index.jsx
+++ b/src/components/top-menu/index.jsx
@@ -1,38 +1,37 @@
-import { message } from 'antd';
-import React, { useState, memo, useEffect } from 'react'
-import { useLocation, useNavigate } from 'react-router-dom';
+import { message } from 'antd'
+import React, { memo, useEffect, useState } from 'react'
+import { useLocation, useNavigate } from 'react-router-dom'
import './index.less'
// 顶部tab
const MENULIST = [
{
key: 'questionBank',
title: '刷题',
- route: '/question-bank',
+ route: '/question-bank'
},
{
key: 'prictiseQuestion',
title: '练题',
- route: '/brush-question',
+ route: '/brush-question'
},
{
key: 'practiceQuestions',
title: '鸡圈',
- route: '/practice-questions',
+ route: '/practice-questions'
},
{
key: 'interList',
title: '模拟面试',
- route: '/inter-list',
- },
+ route: '/inter-list'
+ }
]
// 顶部tab映射
const mapMenu = {
- '/question-bank': 'questionBank',
+ '/question-bank': 'questionBank'
}
const TopMenu = () => {
-
const [currentKey, setCurrentKey] = useState('questionBank')
const location = useLocation()
const navigate = useNavigate()
@@ -44,26 +43,29 @@ const TopMenu = () => {
} else {
setCurrentKey('')
}
- }, [location.pathname]);
-
+ }, [location.pathname])
/**
* 切换item
* @param {*} item
* @returns
*/
- const changeMenu = (item) => () => {
- if (item.key === "questionBank") {
+ const changeMenu = item => () => {
+ const userInfoStorage = localStorage.getItem('userInfo')
+ if (!userInfoStorage) {
+ return message.info('请登录')
+ }
+ if (item.key === 'questionBank') {
if (location.pathname === '/question-bank') return
navigate('/question-bank')
setCurrentKey(item.key)
} else {
- return message.info("敬请期待")
+ return message.info('敬请期待')
}
}
return (
-