dev_home
SylorHuang 5 years ago
commit 4a1cf83783

@ -19,6 +19,13 @@ class Admins::LaboratoryShixunsController < Admins::BaseController
render_ok
end
def destroy
return render_js_error('不能删除自建实训', type: :notify) if current_laboratory_shixun.ownership?
current_laboratory_shixun.destroy!
render_delete_success
end
def homepage
current_laboratory_shixun.update!(homepage: true)
render_ok

@ -21,6 +21,15 @@ class Admins::LaboratorySubjectsController < Admins::BaseController
render_ok
end
def destroy
return render_js_error('不能删除自建课程', type: :notify) if current_laboratory_subject.ownership?
current_laboratory_subject.destroy!
render_delete_success
end
def homepage
current_laboratory_subject.update!(homepage: true)
render_ok

@ -16,7 +16,7 @@ class Cooperative::BaseController < ApplicationController
private
def current_laboratory
@_current_laboratory ||= Laboratory.find_by_subdomain(request.subdomain)
@_current_laboratory ||= Laboratory.find_by_subdomain('hut' || request.subdomain)
end
def current_setting_or_default(name)

@ -15,6 +15,13 @@ class Cooperative::LaboratoryShixunsController < Cooperative::BaseController
end
def destroy
return render_js_error('不能删除自建实训', type: :notify) if current_laboratory_shixun.ownership?
current_laboratory_shixun.destroy!
render_delete_success
end
def homepage
current_laboratory_shixun.update!(homepage: true)
render_ok

@ -18,6 +18,13 @@ class Cooperative::LaboratorySubjectsController < Cooperative::BaseController
current_laboratory_subject.subject.update!(update_params)
end
def destroy
return render_js_error('不能删除自建实践课程', type: :notify) if current_laboratory_subject.ownership?
current_laboratory_subject.destroy!
render_delete_success
end
def homepage
current_laboratory_subject.update!(homepage: true)
render_ok

@ -25,4 +25,8 @@
<%= link_to('去修改', admins_shixun_settings_path(id: laboratory_shixun.shixun_id)) %>
<%= javascript_void_link('首页展示', class: 'action homepage-show-action', data: { id: laboratory_shixun.id }, style: laboratory_shixun.homepage? ? 'display:none' : '') %>
<%= javascript_void_link('取消首页展示', class: 'action homepage-hide-action', data: { id: laboratory_shixun.id }, style: laboratory_shixun.homepage? ? '' : 'display:none') %>
<% unless laboratory_shixun.ownership? %>
<%= delete_link '删除', admins_laboratory_laboratory_shixun_path(current_laboratory, laboratory_shixun, element: ".laboratory-shixun-item-#{laboratory_shixun.id}") %>
<% end %>
</td>

@ -36,6 +36,10 @@
<%= link_to('去修改', admins_subjects_path(id: laboratory_subject.subject_id)) %>
<%= javascript_void_link('首页展示', class: 'action homepage-show-action', data: { id: laboratory_subject.id }, style: laboratory_subject.homepage? ? 'display:none' : '') %>
<%= javascript_void_link('取消首页展示', class: 'action homepage-hide-action', data: { id: laboratory_subject.id }, style: laboratory_subject.homepage? ? '' : 'display:none') %>
<% unless laboratory_subject.ownership? %>
<%= delete_link '删除', admins_laboratory_laboratory_subject_path(current_laboratory, laboratory_subject, element: ".laboratory-subject-item-#{laboratory_subject.id}") %>
<% end %>
</td>
</tr>
<% end %>

@ -29,4 +29,8 @@
<% end %>
<%= javascript_void_link('首页展示', class: 'action homepage-show-action', data: { id: laboratory_shixun.id }, style: laboratory_shixun.homepage? ? 'display:none' : '') %>
<%= javascript_void_link('取消首页展示', class: 'action homepage-hide-action', data: { id: laboratory_shixun.id }, style: laboratory_shixun.homepage? ? '' : 'display:none') %>
<% unless laboratory_shixun.ownership? %>
<%= delete_link '删除', cooperative_laboratory_shixun_path(laboratory_shixun, element: ".laboratory-shixun-item-#{laboratory_shixun.id}") %>
<% end %>
</td>

@ -25,4 +25,8 @@
<%= javascript_void_link('首页展示', class: 'action homepage-show-action', data: { id: laboratory_subject.id }, style: laboratory_subject.homepage? ? 'display:none' : '') %>
<%= javascript_void_link('取消首页展示', class: 'action homepage-hide-action', data: { id: laboratory_subject.id }, style: laboratory_subject.homepage? ? '' : 'display:none') %>
<% unless laboratory_subject.ownership? %>
<%= delete_link '删除', cooperative_laboratory_subject_path(laboratory_subject, element: ".laboratory-subject-item-#{laboratory_subject.id}") %>
<% end %>
</td>

