Merge branches 'dev_Ysm' and 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_Ysm

# Conflicts:
#	app/controllers/subjects_controller.rb
#	public/react/src/App.js
#	public/react/src/modules/courses/coursesPublic/Addcourses.js
#	public/react/src/modules/modals/Certifiedprofessional.js
#	public/react/src/modules/modals/certfed.css
dev_hs
杨树明 6 years ago
commit c61f3c1e8b

@ -85,6 +85,16 @@ class SubjectsController < ApplicationController
# 合作团队 # 合作团队
@shixuns = @subject.shixuns.published.pluck(:id) @shixuns = @subject.shixuns.published.pluck(:id)
@courses = @subject.courses if @subject.excellent @courses = @subject.courses if @subject.excellent
@members = @subject.subject_members.includes(:user)
shixuns = @subject.shixuns.published.pluck(:id)
challenge_ids = Challenge.where(shixun_id: shixuns).pluck(:id)
# 实训路径中的所有实训标签
@tags = ChallengeTag.where(challenge_id: challenge_ids).pluck(:name).uniq
# 用户获取的实训标签
# @user_tags = @subject.shixuns.map(&:user_tags_name).flatten.uniq
@user_tags = user_shixun_tags challenge_ids, @user.id
@my_subject_progress = @subject.my_subject_progress
# 访问数变更 # 访问数变更
@subject.increment!(:visits) @subject.increment!(:visits)
end end
@ -163,8 +173,9 @@ class SubjectsController < ApplicationController
tag_ids = @shixuns.joins(:shixun_tag_repertoires).pluck(:tag_repertoire_id).uniq tag_ids = @shixuns.joins(:shixun_tag_repertoires).pluck(:tag_repertoire_id).uniq
@tags = TagRepertoire.select([:id, :name]).where(id: tag_ids) @tags = TagRepertoire.select([:id, :name]).where(id: tag_ids)
unless @search.blank? unless params[:search].blank?
@shixuns = @shixuns.where("name like ?", "%#{@search}%") @shixuns = @shixuns.joins(:user).where("shixuns.name like ? or concat(users.lastname, users.firstname) like ?",
"%#{@search}%", "%#{@search}%").distinct
end end
unless @type.nil? || @type == "" || @type == "all" unless @type.nil? || @type == "" || @type == "all"

@ -24,3 +24,25 @@ if @subject.excellent
json.course_status subject_course_status course json.course_status subject_course_status course
end end
end end
json.members @members do |member|
json.partial! 'subject_member', locals: { user: member.user }
json.role member.role
end
# 技能标签
json.tags @tags do |tag|
unless tag.blank?
json.tag_name tag
json.status @user_tags.include?(tag)
end
end
# 我的进展
json.progress do
json.my_score @subject.my_subject_score
json.all_score @subject.all_score
json.learned @subject.my_subject_progress
json.time @subject.my_consume_time
end

@ -198,6 +198,8 @@ function generateNewIndexJsp() {
var result = data.replace('/js/js_min_all.js', `${cdnHost}/react/build/js/js_min_all.js?v=${newVersion}`) var result = data.replace('/js/js_min_all.js', `${cdnHost}/react/build/js/js_min_all.js?v=${newVersion}`)
// .replace('/js/js_min_all_2.js', `${cdnHost}/react/build/js/js_min_all_2.js?v=${newVersion}`) // .replace('/js/js_min_all_2.js', `${cdnHost}/react/build/js/js_min_all_2.js?v=${newVersion}`)
// ${cdnHost} 加了cdn后这个文件里的字体文件加载会有跨域的报错 ../fonts/fontawesome-webfont.eot
// TODO tpi 评测结果关闭也使用了fontawesome
.replace('/css/css_min_all.css', `${cdnHost}/react/build/css/css_min_all.css?v=${newVersion}`) .replace('/css/css_min_all.css', `${cdnHost}/react/build/css/css_min_all.css?v=${newVersion}`)
.replace('/css/iconfont.css', `${cdnHost}/react/build/css/iconfont.css?v=${newVersion}`) .replace('/css/iconfont.css', `${cdnHost}/react/build/css/iconfont.css?v=${newVersion}`)
.replace(/\/js\/create_kindeditor.js/g, `${cdnHost}/react/build/js/create_kindeditor.js?v=${newVersion}`) .replace(/\/js\/create_kindeditor.js/g, `${cdnHost}/react/build/js/create_kindeditor.js?v=${newVersion}`)

@ -306,7 +306,7 @@ class App extends Component {
<Trialapplicationreview {...this.props} {...this.state}></Trialapplicationreview> <Trialapplicationreview {...this.props} {...this.state}></Trialapplicationreview>
<Addcourses {...this.props} {...this.state}/> <Addcourses {...this.props} {...this.state}/>
<AccountProfile {...this.props} {...this.state}/> <AccountProfile {...this.props} {...this.state}/>
{/*<Certifiedprofessional {...this.props} {...this.state} />*/} {/*<Certifiedprofessional {...this.props} {...this.state}/>*/}
<Router> <Router>
<Switch> <Switch>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

@ -213,11 +213,9 @@ class Addcourses extends Component{
student:student student:student
} }
).then((response) => { ).then((response) => {
console.log(217);
console.log(response);
if(response === undefined){ if(response === undefined){
this.setState({ this.setState({
Addcoursestype:false, // Addcoursestype:false,
isSpin:false isSpin:false
}); });
return return
@ -260,7 +258,7 @@ class Addcourses extends Component{
}); });
this.setState({ this.setState({
Addcoursestype:false Addcoursestype:false
}); })
if(Addcoursestype===true){ if(Addcoursestype===true){
this.props.hideAddcoursestype(); this.props.hideAddcoursestype();
} }
@ -275,15 +273,16 @@ class Addcourses extends Component{
// }) // })
} }
this.setState({ this.setState({
Addcoursestype:false,
isSpin:false isSpin:false
}) });
}).catch((error) => { }).catch((error) => {
console.log(error); console.log(error)
console.log("报错了报错报错了");
this.setState({ this.setState({
Addcoursestype:false,
isSpin:false isSpin:false
}) });
}) })
// if(value===0){ // if(value===0){

