hjm 6 years ago
commit 8957461ba9

@ -10,6 +10,17 @@ export function getImageUrl(path) {
return `/${path}`;
}
export function setImagesUrl(path){
const local = 'http://47.96.87.25:48080'
let firstStr=path.substr(0,1);
console.log(firstStr);
if(firstStr=="/"){
return isDev?`${local}${path}`:`${path}`;
}else{
return isDev?`${local}/${path}`:`/${path}`;
}
}
export function getUrl(path, goTest) {
// https://www.educoder.net
// https://testbdweb.trustie.net

@ -2,7 +2,7 @@ import { from } from '_array-flatten@2.1.2@array-flatten';
// export { default as OrderStateUtil } from '../routes/Order/components/OrderStateUtil';
export { getImageUrl as getImageUrl, getUrl as getUrl, getUploadActionUrl as getUploadActionUrl } from './UrlTool';
export { getImageUrl as getImageUrl, getUrl as getUrl,setImagesUrl as setImagesUrl, getUploadActionUrl as getUploadActionUrl } from './UrlTool';
export { default as queryString } from './UrlTool2';
export { SnackbarHOC as SnackbarHOC } from './SnackbarHOC';

@ -279,6 +279,7 @@ class Testpapersettinghomepage extends Component{
checkBoxValues={[parseInt(this.props.match.params.Id)]}
Exercisetype={"exercise"}
action={this.Commonheadofthetestpaper}
single={true}
></ImmediatelyEnd>:"":""}
{isAdmin === true?Commonheadofthetestpaper!==undefined&&Commonheadofthetestpaper.user_permission.exercise_unpublish_count>0? <ImmediatelyPublish
{...this.props}
@ -287,6 +288,7 @@ class Testpapersettinghomepage extends Component{
checkBoxValues={[parseInt(this.props.match.params.Id)]}
Exercisetype={"exercise"}
action={this.Commonheadofthetestpaper}
single={true}
></ImmediatelyPublish>
:"":""}
{isAdmin === true? <Link className="fr color-blue font-16 mt20 mr20" to={`/courses/${this.props.match.params.coursesId}/exercises/${this.props.match.params.Id}/edit`}>编辑试卷</Link>:""}

@ -163,13 +163,13 @@ class GraduationTasksappraise extends Component{
<div className={"educontent mb20"}>
<p className="clearfix mt10">
<WordsBtn style="grey" className="fl"> <Link to={"/courses/"+courseId} className="color-grey-6">{datalist&&datalist.course_name}</Link></WordsBtn>
<Link to={"/courses/"+courseId} className="color-grey-9 fl">{datalist&&datalist.course_name}</Link>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn style="grey" className="fl"> <Link to={"/courses/"+courseId+"/graduation_tasks/"+graduation_id} className="color-grey-6">{datalist&&datalist.graduation_name}</Link></WordsBtn>
<Link to={"/courses/"+courseId+"/graduation_tasks/"+graduation_id} className="color-grey-9 fl">{datalist&&datalist.graduation_name}</Link>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn style="grey" className="fl"> <Link to={"/courses/"+courseId+"/graduation_tasks/"+graduation_id+"/"+task_id+"/list"} className="color-grey-6">任务详情</Link></WordsBtn>
<Link to={"/courses/"+courseId+"/graduation_tasks/"+graduation_id+"/"+task_id+"/list"} className="color-grey-9 fl">任务详情</Link>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn style="grey" className="fl"> <span className="color-grey-6">{datalist&&datalist.author_name}</span></WordsBtn>
<span className="color-grey-6 fl">{datalist&&datalist.author_name}</span>
</p>
@ -195,16 +195,16 @@ class GraduationTasksappraise extends Component{
</div>
<div className=" edu-back-white " style={{"padding": "20px 15px 20px 15px","box-sizing": "border-box"}}>
<div className="edu-back-white">
<div className={"stud-class-set edu-back-white"} style={{ padding: '0px 10px 20px 10px'}}>
<div className={"stud-class-set edu-back-white padding20-30"}>
<div className={"color-grey-6 h20 mb20"}>
内容
</div>
<div className={"ml20"}>
<div dangerouslySetInnerHTML={{__html: markdownToHTML(datalist&&datalist.description===null?"--":datalist&&datalist.description).replace(/▁/g,"▁▁▁")}}></div>
<div className="markdown-body" dangerouslySetInnerHTML={{__html: markdownToHTML(datalist&&datalist.description===null?"--":datalist&&datalist.description).replace(/▁/g,"▁▁▁")}}></div>
</div>
{/*<div className={"color-grey-6 h20 ml20"}>*/}
@ -238,7 +238,7 @@ class GraduationTasksappraise extends Component{
{/*<span className={"color9B9B fr"}>*/}
{/*{moment(datalist&&datalist.update_time).format('YYYY-MM-DD HH:mm:ss')==="Invalid date"?"":moment(datalist&&datalist.update_time).format('YYYY-MM-DD HH:mm:ss')}*/}
{/*</span>*/}
<span className={"color9B9B fr mr30"}>提交</span>
<span className={"color9B9B fr"}>提交</span>
<span className={"fr font-13 mr10 ml10"}>{datalist&&datalist.author_name}</span>
<span className={" color9B9B fr"}>
{moment(datalist&&datalist.commit_time).format('YYYY-MM-DD HH:mm:ss')==="Invalid date"?"":moment(datalist&&datalist.commit_time).format('YYYY-MM-DD HH:mm:ss')}
@ -248,12 +248,11 @@ class GraduationTasksappraise extends Component{
</div>
{firelistdata===undefined?"":firelistdata.length===0?"":firelistdata.revise_attachments.length===0?"":<div className={"stud-class-set bor-bottom-greyE pd20 edu-back-white"}>
{firelistdata===undefined?"":firelistdata.length===0?"":firelistdata.revise_attachments.length===0?"":
<div className={"stud-class-set bor-top-greyE padding20-30 edu-back-white"}>
<div className={"color-grey-6 mb10 bor-top-greyE"}>
补交附件
</div>
<div className={"ml20"}>
补交原因{firelistdata&&firelistdata.revise_reason}
</div>
@ -291,28 +290,23 @@ class GraduationTasksappraise extends Component{
</div>}
{datalist&&datalist.project_info===undefined?"":<div className={"stud-class-set bor-bottom-greyE pd20 edu-back-white"}>
{datalist&&datalist.project_info===undefined?"":
<div className={"stud-class-set edu-back-white padding20-30 bor-top-greyE"}>
<div className={"color-grey-6 mb10"}>
关联项目
</div>
<div className={"ml20"}>
{datalist&&datalist.project_info.name}
</div>
</div>}
{/*{*/}
{ datalist === undefined?"":datalist&&datalist.task_type===undefined?"" :datalist.task_type===1? "":
<div className={"stud-class-set pd20 edu-back-white mb10"} style={{height:"100%"}}>
{ datalist === undefined?"": datalist && datalist.task_type===undefined ?"" : datalist.task_type===1? "": datalist && datalist.work_members && datalist.work_members.length == 0 ?"":
<div className={"stud-class-set edu-back-white padding20-30 bor-top-greyE"} style={{height:"100%"}}>
<div className={"color-grey-6 mb10"}>
其他组员
</div>
<div className={"both"}></div>
{datalist&&datalist.work_members&&datalist.work_members.map((item,key)=>{
{datalist.work_members.map((item,key)=>{
return(
<div className={"fl mr20 ml20"} key={key} id={item.user_id}>
{item.user_name}
@ -322,8 +316,6 @@ class GraduationTasksappraise extends Component{
<div className={"both"}></div>
</div>
}
</div>

@ -216,7 +216,7 @@ class GraduationTasksedit extends Component{
if ( response.data.status === 0) {
this.setState({
Modalstype:true,
Modalstype:false,
Modalstopval:response.data.message,
ModalSave:this.cancelAttachment,
Loadtype:true,

@ -1010,10 +1010,10 @@ class GraduationTaskssettingapp extends Component{
<div className={"educontent mb20"}>
<p className="clearfix mt10">
<WordsBtn style="grey" className="fl"> <Link to={"/courses/"+courseId+"/students"} className="color-grey-6">{coursename}</Link></WordsBtn>
<span className="color-grey-c fl ml3 mr3">&gt;</span>
<WordsBtn style="grey" className="fl"> <Link to={"/courses/"+courseId+"/graduation_tasks/"+settingdata.graduation_id} className="color-grey-6">毕设任务</Link></WordsBtn>
<span className="color-grey-c fl ml3 mr3">&gt;</span>
<Link to={"/courses/"+courseId+"/students"} className="color-grey-9 fl">{coursename}</Link>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<Link to={"/courses/"+courseId+"/graduation_tasks/"+settingdata.graduation_id} className="color-grey-9 fl">毕设任务</Link>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
{/*{taskname===""?"":*/}
{/*<WordsBtn style="grey" className="fl">*/}
@ -1022,18 +1022,17 @@ class GraduationTaskssettingapp extends Component{
{/*</WordsBtn>*/}
{/*}*/}
<span>任务详情</span>
<span className="color-grey-6">任务详情</span>
</p>
<div style={{ width:'100%',height:'75px'}} >
<p className=" fl color-black mt25 summaryname">
<div className="clearfix mt20 mb20 lineh-25">
<p className=" fl color-black lineh-25 summaryname">
<Link to={"/courses/"+courseId+"/graduation"+"/graduation_tasks/"}>{taskname}</Link>
</p>
<CoursesListType
typelist={task_status}
typesylename={"mt22"}
/>
<a className="color-grey-6 fr font-16 ml30 mt10 mr20" onClick={this.goback}>返回</a>
<a className="color-grey-6 fr font-16 ml30 mr20" onClick={this.goback}>返回</a>
</div>

@ -1360,11 +1360,11 @@ class GraduationTaskssettinglist extends Component{
<div className={"educontent mb20"}>
<p className="clearfix mt10">
<WordsBtn style="grey" className="fl"> <Link to={"/courses/"+courseId+"/students"}>{taskslistdata.course_name}</Link></WordsBtn>
<Link className="color-grey-9 fl" to={"/courses/"+courseId+"/students"}>{taskslistdata.course_name}</Link>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn style="grey" className="fl"> <Link to={"/courses/"+courseId+"/graduation_tasks/"+taskslistdata.graduation_id} className="color-grey-6">{taskslistdata.graduation_name}</Link></WordsBtn>
<Link className="color-grey-9 fl" to={"/courses/"+courseId+"/graduation_tasks/"+taskslistdata.graduation_id}>{taskslistdata.graduation_name}</Link>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<span>任务详情</span>
<span className="color-grey-6 fl">任务详情</span>
</p>
<div className="clearfix lineh-25 mt20 mb20">

@ -243,29 +243,21 @@ class GraduationTasksquestions extends Component{
<div className={"educontent mb20"}>
<p className="clearfix mt10">
<WordsBtn style="grey" className="fl"> <Link to={"/courses/"+courseId+"/students"} className="color-grey-6">{questionslist.course_name}</Link></WordsBtn>
<Link to={"/courses/"+courseId+"/students"} className="color-grey-9 fl">{questionslist.course_name}</Link>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn style="grey" className="fl"> <Link to={"/courses/"+courseId+"/graduation_tasks/"+questionslist.graduation_id} className="color-grey-6">{questionslist.graduation_name}</Link></WordsBtn>
<Link to={"/courses/"+courseId+"/graduation_tasks/"+questionslist.graduation_id} className="color-grey-9 fl">{questionslist.graduation_name}</Link>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
{/*<WordsBtn style="grey" className="fl">*/}
{/*<Link to={"/courses/"+courseId+"/graduation/graduation_tasks/"+category_id} className="color-grey-6">{questionslist.task_name}</Link>*/}
{/*<span className="color-grey-9 ml3 mr3">&gt;</span>*/}
{/*</WordsBtn>*/}
<span>任务详情</span>
<span className="color-grey-6">任务详情</span>
</p>
<div style={{ width:'100%'}} >
<p className=" fl color-black mt25 summaryname">
<div className="clearfix mt20 mb20 lineh-25">
<p className=" fl color-black summaryname">
<Link to={"/courses/"+courseId+"/graduation_tasks/"+category_id} className="color-grey-6">{questionslist.task_name}</Link>
</p>
<CoursesListType
typelist={questionslist.task_status}
typesylename={"mt22"}
/>
<a className="color-grey-6 fr font-16 ml30 mt10 mr20" onClick={this.goback}>返回</a>
<a className="color-grey-6 fr font-16 ml30 mr20" onClick={this.goback}>返回</a>
</div>

@ -19,7 +19,8 @@ class AddStudentModal extends Component{
hasMore: true,
loading: false,
courseGroup: '',
page: 1
page: 1,
isSpin:false
}
}
fetchMemberList = (arg_page) => {
@ -92,6 +93,9 @@ class AddStudentModal extends Component{
}
onSendOk = () => {
this.setState({
isSpin:true
})
if(!this.state.checkBoxValues || this.state.checkBoxValues.length == 0) {
this.props.showNotification('请从列表中先选择用户。')
return;
@ -111,6 +115,9 @@ class AddStudentModal extends Component{
this.setVisible(false)
this.props.showNotification('添加成功')
this.props.addStudentSuccess && this.props.addStudentSuccess(params)
this.setState({
isSpin:false
})
}
})
.catch(function (error) {
@ -142,7 +149,7 @@ class AddStudentModal extends Component{
}
render(){
const { users, checkBoxValues, loading, hasMore, name, school_name
, courseGroup, course_groups, } = this.state
, courseGroup, course_groups,isSpin } = this.state
const { moduleName } = this.props
return(
<ModalWrapper
@ -184,9 +191,9 @@ class AddStudentModal extends Component{
`}
</style>
<div className="df">
<span className="firstLabel label">姓名:</span>
<span className="mr10">姓名:</span>
<Input allowClear placeholder="请输入真实姓名" value={name} onChange={(e) => {this.setState({name: e.target.value})}}
style={{ width: '200px'}}
style={{ width: '242px'}}
></Input>
<span className="label" style={{ minWidth: '36px' }}>单位:</span>
{/* <Input allowClear placeholder="" value={school_name} onChange={(e) => {this.setState({school_name: e.target.value})}}
@ -202,8 +209,8 @@ class AddStudentModal extends Component{
</div>
{/* <Divider /> */}
{course_groups && course_groups.length && <div className="df" style={{ marginTop: '24px' }} >
<span className="firstLabel label">分班:</span>
<Select style={{ width: 457 }} onChange={this.handleCourseGroupChange} value={courseGroup}>
<span className="mr10">分班:</span>
<Select style={{ width:500 }} onChange={this.handleCourseGroupChange} value={courseGroup}>
{ course_groups.map((item) => {
return <Option value={item.id}>{item.name}</Option>
})}
@ -217,6 +224,7 @@ class AddStudentModal extends Component{
<span className="fl with45"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{'单位'}</label></span>
</p>
<Spin size="large" spinning={isSpin}>
{ users && users.length ? <div>
{/* https://github.com/CassetteRocks/react-infinite-scroller/issues/70 */}
<div className="edu-back-skyblue padding10-15" style={{"height":"300px", overflowY: "scroll", overflowAnchor: 'none' }}>
@ -259,6 +267,7 @@ class AddStudentModal extends Component{
</InfiniteScroll>
</div>
</div> : <NoneData></NoneData> }
</Spin>
</ModalWrapper>
)
}

@ -38,6 +38,10 @@ function buildColumns(that) {
render: (content, item, index) => {
return <a href="javascript:;">{(that.state.page - 1) * 20 + index + 1}</a>
}
},{
title: '用户ID',
dataIndex: 'login',
key: 'login'
}, {
title: '姓名',
dataIndex: 'name',

@ -118,6 +118,7 @@ class PollDetailIndex extends Component{
className={"font-16"}
checkBoxValues={[this.props.match.params.pollId]}
action={this.getPollInfo}
single={true}
></ImmediatelyPublish>
</li>
:""
@ -133,6 +134,7 @@ class PollDetailIndex extends Component{
className={"font-16"}
checkBoxValues={[this.props.match.params.pollId]}
action={this.getPollInfo}
single={true}
></ImmediatelyEnd>
</li>
:""

@ -63,16 +63,17 @@ class PollDetailTabSecond extends Component{
return(
<div className="edu-back-white mb10">
<div className="pt20 pl30 pr30 pb10">
<span className="font-16">
<span className="mr20 color-grey-6">{parseInt(page-1)*parseInt(limit)+(key+1)}:
<span className="color-grey-9">({map[item.question.question_type]})</span></span>
<span className="color-grey-9">
<span className="font-16 clearfix">
<span className="color-blue fl">{parseInt(page-1)*parseInt(limit)+(key+1)}{map[item.question.question_type]}</span>
{ item.question.is_necessary==1 ? <span className="mustAnswer fl ml10 mr10 mt6">必答</span>:"" }
{ item.question.question_type == 2 ?
<span className="color-grey-9">
{
item.question.min_choices == item.question.max_choices ? "可选"+item.question.max_choices+"项" :
"可选"+item.question.min_choices+"-"+item.question.max_choices+"项"
:""
}
</span>
</span>:""
}
</span>
<p className="mt10 font-16">{item.question.question_title}</p>
</div>

@ -68,15 +68,17 @@ class PollDetailTabThird extends Component{
pollDetail && pollDetail.questions.map((item,key)=>{
return(
<div className="previewList">
<p className="pl30 pr30 pt30 pb15 font-16">
<span className="color-blue mr8">{map[item.question.question_type]}</span><span className="mr10"><span className="color-red">*</span>Q{item.question.question_number}</span>
<span className="color-grey-9">
<p className="pl30 pr30 pt30 pb15 font-16 clearfix">
<span className="color-blue mr8 fl">{item.question.question_number}{map[item.question.question_type]}</span>
{ item.question.is_necessary==1 ? <span className="mustAnswer fl ml10 mr10">必答</span>:"" }
{ item.question.question_type == 2 ?
<span className="color-grey-9">
{
item.question.min_choices == item.question.max_choices ? "可选"+item.question.max_choices+"项" :
"可选"+item.question.min_choices+"-"+item.question.max_choices+"项"
:""
}
</span>
</span>:""
}
</p>
<li className="pl30 pr30 pb15">{item.question.question_title}</li>
{

@ -72,7 +72,7 @@ class ImmediatelyEnd extends Component{
visible:true,
Topval:"学生将不能再提交试卷",
// Botvalleft:"暂不截止",
Botval:`本操作只对"提交中"的分班有效`,
Botval:this.props.single ?`本操作只对"提交中"的分班有效`:"",
// starttime:"发布时间:"+getNowFormatDate(1),
// endtime:"截止时间:"+getNowFormatDate(2),
Cancelname:"暂不截止",
@ -114,7 +114,7 @@ class ImmediatelyEnd extends Component{
visible:true,
Topval:"学生将不能再提交问卷",
// Botvalleft:"暂不截止",
Botval:`本操作只对"提交中"的分班有效`,
Botval:this.props.single ?`本操作只对"提交中"的分班有效`:"",
// starttime:"发布时间:"+getNowFormatDate(1),
// endtime:"截止时间:"+getNowFormatDate(2),
Cancelname:"暂不截止",

@ -80,7 +80,7 @@ class Immediatelypublish extends Component{
visible:true,
Topval:"学生将立即收到试卷",
// Botvalleft:"暂不发布",
Botval:`本操作只对"未发布"的分班有效`,
Botval:this.props.single ? "":`本操作只对"未发布"的分班有效`,
starttime:"发布时间:"+moment(moment(new Date())).format("YYYY-MM-DD HH:mm"),
starttimes:this.props.getNowFormatDates(1),
endtime:"截止时间:"+this.props.getNowFormatDates(2),
@ -119,7 +119,7 @@ class Immediatelypublish extends Component{
visible:true,
Topval:"学生将立即收到问卷",
// Botvalleft:"暂不发布",
Botval:`本操作只对"未发布"的分班有效`,
Botval:this.props.single ? "":`本操作只对"未发布"的分班有效`,
starttime:"发布时间:"+moment(moment(new Date())).format("YYYY-MM-DD HH:mm"),
starttimes:this.props.getNowFormatDates(1),
endtime:"截止时间:"+this.props.getNowFormatDates(2),

@ -9,7 +9,7 @@ import classNames from 'classnames';
// import { Rating,Loading} from '@icedesign/base';
import {getImageUrl, toPath} from 'educoder';
import {getImageUrl,setImagesUrl, toPath} from 'educoder';
// import { Pagination,Row,Col } from 'antd';
@ -94,7 +94,7 @@ class ShixunCard extends Component {
item.tag_name === null ? "":
<div className="tag-green">
<span className="tag-name"> {item.tag_name}</span>
<img style={{display:item.tag_name===null?"none":'block',height: '28px'}} src={require(`./shixunCss/tag2.png`)}/>
<img style={{display:'block',height: '28px'}} src={require(`./shixunCss/tag2.png`)}/>
</div>
}
<div className={item.power === false ? "closeSquare" : "none"}>
@ -105,7 +105,7 @@ class ShixunCard extends Component {
<a href={"/shixuns/"+item.identifier+"/challenges"} target="_blank" className="square-img">
{/*<img src={getImageUrl("images/"+item.pic+"?1540534846")}/>*/}
<img src={item.pic}/>
<img src={setImagesUrl(`${item.pic}`)}/>
</a>
<div className="square-main">

@ -6,7 +6,7 @@ import Loadable from 'react-loadable';
import Loading from '../../../Loading';
import NoneData from '../../courses/coursesPublic/NoneData'
import axios from 'axios';
import {getImageUrl} from 'educoder';
import {getImageUrl,setImagesUrl} from 'educoder';
import { TPMIndexHOC } from '../../tpm/TPMIndexHOC';
import { CNotificationHOC } from '../../courses/common/CNotificationHOC'
import "./usersInfo.css"
@ -168,10 +168,10 @@ class InfosShixun extends Component{
return(
<div className="square-Item" onClick={()=>this.turnToCourses(`/shixuns/${item.identifier}/challenges`)}>
{
item.tag && <div className="tag-green"><span className="tag-name">{item.tag}</span><img src={getImageUrl("/images/educoder/tag2.png")}/></div>
item.tag && <div className="tag-green"><span className="tag-name">{item.tag}</span><img className="fl" src={setImagesUrl("images/educoder/tag2.png")}/></div>
}
<a href="javascript:void(0)" className="square-img">
<img alt="Shixun6" src={`${item.image_url}`}/>
<img src={setImagesUrl(`${item.image_url}`)}/>
</a>
<div className="square-main">
<p className="task-hide">

Loading…
Cancel
Save