@ -3,11 +3,11 @@ json.images_url @images_url
json.reps @rep_list
json.shixuns do
json.partial! 'shixuns/shixun', locals: {shixuns: @shixuns.present? ? @shixuns : @main_shixuns}
json.partial! 'shixuns/shixun', locals: {shixuns: @shixuns}
end
json.subjects do
json.partial! 'subjects/subject', locals: {subjects: @subjects.present? ? @subjects : @main_subjects}
json.partial! 'subjects/subject', locals: {subjects: @subjects}
end
if current_laboratory.main_site?

@ -13,6 +13,7 @@ json.phone @user.phone
json.email @user.mail
json.profile_completed @user.profile_completed?
json.professional_certification @user.professional_certification
json.main_site current_laboratory.main_site?
if @course
json.course_identity @course_identity
json.course_name @course.name

@ -1049,13 +1049,13 @@ Rails.application.routes.draw do
post :drag, on: :collection
end
resources :laboratory_shixuns, only: [:index, :create] do
resources :laboratory_shixuns, only: [:index, :create, :destroy] do
member do
post :homepage
post :cancel_homepage
end
end
resources :laboratory_subjects, only: [:index, :create] do
resources :laboratory_subjects, only: [:index, :create, :destroy] do
member do
post :homepage
post :cancel_homepage
@ -1132,13 +1132,13 @@ Rails.application.routes.draw do
resources :carousels, only: [:index, :create, :update, :destroy] do
post :drag, on: :collection
end
resources :laboratory_shixuns, only: [:index, :edit, :update] do
resources :laboratory_shixuns, only: [:index, :edit, :update, :destroy] do
member do
post :homepage
post :cancel_homepage
end
end
resources :laboratory_subjects, only: [:index, :edit, :update] do
resources :laboratory_subjects, only: [:index, :edit, :update, :destroy] do
member do
post :homepage
post :cancel_homepage

@ -6,7 +6,8 @@ class MigrateGccProjectTeam < ActiveRecord::Migration[5.2]
all_login = [['mu2pwryse', 'pljq3f9xp', 'pfx7gfmiz'], ['p9rs7xtfl', 'prx72s8uc', 'plezci23p', 'pjysrikw7'], ['m40352189', 'p05394287'],
['m9ozhx83t', 'p05296348'], ['p35490268', 'p48921607', 'p24019738'], ['p29165708', 'm43960821']]
all_login.each do |user_login|
leader = User.find_by!(login: user_login.first)
leader = User.find_by(login: user_login.first)
next if leader.blank?
team = CompetitionTeam.create!(name: "#{leader.real_name}", user_id: leader.id, competition_id: 8)
team.generate_invite_code
team.save!

