资源调整

dev_forum
杨树明 6 years ago
parent f142c7339d
commit 1e99acc02c

@ -8,6 +8,7 @@ import {getUrl} from 'educoder';
import moment from 'moment';
import CoursesListType from '../coursesPublic/CoursesListType';
import Showoldfiles from "../coursesPublic/Showoldfiles";
import Modals from '../../modals/Modals';
class Fileslistitem extends Component{
constructor(props){
@ -74,6 +75,67 @@ class Fileslistitem extends Component{
Showoldfiles:false,
})
}
onDelete = (id) => {
this.setState({
Modalstype:true,
Modalstopval:"是否确认删除?",
ModalCancel:this.cancelmodel,
ModalSave:()=>this.savedelete(id),
})
}
cancelmodel=()=>{
this.setState({
Modalstype:false,
Loadtype:false,
Modalstopval:"",
ModalCancel:"",
ModalSave:"",
checkBoxValues:[],
})
}
savedelete=(id)=>{
this.setState({
Modalstype:false,
})
const cid = this.props.match.params.coursesId
const url = `/files/bulk_delete.json`;
axios.delete(url, { data: {
course_id:cid,
ids: [id],
}})
.then((response) => {
if (response.data.status == 0) {
//Modalstopval:response.data.message,
this.props.updatafiledfun()
this.setState({
// Modalstype:true,
// Modalstopval:"删除成功",
ModalsBottomval:"",
// ModalSave:this.cancelmodel,
// Loadtype:true,
checkBoxValues:[],
checkAllValue:false
})
this.props.showNotification("删除成功");
}
})
.catch(function (error) {
console.log(error);
});
}
render(){
const { checkBox,
@ -84,6 +146,16 @@ class Fileslistitem extends Component{
return(
<div className="graduateTopicList boardsList">
{/*提示*/}
{this.state.Modalstype&&this.state.Modalstype===true?<Modals
modalsType={this.state.Modalstype}
modalsTopval={this.state.Modalstopval}
modalCancel={this.state.ModalCancel}
modalSave={this.state.ModalSave}
modalsBottomval={this.state.ModalsBottomval}
loadtype={this.state.Loadtype}
/>:""}
<Showoldfiles
visible={this.state.Showoldfiles}
allfiles={this.state.allfiles}
@ -178,12 +250,19 @@ class Fileslistitem extends Component{
{this.props.isAdmin ||this.props.current_user.username===discussMessage.author.name?
<span className={"sttingbox"}>
<WordsBtn style="blue" className="colorblue font-16 mr20 fr">
<a className="btn colorblue"
onClick={()=>this.settingList()}>设置</a>
</WordsBtn>
<WordsBtn style="blue" className="colorblue font-16 mr20 fr">
<a className="btn colorblue"
onClick={()=>this.onDelete(discussMessage.id)}>删除</a>
</WordsBtn>
</span>:""}
<div className="cl"></div>
<style>
{
`

@ -106,6 +106,14 @@ class Fileslists extends Component{
})
}
updatafiled=()=>{
debugger
if(this.props.match.params.main_id){
this.seactall();
}else if(this.props.match.params.Id){
this.seactall(parseInt(this.props.match.params.Id),1)
}
}
seactall=(coursesecondcategoryid,type)=>{
this.setState({
@ -243,8 +251,7 @@ class Fileslists extends Component{
.then((response) => {
if (response.data.status == 0) {
//Modalstopval:response.data.message,
this.seactall();
this.updatafiled()
this.setState({
// Modalstype:true,
// Modalstopval:"删除成功",
@ -254,7 +261,6 @@ class Fileslists extends Component{
checkBoxValues:[],
checkAllValue:false
})
this.props.updataleftNavfun()
this.props.showNotification("删除成功");
}
})
@ -519,7 +525,7 @@ class Fileslists extends Component{
checkBoxValues:[],
// checkAllValue:false
})
this.props.updataleftNavfun()
this.updatafiled()
this.props.showNotification('资源移动成功')
}
})
@ -658,7 +664,7 @@ class Fileslists extends Component{
showSearchInput={true}
></Titlesearchsection>
<div className="mt20 edu-back-white padding20-30" style={{display:this.props.isAdmin()||this.props.isStudent()?"":"none"}}>
{this.props.isAdmin()? <div className="mt20 edu-back-white padding20-30" style={{display:this.props.isAdmin()||this.props.isStudent()?"":"none"}}>
<div className="clearfix">
{this.props.isAdmin()? <Checkbox className="fl" onChange={this.onCheckAll} checked={checkAllValue}>已选 {checkBoxValues.length} </Checkbox>:""}
<div className="studentList_operation_ul">
@ -736,7 +742,7 @@ class Fileslists extends Component{
</li>:""}
</div>
</div>
</div>
</div> :""}
<style>{`
.padding02010{
@ -771,6 +777,7 @@ class Fileslists extends Component{
checkBox={<Checkbox value={item.id}></Checkbox>}
Settingtypes={(id)=>this.Settingtypes(id)}
coursesId={this.props.match.params.coursesId}
updatafiledfun={()=>this.updatafiled()}
></Fileslistitem>
</div>
</div>

@ -196,6 +196,7 @@ class Selectresource extends Component{
}
savecouseShixunModal=()=>{
let {patheditarry}=this.state;
let {coursesId,attachmentId}=this.props;
let url="/files/import.json";

@ -181,6 +181,7 @@ class Selectsetting extends Component{
}
savecouseShixunModal=()=>{
debugger
let {fileList,is_public,unified_setting,description,datatime,course_groups}=this.state;
let newfileList=[];
@ -188,7 +189,7 @@ class Selectsetting extends Component{
newfileList.push(list.response.id)
}
if(description===undefined){
if(description===undefined||description===null){
}else if(description.length>100){
this.setState({
@ -512,7 +513,7 @@ class Selectsetting extends Component{
.popups{
padding-left: 20px;
padding-right: 20px;
padding-top: 30px;
padding-top: 20px;
}
`}</style>
<div className="popups">
@ -696,7 +697,7 @@ class Selectsetting extends Component{
id={"startimes"}
className={"Selectleft20"}
width={"200px"}
value={item.publish_time===undefined||item.publish_time===""?"":moment(item.publish_time, dateFormat)}
value={item.publish_time===undefined||item.publish_time===""?"":item.publish_time===null?"":moment(item.publish_time, dateFormat)}
onChange={(e,index)=>this.onChangeTimepublishs(e,index,key)}
// onChange={ this.onChangeTimepublish }
disabledTime={disabledDateTime}
@ -739,7 +740,7 @@ class Selectsetting extends Component{
{/*{this.state.course_group_idtypes===true?<p className={"color-red"}>请选择分班</p>:""}*/}
{/*{course_group_publish_timestype===true?<p className={"color-red mt10"}>请填写完整</p>:""}*/}
<textarea placeholder="请在此输入补交附件的原因最大限制100个字符" className={"mt10"} value={description} onInput={this.settextarea} style={{
<textarea placeholder="请输入资源描述最大限制100个字符" className={"mt10"} value={description} onInput={this.settextarea} style={{
width: '100%',
height:'120px',
border:'1px solid rgba(234,234,234,1)',

@ -566,7 +566,7 @@ class Sendresource extends Component{
border:'1px solid rgba(234,234,234,1)',
padding: '10px'
}}></textarea>
{descriptiontype===true?<p className={"color-red"}>描述不能超过最大限制100个字符</p>:""}
{descriptiontype===true?<p className={"color-red"}>请输入资源描述最大限制100个字符</p>:""}
<div className="clearfix mt30 edu-txt-center mb10">
<a className="task-btn color-white mr70" onClick={this.props.Cancel}>{this.props.Cancelname}</a>
<a className="task-btn task-btn-orange" onClick={()=>this.Saves()}>{this.props.Savesname}</a>

@ -85,11 +85,14 @@ class ExerciseListItem extends Component{
text-overflow: ellipsis;
white-space: nowrap;
}
.homepagePostSetting {
position: absolute;
}
`
}
</style>
<div className="flex1 pr">
<p className="clearfix mb30">
<p className="clearfix mb20">
{/*<Link to={`/courses/${coursesId}/exercises/${item.id}/exercises/student_exercise_list?tab=0`} className="fl font-16 font-bd mt2 color-grey-3 task-hide" style={{"maxWidth":"600px"}}>{item.exercise_name}</Link>*/}
{
@ -161,23 +164,32 @@ class ExerciseListItem extends Component{
{/*item.exercise_status ==2?"":*/}
{/*<span className="mr20 fl"> 发布于{moment(item.exercise_left_time).fromNow()} </span>*/}
{/*}*/}
{ IsAdmin &&<div className="homepagePostSetting" style={{"right":"-17px","top":"51px","display":"block","width":"100px"}}>
<a className="btn colorblue font-16" href={`/courses/${coursesId}/exercises/${item.id}/edit`} target={"_blank"}>编辑</a>
<a className="btn colorblue ml20 font-16" href={`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=3`}>设置</a>
</div> }
</p>
{
IsAdmin &&
<div className="homepagePostSetting" style={{"right":"0px","top":"-5px","position":"absolute","display":"block"}}>
<ul>
<li className="edu-position edu-position-hidebox">
<i className="fa fa-bars color-grey-b"></i>
<ul className="edu-position-hide undis">
<li> <Link className="" to={`/courses/${coursesId}/exercises/${item.id}/edit`}>编辑</Link></li>
<li> <a className="" href={`
/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=3`
}>设置</a></li>
</ul>
</li>
</ul>
</div>
}
{/*{*/}
{/*IsAdmin &&*/}
{/*<div className="homepagePostSetting" style={{"right":"0px","top":"-5px","position":"absolute","display":"block"}}>*/}
{/*<ul>*/}
{/*<li className="edu-position edu-position-hidebox">*/}
{/*<i className="fa fa-bars color-grey-b"></i>*/}
{/*<ul className="edu-position-hide undis">*/}
{/*<li> <Link className="" to={`/courses/${coursesId}/exercises/${item.id}/edit`}>编辑</Link></li>*/}
{/*<li> <a className="" href={`*/}
{/*/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=3`*/}
{/*}>设置</a></li>*/}
{/*</ul>*/}
{/*</li>*/}
{/*</ul>*/}
{/*</div>*/}
{/*}*/}
{
IsStudent &&
<div className="homepagePostSetting" style={{"right":"0px","top":"62px","position":"absolute","display":"block"}}>

@ -234,12 +234,20 @@ class GraduateTaskItem extends Component{
</span>
</p>
<style>
{
`
.mrf4{
margin-right: -4px;
}
`
}
</style>
{this.props.isAdmin?
<div className="mt13">
<WordsBtn style="blue" to={"/courses/"+coursesId+"/graduation_tasks/"+taskid+"/edit"} className="colorblue font-16 mr20 fr">
<WordsBtn style="blue" to={"/courses/"+coursesId+"/graduation_tasks/"+taskid+"/edit"} className="colorblue font-16 mrf4 fr">
<a className="btn colorblue">编辑</a>
</WordsBtn>
<WordsBtn style="blue" to={"/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/"+taskid+"/setting"} className="colorblue font-16 mr20 fr">

Loading…
Cancel
Save