From f049d7763c066101b30ac397f8b105f2b7637f44 Mon Sep 17 00:00:00 2001
From: hjm <63528605@qq.com>
Date: Wed, 24 Jul 2019 15:40:08 +0800
Subject: [PATCH 01/34] addSuc
---
.../src/modules/user/account/AccountBasicEdit.js | 11 ++++++++++-
.../src/modules/user/modal/ApplyForAddOrgModal.js | 1 +
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/public/react/src/modules/user/account/AccountBasicEdit.js b/public/react/src/modules/user/account/AccountBasicEdit.js
index 8af24022d..13741fd5b 100644
--- a/public/react/src/modules/user/account/AccountBasicEdit.js
+++ b/public/react/src/modules/user/account/AccountBasicEdit.js
@@ -273,6 +273,14 @@ class AccountBasic extends Component {
}
}
+ addOrgSuccess = (name) => {
+ const schoolList = this.state.schoolList.slice(0)
+ schoolList.push({ id: schoolList.length + 2000, name: name})
+ this.setState({ schoolList })
+ this.props.form.setFieldsValue({
+ name: name
+ })
+ }
showApplyForAddOrgModal = () => {
this.applyForAddOrgForm.setVisible(true)
@@ -309,7 +317,8 @@ class AccountBasic extends Component {
return (
this.applyForAddOrgForm = form} schoolName={school}
- {...propsWithoutForm}>
+ {...propsWithoutForm} addOrgSuccess={this.addOrgSuccess}
+ >
this.applyForAddChildOrgForm = form} >
diff --git a/public/react/src/modules/user/modal/ApplyForAddOrgModal.js b/public/react/src/modules/user/modal/ApplyForAddOrgModal.js
index 95cfa9105..72ae542c6 100644
--- a/public/react/src/modules/user/modal/ApplyForAddOrgModal.js
+++ b/public/react/src/modules/user/modal/ApplyForAddOrgModal.js
@@ -48,6 +48,7 @@ class ApplyForAddOrgModal extends Component{
}).then((result)=>{
if(result){
this.props.showNotification("新增学校/单位成功!");
+ this.props.addOrgSuccess(values.schoolName)
this.setVisible(false);
}
}).catch((error)=>{
From 7a65ebaf7632d0851f75f357adf55d592f10f078 Mon Sep 17 00:00:00 2001
From: cxt <853663049@qq.com>
Date: Wed, 24 Jul 2019 17:54:14 +0800
Subject: [PATCH 02/34] =?UTF-8?q?=E9=99=84=E4=BB=B6=E7=9A=84=E6=9D=83?=
=?UTF-8?q?=E9=99=90=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/attachments_controller.rb | 33 ++++++++++++++++++++++-
app/models/user.rb | 2 +-
2 files changed, 33 insertions(+), 2 deletions(-)
diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb
index 014262aea..8eb7ffebc 100644
--- a/app/controllers/attachments_controller.rb
+++ b/app/controllers/attachments_controller.rb
@@ -2,7 +2,7 @@
#
# 文件上传
class AttachmentsController < ApplicationController
- before_action :require_login, :check_auth
+ before_action :require_login, :check_auth, except: [:show]
before_action :find_file, only: %i[show destroy]
include ApplicationHelper
@@ -10,6 +10,8 @@ class AttachmentsController < ApplicationController
def show
# 1. 优先跳到cdn
# 2. 如果没有cdn,send_file
+ candown = attachment_candown @file
+ tip_exception("您没有权限下载该附件") if !candown
if @file.cloud_url.present?
update_downloads(@file)
redirect_to @file.cloud_url and return
@@ -157,4 +159,33 @@ class AttachmentsController < ApplicationController
end
edu_setting('public_cdn_host') + "/" + path
end
+
+ def attachment_candown attachment
+ return true if current_user.admin? || current_user.business?
+ candown = false
+ if attachment.container && current_user.logged?
+ # 课堂资源、作业、毕设相关资源的权限判断
+ if attachment.container.is_a?(Course)
+ course = attachment.container
+ candown = current_user.member_of_course?(course) || attachment.is_public == 1
+ elsif attachment.container.is_a?(HomeworkCommon) || attachment.container.is_a?(GraduationTask) || attachment.container.is_a?(GraduationTopic)
+ course = attachment.container&.course
+ elsif attachment.container.is_a?(StudentWork)
+ course = attachment.container&.homework_common&.course
+ elsif attachment.container.is_a?(StudentWorksScore)
+ course = attachment.container&.student_work&.homework_common&.course
+ elsif attachment.container.is_a?(GraduationWork)
+ course = attachment.container&.graduation_task&.course
+ elsif attachment.container.is_a?(GraduationWorkScore)
+ course = attachment.container&.graduation_work&.graduation_task&.course
+ else
+ candown = true
+ end
+
+ candown = !candown && course.present? ? current_user.member_of_course?(course) : candown
+ else
+ candown = true
+ end
+ candown
+ end
end
diff --git a/app/models/user.rb b/app/models/user.rb
index 03c97b9f3..34576db66 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -250,7 +250,7 @@ class User < ApplicationRecord
# 课堂成员
def member_of_course?(course)
- course.course_members.exists?(user_id: id)
+ course&.course_members.exists?(user_id: id)
end
# 实训路径管理员:创建者或admin
From 91bcb7bba46f7fb40981400102a04afed502814c Mon Sep 17 00:00:00 2001
From: cxt <853663049@qq.com>
Date: Wed, 24 Jul 2019 17:54:38 +0800
Subject: [PATCH 03/34] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/application_controller.rb | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index cc1fc167e..c80ca2348 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -232,6 +232,14 @@ class ApplicationController < ActionController::Base
User.current = User.find 12
end
+ if params[:debug] == 'teacher' #todo 为了测试,记得讲debug删除
+ User.current = User.find 81403
+ elsif params[:debug] == 'student'
+ User.current = User.find 8686
+ elsif params[:debug] == 'admin'
+ User.current = User.find 1
+ end
+
# User.current = User.find 81403
end
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 04/34] =?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 ab1039df4963e724248c773097f47f082bfb8083 Mon Sep 17 00:00:00 2001
From: cxt <853663049@qq.com>
Date: Wed, 24 Jul 2019 18:02:44 +0800
Subject: [PATCH 05/34] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=95=99=E5=B8=88?=
=?UTF-8?q?=E5=92=8C=E5=8A=A9=E6=95=99=E7=9A=84=E6=9D=83=E9=99=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/courses_controller.rb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb
index bb0737128..f5830adff 100644
--- a/app/controllers/courses_controller.rb
+++ b/app/controllers/courses_controller.rb
@@ -29,10 +29,10 @@ class CoursesController < ApplicationController
:transfer_to_course_group, :delete_from_course,
:search_users, :add_students_by_search, :get_historical_courses, :add_teacher_popup, :add_teacher]
before_action :admin_allowed, only: [:set_invite_code_halt, :set_public_or_private, :change_course_admin,
- :set_course_group, :delete_course_teacher, :create_group_by_importing_file]
+ :set_course_group, :create_group_by_importing_file]
before_action :teacher_or_admin_allowed, only: [:graduation_group_list, :create_graduation_group, :join_graduation_group,
:change_course_teacher, :export_member_scores_excel, :course_group_list,
- :teacher_application_review, :apply_teachers]
+ :teacher_application_review, :apply_teachers, :delete_course_teacher]
before_action :validate_course_name, only: [:create, :update]
before_action :find_board, only: :board_list
before_action :validate_page_size, only: :mine
From 4b388e090b74a950e4dfb5be88fb29ba1d4d90e3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Wed, 24 Jul 2019 18:02:59 +0800
Subject: [PATCH 06/34] =?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/user/Interestpage.js | 2 ++
public/react/src/modules/user/InterestpageMax.js | 8 +++-----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/public/react/src/modules/user/Interestpage.js b/public/react/src/modules/user/Interestpage.js
index dbca5a242..1054d620e 100644
--- a/public/react/src/modules/user/Interestpage.js
+++ b/public/react/src/modules/user/Interestpage.js
@@ -192,6 +192,8 @@ class InterestpageComponent extends Component {
ints.push(this.state.gouxuans4[i].id);
}
}
+ console.log("195195");
+ console.log(ints);
if(ints.length<1){
this.openNotification("请至少选择一个您感兴趣的内容");
return
diff --git a/public/react/src/modules/user/InterestpageMax.js b/public/react/src/modules/user/InterestpageMax.js
index e0585ed33..6dc182154 100644
--- a/public/react/src/modules/user/InterestpageMax.js
+++ b/public/react/src/modules/user/InterestpageMax.js
@@ -182,10 +182,6 @@ class InterestpageMax extends Component {
//兴趣页面点击
Interestcompletionpage(){
-
- this.setState({
- setpagecomplet:true
- })
if(this.state.gouxuans.length === 0){
this.openNotification("请选择职业");
return
@@ -197,6 +193,8 @@ class InterestpageMax extends Component {
ints.push(this.state.gouxuans4[i].id);
}
}
+ console.log("200200");
+ console.log(ints);
if(ints.length<1){
this.openNotification("请至少选择一个您感兴趣的内容");
return
@@ -302,7 +300,7 @@ class InterestpageMax extends Component {
)
})}
-
基本信息
From d6ff838b0cf6357bcd6a9e32ed8a6daad6c6c453 Mon Sep 17 00:00:00 2001
From: hjm <63528605@qq.com>
Date: Wed, 24 Jul 2019 18:57:45 +0800
Subject: [PATCH 17/34] =?UTF-8?q?=E8=AF=B7=E5=85=88=E9=80=89=E6=8B=A9?=
=?UTF-8?q?=E5=AD=A6=E6=A0=A1?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/react/src/modules/user/account/AccountBasicEdit.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/public/react/src/modules/user/account/AccountBasicEdit.js b/public/react/src/modules/user/account/AccountBasicEdit.js
index 850f74c89..9ebc4da02 100644
--- a/public/react/src/modules/user/account/AccountBasicEdit.js
+++ b/public/react/src/modules/user/account/AccountBasicEdit.js
@@ -135,7 +135,7 @@ class AccountBasic extends Component {
let {basicInfo}=this.props;
if(!err ){
if (!this.state.school_id) {
- this.props.showNotification('请先请先选择学校/单位')
+ this.props.showNotification('请先选择学校/单位')
return;
}
if (!this.state.department_id) {
From 7dd4d74b46e1cb89dead481f7302c9dab22a8b5e Mon Sep 17 00:00:00 2001
From: hjm <63528605@qq.com>
Date: Wed, 24 Jul 2019 19:00:48 +0800
Subject: [PATCH 18/34] retryAndRefresh
---
public/react/src/modules/page/MainContentContainer.js | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/public/react/src/modules/page/MainContentContainer.js b/public/react/src/modules/page/MainContentContainer.js
index 947aadaa5..829b84b16 100644
--- a/public/react/src/modules/page/MainContentContainer.js
+++ b/public/react/src/modules/page/MainContentContainer.js
@@ -236,6 +236,9 @@ class MainContentContainer extends Component {
// arg_path 点击文件目录树时,传入的点击节点对应的path
fetchRepositoryCode( props, arg_path, type, isRetry, retryAndRefresh) {
+ if (retryAndRefresh) {
+ this.retryAndRefresh = retryAndRefresh
+ }
const { challenge, showSnackbar, game, shixun, myshixun, hide_code } = props ? props : this.props;
if (shixun.vnc == true) {
// vnc模式下不需要加载代码
@@ -294,7 +297,7 @@ class MainContentContainer extends Component {
// })
}).then((fetchRepositoryCodeResponse) => {
// monaca 需要刷新,不然无法编辑
- if (retryAndRefresh && fetchRepositoryCodeResponse.data.content) {
+ if (this.retryAndRefresh && fetchRepositoryCodeResponse.data.content) {
window.location.reload()
return;
}
From 19e90f6255d61ea7e15a0a9a84f283f30152565a Mon Sep 17 00:00:00 2001
From: caishi <1149225589@qq.com>
Date: Wed, 24 Jul 2019 20:28:26 +0800
Subject: [PATCH 19/34] =?UTF-8?q?=E8=B4=A6=E6=88=B7=E7=AE=A1=E7=90=86?=
=?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=82=B9=E5=87=BB=E4=BF=9D=E5=AD=98=E4=BB=8D?=
=?UTF-8?q?=E7=84=B6=E6=8F=90=E7=A4=BA=E9=80=89=E6=8B=A9=E5=AD=A6=E6=A0=A1?=
=?UTF-8?q?/=E5=8D=95=E4=BD=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/react/src/modules/user/account/AccountBasicEdit.js | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/public/react/src/modules/user/account/AccountBasicEdit.js b/public/react/src/modules/user/account/AccountBasicEdit.js
index 9ebc4da02..9a37f866e 100644
--- a/public/react/src/modules/user/account/AccountBasicEdit.js
+++ b/public/react/src/modules/user/account/AccountBasicEdit.js
@@ -70,14 +70,15 @@ class AccountBasic extends Component {
job2:basicInfo && basicInfo.identity=="professional" ? basicInfo.technical_title:"企业管理者",
})
}, 100)
-
//if(basicInfo.nickname){
this.setState({
forDisable: true,
nameLength:basicInfo.nickname?basicInfo.nickname.length:0,
showRealName:basicInfo.show_realname,
realName: basicInfo.name,
- identity:basicInfo.identity
+ identity:basicInfo.identity,
+ school_id:basicInfo.school_id,
+ department_id:basicInfo.department_id
})
//}
}
From 01f19b9bcfdcf0e4ac05a1aed0b9fdb7c8b1d1c1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Wed, 24 Jul 2019 20:34:19 +0800
Subject: [PATCH 20/34] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../modules/user/modal/ApplyForAddOrgModal.js | 353 +++++++++---------
1 file changed, 177 insertions(+), 176 deletions(-)
diff --git a/public/react/src/modules/user/modal/ApplyForAddOrgModal.js b/public/react/src/modules/user/modal/ApplyForAddOrgModal.js
index 72ae542c6..afa613f9d 100644
--- a/public/react/src/modules/user/modal/ApplyForAddOrgModal.js
+++ b/public/react/src/modules/user/modal/ApplyForAddOrgModal.js
@@ -1,176 +1,177 @@
-import React, { Component } from "react";
-import { Modal, Button, Input, Form, } from "antd";
-import axios from 'axios'
-import ModalWrapper from "../../courses/common/ModalWrapper"
-import { City } from 'educoder'
-import '../account/common.css'
-
-const { TextArea } = Input;
-const Search = Input.Search
-class ApplyForAddOrgModal extends Component{
- constructor(props){
- super(props);
- this.state={
-
- }
- }
-
- componentDidUpdate=(prevState)=>{
- if(this.props.schoolName && prevState.schoolName != this.props.schoolName){
- this.props.form.setFieldsValue({
- schoolName:this.props.schoolName
- })
- }
- }
- componentDidMount=()=>{
- if(this.props.schoolName){
- this.props.form.setFieldsValue({
- schoolName:this.props.schoolName
- })
- }
- }
-
- setVisible = (visible) => {
- this.refs.modalWrapper.setVisible(visible)
- }
-
- onSendOk = () => {
- this.props.form.validateFieldsAndScroll((err, values) => {
- console.log(values);
- if(!err){
- let url=`/add_school_applies.json`;
- axios.post(url,{
- name:values.schoolName,
- province:values.city && values.city[0],
- city:values.city && values.city[1],
- address:values.address,
- remarks:values.remarks
- }).then((result)=>{
- if(result){
- this.props.showNotification("新增学校/单位成功!");
- this.props.addOrgSuccess(values.schoolName)
- this.setVisible(false);
- }
- }).catch((error)=>{
- console.log(error);
- })
- }
- })
- }
-
- onOk = () => {
- this.onSendOk()
- }
-
- render(){
- const { course_lists, checkBoxValues, searchValue, loading, hasMore } = this.state
- const { moduleName } = this.props
- const { getFieldDecorator } = this.props.form;
- return(
-
-
-
- {getFieldDecorator('schoolName', {
- rules: [{
- // initialValue: this.state.cityDefaultValue,
- required: true,
- message: '请输入学校或工作单位',
- }],
- })(
-
- )}
-
-
示例:
-
- -
-
- 国防科学技术大学
-
- -
-
- 国防科学技术大学开福校区
-
-
-
-
-
-
- {getFieldDecorator('city', {
- rules: [],
- })(
-
- )}
-
-
-
- {getFieldDecorator('address', {
- rules: [],
- })(
-
- )}
-
-
-
- {getFieldDecorator('remarks', {
- })(
-
- )}
-
-
-
-
-
-
- )
- }
-}
-const WrappedApplyForAddOrgModal = Form.create({ name: 'ApplyForAddOrgModal' })(ApplyForAddOrgModal);
-
-export default WrappedApplyForAddOrgModal;
-
-
+import React, { Component } from "react";
+import { Modal, Button, Input, Form, } from "antd";
+import axios from 'axios'
+import ModalWrapper from "../../courses/common/ModalWrapper"
+import { City } from 'educoder'
+import '../account/common.css'
+
+const { TextArea } = Input;
+const Search = Input.Search
+class ApplyForAddOrgModal extends Component{
+ constructor(props){
+ super(props);
+ this.state={
+
+ }
+ }
+
+ componentDidUpdate=(prevState)=>{
+ if(this.props.schoolName && prevState.schoolName != this.props.schoolName){
+ this.props.form.setFieldsValue({
+ schoolName:this.props.schoolName
+ })
+ }
+ }
+ componentDidMount=()=>{
+ if(this.props.schoolName){
+ this.props.form.setFieldsValue({
+ schoolName:this.props.schoolName
+ })
+ }
+ }
+
+ setVisible = (visible) => {
+ this.refs.modalWrapper.setVisible(visible)
+ }
+
+ onSendOk = () => {
+ this.props.form.validateFieldsAndScroll((err, values) => {
+ console.log(values);
+ if(!err){
+ let url=`/add_school_applies.json`;
+ axios.post(url,{
+ name:values.schoolName,
+ province:values.city && values.city[0],
+ city:values.city && values.city[1],
+ address:values.address,
+ remarks:values.remarks
+ }).then((result)=>{
+ if(result){
+ this.props.showNotification("新增学校/单位成功!");
+ this.setVisible(false);
+ this.props.addOrgSuccess(values.schoolName)
+
+ }
+ }).catch((error)=>{
+ console.log(error);
+ })
+ }
+ })
+ }
+
+ onOk = () => {
+ this.onSendOk()
+ }
+
+ render(){
+ const { course_lists, checkBoxValues, searchValue, loading, hasMore } = this.state
+ const { moduleName } = this.props
+ const { getFieldDecorator } = this.props.form;
+ return(
+
+
+
+ {getFieldDecorator('schoolName', {
+ rules: [{
+ // initialValue: this.state.cityDefaultValue,
+ required: true,
+ message: '请输入学校或工作单位',
+ }],
+ })(
+
+ )}
+
+
示例:
+
+ -
+
+ 国防科学技术大学
+
+ -
+
+ 国防科学技术大学开福校区
+
+
+
+
+
+
+ {getFieldDecorator('city', {
+ rules: [],
+ })(
+
+ )}
+
+
+
+ {getFieldDecorator('address', {
+ rules: [],
+ })(
+
+ )}
+
+
+
+ {getFieldDecorator('remarks', {
+ })(
+
+ )}
+
+
+
+
+
+
+ )
+ }
+}
+const WrappedApplyForAddOrgModal = Form.create({ name: 'ApplyForAddOrgModal' })(ApplyForAddOrgModal);
+
+export default WrappedApplyForAddOrgModal;
+
+
From 92337c947934e0071603db24190d367716bb6bd0 Mon Sep 17 00:00:00 2001
From: cxt <853663049@qq.com>
Date: Thu, 25 Jul 2019 09:11:54 +0800
Subject: [PATCH 21/34] =?UTF-8?q?user=5Finfo=E4=B8=AD=E5=8A=A0=E5=85=A5?=
=?UTF-8?q?=E8=AF=BE=E5=A0=82=E7=9A=84=E7=AC=AC=E4=B8=80=E4=B8=AA=E6=A8=A1?=
=?UTF-8?q?=E5=9D=97url?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/users/get_user_info.json.jbuilder | 1 +
1 file changed, 1 insertion(+)
diff --git a/app/views/users/get_user_info.json.jbuilder b/app/views/users/get_user_info.json.jbuilder
index fbb9778e2..164c943d0 100644
--- a/app/views/users/get_user_info.json.jbuilder
+++ b/app/views/users/get_user_info.json.jbuilder
@@ -14,6 +14,7 @@ if @course
if params[:group_info]
json.group_info @course.teacher_group(@user.id) if @course_identity < Course::STUDENT
end
+ json.first_category_url module_url(@course.none_hidden_course_modules.first, @course)
end
if params[:school]
From 4745a3b2804301403431d168fb98b6991a25ae73 Mon Sep 17 00:00:00 2001
From: hjm <63528605@qq.com>
Date: Thu, 25 Jul 2019 10:00:55 +0800
Subject: [PATCH 22/34] 40px
---
.../modules/user/account/AccountBasicEdit.js | 6 ++--
.../src/modules/user/account/AccountSecure.js | 6 ++--
.../react/src/modules/user/account/common.css | 30 +++++++++++++++++++
3 files changed, 36 insertions(+), 6 deletions(-)
diff --git a/public/react/src/modules/user/account/AccountBasicEdit.js b/public/react/src/modules/user/account/AccountBasicEdit.js
index 9a37f866e..1755ca365 100644
--- a/public/react/src/modules/user/account/AccountBasicEdit.js
+++ b/public/react/src/modules/user/account/AccountBasicEdit.js
@@ -448,9 +448,7 @@ class AccountBasic extends Component {
.basicForm .cancelBtn {
margin-left: 0px;
}
- .basicForm .ant-input-lg {
- height: 32px;
- }
+
.basicForm .ant-form-item-label {
width: 100px;
padding-right: 10px;
@@ -576,6 +574,7 @@ class AccountBasic extends Component {
{getFieldDecorator('student_No', {
@@ -680,6 +679,7 @@ class AccountBasic extends Component {
{getFieldDecorator('org2', {
rules: [{
diff --git a/public/react/src/modules/user/account/AccountSecure.js b/public/react/src/modules/user/account/AccountSecure.js
index 29abf22e4..e5b03e36b 100644
--- a/public/react/src/modules/user/account/AccountSecure.js
+++ b/public/react/src/modules/user/account/AccountSecure.js
@@ -335,7 +335,7 @@ class AccountSecure extends Component {
-
+
@@ -398,7 +398,7 @@ class AccountSecure extends Component {
{ !secondsFlag ? "获取验证码":`重新发送${seconds}s`}
-
+
@@ -471,7 +471,7 @@ class AccountSecure extends Component {
)}
-
+
diff --git a/public/react/src/modules/user/account/common.css b/public/react/src/modules/user/account/common.css
index 113b39e07..908948710 100644
--- a/public/react/src/modules/user/account/common.css
+++ b/public/react/src/modules/user/account/common.css
@@ -51,3 +51,33 @@ button.ant-btn.ant-btn-primary.grayBtn {
.basicForm .ant-form-item-label label {
color: #979797
} */
+
+
+.basicForm .ant-select-show-search {
+ height: 40px;
+}
+.basicForm .ant-select-auto-complete.ant-select .ant-input {
+ height: 40px;
+}
+.basicForm .ant-select-search__field__mirror {
+ height: 40px;
+}
+.basicForm .ant-input-lg {
+ height: 40px;
+}
+.basicForm .ant-select-selection--single {
+ height: 40px;
+}
+.basicForm .ant-select-auto-complete.ant-select .ant-select-selection--single {
+ height: 40px
+}
+.basicForm .ant-input-affix-wrapper {
+ height: 40px;
+}
+/* 职业 */
+.basicForm .ant-select-selection-selected-value {
+ line-height: 38px
+}
+.basicForm input {
+ height: 40px;
+}
\ No newline at end of file
From af7c74c2a44e567d66a3d9b7d6d78cf65d31534f 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, 25 Jul 2019 10:33:39 +0800
Subject: [PATCH 23/34] Merge branch 'dev_aliyun' of
https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun
# Conflicts:
# app/controllers/application_controller.rb
# public/react/src/AppConfig.js
---
.../tasks/GraduationTasksSubmitedit.js | 24 ++++++++++---------
.../tasks/GraduationTasksSubmitnew.js | 13 ++++++----
.../tasks/GraduationTasksappraise.js | 8 ++++++-
.../graduation/tasks/GraduationTasksedit.js | 17 +++++++------
.../graduation/tasks/GraduationTasksnew.js | 13 +++++-----
.../tasks/GraduationTaskssetting.js | 10 ++++----
.../tasks/GraduationTaskssettinglist.js | 10 +++++---
.../tasks/GraduationTaskssettingquestions.js | 9 +++++--
.../src/modules/courses/new/CoursesNew.js | 17 ++++---------
public/react/src/modules/home/shixunsHome.js | 20 ++++++++--------
.../react/src/modules/paths/ShixunPathCard.js | 2 +-
11 files changed, 80 insertions(+), 63 deletions(-)
diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js
index 044d0a3ae..fbaa5b7c3 100644
--- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js
+++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js
@@ -78,12 +78,12 @@ class GraduationTasksSubmitedit extends Component{
}
setedit=()=>{
- let coursesId=this.props.match.params.coursesId;
- let workId=this.props.match.params.work_Id;
- let {workslist}=this.state
- let task_id=workslist&&workslist.task_id;
+ // let coursesId=this.props.match.params.coursesId;
+ // let workId=this.props.match.params.work_Id;
+ // let {workslist}=this.state
+ // let task_id=workslist&&workslist.task_id;
// window.location.href="/courses/"+coursesId+"/graduation_tasks/"+task_id+"/"+workId+"/works/edit";
- window.location.href="/courses/"+coursesId+"/graduation_tasks/"+workId+"/appraise";
+ this.goback()
}
@@ -96,11 +96,13 @@ class GraduationTasksSubmitedit extends Component{
}
goback=()=>{
- let courseId=this.props.match.params.coursesId;
- let work_Id=this.props.match.params.work_Id;
- // window.location.href="/courses/"+courseId+"/graduation/graduation_tasks/"+category_id;
- window.location.href="/courses/"+courseId+"/graduation_tasks/"+work_Id+"/appraise";
+ let courseId=this.props.match.params.coursesId;
+ if(courseId===undefined){
+ this.props.history.push("/courses");
+ }else{
+ this.props.history.push(this.props.current_user.first_category_url);
+ }
}
@@ -568,7 +570,7 @@ class GraduationTasksSubmitedit extends Component{
{/* {workslist&&workslist.course_name}*/}
{/*>*/}
- 毕设任务
+ 毕设任务
>
任务详情
>
@@ -825,7 +827,7 @@ class GraduationTasksSubmitedit extends Component{
-
取消
+
取消
{/**/}
diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js
index 50f2a4fde..dddb11e53 100644
--- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js
+++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js
@@ -100,9 +100,12 @@ class GraduationTasksSubmitnew extends Component{
goback=()=>{
let courseId=this.props.match.params.coursesId;
- let category_id=this.props.match.params.category_id;
+ if(courseId===undefined){
+ this.props.history.push("/courses");
+ }else{
+ this.props.history.push(this.props.current_user.first_category_url);
+ }
- window.location.href="/courses/"+courseId+"/graduation_tasks/"+category_id;
}
@@ -438,7 +441,7 @@ class GraduationTasksSubmitnew extends Component{
spinnings:false
})
if(response!==undefined){
- this.setedit(response.data.work_id)
+ this.goback()
}
// if(response.status===200) {
// GraduationTasksnewtype=false;
@@ -567,7 +570,7 @@ render(){
{/* {workslist&&workslist.course_name}*/}
{/*>*/}
- 毕设任务
+ 毕设任务
>
任务详情
>
@@ -802,7 +805,7 @@ render(){
-
取消
+
取消
{/**/}
diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraise.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraise.js
index 971152781..7aa1530af 100644
--- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraise.js
+++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraise.js
@@ -70,7 +70,13 @@ class GraduationTasksappraise extends Component{
// let category_id=this.props.match.params.category_id;
//
// window.location.href="/courses/"+courseId+"/graduation_tasks/"+datalist.graduation_id;
- window.history.go(-1)
+ let courseId=this.props.match.params.coursesId;
+ if(courseId===undefined){
+ this.props.history.push("/courses");
+ }else{
+ this.props.history.push(this.props.current_user.first_category_url);
+ }
+
}
Cancelvisible=()=>{
diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksedit.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksedit.js
index 2e9efba0c..2b55e0737 100644
--- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksedit.js
+++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksedit.js
@@ -81,10 +81,13 @@ class GraduationTasksedit extends Component{
goback=()=>{
- // let courseId=this.props.match.params.coursesId;
- // window.location.href="/courses/"+courseId+"/graduation_tasks/"+this.state.data.graduation_id;
- // goback = () => {
- window.history.go(-1)
+
+ let courseId = this.props.match.params.coursesId;
+ if(courseId===undefined){
+ this.props.history.push("/courses");
+ }else{
+ this.props.history.push(this.props.current_user.first_category_url);
+ }
}
@@ -233,8 +236,8 @@ class GraduationTasksedit extends Component{
// console.log(response)
// GraduationTasksedittype=false;
// window.location.href="/courses/"+course_id+"/graduation/"+graduationId+"/graduation_tasks/"+category_id+"/questions";
- // this.goback()
- this.props.history.push("/courses/"+this.props.match.params.coursesId+"/graduation_tasks/"+graduation_id+"/"+this.props.match.params.category_id +"/setting");
+ this.goback()
+ //this.props.history.push("/courses/"+this.props.match.params.coursesId+"/graduation_tasks/"+graduation_id+"/"+this.props.match.params.category_id +"/setting");
}
}).catch((error) => {
console.log(error)
@@ -333,7 +336,7 @@ class GraduationTasksedit extends Component{
- {this.props.current_user&&this.props.current_user.course_name}
+ {this.props.current_user&&this.props.current_user.course_name}
>
毕设任务
>
diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksnew.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksnew.js
index 90f67a984..e27d8382b 100644
--- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksnew.js
+++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksnew.js
@@ -91,7 +91,7 @@ class GraduationTasksnew extends Component {
// GraduationTasksnewtype = false;
// this.goback();
if(response!==undefined){
- this.props.history.push("/courses/" + this.props.match.params.coursesId + "/graduation_tasks/" + this.props.match.params.category_id + "/" + response.data.task_id + "/setting");
+ this.goback()
}
// }
}).catch((error) => {
@@ -108,9 +108,11 @@ class GraduationTasksnew extends Component {
goback = () => {
let courseId = this.props.match.params.coursesId;
- let category_id = this.props.match.params.category_id;
-
- window.location.href = "/courses/" + courseId + "/graduation_tasks/" + category_id;
+ if(courseId===undefined){
+ this.props.history.push("/courses");
+ }else{
+ this.props.history.push(this.props.current_user.first_category_url);
+ }
}
@@ -307,8 +309,7 @@ class GraduationTasksnew extends Component {
- {this.props.current_user && this.props.current_user.course_name}
+ {this.props.current_user && this.props.current_user.course_name}
>
毕设任务
diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js
index 983231167..5bbbe1a14 100644
--- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js
+++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js
@@ -761,9 +761,11 @@ class GraduationTaskssettingapp extends Component{
goback=()=>{
let courseId=this.props.match.params.coursesId;
- let category_id=this.props.match.params.category_id;
-
- window.location.href="/courses/"+courseId+"/graduation_tasks/"+category_id;
+ if(courseId===undefined){
+ this.props.history.push("/courses");
+ }else{
+ this.props.history.push(this.props.current_user.first_category_url);
+ }
}
isgoback=()=>{
@@ -1046,7 +1048,7 @@ class GraduationTaskssettingapp extends Component{
- {coursename}
+ {coursename}
>
毕设任务
>
diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js
index 291095008..d773d8411 100644
--- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js
+++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js
@@ -57,11 +57,15 @@ class GraduationTaskssettinglist extends Component{
let{teacher_comment,task_status,course_group,cross_comment,order,b_order,search}=this.state;
this.seacthdata(teacher_comment,task_status,course_group,cross_comment,order,b_order,search,this.state.page);
}
+
goback=()=>{
// window.history.back(-1)
let courseId=this.props.match.params.coursesId;
- let category_id=this.props.match.params.category_id;
- window.location.href="/courses/"+courseId+"/graduation_tasks/"+category_id;
+ if(courseId===undefined){
+ this.props.history.push("/courses");
+ }else{
+ this.props.history.push(this.props.current_user.first_category_url);
+ }
}
@@ -1058,7 +1062,7 @@ class GraduationTaskssettinglist extends Component{
- {taskslistdata.course_name}
+ {taskslistdata.course_name}
>
{taskslistdata.graduation_name}
>
diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.js
index dee8f0c91..1bf6eb962 100644
--- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.js
+++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.js
@@ -55,7 +55,12 @@ class GraduationTasksquestions extends Component{
// let courseId=this.props.match.params.coursesId;
// let category_id=this.props.match.params.category_id;
// window.location.href="/courses/"+courseId+"/graduation_tasks/"+category_id;
- window.history.go(-1)
+ let courseId = this.props.match.params.coursesId;
+ if(courseId===undefined){
+ this.props.history.push("/courses");
+ }else{
+ this.props.history.push(this.props.current_user.first_category_url);
+ }
}
end=()=>{
@@ -300,7 +305,7 @@ class GraduationTasksquestions extends Component{
- {questionslist.course_name}
+ {questionslist.course_name}
>
{questionslist.graduation_name}
>
diff --git a/public/react/src/modules/courses/new/CoursesNew.js b/public/react/src/modules/courses/new/CoursesNew.js
index 6e996297b..fce6cd732 100644
--- a/public/react/src/modules/courses/new/CoursesNew.js
+++ b/public/react/src/modules/courses/new/CoursesNew.js
@@ -28,6 +28,7 @@ function disabledDateTime() {
};
}
+
class CoursesNew extends Component {
constructor(props) {
@@ -191,17 +192,7 @@ class CoursesNew extends Component {
).then((response) => {
// debugger
if (response.data.status === 0) {
- // this.setState({
- // Modalstype: true,
- // Modalstopval: response.data.message,
- // ModalSave: this.cancelmodel,
- // Loadtype: true,
- // checkBoxValues: [],
- // checkAllValue: false,
- // // Realnamecertification : authentication,
- // // professional_certification: values.Professionalcertification
- // })
- window.location.href = "/courses/" + coursesId+"/students";
+ this.goback
}
}).catch((error) => {
console.log(error)
@@ -262,7 +253,7 @@ class CoursesNew extends Component {
if(this.props.match.params.coursesId===undefined){
this.props.history.push("/courses");
}else{
- this.props.history.push(`/courses/${this.props.match.params.coursesId}`);
+ this.props.history.push(this.props.current_user.first_category_url);
}
// window.history.go(-1)
}
@@ -390,7 +381,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(options)
+
return (
diff --git a/public/react/src/modules/home/shixunsHome.js b/public/react/src/modules/home/shixunsHome.js
index 92f3c9f44..9c166f43f 100644
--- a/public/react/src/modules/home/shixunsHome.js
+++ b/public/react/src/modules/home/shixunsHome.js
@@ -93,7 +93,7 @@ class ShixunsHome extends Component {
const CustomNextArrow = props => {
return (
-
+
);
};
@@ -101,7 +101,7 @@ class ShixunsHome extends Component {
const CustomPrevArrow = props => {
return (
-
+
);
};
@@ -374,7 +374,7 @@ class ShixunsHome extends Component {
-
+
{item.username}
@@ -388,7 +388,7 @@ class ShixunsHome extends Component {
-
+
{item.username}
@@ -402,7 +402,7 @@ class ShixunsHome extends Component {
-
+
{item.username}
@@ -418,7 +418,7 @@ class ShixunsHome extends Component {
return (
-
+
{item.username}
@@ -450,7 +450,7 @@ class ShixunsHome extends Component {
-
+
{item.username}
@@ -464,7 +464,7 @@ class ShixunsHome extends Component {
-
+
{item.username}
@@ -478,7 +478,7 @@ class ShixunsHome extends Component {
-
+
{item.username}
@@ -494,7 +494,7 @@ class ShixunsHome extends Component {
return (
-
+
{item.username}
diff --git a/public/react/src/modules/paths/ShixunPathCard.js b/public/react/src/modules/paths/ShixunPathCard.js
index 9260b9f46..1b0759d1f 100644
--- a/public/react/src/modules/paths/ShixunPathCard.js
+++ b/public/react/src/modules/paths/ShixunPathCard.js
@@ -38,7 +38,7 @@ class ShixunPathCard extends Component{
{/*target="_blank"*/}
-
+
From 56bfc47444874ef9a74634993d1193ffe98c4dd8 Mon Sep 17 00:00:00 2001
From: hjm <63528605@qq.com>
Date: Thu, 25 Jul 2019 10:57:43 +0800
Subject: [PATCH 24/34] 40
---
.../modules/user/account/AccountBasicEdit.js | 5 +++--
.../user/account/AccountCertification.js | 22 ++++++++-----------
.../react/src/modules/user/account/common.css | 18 +++++++--------
.../user/modal/ApplyForAddChildOrgModal.js | 4 ++--
.../modules/user/modal/ApplyForAddOrgModal.js | 6 ++---
.../user/modal/RealNameCertificationModal.js | 4 ++--
6 files changed, 28 insertions(+), 31 deletions(-)
diff --git a/public/react/src/modules/user/account/AccountBasicEdit.js b/public/react/src/modules/user/account/AccountBasicEdit.js
index 1755ca365..1458862a1 100644
--- a/public/react/src/modules/user/account/AccountBasicEdit.js
+++ b/public/react/src/modules/user/account/AccountBasicEdit.js
@@ -278,6 +278,7 @@ class AccountBasic extends Component {
this.setState({
departments: [],
filterDepartments: [],
+ departmentsName: '',
school_id: '',
department_id: '',
})
@@ -412,7 +413,7 @@ class AccountBasic extends Component {
addChildOrgSuccess={this.addChildOrgSuccess}
>
-
+
-
-
@@ -186,7 +186,7 @@ class RealNameCertificationModal extends Component{
>
-