From 42c2cc50cb2099dd8630806ebc3da9bff0e087fd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com>
Date: Wed, 24 Jul 2019 18:02:32 +0800
Subject: [PATCH 1/2] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/modules/courses/new/CoursesNew.js | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/public/react/src/modules/courses/new/CoursesNew.js b/public/react/src/modules/courses/new/CoursesNew.js
index 149f9bc27..87b6c63ab 100644
--- a/public/react/src/modules/courses/new/CoursesNew.js
+++ b/public/react/src/modules/courses/new/CoursesNew.js
@@ -46,7 +46,8 @@ class CoursesNew extends Component {
let coursesId = this.props.match.params.coursesId;
let user_school=this.props.current_user&&this.props.current_user.user_school;
-
+ this.getschool("")
+ this.Searchvalue("")
if (coursesId != undefined) {
let url = "/courses/" + coursesId + "/settings.json"
axios.get(url).then((result) => {
@@ -85,8 +86,7 @@ class CoursesNew extends Component {
})
}
- this.getschool("")
- this.Searchvalue("")
+
}
componentDidUpdate(prevProps){
@@ -292,7 +292,8 @@ class CoursesNew extends Component {
search:value
}).then((result)=>{
// console.log(result.data)
- if (result.data.status===0) {
+ if (result.data.message===undefined) {
+
this.setState({
searchlist: result.data.course_lists,
// course:value,
@@ -357,7 +358,9 @@ class CoursesNew extends Component {
};
getschool=(value)=>{
-
+ this.props.form.setFieldsValue({
+ school: value
+ })
let url="/schools/school_list.json";
axios.get(url,{
params: {
@@ -369,9 +372,7 @@ class CoursesNew extends Component {
searchlistscholl: result.data.school_names,
school: value
})
- this.props.form.setFieldsValue({
- school: value
- })
+
}
}).catch((error)=>{
console.log(error)
@@ -389,7 +390,7 @@ class CoursesNew extends Component {
const optionschool = this.state.searchlistscholl&&this.state.searchlistscholl.map(z => );
// console.log(this.props.current_user.user_school)
// form合并了
- // console.log(optionschool)
+ console.log(options)
return (
From 47c6b5446d7f53069ccf7bb089f4c2c5825c9471 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com>
Date: Wed, 24 Jul 2019 18:04:47 +0800
Subject: [PATCH 2/2] =?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/modules/courses/new/CoursesNew.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/public/react/src/modules/courses/new/CoursesNew.js b/public/react/src/modules/courses/new/CoursesNew.js
index 87b6c63ab..6e996297b 100644
--- a/public/react/src/modules/courses/new/CoursesNew.js
+++ b/public/react/src/modules/courses/new/CoursesNew.js
@@ -152,7 +152,7 @@ class CoursesNew extends Component {
}
if(values.school===""||values.school===undefined){
- this.scrollToAnchor("isschool")
+ // this.scrollToAnchor("isschool")
return
}
@@ -220,7 +220,7 @@ class CoursesNew extends Component {
return
}
if(values.school===""||values.school===undefined){
- this.scrollToAnchor("isschool")
+ // this.scrollToAnchor("isschool")
return
}