parent
4946fb3045
commit
d9badc2d95
@ -1,120 +1,122 @@
|
|||||||
import React,{ Component } from "react";
|
import React,{ Component } from "react";
|
||||||
import { Modal,Checkbox,Select,Input,Tooltip} from "antd";
|
import { Modal,Checkbox,Select,Input,Tooltip} from "antd";
|
||||||
import axios from'axios';
|
import axios from'axios';
|
||||||
import ShixunModal from './ShixunModal'
|
import NewShixunModel from '../coursesPublic/NewShixunModel';
|
||||||
|
|
||||||
const Option = Select.Option;
|
const Option = Select.Option;
|
||||||
const Search = Input.Search;
|
const Search = Input.Search;
|
||||||
class ShixunChooseModal extends Component{
|
class ShixunChooseModal extends Component{
|
||||||
constructor(props){
|
constructor(props){
|
||||||
super(props);
|
super(props);
|
||||||
this.state={
|
this.state={
|
||||||
shixunmodal: false,
|
shixunmodal: false,
|
||||||
hometypepvisible: false,
|
hometypepvisible: false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
setVisible = (visible) => {
|
setVisible = (visible) => {
|
||||||
if (visible) {
|
// if (visible) {
|
||||||
this.createCommonWork()
|
// this.createCommonWork()
|
||||||
} else {
|
// } else {
|
||||||
this.setState({ shixunmodal: visible })
|
//
|
||||||
}
|
// }
|
||||||
}
|
this.setState({ shixunmodal: visible })
|
||||||
hidecouseShixunModal = () => {
|
}
|
||||||
this.setVisible(false)
|
hidecouseShixunModal = () => {
|
||||||
}
|
this.setVisible(false)
|
||||||
componentDidMount() {
|
}
|
||||||
|
componentDidMount() {
|
||||||
|
|
||||||
}
|
|
||||||
funshixunmodallist=(search,type,loading,page)=>{
|
}
|
||||||
let{newshixunmodallist}=this.state;
|
funshixunmodallist=(search,type,loading,page)=>{
|
||||||
let newshixunmodallists=[]
|
let{newshixunmodallist}=this.state;
|
||||||
if(page>1){
|
let newshixunmodallists=[]
|
||||||
newshixunmodallists=newshixunmodallist;
|
if(page>1){
|
||||||
}
|
newshixunmodallists=newshixunmodallist;
|
||||||
this.setState({
|
}
|
||||||
hometypepvisible:loading
|
this.setState({
|
||||||
})
|
hometypepvisible:loading
|
||||||
let coursesId=this.props.match.params.coursesId;
|
})
|
||||||
let url = this.props.shixunsUrl || "/courses/"+coursesId+"/homework_commons/shixuns.json";
|
let coursesId=this.props.match.params.coursesId;
|
||||||
|
let url = this.props.shixunsUrl || "/courses/"+coursesId+"/homework_commons/shixuns.json";
|
||||||
axios.get(url, {
|
|
||||||
params: {
|
axios.get(url, {
|
||||||
search: search,
|
params: {
|
||||||
type:type,
|
search: search,
|
||||||
page:page
|
type:type,
|
||||||
}
|
page:page
|
||||||
}).then((result)=>{
|
}
|
||||||
if(result.status===200){
|
}).then((result)=>{
|
||||||
|
if(result.status===200){
|
||||||
let shixun_list=result.data.shixun_list;
|
|
||||||
for(var i=0; i<shixun_list.length;i++){
|
let shixun_list=result.data.shixun_list;
|
||||||
newshixunmodallists.push(shixun_list[i])
|
for(var i=0; i<shixun_list.length;i++){
|
||||||
}
|
newshixunmodallists.push(shixun_list[i])
|
||||||
this.setState({
|
}
|
||||||
shixunmodal:true,
|
this.setState({
|
||||||
shixunmodallist:result.data,
|
shixunmodal:true,
|
||||||
newshixunmodallist:newshixunmodallists,
|
shixunmodallist:result.data,
|
||||||
hometypepvisible:false
|
newshixunmodallist:newshixunmodallists,
|
||||||
})
|
hometypepvisible:false
|
||||||
}
|
})
|
||||||
}).catch((error)=>{
|
}
|
||||||
console.log(error);
|
}).catch((error)=>{
|
||||||
})
|
console.log(error);
|
||||||
}
|
})
|
||||||
funpatheditarry=(list)=>{
|
}
|
||||||
this.setState({
|
funpatheditarry=(list)=>{
|
||||||
patheditarry:list
|
this.setState({
|
||||||
})
|
patheditarry:list
|
||||||
}
|
})
|
||||||
createCommonWork=()=>{
|
}
|
||||||
|
createCommonWork=()=>{
|
||||||
this.setState({
|
|
||||||
hometypepvisible:true,
|
this.setState({
|
||||||
patheditarry:[]
|
hometypepvisible:true,
|
||||||
})
|
patheditarry:[]
|
||||||
|
})
|
||||||
let coursesId=this.props.match.params.coursesId;
|
|
||||||
let url = this.props.shixunsUrl || "/courses/"+coursesId+"/homework_commons/shixuns.json";
|
let coursesId=this.props.match.params.coursesId;
|
||||||
|
let url = this.props.shixunsUrl || "/courses/"+coursesId+"/homework_commons/shixuns.json";
|
||||||
axios.get(url).then((result)=>{
|
|
||||||
if(result.status===200){
|
axios.get(url).then((result)=>{
|
||||||
this.setState({
|
if(result.status===200){
|
||||||
shixunmodal:true,
|
this.setState({
|
||||||
shixunmodallist:result.data,
|
shixunmodal:true,
|
||||||
hometypepvisible:false,
|
shixunmodallist:result.data,
|
||||||
newshixunmodallist:result.data.shixun_list,
|
hometypepvisible:false,
|
||||||
})
|
newshixunmodallist:result.data.shixun_list,
|
||||||
}
|
})
|
||||||
}).catch((error)=>{
|
}
|
||||||
console.log(error);
|
}).catch((error)=>{
|
||||||
})
|
console.log(error);
|
||||||
}
|
})
|
||||||
render(){
|
}
|
||||||
let {Searchvalue,type,category_id, datas, shixunmodal, shixunmodallist
|
render(){
|
||||||
, hometypepvisible, newshixunmodallist, patheditarry }=this.state;
|
let {Searchvalue,type,category_id, datas, shixunmodal, shixunmodallist
|
||||||
let {visible}=this.props;
|
, hometypepvisible, newshixunmodallist, patheditarry }=this.state;
|
||||||
|
let {visible}=this.props;
|
||||||
// console.log(patheditarry)
|
|
||||||
return(
|
// console.log(patheditarry)
|
||||||
<ShixunModal
|
return(
|
||||||
datas={datas}
|
shixunmodal===true?<NewShixunModel
|
||||||
category_id={this.props.match.params.category_id}
|
statustype={'published'}
|
||||||
visible={shixunmodal}
|
datas={datas}
|
||||||
shixunmodallist={shixunmodallist}
|
category_id={this.props.match.params.category_id}
|
||||||
funshixunmodallist={(search,type,loading,page)=>this.funshixunmodallist(search,type,loading,page)}
|
NewShixunModelType={shixunmodal}
|
||||||
hometypepvisible={hometypepvisible}
|
shixunmodallist={shixunmodallist}
|
||||||
hidecouseShixunModal={this.hidecouseShixunModal}
|
funshixunmodallist={(search,type,loading,page)=>this.funshixunmodallist(search,type,loading,page)}
|
||||||
newshixunmodallist={newshixunmodallist}
|
hometypepvisible={hometypepvisible}
|
||||||
coursesId={this.props.match.params.coursesId}
|
hideNewShixunModelType={this.hidecouseShixunModal}
|
||||||
courseshomeworkstart={(category_id,homework_ids)=> this.props.newhomeworkstart
|
newshixunmodallist={newshixunmodallist}
|
||||||
&& this.props.newhomeworkstart(category_id,homework_ids)}
|
coursesId={this.props.match.params.coursesId}
|
||||||
funpatheditarry={(patheditarry)=>this.funpatheditarry(patheditarry)}
|
courseshomeworkstart={(category_id,homework_ids)=> this.props.newhomeworkstart
|
||||||
patheditarry={patheditarry}
|
&& this.props.newhomeworkstart(category_id,homework_ids)}
|
||||||
{...this.props}
|
funpatheditarry={(patheditarry)=>this.funpatheditarry(patheditarry)}
|
||||||
></ShixunModal>
|
patheditarry={patheditarry}
|
||||||
)
|
{...this.props}
|
||||||
}
|
></NewShixunModel>:""
|
||||||
}
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
export default ShixunChooseModal;
|
export default ShixunChooseModal;
|
Loading…
Reference in new issue