issues25489
杨树林 5 years ago
parent 39820cb449
commit 0916cfe2de

@ -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.

@ -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 (
<div>
<div className="ml38">
<style>{`
.flexRow {
padding: 20px 0;
}
.flexRow .name {
margin-left: 12px;
color: #666666;
text-align: center;
flex: 0 0 100px;
}
.flexRow .description {
margin-left: 10px;
flex: 1;
color: #CDCDCD;
}
.description span {
margin-right: 20px;
color: #05101A;
}
.flexRow .status {
width: 100px;
color: #28AC7F;
text-align: right;
}
.flexTable .flexTable {
border-bottom: 1px solid #EBEBEB;
}
.settingFormsy label{
color: #666666;
font-size: 14px !important ;
}
.settingFormsy input {
width: 275px;
height: 32px;
}
.settingFormsy input.validateInput {
width: 220px;
}
.settingFormsy .formItemInline button {
width: 110px;
margin-left: 10px;
}
.settingFormsy .ant-form-item-label {
width: 60px;
text-align: left;
}
.formItemInline .ant-form-explain{
position:absolute;
bottom:-22px;
left:0px;
width:100%;
}
.yslzxueshi .ant-input{
height: 40px !important;
width: 276px !important
}
// class="ant-col ant-form-item-label"
`}</style>
<div className="settingFormsy">
<React.Fragment>
<Form>
<div style={{
display: "flex",
flexDirection: "initial",
lineHeight: " 51px",
}}>
<Form.Item
label=""
className="formItemInline hideRequireTag mb20 mt20"
>
{getFieldDecorator('teachingteam', {
rules: [{
// initialValue: this.state.cityDefaultValue,
required: true,
message: '请输入模式',
}],
})(
<Input placeholder={`例如:教学团队`}></Input>
)}
</Form.Item>
<div className="flexdirections yslzxueshi ml38 ">
<p className="fontcolorsyslhui1 font-14 myysllineheight myyslminwidth"></p>
<div className=" flexdirections ml10">
{/*<div className="buttongo mycompitcursor" onClick={()=>this.yhBanksfalse()}><p className="fontwenzi mycompitcursor" >取消</p></div>*/}
<Button type="primary" onClick={() => this.Modifytext()}>确定</Button>
</div>
</div>
</div>
</Form>
</React.Fragment>
</div>
</div>
</div>
)
}
}
const Modifytexts = Form.create({name: 'Modifytext'})(Modifytext);
export default Modifytexts;

@ -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 ?"":
<div className="teacherTeam edu-back-white clearfix" id="subject_members">
<p className="font-16 clearfix">教学团队</p>
{
detailInfoList === undefined ? "" : detailInfoList.allow_add_member === true ?
(
modify === false ?
<p className="font-16 clearfix" onDoubleClick={() => this.modifysy(1)}>{team_title}</p>
:
<Modifytext {...this.props} {...this.state} pathid={this.props.match.params.pathId}
modifysy={(i) => this.modifysy(i)}
setteam_title={(name) => this.setteam_title(name)}></Modifytext>
)
: ""
}
{ members===undefined?
members && members.map((item,key)=>{
@ -712,4 +774,4 @@ class PathDetailIndex extends Component{
)
}
}
export default PathDetailIndex;
export default PathDetailIndex;

Loading…
Cancel
Save