dev_forum
杨树明 6 years ago
parent 06244a38c4
commit 47a26ca47a

@ -29,7 +29,7 @@ const env = getClientEnvironment(publicUrl);
module.exports = { module.exports = {
// You may want 'eval' instead if you prefer to see the compiled output in DevTools. // You may want 'eval' instead if you prefer to see the compiled output in DevTools.
// See the discussion in https://github.com/facebookincubator/create-react-app/issues/343.s // See the discussion in https://github.com/facebookincubator/create-react-app/issues/343.s
devtool: "source-map", // 开启调试 // devtool: "source-map", // 开启调试
// These are the "entry points" to our application. // These are the "entry points" to our application.
// This means they will be the "root" imports that are included in JS bundle. // 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. // The first two entry points enable "hot" CSS and auto-refreshes for JS.

@ -321,7 +321,7 @@ export default class TPMMDEditor extends Component {
<div className={`df ${className}`} > <div className={`df ${className}`} >
{/* padding10-20 */} {/* padding10-20 */}
<div className="edu-back-greyf5 radius4" id={`mdEditor_${mdID}`} style={{..._style}}> <div className="edu-back-greyf5 radius4" id={`mdEditor_${mdID}`} style={{..._style}}>
<textarea style={{display: 'none'}} id="evaluate_script_show" name="content"></textarea> <textarea style={{display: 'none'}} id={`mdEditors_${mdID}`} name="content"></textarea>
<div className="CodeMirror cm-s-defualt"> <div className="CodeMirror cm-s-defualt">
</div> </div>
</div> </div>

@ -1,6 +1,6 @@
import React, {Component} from 'react'; import React, {Component} from 'react';
import {Input, Select, Radio, Checkbox, Popconfirm, message, Modal,Tooltip} from 'antd'; import {Input, Select, Radio, Checkbox, Popconfirm, message, Modal,Tooltip,notification} from 'antd';
import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom"; import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom";
@ -184,7 +184,7 @@ export default class TPMquestion extends Component {
practice_url: newpractice_url, practice_url: newpractice_url,
go_back_url: newgo_back_url, go_back_url: newgo_back_url,
power:response.data.power, power:response.data.power,
questioMD:response.data.task_pass, // questioMD:response.data.task_pass,
answer:response.data.answer answer:response.data.answer
}) })
@ -192,7 +192,7 @@ export default class TPMquestion extends Component {
this.setState({ this.setState({
contentMdRefval:response.data.task_pass contentMdRefval:response.data.task_pass
}) })
this.contentMdRef.current.setValue(response.data.task_pass || '') // this.contentMdRef.current.setValue(response.data.task_pass || '')
if(response.data.chooses.length===0){ if(response.data.chooses.length===0){
this.questionadd() this.questionadd()
} }
@ -248,14 +248,14 @@ export default class TPMquestion extends Component {
practice_url: newpractice_url, practice_url: newpractice_url,
go_back_url: newgo_back_url, go_back_url: newgo_back_url,
power:response.data.power, power:response.data.power,
questioMD:response.data.task_pass, // questioMD:response.data.task_pass,
}) })
this.setState({ this.setState({
contentMdRefval:response.data.task_pass contentMdRefval:response.data.task_pass
}) })
this.contentMdRef.current.setValue(response.data.task_pass || '') // this.contentMdRef.current.setValue(response.data.task_pass || '')
if(response.data.chooses.length===0){ if(response.data.chooses.length===0){
this.questionadd() this.questionadd()
} }
@ -400,12 +400,14 @@ export default class TPMquestion extends Component {
} }
questionall=()=>{ questionall=()=>{
this.setState({ // this.setState({
activetype:"first", // activetype:"first",
newquestionaddtype:false, // newquestionaddtype:false,
editquestionaddtype:false, // editquestionaddtype:false,
questionaddtype:false // questionaddtype:false
}) // })
window.location.href = '/shixuns/'+this.props.match.params.shixunId+'/challenges/'+this.props.match.params.checkpointId+'/editquestion';
} }
questionadd=()=>{ questionadd=()=>{
$('html').animate({ $('html').animate({
@ -707,14 +709,22 @@ export default class TPMquestion extends Component {
// $('html').animate({ // $('html').animate({
// scrollTop: 10 // scrollTop: 10
// }, 200); // }, 200);
message.success("修改成功"); $('html').animate({
scrollTop: 10
}, 200);
notification.open({
message: '提示',
description:
'修改成功,请点击右侧加号继续添加',
});
this.setState({ this.setState({
questionaddtype:false, questionaddtype:false,
newquestioMDvaluetype:false, newquestioMDvaluetype:false,
newquestioMDvaluetypes:false, newquestioMDvaluetypes:false,
}) })
setTimeout(window.location.href="/shixuns/"+this.props.match.params.shixunId+"/challenges/"+this.props.match.params.checkpointId+"/editquestion"+"/"+response.data.challenge_choose_id,1000) // setTimeout(window.location.href="/shixuns/"+this.props.match.params.shixunId+"/challenges/"+this.props.match.params.checkpointId+"/editquestion"+"/"+response.data.challenge_choose_id,1000)
// this.gochooseid() // this.gochooseid()
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
@ -761,12 +771,17 @@ export default class TPMquestion extends Component {
newquestioMDvaluetypes:false, newquestioMDvaluetypes:false,
questionaddarray:questionaddarrays questionaddarray:questionaddarrays
}) })
// $('html').animate({ $('html').animate({
// scrollTop: 10 scrollTop: 10
// }, 200); }, 200);
message.success("新建成功");
notification.open({
message: '提示',
description:
'新建成功,请点击右侧加号继续添加',
});
// this.getanswer_subitlist() // this.getanswer_subitlist()
this.gochooseid("/shixuns/"+this.props.match.params.shixunId+"/challenges/"+this.props.match.params.checkpointId+"/editquestion"+"/"+response.data.challenge_choose_id) // this.gochooseid("/shixuns/"+this.props.match.params.shixunId+"/challenges/"+this.props.match.params.checkpointId+"/editquestion"+"/"+response.data.challenge_choose_id)
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
}); });
@ -870,6 +885,7 @@ export default class TPMquestion extends Component {
gochooseid=(url)=>{ gochooseid=(url)=>{
window.location.href =url window.location.href =url
// window.location.Reload(url)
// this.props.history.replace( url ); // this.props.history.replace( url );
// this.props.history.push( url ); // this.props.history.push( url );
// 返回 // 返回

@ -24,7 +24,10 @@ export default class TpmQuestionEdit extends Component {
render() { render() {
console.log( this.props.questionlists) console.log( this.props.neweditanswerRef)
console.log( this.props.neweditanswerRefval)
console.log( this.props.editanswersRef)
console.log( this.props.editanswersRefval)
return ( return (
<div> <div>
@ -34,7 +37,7 @@ export default class TpmQuestionEdit extends Component {
<div className="df"> <div className="df">
<span className="mr30 color-orange pt10">*</span> <span className="mr30 color-orange pt10">*</span>
<div className="flex1 mr20"> <div className="flex1 mr20">
<TPMMDEditor ref={this.props.neweditanswerRef} placeholder="请输入选择题的题干内容" mdID={'newquestioMDid'} refreshTimeout={1500} <TPMMDEditor ref={this.props.neweditanswerRef} placeholder="请输入选择题的题干内容" mdID={'editquestioMDid'} refreshTimeout={1500}
watch={true} className="courseMessageMD" initValue={this.props.neweditanswerRefval}></TPMMDEditor> watch={true} className="courseMessageMD" initValue={this.props.neweditanswerRefval}></TPMMDEditor>
</div> </div>

@ -24,7 +24,7 @@ export default class TpmQuestionNew extends Component {
render() { render() {
console.log( this.props.questionlists) // console.log( this.props.questionlists)
return ( return (
<div> <div>

@ -2,3 +2,8 @@
height: 30px; height: 30px;
line-height: 30px; line-height: 30px;
} }
.line27{
line-height: 27px;
vertical-align: 1px;
}

@ -2,7 +2,7 @@ import React, { Component } from 'react';
import { Redirect } from 'react-router'; import { Redirect } from 'react-router';
import {Modal, Button, Radio, Input, Checkbox,message} from 'antd'; import {Modal, Button, Radio, Input, Checkbox,message,Spin, Icon} from 'antd';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
@ -44,7 +44,8 @@ class Collaborators extends Component {
collaboratorListsum:10, collaboratorListsum:10,
collaboratorListsumtype:true, collaboratorListsumtype:true,
user_name:undefined, user_name:undefined,
school_name:undefined school_name:undefined,
spinnings:false
} }
} }
componentDidMount() { componentDidMount() {
@ -155,9 +156,11 @@ class Collaborators extends Component {
}) })
} }
onSearchadmin = (value) => { onSearchadmin = (value) => {
let {collaboratorList,user_name,school_name} = this.state; let {collaboratorList,user_name,school_name} = this.state;
this.setState({ this.setState({
Searchadmin: [], Searchadmin: [],
spinnings:true,
}) })
// if (value === "") { // if (value === "") {
// this.setState({ // this.setState({
@ -174,7 +177,9 @@ class Collaborators extends Component {
school_name:school_name, school_name:school_name,
}}).then((response) => { }}).then((response) => {
if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { if (response.data.status === 403||response.data.status === 401||response.data.status === 500) {
this.setState({
spinnings:false
})
}else{ }else{
let newlist = response.data.users; let newlist = response.data.users;
for (var i = 0; i < newlist.length; i++) { for (var i = 0; i < newlist.length; i++) {
@ -182,7 +187,8 @@ class Collaborators extends Component {
} }
this.setState({ this.setState({
Searchadmin: newlist, Searchadmin: newlist,
collaboratorList: collaboratorList collaboratorList: collaboratorList,
spinnings:false
}) })
} }
@ -404,6 +410,9 @@ class Collaborators extends Component {
lineHeight: '30px', lineHeight: '30px',
}; };
// console.log(collaboratorList) // console.log(collaboratorList)
const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />;
return ( return (
<React.Fragment> <React.Fragment>
<p className="clearfix mt30" <p className="clearfix mt30"
@ -412,7 +421,7 @@ class Collaborators extends Component {
<a onClick={() => this.showCollaboratorsvisible("cooperation")} <a onClick={() => this.showCollaboratorsvisible("cooperation")}
className="edu-default-btn edu-greenback-btn fr mr20 height40" className="edu-default-btn edu-greenback-btn fr mr20 height40"
data-remote="true"> data-remote="true">
+ 添加合作 <span className={"line27"}>+ </span>
</a> </a>
<a onClick={() => this.showCollaboratorsvisible("admin")} <a onClick={() => this.showCollaboratorsvisible("admin")}
style={{display:this.props.identity===1?"block":"none"}} style={{display:this.props.identity===1?"block":"none"}}
@ -467,6 +476,7 @@ class Collaborators extends Component {
visible={Collaboratorsvisibleadmin} visible={Collaboratorsvisibleadmin}
closable={false} closable={false}
footer={null} footer={null}
width={800}
> >
{/*<Search*/} {/*<Search*/}
{/*placeholder="输入用户的姓名、昵称、邮箱进行搜索"*/} {/*placeholder="输入用户的姓名、昵称、邮箱进行搜索"*/}
@ -475,26 +485,27 @@ class Collaborators extends Component {
{/*onInput={this.onSearchadmins}*/} {/*onInput={this.onSearchadmins}*/}
{/*style={{width: '100%'}}*/} {/*style={{width: '100%'}}*/}
{/*/>*/} {/*/>*/}
<span className="mr10">姓名:</span> <span className="mr10">姓名或手机号:</span>
<Input allowClear placeholder="请输入真实姓名" value={user_name} onInput={(e) => {this.setState({user_name: e.target.value})}} <Input placeholder="请输入姓名或手机号码搜索" value={user_name} onInput={(e) => {this.setState({user_name: e.target.value})}}
style={{ width: '130px'}} style={{ width: '215px'}}
></Input> ></Input>
<span className="label ml10 " style={{ minWidth: '36px' }}>单位:</span> <span className="label ml10 " style={{ minWidth: '36px' }}>单位:</span>
<Input allowClear placeholder="请输入单位名称" className="ml10" value={school_name} onInput={(e) => {this.setState({school_name: e.target.value})}} <Input placeholder="请输入单位名称" className="ml10" value={school_name} onInput={(e) => {this.setState({school_name: e.target.value})}}
style={{ width: '135px'}}> style={{ width: '215px'}}
>
</Input> </Input>
<a className="task-btn task-btn-orange" onClick={() => this.onSearchadmin()} <a className="task-btn task-btn-orange ml20" onClick={() => this.onSearchadmin()}
style={{ height: '30px', lineHeight: '30px', marginLeft: '10px', width: '70px'}} style={{ height: '30px', lineHeight: '30px', width: '70px'}}
>搜索</a> >搜索</a>
<p className="clearfix pl35 mt20"> <p className="clearfix pl35 mt20">
<span className="fl edu-txt-w80 task-hide font-bd ml10 edu-txt-left">姓名</span> <span className="fl edu-txt-w100 task-hide font-bd ml10 edu-txt-left">姓名</span>
<span className="fl edu-txt-w80 task-hide font-bd">职业</span> <span className="fl edu-txt-w100 task-hide font-bd">职业</span>
<span className="fl edu-txt-w180 task-hide font-bd ml50">单位</span> <span className="fl edu-txt-w180 task-hide font-bd ml80">单位</span>
</p> </p>
<div className="mt5" style={{background: '#f7f9fd'}}> <div className="mt5" style={{background: '#f7f9fd'}}>
<Spin indicator={antIcon} spinning={this.state.spinnings}>
<div className="clearfix"> <div className="clearfix">
<ul className="upload_select_box fl" id="search_not_teachers_list" onScroll={this.contentViewScrolledit}> <ul className="upload_select_box fl" id="search_not_teachers_list" onScroll={this.contentViewScrolledit}>
{Searchadmin.length === 0 ? <li style={{textAlign: 'center'}}> {Searchadmin.length === 0 ? <li style={{textAlign: 'center'}}>
@ -518,10 +529,9 @@ class Collaborators extends Component {
} }
</ul> </ul>
</div> </div>
</Spin>
</div> </div>
<div className="mt10 clearfix"> <div className="mt10 clearfix">
<span className="fl mr15"> <span className="fl mr15">
<Checkbox className="fl" checked={allChangechecked} onChange={this.allChange}>全选</Checkbox> <Checkbox className="fl" checked={allChangechecked} onChange={this.allChange}>全选</Checkbox>
<div className="fl" style={{height: '27px'}}> <div className="fl" style={{height: '27px'}}>

Loading…
Cancel
Save