|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
import React,{ Component } from "react";
|
|
|
|
|
import { Link } from "react-router-dom";
|
|
|
|
|
import axios from 'axios';
|
|
|
|
|
import {Checkbox,Modal,Input,Tooltip,notification,Popover} from 'antd';
|
|
|
|
|
import {Checkbox,Modal,Input,Tooltip,notification,Popover,Dropdown,Menu} from 'antd';
|
|
|
|
|
import { DragDropContext,Draggable, Droppable} from 'react-beautiful-dnd';
|
|
|
|
|
import Modals from '../../modals/Modals';
|
|
|
|
|
import { on, off, trigger } from 'educoder';
|
|
|
|
@ -11,7 +11,7 @@ const CheckboxGroup = Checkbox.Group;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let navidtype=true;
|
|
|
|
|
|
|
|
|
|
const { SubMenu } = Menu;
|
|
|
|
|
|
|
|
|
|
//a little function to help us with reordering the result
|
|
|
|
|
const reorder = (list, startIndex, endIndex) => {
|
|
|
|
@ -62,9 +62,13 @@ class Coursesleftnav extends Component{
|
|
|
|
|
antIcon:false,
|
|
|
|
|
chapterupdate:false,
|
|
|
|
|
|
|
|
|
|
successFunc:undefined
|
|
|
|
|
successFunc:undefined,
|
|
|
|
|
|
|
|
|
|
//用来判断 是不是资源点击进入的
|
|
|
|
|
Navmodalziyname:''
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// updataleftNav=()=>{
|
|
|
|
|
//
|
|
|
|
@ -181,8 +185,9 @@ class Coursesleftnav extends Component{
|
|
|
|
|
groupRenameListener = (e, data) => {
|
|
|
|
|
this.Navmodalnames(e,5,"editSecondname", data.id, data.name);
|
|
|
|
|
}
|
|
|
|
|
attachmentAddlog=(e,data)=>{
|
|
|
|
|
this.Navmodalnames(e,1,"attachment",data);
|
|
|
|
|
attachmentAddlog=(e,data,name)=>{
|
|
|
|
|
console.log(data.id,data.name)
|
|
|
|
|
this.Navmodalnames(e,1,"attachment",data.id,data.name);
|
|
|
|
|
}
|
|
|
|
|
flieseditDir=(e, data)=>{
|
|
|
|
|
this.Navmodalnames(e,4,"editSecondname",data.id,data.name);
|
|
|
|
@ -208,7 +213,6 @@ class Coursesleftnav extends Component{
|
|
|
|
|
on('editcommon_homeworks',this.editcommon_homeworks)
|
|
|
|
|
|
|
|
|
|
let courstype=this.props.match.url;
|
|
|
|
|
|
|
|
|
|
courstype = courstype.split('/');
|
|
|
|
|
|
|
|
|
|
courstype=courstype[3];
|
|
|
|
@ -464,6 +468,8 @@ class Coursesleftnav extends Component{
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
edithidden=(e,id)=>{
|
|
|
|
|
e.stopPropagation();//阻止冒泡
|
|
|
|
|
let {course_modules}=this.props;
|
|
|
|
@ -490,6 +496,7 @@ class Coursesleftnav extends Component{
|
|
|
|
|
|
|
|
|
|
Navmodalnames=(e,id,type,setnavid,name)=>{
|
|
|
|
|
e.stopPropagation();//阻止冒泡
|
|
|
|
|
console.log(id)
|
|
|
|
|
navidtype=false
|
|
|
|
|
if(id===1||id===2||id===6){
|
|
|
|
|
this.setState({
|
|
|
|
@ -498,6 +505,7 @@ class Coursesleftnav extends Component{
|
|
|
|
|
Navplaceholder:"请输入名称,最大限制60个字符",
|
|
|
|
|
Navmodalnametype:true,
|
|
|
|
|
Navmodaltypename:id,
|
|
|
|
|
Navmodalziyname:name,
|
|
|
|
|
setnavid:setnavid,
|
|
|
|
|
NavmodalValue:""
|
|
|
|
|
})
|
|
|
|
@ -510,6 +518,7 @@ class Coursesleftnav extends Component{
|
|
|
|
|
Navmodalnametype:true,
|
|
|
|
|
Navmodaltypename:id,
|
|
|
|
|
setnavid:setnavid,
|
|
|
|
|
Navmodalziyname:name,
|
|
|
|
|
NavmodalValue:name
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
@ -548,7 +557,9 @@ class Coursesleftnav extends Component{
|
|
|
|
|
saveNavmodapost=(url,value,positiontype,coursesId,type)=>{
|
|
|
|
|
console.log(positiontype)
|
|
|
|
|
axios.post(url,
|
|
|
|
|
{name:value}).then((result)=>{
|
|
|
|
|
{name:value,
|
|
|
|
|
parent_id:2342
|
|
|
|
|
}).then((result)=>{
|
|
|
|
|
if(result!=undefined){
|
|
|
|
|
if(result.data.status===0){
|
|
|
|
|
|
|
|
|
@ -587,7 +598,6 @@ class Coursesleftnav extends Component{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(positiontype==="files"||positiontype==="file"){
|
|
|
|
|
|
|
|
|
|
if(type===true){
|
|
|
|
|
this.updasaveNavmoda()
|
|
|
|
|
trigger('files')
|
|
|
|
@ -871,6 +881,7 @@ class Coursesleftnav extends Component{
|
|
|
|
|
showsandians=(e,key,urls,num,id,type,index)=> {
|
|
|
|
|
let {url}=this.state;
|
|
|
|
|
if (key === this.props.indexs) {
|
|
|
|
|
|
|
|
|
|
this.props.unlocationNavfun(undefined)
|
|
|
|
|
} else {
|
|
|
|
|
this.props.updataleftNavfun();
|
|
|
|
@ -899,7 +910,7 @@ class Coursesleftnav extends Component{
|
|
|
|
|
{/*/!* 分组作业 *!/*/}
|
|
|
|
|
{item.type==="group_homework"?<div onClick={e=>this.Navmodalnames(e,1,"group_homeworks",item.id)}>新建目录</div>:""}
|
|
|
|
|
{/*资源*/}
|
|
|
|
|
{item.type==="attachment"?<div onClick={e=>this.Navmodalnames(e,1,"attachment",item.id)}>新建目录</div>:""}
|
|
|
|
|
{item.type==="attachment"?<div onClick={e=>this.Navmodalnames(e,1,"attachment",item.id,"资源")}>新建目录</div>:""}
|
|
|
|
|
{/* 视频 */}
|
|
|
|
|
{item.type==="video"?<div onClick={e=>this.Navmodalnames(e,1,"video",item.id)}>新建目录</div>:""}
|
|
|
|
|
{/*毕业设计*/}
|
|
|
|
@ -928,6 +939,7 @@ class Coursesleftnav extends Component{
|
|
|
|
|
let {twosandiantypes,twosandiantypenum}=this.state;
|
|
|
|
|
return (item.type==="graduation"?"": <div className={item.type===twosandiantypes&&twosandiantypenum===index?"sandianboxs":"sandianboxs"} >
|
|
|
|
|
{/*作业/资源*/}
|
|
|
|
|
{item.type==="shixun_homework"||item.type==="attachment"||item.type==="common_homework"||item.type==="group_homework"?<div onClick={e=>this.deleteSecondary(e,1,iem.category_id)}>新建目录</div>:""}
|
|
|
|
|
{item.type==="shixun_homework"||item.type==="attachment"||item.type==="graduation"||item.type==="common_homework"||item.type==="group_homework"?<div onClick={e=>this.Navmodalnames(e,4,"editSecondname",iem.category_id,iem.category_name)}>重命名</div>:""}
|
|
|
|
|
{item.type==="shixun_homework"||item.type==="attachment"||item.type==="common_homework"||item.type==="group_homework"?<div onClick={e=>this.deleteSecondary(e,1,iem.category_id)}>删除</div>:""}
|
|
|
|
|
{/*分班*/}
|
|
|
|
@ -955,7 +967,11 @@ class Coursesleftnav extends Component{
|
|
|
|
|
chapterupdate:false,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
sunmenu=()=>{
|
|
|
|
|
alert(1231)
|
|
|
|
|
}
|
|
|
|
|
render(){
|
|
|
|
|
|
|
|
|
|
let {
|
|
|
|
|
twosandiantype,
|
|
|
|
|
Navmodalname,
|
|
|
|
@ -1035,7 +1051,13 @@ class Coursesleftnav extends Component{
|
|
|
|
|
destroyOnClose={true}
|
|
|
|
|
centered={true}
|
|
|
|
|
>
|
|
|
|
|
<div className="df">
|
|
|
|
|
<div>
|
|
|
|
|
{this.state.Navmodalziyname==="资源"?<div className="df" style={{marginBottom:50}}>
|
|
|
|
|
<div className={"fl mt5"}>上级目录:</div>
|
|
|
|
|
|
|
|
|
|
</div>:''}
|
|
|
|
|
|
|
|
|
|
<div className="df" >
|
|
|
|
|
<div className={"fl mt5"}>{this.state.Navtitles}:</div>
|
|
|
|
|
<Input placeholder={this.state.Navplaceholder}
|
|
|
|
|
className={"input-flex-35 greyInput fl"}
|
|
|
|
@ -1043,6 +1065,7 @@ class Coursesleftnav extends Component{
|
|
|
|
|
value={NavmodalValue}
|
|
|
|
|
onInput={this.setNavmodalValue}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<style>
|
|
|
|
|
{
|
|
|
|
@ -1053,6 +1076,7 @@ class Coursesleftnav extends Component{
|
|
|
|
|
`
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|
|
|
|
|
{this.state.NavmodalValuetype===true?<span className={"ml70 color-red"}>
|
|
|
|
|
{this.state.NavmodalValues}
|
|
|
|
|
</span>:""}
|
|
|
|
|