Merge branch 'master' of https://bdgit.educoder.net/Hjqreturn/educoder
commit
049daac232
@ -0,0 +1,33 @@
|
||||
import React, { Component } from 'react';
|
||||
import { Modal } from 'antd';
|
||||
// import Notcompleted from './Notcompleted';
|
||||
|
||||
export function SetAppModel(options = {}) {
|
||||
return function wrap(WrappedComponent) {
|
||||
return class Wrapper extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
this.state = {
|
||||
|
||||
}
|
||||
}
|
||||
componentDidMount(){
|
||||
console.log(this.props)
|
||||
}
|
||||
|
||||
render() {
|
||||
const { titlemessage, Modallisttype, Modallist, singleButton } = this.state;
|
||||
|
||||
return (
|
||||
<div>
|
||||
{/*<Notcompleted*/}
|
||||
{/*modalsType={this.state.Notcompleteds}*/}
|
||||
{/*/>*/}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,53 +1,56 @@
|
||||
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, getUrl2 as getUrl2, setImagesUrl as setImagesUrl, getUploadActionUrl as getUploadActionUrl } from './UrlTool';
|
||||
export { default as queryString } from './UrlTool2';
|
||||
|
||||
export { SnackbarHOC as SnackbarHOC } from './SnackbarHOC';
|
||||
|
||||
export { trigger as trigger, on as on, off as off
|
||||
, broadcastChannelPostMessage, broadcastChannelOnmessage } from './EventUtil';
|
||||
|
||||
export { updatePageParams as updatePageParams } from './RouterUtil';
|
||||
|
||||
export { bytesToSize as bytesToSize } from './UnitUtil';
|
||||
|
||||
export { markdownToHTML, uploadNameSizeSeperator, appendFileSizeToUploadFile, appendFileSizeToUploadFileAll, isImageExtension } from './TextUtil'
|
||||
export { handleDateString, getNextHalfHourOfMoment,formatDuring } from './DateUtil'
|
||||
|
||||
|
||||
export { isDev as isDev } from './Env'
|
||||
|
||||
export { toStore as toStore, fromStore as fromStore } from './Store'
|
||||
|
||||
export { trace_collapse, trace, debug, info, warn, error, trace_c, debug_c, info_c, warn_c, error_c } from './LogUtil'
|
||||
|
||||
export { EDU_ADMIN, EDU_BUSINESS, EDU_SHIXUN_MANAGER, EDU_SHIXUN_MEMBER, EDU_CERTIFICATION_TEACHER
|
||||
, EDU_GAME_MANAGER, EDU_TEACHER, EDU_NORMAL} from './Const'
|
||||
|
||||
export { themes, ThemeContext } from './context/ThemeContext'
|
||||
|
||||
export { ModalHOC } from './components/ModalHOC'
|
||||
export { default as Cropper } from './components/Cropper'
|
||||
export { default as ConditionToolTip } from './components/ConditionToolTip'
|
||||
export { default as DragValidator } from './components/DragValidator'
|
||||
|
||||
export { default as PopInstruction } from './components/instruction/PopInstruction'
|
||||
|
||||
export { default as City } from './components/form/City'
|
||||
|
||||
|
||||
// course
|
||||
export { default as WordsBtn } from './course/WordsBtn'
|
||||
|
||||
export { default as ActionBtn } from './course/ActionBtn'
|
||||
|
||||
export { default as MarkdownToHtml } from './components/markdown/MarkdownToHtml'
|
||||
|
||||
export { default as DMDEditor } from './components/markdown/DMDEditor'
|
||||
|
||||
|
||||
|
||||
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, getUrl2 as getUrl2, setImagesUrl as setImagesUrl, getUploadActionUrl as getUploadActionUrl } from './UrlTool';
|
||||
export { default as queryString } from './UrlTool2';
|
||||
|
||||
export { SnackbarHOC as SnackbarHOC } from './SnackbarHOC';
|
||||
|
||||
export { trigger as trigger, on as on, off as off
|
||||
, broadcastChannelPostMessage, broadcastChannelOnmessage } from './EventUtil';
|
||||
|
||||
export { updatePageParams as updatePageParams } from './RouterUtil';
|
||||
|
||||
export { bytesToSize as bytesToSize } from './UnitUtil';
|
||||
|
||||
export { markdownToHTML, uploadNameSizeSeperator, appendFileSizeToUploadFile, appendFileSizeToUploadFileAll, isImageExtension } from './TextUtil'
|
||||
export { handleDateString, getNextHalfHourOfMoment,formatDuring } from './DateUtil'
|
||||
|
||||
|
||||
export { isDev as isDev } from './Env'
|
||||
|
||||
export { toStore as toStore, fromStore as fromStore } from './Store'
|
||||
|
||||
export { trace_collapse, trace, debug, info, warn, error, trace_c, debug_c, info_c, warn_c, error_c } from './LogUtil'
|
||||
|
||||
export { EDU_ADMIN, EDU_BUSINESS, EDU_SHIXUN_MANAGER, EDU_SHIXUN_MEMBER, EDU_CERTIFICATION_TEACHER
|
||||
, EDU_GAME_MANAGER, EDU_TEACHER, EDU_NORMAL} from './Const'
|
||||
|
||||
export { themes, ThemeContext } from './context/ThemeContext'
|
||||
|
||||
export { ModalHOC } from './components/ModalHOC'
|
||||
|
||||
export { SetAppModel } from './components/SetAppModel'
|
||||
|
||||
export { default as Cropper } from './components/Cropper'
|
||||
export { default as ConditionToolTip } from './components/ConditionToolTip'
|
||||
export { default as DragValidator } from './components/DragValidator'
|
||||
|
||||
export { default as PopInstruction } from './components/instruction/PopInstruction'
|
||||
|
||||
export { default as City } from './components/form/City'
|
||||
|
||||
|
||||
// course
|
||||
export { default as WordsBtn } from './course/WordsBtn'
|
||||
|
||||
export { default as ActionBtn } from './course/ActionBtn'
|
||||
|
||||
export { default as MarkdownToHtml } from './components/markdown/MarkdownToHtml'
|
||||
|
||||
export { default as DMDEditor } from './components/markdown/DMDEditor'
|
||||
|
||||
|
||||
|
||||
export { default as ImageLayerHook } from './hooks/ImageLayerHook'
|
@ -1,207 +1,207 @@
|
||||
import React,{ Component } from "react";
|
||||
import { Modal,Radio,Input,Tooltip,Checkbox,Select, Row,Col } from "antd";
|
||||
import axios from 'axios';
|
||||
import { SnackbarHOC } from 'educoder';
|
||||
import Modals from '../../modals/Modals';
|
||||
const Option = Select.Option;
|
||||
const CheckboxGroup = Checkbox.Group;
|
||||
class sendPanel extends Component{
|
||||
constructor(props){
|
||||
super(props);
|
||||
this.state={
|
||||
sentShixunPath:false,
|
||||
sendToCourseList:undefined,
|
||||
openSearch:false,
|
||||
sendToCourseId:undefined,
|
||||
sendToShixunArray:[],
|
||||
shixunNum:0,
|
||||
Modalstype:false,
|
||||
cardsModalcancel:this.cardsModalcancel,
|
||||
cardsModalsave:this.cardsModalsave,
|
||||
modalsTopval:'',
|
||||
Modalsbottomval:'',
|
||||
courseurl:''
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//发送至
|
||||
SentToLesson =() =>{
|
||||
this.setState({
|
||||
sentShixunPath:true
|
||||
})
|
||||
}
|
||||
//隐藏发送至弹框
|
||||
hideSenttothevalue =()=>{
|
||||
this.setState({
|
||||
sentShixunPath:false
|
||||
})
|
||||
}
|
||||
//打开课堂列表下拉框
|
||||
openList=()=>{
|
||||
this.setState({
|
||||
openSearch:true
|
||||
})
|
||||
}
|
||||
//关闭课堂列表下拉框
|
||||
closeList=()=>{
|
||||
this.setState({
|
||||
openSearch:false
|
||||
})
|
||||
}
|
||||
|
||||
// 选择课堂获取选中的Id
|
||||
selectCloseList=(e)=>{
|
||||
this.setState({
|
||||
openSearch:false,
|
||||
sendToCourseId:e
|
||||
})
|
||||
}
|
||||
|
||||
//选择checkbox
|
||||
changeCheckBoxs=(list)=>{
|
||||
this.setState({
|
||||
sendToShixunArray:list,
|
||||
shixunNum:list.length
|
||||
})
|
||||
}
|
||||
|
||||
//确认提交
|
||||
submitInfo=()=>{
|
||||
let {sendToCourseId,sendToShixunArray}=this.state;
|
||||
if(sendToCourseId===undefined){
|
||||
this.props.showSnackbar("您还未选择发送的课堂");
|
||||
}else if(parseInt(sendToShixunArray.length)==0){
|
||||
this.props.showSnackbar("您还未选择实训");
|
||||
}else{
|
||||
let id=this.props.detailInfoList.id;
|
||||
let url="/paths/"+id+"/send_to_course.json";
|
||||
axios.post(url,{
|
||||
shixun_ids:sendToShixunArray,
|
||||
course_id:sendToCourseId
|
||||
}).then((result)=>{
|
||||
if(result.data.status===1){
|
||||
this.setState({
|
||||
Modalstype:true,
|
||||
sentShixunPath:false,
|
||||
Modalstopval:result.data.message,
|
||||
courseurl:result.data.url
|
||||
})
|
||||
}
|
||||
}).catch((error)=>{
|
||||
console.log(error);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
componentDidMount(){
|
||||
let id=this.props.detailInfoList.id;
|
||||
let url="/paths/"+id+"/choose_course.json";
|
||||
axios.get(url).then((result)=>{
|
||||
if(result.status==200){
|
||||
this.setState({
|
||||
sendToCourseList:result.data
|
||||
})
|
||||
}
|
||||
}).catch((error)=>{
|
||||
console.log(error);
|
||||
})
|
||||
}
|
||||
|
||||
cardsModalcancel=()=>{
|
||||
this.setState({
|
||||
Modalstype:false,
|
||||
})
|
||||
}
|
||||
cardsModalsave=()=>{
|
||||
let {courseurl}=this.state;
|
||||
window.location.href = "https://www.educoder.net/"+courseurl;
|
||||
}
|
||||
render(){
|
||||
let{sentShixunPath,sendToCourseList,openSearch,shixunNum,Modalstype,Modalstopval,Modalsbottomval,cardsModalcancel,cardsModalsave}= this.state;
|
||||
return(
|
||||
<div>
|
||||
|
||||
<Modals
|
||||
modalsType={Modalstype}
|
||||
modalsTopval={Modalstopval}
|
||||
modalsBottomval={Modalsbottomval}
|
||||
modalCancel={cardsModalcancel}
|
||||
modalSave={cardsModalsave}
|
||||
>
|
||||
</Modals>
|
||||
{
|
||||
this.props.detailInfoList===undefined?"":this.props.detailInfoList.allow_statistics===true?
|
||||
<Tooltip placement="bottom" title="以实训作业的形式发送到我的课堂">
|
||||
<a onClick = {this.SentToLesson} className="user_default_btn edu-greenline-btn fr font-18 mr20">
|
||||
发送至
|
||||
</a>
|
||||
</Tooltip>:''
|
||||
}
|
||||
|
||||
<Modal
|
||||
keyboard={false}
|
||||
title="发送至课堂"
|
||||
visible={sentShixunPath}
|
||||
closable={false}
|
||||
footer={null}
|
||||
destroyOnClose={true}
|
||||
>
|
||||
<div className="newupload_conbox">
|
||||
<div className="mb20" onMouseLeave={this.closeList}>
|
||||
<Select
|
||||
placeholder="请选择您要发送的课堂"
|
||||
style={{"width":"100%"}}
|
||||
onSelect={this.selectCloseList}
|
||||
onMouseEnter={this.openList}
|
||||
defaultOpen={false}
|
||||
open={openSearch}
|
||||
optionLabelProp="name"
|
||||
>
|
||||
{
|
||||
sendToCourseList === undefined ? "": sendToCourseList.courses.map((item,key)=>{
|
||||
return(
|
||||
<Option key={item.course_id} id={key} name={item.course_name}>
|
||||
<Row>
|
||||
<Col className="fl with70 task-hide">{item.course_name}</Col>
|
||||
<Col className="fl color-grey-9 with30 edu-txt-center">{item.created_at}</Col>
|
||||
</Row>
|
||||
</Option>
|
||||
)
|
||||
})
|
||||
}
|
||||
</Select>
|
||||
</div>
|
||||
<div className="edu-back-skyblue pl15 pr15 clearfix over280 pt5">
|
||||
<CheckboxGroup onChange={this.changeCheckBoxs}>
|
||||
|
||||
{
|
||||
sendToCourseList && sendToCourseList.stages.map((item,key)=>{
|
||||
return(
|
||||
item.shixuns.map((items,keys)=>{
|
||||
return(
|
||||
<div className="mt5" key={keys}>
|
||||
<Checkbox name={key} value={items.shixun_id}>{items.shixun_name}</Checkbox>
|
||||
</div>
|
||||
)
|
||||
})
|
||||
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
</CheckboxGroup>
|
||||
</div>
|
||||
<p className="color-grey-9 pl15 font-12 mt10">已选择 {shixunNum} 个实训</p>
|
||||
<div className="mt20 clearfix edu-txt-center">
|
||||
<a onClick={this.hideSenttothevalue} className="pop_close task-btn mr30">取消</a>
|
||||
<a className="task-btn task-btn-orange" onClick={this.submitInfo}>确定</a>
|
||||
</div>
|
||||
</div>
|
||||
</Modal>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
import React,{ Component } from "react";
|
||||
import { Modal,Radio,Input,Tooltip,Checkbox,Select, Row,Col } from "antd";
|
||||
import axios from 'axios';
|
||||
import { SnackbarHOC } from 'educoder';
|
||||
import Modals from '../../modals/Modals';
|
||||
const Option = Select.Option;
|
||||
const CheckboxGroup = Checkbox.Group;
|
||||
class sendPanel extends Component{
|
||||
constructor(props){
|
||||
super(props);
|
||||
this.state={
|
||||
sentShixunPath:false,
|
||||
sendToCourseList:undefined,
|
||||
openSearch:false,
|
||||
sendToCourseId:undefined,
|
||||
sendToShixunArray:[],
|
||||
shixunNum:0,
|
||||
Modalstype:false,
|
||||
cardsModalcancel:this.cardsModalcancel,
|
||||
cardsModalsave:this.cardsModalsave,
|
||||
modalsTopval:'',
|
||||
Modalsbottomval:'',
|
||||
courseurl:''
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//发送至
|
||||
SentToLesson =() =>{
|
||||
this.setState({
|
||||
sentShixunPath:true
|
||||
})
|
||||
}
|
||||
//隐藏发送至弹框
|
||||
hideSenttothevalue =()=>{
|
||||
this.setState({
|
||||
sentShixunPath:false
|
||||
})
|
||||
}
|
||||
//打开课堂列表下拉框
|
||||
openList=()=>{
|
||||
this.setState({
|
||||
openSearch:true
|
||||
})
|
||||
}
|
||||
//关闭课堂列表下拉框
|
||||
closeList=()=>{
|
||||
this.setState({
|
||||
openSearch:false
|
||||
})
|
||||
}
|
||||
|
||||
// 选择课堂获取选中的Id
|
||||
selectCloseList=(e)=>{
|
||||
this.setState({
|
||||
openSearch:false,
|
||||
sendToCourseId:e
|
||||
})
|
||||
}
|
||||
|
||||
//选择checkbox
|
||||
changeCheckBoxs=(list)=>{
|
||||
this.setState({
|
||||
sendToShixunArray:list,
|
||||
shixunNum:list.length
|
||||
})
|
||||
}
|
||||
|
||||
//确认提交
|
||||
submitInfo=()=>{
|
||||
let {sendToCourseId,sendToShixunArray}=this.state;
|
||||
if(sendToCourseId===undefined){
|
||||
this.props.showSnackbar("您还未选择发送的课堂");
|
||||
}else if(parseInt(sendToShixunArray.length)==0){
|
||||
this.props.showSnackbar("您还未选择实训");
|
||||
}else{
|
||||
let id=this.props.detailInfoList.id;
|
||||
let url="/paths/"+id+"/send_to_course.json";
|
||||
axios.post(url,{
|
||||
shixun_ids:sendToShixunArray,
|
||||
course_id:sendToCourseId
|
||||
}).then((result)=>{
|
||||
if(result.data.status===1){
|
||||
this.setState({
|
||||
Modalstype:true,
|
||||
sentShixunPath:false,
|
||||
Modalstopval:result.data.message,
|
||||
courseurl:result.data.url
|
||||
})
|
||||
}
|
||||
}).catch((error)=>{
|
||||
console.log(error);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
componentDidMount(){
|
||||
let id=this.props.detailInfoList.id;
|
||||
let url="/paths/"+id+"/choose_course.json";
|
||||
axios.get(url).then((result)=>{
|
||||
if(result.status==200){
|
||||
this.setState({
|
||||
sendToCourseList:result.data
|
||||
})
|
||||
}
|
||||
}).catch((error)=>{
|
||||
console.log(error);
|
||||
})
|
||||
}
|
||||
|
||||
cardsModalcancel=()=>{
|
||||
this.setState({
|
||||
Modalstype:false,
|
||||
})
|
||||
}
|
||||
cardsModalsave=()=>{
|
||||
let {courseurl}=this.state;
|
||||
window.location.href =courseurl;
|
||||
}
|
||||
render(){
|
||||
let{sentShixunPath,sendToCourseList,openSearch,shixunNum,Modalstype,Modalstopval,Modalsbottomval,cardsModalcancel,cardsModalsave}= this.state;
|
||||
return(
|
||||
<div>
|
||||
|
||||
<Modals
|
||||
modalsType={Modalstype}
|
||||
modalsTopval={Modalstopval}
|
||||
modalsBottomval={Modalsbottomval}
|
||||
modalCancel={cardsModalcancel}
|
||||
modalSave={cardsModalsave}
|
||||
>
|
||||
</Modals>
|
||||
{
|
||||
this.props.detailInfoList===undefined?"":this.props.detailInfoList.allow_statistics===true?
|
||||
<Tooltip placement="bottom" title="以实训作业的形式发送到我的课堂">
|
||||
<a onClick = {this.SentToLesson} className="user_default_btn edu-greenline-btn fr font-18 mr20">
|
||||
发送至
|
||||
</a>
|
||||
</Tooltip>:''
|
||||
}
|
||||
|
||||
<Modal
|
||||
keyboard={false}
|
||||
title="发送至课堂"
|
||||
visible={sentShixunPath}
|
||||
closable={false}
|
||||
footer={null}
|
||||
destroyOnClose={true}
|
||||
>
|
||||
<div className="newupload_conbox">
|
||||
<div className="mb20" onMouseLeave={this.closeList}>
|
||||
<Select
|
||||
placeholder="请选择您要发送的课堂"
|
||||
style={{"width":"100%"}}
|
||||
onSelect={this.selectCloseList}
|
||||
onMouseEnter={this.openList}
|
||||
defaultOpen={false}
|
||||
open={openSearch}
|
||||
optionLabelProp="name"
|
||||
>
|
||||
{
|
||||
sendToCourseList === undefined ? "": sendToCourseList.courses.map((item,key)=>{
|
||||
return(
|
||||
<Option key={item.course_id} id={key} name={item.course_name}>
|
||||
<Row>
|
||||
<Col className="fl with70 task-hide">{item.course_name}</Col>
|
||||
<Col className="fl color-grey-9 with30 edu-txt-center">{item.created_at}</Col>
|
||||
</Row>
|
||||
</Option>
|
||||
)
|
||||
})
|
||||
}
|
||||
</Select>
|
||||
</div>
|
||||
<div className="edu-back-skyblue pl15 pr15 clearfix over280 pt5">
|
||||
<CheckboxGroup onChange={this.changeCheckBoxs}>
|
||||
|
||||
{
|
||||
sendToCourseList && sendToCourseList.stages.map((item,key)=>{
|
||||
return(
|
||||
item.shixuns.map((items,keys)=>{
|
||||
return(
|
||||
<div className="mt5" key={keys}>
|
||||
<Checkbox name={key} value={items.shixun_id}>{items.shixun_name}</Checkbox>
|
||||
</div>
|
||||
)
|
||||
})
|
||||
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
</CheckboxGroup>
|
||||
</div>
|
||||
<p className="color-grey-9 pl15 font-12 mt10">已选择 {shixunNum} 个实训</p>
|
||||
<div className="mt20 clearfix edu-txt-center">
|
||||
<a onClick={this.hideSenttothevalue} className="pop_close task-btn mr30">取消</a>
|
||||
<a className="task-btn task-btn-orange" onClick={this.submitInfo}>确定</a>
|
||||
</div>
|
||||
</div>
|
||||
</Modal>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
export default SnackbarHOC()(sendPanel);
|
Loading…
Reference in new issue