@ -131,7 +131,7 @@ class Selectsetting extends Component{
getalldata=()=>{ getalldata=()=>{
} }
componentDidUpdate = (prevProps) => { componentDidUpdate = (prevProps) => {
@ -139,9 +139,9 @@ class Selectsetting extends Component{
if ( prevProps.visible != this.props.visible ) { if ( prevProps.visible != this.props.visible ) {
console.log(prevProps) console.log(prevProps)
console.log(this.props) console.log(this.props)
this.setState({ this.setState({
visible:this.props.visible visible:this.props.visible
}) })
this.getalldata() this.getalldata()
} }
@ -205,23 +205,23 @@ class Selectsetting extends Component{
// } // }
// }) // })
// if(unified_setting===false){ // if(unified_setting===false){
// //
// course_groups.forEach((item,key)=>{ // course_groups.forEach((item,key)=>{
// if(item.course_group_id===undefined){ // if(item.course_group_id===undefined){
// this.setState({ // this.setState({
// course_group_idtypes:true // course_group_idtypes:true
// }) // })
// return // return
// } // }
// }) // })
// //
// } // }
let coursesId=this.props.match.params.coursesId; let coursesId=this.props.match.params.coursesId;
let attachmentId=this.props.attachmentId; let attachmentId=this.props.attachmentId;
let url="/files/"+this.props.discussMessageid+".json"; let url="/files/"+this.props.discussMessageid+".json";
// //
axios.put(url,{ axios.put(url,{
course_id:coursesId, course_id:coursesId,
@ -298,7 +298,7 @@ class Selectsetting extends Component{
onAttachmentRemove = (file) => { onAttachmentRemove = (file) => {
// const url = `/attachments/${file.response ? file.response.id : file.uid}.json` // const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
const url = `/attachments/${file.response ? file.response.id : file.uid}.json` const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
axios.delete(url, { axios.delete(url, {
}) })
.then((response) => { .then((response) => {
@ -368,7 +368,7 @@ class Selectsetting extends Component{
newlist.push( { newlist.push( {
course_group_id : undefined, course_group_id : undefined,
publish_time :"" publish_time :""
// moment(new Date()).format('YYYY-MM-DD HH:mm') // moment(new Date()).format('YYYY-MM-DD HH:mm')
}) })
this.setState({ this.setState({
course_groups:newlist course_groups:newlist
@ -381,7 +381,7 @@ class Selectsetting extends Component{
width: 600, width: 600,
// https://github.com/ant-design/ant-design/issues/15505 // https://github.com/ant-design/ant-design/issues/15505
// showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。 // showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。
// showUploadList: false, // showUploadList: false,
action: `${getUrl()}/api/attachments.json`, action: `${getUrl()}/api/attachments.json`,
onChange: this.handleChange, onChange: this.handleChange,
onRemove: this.onAttachmentRemove, onRemove: this.onAttachmentRemove,
@ -463,7 +463,7 @@ class Selectsetting extends Component{
<div className="pl20 pr20" <div className="pl20 pr20"
style={{"Height":"204px"}}> style={{"Height":"204px"}}>
<style>{` <style>{`
.color-grey-9a{color: #9A9A9A !important;} .color-grey-9a{color: #9A9A9A !important;}
@ -487,7 +487,7 @@ class Selectsetting extends Component{
{datalist&&datalist.attachment_histories.length===0?"":<span className={"newcolor-orange fl"}>当前版本</span>} {datalist&&datalist.attachment_histories.length===0?"":<span className={"newcolor-orange fl"}>当前版本</span>}
</li> </li>
<li className="fl edu-txt-left task-hide paddingl5 " <li className="fl edu-txt-left task-hide paddingl5 "
style={{width: '76px'}}> {datalist&&datalist.downloads_count} </li> style={{width: '76px'}}> {datalist&&datalist.downloads_count} </li>
<li className="fl paddingl10 " style={{width: '100px'}}> {datalist&&datalist.quotes} </li> <li className="fl paddingl10 " style={{width: '100px'}}> {datalist&&datalist.quotes} </li>
<li className="fl paddingl10 datastyle"> <li className="fl paddingl10 datastyle">
{moment(datalist&&datalist.created_on).format('YYYY-MM-DD HH:mm')==="Invalid date"?"":moment(datalist&&datalist.created_on).format('YYYY-MM-DD HH:mm')} {moment(datalist&&datalist.created_on).format('YYYY-MM-DD HH:mm')==="Invalid date"?"":moment(datalist&&datalist.created_on).format('YYYY-MM-DD HH:mm')}
@ -495,21 +495,21 @@ class Selectsetting extends Component{
</div> </div>
{datalist&&datalist.attachment_histories.map((item,key)=>{ {datalist&&datalist.attachment_histories.map((item,key)=>{
return( return(
<div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE" key={key}> <div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE" key={key}>
<li className="fl" style={{width: '241px'}}> <li className="fl" style={{width: '241px'}}>
<span className={"isabox"} title={item.title}> {item.title} </span> <span className={"isabox"} title={item.title}> {item.title} </span>
{/*<span className={"newcolor-orange fl"}>当前版本</span>*/} {/*<span className={"newcolor-orange fl"}>当前版本</span>*/}
</li> </li>
<li className="fl edu-txt-left task-hide paddingl5 " <li className="fl edu-txt-left task-hide paddingl5 "
style={{width: '76px'}}> {item.downloads_count} </li> style={{width: '76px'}}> {item.downloads_count} </li>
<li className="fl paddingl10 " style={{width: '100px'}}> {item.quotes} </li> <li className="fl paddingl10 " style={{width: '100px'}}> {item.quotes} </li>
<li className="fl paddingl10 datastyle"> <li className="fl paddingl10 datastyle">
{moment(item.created_on).format('YYYY-MM-DD HH:mm')==="Invalid date"?"":moment(item.created_on).format('YYYY-MM-DD HH:mm')} {moment(item.created_on).format('YYYY-MM-DD HH:mm')==="Invalid date"?"":moment(item.created_on).format('YYYY-MM-DD HH:mm')}
</li> </li>
</div> </div>
) )
})} })}
</div> </div>
<style>{` <style>{`
.popups{ .popups{
@ -571,21 +571,21 @@ class Selectsetting extends Component{
<p className={"winth540"}> <p className={"winth540"}>
{ {
this.state.fileListtype===true? this.state.fileListtype===true?
<div> <div>
<Tooltip placement="bottom" title={ <Tooltip placement="bottom" title={
<pre> <pre>
每次只能上传一个资源<br/>删除下面资源可重新上传 每次只能上传一个资源<br/>删除下面资源可重新上传
</pre> </pre>
}> }>
<Button className="uploadBtns"> <Button className="uploadBtns">
更新版本 更新版本
</Button> </Button>
</Tooltip> </Tooltip>
<span>(单个文件最大150M)</span> <span>(单个文件最大150M)</span>
</div> </div>
:"" :""
} }
<Upload {...uploadProps} fileList={this.state.fileList} className="upload_1"> <Upload {...uploadProps} fileList={this.state.fileList} className="upload_1">
@ -600,121 +600,121 @@ class Selectsetting extends Component{
</p> </p>
{/*<style>*/} {/*<style>*/}
{/*{*/} {/*{*/}
{/*`*/} {/*`*/}
{/*.maxwidth400{*/} {/*.maxwidth400{*/}
{/*max-width: 400px;*/} {/*max-width: 400px;*/}
{/*overflow: hidden;*/} {/*overflow: hidden;*/}
{/*text-overflow: ellipsis;*/} {/*text-overflow: ellipsis;*/}
{/*white-space: nowrap;*/} {/*white-space: nowrap;*/}
{/*}*/} {/*}*/}
{/*`*/} {/*`*/}
{/*}*/} {/*}*/}
{/*</style>*/} {/*</style>*/}
{/*{this.state.fileList.length===0?"":this.state.fileList.map((item,key)=>{*/} {/*{this.state.fileList.length===0?"":this.state.fileList.map((item,key)=>{*/}
{/*return(*/} {/*return(*/}
{/*<p className="color-grey mt10" key={key} >*/} {/*<p className="color-grey mt10" key={key} >*/}
{/*<a className="color-grey fl">*/} {/*<a className="color-grey fl">*/}
{/*<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>*/} {/*<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>*/}
{/*</a>*/} {/*</a>*/}
{/*<span className="mr12 color9B9B maxwidth400 fl" length="58">*/} {/*<span className="mr12 color9B9B maxwidth400 fl" length="58">*/}
{/*{item.name}*/} {/*{item.name}*/}
{/*</span>*/} {/*</span>*/}
{/*<span className="color656565 mt2 color-grey-6 font-12 mr8">*/} {/*<span className="color656565 mt2 color-grey-6 font-12 mr8">*/}
{/*{item.response===undefined?"":isNaN(bytesToSize(item.filesize))?"123":bytesToSize(item.filesize)}*/} {/*{item.response===undefined?"":isNaN(bytesToSize(item.filesize))?"123":bytesToSize(item.filesize)}*/}
{/*</span>*/} {/*</span>*/}
{/*<i className="font-14 iconfont icon-guanbi "*/} {/*<i className="font-14 iconfont icon-guanbi "*/}
{/*id={item.response===undefined?"":item.response.id}*/} {/*id={item.response===undefined?"":item.response.id}*/}
{/*aria-hidden="true" onClick={()=>this.onAttachmentRemove(item.response===undefined?"":item.response.id&&item.response.id)}></i>*/} {/*aria-hidden="true" onClick={()=>this.onAttachmentRemove(item.response===undefined?"":item.response.id&&item.response.id)}></i>*/}
{/*</p>*/} {/*</p>*/}
{/*)*/} {/*)*/}
{/*})}*/} {/*})}*/}
{this.state.newfileListtypes===true?<p className={"color-red"}>请先上传资源</p>:""} {this.state.newfileListtypes===true?<p className={"color-red"}>请先上传资源</p>:""}
{/*<p className={"winth540"}>*/} <p className={"winth540"}>
{/*<style>{`*/} <style>{`
{/*.ant-checkbox-wrapper{*/} .ant-checkbox-wrapper{
{/*margin-left:0px !important;*/} margin-left:0px !important;
{/*margin-top:10px;*/} margin-top:10px;
{/*}*/} }
{/*`}</style>*/} `}</style>
{/*<div className={this.state.fileListtype===true?"mt30":""}>*/}
{/*<Checkbox*/}
{/*checked={is_public}*/}
{/*onChange={this.onChangepublics}>*/}
{/*<span className={"font-14"}>勾选后所有用户可见,否则仅课堂成员可见</span>*/}
{/*</Checkbox>*/}
{/*</div>*/}
{/*/!*{this.props.has_course_groups&&this.props.has_course_groups===true?:""}*!/*/}
{/*/!*{this.state.course_groupss&&this.state.course_groupss.length>0?<Checkbox*!/*/}
{/*/!*checked={unified_setting}*!/*/}
{/*/!*onChange={this.onChangesettings}>*!/*/}
{/*/!*<span>统一设置</span><span className={"font-14 color-grey-9"}>(选中则所有分班使用相同的发布设置,否则各个单独设置)</span>*!/*/}
{/*/!*</Checkbox>:""}*!/*/}
{/*<style>*/}
{/*{`*/}
{/*.Selectleft20{*/}
{/*margin-left: 20px !important;*/}
{/*width: 176px;*/}
{/*height: 40px; */}
{/*}*/}
{/*.resourcebox{*/}
{/*max-height:150px;*/}
{/*overflow: auto;*/}
{/*}*/}
{/*`}*/}
{/*</style>*/}
{/*/!*this.props.has_course_groups&&this.props.has_course_groups===true?:""*!/*/}
{/*<div className={"resourcebox"}>*/}
{/*{unified_setting===false?*/}
{/*this.state.course_groups&&this.state.course_groups.map((item,key)=>{*/}
{/*return(*/}
{/*<div className={"mt10 "} key={key}>*/}
{/*<Select placeholder="请选择分班名称"*/}
{/*value={item.course_group_id}*/}
{/*style={{ width: 200 }}*/}
{/*onChange={(e,index)=>this.selectassigngroups(e,index,key)}*/}
{/*>*/}
{/*{ this.state.course_groupss&&this.state.course_groupss.map((item,key)=>{*/}
{/*return(*/}
{/*<Option value={item.id} key={key}>{item.name}</Option>*/}
{/*)*/}
{/*})}*/}
{/*</Select>*/}
{/*<DatePicker*/}
{/*showToday={false}*/}
{/*dropdownClassName="hideDisable"*/}
{/*showTime={{ format: 'HH:mm' }}*/}
{/*format="YYYY-MM-DD HH:mm"*/}
{/*locale={locale}*/}
{/*placeholder="请选择发布时间"*/}
{/*id={"startimes"}*/}
{/*className={"Selectleft20"}*/}
{/*width={"200px"}*/}
{/*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}*/}
{/*disabledDate={disabledDate}*/}
{/*/>*/}
{/*{key!=0?<i className="iconfont icon-shanchu color-grey-c font-14 font-n ml20" onClick={()=>this.deletegrouppublish(key)}></i>:""}*/}
{/*{key===course_groups.length-1?<i className="iconfont icon-tianjiafangda color-green ml15" onClick={this.addgrouppublish}></i>:""}*/}
{/*</div>*/}
{/*)*/}
{/*}):""}*/}
{/*</div>*/}
{/*</p>*/} <div className={this.state.fileListtype===true?"mt30":""}>
<Checkbox
checked={is_public}
onChange={this.onChangepublics}>
<span className={"font-14"}>勾选后所有用户可见否则仅课堂成员可见</span>
</Checkbox>
</div>
{/*{this.props.has_course_groups&&this.props.has_course_groups===true?:""}*/}
{/*{this.state.course_groupss&&this.state.course_groupss.length>0?<Checkbox*/}
{/*checked={unified_setting}*/}
{/*onChange={this.onChangesettings}>*/}
{/*<span>统一设置</span><span className={"font-14 color-grey-9"}>(选中则所有分班使用相同的发布设置,否则各个单独设置)</span>*/}
{/*</Checkbox>:""}*/}
<style>
{`
.Selectleft20{
margin-left: 20px !important;
width: 176px;
height: 40px;
}
.resourcebox{
max-height:150px;
overflow: auto;
}
`}
</style>
{/*this.props.has_course_groups&&this.props.has_course_groups===true?:""*/}
<div className={"resourcebox"}>
{unified_setting===false?
this.state.course_groups&&this.state.course_groups.map((item,key)=>{
return(
<div className={"mt10 "} key={key}>
<Select placeholder="请选择分班名称"
value={item.course_group_id}
style={{ width: 200 }}
onChange={(e,index)=>this.selectassigngroups(e,index,key)}
>
{ this.state.course_groupss&&this.state.course_groupss.map((item,key)=>{
return(
<Option value={item.id} key={key}>{item.name}</Option>
)
})}
</Select>
<DatePicker
showToday={false}
dropdownClassName="hideDisable"
showTime={{ format: 'HH:mm' }}
format="YYYY-MM-DD HH:mm"
locale={locale}
placeholder="请选择发布时间"
id={"startimes"}
className={"Selectleft20"}
width={"200px"}
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}
disabledDate={disabledDate}
/>
{key!=0?<i className="iconfont icon-shanchu color-grey-c font-14 font-n ml20" onClick={()=>this.deletegrouppublish(key)}></i>:""}
{key===course_groups.length-1?<i className="iconfont icon-tianjiafangda color-green ml15" onClick={this.addgrouppublish}></i>:""}
</div>
)
}):""}
</div>
</p>
<style> <style>
{` {`
#startime .ant-calendar-picker-icon{ #startime .ant-calendar-picker-icon{
@ -723,22 +723,22 @@ class Selectsetting extends Component{
`} `}
</style> </style>
{unified_setting===true? {unified_setting===true?
<p className={this.state.fileListtype===true?"mt30":""}> <p className={"mt10"}>
<span> <span>
<DatePicker <DatePicker
showToday={false} showToday={false}
dropdownClassName="hideDisable" dropdownClassName="hideDisable"
showTime={{ format: 'HH:mm' }} showTime={{ format: 'HH:mm' }}
format="YYYY-MM-DD HH:mm" format="YYYY-MM-DD HH:mm"
locale={locale} locale={locale}
placeholder="请选择发布时间" placeholder="请选择发布时间"
id={"startime"} id={"startime"}
width={"210px"} width={"210px"}
value={datatime===undefined||datatime===""?"":moment(datatime, dateFormat)} value={datatime===undefined||datatime===""?"":moment(datatime, dateFormat)}
onChange={this.onChangeTimepublish} onChange={this.onChangeTimepublish}
disabledTime={disabledDateTime} disabledTime={disabledDateTime}
disabledDate={disabledDate} disabledDate={disabledDate}
/> />
</span> </span>
</p>:""} </p>:""}
{/*{this.state.course_group_idtypes===true?<p className={"color-red"}>请选择分班</p>:""}*/} {/*{this.state.course_group_idtypes===true?<p className={"color-red"}>请选择分班</p>:""}*/}

@ -8,18 +8,18 @@ import moment from 'moment';
const CheckboxGroup = Checkbox.Group; const CheckboxGroup = Checkbox.Group;
const Option = Select.Option; const Option = Select.Option;
function range(start, end) { function range(start, end) {
const result = []; const result = [];
for (let i = start; i < end; i++) { for (let i = start; i < end; i++) {
result.push(i); result.push(i);
} }
return result; return result;
} }
function disabledDateTime() { function disabledDateTime() {
return { return {
// disabledHours: () => range(0, 24).splice(4, 20), // disabledHours: () => range(0, 24).splice(4, 20),
disabledMinutes: () => range(1, 30).concat(range(31, 60)), disabledMinutes: () => range(1, 30).concat(range(31, 60)),
// disabledSeconds: () => [0, 60], // disabledSeconds: () => [0, 60],
}; };
} }
function disabledDate(current) { function disabledDate(current) {
@ -29,63 +29,63 @@ function disabledDate(current) {
const dateFormat="YYYY-MM-DD HH:mm"; const dateFormat="YYYY-MM-DD HH:mm";
class Sendresource extends Component{ class Sendresource extends Component{
constructor(props){ constructor(props){
super(props); super(props);
this.state={ this.state={
group_ids:[], group_ids:[],
fileList:[], fileList:[],
Modalstype:false, Modalstype:false,
Modalstopval:"", Modalstopval:"",
ModalCancel:"", ModalCancel:"",
ModalSave:"", ModalSave:"",
fileListtype:false, fileListtype:false,
loadtype:false, loadtype:false,
is_unified_setting:true, is_unified_setting:true,
is_public:false, is_public:false,
datatime:undefined, datatime:undefined,
// moment(new Date()).format('YYYY-MM-DD HH:mm:ss'), // moment(new Date()).format('YYYY-MM-DD HH:mm:ss'),
course_group_publish_times:[ course_group_publish_times:[
{ {
course_group_id : undefined, course_group_id : undefined,
publish_time :"" publish_time :""
}], }],
course_groups:undefined, course_groups:undefined,
course_groups_count:undefined course_groups_count:undefined
} }
} }
componentDidMount() { componentDidMount() {
let coursesId=this.props.match.params.coursesId; let coursesId=this.props.match.params.coursesId;
if(this.props.isAdmin()){ if(this.props.isAdmin()){
let url = `/courses/${coursesId}/all_course_groups.json` let url = `/courses/${coursesId}/all_course_groups.json`
axios.get(url, { axios.get(url, {
}) })
.then((response) => { .then((response) => {
this.setState({ this.setState({
course_groups: response.data.course_groups, course_groups: response.data.course_groups,
course_groups_count:response.data.course_groups_count course_groups_count:response.data.course_groups_count
}) })
}) })
.catch(function (error) { .catch(function (error) {
console.log(error); console.log(error);
}); });
} }
} }
//勾选实训 //勾选实训
shixunhomeworkedit=(list)=>{ shixunhomeworkedit=(list)=>{
this.setState({ this.setState({
group_ids:list group_ids:list
}) })
} }
// 附件相关 START // 附件相关 START
handleChange = (info) => { handleChange = (info) => {
let fileList = info.fileList; let fileList = info.fileList;
if(info.file.status!="removed"){ if(info.file.status!="removed"){
@ -98,280 +98,280 @@ class Sendresource extends Component{
fileList: appendFileSizeToUploadFileAll(fileList), fileList: appendFileSizeToUploadFileAll(fileList),
}); });
} }
} }
// onAttachmentRemove = (file) => { // onAttachmentRemove = (file) => {
// //
// this.setState({ // this.setState({
// fileListtype:false, // fileListtype:false,
// }) // })
// // confirm({ // // confirm({
// // title: '确定要删除这个附件吗?', // // title: '确定要删除这个附件吗?',
// // okText: '确定', // // okText: '确定',
// // cancelText: '取消', // // cancelText: '取消',
// // // content: 'Some descriptions', // // // content: 'Some descriptions',
// // onOk: () => { // // onOk: () => {
// // this.deleteAttachment(file) // // this.deleteAttachment(file)
// // }, // // },
// // onCancel() { // // onCancel() {
// // console.log('Cancel'); // // console.log('Cancel');
// // }, // // },
// // }); // // });
// // return false; // // return false;
// //
// // this.setState({ // // this.setState({
// // Modalstype:true, // // Modalstype:true,
// // Modalstopval:'确定要删除这个附件吗?', // // Modalstopval:'确定要删除这个附件吗?',
// // ModalSave: ()=>this.deleteAttachment(file), // // ModalSave: ()=>this.deleteAttachment(file),
// // ModalCancel:this.cancelAttachment // // ModalCancel:this.cancelAttachment
// // }) // // })
// // return false; // // return false;
// //
// this.deleteAttachment(file); // this.deleteAttachment(file);
// } // }
onAttachmentRemove = (file) => { onAttachmentRemove = (file) => {
const url = `/attachments/${file.response ? file.response.id : file.uid}.json` const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
axios.delete(url, { axios.delete(url, {
}) })
.then((response) => { .then((response) => {
if (response.data) { if (response.data) {
const { status } = response.data; const { status } = response.data;
if (status == 0) { if (status == 0) {
this.setState({ this.setState({
fileListtype:false, fileListtype:false,
fileList:[] fileList:[]
}) })
} }
} }
}) })
.catch(function (error) { .catch(function (error) {
console.log(error); console.log(error);
}); });
this.setState({
fileListtype:false,
})
}
ModalCancelModalCancel=()=>{
this.setState({
Modalstype:false,
Modalstopval:"",
ModalSave:this.ModalCancelModalCancel,
loadtype:false
})
this.props.Cancel()
}
Saves=()=>{
let id=this.props.categoryid;
let {fileList,description,is_public,is_unified_setting,datatime,course_group_publish_times} =this.state;
let newfileList=[];
for(var list of fileList){
newfileList.push(list.response.id)
}
if(newfileList.length===0){
this.setState({ this.setState({
fileListtype:false, newfileListtype:true
}) })
} return
}
ModalCancelModalCancel=()=>{ // if(is_unified_setting===false){
this.setState({ // course_group_publish_times.forEach((item,key)=>{
Modalstype:false, // if(item.course_group_id===undefined||item.publish_time===undefined){
Modalstopval:"", // this.setState({
ModalSave:this.ModalCancelModalCancel, // course_group_publish_timestype:true
loadtype:false // })
}) // return
this.props.Cancel() // }
} // })
Saves=()=>{ //
// }
let id=this.props.categoryid;
let {fileList,description,is_public,is_unified_setting,datatime,course_group_publish_times} =this.state;
let newfileList=[]; if(description===undefined){
for(var list of fileList){
newfileList.push(list.response.id) }else if(description.length>100){
}
this.setState({
if(newfileList.length===0){ descriptiontype:true
this.setState({ })
newfileListtype:true return
}) }
return
} let coursesId=this.props.match.params.coursesId;
// if(is_unified_setting===false){ let attachmentId=this.props.attachmentId;
// course_group_publish_times.forEach((item,key)=>{ let url="/files/upload.json";
// if(item.course_group_id===undefined||item.publish_time===undefined){
// this.setState({
// course_group_publish_timestype:true axios.post(url,{
// }) course_id:coursesId,
// return course_second_category_id:this.props.coursesidtype===undefined||this.props.coursesidtype==="node"?0:attachmentId,
// } attachment_ids:newfileList,
// }) is_public:is_public,
// is_unified_setting:is_unified_setting,
// } publish_time:is_unified_setting===true?datatime===undefined? moment(new Date()).format('YYYY-MM-DD HH:mm'):datatime:undefined,
description:description,
course_group_publish_times:is_unified_setting===false?course_group_publish_times:undefined
}).then((result)=>{
if(description===undefined){
if(result.data.status===0){
}else if(description.length>100){ // this.setState({
// Modalstype:true,
this.setState({ // Modalstopval:result.data.message,
descriptiontype:true // ModalSave:this.ModalCancelModalCancel,
}) // loadtype:true
return // })
} this.ModalCancelModalCancel();
this.props.updataleftNavfun();
let coursesId=this.props.match.params.coursesId; // this.props.showNotification(result.data.message);
let attachmentId=this.props.attachmentId; this.props.showNotification("上传资源成功");
let url="/files/upload.json"; this.props.setupdate(this.props.attachmentId)
}
})
axios.post(url,{
course_id:coursesId,
course_second_category_id:this.props.coursesidtype===undefined||this.props.coursesidtype==="node"?0:attachmentId,
attachment_ids:newfileList, }
is_public:is_public,
is_unified_setting:is_unified_setting, settextarea=(e)=>{
publish_time:is_unified_setting===true?datatime===undefined? moment(new Date()).format('YYYY-MM-DD HH:mm'):datatime:undefined, this.setState({
description:description, description:e.target.value
course_group_publish_times:is_unified_setting===false?course_group_publish_times:undefined })
}).then((result)=>{ }
if(result.data.status===0){ onChangesetting=(e)=>{
// this.setState({
// Modalstype:true, this.setState({
// Modalstopval:result.data.message, is_unified_setting:e.target.checked
// ModalSave:this.ModalCancelModalCancel, })
// loadtype:true
// }) }
this.ModalCancelModalCancel();
this.props.updataleftNavfun(); onChangepublic=(e)=>{
// this.props.showNotification(result.data.message);
this.props.showNotification("上传资源成功"); this.setState({
this.props.setupdate(this.props.attachmentId) is_public:e.target.checked
} })
})
}
onChangeTimepublish= (date, dateString,key,type) => {
} if(type===1){
this.setState({
settextarea=(e)=>{ datatime:handleDateString(dateString),
this.setState({ })
description:e.target.value }else if(type===2){
}) let {course_group_publish_times}=this.state;
} let newgroup_publish=course_group_publish_times;
for(var i=0; i<newgroup_publish.length; i++){
onChangesetting=(e)=>{ if(i===parseInt(key)){
newgroup_publish[i].publish_time=handleDateString(dateString);
this.setState({ }
is_unified_setting:e.target.checked }
}) this.setState({
course_group_publish_times:newgroup_publish,
} })
}
onChangepublic=(e)=>{
}
this.setState({
is_public:e.target.checked selectassigngroups=(e,index,key)=>{
}) let {course_group_publish_times}=this.state;
let newgroup_publish=course_group_publish_times;
} for(var i=0; i<newgroup_publish.length; i++){
if(i===parseInt(key)){
onChangeTimepublish= (date, dateString,key,type) => { newgroup_publish[i].course_group_id=index.props.value;
if(type===1){ }
this.setState({ }
datatime:handleDateString(dateString), this.setState({
}) course_group_publish_times:newgroup_publish,
}else if(type===2){ })
let {course_group_publish_times}=this.state; }
let newgroup_publish=course_group_publish_times;
for(var i=0; i<newgroup_publish.length; i++){ deletegrouppublish=(key)=>{
if(i===parseInt(key)){ let newlist=this.state.course_group_publish_times;
newgroup_publish[i].publish_time=handleDateString(dateString); newlist.splice(key,1);
} this.setState({
} course_group_publish_times:newlist
this.setState({ })
course_group_publish_times:newgroup_publish, }
})
} addgrouppublish=()=>{
let newlist=this.state.course_group_publish_times;
} newlist.push( {
course_group_id : undefined,
selectassigngroups=(e,index,key)=>{ publish_time :undefined
let {course_group_publish_times}=this.state; })
let newgroup_publish=course_group_publish_times; this.setState({
for(var i=0; i<newgroup_publish.length; i++){ course_group_publish_times:newlist
if(i===parseInt(key)){ })
newgroup_publish[i].course_group_id=index.props.value; }
}
} render(){
this.setState({ let {settextarea,newfileListtype,descriptiontype,
course_group_publish_times:newgroup_publish, course_group_publish_timestype,
}) Modalstopval,
} ModalCancel,
ModalSave,
deletegrouppublish=(key)=>{ loadtype,
let newlist=this.state.course_group_publish_times; is_unified_setting,
newlist.splice(key,1); is_public,
this.setState({ datatime,
course_group_publish_times:newlist course_group_publish_times,
}) course_groups
} }=this.state;
addgrouppublish=()=>{ const uploadProps = {
let newlist=this.state.course_group_publish_times; width: 600,
newlist.push( { // showUploadList:false,
course_group_id : undefined, action: `${getUrl()}/api/attachments.json`,
publish_time :undefined onChange: this.handleChange,
}) onRemove: this.onAttachmentRemove,
this.setState({ beforeUpload: (file) => {
course_group_publish_times:newlist // console.log('beforeUpload', file.name);
}) const isLt150M = file.size / 1024 / 1024 < 150;
} if (!isLt150M) {
message.error('文件大小必须小于150MB!');
render(){ }
let {settextarea,newfileListtype,descriptiontype, return isLt150M;
course_group_publish_timestype, },
Modalstopval, };
ModalCancel,
ModalSave, return(
loadtype, <div>
is_unified_setting, {/*提示*/}
is_public, <Modals
datatime, modalsType={this.state.Modalstype}
course_group_publish_times, modalsTopval={this.state.Modalstopval}
course_groups modalCancel={this.state.ModalCancel}
}=this.state; modalSave={this.state.ModalSave}
loadtype= {this.state.loadtype}
const uploadProps = {
width: 600, />
// showUploadList:false,
action: `${getUrl()}/api/attachments.json`, <Modal
onChange: this.handleChange, keyboard={false}
onRemove: this.onAttachmentRemove, className={"HomeworkModal"}
beforeUpload: (file) => { title={this.props.modalname}
// console.log('beforeUpload', file.name); visible={this.props.visible}
const isLt150M = file.size / 1024 / 1024 < 150; closable={false}
if (!isLt150M) { footer={null}
message.error('文件大小必须小于150MB!'); destroyOnClose={true}
} >
return isLt150M; <div className="task-popup-content">
}, <p className="task-popup-text-center font-16">
};
<span className={"color-blue underline"}> </span>
return( </p>
<div>
{/*提示*/} <style>{`
<Modals
modalsType={this.state.Modalstype}
modalsTopval={this.state.Modalstopval}
modalCancel={this.state.ModalCancel}
modalSave={this.state.ModalSave}
loadtype= {this.state.loadtype}
/>
<Modal
keyboard={false}
className={"HomeworkModal"}
title={this.props.modalname}
visible={this.props.visible}
closable={false}
footer={null}
destroyOnClose={true}
>
<div className="task-popup-content">
<p className="task-popup-text-center font-16">
<span className={"color-blue underline"}> </span>
</p>
<style>{`
.uploadBtn.ant-btn { .uploadBtn.ant-btn {
border: none; border: none;
color: #4CACFF; color: #4CACFF;
@ -404,7 +404,7 @@ class Sendresource extends Component{
margin-top:31px; margin-top:31px;
} }
`}</style>} `}</style>}
<p className={"winth540"}> <p className={"winth540"}>
{ {
@ -433,152 +433,152 @@ class Sendresource extends Component{
<span className={"ml10"}>(单个文件最大150M)</span> <span className={"ml10"}>(单个文件最大150M)</span>
</span>:""} </span>:""}
</Upload> </Upload>
</p> </p>
{/*<style>*/} {/*<style>*/}
{/*{*/} {/*{*/}
{/*`*/} {/*`*/}
{/*.maxwidth400{*/} {/*.maxwidth400{*/}
{/*max-width: 400px;*/} {/*max-width: 400px;*/}
{/*overflow: hidden;*/} {/*overflow: hidden;*/}
{/*text-overflow: ellipsis;*/} {/*text-overflow: ellipsis;*/}
{/*white-space: nowrap;*/} {/*white-space: nowrap;*/}
{/*}*/} {/*}*/}
{/*`*/} {/*`*/}
{/*}*/} {/*}*/}
{/*</style>*/} {/*</style>*/}
{/*{this.state.fileList.length===0?"":this.state.fileList.map((item,key)=>{*/} {/*{this.state.fileList.length===0?"":this.state.fileList.map((item,key)=>{*/}
{/*debugger*/} {/*debugger*/}
{/*return(*/} {/*return(*/}
{/*<p className="color-grey mt10" key={key} >*/} {/*<p className="color-grey mt10" key={key} >*/}
{/*<a className="color-grey fl">*/} {/*<a className="color-grey fl">*/}
{/*<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>*/} {/*<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>*/}
{/*</a>*/} {/*</a>*/}
{/*<span className="mr12 color9B9B maxwidth400 fl" length="58">*/} {/*<span className="mr12 color9B9B maxwidth400 fl" length="58">*/}
{/*{item.name}*/} {/*{item.name}*/}
{/*</span>*/} {/*</span>*/}
{/*<span className="color656565 mt2 color-grey-6 font-12 mr8">*/} {/*<span className="color656565 mt2 color-grey-6 font-12 mr8">*/}
{/*{item.response===undefined?"":isNaN(bytesToSize(item.filesize))?"":bytesToSize(item.filesize)}*/} {/*{item.response===undefined?"":isNaN(bytesToSize(item.filesize))?"":bytesToSize(item.filesize)}*/}
{/*</span>*/} {/*</span>*/}
{/*<i className="font-14 iconfont icon-guanbi "*/} {/*<i className="font-14 iconfont icon-guanbi "*/}
{/*id={item.response===undefined?"":item.response.id}*/} {/*id={item.response===undefined?"":item.response.id}*/}
{/*aria-hidden="true" onClick={()=>this.onAttachmentRemove(item.response===undefined?"":item.response.id&&item.response.id)}></i>*/} {/*aria-hidden="true" onClick={()=>this.onAttachmentRemove(item.response===undefined?"":item.response.id&&item.response.id)}></i>*/}
{/*</p>*/} {/*</p>*/}
{/*)*/} {/*)*/}
{/*})}*/} {/*})}*/}
{newfileListtype===true&&this.state.fileListtype===false?<p className={"color-red"}>请先上传资源</p>:""} {newfileListtype===true&&this.state.fileListtype===false?<p className={"color-red"}>请先上传资源</p>:""}
{/*<p className={"winth540"}>*/} <p className={"winth540"}>
{/*<style>{`*/} <style>{`
{/*.ant-checkbox-wrapper{*/} .ant-checkbox-wrapper{
{/*margin-left:0px !important;*/} margin-left:0px !important;
{/*margin-top:10px;*/} margin-top:10px;
{/*}*/} }
{/*`}</style>*/} `}</style>
{/*<div className={this.state.fileListtype===true?"mt30":""}></div><Checkbox checked={is_public} onChange={this.onChangepublic}>*/} <div className={this.state.fileListtype===true?"mt30":""}></div><Checkbox checked={is_public} onChange={this.onChangepublic}>
{/*<span className={"font-14"}>勾选后所有用户可见,否则仅课堂成员可见</span>*/} <span className={"font-14"}>勾选后所有用户可见否则仅课堂成员可见</span>
{/*</Checkbox>*/} </Checkbox>
{/*/!*{this.state.course_groups_count&&this.state.course_groups_count>0?<Checkbox checked={is_unified_setting} onChange={this.onChangesetting}>*!/*/} {/*{this.state.course_groups_count&&this.state.course_groups_count>0?<Checkbox checked={is_unified_setting} onChange={this.onChangesetting}>*/}
{/*/!*<span>统一设置</span><span className={"font-14 color-grey-9"}>(选中则所有分班使用相同的发布设置,否则各个单独设置)</span>*!/*/} {/*<span>统一设置</span><span className={"font-14 color-grey-9"}>(选中则所有分班使用相同的发布设置,否则各个单独设置)</span>*/}
{/*/!*</Checkbox>:""}*!/*/} {/*</Checkbox>:""}*/}
{/*<style>{`*/} <style>{`
{/*.Selectleft20{*/} .Selectleft20{
{/*margin-left: 20px !important;*/} margin-left: 20px !important;
{/*width: 176px;*/} width: 176px;
{/*height: 40px; */} height: 40px;
{/*}*/} }
{/*#startimes .ant-calendar-picker-icon{*/} #startimes .ant-calendar-picker-icon{
{/*margin-top:-11px;*/} margin-top:-11px;
{/*}*/} }
{/*.resourcebox{*/} .resourcebox{
{/*max-height:150px;*/} max-height:150px;
{/*overflow: auto;*/} overflow: auto;
{/*}*/} }
{/*`}</style>*/} `}</style>
{/*<div className={"resourcebox"}>*/} <div className={"resourcebox"}>
{/*{is_unified_setting===false?*/} {is_unified_setting===false?
{/*course_group_publish_times.map((item,key)=>{*/} course_group_publish_times.map((item,key)=>{
{/*return(*/} return(
{/*<div className={"mt10"} key={key}>*/} <div className={"mt10"} key={key}>
{/*<Select placeholder="请选择分班名称"*/} <Select placeholder="请选择分班名称"
{/*value={item.course_group_id}*/} value={item.course_group_id}
{/*style={{ width: 200 }}*/} style={{ width: 200 }}
{/*onChange={(e,index)=>this.selectassigngroups(e,index,key)}*/} onChange={(e,index)=>this.selectassigngroups(e,index,key)}
{/*>*/} >
{/*{course_groups&&course_groups.map((item,key)=>{*/} {course_groups&&course_groups.map((item,key)=>{
{/*return(*/} return(
{/*<Option value={item.id} key={key}>{item.name}</Option>*/} <Option value={item.id} key={key}>{item.name}</Option>
{/*)*/} )
{/*})}*/} })}
{/*</Select>*/} </Select>
{/*<DatePicker*/} <DatePicker
{/*dropdownClassName="hideDisable"*/} dropdownClassName="hideDisable"
{/*showTime={{ format: 'HH:mm' }}*/} showTime={{ format: 'HH:mm' }}
{/*locale={locale}*/} locale={locale}
{/*showToday={false}*/} showToday={false}
{/*format={dateFormat}*/} format={dateFormat}
{/*placeholder="请选择发布时间"*/} placeholder="请选择发布时间"
{/*id={"startimes"}*/} id={"startimes"}
{/*className={"Selectleft20 "}*/} className={"Selectleft20 "}
{/*width={"200px"}*/} width={"200px"}
{/*value={item.publish_time===undefined||item.publish_time===""?undefined:moment(item.publish_time, dateFormat)}*/} value={item.publish_time===undefined||item.publish_time===""?undefined:moment(item.publish_time, dateFormat)}
{/*onChange={(e,index)=>this.onChangeTimepublish(e,index,key,2)}*/} onChange={(e,index)=>this.onChangeTimepublish(e,index,key,2)}
{/*// onChange={ this.onChangeTimepublish }*/} // onChange={ this.onChangeTimepublish }
{/*disabledTime={disabledDateTime}*/} disabledTime={disabledDateTime}
{/*disabledDate={disabledDate}*/} disabledDate={disabledDate}
{/*/>*/} />
{/*{key!=0?<i className="iconfont icon-shanchu color-grey-c font-14 font-n ml20" onClick={()=>this.deletegrouppublish(key)}></i>:""}*/} {key!=0?<i className="iconfont icon-shanchu color-grey-c font-14 font-n ml20" onClick={()=>this.deletegrouppublish(key)}></i>:""}
{/*{key===course_group_publish_times.length-1&&key<this.state.course_groups_count-1?<i className="iconfont icon-tianjiafangda color-green ml15" onClick={this.addgrouppublish}></i>:""}*/} {key===course_group_publish_times.length-1&&key<this.state.course_groups_count-1?<i className="iconfont icon-tianjiafangda color-green ml15" onClick={this.addgrouppublish}></i>:""}
{/*</div>*/} </div>
{/*)*/} )
{/*})*/} })
{/*:""}*/} :""}
{/*</div>*/} </div>
{/*</p>*/} </p>
{is_unified_setting===true?<p className={this.state.fileListtype===true?"mt30":"mt10"}> {is_unified_setting===true?<p className={"mt10"}>
<span> <span>
<DatePicker <DatePicker
dropdownClassName="hideDisable" dropdownClassName="hideDisable"
showTime={{ format: 'HH:mm' }} showTime={{ format: 'HH:mm' }}
locale={locale} locale={locale}
format={dateFormat} format={dateFormat}
placeholder="请选择发布时间" placeholder="请选择发布时间"
id={"startime"} id={"startime"}
showToday={false} showToday={false}
width={"210px"} width={"210px"}
value={datatime===undefined||datatime===""?undefined:moment(datatime, dateFormat)} value={datatime===undefined||datatime===""?undefined:moment(datatime, dateFormat)}
onChange={(e,index)=>this.onChangeTimepublish(e,index,undefined,1)} onChange={(e,index)=>this.onChangeTimepublish(e,index,undefined,1)}
disabledTime={disabledDateTime} disabledTime={disabledDateTime}
disabledDate={disabledDate} disabledDate={disabledDate}
/> />
</span> </span>
</p>:""} </p>:""}
{/*{course_group_publish_timestype===true?<p className={"color-red mt10"}>请填写完整</p>:""}*/} {/*{course_group_publish_timestype===true?<p className={"color-red mt10"}>请填写完整</p>:""}*/}
<textarea placeholder="请在此输入资源描述最大限制100个字符" className={"mt10"} value={this.state.description} onInput={this.settextarea} style={{ <textarea placeholder="请在此输入资源描述最大限制100个字符" className={"mt10"} value={this.state.description} onInput={this.settextarea} style={{
width: '100%', width: '100%',
height:'120px', height:'120px',
border:'1px solid rgba(234,234,234,1)', border:'1px solid rgba(234,234,234,1)',
padding: '10px' padding: '10px'
}}></textarea> }}></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"> <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 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> <a className="task-btn task-btn-orange" onClick={()=>this.Saves()}>{this.props.Savesname}</a>
</div> </div>
</div> </div>
</Modal> </Modal>
</div> </div>
) )
} }
} }
export default Sendresource; export default Sendresource;

@ -2033,7 +2033,7 @@ class Studentshavecompletedthelist extends Component {
page:1, page:1,
}) })
} }
this.Searchdatasys(this.state.order, this.state.commit_status, null, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit); this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, null, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit);
} }
// notlimiteds = () => { // notlimiteds = () => {
// this.setState({ // this.setState({
@ -2160,7 +2160,7 @@ class Studentshavecompletedthelist extends Component {
}) })
} }
this.Searchdatasys(this.state.order, this.state.commit_status, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit); this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit);
} else if (checkedValues.length === data.length) { } else if (checkedValues.length === data.length) {
if (this.state.loadingstate === false) { if (this.state.loadingstate === false) {
this.setState({ this.setState({
@ -2177,7 +2177,7 @@ class Studentshavecompletedthelist extends Component {
}) })
} }
this.Searchdatasys(this.state.order, this.state.commit_status, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit); this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit);
} else { } else {
// console.log(checkedValues); // console.log(checkedValues);
if (this.state.loadingstate === false) { if (this.state.loadingstate === false) {
@ -2195,7 +2195,7 @@ class Studentshavecompletedthelist extends Component {
}) })
} }
this.Searchdatasys(this.state.order, this.state.commit_status, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit); this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit);
} }
} }
@ -2218,7 +2218,7 @@ class Studentshavecompletedthelist extends Component {
}) })
} }
this.Searchdatasys(this.state.order, this.state.commit_status, this.state.review, undefined, this.state.searchtext, 1, this.state.limit) this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, this.state.review, undefined, this.state.searchtext, 1, this.state.limit)
} }
funtaskstatustwo = (checkedValues, data) => { funtaskstatustwo = (checkedValues, data) => {
@ -2240,7 +2240,7 @@ class Studentshavecompletedthelist extends Component {
}) })
} }
this.Searchdatasys(this.state.order, this.state.commit_status, this.state.review, checkedValues, this.state.searchtext, 1, this.state.limit) this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, this.state.review, checkedValues, this.state.searchtext, 1, this.state.limit)
} else if (checkedValues.length === data.length) { } else if (checkedValues.length === data.length) {
if (this.state.loadingstate === false) { if (this.state.loadingstate === false) {
this.setState({ this.setState({
@ -2257,7 +2257,7 @@ class Studentshavecompletedthelist extends Component {
}) })
} }
this.Searchdatasys(this.state.order, this.state.commit_status, this.state.review, checkedValues, this.state.searchtext, 1, this.state.limit) this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, this.state.review, checkedValues, this.state.searchtext, 1, this.state.limit)
} else { } else {
// console.log(checkedValues); // console.log(checkedValues);
if (this.state.loadingstate === false) { if (this.state.loadingstate === false) {
@ -2278,7 +2278,7 @@ class Studentshavecompletedthelist extends Component {
} }
this.Searchdatasys(this.state.order, this.state.commit_status, this.state.review, checkedValues, this.state.searchtext, 1, this.state.limit) this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, this.state.review, checkedValues, this.state.searchtext, 1, this.state.limit)
this.props.setcourse_groupysls(checkedValues) this.props.setcourse_groupysls(checkedValues)
} }
@ -2299,7 +2299,7 @@ class Studentshavecompletedthelist extends Component {
}) })
} }
this.Searchdatasys(this.state.order, this.state.commit_status, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit); this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit);
} }
}; };
//搜索学生按钮输入 老师 //搜索学生按钮输入 老师
@ -2316,7 +2316,7 @@ class Studentshavecompletedthelist extends Component {
}) })
} }
this.Searchdatasys(this.state.order, this.state.commit_status, this.state.review, this.state.checkedValuesineinfo, value, 1, this.state.limit); this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, this.state.review, this.state.checkedValuesineinfo, value, 1, this.state.limit);
// this.Startsorting(this.state.order,this.state.checkedValuesine,this.state.checkedValuesineinfo,value); // this.Startsorting(this.state.order,this.state.checkedValuesine,this.state.checkedValuesineinfo,value);
// console.log(value) // console.log(value)
@ -2353,6 +2353,8 @@ class Studentshavecompletedthelist extends Component {
//排序 //排序
funordersy = (e) => { funordersy = (e) => {
console.log(this.state.course_groupyslstwo);
debugger
if (e === "end_at") { if (e === "end_at") {
// 时间 // 时间
// 时间排序是从小到大 // 时间排序是从小到大
@ -2367,7 +2369,7 @@ class Studentshavecompletedthelist extends Component {
}) })
} }
this.Searchdatasys(e, this.state.commit_status, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page,this.state.limit) this.Searchdatasys(e, this.state.course_groupyslstwo, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page,this.state.limit)
} }
if (e === "score") { if (e === "score") {
@ -2385,7 +2387,7 @@ class Studentshavecompletedthelist extends Component {
} }
this.Searchdatasys(e, this.state.commit_status, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, null, null) this.Searchdatasys(e, this.state.course_groupyslstwo, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, null, null)
} }
if (e === "student_id") { if (e === "student_id") {
@ -2402,7 +2404,7 @@ class Studentshavecompletedthelist extends Component {
}) })
} }
this.Searchdatasys(e, this.state.commit_status, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, null, null) this.Searchdatasys(e, this.state.course_groupyslstwo, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, null, null)
} }
} }
setExerciseReviewAndAnswer = () => { setExerciseReviewAndAnswer = () => {
@ -2423,7 +2425,7 @@ class Studentshavecompletedthelist extends Component {
" min-width": " 1200px", " min-width": " 1200px",
}}> }}>
{/*老师*/} {/*老师*/}
<div className="edu-back-white"> <div className="edu-back-white" >
<ul className="clearfix" style={{padding: '10px 30px 10px 30px'}}> <ul className="clearfix" style={{padding: '10px 30px 10px 30px'}}>
{/*你的评阅:*/} {/*你的评阅:*/}
@ -2588,6 +2590,7 @@ class Studentshavecompletedthelist extends Component {
{data === undefined ? "" : <Table {data === undefined ? "" : <Table
dataSource={data} dataSource={data}
columns={columnsys} columns={columnsys}
className="mysjysltable1"
pagination={false} pagination={false}
loading={loadingstate} loading={loadingstate}
// onChange={this.TablePaginationsy} // onChange={this.TablePaginationsy}
@ -2683,6 +2686,7 @@ class Studentshavecompletedthelist extends Component {
{datas === undefined ? "" : <Table {datas === undefined ? "" : <Table
dataSource={datas} dataSource={datas}
columns={columnss} columns={columnss}
className="mysjysltable2"
pagination={false} pagination={false}
loading={false} loading={false}
/>} />}
@ -2716,6 +2720,7 @@ class Studentshavecompletedthelist extends Component {
dataSource={data} dataSource={data}
columns={columnstwo} columns={columnstwo}
// showHeader={false} // showHeader={false}
className="mysjysltable3"
pagination={false} pagination={false}
loading={false} loading={false}
@ -2789,6 +2794,7 @@ class Studentshavecompletedthelist extends Component {
dataSource={datas} dataSource={datas}
columns={columns} columns={columns}
pagination={false} pagination={false}
className="mysjysltable4"
loading={loadingstate} loading={loadingstate}
/>}</div> />}</div>
</div> </div>

@ -1,7 +1,9 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Modal} from 'antd'; import { Modal} from 'antd';
import axios from 'axios'; import axios from 'axios';
import certfed from './certfed.css'; import shimingrenzheng from '../../../src/images/cert/shimingrenzheng.png';
import zhiyerenzheng from '../../../src/images/cert/zhiyerenzheng.png';
import './certfed.css';
//认证职业 //认证职业
class Certifiedprofessional extends Component { class Certifiedprofessional extends Component {
@ -22,23 +24,23 @@ class Certifiedprofessional extends Component {
axios.interceptors.response.use((response) => { axios.interceptors.response.use((response) => {
if (response != undefined) if (response != undefined)
if (response && response.data.status === -1) { if (response && response.data.status === -1) {
if(response.data.message==="该课堂要求成员完成实名认证"){ if(response.data.message==="该课堂要求成员完成实名认证"){
this.setState({ this.setState({
mydisplay:true, mydisplay:true,
occupation:1, occupation:1,
}) })
}else if(response.data.message==="该课堂要求成员完成职业认证"){ }else if(response.data.message==="该课堂要求成员完成职业认证"){
this.setState({ this.setState({
mydisplay:true, mydisplay:true,
occupation:2, occupation:2,
}) })
}else if(response.data.message==="该课堂要求成员完成实名和职业认证"){ }else if(response.data.message==="该课堂要求成员完成实名和职业认证"){
this.setState({ this.setState({
mydisplay:true, mydisplay:true,
occupation:3, occupation:3,
}) })
} }
} }
return response; return response;
}, (error) => { }, (error) => {
@ -53,7 +55,7 @@ class Certifiedprofessional extends Component {
}; };
setDownload=()=>{ setDownload=()=>{
window.location.href="/account/certification"
} }
@ -61,7 +63,8 @@ class Certifiedprofessional extends Component {
render() { render() {
// console.log("加入金品课堂2"); // console.log("加入金品课堂2");
// console.log(this.props); // console.log(this.props);
return( let{occupation} =this.state;
return(
<Modal <Modal
keyboard={false} keyboard={false}
closable={false} closable={false}
@ -74,21 +77,48 @@ class Certifiedprofessional extends Component {
heigth="307px" heigth="307px"
> >
<div className="educouddiv"> <div className="educouddiv">
<div className={"tabeltext-alignleft fontsizecoirlysl"}><p style={{fontSize: "16px",marginTop:"26px"}}>请在完成条件后重试</p></div> <div className={"tabeltext-alignleft fontsizecoirlysl"}><p style={{fontSize: "16px"}}>请在完成条件后重试</p></div>
<div className="yslcentercerlfed edu-txt-center mt30" > {
<div className="mr30"> occupation=== 3?
<div className="yslcentercerlfed edu-txt-center mt30" >
<span className="fontsizecoirlysltwo">未实名认证</span> <div className="mr55 imgysldivone">
</div> <img className="yslimgwidthte"
<div > src={shimingrenzheng}
/>
<span className="fontsizecoirlysltwo mt15">未实名认证</span>
</div>
<div className="imgysldivone">
<img className="yslimgwidthte"
src={zhiyerenzheng}
/>
<span className="fontsizecoirlysltwo mt15">未职业认证</span>
</div>
</div>
:occupation=== 2?
<div className="yslcentercerlfed edu-txt-center mt30" >
<div className="imgysldivone">
<img className="yslimgwidthte"
src={zhiyerenzheng}
/>
<span className="fontsizecoirlysltwo mt15">未职业认证</span>
</div>
</div>
:
<div className="yslcentercerlfed edu-txt-center mt30" >
<div className=" imgysldivone">
<img className="yslimgwidthte"
src={shimingrenzheng}
/>
<span className="fontsizecoirlysltwo mt15">未实名认证</span>
</div>
</div>
}
<span className="fontsizecoirlysltwo">未职业认证</span> <div className="clearfix edu-txt-center mt28">
</div>
</div>
<div className="clearfix edu-txt-center mt60">
<a className="task-btn mr30" onClick={()=>this.modalCancel()}>取消</a> <a className="task-btn mr60 w90" onClick={()=>this.modalCancel()}>取消</a>
<a className="task-btn task-btn-orange" onClick={()=>this.setDownload()}>立即认证</a> <a className="task-btn task-btn-orange w90" onClick={()=>this.setDownload()}>立即认证</a>
</div> </div>
</div> </div>
</Modal> </Modal>

@ -19,3 +19,26 @@
font-size: 14px; font-size: 14px;
color: #979797; color: #979797;
} }
.imgysldivone{
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.yslimgwidthte{
width: 40px;
height: 37px;
}
.mr55{
margin-right: 55px;
}
.mt28{
margin-top: 28px;
}
.w90{
width: 90px;
}
.mr60{
margin-right: 60px;
}

@ -449,7 +449,7 @@ class DetailCardsEditAndAdd extends Component{
<Spin spinning={hometypepvisible} size="large" style={{marginTop:'15%'}}> <Spin spinning={hometypepvisible} size="large" style={{marginTop:'15%'}}>
<div className="newupload_conbox"> <div className="newupload_conbox">
<div className="clearfix mb20 shixun_work_div newshixun_tab_div cdefault" style={{"marginRight":"4px"}} id="shixun_tab_div"> <div className="clearfix mb20 shixun_work_div newshixun_tab_div cdefault" style={{"marginRight":"4px"}} id="shixun_tab_div">
<li className="fl mr5 mt5"> <a onClick={()=>this.changeTag(0,`${search}`)} className={ type===0 ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>全部</a></li> <li className="fl mr5 mt5"> <a onClick={()=>this.changeTag(0,`${search}`)} className={ parseInt(type)===0 ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>全部</a></li>
{ {
ChooseShixunList && ChooseShixunList.tags.map((item,key)=>{ ChooseShixunList && ChooseShixunList.tags.map((item,key)=>{
return( return(

@ -81,6 +81,7 @@ class DetailCardsEditAndEdit extends Component{
//打开选择实训弹框初始化tag标签和列表 //打开选择实训弹框初始化tag标签和列表
changeTag(id,search){ changeTag(id,search){
this.setState({ this.setState({
ChooseShixunListshixun_list:[], ChooseShixunListshixun_list:[],
page:1, page:1,
@ -481,7 +482,7 @@ class DetailCardsEditAndEdit extends Component{
<Spin spinning={hometypepvisible} size="large" style={{marginTop:'15%'}}> <Spin spinning={hometypepvisible} size="large" style={{marginTop:'15%'}}>
<div className="newupload_conbox"> <div className="newupload_conbox">
<div className="clearfix mb20 shixun_work_div newshixun_tab_div cdefault" style={{"marginRight":"4px"}} id="shixun_tab_div"> <div className="clearfix mb20 shixun_work_div newshixun_tab_div cdefault" style={{"marginRight":"4px"}} id="shixun_tab_div">
<li className="fl mr5 mt5"> <a onClick={()=>this.changeTag(0,`${search}`)} className={ type===0 ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>全部</a></li> <li className="fl mr5 mt5"> <a onClick={()=>this.changeTag(0,`${search}`)} className={ parseInt(type)===0 ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>全部</a></li>
{ {
ChooseShixunList && ChooseShixunList.tags.map((item,key)=>{ ChooseShixunList && ChooseShixunList.tags.map((item,key)=>{
return( return(

@ -35,14 +35,14 @@ if (!window['indexHOCLoaded']) {
// $('head').append($('<link rel="stylesheet" type="text/css" />') // $('head').append($('<link rel="stylesheet" type="text/css" />')
// .attr('href', `${_url_origin}/stylesheets/educoder/antd.min.css?1525440977`)); // .attr('href', `${_url_origin}/stylesheets/educoder/antd.min.css?1525440977`));
$('head').append($('<link rel="stylesheet" type="text/css" />') $('head').append($('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/css/edu-common.css?8`)); .attr('href', `${_url_origin}/stylesheets/css/edu-common.css?9`));
$('head').append($('<link rel="stylesheet" type="text/css" />') $('head').append($('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/educoder/edu-main.css?8`)); .attr('href', `${_url_origin}/stylesheets/educoder/edu-main.css?9`));
// index.html有加载 // index.html有加载
$('head').append($('<link rel="stylesheet" type="text/css" />') $('head').append($('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/educoder/edu-all.css?8`)); .attr('href', `${_url_origin}/stylesheets/educoder/edu-all.css?9`));
// $('head').append($('<link rel="stylesheet" type="text/css" />') // $('head').append($('<link rel="stylesheet" type="text/css" />')

@ -43,6 +43,8 @@ function doCreateUploader (options) {
retryDuration: $('#retryDuration').val() || 2, retryDuration: $('#retryDuration').val() || 2,
region: $('#region').val() || 'ap-southeast-1', region: $('#region').val() || 'ap-southeast-1',
userId: $('#userId').val() || 1829848226361863, // 1303984639806000, userId: $('#userId').val() || 1829848226361863, // 1303984639806000,
// 解决取消上传后无法继续上传同文件的问题
// https://workorder.console.aliyun.com/console.htm#/ticket/detail/?ticketId=FLASELR
enableUploadProgress: false, enableUploadProgress: false,
// 添加文件成功 // 添加文件成功
addFileSuccess: function (uploadInfo) { addFileSuccess: function (uploadInfo) {

@ -70,6 +70,7 @@ function VideoUploadList (props) {
&& file.name.indexOf('.webm') == -1 && file.name.indexOf('.webm') == -1
) { ) {
showNotification(`不支持的视频格式`) showNotification(`不支持的视频格式`)
clearInput()
return; return;
} }
if (file.size > 200 * 1024 * 1024) { if (file.size > 200 * 1024 * 1024) {

Loading…
Cancel
Save