From 5e12bc722553f362897be5da5d78d91be30918bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 30 Dec 2019 16:26:51 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/shixunHomework/shixunHomework.js | 39 ++++++++++++------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/shixunHomework.js b/public/react/src/modules/courses/shixunHomework/shixunHomework.js index 4705e7a8f..36d5129f5 100644 --- a/public/react/src/modules/courses/shixunHomework/shixunHomework.js +++ b/public/react/src/modules/courses/shixunHomework/shixunHomework.js @@ -1,12 +1,10 @@ import React,{ Component } from "react"; -import { Input,Checkbox,Table, Pagination, Modal,Menu, Tooltip,Spin } from "antd"; -import { WordsBtn,on, off, trigger } from 'educoder'; -import {BrowserRouter as Router,Route,Switch,Link} from 'react-router-dom'; +import { Input,Checkbox, Pagination,Menu, AutoComplete,Spin } from "antd"; +import { WordsBtn,on, trigger } from 'educoder'; +import {Link} from 'react-router-dom'; import axios from'axios'; import HomeworkModal from "../coursesPublic/HomeworkModal"; -import OneSelfOrderModal from "../coursesPublic/OneSelfOrderModal"; -import ShixunModal from "../coursesPublic/ShixunModal"; -import PathModal from "../coursesPublic/PathModal"; + import NewShixunModel from '../coursesPublic/NewShixunModel'; import AddcoursesNav from "../coursesPublic/AddcoursesNav"; import Modals from '../../modals/Modals'; @@ -16,7 +14,7 @@ import '../css/busyWork.css' import ShixunhomeWorkItem from "./ShixunhomeWorkItem"; import NoneData from "../coursesPublic/NoneData"; -const Search = Input.Search; + class ShixunHomework extends Component{ constructor(props){ @@ -1212,12 +1210,27 @@ class ShixunHomework extends Component{
- this.SearchCoursename(value)} - > + {/* this.SearchCoursename(value)}*/} + {/* allowClear*/} + {/*>*/} + + } /> +
From 0a1d2b0626e22973d2688104bbccb2f2010f10d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 30 Dec 2019 16:58:32 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/shixunHomework/shixunHomework.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/shixunHomework.js b/public/react/src/modules/courses/shixunHomework/shixunHomework.js index 36d5129f5..c3eb8095a 100644 --- a/public/react/src/modules/courses/shixunHomework/shixunHomework.js +++ b/public/react/src/modules/courses/shixunHomework/shixunHomework.js @@ -1,5 +1,5 @@ import React,{ Component } from "react"; -import { Input,Checkbox, Pagination,Menu, AutoComplete,Spin } from "antd"; +import { Input,Checkbox, Pagination,Menu, AutoComplete,Spin,Icon } from "antd"; import { WordsBtn,on, trigger } from 'educoder'; import {Link} from 'react-router-dom'; import axios from'axios'; @@ -1029,7 +1029,7 @@ class ShixunHomework extends Component{ let main_id=this.props.match.params.main_id; let category_id=this.props.match.params.category_id; - + const dataSource = ['12345', '23456', '34567']; return(
@@ -1225,7 +1225,7 @@ class ShixunHomework extends Component{ dropdownStyle={{ width: 300 }} size="large" style={{ width: '100%' }} - dataSource={options} + dataSource={dataSource} placeholder="input here" optionLabelProp="value" > From bd6bf4512992f366e144af1f747718c5223c191f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Tue, 31 Dec 2019 11:03:15 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/common/UrlTool.js | 16 +++++ public/react/src/common/educoder.js | 2 +- .../modules/courses/busyWork/commonWork.js | 24 ++++---- .../common/titleSearch/TitleSearchSection.js | 22 +++---- .../src/modules/courses/exercise/Exercise.js | 29 ++++----- .../modules/courses/graduation/tasks/index.js | 14 +++-- .../courses/graduation/topics/index.js | 13 ++-- public/react/src/modules/courses/poll/Poll.js | 24 ++++---- .../courses/shixunHomework/shixunHomework.js | 60 +++++++------------ 9 files changed, 101 insertions(+), 103 deletions(-) diff --git a/public/react/src/common/UrlTool.js b/public/react/src/common/UrlTool.js index 33a84dc55..07c492081 100644 --- a/public/react/src/common/UrlTool.js +++ b/public/react/src/common/UrlTool.js @@ -1,4 +1,8 @@ +import React from "react"; import md5 from 'md5'; +import {Input} from "antd"; +const { Search } = Input; + const $ = window.$; const isDev = window.location.port == 3007; export const TEST_HOST = "https://test-newweb.educoder.net" @@ -144,3 +148,15 @@ export function htmlEncode(str) { s = s.replace(/\"/g, """); return s; } + +export function publicSearchs(Placeholder,onSearch,onInputs,onChanges,loadings) { + return() +} \ No newline at end of file diff --git a/public/react/src/common/educoder.js b/public/react/src/common/educoder.js index 126a42e87..35abfc7fe 100644 --- a/public/react/src/common/educoder.js +++ b/public/react/src/common/educoder.js @@ -2,7 +2,7 @@ // export { default as OrderStateUtil } from '../routes/Order/components/OrderStateUtil'; -export { getImageUrl as getImageUrl, getUrl as getUrl, getRandomcode as getRandomcode,getUrlmys as getUrlmys, getUrl2 as getUrl2, setImagesUrl as setImagesUrl +export { getImageUrl as getImageUrl, getUrl as getUrl, publicSearchs as publicSearchs,getRandomcode as getRandomcode,getUrlmys as getUrlmys, getUrl2 as getUrl2, setImagesUrl as setImagesUrl , getUploadActionUrl as getUploadActionUrl,getUploadActionUrltwo as getUploadActionUrltwo ,getUploadActionUrlthree as getUploadActionUrlthree, getUploadActionUrlOfAuth as getUploadActionUrlOfAuth , getTaskUrlById as getTaskUrlById, TEST_HOST ,htmlEncode as htmlEncode } from './UrlTool'; export { default as queryString } from './UrlTool2'; diff --git a/public/react/src/modules/courses/busyWork/commonWork.js b/public/react/src/modules/courses/busyWork/commonWork.js index d114b6777..ffc2e0c34 100644 --- a/public/react/src/modules/courses/busyWork/commonWork.js +++ b/public/react/src/modules/courses/busyWork/commonWork.js @@ -1,28 +1,22 @@ import React,{ Component } from "react"; import { Input,Checkbox,Menu,Pagination,Spin} from "antd"; -import CourseLayoutcomponent from '../common/CourseLayoutComponent'; import UseBank from './UseBank' - import '../css/members.css' import '../css/busyWork.css' - -import CoursesListType from '../coursesPublic/CoursesListType' import CommonWorkItem from './CommonWorkItem' import PublishRightnow from './PublishRightnow' import ConnectProject from './ConnectProject' - import { WordsBtn, on, off } from 'educoder' import Modals from '../../modals/Modals' import NoneData from "../coursesPublic/NoneData" import Titlesearchsection from '../common/titleSearch/TitleSearchSection'; import { RouteHOC } from './common' - import axios from 'axios'; import _ from 'lodash' -const Search = Input.Search; -const map={1:"普通作业",2:"",3:"分组作业"} -const COMMON_WORK = 1 +// const Search = Input.Search; +// const map={1:"普通作业",2:"",3:"分组作业"} +// const COMMON_WORK = 1 // const COMMON_WORK = 2 class commonWork extends Component{ constructor(props){ @@ -47,13 +41,12 @@ class commonWork extends Component{ inputStudent=(e)=>{ this.setState({ search:e.target.value, - page:1 }) } //搜索查询 searchStudent=()=>{ let {page,search,order}=this.state; - this.getList(page,search,order); + this.getList(1,search,order); } openConnectionProject = (work) => { this.refs['connectProject'].openConnectionProject(work) @@ -134,11 +127,14 @@ class commonWork extends Component{ mainList:result.data, totalCount:result.data.task_count, isSpin:false, + page:page, ...result.data }) } }).catch((error)=>{ - console.log(error); + this.setState({ + isSpin:false + }) }) } //筛选条件 @@ -325,7 +321,7 @@ class commonWork extends Component{ console.log(error) }) } - + render(){ let { @@ -396,7 +392,7 @@ class commonWork extends Component{ // searchtype={this.props.isAdmin||this.props.isStudent ?true:false} onInputSearchChange={this.inputStudent} onPressEnter={this.searchStudent} - + allowClearonChange={this.inputStudent} firstRowRight={ { isAdmin && this.createCommonWork(1)}>新建} diff --git a/public/react/src/modules/courses/common/titleSearch/TitleSearchSection.js b/public/react/src/modules/courses/common/titleSearch/TitleSearchSection.js index c71ef38ea..479c8595b 100644 --- a/public/react/src/modules/courses/common/titleSearch/TitleSearchSection.js +++ b/public/react/src/modules/courses/common/titleSearch/TitleSearchSection.js @@ -1,8 +1,5 @@ import React,{ Component } from "react"; -import { Input } from "antd"; - -const Search = Input.Search; - +import {publicSearchs} from 'educoder'; class Titlesearchsection extends Component{ constructor(props){ super(props); @@ -14,7 +11,7 @@ class Titlesearchsection extends Component{ render(){ let { addGroup } = this.state; const { firstRowRight, secondRowLeft,firstRowMid, secondRowBotton,thirdRow, title, onInputSearchChange - , searchValue, onPressEnter, searchPlaceholder, showSearchInput } = this.props; + , searchValue, onPressEnter, searchPlaceholder, allowClearonChange } = this.props; return(
- {datajs === undefined ? "" : } + + {datajs === undefined ? "" :
} + + } @@ -3898,12 +3911,18 @@ class Listofworksstudentone extends Component { { homework_status && homework_status.length && homework_status.length === 0 ?
- +
: homework_status && homework_status.length > 0 && homework_status && homework_status[0] === "未发布" ?
- +
: @@ -4029,7 +4048,7 @@ class Listofworksstudentone extends Component {
-

暂时还没有相关数据哦!

+

{this.state.searchtypes===false?"暂时还没有相关数据哦!":"抱歉没有您要搜索的内容,请换个词语试试看"}

@@ -4069,12 +4088,18 @@ class Listofworksstudentone extends Component { { homework_status && homework_status.length === 0 ?
- +
: homework_status && homework_status.length > 0 && homework_status && homework_status[0] === "未发布" ?
- +
:
@@ -4226,9 +4251,9 @@ class Listofworksstudentone extends Component {
- {datas === undefined ? "" :
} + {datas === undefined ? "" : + +
+ + } { @@ -4270,7 +4299,7 @@ class Listofworksstudentone extends Component {
-

暂时还没有相关数据哦!

+

{this.state.searchtypes===false?"暂时还没有相关数据哦!":"抱歉没有您要搜索的内容,请换个词语试试看"}

From 85b73a531324d82ea94800e133ab192667f88f6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 2 Jan 2020 09:54:56 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=AF=BE=E5=A0=82?= =?UTF-8?q?=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/busyWork/CommonWorkList.js | 54 +++++++++++-------- .../modules/courses/coursesPublic/NoneData.js | 2 +- .../shixunHomework/Listofworksstudentone.js | 5 +- 3 files changed, 35 insertions(+), 26 deletions(-) diff --git a/public/react/src/modules/courses/busyWork/CommonWorkList.js b/public/react/src/modules/courses/busyWork/CommonWorkList.js index ca93833bb..d60f68b22 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkList.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkList.js @@ -1,28 +1,17 @@ import React,{Component} from "react"; import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal, Table, Divider, Tag,DatePicker,Radio,Tooltip,Spin, Pagination} from "antd"; -import {Link} from 'react-router-dom'; -import locale from 'antd/lib/date-picker/locale/zh_CN'; -import {WordsBtn, ConditionToolTip, queryString, getImageUrl, on, off, NoneData, sortDirections} from 'educoder'; +import {WordsBtn, ConditionToolTip, queryString, publicSearchs, on, off, NoneData, sortDirections} from 'educoder'; import axios from 'axios'; -import Modals from '../../modals/Modals'; -import CoursesListType from '../coursesPublic/CoursesListType'; -import HomeworkModal from "../coursesPublic/HomeworkModal"; import CheckAllGroup from '../common/button/CheckAllGroup' import moment from 'moment'; import CheckCodeModal from '../coursesPublic/modal/CheckCodeModal' -import '../css/Courses.css' -import WorkDetailPageHeader from './common/WorkDetailPageHeader' +import '../css/Courses.css'; import PublishRightnow from './PublishRightnow' import ModulationModal from "../coursesPublic/ModulationModal"; import AccessoryModal from "../coursesPublic/AccessoryModal"; import LeaderIcon from './common/LeaderIcon' -const { Option} = Select; -const CheckboxGroup = Checkbox.Group; -const confirm = Modal.confirm; -let GraduationTasksnewtype=true; const $ = window.$; const Search = Input.Search; -const RadioGroup = Radio.Group; function renderScore(score, content) { let color = '#747A7F' @@ -414,6 +403,7 @@ class CommonWorkList extends Component{ left_time: {}, category: {}, b_order: 'desc', + searchtypes:false } } onTablePagination = (page) => { @@ -423,10 +413,26 @@ class CommonWorkList extends Component{ } onSearchValue = (val) => { + if (val === ""||val===undefined) { + this.setState({ + search: undefined, + searchtypes:false + }) + }else{ + this.setState({ + searchtypes:true + }) + } this.fetchList() } onSearchValueInput = (e) => { - this.setState({search: e.target.value}) + if (e.target.value === ""||e.target.value===undefined) { + this.setState({ + search: undefined, + }) + } else { + this.setState({search: e.target.value}) + } } componentDidMount() { @@ -789,13 +795,14 @@ class CommonWorkList extends Component{ {/* value={search} */}
- + {/**/} + {publicSearchs("请输入姓名或学号搜索",this.onSearchValue,this.onSearchValueInput,this.onSearchValueInput)}
} @@ -859,7 +866,10 @@ class CommonWorkList extends Component{
- +
diff --git a/public/react/src/modules/courses/coursesPublic/NoneData.js b/public/react/src/modules/courses/coursesPublic/NoneData.js index 825ca5832..6f0422f67 100644 --- a/public/react/src/modules/courses/coursesPublic/NoneData.js +++ b/public/react/src/modules/courses/coursesPublic/NoneData.js @@ -24,7 +24,7 @@ class NoneData extends Component{ `} -

暂时还没有相关数据哦!

+

{searchtypes===true?"抱歉没有您要搜索的内容,请换个词语试试看":"暂时还没有相关数据哦!"}

) } diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index 84a04687e..8c73793f1 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -2961,10 +2961,9 @@ class Listofworksstudentone extends Component { } //搜索学生 文字输入 inputSearchValuest = (e) => { - // console.log(e.target.value) - if (e.target.value === "") { + if (e.target.value === ""||e.target.value===undefined) { this.setState({ - searchtext: undefined + searchtext: undefined, }) } else { this.setState({