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

@ -29,7 +29,7 @@ const env = getClientEnvironment(publicUrl);
module.exports = {
// 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
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.

@ -321,7 +321,7 @@ export default class TPMMDEditor extends Component {
<div className={`df ${className}`} >
{/* padding10-20 */}
<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>
</div>

@ -1,6 +1,6 @@
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";
@ -184,7 +184,7 @@ export default class TPMquestion extends Component {
practice_url: newpractice_url,
go_back_url: newgo_back_url,
power:response.data.power,
questioMD:response.data.task_pass,
// questioMD:response.data.task_pass,
answer:response.data.answer
})
@ -192,7 +192,7 @@ export default class TPMquestion extends Component {
this.setState({
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){
this.questionadd()
}
@ -248,14 +248,14 @@ export default class TPMquestion extends Component {
practice_url: newpractice_url,
go_back_url: newgo_back_url,
power:response.data.power,
questioMD:response.data.task_pass,
// questioMD:response.data.task_pass,
})
this.setState({
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){
this.questionadd()
}
@ -400,12 +400,14 @@ export default class TPMquestion extends Component {
}
questionall=()=>{
this.setState({
activetype:"first",
newquestionaddtype:false,
editquestionaddtype:false,
questionaddtype:false
})
// this.setState({
// activetype:"first",
// newquestionaddtype:false,
// editquestionaddtype:false,
// questionaddtype:false
// })
window.location.href = '/shixuns/'+this.props.match.params.shixunId+'/challenges/'+this.props.match.params.checkpointId+'/editquestion';
}
questionadd=()=>{
$('html').animate({
@ -707,14 +709,22 @@ export default class TPMquestion extends Component {
// $('html').animate({
// scrollTop: 10
// }, 200);
message.success("修改成功");
$('html').animate({
scrollTop: 10
}, 200);
notification.open({
message: '提示',
description:
'修改成功,请点击右侧加号继续添加',
});
this.setState({
questionaddtype:false,
newquestioMDvaluetype: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()
}).catch((error) => {
console.log(error)
@ -761,12 +771,17 @@ export default class TPMquestion extends Component {
newquestioMDvaluetypes:false,
questionaddarray:questionaddarrays
})
// $('html').animate({
// scrollTop: 10
// }, 200);
message.success("新建成功");
$('html').animate({
scrollTop: 10
}, 200);
notification.open({
message: '提示',
description:
'新建成功,请点击右侧加号继续添加',
});
// 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) => {
console.log(error)
});
@ -869,7 +884,8 @@ export default class TPMquestion extends Component {
}
gochooseid=(url)=>{
window.location.href =url
window.location.href =url
// window.location.Reload(url)
// this.props.history.replace( url );
// this.props.history.push( url );
// 返回

@ -24,7 +24,10 @@ export default class TpmQuestionEdit extends Component {
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 (
<div>
@ -34,7 +37,7 @@ export default class TpmQuestionEdit extends Component {
<div className="df">
<span className="mr30 color-orange pt10">*</span>
<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>
</div>

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

@ -2,3 +2,8 @@
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 {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";
@ -44,7 +44,8 @@ class Collaborators extends Component {
collaboratorListsum:10,
collaboratorListsumtype:true,
user_name:undefined,
school_name:undefined
school_name:undefined,
spinnings:false
}
}
componentDidMount() {
@ -155,9 +156,11 @@ class Collaborators extends Component {
})
}
onSearchadmin = (value) => {
let {collaboratorList,user_name,school_name} = this.state;
this.setState({
Searchadmin: [],
spinnings:true,
})
// if (value === "") {
// this.setState({
@ -174,7 +177,9 @@ class Collaborators extends Component {
school_name:school_name,
}}).then((response) => {
if (response.data.status === 403||response.data.status === 401||response.data.status === 500) {
this.setState({
spinnings:false
})
}else{
let newlist = response.data.users;
for (var i = 0; i < newlist.length; i++) {
@ -182,7 +187,8 @@ class Collaborators extends Component {
}
this.setState({
Searchadmin: newlist,
collaboratorList: collaboratorList
collaboratorList: collaboratorList,
spinnings:false
})
}
@ -404,7 +410,10 @@ class Collaborators extends Component {
lineHeight: '30px',
};
// console.log(collaboratorList)
return (
const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />;
return (
<React.Fragment>
<p className="clearfix mt30"
style={{display:this.props.identity<5?"block":"none"}}
@ -412,7 +421,7 @@ class Collaborators extends Component {
<a onClick={() => this.showCollaboratorsvisible("cooperation")}
className="edu-default-btn edu-greenback-btn fr mr20 height40"
data-remote="true">
+ 添加合作
<span className={"line27"}>+ </span>
</a>
<a onClick={() => this.showCollaboratorsvisible("admin")}
style={{display:this.props.identity===1?"block":"none"}}
@ -467,6 +476,7 @@ class Collaborators extends Component {
visible={Collaboratorsvisibleadmin}
closable={false}
footer={null}
width={800}
>
{/*<Search*/}
{/*placeholder="输入用户的姓名、昵称、邮箱进行搜索"*/}
@ -475,53 +485,53 @@ class Collaborators extends Component {
{/*onInput={this.onSearchadmins}*/}
{/*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})}}
style={{ width: '130px'}}
<Input placeholder="请输入姓名或手机号码搜索" value={user_name} onInput={(e) => {this.setState({user_name: e.target.value})}}
style={{ width: '215px'}}
></Input>
<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})}}
style={{ width: '135px'}}>
<Input placeholder="请输入单位名称" className="ml10" value={school_name} onInput={(e) => {this.setState({school_name: e.target.value})}}
style={{ width: '215px'}}
>
</Input>
<a className="task-btn task-btn-orange" onClick={() => this.onSearchadmin()}
style={{ height: '30px', lineHeight: '30px', marginLeft: '10px', width: '70px'}}
<a className="task-btn task-btn-orange ml20" onClick={() => this.onSearchadmin()}
style={{ height: '30px', lineHeight: '30px', width: '70px'}}
>搜索</a>
<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-w80 task-hide font-bd">职业</span>
<span className="fl edu-txt-w180 task-hide font-bd ml50">单位</span>
<span className="fl edu-txt-w100 task-hide font-bd ml10 edu-txt-left">姓名</span>
<span className="fl edu-txt-w100 task-hide font-bd">职业</span>
<span className="fl edu-txt-w180 task-hide font-bd ml80">单位</span>
</p>
<div className="mt5" style={{background: '#f7f9fd'}}>
<div className="clearfix">
<ul className="upload_select_box fl" id="search_not_teachers_list" onScroll={this.contentViewScrolledit}>
{Searchadmin.length === 0 ? <li style={{textAlign: 'center'}}>
<span>请试试搜索一下</span>
</li> : Searchadmin.map((item, key) => {
return (
<li key={key} style={{display: item.identify === "专业人士" ? "none" : "block"}}>
<Checkbox className="fl mr20" checked={item.checked}
onChange={(e) => this.selectChangenickname(e, key)}
id={item.user_id}></Checkbox>
<a className="task-hide color-grey3 fl span1 edu-txt-w80 edu-txt-left">{item.nickname}</a>
<span className="task-hide fl color-grey edu-txt-w80 span2">{item.identify}</span>
<span
title={item.school_name}
style={{width: '150px'}}
className="span3 color-grey fl edu-txt-w260 task-hide ml50 task-hide" >{item.school_name}</span>
</li>
)
})
}
</ul>
</div>
<Spin indicator={antIcon} spinning={this.state.spinnings}>
<div className="clearfix">
<ul className="upload_select_box fl" id="search_not_teachers_list" onScroll={this.contentViewScrolledit}>
{Searchadmin.length === 0 ? <li style={{textAlign: 'center'}}>
<span>请试试搜索一下</span>
</li> : Searchadmin.map((item, key) => {
return (
<li key={key} style={{display: item.identify === "专业人士" ? "none" : "block"}}>
<Checkbox className="fl mr20" checked={item.checked}
onChange={(e) => this.selectChangenickname(e, key)}
id={item.user_id}></Checkbox>
<a className="task-hide color-grey3 fl span1 edu-txt-w80 edu-txt-left">{item.nickname}</a>
<span className="task-hide fl color-grey edu-txt-w80 span2">{item.identify}</span>
<span
title={item.school_name}
style={{width: '150px'}}
className="span3 color-grey fl edu-txt-w260 task-hide ml50 task-hide" >{item.school_name}</span>
</li>
)
})
}
</ul>
</div>
</Spin>
</div>
<div className="mt10 clearfix">
<span className="fl mr15">
<Checkbox className="fl" checked={allChangechecked} onChange={this.allChange}>全选</Checkbox>
<div className="fl" style={{height: '27px'}}>

Loading…
Cancel
Save