|
@@ -6,6 +6,7 @@ import { Link } from "react-router-dom";
|
|
|
import { Toast } from 'react-vant';
|
|
|
export const ExamRoadVideo: React.FC = (props: any) => {
|
|
|
|
|
|
+
|
|
|
const [keyWord, setKeyWord] = useState('');
|
|
|
const [city, setCity] = useState({
|
|
|
city: "",
|
|
@@ -47,29 +48,35 @@ export const ExamRoadVideo: React.FC = (props: any) => {
|
|
|
county: string,
|
|
|
countyId: string
|
|
|
}[]>([])
|
|
|
- const getExamListByName = (name?: string) => {
|
|
|
- () => {
|
|
|
- setProvince({
|
|
|
- province: "",
|
|
|
- provinceId: ""
|
|
|
- })
|
|
|
- setCounty({
|
|
|
- county: "",
|
|
|
- countyId: ""
|
|
|
- })
|
|
|
- setCity({
|
|
|
- city: "",
|
|
|
- cityId: ""
|
|
|
- })
|
|
|
- api.studentExamInfoList({
|
|
|
- name: name
|
|
|
- }).then(res => {
|
|
|
- console.log(res)
|
|
|
- setExamList(res.data.rows)
|
|
|
+ const getExamListByName = function (name: string) {
|
|
|
|
|
|
|
|
|
+ setProvince({
|
|
|
+ province: "",
|
|
|
+ provinceId: ""
|
|
|
+ })
|
|
|
+ setCounty({
|
|
|
+ county: "",
|
|
|
+ countyId: ""
|
|
|
+ })
|
|
|
+ setCity({
|
|
|
+ city: "",
|
|
|
+ cityId: ""
|
|
|
+ })
|
|
|
+ api.studentExamInfoList({
|
|
|
+ name: name
|
|
|
+ }).then(res => {
|
|
|
+ Toast.loading({
|
|
|
+ message:"搜索中"
|
|
|
})
|
|
|
- }
|
|
|
+ //修复bug,这段必须
|
|
|
+
|
|
|
+ window.setTimeout(()=>{setExamList(res.data.rows);Toast.clear();},1500)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
|
|
|
}
|
|
|
|
|
@@ -101,11 +108,13 @@ export const ExamRoadVideo: React.FC = (props: any) => {
|
|
|
"sign": null
|
|
|
}[]>([])
|
|
|
useEffect(() => {
|
|
|
+
|
|
|
api.studentExamInfoList({
|
|
|
...province,
|
|
|
...city,
|
|
|
...county
|
|
|
}).then(res => {
|
|
|
+
|
|
|
setExamList(res.data.rows)
|
|
|
|
|
|
})
|
|
@@ -166,15 +175,12 @@ export const ExamRoadVideo: React.FC = (props: any) => {
|
|
|
<div className="rect">
|
|
|
<div className="search">
|
|
|
{/* <SearchOutline className="icon1" color="#8A9099" fontSize={18} /> */}
|
|
|
- <Search onSearch={(val)=>{
|
|
|
- getExamListByName(val)
|
|
|
+ <Search onSearch={(val) => {
|
|
|
+
|
|
|
+ getExamListByName(val)
|
|
|
}} onChange={val => {
|
|
|
setKeyWord(val)
|
|
|
- }} showAction actionText={<div style={
|
|
|
- {
|
|
|
- color:"#fff"
|
|
|
- }
|
|
|
- } onClick={() => getExamListByName(keyWord)}>搜索</div>} value={keyWord} shape="round" background="transparent" placeholder="请输入搜索关键词"></Search>
|
|
|
+ }} value={keyWord} shape="round" background="transparent" placeholder="请输入搜索关键词"></Search>
|
|
|
{/* <input placeholder="输入系列课标题" className="bar" type="search"></input> */}
|
|
|
</div>
|
|
|
<div
|