From 8a9d22e0aa04daba256007f4edc10dd1939e0665 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=8B=E6=B0=B4=E6=B5=AE=E5=B0=98?= <18510549872@163.comm> Date: Sat, 11 Nov 2023 23:23:35 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=B8=AA=E4=BA=BA=E4=B8=AD=E5=BF=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 2 +- src/components/question-list/index.jsx | 137 ++++++------------- src/components/tags-editor/index.jsx | 4 +- src/views/brush-questions/index.less | 2 +- src/views/question-bank/index.less | 7 +- src/views/question-bank/index.tsx | 95 +++++++++---- src/views/user-info/index.tsx | 180 ++++++++++++++----------- 7 files changed, 222 insertions(+), 205 deletions(-) diff --git a/.env.development b/.env.development index 3a55d35..204eaff 100644 --- a/.env.development +++ b/.env.development @@ -1,2 +1,2 @@ -VITE_API_HOST1=http://117.72.14.166:3010 +VITE_API_HOST=http://117.72.10.84:3010 VITE_IMG_HOST=http://117.72.14.166:9000 \ No newline at end of file diff --git a/src/components/question-list/index.jsx b/src/components/question-list/index.jsx index 51d2dd7..c720fc9 100644 --- a/src/components/question-list/index.jsx +++ b/src/components/question-list/index.jsx @@ -1,8 +1,9 @@ import React, { Fragment, useState } from "react"; -import { Tag, Table, Input } from "antd"; +import { Tag, Table, Input, Radio, Space, Button, Divider } from "antd"; import { filterDifficulty, gradeObject } from "@constants"; import { useNavigate } from "react-router-dom"; import "./index.less"; + const { Search } = Input; const colors = ['#ffffb8', '#f4ffb8', '#b5f5ec', '#bae0ff', '#d9f7be', '#efdbff', ' #ffd6e7', '#d6e4ff'] @@ -10,12 +11,9 @@ const colors = ['#ffffb8', '#f4ffb8', '#b5f5ec', '#bae0ff', '#d9f7be', '#efdbff' const QuestionList = (props) => { - - const [selectValue, setSelectValue] = useState('难度') + const [difficuty, setDifficuty] = useState(0) const navigate = useNavigate(); - - const RandomNumBoth = (Min, Max) => { //差值 const Range = Max - Min; @@ -24,6 +22,15 @@ const QuestionList = (props) => { return Min + Math.round(Rand * Range); //四舍五入 } + const handleSearch = (close) => { + props.changeDifficuty(difficuty) + close() + } + + const changeDifficuty = (e) => { + setDifficuty(e.target.value) + } + /** * 题目列表 */ @@ -40,8 +47,7 @@ const QuestionList = (props) => { return (