@ -14,24 +14,24 @@ import TPMRightSection from "../../tpm/component/TPMRightSection";
import styled from "styled-components" ;
import styled from "styled-components" ;
const getItemStyle = ( isDragging , draggableStyle ) => ( {
const getItemStyle = ( isDragging , draggableStyle ) => ( {
// change background colour if dragging
// change background colour if dragging
background : isDragging ? '#dceeff' : '' ,
background : isDragging ? '#dceeff' : '' ,
// styles we need to apply on draggables
// styles we need to apply on draggables
... draggableStyle ,
... draggableStyle ,
} ) ;
} ) ;
const getItems = count =>
const getItems = count =>
Array . from ( { length : count } , ( v , k ) => k ) . map ( k => ( {
Array . from ( { length : count } , ( v , k ) => k ) . map ( k => ( {
id : ` item- ${ k } ` ,
id : ` item- ${ k } ` ,
content : ` item ${ k } `
content : ` item ${ k } `
} ) ) ;
} ) ) ;
// a little function to help us with reordering the result
// a little function to help us with reordering the result
const reorder = ( list , startIndex , endIndex ) => {
const reorder = ( list , startIndex , endIndex ) => {
const result = Array . from ( list ) ;
const result = Array . from ( list ) ;
const [ removed ] = result . splice ( startIndex , 1 ) ;
const [ removed ] = result . splice ( startIndex , 1 ) ;
result . splice ( endIndex , 0 , removed ) ;
result . splice ( endIndex , 0 , removed ) ;
return result ;
return result ;
} ;
} ;
const List = styled . div `
const List = styled . div `
@ -66,90 +66,90 @@ const DragHandle = styled.div`
` ;
` ;
const $ = window . $
const $ = window . $
class PathDetailIndex extends Component {
class PathDetailIndex extends Component {
constructor ( props ) {
constructor ( props ) {
super ( props )
super ( props )
this . state = {
this . state = {
progress : undefined ,
progress : undefined ,
tags : undefined ,
tags : undefined ,
members : undefined ,
members : undefined ,
detailInfoList : undefined ,
detailInfoList : undefined ,
clickdetailInfoListtype : false ,
clickdetailInfoListtype : false ,
Modalstype : false ,
Modalstype : false ,
Modalstopval : undefined ,
Modalstopval : undefined ,
Modalsbottomval : undefined ,
Modalsbottomval : undefined ,
cardsModalcancel : this . cardsModalcancel ,
cardsModalcancel : this . cardsModalcancel ,
cardsModalsave : this . cardsModalsave ,
cardsModalsave : this . cardsModalsave ,
user _id : undefined ,
user _id : undefined ,
loadtype : false ,
loadtype : false ,
courses : undefined ,
courses : undefined ,
items : getItems ( 10 ) ,
items : getItems ( 10 ) ,
pathtopskey : 1
pathtopskey : 1
}
}
this . onDragEnd = this . onDragEnd . bind ( this ) ;
this . onDragEnd = this . onDragEnd . bind ( this ) ;
}
}
onDragEnd ( result ) {
onDragEnd ( result ) {
// dropped outside the list
// dropped outside the list
if ( ! result . destination ) {
if ( ! result . destination ) {
return ;
return ;
}
}
try {
try {
} catch ( e ) {
} catch ( e ) {
}
}
const items = reorder (
const items = reorder (
this . state . members ,
this . state . members ,
result . source . index ,
result . source . index ,
result . destination . index
result . destination . index
) ;
) ;
this . setState ( {
this . setState ( {
detailInfoList : this . state . detailInfoList ,
detailInfoList : this . state . detailInfoList ,
members : items ,
members : items ,
items
items
} ) ;
} ) ;
console . log ( this . state . members )
console . log ( this . state . members )
console . log ( "items 数组数组数组数组" )
console . log ( "items 数组数组数组数组" )
console . log ( items )
console . log ( items )
}
}
cardsModalcancel = ( ) => {
cardsModalcancel = ( ) => {
this . setState ( {
this . setState ( {
Modalstype : false ,
Modalstype : false ,
} )
} )
// TODO 这个是临时处理,还需要优化,这里要看怎么区分处理
// TODO 这个是临时处理,还需要优化,这里要看怎么区分处理
if ( this . state . Modalstopval == '你确定要删除该成员吗?' ) {
if ( this . state . Modalstopval == '你确定要删除该成员吗?' ) {
return ;
return ;
}
}
this . props . history . goBack ( )
this . props . history . goBack ( )
}
}
cardsModalsave = ( ) => {
cardsModalsave = ( ) => {
this . setState ( {
this . setState ( {
Modalstype : false ,
Modalstype : false ,
} )
} )
this . props . history . goBack ( )
this . props . history . goBack ( )
}
}
// 加载markdown
// 加载markdown
updatamakedown = ( id ) => {
updatamakedown = ( id ) => {
setTimeout ( ( ) => {
setTimeout ( ( ) => {
var shixunDescr = window . editormd . markdownToHTML ( id , {
var shixunDescr = window . editormd . markdownToHTML ( id , {
htmlDecode : "style,script,iframe" ,
htmlDecode : "style,script,iframe" ,
taskList : true ,
taskList : true ,
tex : true ,
tex : true ,
flowChart : true ,
flowChart : true ,
sequenceDiagram : true
sequenceDiagram : true
} ) ;
} ) ;
$ ( "#" + id + " p:first" ) . addClass ( "ReactMarkdown" ) ;
$ ( "#" + id + " p:first" ) . addClass ( "ReactMarkdown" ) ;
} , 200 )
} , 200 )
}
}
componentDidMount ( ) {
componentDidMount ( ) {
this . getdatasindex ( )
this . getdatasindex ( )
}
}
getdatasindex = ( key ) => {
getdatasindex = ( key ) => {
let pathid = this . props . match . params . pathId ;
let pathid = this . props . match . params . pathId ;
let url = "/paths/" + pathid + ".json" ;
let url = "/paths/" + pathid + ".json" ;
@ -168,7 +168,7 @@ class PathDetailIndex extends Component{
if ( result . data . allow _visit === true ) {
if ( result . data . allow _visit === true ) {
this . setState ( {
this . setState ( {
detailInfoList : result . data ,
detailInfoList : result . data ,
courses : result . data . courses ,
courses : result . data . courses ,
pathtopskey : key === undefined ? 1 : key ,
pathtopskey : key === undefined ? 1 : key ,
// items: getItems(result.data.members.length),
// items: getItems(result.data.members.length),
} )
} )
@ -205,157 +205,157 @@ class PathDetailIndex extends Component{
} )
} )
}
}
updatadetailInfoList = ( ) => {
updatadetailInfoList = ( ) => {
this . getdatasindex ( ) ;
this . getdatasindex ( ) ;
}
}
clickNewsubscript = ( val ) => {
clickNewsubscript = ( val ) => {
if ( val === 0 ) {
if ( val === 0 ) {
this . setState ( {
this . setState ( {
clickdetailInfoListtype : true
clickdetailInfoListtype : true
} )
} )
} else {
} else {
this . setState ( {
this . setState ( {
clickdetailInfoListtype : false
clickdetailInfoListtype : false
} )
} )
}
}
}
}
timeStamp = ( value ) => {
timeStamp = ( value ) => {
var secondTime = parseInt ( value ) ; // 秒
var secondTime = parseInt ( value ) ; // 秒
var minuteTime = 0 ; // 分
var minuteTime = 0 ; // 分
var hourTime = 0 ; // 小时
var hourTime = 0 ; // 小时
if ( secondTime > 60 ) { //如果秒数大于60, 将秒数转换成整数
if ( secondTime > 60 ) { //如果秒数大于60, 将秒数转换成整数
//获取分钟, 除以60取整数, 得到整数分钟
//获取分钟, 除以60取整数, 得到整数分钟
minuteTime = parseInt ( secondTime / 60 ) ;
minuteTime = parseInt ( secondTime / 60 ) ;
//获取秒数,秒数取佘,得到整数秒数
//获取秒数,秒数取佘,得到整数秒数
secondTime = parseInt ( secondTime % 60 ) ;
secondTime = parseInt ( secondTime % 60 ) ;
//如果分钟大于60, 将分钟转换成小时
//如果分钟大于60, 将分钟转换成小时
if ( minuteTime > 60 ) {
if ( minuteTime > 60 ) {
//获取小时, 获取分钟除以60, 得到整数小时
//获取小时, 获取分钟除以60, 得到整数小时
hourTime = parseInt ( minuteTime / 60 ) ;
hourTime = parseInt ( minuteTime / 60 ) ;
//获取小时后取佘的分, 获取分钟除以60取佘的分
//获取小时后取佘的分, 获取分钟除以60取佘的分
minuteTime = parseInt ( minuteTime % 60 ) ;
minuteTime = parseInt ( minuteTime % 60 ) ;
}
}
}
}
var result = "" + parseInt ( secondTime ) + "秒" ;
var result = "" + parseInt ( secondTime ) + "秒" ;
if ( minuteTime > 0 ) {
if ( minuteTime > 0 ) {
result = "" + parseInt ( minuteTime ) + "分" + result ;
result = "" + parseInt ( minuteTime ) + "分" + result ;
}
}
if ( hourTime > 0 ) {
if ( hourTime > 0 ) {
result = "" + parseInt ( hourTime ) + "小时" + result ;
result = "" + parseInt ( hourTime ) + "小时" + result ;
}
}
return result ;
return result ;
}
}
shanchuallow = ( id ) => {
shanchuallow = ( id ) => {
this . setState ( {
this . setState ( {
user _id : id ,
user _id : id ,
Modalstype : true ,
Modalstype : true ,
Modalstopval : "你确定要删除该成员吗?" ,
Modalstopval : "你确定要删除该成员吗?" ,
cardsModalsave : this . delectshanchuallow ,
cardsModalsave : this . delectshanchuallow ,
loadtype : false
loadtype : false
} )
} )
}
}
delectshanchuallow = ( ) => {
delectshanchuallow = ( ) => {
let { user _id } = this . state ;
let { user _id } = this . state ;
let pathid = this . props . match . params . pathId ;
let pathid = this . props . match . params . pathId ;
let url = "/paths/" + pathid + "/delete_member.json" ;
let url = "/paths/" + pathid + "/delete_member.json" ;
let param = { user _id : user _id } ;
let param = { user _id : user _id } ;
axios . delete ( url , { data : param } ) . then ( ( response ) => {
axios . delete ( url , { data : param } ) . then ( ( response ) => {
if ( response . data . status === 1 ) {
if ( response . data . status === 1 ) {
if ( this . props . current _user . user _id == user _id ) {
if ( this . props . current _user . user _id == user _id ) {
this . props . history . push ( '/paths' )
this . props . history . push ( '/paths' )
return ;
return ;
}
}
this . props . showNotification ( response . data . message )
this . props . showNotification ( response . data . message )
this . setState ( {
this . setState ( {
Modalstype : false ,
Modalstype : false ,
// Modalstopval:response.data.message,
// Modalstopval:response.data.message,
loadtype : false ,
loadtype : false ,
// cardsModalsave:this.cardsModalsave,
// cardsModalsave:this.cardsModalsave,
} )
} )
this . updatadetailInfoList ( ) ;
this . updatadetailInfoList ( ) ;
}
}
} ) . catch ( ( error ) => {
} ) . catch ( ( error ) => {
console . log ( error )
console . log ( error )
} )
} )
}
}
//上移
moveup = ( data ) => {
// console.log(data);
let pathid = this . props . match . params . pathId ;
let url = ` /paths/ ${ pathid } /up_member_position.json ` ;
axios . post ( url , {
user _id : data . id
} ) . then ( ( response ) => {
if ( response . status === 200 ) {
console . log ( "上移" ) ;
// console.log(this.state.detailInfoList.members);
// console.log(response);
//上移
this . setState ( {
moveup = ( data ) => {
detailInfoList : this . state . detailInfoList ,
// console.log(data);
let pathid = this . props . match . params . pathId ;
let url = ` /paths/ ${ pathid } /up_member_position.json ` ;
axios . post ( url , {
user _id : data . id
} ) . then ( ( response ) => {
if ( response . status === 200 ) {
console . log ( "上移" ) ;
// console.log(this.state.detailInfoList.members);
// console.log(response);
this . setState ( {
detailInfoList : this . state . detailInfoList ,
members : response . data . members
members : response . data . members
} ) ;
} ) ;
// console.log(this.state.detailInfoList.members);
// console.log(this.state.detailInfoList.members);
}
}
} ) . catch ( ( error ) => {
} ) . catch ( ( error ) => {
console . log ( error )
console . log ( error )
} )
} )
}
}
//下移
//下移
movedown = ( data ) => {
movedown = ( data ) => {
// console.log(data);
// console.log(data);
let pathid = this . props . match . params . pathId ;
let pathid = this . props . match . params . pathId ;
let url = ` /paths/ ${ pathid } /down_member_position.json ` ;
let url = ` /paths/ ${ pathid } /down_member_position.json ` ;
axios . post ( url , {
axios . post ( url , {
user _id : data . id
user _id : data . id
} ) . then ( ( response ) => {
} ) . then ( ( response ) => {
if ( response . status === 200 ) {
if ( response . status === 200 ) {
console . log ( "下移" ) ;
console . log ( "下移" ) ;
// console.log(this.state.detailInfoList.members);
// console.log(this.state.detailInfoList.members);
// console.log(response);
// console.log(response);
this . setState ( {
this . setState ( {
detailInfoList : this . state . detailInfoList ,
detailInfoList : this . state . detailInfoList ,
members : response . data . members
members : response . data . members
} ) ;
} ) ;
// console.log(this.state.detailInfoList.members);
// console.log(this.state.detailInfoList.members);
}
}
} ) . catch ( ( error ) => {
} ) . catch ( ( error ) => {
console . log ( error )
console . log ( error )
} )
} )
}
}
render ( ) {
render ( ) {
this . updatamakedown ( "shixuns_propaedeutics" ) ;
this . updatamakedown ( "shixuns_propaedeutics" ) ;
this . updatamakedown ( "subject_learning_notes" ) ;
this . updatamakedown ( "subject_learning_notes" ) ;
let { detailInfoList ,
let { detailInfoList ,
clickdetailInfoListtype ,
clickdetailInfoListtype ,
Modalstype ,
Modalstype ,
Modalstopval ,
Modalstopval ,
Modalsbottomval ,
Modalsbottomval ,
cardsModalcancel ,
cardsModalcancel ,
cardsModalsave ,
cardsModalsave ,
loadtype ,
loadtype ,
progress ,
progress ,
members ,
members ,
tags ,
tags ,
courses ,
courses ,
} = this . state
} = this . state
return (
return (
< div className = "newContainer" >
< div className = "newContainer" >
< style >
< style >
{
{
`
`
@ -365,206 +365,206 @@ class PathDetailIndex extends Component{
`
`
}
}
< / s t y l e >
< / s t y l e >
< Modals
< Modals
modalsType = { Modalstype }
modalsType = { Modalstype }
modalsTopval = { Modalstopval }
modalsTopval = { Modalstopval }
modalsBottomval = { Modalsbottomval }
modalsBottomval = { Modalsbottomval }
modalCancel = { cardsModalcancel }
modalCancel = { cardsModalcancel }
modalSave = { cardsModalsave }
modalSave = { cardsModalsave }
loadtype = { loadtype }
loadtype = { loadtype }
>
>
< / M o d a l s >
< / M o d a l s >
< div className = "newMain clearfix" >
< div className = "newMain clearfix" >
< DetailTop { ... this . state } { ... this . props } getdatasindex = { ( key ) => this . getdatasindex ( key ) } > < / D e t a i l T o p >
< DetailTop { ... this . state } { ... this . props } getdatasindex = { ( key ) => this . getdatasindex ( key ) } > < / D e t a i l T o p >
< div className = "educontent clearfix mb80" >
< div className = "educontent clearfix mb80" >
< div className = "with65 fl" >
< div className = "with65 fl" >
< div className = "produce-content mb10" >
< div className = "produce-content mb10" >
< p className = "clearfix mb20" >
< p className = "clearfix mb20" >
< span className = "fl font-18 font-bd" > 简介 < / s p a n >
< span className = "fl font-18 font-bd" > 简介 < / s p a n >
{ /*{detailInfoList===undefined?"":detailInfoList.allow_statistics===true?*/ }
{ /*{detailInfoList===undefined?"":detailInfoList.allow_statistics===true?*/ }
{ /*<Tooltip placement="bottom" title={"编辑"}>*/ }
{ /*<Tooltip placement="bottom" title={"编辑"}>*/ }
{ /*<Link className="fr" to={"/paths/"+this.props.match.params.pathId+"/edit"}>*/ }
{ /*<Link className="fr" to={"/paths/"+this.props.match.params.pathId+"/edit"}>*/ }
{ /*<i className="iconfont icon-bianjidaibeijing font-20 color-green"></i>*/ }
{ /*<i className="iconfont icon-bianjidaibeijing font-20 color-green"></i>*/ }
{ /*</Link>*/ }
{ /*</Link>*/ }
{ /*</Tooltip>*/ }
{ /*</Tooltip>*/ }
{ /*:""*/ }
{ /*:""*/ }
{ /*}*/ }
{ /*}*/ }
< / p >
< / p >
< div className = "color-grey-6 clearfix" >
< div className = "color-grey-6 clearfix" >
< div id = "shixuns_propaedeutics" className = "new_li fl" style = { { "padding" : " 0px" , "textAlign" : "justify;" } } >
< div id = "shixuns_propaedeutics" className = "new_li fl" style = { { "padding" : " 0px" , "textAlign" : "justify;" } } >
{ detailInfoList === undefined ? "" : detailInfoList . description === null ? "" :
{ detailInfoList === undefined ? "" : detailInfoList . description === null ? "" :
< div className = { "markdown-body font-14" } dangerouslySetInnerHTML = { { _ _html : markdownToHTML ( detailInfoList . description ) . replace ( /▁/g , "▁▁▁" ) } } > < / d i v >
< div className = { "markdown-body font-14" } dangerouslySetInnerHTML = { { _ _html : markdownToHTML ( detailInfoList . description ) . replace ( /▁/g , "▁▁▁" ) } } > < / d i v >
}
< / d i v >
< / d i v >
< / d i v >
< DetailCards
{ ... this . props }
{ ... this . state }
updatadetailInfoLists = { this . updatadetailInfoList }
> < / D e t a i l C a r d s >
< / d i v >
< div className = "with35 fr pl20" >
< div className = "edu-back-white mustlearn mb10" >
< p className = "clearfix mb30" >
< span className = "font-16" > 课程须知 < / s p a n >
{ /*{detailInfoList===undefined?"":detailInfoList.allow_statistics===true?*/ }
{ /*<Tooltip placement="bottom" title={"编辑"}>*/ }
{ /*<Link to={"/paths/"+this.props.match.params.pathId+"/edit#learning_notes"} className="fr mtf5">*/ }
{ /*<i className="iconfont icon-bianjidaibeijing font-20 color-green"></i>*/ }
{ /*</Link>*/ }
{ /*</Tooltip>*/ }
{ /*:""*/ }
{ /*}*/ }
< / p >
< div id = "subject_learning_notes" className = "color-grey-6 new_li markdown-body editormd-html-preview justify" >
{ detailInfoList === undefined ? "" : detailInfoList . learning _notes === null ? "" :
< div className = { "markdown-body font-14" } dangerouslySetInnerHTML = { { _ _html : markdownToHTML ( detailInfoList . learning _notes ) . replace ( /▁/g , "▁▁▁" ) } } > < / d i v >
}
}
< / d i v >
< / d i v >
< / d i v >
< / d i v >
{ tags === undefined ? "" : tags === null ? "" :
< / d i v >
< div className = "edu-back-white padding40-20 mb10 relative" >
< p className = "font-16 mb20" > 技能标签 < span className = "color-grey-c" > { tags . length } < / s p a n > < / p >
< DetailCards
{ ... this . props }
< div className = { clickdetailInfoListtype === false ? "newedbox newedboxheight" : "newedbox newminheight" } >
{ ... this . state }
< div className = "clearfix" id = "boxheight" >
updatadetailInfoLists = { this . updatadetailInfoList }
{
> < / D e t a i l C a r d s >
tags && tags . map ( ( item , key ) => {
< / d i v >
return (
< div className = "with35 fr pl20" >
< span value = { key } className = { item . status == true ? "edu-filter-btn29BD8B fl" : "newedu-filter-btn fl" } > { item . tag _name } < / s p a n >
< div className = "edu-back-white mustlearn mb10" >
)
< p className = "clearfix mb30" >
} )
< span className = "font-16" > 课程须知 < / s p a n >
}
{ /*{detailInfoList===undefined?"":detailInfoList.allow_statistics===true?*/ }
< / d i v >
{ /*<Tooltip placement="bottom" title={"编辑"}>*/ }
< / d i v >
{ /*<Link to={"/paths/"+this.props.match.params.pathId+"/edit#learning_notes"} className="fr mtf5">*/ }
{ /*<i className="iconfont icon-bianjidaibeijing font-20 color-green"></i>*/ }
< Tooltip placement = "bottom" title = { "显示全部" } >
{ /*</Link>*/ }
< div className = { tags . length > 20 && clickdetailInfoListtype === false ? "newsubscript mb9 color-grey-9 fr" : "newsubscript mb9 color-grey-9 none" }
{ /*</Tooltip>*/ }
onClick = { ( ) => this . clickNewsubscript ( 0 ) }
{ /*:""*/ }
> < span className = "mr8" > ... < /span><Icon type="caret-down" / >
{ /*}*/ }
< / d i v >
< / p >
< / T o o l t i p >
< div id = "subject_learning_notes" className = "color-grey-6 new_li markdown-body editormd-html-preview justify" >
{ detailInfoList === undefined ? "" : detailInfoList . learning _notes === null ? "" :
< Tooltip placement = "bottom" title = { "收起" } >
< div className = { "markdown-body font-14" } dangerouslySetInnerHTML = { { _ _html : markdownToHTML ( detailInfoList . learning _notes ) . replace ( /▁/g , "▁▁▁" ) } } > < / d i v >
< div className = { clickdetailInfoListtype === false ? "newsubscript mb9 color-grey-9 none" : "newsubscript mb9 color-grey-9 fr" }
}
onClick = { ( ) => this . clickNewsubscript ( 1 ) } > < Icon type = "caret-up" / >
< / d i v >
< / d i v >
< / d i v >
< / T o o l t i p >
{ tags === undefined ? "" : tags === null ? "" :
< div className = "edu-back-white padding40-20 mb10 relative" >
< / d i v >
< p className = "font-16 mb20" > 技能标签 < span className = "color-grey-c" > { tags . length } < / s p a n > < / p >
}
{
< div className = { clickdetailInfoListtype === false ? "newedbox newedboxheight" : "newedbox newminheight" } >
this . props . checkIfLogin ( ) === false ? "" : progress === undefined ? "" : progress === null ? "" :
< div className = "clearfix" id = "boxheight" >
< div className = "edu-back-white myProgress padding40-20 mb10" >
{
< p className = "mb20" >
tags && tags . map ( ( item , key ) => {
< span className = "font-16 mr10" > 关卡数 < / s p a n >
return (
< Tooltip placement = "bottom" title = "已通过关卡数/总关卡数" >
< span value = { key } className = { item . status == true ? "edu-filter-btn29BD8B fl" : "newedu-filter-btn fl" } > { item . tag _name } < / s p a n >
< span className = "color-green" > { progress . my _score } / { progress . all _score } < / s p a n >
)
< / T o o l t i p >
} )
< / p >
}
< p className = "clearfix mb10" >
< / d i v >
< span className = "fl color-green" > 已学 { progress . learned } % < / s p a n >
< / d i v >
< span className = "fr color-grey-9" id = "time-consuming" > 学习耗时 { this . timeStamp ( progress . time ) } < / s p a n >
< / p >
< Tooltip placement = "bottom" title = { "显示全部" } >
< div className = "myProgressNav" > < div className = "myProgressGreen" style = { { "width" : ` ${ progress . learned + "%" } ` } } > < / d i v > < / d i v >
< div className = { tags . length > 20 && clickdetailInfoListtype === false ? "newsubscript mb9 color-grey-9 fr" : "newsubscript mb9 color-grey-9 none" }
< / d i v >
onClick = { ( ) => this . clickNewsubscript ( 0 ) }
}
> < span className = "mr8" > ... < /span><Icon type="caret-down" / >
< / d i v >
{
< / T o o l t i p >
members === undefined ? "" : members === null ? "" :
< div className = "teacherTeam edu-back-white clearfix" id = "subject_members" >
< Tooltip placement = "bottom" title = { "收起" } >
< p className = "font-16 clearfix" > 教学团队 < / p >
< div className = { clickdetailInfoListtype === false ? "newsubscript mb9 color-grey-9 none" : "newsubscript mb9 color-grey-9 fr" }
onClick = { ( ) => this . clickNewsubscript ( 1 ) } > < Icon type = "caret-up" / >
{ members === undefined ?
< / d i v >
members && members . map ( ( item , key ) => {
< / T o o l t i p >
return (
< div className = "teacherTeamItem clearfix df" key = { key } >
< / d i v >
< a href = { item . user _url } target = "_blank" className = "fl" >
}
< img alt = "头像" className = "radius" height = "80" src = { getImageUrl ( ` ${ "images/" + item . image _url } ` ) } width = "80" / >
{
< / a >
this . props . checkIfLogin ( ) === false ? "" : progress === undefined ? "" : progress === null ? "" :
< div className = "edu-back-white myProgress padding40-20 mb10" >
< div className = "fl ml15 flex1" >
< p className = "mb20" >
< p className = "mb10 mt5" > { item . name }
< span className = "font-16 mr10" > 我的进展 < / s p a n >
{ /*{*/ }
< Tooltip placement = "bottom" title = "获得经验值/总经验值" >
{ /* detailInfoList===undefined?"":detailInfoList.allow_add_member===true?*/ }
< span className = "color-green" > { progress . my _score } / { progress . all _score } < / s p a n >
{ /* <a className="fr" onClick={()=>this.shanchuallow(item.id)}><i className="iconfont icon-shanchu color-grey-c font-14 font-n"></i></a>:""*/ }
< / T o o l t i p >
{ /*}*/ }
< / p >
< / p >
< p className = "clearfix mb10" >
< div className = "clearfix" >
< span className = "fl color-green" > 已学 { progress . learned } % < / s p a n >
< p className = "color-grey-9 font-12 fl" > < span className = "mr10" > { item . school } < / s p a n > < s p a n > { i t e m . i d e n t i t y } < / s p a n > < / p >
< span className = "fr color-grey-9" id = "time-consuming" > 学习耗时 { this . timeStamp ( progress . time ) } < / s p a n >
< / d i v >
< / p >
< / d i v >
< div className = "myProgressNav" > < div className = "myProgressGreen" style = { { "width" : ` ${ progress . learned + "%" } ` } } > < / d i v > < / d i v >
< / d i v >
< / d i v >
)
}
} )
: detailInfoList === undefined ? "" : detailInfoList . allow _add _member === true ?
{
members && members . map ( ( item , key ) => {
members === undefined ? "" : members === null ? "" :
return (
< div className = "teacherTeam edu-back-white clearfix" id = "subject_members" >
< div className = "teacherTeamItem clearfix df" key = { key } >
< p className = "font-16 clearfix" > 教学团队 < / p >
< a href = { item . user _url } target = "_blank" className = "fl" >
< img alt = "头像" className = "radius" height = "80" src = { getImageUrl ( ` ${ "images/" + item . image _url } ` ) } width = "80" / >
{ members === undefined ?
< / a >
members && members . map ( ( item , key ) => {
return (
< div className = "fl ml15 flex1" >
< div className = "teacherTeamItem clearfix df" key = { key } >
< p className = "mb10 mt5" > { item . name }
< a href = { item . user _url } target = "_blank" className = "fl" >
{ /* 新增role 判断是否能删除 1 管理员 2 合作者 */ }
< img alt = "头像" className = "radius" height = "80" src = { getImageUrl ( ` ${ "images/" + item . image _url } ` ) } width = "80" / >
< / a >
{
detailInfoList === undefined ? "" : detailInfoList . allow _add _member === true && item . role == 2 ?
< div className = "fl ml15 flex1" >
< a className = "fr" onClick = { ( ) => this . shanchuallow ( item . id ) } > < i className = "iconfont icon-shanchu color-grey-c font-14 font-n" > < / i > < / a > : " "
< p className = "mb10 mt5" > { item . name }
}
{ /*{*/ }
< / p >
{ /* detailInfoList===undefined?"":detailInfoList.allow_add_member===true?*/ }
< div className = "clearfix" >
{ /* <a className="fr" onClick={()=>this.shanchuallow(item.id)}><i className="iconfont icon-shanchu color-grey-c font-14 font-n"></i></a>:""*/ }
< p className = "color-grey-9 font-12 fl" > < span className = "mr10" > { item . school } < / s p a n > < s p a n > { i t e m . i d e n t i t y } < / s p a n > < / p >
{ /*}*/ }
< / d i v >
< / p >
{
< div className = "clearfix" >
detailInfoList === undefined ? "" : detailInfoList . allow _add _member === true ? < div >
< p className = "color-grey-9 font-12 fl" > < span className = "mr10" > { item . school } < / s p a n > < s p a n > { i t e m . i d e n t i t y } < / s p a n > < / p >
{ key != 0 ? < div className = "fr ml15 flex1" > < a onClick = { ( ) => this . moveup ( item ) } > < Tooltip title = "上移" > < i className = "color-green font-18 iconfont icon-xiangshangyi" > < / i > < / T o o l t i p > < / a > < / d i v > : " " }
< / d i v >
{ key + 1 == members . length ? "" : < div className = "fr ml15 flex1 " > < a onClick = { ( ) => this . movedown ( item ) } > < Tooltip title = "下移" > < i className = "color-green font-18 iconfont icon-xiangxiayi" > < / i > < / T o o l t i p > < / a > < / d i v > }
< / d i v >
< / d i v >
< / d i v >
: ""
)
}
} )
: detailInfoList === undefined ? "" : detailInfoList . allow _add _member === true ?
< / d i v >
members && members . map ( ( item , key ) => {
< / d i v >
return (
)
< div className = "teacherTeamItem clearfix df" key = { key } >
} )
< a href = { item . user _url } target = "_blank" className = "fl" >
: members && members . map ( ( item , key ) => {
< img alt = "头像" className = "radius" height = "80" src = { getImageUrl ( ` ${ "images/" + item . image _url } ` ) } width = "80" / >
return (
< / a >
< div className = "teacherTeamItem clearfix df" key = { key } >
< a href = { item . user _url } target = "_blank" className = "fl" >
< div className = "fl ml15 flex1" >
< img alt = "头像" className = "radius" height = "80" src = { getImageUrl ( ` ${ "images/" + item . image _url } ` ) } width = "80" / >
< p className = "mb10 mt5" > { item . name }
< / a >
{ /* 新增role 判断是否能删除 1 管理员 2 合作者 */ }
< div className = "fl ml15 flex1" >
{
< p className = "mb10 mt5" > { item . name }
detailInfoList === undefined ? "" : detailInfoList . allow _add _member === true && item . role == 2 ?
{ /*{*/ }
< a className = "fr" onClick = { ( ) => this . shanchuallow ( item . id ) } > < i className = "iconfont icon-shanchu color-grey-c font-14 font-n" > < / i > < / a > : " "
{ /* detailInfoList===undefined?"":detailInfoList.allow_add_member===true?*/ }
}
{ /* <a className="fr" onClick={()=>this.shanchuallow(item.id)}><i className="iconfont icon-shanchu color-grey-c font-14 font-n"></i></a>:""*/ }
< / p >
{ /*}*/ }
< div className = "clearfix" >
< / p >
< p className = "color-grey-9 font-12 fl" > < span className = "mr10" > { item . school } < / s p a n > < s p a n > { i t e m . i d e n t i t y } < / s p a n > < / p >
< div className = "clearfix" >
< / d i v >
< p className = "color-grey-9 font-12 fl" > < span className = "mr10" > { item . school } < / s p a n > < s p a n > { i t e m . i d e n t i t y } < / s p a n > < / p >
{
< / d i v >
detailInfoList === undefined ? "" : detailInfoList . allow _add _member === true ? < div >
< / d i v >
{ key != 0 ? < div className = "fr ml15 flex1" > < a onClick = { ( ) => this . moveup ( item ) } > < Tooltip title = "上移" > < i className = "color-green font-18 iconfont icon-xiangshangyi" > < / i > < / T o o l t i p > < / a > < / d i v > : " " }
< / d i v >
{ key + 1 == members . length ? "" : < div className = "fr ml15 flex1 " > < a onClick = { ( ) => this . movedown ( item ) } > < Tooltip title = "下移" > < i className = "color-green font-18 iconfont icon-xiangxiayi" > < / i > < / T o o l t i p > < / a > < / d i v > }
)
< / d i v >
} ) }
: ""
}
< / d i v >
}
< / d i v >
< / d i v >
)
< AddCollaborators { ... this . props } { ... this . state } updatadetailInfoLists = { this . updatadetailInfoList } > < / A d d C o l l a b o r a t o r s >
} )
: members && members . map ( ( item , key ) => {
< / d i v >
return (
< / d i v >
< div className = "teacherTeamItem clearfix df" key = { key } >
< / d i v >
< a href = { item . user _url } target = "_blank" className = "fl" >
< img alt = "头像" className = "radius" height = "80" src = { getImageUrl ( ` ${ "images/" + item . image _url } ` ) } width = "80" / >
< / d i v >
< / a >
)
}
< div className = "fl ml15 flex1" >
< p className = "mb10 mt5" > { item . name }
{ /*{*/ }
{ /* detailInfoList===undefined?"":detailInfoList.allow_add_member===true?*/ }
{ /* <a className="fr" onClick={()=>this.shanchuallow(item.id)}><i className="iconfont icon-shanchu color-grey-c font-14 font-n"></i></a>:""*/ }
{ /*}*/ }
< / p >
< div className = "clearfix" >
< p className = "color-grey-9 font-12 fl" > < span className = "mr10" > { item . school } < / s p a n > < s p a n > { i t e m . i d e n t i t y } < / s p a n > < / p >
< / d i v >
< / d i v >
< / d i v >
)
} ) }
< / d i v >
}
< AddCollaborators { ... this . props } { ... this . state } updatadetailInfoLists = { this . updatadetailInfoList } > < / A d d C o l l a b o r a t o r s >
< / d i v >
< / d i v >
< / d i v >
< / d i v >
)
}
}
}
export default PathDetailIndex ;
export default PathDetailIndex ;