@ -32,7 +32,7 @@ module.exports = {
// See the discussion in https://github.com/facebookincubator/create-react-app/issues/343.s
// devtool: "cheap-module-eval-source-map",
// 开启调试
devtool: "source-map", // 开启调试
//devtool: "source-map", // 开启调试
// These are the "entry points" to our application.
// This means they will be the "root" imports that are included in JS bundle.
// The first two entry points enable "hot" CSS and auto-refreshes for JS.

@ -45,6 +45,7 @@ class ModulationModal_exercise extends Component {
}
Saves = () => {
debugger
let {
textareaval,
subjective_questions,
@ -123,7 +124,7 @@ class ModulationModal_exercise extends Component {
Inputsvaltests: "请输入0-100的分数",
})
return;
} else if (parseFloat(Inputsval) > this.props.objective_score) {
} else if (parseFloat(Inputsvals) > this.props.objective_score) {
this.setState({
Inputsvals: Inputsvals,
Inputsvaltypes: true,
@ -312,7 +313,9 @@ class ModulationModal_exercise extends Component {
""
}
<div className="mexertwo">
<div className="mexertwo" style={{
marginTop: "20px",
}}>
<p className="mexeheigth2">主观题成绩:</p>
<Input
className={Inputsvaltype === true ? "borerinput myinputnumbers bor-reds" : "myinputnumbers"}
@ -355,7 +358,9 @@ class ModulationModal_exercise extends Component {
""
}
<div className="mexertwo">
<div className="mexertwo" style={{
marginTop: "20px",
}}>
<p className="mexeheigth2">客观题成绩:</p>
<Input
@ -382,6 +387,13 @@ class ModulationModal_exercise extends Component {
}}>{Inputsvaltests}</p>
: ""
}
<div className="minbuttionte">
<a className="task-btn color-white mr30" style={{width: "72px",}}
onClick={this.props.Cancel}>{this.props.Cancelname || '取消'}</a>
<a className="task-btn task-btn-orange" style={{width: "72px",}}
onClick={this.Saves}>{this.props.Savesname || '保存'}</a>
</div>
</div>
:
<div className="mt20">

@ -428,7 +428,7 @@ class Studentshavecompletedthelist extends Component {
textAlign: "center",
width:'255px',
}}>--</span>:
<a className="maxnamewidth255" tyle={{
<a className="maxnamewidth255" style={{
color: '#07111B',
textAlign: "center",
width:'255px',
@ -661,7 +661,7 @@ class Studentshavecompletedthelist extends Component {
key: 'classroom',
dataIndex: 'classroom',
align: 'center',
className: "edu-txt-center font-14",
className: "edu-txt-center font-14 maxnamewidth260",
width:"260px",
render: (text, record) => (
<span>
@ -669,15 +669,15 @@ class Studentshavecompletedthelist extends Component {
<span style={{
color: '#999999',
textAlign: "center"
}}>--</span> : record.classroom === "" ?
}} className="maxnamewidth260">--</span> : record.classroom === "" ?
<span style={{
color: '#999999',
textAlign: "center"
}}>--</span> :
}} className="maxnamewidth260">--</span> :
<span style={{
color: '#07111B',
textAlign: "center"
}}>{record.classroom}</span>
}} className="maxnamewidth260">{record.classroom}</span>
}
</span>
@ -904,14 +904,14 @@ class Studentshavecompletedthelist extends Component {
key: 'classroom',
dataIndex: 'classroom',
align: 'center',
className: "edu-txt-center font-14",
className: "edu-txt-center font-14 maxnamewidth260",
width:'260px',
render: (text, record) => (
<span>
{record.classroom==="--"?
<span style={{color: '#999999', textAlign: "center"}}>{record.classroom}</span>
<span style={{color: '#999999', textAlign: "center"}} className="maxnamewidth260">{record.classroom}</span>
:
<span style={{color: '#07111B', textAlign: "center"}}>{record.classroom}</span>
<a style={{color: '#07111B', textAlign: "center"}} className="maxnamewidth260" title={record.classroom}>{record.classroom}</a>
}
</span>
)
@ -1031,8 +1031,7 @@ class Studentshavecompletedthelist extends Component {
render: (text, record) => (
<span>
{record.finalscore==="--"?
<span style={{textAlign: "center", color: '#999999'}}
>--</span>
<span style={{textAlign: "center", color: '#999999'}}>--</span>
:
<a style={{textAlign: "center"}} className="color-blue"
target="_blank"
@ -1100,14 +1099,14 @@ class Studentshavecompletedthelist extends Component {
key: 'classroom',
dataIndex: 'classroom',
align: 'center',
className: "edu-txt-center font-14",
className: "edu-txt-center font-14 maxnamewidth260 ",
width:'260px',
render: (text, record) => (
<span>
{record.classroom==="--"?
<span style={{color: '#999999', textAlign: "center"}}>{record.classroom}</span>
<span style={{color: '#999999', textAlign: "center"}} className="maxnamewidth260">{record.classroom}</span>
:
<span style={{color: '#07111B', textAlign: "center"}}>{record.classroom}</span>
<a style={{color: '#07111B', textAlign: "center"}} className="maxnamewidth260" title={record.classroom}>{record.classroom}</a>
}
</span>
)
@ -1227,8 +1226,7 @@ class Studentshavecompletedthelist extends Component {
render: (text, record) => (
<span>
{record.finalscore==="--"?
<span style={{textAlign: "center", color: '#999999'}}
>--</span>
<span style={{textAlign: "center", color: '#999999'}}>--</span>
:
<a style={{textAlign: "center"}} className="color-blue"
target="_blank"

@ -47,3 +47,11 @@
white-space:nowrap;
cursor: default;
}
.maxnamewidth260 {
max-width: 260px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
cursor: default;
}

@ -24,25 +24,28 @@ class Bullsubdirectory extends Component{
Modalstopval:"是否确认删除?",
ModalCancel:"",
ModalSave:"",
index:0,
}
//不能显示数据编辑的时候没有赋值
//没加initialValue 输入不能赋值到from 上
}
componentDidMount() {
console.log("获取到数据");
console.log(this.props);
let{id,myname,mydescription} =this.props
let{id,myname,mydescription,index,item} =this.props
this.props.form.setFieldsValue({
id:id,
eduintits:myname,
description:mydescription,
eduintits:item.name,
description:item.description,
});
// this.contentMdRef.current.setValue(mydescription);
this.setState({
id:id,
eduintits:myname,
description:mydescription,
eduintits:item.name,
description:item.description,
index:index
})
if(myname!=undefined){
this.setState({
@ -108,10 +111,20 @@ class Bullsubdirectory extends Component{
}
bianji = (bians)=>{
bianji = (bians,i)=>{
console.log("bianji");
console.log(this.props.myname);
console.log(this.props.mydescription);
this.setState({
whethertoeditysl:bians,
})
eduintits:this.props.myname,
description:this.props.mydescription,
index:i
});
this.props.form.setFieldsValue({
eduintits:this.props.myname,
description:this.props.mydescription,
});
if(bians===true){
this.props.getyslbooltrue();
}else {
@ -143,6 +156,7 @@ class Bullsubdirectory extends Component{
handleSubmit=(e) => {
e.preventDefault();
this.props.form.validateFields((err, values) => {
debugger
if (!err) {
console.log(values.description);
if(values.eduintits === undefined|| values.eduintits === "" || values.eduintits ===null){
@ -180,11 +194,11 @@ class Bullsubdirectory extends Component{
if(result){
if(result.data){
if(result.data.status === 0){
this.props.form.setFieldsValue({
id:this.state.id,
eduintits:titname,
description:values.description,
});
// this.props.form.setFieldsValue({
// id:this.state.id,
// eduintits:titname,
// description:values.description,
// });
this.setState({
whethertoeditysl:false,
id:this.state.id,
@ -266,111 +280,118 @@ class Bullsubdirectory extends Component{
render(){
let{description,whethertoeditysl,addonAfter,eduintits,informs,isSpinysl} =this.state;
let{description,whethertoeditysl,addonAfter,eduintits,informs,isSpinysl,index} =this.state;
let{myname,mydescription,id}=this.props;
const {getFieldDecorator} = this.props.form;
// console.log("Bullsubdirectory");
// console.log(this.props.isAdmin());
// console.log(this.props);
console.log(this.props);
console.log(whethertoeditysl);
console.log(this.state.eduintits);
console.log(this.state.description);
return(
<React.Fragment >
<div >
{this.state.Modalstype&&this.state.Modalstype===true?<Modals
modalsType={this.state.Modalstype}
modalsTopval={this.state.Modalstopval}
modalCancel={this.state.ModalCancel}
modalSave={this.state.ModalSave}
/>:""}
<Spin size="large" spinning={isSpinysl} >
<div className="edu-back-white ">
{
whethertoeditysl === false?
<div>
<div className="fudonyingxiangysls">
<div className="fudonyingxiangysl">
<div style={{marginRight:"60px"}}>
<span className="ysltitbt">{myname}</span>
</div>
<div>
<React.Fragment key={this.props.index} id={this.props.id}>
<div key={this.props.index} id={this.props.id}>
{this.state.Modalstype&&this.state.Modalstype===true?<Modals
modalsType={this.state.Modalstype}
modalsTopval={this.state.Modalstopval}
modalCancel={this.state.ModalCancel}
modalSave={this.state.ModalSave}
/>:""}
<Spin size="large" spinning={isSpinysl} >
<div className="edu-back-white " id={
index
}>
{
whethertoeditysl === false?
<div id={this.props.index}>
<div className="fudonyingxiangysls">
<div className="fudonyingxiangysl">
<div style={{marginRight:"60px"}}>
<span className="ysltitbt">{myname}</span>
</div>
<div>
<span className="fr yslbianji" style={{marginRight:"17px"}}>
{
this.props.isAdmin() === true ?
(this.props.yslbool===false?
<Tooltip placement="bottom" title={<div>
编辑
</div>}>
<i className="iconfont icon-bianji1 newbianji1" onClick={()=>this.bianji(true)}></i>
</Tooltip>
<Tooltip placement="bottom" title={<div>
编辑
</div>}>
<i className="iconfont icon-bianji1 newbianji1" onClick={()=>this.bianji(true,this.props.index)}></i>
</Tooltip>
:
""
)
:""
}
</span>
<span className="fr yslbianji" style={{marginRight:"22px"}}>
<span className="fr yslbianji" style={{marginRight:"22px"}}>
{
this.props.isAdmin() === true ?
(this.props.yslbool===false?
<Tooltip placement="bottom" title={<div>
删除
</div>}>
<i className="iconfont icon-shanchu newbianji1" style={{ color: "#4CACFF"}} onClick={()=>this.setModeltrue(true)}></i>
</Tooltip>
<Tooltip placement="bottom" title={<div>
删除
</div>}>
<i className="iconfont icon-shanchu newbianji1" style={{ color: "#4CACFF"}} onClick={()=>this.setModeltrue(true)}></i>
</Tooltip>
:
""
)
:""
}
</span>
{
this.props.length - 1 === this.props.index ? "" :
this.props.isAdmin() === true ?
(this.props.yslbool === false ?
<a className="fr yslbianji mr30"
style={{
lineHeight: "31px",
}}
onClick={() => this.Movedown(this.props.id)}
><Tooltip
title="下移"><i
style={{color: "#4CACFF"}}
className=" font-18 iconfont icon-xiangxiayi"></i></Tooltip></a>
:
""
)
: ""
}
{
this.props.index === 0 ? "" :
this.props.isAdmin() === true ?
(this.props.yslbool === false ?
<a className="fr yslbianji mr30"
style={{
lineHeight: "31px",
}}
onClick={() => this.Moveupward(this.props.id)}
><Tooltip
title="上移"><i
style={{color: "#4CACFF"}}
className=" font-18 iconfont icon-xiangshangyi"></i></Tooltip></a>
:
""
)
: ""
}
</div>
<div className="yslclear"></div>
</div>
<div id="MakedownHTML"className="markdown-body fonttext yslmtopcg yslminHeigth markdownysltext" dangerouslySetInnerHTML={{__html: markdownToHTML(mydescription).replace(/▁/g, "▁▁▁")}}/>
{
this.props.length - 1 === this.props.index ? "" :
this.props.isAdmin() === true ?
(this.props.yslbool === false ?
<a className="fr yslbianji mr30"
style={{
lineHeight: "31px",
}}
onClick={() => this.Movedown(this.props.id)}
><Tooltip
title="下移"><i
style={{color: "#4CACFF"}}
className=" font-18 iconfont icon-xiangxiayi"></i></Tooltip></a>
:
""
)
: ""
}
{
this.props.index === 0 ? "" :
this.props.isAdmin() === true ?
(this.props.yslbool === false ?
<a className="fr yslbianji mr30"
style={{
lineHeight: "31px",
}}
onClick={() => this.Moveupward(this.props.id)}
><Tooltip
title="上移"><i
style={{color: "#4CACFF"}}
className=" font-18 iconfont icon-xiangshangyi"></i></Tooltip></a>
:
""
)
: ""
}
</div>
{parseInt(this.props&&this.props.informs.length)===parseInt(this.props&&this.props.index+1)?"":<div className="bor-bottom-greyE mr25 ml25"></div>}
<div className="yslclear"></div>
</div>
:
<div className="edu-back-white ">
<Form layout='vertical' onSubmit={this.handleSubmit} >
<style>
{
`.ant-form-item{
<div id="MakedownHTML"className="markdown-body fonttext yslmtopcg yslminHeigth markdownysltext" dangerouslySetInnerHTML={{__html: markdownToHTML(mydescription).replace(/▁/g, "▁▁▁")}}/>
</div>
{parseInt(this.props&&this.props.informs.length)===parseInt(this.props&&this.props.index+1)?"":<div className="bor-bottom-greyE mr25 ml25"></div>}
</div>
:
whethertoeditysl === true?
<div className="edu-back-white " key={this.props.index} id={this.props.id}>
<Form layout='vertical' onSubmit={this.handleSubmit} key={this.props.index}>
<style>
{
`.ant-form-item{
margin-bottom:0px !important;
}
.chooseDestwo .ant-form-item{
@ -385,49 +406,50 @@ class Bullsubdirectory extends Component{
}
`
}
</style>
<Form.Item
style={{"borderBottom":'none'}}
className="chooseDestwo "
>
{getFieldDecorator('eduintits',{ initialValue: this.state.eduintits }, {
rules: [{
required: true, message: '请在此输入标题,最多60个字符',
}],
})(
<div className="ysleduinwh">
<div className="yslduinlefts">
<span className="yslduincolorred">*</span>
</div>
<div className="yslduinleft">
<style>{
`
}
</style>
<Form.Item
style={{"borderBottom":'none'}}
className="chooseDestwo "
key={this.props.index}
>
{getFieldDecorator('eduintits', { initialValue: eduintits}, {
rules: [{
required: true, message: '请在此输入标题,最多60个字符',
}],
})(
<div className="ysleduinwh">
<div className="yslduinlefts">
<span className="yslduincolorred">*</span>
</div>
<div className="yslduinleft">
<style>{
`
.ant-input{
border-right: none !important;
height: 40px !important;
}
`
}</style>
<Input placeholder="请在此输入标题最多60个字符" maxLength="60"
style={{ textAlign: "left",width:"100%",}}
onInput={this.changeTopicName}
autoComplete="off"
addonAfter={String(addonAfter)+"/60"}
value={eduintits}
className="searchViewAfter"></Input>
</div>
}</style>
<Input placeholder="请在此输入标题最多60个字符" key={this.props.index} maxLength="60"
style={{ textAlign: "left",width:"100%",}}
onInput={this.changeTopicName}
autoComplete="off"
addonAfter={String(addonAfter)+"/60"}
value={eduintits}
className="searchViewAfter"></Input>
</div>
)}
</Form.Item>
</div>
)}
</Form.Item>
<div className="edu-back-white ">
<div className={"yslmt16px"}>
<style>
{
`
<div className="edu-back-white " key={this.props.index}>
<div className={"yslmt16px"}>
<style>
{
`
.ant-form-item-children {
position: unset;
}
@ -473,46 +495,52 @@ class Bullsubdirectory extends Component{
margin-bottom: 24px !important;
}
`
}
</style>
<Form.Item
style={{"borderBottom":'none'}}
className="chooseDes "
>
{getFieldDecorator('description', { initialValue: this.state.description },{
rules: [{
required: true, message: '请在此输入内容,最多5000个字符',
}, {
len: 5000, message: '最大限制为5000个字符',
}],
})(
<TPMMDEditor ref={this.messageRef}
placeholder={'请在此输入内容,最多5000个字符'}
initValue={description}
mdID={'courseMessageMD'}
className="courseMessageMD "
height={518}
></TPMMDEditor>
)}
</Form.Item>
</div>
</div>
}
</style>
<Form.Item
style={{"borderBottom":'none'}}
className="chooseDes "
key={this.props.index}
>
{getFieldDecorator('description', { initialValue: description},{
rules: [{
required: true, message: '请在此输入内容,最多5000个字符',
}, {
len: 5000, message: '最大限制为5000个字符',
}],
})(
<TPMMDEditor ref={this.messageRef}
key={this.props.index}
placeholder={'请在此输入内容,最多5000个字符'}
initValue={description}
mdID={'courseMessageMD'}
className="courseMessageMD "
height={518}
></TPMMDEditor>
)}
</Form.Item>
<Form.Item>
<div className="clearfix mt28 fr pb50 mr25">
<a className="defalutCancelbtn fl mr20 " onClick={()=>this.bianji(false)}>取消</a>
<Button htmlType="submit" className="ant-btn defalutSubmitbtn fl ant-btn-primary">
<span> </span></Button>
</div>
</Form.Item>
</Form>
<div className="bor-bottom-greyE mr25 ml25"></div>
</div>
}
</div>
</Spin>
</div>
</div>
</div>
<Form.Item>
<div className="clearfix mt28 fr pb50 mr25">
<a className="defalutCancelbtn fl mr20 " onClick={()=>this.bianji(false,this.props.index)}>取消</a>
<Button htmlType="submit" className="ant-btn defalutSubmitbtn fl ant-btn-primary">
<span> </span></Button>
</div>
</Form.Item>
</Form>
<div className="bor-bottom-greyE mr25 ml25"></div>
</div>
:""
}
</div>
</Spin>
</div>
</React.Fragment>
)
}

@ -497,6 +497,7 @@ class Eduinforms extends Component{
<Bullsubdirectory {...this.state} {...this.props} key={index} index={index}
length={informs.length} yslbool={yslbool} id={item.id}
myname={item.name} mydescription={item.description}
item={item}
getyslbooltrue={()=>this.getyslbooltrue()}
getyslboolfalse={()=>this.getyslboolfalse()}
getinputdata={()=>this.getinputdata()} ></Bullsubdirectory>

@ -64,7 +64,7 @@ class PollDetailTabSecond extends Component{
let {page, limit, questions, questionsInfo , isSpin} = this.state;
return(
<Spin size="large" spinning={ isSpin }>
<div>
<React.Fragment>
{
questions && questions.length>0 && questions.map((item,key)=>{
return(
@ -179,7 +179,7 @@ class PollDetailTabSecond extends Component{
})
}
{
questions && questions.length == 0 && <NoneData></NoneData>
questions && questions.length == 0 && <div className="edu-back-white"><NoneData></NoneData></div>
}
{
questionsInfo && questionsInfo.q_counts > limit &&
@ -189,7 +189,7 @@ class PollDetailTabSecond extends Component{
</div>
}
</div>
</React.Fragment>
</Spin>
)
}

@ -1,6 +1,7 @@
import React,{ Component } from "react";
import {Checkbox,Radio} from "antd";
import NoneData from "../coursesPublic/NoneData"
import '../css/members.css'
import '../css/busyWork.css'
@ -26,31 +27,34 @@ class PollDetailTabThirdInfo extends Component{
pollDetail !== pollDetail.poll.polls_description &&
<p style={{whiteSpace:"pre-wrap"}} className="color-grey-3 padding20-30">{ pollDetail.poll.polls_description }</p>
}
<p className="padding20-30 clearfix edu-txt-left" style={{background:"#fafafa"}}>
{ !pollDetail || !pollDetail.question_types || pollDetail.question_types.q_counts===0 ? "" :
<span className="color-grey-3">
{
pollDetail && pollDetail.question_types && pollDetail.question_types.q_counts > 0 &&
<span>合计{pollDetail.question_types && pollDetail.question_types.q_counts}</span>
}
{
pollDetail && pollDetail.question_types.q_singles > 0 &&
<span className="mr15 color-grey-9">单选题{pollDetail.question_types.q_singles}</span>
}
{
pollDetail && pollDetail.question_types.q_doubles > 0 &&
<span className="mr15 color-grey-9">多选题{pollDetail.question_types.q_doubles}</span>
}
{
pollDetail && pollDetail.question_types.q_mains > 0 &&
<span className="color-grey-9">主观题{pollDetail.question_types.q_mains}</span>
}
</span>
}
</p>
{
pollDetail && pollDetail.questions && pollDetail.questions.map((item,key)=>{
pollDetail && pollDetail.questions && pollDetail.questions.length > 0 &&
<p className="padding20-30 clearfix edu-txt-left" style={{background:"#fafafa"}}>
{ !pollDetail || !pollDetail.question_types || pollDetail.question_types.q_counts===0 ? "" :
<span className="color-grey-3">
{
pollDetail && pollDetail.question_types && pollDetail.question_types.q_counts > 0 &&
<span>合计{pollDetail.question_types && pollDetail.question_types.q_counts}</span>
}
{
pollDetail && pollDetail.question_types.q_singles > 0 &&
<span className="mr15 color-grey-9">单选题{pollDetail.question_types.q_singles}</span>
}
{
pollDetail && pollDetail.question_types.q_doubles > 0 &&
<span className="mr15 color-grey-9">多选题{pollDetail.question_types.q_doubles}</span>
}
{
pollDetail && pollDetail.question_types.q_mains > 0 &&
<span className="color-grey-9">主观题{pollDetail.question_types.q_mains}</span>
}
</span>
}
</p>
}
{
pollDetail && pollDetail.questions && pollDetail.questions.length > 0 && pollDetail.questions.map((item,key)=>{
return(
<div className="previewList">
<p className="pl30 pr30 pt30 pb15 font-16 clearfix">
@ -120,6 +124,10 @@ class PollDetailTabThirdInfo extends Component{
)
})
}
{
pollDetail && pollDetail.questions && pollDetail.questions.length == 0 && <NoneData></NoneData>
}
</div>
: ""
}

@ -112,13 +112,27 @@ class ShixunsHome extends Component {
}
const MyRate = ({ defaultValue, ...rest }) => {
let myValue = defaultValue;
// console.log(myValue-Math.floor(myValue))
// if (myValue < Math.ceil(myValue)) {
// myValue = Math.floor(myValue) + 0.5;
// }
return <Rating {...rest} value={myValue} />;
};
let shixuntype=false;
let pathstype=false;
if(this.props&&this.props.mygetHelmetapi!=null){
console.log(this.props.mygetHelmetapi.navbar)
let shixun="/shixuns";
let paths="/paths";
this.props.mygetHelmetapi.navbar.map((item,key)=>{
var reg = RegExp(item.link);
if(shixun.match(reg)){
shixuntype=true
}
if(paths.match(reg)){
pathstype=true
}
})
}
return (
<div className="newMain clearfix backFAFAFA shixunsHome">
{this.state.updata===undefined?"":<UpgradeModals
@ -162,7 +176,7 @@ class ShixunsHome extends Component {
))}
</Slider>
}
<div className="user_navlist">
{this.props.user&&this.props.user.main_site===true?<div className="user_navlist">
<div className="user_navlist_black">
<ul className="black_nav_list">
{homedatalist === undefined ? "" :homedatalistreps.map((item,key)=>{
@ -212,13 +226,13 @@ class ShixunsHome extends Component {
}
</ul>
</div>
</div>
</div>:""}
</div>
</div>
{/*实训路径*/}
<div className="clearfix pt20 educontent pr pb20">
{pathstype===true?<div className="clearfix pt20 educontent pr pb20">
<div className="edu-txt-center">
<p className="color-dark edu-txt-center font-24" style={{lineHeight: '30px'}}>实践课程</p>
<p className="color-grey-cd font-12">TRAINING COURSE</p>
@ -294,10 +308,10 @@ class ShixunsHome extends Component {
}
</div>
</div>
</div>:""}
{/*精选实训 改为 开发社区*/}
<div className="clearfix pt20 educontent pr pb20">
{shixuntype===true?<div className="clearfix pt20 educontent pr pb20">
<div className="edu-txt-center">
<p className="color-dark edu-txt-center font-24" style={{lineHeight: '30px'}}>实训项目</p>
<p className="color-grey-cd font-12">DEVELOPMENT COMMUNITY</p>
@ -389,13 +403,13 @@ class ShixunsHome extends Component {
</div>
</div>
</div>:""}
{/*导师排行榜*/}
{/*导师排行榜*/}
{ homedatalist !== undefined && homedatalist.teachers !== undefined && (
<div className="pt60 pb60 mb30 mentor-ranking">
this.props.user&&this.props.user.main_site===true?<div className="pt60 pb60 mb30 mentor-ranking">
<div className="educontent">
<div className="edu-txt-center">
<p className="color-dark edu-txt-center font-24" style={{lineHeight: '30px'}}>导师排行榜</p>
@ -470,12 +484,12 @@ class ShixunsHome extends Component {
</div>
</div>
</div>:""
)}
{/*程序员排行榜*/}
{ homedatalist !== undefined && homedatalist.students !== undefined && (
<div className="pt60 pb60 mb30 pro-ranking">
this.props.user&&this.props.user.main_site===true?<div className="pt60 pb60 mb30 pro-ranking">
<div className="educontent">
<div className="edu-txt-center">
<p className="color-dark edu-txt-center font-24" style={{lineHeight: '30px'}}>程序员排行榜</p>
@ -546,7 +560,7 @@ class ShixunsHome extends Component {
</ul>
</div>
</div>
</div>
</div>:""
)}
</div>
</Spin>

@ -876,7 +876,7 @@ submittojoinclass=(value)=>{
// console.log(mygetHelmetapi2);
// console.log("NewHeadermygetHelmetapi123123123123");
// console.log(mygetHelmetapi2);
// console.log(this.props);
return (
<div className="newHeaders" id="nHeader" >
@ -1244,12 +1244,12 @@ submittojoinclass=(value)=>{
{/*href="https://www.educoder.net/login"*/}
<div className="fr head-right">
{/*{ loadHeader()}*/}
{showSearchOpentype===true?"":<a id="search-open" className="fl mr30 headIcon" onClick={(e)=>this.showSearchOpen(e)}>
{showSearchOpentype===true?"":this.props.user&&this.props.user.main_site===true?<a id="search-open" className="fl mr30 headIcon" onClick={(e)=>this.showSearchOpen(e)}>
{/*"/images/educoder/icon/search.svg"
<img src={getImageUrl(`images/educoder/icon/search.svg`)} /> */}
<i className="iconfont icon-sousuo color-white"></i>
</a>}
</a>:""}
{/*</div>*/}
<div className="fl mr30 edu-menu-panel headIcon">

@ -216,5 +216,6 @@ body>.-task-title {
.logoimg{
float: left;
width: 40px;
min-width: 40px;
height:40px;
}

@ -118,7 +118,7 @@ class TPMRightSection extends Component {
}
<div className="padding20 edu-back-white mb10 mt10" style={{
{this.props.user&&this.props.user.main_site===true?<div className="padding20 edu-back-white mb10 mt10" style={{
display: TPMRightSectionData === undefined?"none":TPMRightSectionData.paths===undefined?"":TPMRightSectionData.paths.length === 0 ? "none" : "block"
}}>
<p className="mb20 font-16 clearfix">所属课程</p>
@ -159,10 +159,10 @@ class TPMRightSection extends Component {
})
}
</div>
</div>
</div>:""}
{TPMRightSectionData === undefined?"":TPMRightSectionData.paths===undefined?"":TPMRightSectionData.paths.length === 0 ? "" :
<div className="padding20 edu-back-white"
this.props.user&&this.props.user.main_site===true?<div className="padding20 edu-back-white"
style={{
display:
TPMRightSectionData === undefined?"none":TPMRightSectionData.recommands===undefined?"none":TPMRightSectionData.recommands.length === 0 ? "none" : "block"
@ -191,8 +191,8 @@ class TPMRightSection extends Component {
})
}
</div>
</div> }
</div>:""
}
</div>
}
</div>

@ -34,7 +34,7 @@ class InfosBanner extends Component{
// console.log(is_current)
// console.log(current_user)
// console.log(current_user.is_teacher)
// console.log(current_user.admin)
return(
<div className="bannerPanel mb60">
<div className="educontent">
@ -116,20 +116,20 @@ class InfosBanner extends Component{
{/* onClick={() => this.setState({moduleName: 'package'})}*/}
{/* to={`/users/${username}/package`}>众包</Link>*/}
{/*</li>*/}
{((is_current && current_user && current_user.is_teacher ) || current_user && current_user.admin)
{this.props.user&&this.props.user.main_site===true?((is_current && current_user && current_user.is_teacher ) || current_user && current_user.admin)
&& <li className={`${moduleName == 'videos' ? 'active' : '' }`}>
<Link
onClick={() => this.setState({moduleName: 'videos'})}
to={`/users/${username}/videos`}>视频</Link>
</li>}
</li>:""}
{/*自己的主页且不是学生显示题库按钮*/}
{(is_current && current_user&& current_user.is_teacher )
{this.props.user&&this.props.user.main_site===true?(is_current && current_user&& current_user.is_teacher )
&&<li className={`${moduleName == 'topics' ? 'active' : '' }`}>
<Link
onClick={() => this.setState({moduleName: 'topics'})}
to={`/users/${username}/topics/personal`}>题库</Link>
</li>}
</li>:""}
</div>
</div>

Loading…
Cancel
Save