Merge branch 'dev_aliyun' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

issues25489
cxt 5 years ago
commit 960d2674c8

@ -63,16 +63,23 @@ $(document).on('turbolinks:load', function() {
theme: 'bootstrap4',
placeholder: '请输入实训名称/创建者检索',
multiple: true,
minimumInputLength: 1,
closeOnSelect: false,
ajax: {
delay: 500,
url: '/admins/laboratories/' + laboratoryId + '/shixuns_for_select',
dataType: 'json',
data: function(params){
return { keyword: params.term };
return { keyword: params.term, page: params.page || 1, per_page: 20 };
},
processResults: function(data){
return { results: data.shixuns }
processResults: function(data, params){
params.page = params.page || 1;
return {
results: data.shixuns,
pagination: {
more: (params.page * 20) < data.count
}
};
}
},
templateResult: function (item) {

@ -85,16 +85,23 @@ $(document).on('turbolinks:load', function() {
theme: 'bootstrap4',
placeholder: '请输入课程名称/创建者检索',
multiple: true,
minimumInputLength: 1,
closeOnSelect: false,
ajax: {
delay: 500,
url: '/admins/laboratories/' + laboratoryId + '/subjects_for_select',
dataType: 'json',
data: function(params){
return { keyword: params.term };
return { keyword: params.term, page: params.page || 1, per_page: 20 }
},
processResults: function(data){
return { results: data.subjects }
processResults: function(data, params){
params.page = params.page || 1;
return {
results: data.subjects,
pagination: {
more: (params.page * 20) < data.count
}
};
}
},
templateResult: function (item) {

@ -26,10 +26,12 @@ class Admins::LaboratoriesController < Admins::BaseController
keyword = params[:keyword].to_s.strip
if keyword.present?
like_sql = 'shixuns.name LIKE :keyword OR CONCAT(users.lastname, users.firstname) LIKE :keyword'
shixuns = shixuns.joins(:user).where(like_sql, keyword: "%#{keyword}%")
like_sql = 'shixuns.name LIKE :keyword OR CONCAT(users.lastname, users.firstname) LIKE :keyword '\
'OR mirror_repositories.name LIKE :keyword'
shixuns = shixuns.joins(:user, :mirror_repositories).where(like_sql, keyword: "%#{keyword}%")
end
@count = shixuns.count
@shixuns = paginate(shixuns.includes(:user))
end
@ -44,6 +46,7 @@ class Admins::LaboratoriesController < Admins::BaseController
subjects = subjects.joins(:user).where(like_sql, keyword: "%#{keyword}%")
end
@count = subjects.count
@subjects = paginate(subjects.includes(:user))
end

@ -1,3 +1,4 @@
json.count @count
json.shixuns do
json.array! @shixuns do |shixun|
json.extract! shixun, :id, :name, :status

@ -1,3 +1,4 @@
json.count @count
json.subjects do
json.array! @subjects do |subject|
json.extract! subject, :id, :name, :status

@ -1,10 +1,10 @@
<% sidebar_collapse = request.cookies['admin_sidebar_collapse'].to_s == 'true' %>
<nav id="sidebar" class="<%= sidebar_collapse ? 'active' : '' %>" data-current-controller="<%= admin_sidebar_controller %>">
<div class="sidebar-header">
<div class="sidebar-header-logo">
<a href="/" class="sidebar-header-logo" data-toggle="tooltip" data-title="返回主站" >
<img class="rounded-circle" src="/images/<%= url_to_avatar(current_user) %>" />
<span class="logo-label">后台管理</span>
</div>
</a>
<div id="sidebarCollapse" class="navbar-btn <%= sidebar_collapse ? 'active' : '' %>">
<i class="fa fa-chevron-left fold" data-toggle="tooltip" data-placement="right" data-boundary="window" title="收起"></i>
<i class="fa fa-bars unfold" data-toggle="tooltip" data-placement="right" data-boundary="window" title="展开"></i>

@ -2,6 +2,7 @@ admins-mirror_scripts: 'admins-mirror_repositories'
admins-laboratory_settings: 'admins-laboratories'
admins-carousels: 'admins-laboratories'
admins-laboratory_shixuns: 'admins-laboratories'
admins-laboratory_subjects: 'admins-laboratories'
admins-competition_settings: 'admins-competitions'
admins-enroll_lists: 'admins-competitions'
admins-competition_prize_users: 'admins-competitions'

File diff suppressed because one or more lines are too long

@ -137758,16 +137758,23 @@ $(document).on('turbolinks:load', function() {
theme: 'bootstrap4',
placeholder: '请输入实训名称/创建者检索',
multiple: true,
minimumInputLength: 1,
closeOnSelect: false,
ajax: {
delay: 500,
url: '/admins/laboratories/' + laboratoryId + '/shixuns_for_select',
dataType: 'json',
data: function(params){
return { keyword: params.term };
return { keyword: params.term, page: params.page || 1, per_page: 20 };
},
processResults: function(data){
return { results: data.shixuns }
processResults: function(data, params){
params.page = params.page || 1;
return {
results: data.shixuns,
pagination: {
more: (params.page * 20) < data.count
}
};
}
},
templateResult: function (item) {
@ -137900,16 +137907,23 @@ $(document).on('turbolinks:load', function() {
theme: 'bootstrap4',
placeholder: '请输入课程名称/创建者检索',
multiple: true,
minimumInputLength: 1,
closeOnSelect: false,
ajax: {
delay: 500,
url: '/admins/laboratories/' + laboratoryId + '/subjects_for_select',
dataType: 'json',
data: function(params){
return { keyword: params.term };
return { keyword: params.term, page: params.page || 1, per_page: 20 }
},
processResults: function(data){
return { results: data.subjects }
processResults: function(data, params){
params.page = params.page || 1;
return {
results: data.subjects,
pagination: {
more: (params.page * 20) < data.count
}
};
}
},
templateResult: function (item) {

@ -3,7 +3,7 @@ import React,{ Component } from "react";
import {
Form, Input, InputNumber, Switch, Radio,
Slider, Button, Upload, Icon, Rate, Checkbox, message,
Row, Col, Select, Modal, Divider
Row, Col, Select, Modal, Divider,Tooltip
} from 'antd';
import TPMMDEditor from '../../tpm/challengesnew/TPMMDEditor';
import axios from 'axios'
@ -29,7 +29,8 @@ class BoardsNew extends Component{
fileList: [],
boards: [],
title_num: 0,
email_notify:false
email_notify:false,
isemail_notify:false
}
}
addSuccess = () => {
@ -98,7 +99,7 @@ class BoardsNew extends Component{
}
})
this.setState({ fileList: _fileList, board_name: data.board_name, title_num: parseInt(data.subject.length) })
this.setState({ fileList: _fileList, board_name: data.board_name, title_num: parseInt(data.subject.length) ,isemail_notify:response.data.data.email_notify})
}
}
})
@ -136,6 +137,7 @@ class BoardsNew extends Component{
select_board_id: values.select_board_id,
content: values.content,
sticky: values.sticky,
email_notify:this.state.isemail_notify,
attachment_ids,
})
.then((response) => {
@ -160,7 +162,7 @@ class BoardsNew extends Component{
axios.post(url, {
...values,
email_notify:this.state.email_notify,
email_notify:this.state.isemail_notify,
course_id: cid,
attachment_ids,
})
@ -253,7 +255,7 @@ class BoardsNew extends Component{
setemailchange=(e)=>{
this.setState({
email_notify:e.target.checked
isemail_notify:e.target.checked
})
}
render() {
@ -299,6 +301,7 @@ class BoardsNew extends Component{
const isCourseEnd = this.props.isCourseEnd();
document.title=this.props.coursedata&&this.props.coursedata.name;
// console.log(this.state)
return(
<div className="newMain ">
<AddDirModal {...this.props}
@ -338,13 +341,17 @@ class BoardsNew extends Component{
{/* notRequired */}
<Form {...formItemLayout} onSubmit={this.handleSubmit}>
<div className="formBlock" style={{paddingBottom: '0px', position: 'relative'}}>
{this.state.boardsdata&&this.state.boardsdata.email_notify===true?this.props.isAdminOrTeacher()===true?<Tooltip placement="bottom" title={this.state.isemail_notify?"邮件只能发送一次":""}><span className={"setemail fr mr70 setemailposition"}>
<Checkbox onChange={this.setemailchange} checked={this.state.isemail_notify} disabled={this.state.isemail_notify}>发送邮件提醒</Checkbox>
</span></Tooltip>:"":""}
{ isAdmin &&
<React.Fragment>
{getFieldDecorator('sticky', {
valuePropName: 'checked',
})(
isAdmin && <Checkbox style={{ right: '22px',
top: '28px',
top: '17px',
position: 'absolute'
}}>置顶</Checkbox>
)}
@ -411,9 +418,7 @@ class BoardsNew extends Component{
</Select>
)}
</Form.Item>
{this.state.boardsdata&&this.state.boardsdata.email_notify===true?this.props.isAdminOrTeacher()===true?this.isEdit ?"":<span className={"setemail"}>
<Checkbox onChange={this.setemailchange} checked={this.state.email_notify}>发送邮件提醒</Checkbox>
</span>:"":""}
{/* { isAdmin && <Form.Item

@ -728,7 +728,7 @@ class CommonWorkSetting extends Component{
course_id ,
unified_setting: unified_setting, // 统一设置
group_settings: group_settings_param,
publish_time: temp_end_time ? new Date(temp_publish_time.replace(/-/g, '/')) : temp_end_time, // 发布
publish_time: temp_publish_time ? new Date(temp_publish_time.replace(/-/g, '/')) : temp_publish_time, // 发布
end_time: temp_end_time ? new Date(temp_end_time.replace(/-/g, '/')) : temp_end_time, // 截止
late_penalty: late_penalty, // 迟交扣分
allow_late: allow_late, // 是否允许补交

@ -49,4 +49,10 @@
display: inline;
margin-left: 10px;
}
/* errorInline ----------- */
/* errorInline ----------- */
.setemailposition{
position: absolute;
right: 40px;
top: 10px;
}

@ -26,6 +26,7 @@ import './leftView.css'
import CodeEvaluateMultiLevelAnswerUnlock from './CodeEvaluateMultiLevelAnswerUnlock'
import MUIDialogStyleUtil from '../component/MUIDialogStyleUtil'
import moment from 'moment';
// http://danilowoz.com/create-react-content-loader/
const MyLoader = () => (
<ContentLoader
@ -35,16 +36,16 @@ const MyLoader = () => (
primaryColor={"#000000"}
secondaryColor={"#ecebeb"}
>
<rect x="0" y="10" rx="3" ry="3" width="320" height="6.4" />
<rect x="0" y="35" rx="3" ry="3" width="85" height="10" />
<rect x="0" y="60" rx="3" ry="3" width="350" height="6.4" />
<rect x="0" y="80" rx="3" ry="3" width="350" height="6.4" />
<rect x="0" y="100" rx="3" ry="3" width="350" height="6.4" />
<rect x="0" y="120" rx="3" ry="3" width="101" height="6.4" />
<rect x="0" y="145" rx="3" ry="3" width="65" height="10" />
<rect x="0" y="170" rx="3" ry="3" width="350" height="6.4" />
<rect x="0" y="190" rx="3" ry="3" width="350" height="6.4" />
<rect x="0" y="10" rx="3" ry="3" width="320" height="6.4" />
<rect x="0" y="35" rx="3" ry="3" width="85" height="10" />
<rect x="0" y="60" rx="3" ry="3" width="350" height="6.4" />
<rect x="0" y="80" rx="3" ry="3" width="350" height="6.4" />
<rect x="0" y="100" rx="3" ry="3" width="350" height="6.4" />
<rect x="0" y="120" rx="3" ry="3" width="101" height="6.4" />
<rect x="0" y="145" rx="3" ry="3" width="65" height="10" />
<rect x="0" y="170" rx="3" ry="3" width="350" height="6.4" />
<rect x="0" y="190" rx="3" ry="3" width="350" height="6.4" />
<rect x="0" y="210" rx="3" ry="3" width="201" height="6.4" />
</ContentLoader>
)
@ -59,7 +60,7 @@ const styles = MUIDialogStyleUtil.getTwoButtonStyle(
width: '36px',
height: '36px',
}
}
}
}
)
@ -86,7 +87,7 @@ class LeftView extends Component {
// style={{marginRight: '6px'}}
// />,
// <Button
// variant="raised"
// variant="raised"
// label="确定"
// primary={true}
// onClick={handleDialogReadAnswer}
@ -97,14 +98,14 @@ class LeftView extends Component {
// isMultiLevelAnswer = true
const is_teacher = user.is_teacher
let contentText = is_teacher ?
let contentText = is_teacher ?
<React.Fragment>
<p>{`已经过职业认证的教师可以免金币查看答案哟~`}</p>
<p>{`将扣除${challenge.score}点金币,是否确认查看答案`}</p>
<p><a onClick={()=>this.goToCertification()}
<p><a onClick={()=>this.goToCertification()}
style={{textDecoration: 'underline', color: '#4CACFF'}}>立即认证</a></p>
</React.Fragment>
:
:
<React.Fragment>
<p>{`先查看参考答案,再通过评测的学生,实训作业有可能是零分哦~`}</p>
<p>{`将扣除${challenge.score}点金币,是否确认查看答案`}</p>
@ -112,13 +113,13 @@ class LeftView extends Component {
// 多级别解锁
if (isMultiLevelAnswer) {
// power === 0 &&
contentText = ( is_teacher ) ?
// power === 0 &&
contentText = ( is_teacher ) ?
            <React.Fragment>
             <p>{`已经过职业认证的教师可以免金币查看答案哟~`}</p>
<p><a style={{textDecoration: 'underline'}} onClick={()=>this.goToCertification()}
style={{ color: '#1890ff', 'margin-top': '6px', display: 'inline-block'}}>立即认证</a></p>
<CodeEvaluateMultiLevelAnswerUnlock
<CodeEvaluateMultiLevelAnswerUnlock
ref="answerUnlock" lockedAnswers={lockedAnswers} unlockedAnswers={unlockedAnswers}
challenge={challenge}
>
@ -128,7 +129,7 @@ class LeftView extends Component {
            <React.Fragment>
<p>{`先查看参考答案,再通过评测的学生,实训作业将被扣分`}</p>
{/* { MultiLevelUnlockTable } */}
<CodeEvaluateMultiLevelAnswerUnlock
<CodeEvaluateMultiLevelAnswerUnlock
ref="answerUnlock" lockedAnswers={lockedAnswers} unlockedAnswers={unlockedAnswers}
challenge={challenge}
>
@ -136,13 +137,13 @@ class LeftView extends Component {
            </React.Fragment>;
}
/**
/**
{ is_teacher ? <Button size="small" variant="raised" style={{ marginRight: '20px'}}
onClick={()=>this.goToCertification()} color="primary">
{ '立即认证' }
</Button> : ''}
*/
*/
return (
<React.Fragment>
@ -150,7 +151,7 @@ class LeftView extends Component {
open={dialogOpen}
disableEscapeKeyDown={true}
onClose={handleDialogClose}
>
>
<DialogTitle id="alert-dialog-title">{"提示"}</DialogTitle>
<DialogContent id="dialog-content" >
<DialogContentText id="alert-dialog-description" style={{textAlign: 'center'}}>
@ -159,32 +160,32 @@ class LeftView extends Component {
</DialogContent>
{/* http://localhost:3000/account/professional_certification */}
<DialogActions id="dialog-actions">
<Button onClick={handleDialogClose} color="primary" className={`${classes.button} ${classes.buttonGray}`}>
取消
</Button>
{/* variant={ is_teacher ? "flat" : "raised"} */}
<Button size="medium" variant={"raised"}
className={`${classes.button} `}
onClick={() => handleDialogReadAnswer(this.refs.answerUnlock ? this.refs.answerUnlock.getSelectedId() : '')}
onClick={() => handleDialogReadAnswer(this.refs.answerUnlock ? this.refs.answerUnlock.getSelectedId() : '')}
color="primary" autoFocus>
{ is_teacher ? '继续查看' : '确定'}
</Button>
</DialogActions>
</Dialog>
<div className="-fit -layout-v">
<div className="-layout-v -flex -bg-white -task-ml80">
{/*新界面关卡名称显示、关卡金币显示*/}
<div id="task_name_section" className="task_name_section">
{ loading ? "" :
<React.Fragment>
<Tooltip title={ "点击查看全部任务" } disableFocusListener={true}>
<IconButton color="default" mini={''} aria-label="edit" className={classes.iconButton}
<IconButton color="default" mini={''} aria-label="edit" className={classes.iconButton}
onClick={onDrawerButtonClick}>
<i className={ "fa font-18 fa-list-ul" }></i>
</IconButton>
@ -223,15 +224,15 @@ class LeftView extends Component {
<div id="tab_con_1" className="tab-info" style={ tabIndex === 0 ? {display: 'block'} : {display: 'none'} }>
<div className="fit -scroll">
<div className="-layout-v -fit">
{ loading ?
<div className="-flex -scroll task-padding16 panel-box-sizing new_li break_word markdown-body editormd-html-preview"
{ loading ?
<div className="-flex -scroll task-padding16 panel-box-sizing new_li break_word markdown-body editormd-html-preview"
unselectable="on">
<CircularProgress size={40} thickness={3} className="circularProgress"
style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '40% !important', display: 'block' }}/>
style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '40% !important', display: 'block' }}/>
</div> : ""
}
<div className="-flex -scroll task-padding16 panel-box-sizing new_li break_word markdown-body editormd-html-preview"
<div className="-flex -scroll task-padding16 panel-box-sizing new_li break_word markdown-body editormd-html-preview"
unselectable="on" id="game_task_pass" style={loading ? {display:'none'} : {}}>
</div>
</div>
@ -242,7 +243,7 @@ class LeftView extends Component {
<div className="fit -scroll">
<div className="-layout-v -fit">
<div className="-flex -scroll task-padding16 panel-box-sizing new_li markdown-body editormd-html-preview" unselectable="on" id="game_ready_knowledge">
</div>
</div>
</div>
@ -253,8 +254,8 @@ class LeftView extends Component {
<div className="-layout-v -fit" style={{ overflowY: 'scroll' }}>
{/* markdown markdownToHTML markdownsetMarkdown
<textarea style={{display:'none'}} id="editorMd_contents" value={gameAnswer}></textarea>*/}
{ (!unlockedAnswers || unlockedAnswers.length === 0) && (!lockedAnswers || lockedAnswers.length === 0) &&
<div className="-flex -scroll task-padding16 panel-box-sizing new_li" id="game_answer_show"
style={{ display: st === 0 ? 'block' : 'none' }}>
@ -283,8 +284,10 @@ class LeftView extends Component {
}
.multiLevelAnswer .status{
color: #CDCDCD;
flex: 0 0 45px;
}
}
.multiLevelAnswer .lock-time{
margin-right: 15px;
}
.markdown-body ol, .markdown-body ul {
padding-left: 2.5em;
}
@ -292,13 +295,17 @@ class LeftView extends Component {
<div className="multiLevelAnswer">
{ unlockedAnswers && unlockedAnswers.map((item, index) => {
const {name, contents, view_time} = item;
return <div className="anwserSection">
<div className="df">
<div className="level">级别{index + 1}</div>
<div className="name">{item.name}</div>
<div className="status">已解锁</div>
<div className="name">{name}</div>
<div className="status">
<span className="lock-time">{view_time ? moment(view_time).format('YYYY-MM-DD HH:mm') : ''}</span>
已解锁
</div>
</div>
<div className="contents markdown-body" dangerouslySetInnerHTML={{__html: markdownToHTML(item.contents)}}>
<div className="contents markdown-body" dangerouslySetInnerHTML={{__html: markdownToHTML(contents)}}>
</div>
</div>
})}
@ -308,19 +315,19 @@ class LeftView extends Component {
<div className="df">
<div className="level">级别{index + 1 + (unlockedAnswers ? unlockedAnswers.length : 0)}</div>
<div className="name">{item.name}</div>
<div
<div
className="status" onClick={ () => { this.props.showUnlockAnswerDialog(item) } }
style={{ color: '#4CACFF', cursor: 'pointer' }}
>解锁</div>
</div>
</div>
})}
</div>
{ st === 1 ?
<div className="-flex -scroll task-padding16 panel-box-sizing new_li" id="game_answer_show_choose"
{ st === 1 ?
<div className="-flex -scroll task-padding16 panel-box-sizing new_li" id="game_answer_show_choose"
>
<ChooseAnswerView gameAnswer={gameAnswer}></ChooseAnswerView>
</div>
@ -338,8 +345,8 @@ class LeftView extends Component {
</div>
</div>
<div id="tab_con_4" className="commentTab tab-info commentsDelegateParent" style={ tabIndex === 3 ? {display: 'block'} : {display: 'none'} }>
{ loadingComments ?
<CircularProgress size={40} thickness={3} style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '40%', display: 'block' }}/> :
{ loadingComments ?
<CircularProgress size={40} thickness={3} style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '40%', display: 'block' }}/> :
<CommentContainer {...this.props}></CommentContainer>
}
</div>

@ -1,92 +1,123 @@
/*------------------------------- TaskList Start */
#all_task_index {
color: #fff;
background: #111C24;
}
.panel-list:last-child {
margin-bottom: 50px;
}
.-task-list-title a, .-task-list-title a:link, .-task-list-title a:visited {
color: #BCC6CD;
}
.-task-list-inner {
background: none;
border-bottom: 1px solid #222C34;
padding-bottom: 16px;
}
#all_task_index .fa-play-circle {
color: white;
}
#all_task_index .panel-list {
position: relative;
}
#all_task_index .current .currentSelected {
border-left: 3px solid #4CACFF;
height: 22px;
width: 0px;
position: absolute;
top: 8px;
}
#all_task_index .grades {
color: #747A7F;
}
.-task-list-title {
color: #BCC6CD;
}
#all_task_index .positive.info-partly span {
color: #45E660;
}
#all_task_index .negative.info-partly span {
color: #FF954C;
}
#all_task_index .notFinish .info-partly span {
color: #747A7F !important;
}
#all_task_index #shixun_exp_118 span {
/*color: #45E660;*/
}
#all_task_index #shixun_grade_118 span {
/*color: #FF954C;*/
}
#all_task_index #shixun_tag_118 span {
color: #FFF;
}
.rateRow {
margin-left: 20px;
font-size: 13px;
margin-top: 6px;
}
.rateRow .rc-rate {
margin-top: -5px;
margin-left: 3px;
}
.rateRow .rc-rate-star {
color: #9A9A9A;
}
.rateRow .starTip {
color: #666666;
font-size: 13px;
}
.rateRow .starNumber {
color: #FFA800;
margin-left: 4px;
}
.rateRow .unstar .starNumber {
cursor: pointer;
}
.rateRow .unstar .starNumber:hover {
text-decoration: underline;
}
.rateRow .stared .starNumber {
}
.rateRow .rc-rate-star-half .rc-rate-star-first, .rateRow .rc-rate-star-full .rc-rate-star-second {
color: #FFA800;
}
/*------------------------------- TaskList End */
/*------------------------------- TaskList Start */
#all_task_index {
color: #fff;
background: #111C24;
}
.panel-list:last-child {
margin-bottom: 50px;
}
.-task-list-title a, .-task-list-title a:link, .-task-list-title a:visited {
color: #BCC6CD;
}
.-task-list-inner {
background: none;
border-bottom: 1px solid #222C34;
padding-bottom: 16px;
}
#all_task_index .fa-play-circle {
color: white;
}
#all_task_index .panel-list {
position: relative;
}
#all_task_index .current .currentSelected {
border-left: 3px solid #4CACFF;
height: 22px;
width: 0px;
position: absolute;
top: 8px;
}
#all_task_index .grades {
color: #747A7F;
}
.-task-list-title {
color: #BCC6CD;
}
#all_task_index .positive.info-partly span {
color: #45E660;
}
#all_task_index .negative.info-partly span {
color: #FF954C;
}
#all_task_index .notFinish .info-partly span {
color: #747A7F !important;
}
#all_task_index #shixun_exp_118 span {
/*color: #45E660;*/
}
#all_task_index #shixun_grade_118 span {
/*color: #FF954C;*/
}
#all_task_index #shixun_tag_118 span {
color: #FFF;
}
.rateRow {
margin-left: 20px;
font-size: 13px;
margin-top: 6px;
}
.rateRow .rc-rate {
margin-top: -5px;
margin-left: 3px;
}
.rateRow .rc-rate-star {
color: #9A9A9A;
}
.rateRow .starTip {
color: #666666;
font-size: 13px;
}
.rateRow .starNumber {
color: #FFA800;
margin-left: 4px;
}
.rateRow .unstar .starNumber {
cursor: pointer;
}
.rateRow .unstar .starNumber:hover {
text-decoration: underline;
}
.rateRow .stared .starNumber {
}
.rateRow .rc-rate-star-half .rc-rate-star-first, .rateRow .rc-rate-star-full .rc-rate-star-second {
color: #FFA800;
}
.tip-info-wrap{
background-color: #111C24;
padding: 20px 0px;
}
.tip-info-wrap .tip-info{
display: flex;
background: #707070;
border: 1px solid rgba(112,112,112,1);
border-radius: 100px;
width: 375px;
height: 52px;
font-size: 12px;
align-items: center;
align-items: space-around;
margin: 0 auto;
padding: 0 20px;
}
.finish-wrap{
display: flex;
padding: 0 0px 0 20px;
margin-top: 10px;
}
.finish-wrap .finish-time{
flex: 1;
}
.finish-time .time-title{
color: #747A7F;
margin-right: 5px;
}
/*------------------------------- TaskList End */

@ -1,124 +1,140 @@
import React, { Component } from 'react';
import { BrowserRouter as Router, Route, Link } from "react-router-dom";
import { CircularProgress } from 'material-ui/Progress';
import Rate from 'rc-rate';
import 'rc-rate/assets/index.css';
import './TaskList.css'
import classNames from 'classnames'
class TaskList extends Component {
onChange() {
}
renderTasks() {
const { challenges, challenge, shixun, onChallengesDrawerClose, myshixun_manager } = this.props;
const currentChallenge = challenge;
const taskArray = challenges.map( (challenge, index) => {
challenge.experience = challenge.get_experience
challenge.gold = challenge.get_gold
challenge.subject = challenge.name
const showExp = (challenge.experience > 0 && challenge.status === 2) ? '+' + challenge.experience : challenge.experience
const showGold = (challenge.gold > 0 && challenge.status === 2) ? '+' + challenge.gold : challenge.gold
return (
<div className={classNames("panel-list", {'current': (currentChallenge.position-1) === index})} key={index}>
<div className="currentSelected"></div>
<div className=" clearfix -task-list-inner" id="game_status_118">
{/* 允许跳关的设置 */}
<h4 className=" -task-list-title fl">
{shixun.status<2 || challenge.status === 2 || (challenges[index-1] && challenges[index-1].status === 2)
|| shixun.task_pass || myshixun_manager === true ?
<Link to={`/tasks/${challenge.identifier}`} onClick={onChallengesDrawerClose}>{index+1}. {challenge.subject}</Link>
:
<span>{index+1}. {challenge.subject}</span>}
</h4>
<a className="fr">
{challenge.status === 2 ?
<i data-tip-down="已完成" className="fa fa-check-circle color-light-green fr font-16 mt5 -text-danger w20_center"></i>
:
<i data-tip-down="待完成" className="fa fa-check-circle fr font-16 mt5 color-light-grey w20_center"></i>
}
</a>
<div className="cl"></div>
<div style={{display: 'flex'}} className={`grades with80 ml20 ${challenge.status === 2 ? '' : 'notFinish'}`}>
<span className={`font-12 mr15 info-partly ${(challenge.status === 2 && challenge.experience > 0) ? 'positive ' : 'negative'}`} id="shixun_exp_118">
经验值<span className="ml5">
{ showExp }
</span>
</span>
<span className={`font-12 mr15 info-partly ${(challenge.status === 2 && challenge.experience > 0) ? 'positive ' : 'negative'}`} id="shixun_grade_118">
金币<span className="ml5">
{/*因为关卡金币和经验值是一样的,所以这里可以直接用经验值*/}
{ showGold }
</span>
</span>
<span className=" font-12 mr15 info-partly" id="shixun_tag_118">
{ challenge.tag_count ?
<React.Fragment>
技能标签<span className="ml5">{challenge.tag_count || '无'}</span>
</React.Fragment>
: '' }
</span>
</div>
{ shixun.status >= 2 && <div className="rateRow">
{/* 已完成、未评分 */}
{challenge.status === 2 && challenge.star === 0?
<div className="unstar">
<span className="starTip">给个评分吧</span>
<Rate
defaultValue={0}
onChange={(value) => this.props.onStarChange(challenge, index, value)}
/>
<span className="starNumber" onClick={()=>this.props.saveChallengeStar(challenge, index)}>评价</span>
</div>
:
challenge.status === 2 && challenge.star > 0 ?
<div className="stared">
<span className="starTip">已评分</span>
<Rate
defaultValue={challenge.star}
disabled
/>
<span className="starNumber">{challenge.star}</span>
</div>
: ''}
</div> }
</div>
</div>
)
})
return taskArray;
}
render() {
const { taskListLoading } = this.props;
return (
<div className="page--over">
<div className="col-width-3 -scroll" style={{height: '100%'}} id="all_task_index">
{ taskListLoading ?
<CircularProgress size={40} thickness={3} style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '40%', display: 'block' }}/> :
this.renderTasks()
}
</div>
</div>
);
}
/*
<a className="fr"><i data-tip-down="待完成" className="fa fa-play-circle color-light-green fr font-18 mt5 -text-danger w20_center"></i></a>
<div className="-task-list-header clearfix">
<h3 className="fl">全部任务</h3>
</div>
*/
}
export default TaskList;
import React, { Component } from 'react';
import { BrowserRouter as Router, Route, Link } from "react-router-dom";
import { CircularProgress } from 'material-ui/Progress';
import moment from 'moment';
import Rate from 'rc-rate';
import 'rc-rate/assets/index.css';
import './TaskList.css'
import classNames from 'classnames'
class TaskList extends Component {
onChange() {
}
renderTasks() {
const { challenges, challenge, shixun, onChallengesDrawerClose, myshixun_manager } = this.props;
const currentChallenge = challenge;
const taskArray = challenges.map( (challenge, index) => {
challenge.experience = challenge.get_experience
challenge.gold = challenge.get_gold
challenge.subject = challenge.name
const {finished_time, view_answer_time} = challenge;
const showExp = (challenge.experience > 0 && challenge.status === 2) ? '+' + challenge.experience : challenge.experience
const showGold = (challenge.gold > 0 && challenge.status === 2) ? '+' + challenge.gold : challenge.gold
return (
<div className={classNames("panel-list", {'current': (currentChallenge.position-1) === index})} key={index}>
<div className="currentSelected"></div>
<div className=" clearfix -task-list-inner" id="game_status_118">
{/* 允许跳关的设置 */}
<h4 className=" -task-list-title fl">
{shixun.status<2 || challenge.status === 2 || (challenges[index-1] && challenges[index-1].status === 2)
|| shixun.task_pass || myshixun_manager === true ?
<Link to={`/tasks/${challenge.identifier}`} onClick={onChallengesDrawerClose}>{index+1}. {challenge.subject}</Link>
:
<span>{index+1}. {challenge.subject}</span>}
</h4>
<a className="fr">
{challenge.status === 2 ?
<i data-tip-down="已完成" className="fa fa-check-circle color-light-green fr font-16 mt5 -text-danger w20_center"></i>
:
<i data-tip-down="待完成" className="fa fa-check-circle fr font-16 mt5 color-light-grey w20_center"></i>
}
</a>
<div className="cl"></div>
<div style={{display: 'flex'}} className={`grades with80 ml20 ${challenge.status === 2 ? '' : 'notFinish'}`}>
<span className={`font-12 mr15 info-partly ${(challenge.status === 2 && challenge.experience > 0) ? 'positive ' : 'negative'}`} id="shixun_exp_118">
经验值<span className="ml5">
{ showExp }
</span>
</span>
<span className={`font-12 mr15 info-partly ${(challenge.status === 2 && challenge.experience > 0) ? 'positive ' : 'negative'}`} id="shixun_grade_118">
金币<span className="ml5">
{/*因为关卡金币和经验值是一样的,所以这里可以直接用经验值*/}
{ showGold }
</span>
</span>
<span className=" font-12 mr15 info-partly" id="shixun_tag_118">
{ challenge.tag_count ?
<React.Fragment>
技能标签<span className="ml5">{challenge.tag_count || '无'}</span>
</React.Fragment>
: '' }
</span>
</div>
<div className="finish-wrap">
<p class="finish-time font-12">
<span class="time-title">完成时间</span>
{ finished_time ? moment(finished_time).format('YYYY-MM-DD HH:mm') : '--' }
</p>
<p class="finish-time font-12">
<span class="time-title">查看答案时间</span>
{ view_answer_time ? moment(view_answer_time).format('YYYY-MM-DD HH:mm') : '--' } </p>
</div>
{ shixun.status >= 2 && <div className="rateRow">
{/* 已完成、未评分 */}
{challenge.status === 2 && challenge.star === 0?
<div className="unstar">
<span className="starTip">给个评分吧</span>
<Rate
defaultValue={0}
onChange={(value) => this.props.onStarChange(challenge, index, value)}
/>
<span className="starNumber" onClick={()=>this.props.saveChallengeStar(challenge, index)}>评价</span>
</div>
:
challenge.status === 2 && challenge.star > 0 ?
<div className="stared">
<span className="starTip">已评分</span>
<Rate
defaultValue={challenge.star}
disabled
/>
<span className="starNumber">{challenge.star}</span>
</div>
: ''}
</div> }
</div>
</div>
)
})
return taskArray;
}
render() {
const { taskListLoading } = this.props;
return (
<div className="page--over" style={{ width: '420px'}}>
{/** 增加提示信息 */}
<div className="tip-info-wrap">
<p className="tip-info">
<span><span style={{ color: '#FFBD4C'}}>温馨提示: </span> </span>
</p>
</div>
<div className="col-width-3 -scroll" style={{height: 'calc( 100% - 100px )', width: '420px'}} id="all_task_index">
{ taskListLoading ?
<CircularProgress size={40} thickness={3} style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '40%', display: 'block' }}/> :
this.renderTasks()
}
</div>
</div>
);
}
/*
<a className="fr"><i data-tip-down="待完成" className="fa fa-play-circle color-light-green fr font-18 mt5 -text-danger w20_center"></i></a>
<div className="-task-list-header clearfix">
<h3 className="fl">全部任务</h3>
</div>
*/
}
export default TaskList;

Loading…
Cancel
Save