diff --git a/config/routes.rb b/config/routes.rb index e6d7add91..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 @@ -289,6 +290,7 @@ Rails.application.routes.draw do post :down_member_position get :right_banner post :appointment + post :update_team_title end collection do @@ -1077,7 +1079,6 @@ Rails.application.routes.draw do post :cancel_homepage_show post :excellent post :cancel_excellent - post :update_team_title end end end 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 ( +
+
+ +
+ +
+
+ + {getFieldDecorator('teachingteam', { + rules: [{ + // initialValue: this.state.cityDefaultValue, + required: true, + message: '请输入模式', + }], + })( + + )} + +
+

+
+ {/*
this.yhBanksfalse()}>

取消

*/} + +
+
+
+
+
+
+ +
+
+ ) + } +} + +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; 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(
    +