From 7b4ecb62b3aed04bd6a022b5de32614d06ec41f2 Mon Sep 17 00:00:00 2001
From: cxt <853663049@qq.com>
Date: Mon, 4 Nov 2019 15:57:29 +0800
Subject: [PATCH 1/4] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
config/routes.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/config/routes.rb b/config/routes.rb
index e6d7add91..04d20fd15 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -289,6 +289,7 @@ Rails.application.routes.draw do
post :down_member_position
get :right_banner
post :appointment
+ post :update_team_title
end
collection do
@@ -1077,7 +1078,6 @@ Rails.application.routes.draw do
post :cancel_homepage_show
post :excellent
post :cancel_excellent
- post :update_team_title
end
end
end
From 0916cfe2dee80aa6e20454eb73c3dd46a8fb5d5d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Mon, 4 Nov 2019 16:09:00 +0800
Subject: [PATCH 2/4] =?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/config/webpack.config.dev.js | 2 +-
.../modules/paths/PathDetail/Modifytext.js | 169 ++++++++++++++++++
.../paths/PathDetail/PathDetailIndex.js | 72 +++++++-
3 files changed, 237 insertions(+), 6 deletions(-)
create mode 100644 public/react/src/modules/paths/PathDetail/Modifytext.js
diff --git a/public/react/config/webpack.config.dev.js b/public/react/config/webpack.config.dev.js
index f335f1705..743b3685c 100644
--- a/public/react/config/webpack.config.dev.js
+++ b/public/react/config/webpack.config.dev.js
@@ -32,7 +32,7 @@ module.exports = {
// See the discussion in https://github.com/facebookincubator/create-react-app/issues/343.s
// devtool: "cheap-module-eval-source-map",
// 开启调试
- devtool: "source-map", // 开启调试
+ // devtool: "source-map", // 开启调试
// These are the "entry points" to our application.
// This means they will be the "root" imports that are included in JS bundle.
// The first two entry points enable "hot" CSS and auto-refreshes for JS.
diff --git a/public/react/src/modules/paths/PathDetail/Modifytext.js b/public/react/src/modules/paths/PathDetail/Modifytext.js
new file mode 100644
index 000000000..ca12659a9
--- /dev/null
+++ b/public/react/src/modules/paths/PathDetail/Modifytext.js
@@ -0,0 +1,169 @@
+import React, {Component} from 'react';
+import {Button, Layout, Input, Form} from 'antd';
+import axios from 'axios';
+import {getImageUrl} from 'educoder';
+
+
+class Modifytext extends Component {
+ constructor(props) {
+ super(props)
+ this.state = {}
+ }
+
+ componentDidMount() {
+
+ }
+
+ //重新输入教学模式
+ Modifytext = () => {
+ this.props.form.validateFieldsAndScroll((err, values) => {
+ if (!err) {
+ const url = `/paths/${this.props.pathid}/update_team_title.json`;
+ axios.post(url, {
+ team_title: values.teachingteam
+ }).then((response) => {
+ console.log(response);
+ if (response) {
+ if (response.data) {
+ if (response.data.status === 0) {
+ try {
+ this.props.showNotification("修改成功!");
+ } catch (e) {
+
+ }
+ try {
+ this.props.modifysy(2);
+ } catch (e) {
+
+ }
+
+
+ }
+ }
+ }
+
+ }).catch((error) => {
+ console.log(error)
+
+ })
+
+
+ }
+ })
+
+
+ }
+
+
+ render() {
+ const {getFieldDecorator} = this.props.form;
+ return (
+
+ )
+ }
+}
+
+const Modifytexts = Form.create({name: 'Modifytext'})(Modifytext);
+
+export default Modifytexts;
+
diff --git a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js
index ca52cd9d1..b393d1bb6 100644
--- a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js
+++ b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js
@@ -12,7 +12,7 @@ import Modals from '../../modals/Modals';
import axios from 'axios';
import TPMRightSection from "../../tpm/component/TPMRightSection";
import styled from "styled-components";
-
+import Modifytext from './Modifytext';
const getItemStyle = (isDragging, draggableStyle) => ({
// change background colour if dragging
background: isDragging ? '#dceeff' : '',
@@ -87,7 +87,9 @@ class PathDetailIndex extends Component{
dataquerys:{},
MenuItemsindex:1,
MenuItemsindextype:0,
- qrcode_img:null
+ qrcode_img: null,
+ team_title: "教学团队",
+ modify: false,
}
this.onDragEnd = this.onDragEnd.bind(this);
@@ -256,6 +258,7 @@ class PathDetailIndex extends Component{
progress:result.data.progress,
members:result.data.members,
items: getItems(result.data.members.length),
+ team_title: result.data.team_title
})
}).catch((error)=>{
@@ -321,6 +324,7 @@ class PathDetailIndex extends Component{
progress:result.data.progress,
members:result.data.members,
items: getItems(result.data.members.length),
+ team_title: result.data.team_title
})
}).catch((error)=>{
@@ -458,6 +462,50 @@ class PathDetailIndex extends Component{
console.log(error)
})
}
+
+
+ modifysy = (i) => {
+ if (i === 1) {
+ this.setState({
+ modify: true
+ })
+ } else if (i === 2) {
+ this.setState({
+ modify: false
+ })
+ let righturl = "/paths/" + this.props.match.params.pathId + "/right_banner.json";
+ axios.get(righturl).then((result) => {
+ if (result.data.status === 407 || result.data.status === 401) {
+ debugger
+ return;
+ }
+
+ if (result.data.status === 403) {
+ debugger
+ // window.location.href = "/403";
+ return;
+ }
+
+ this.setState({
+ // detailInfoList:result.data,
+ tags: result.data.tags,
+ progress: result.data.progress,
+ members: result.data.members,
+ items: getItems(result.data.members.length),
+ team_title: result.data.team_title
+ })
+
+ }).catch((error) => {
+ console.log(error);
+ })
+ }
+ }
+
+ setteam_title(name) {
+ this.setState({
+ team_title: name
+ })
+ }
render(){
this.updatamakedown("shixuns_propaedeutics");
@@ -475,7 +523,9 @@ class PathDetailIndex extends Component{
tags,
qrcode_img,
MenuItemsindex,
- MenuItemsindextype
+ MenuItemsindextype,
+ team_title,
+ modify
} = this.state
@@ -613,7 +663,19 @@ class PathDetailIndex extends Component{
{
members ===undefined ?"":members === null ?"":
-
教学团队
+ {
+ detailInfoList === undefined ? "" : detailInfoList.allow_add_member === true ?
+ (
+ modify === false ?
+
this.modifysy(1)}>{team_title}
+ :
+
this.modifysy(i)}
+ setteam_title={(name) => this.setteam_title(name)}>
+ )
+
+ : ""
+ }
{ members===undefined?
members && members.map((item,key)=>{
@@ -712,4 +774,4 @@ class PathDetailIndex extends Component{
)
}
}
-export default PathDetailIndex;
\ No newline at end of file
+export default PathDetailIndex;
From 26fa7b56e80901f6250fec79cbd05401d9061648 Mon Sep 17 00:00:00 2001
From: p31729568
Date: Mon, 4 Nov 2019 16:10:23 +0800
Subject: [PATCH 3/4] auth qq
---
config/routes.rb | 1 +
1 file changed, 1 insertion(+)
diff --git a/config/routes.rb b/config/routes.rb
index 04d20fd15..60fbf2dad 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -6,6 +6,7 @@ Rails.application.routes.draw do
get 'attachments/download/:id', to: 'attachments#show'
get 'attachments/download/:id/:filename', to: 'attachments#show'
+ get 'auth/qq/callback', to: 'oauth/qq#create'
resources :edu_settings
scope '/api' do
From cbce38672230a11dfab49f3b2fb77d93a14c7ee7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Mon, 4 Nov 2019 16:27:31 +0800
Subject: [PATCH 4/4] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../react/src/modules/user/usersInfo/InfosCourse.js | 11 +++++++++++
.../src/modules/user/usersInfo/InfosPackage.js | 13 ++++++++++++-
.../react/src/modules/user/usersInfo/InfosPath.js | 11 +++++++++++
.../src/modules/user/usersInfo/InfosProject.js | 11 +++++++++++
.../react/src/modules/user/usersInfo/InfosShixun.js | 11 +++++++++++
5 files changed, 56 insertions(+), 1 deletion(-)
diff --git a/public/react/src/modules/user/usersInfo/InfosCourse.js b/public/react/src/modules/user/usersInfo/InfosCourse.js
index 14046d495..8e2478510 100644
--- a/public/react/src/modules/user/usersInfo/InfosCourse.js
+++ b/public/react/src/modules/user/usersInfo/InfosCourse.js
@@ -151,6 +151,17 @@ class InfosCourse extends Component{
return(
+
this.changeCategory()}>全部
this.changeCategory("manage")}>{is_current ? "我":"TA"}管理的
diff --git a/public/react/src/modules/user/usersInfo/InfosPackage.js b/public/react/src/modules/user/usersInfo/InfosPackage.js
index 4b2c655c3..207d32480 100644
--- a/public/react/src/modules/user/usersInfo/InfosPackage.js
+++ b/public/react/src/modules/user/usersInfo/InfosPackage.js
@@ -168,6 +168,17 @@ class InfosPackage extends Component{
modalSave={this.state.ModalSave}
/>
+
this.changeCategory()}>全部
this.changeCategory("manage")}>{is_current ? "我":"TA"}管理的
@@ -289,4 +300,4 @@ class InfosPackage extends Component{
)
}
}
-export default InfosPackage;
\ No newline at end of file
+export default InfosPackage;
diff --git a/public/react/src/modules/user/usersInfo/InfosPath.js b/public/react/src/modules/user/usersInfo/InfosPath.js
index 0b1437f40..429495cf1 100644
--- a/public/react/src/modules/user/usersInfo/InfosPath.js
+++ b/public/react/src/modules/user/usersInfo/InfosPath.js
@@ -160,6 +160,17 @@ class InfosPath extends Component{
return(
+
this.changeCategory()}>全部
this.changeCategory("manage")}>{is_current ? "我":"TA"}管理的
diff --git a/public/react/src/modules/user/usersInfo/InfosProject.js b/public/react/src/modules/user/usersInfo/InfosProject.js
index 302d6def1..ee2cc13b0 100644
--- a/public/react/src/modules/user/usersInfo/InfosProject.js
+++ b/public/react/src/modules/user/usersInfo/InfosProject.js
@@ -162,6 +162,17 @@ class InfosProject extends Component{
return(
+
this.changeCategory()}>全部
this.changeCategory("manage")}>{is_current ? "我":"TA"}管理的
diff --git a/public/react/src/modules/user/usersInfo/InfosShixun.js b/public/react/src/modules/user/usersInfo/InfosShixun.js
index cad70e716..0b6a33571 100644
--- a/public/react/src/modules/user/usersInfo/InfosShixun.js
+++ b/public/react/src/modules/user/usersInfo/InfosShixun.js
@@ -160,6 +160,17 @@ class InfosShixun extends Component{
return(