Merge branch 'dev_aliyun' into develop

sso
daiao 5 years ago
commit 2e7087f72a

@ -49,7 +49,7 @@ class Admins::SubjectsController < Admins::BaseController
# 设为金课 # 设为金课
def excellent def excellent
current_subject.update!(excellent: true) current_subject.update!(excellent: true, public: 2)
render_ok render_ok
end end

@ -1,11 +1,22 @@
module Admins::SubjectsHelper module Admins::SubjectsHelper
def display_subject_status(subject) def display_subject_status(subject)
style = style =
case subject.status case subject.public
when 0 then 'text-secondary' when 0 then 'text-secondary'
when 1 then 'text-warning' when 1 then 'text-warning'
when 2 then 'text-success' when 2 then 'text-success'
end end
raw content_tag(:span, t("subject.public.#{subject.public}"), class: style)
status =
if subject.public == 2
"publiced"
elsif subject.public == 1
"pending"
elsif subject.status == 2
"processed"
else
"editing"
end
raw content_tag(:span, t("subject.public.#{status}"), class: style)
end end
end end

@ -1,12 +1,23 @@
module SubjectsHelper module SubjectsHelper
# 实训路径的发布状态 # 实训路径的发布状态
def publish_status subject, is_manager, user def publish_status subject, is_manager
status = -1 status = -1
if is_manager if is_manager
status = 0 if subject.status == 0 status = 0 if subject.status == 0
status = 1 if subject.status == 1 status = 1 if subject.status == 1
status = 2 if subject.status == 2 && user.admin? status = 2 if subject.status == 2
end
status
end
# 实训路径的公开状态
def public_status subject, is_manager, user
status = -1
if is_manager
status = 0 if subject.public == 0
status = 1 if subject.public == 1
status = 2 if subject.public == 2 && user.admin?
end end
status status
end end

@ -17,11 +17,13 @@ class Admins::SubjectQuery < ApplicationQuery
# 状态过滤 # 状态过滤
status = status =
case params[:status].to_s.strip case params[:status].to_s.strip
when 'pending' then 0 when "editing" then {status: 0}
when 'applying' then 1 when "processed" then {status: 2, public: 0}
when 'published' then 2 when "pending" then {public: 1}
when "publiced" then {public: 2}
end end
subjects = subjects.where(public: status) if status
subjects = subjects.where(status) if status
# 创建者单位 # 创建者单位
if params[:school_id].present? if params[:school_id].present?

@ -41,7 +41,8 @@ class SearchService < ApplicationService
when 'shixun' then when 'shixun' then
{ where: { id: Laboratory.current.shixuns.where(public: 2, status: 2, fork_from: nil).or(Laboratory.current.shixuns.where(status: 2, id: User.current.shixuns)).pluck(:id) } } { where: { id: Laboratory.current.shixuns.where(public: 2, status: 2, fork_from: nil).or(Laboratory.current.shixuns.where(status: 2, id: User.current.shixuns)).pluck(:id) } }
when 'subject' then when 'subject' then
{ where: { id: Laboratory.current.subjects.pluck(:id) } } { where: { id: Laboratory.current.subjects.where(public: 2, status: 2)
.or( Laboratory.current.subjects.where(status: 2, id: User.current.subjects)).pluck(:id) } }
when 'course' then when 'course' then
{ where: { id: Laboratory.current.all_courses.pluck(:id) } } { where: { id: Laboratory.current.all_courses.pluck(:id) } }
else else

@ -17,9 +17,12 @@ class SubjectSearchService < ApplicationService
if type == "mine" if type == "mine"
@subjects = @subjects.where(id: User.current.subjects).visible.unhidden @subjects = @subjects.where(id: User.current.subjects).visible.unhidden
else else
@subjects = @subjects.visible.unhidden if User.current.admin? || User.current.business?
@subjects = @subjects.unhidden
else
@subjects = @subjects.publiced.unhidden.or(@subjects.where(id: User.current.subjects))
end
end end
Subject.search(keyword, search_options) Subject.search(keyword, search_options)
end end

@ -70,12 +70,21 @@ class Users::SubjectService
end end
def manage_subject_status_filter(relations) def manage_subject_status_filter(relations)
if params[:status] == "publiced"
relations = relations.where(public: 2)
elsif params[:status] == "applying"
relations = relations.where(public: 1)
else
status = case params[:status] status = case params[:status]
when 'editing' then 0 when 'editing' then
when 'applying' then 1 0
when 'published' then 2 when 'applying' then
1
when 'published' then
2
end end
relations = relations.where(status: status) if status relations = relations.where(status: status) if status
end
relations relations
end end

@ -6,7 +6,7 @@
<%= form_tag(admins_subjects_path, method: :get, class: 'form-inline search-form flex-1', remote: true) do %> <%= form_tag(admins_subjects_path, method: :get, class: 'form-inline search-form flex-1', remote: true) do %>
<div class="form-group mr-1"> <div class="form-group mr-1">
<label for="status">状态:</label> <label for="status">状态:</label>
<% status_options = [['全部', ''], ['编辑中', 'pending'], ['审核中', 'applying'], ['已发布', 'published']] %> <% status_options = [['全部', ''], ["编辑中", "editing"], ["已发布", 'processed'], ["待审核", 'pending'], ["已公开", 'publiced']] %>
<%= select_tag(:status, options_for_select(status_options), class: 'form-control') %> <%= select_tag(:status, options_for_select(status_options), class: 'form-control') %>
</div> </div>

@ -1,2 +1,2 @@
json.status 0 json.status 0
json.message "申请成功" json.message "发布成功"

@ -6,7 +6,8 @@ json.subject_score @subject.all_score
json.member_count @subject.member_count json.member_count @subject.member_count
json.allow_delete (@subject.status != 2 && @is_creator) || @user.admin? json.allow_delete (@subject.status != 2 && @is_creator) || @user.admin?
json.publish_status publish_status(@subject, @is_manager, @user) json.publish_status publish_status(@subject, @is_manager)
json.public_status public_status(@subject, @is_manager, @user)
json.allow_statistics @is_manager json.allow_statistics @is_manager
json.allow_send @user.logged? json.allow_send @user.logged?
json.allow_visit @subject.status > 1 || @is_manager json.allow_visit @subject.status > 1 || @is_manager

@ -5,6 +5,7 @@
'1': 审核中 '1': 审核中
'2': 已发布 '2': 已发布
public: public:
'0': 编辑中 'editing': 编辑中
'1': 审核中 'processed': 已发布
'2': 已发布 'pending': 审核中
'publiced': 已公开

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 384 KiB

After

Width:  |  Height:  |  Size: 393 KiB

@ -246,7 +246,7 @@ class CoursesBanner extends Component {
}) })
}else{ }else{
s = "邀请码停用后,用户不能主动加入该课堂了"; s = "课堂邀请码停用后,用户不能主动加入该课堂了";
ss = "您是否确认停用?"; ss = "您是否确认停用?";
this.showActionPoll(i,s,ss) this.showActionPoll(i,s,ss)
} }

@ -1032,7 +1032,7 @@ class Coursesleftnav extends Component{
item.type==="board"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-taolun mr10 fl":"iconfont icon-taolun mr10 fl"} ></i>: item.type==="board"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-taolun mr10 fl":"iconfont icon-taolun mr10 fl"} ></i>:
item.type==="course_group"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-fenban mr10 fl":"iconfont icon-fenban mr10 fl"} ></i>: item.type==="course_group"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-fenban mr10 fl":"iconfont icon-fenban mr10 fl"} ></i>:
item.type==="statistics"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-tongji mr10 fl":"iconfont icon-tongji mr10 fl"} ></i>: item.type==="statistics"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-tongji mr10 fl":"iconfont icon-tongji mr10 fl"} ></i>:
item.type==="video"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-bofang1 mr10 fl":"iconfont icon-bofang1 mr10 fl"} ></i>:"" item.type==="video"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-bofang2 mr10 fl":"iconfont icon-bofang2 mr10 fl"} ></i>:""
} }
{/*||this.props.location.pathname===this.state.url&&key===this.state.indexs*/} {/*||this.props.location.pathname===this.state.url&&key===this.state.indexs*/}
@ -1174,7 +1174,7 @@ class Coursesleftnav extends Component{
item.type==="board"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-taolun mr10 fl":"iconfont icon-taolun mr10 fl"} ></i>: item.type==="board"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-taolun mr10 fl":"iconfont icon-taolun mr10 fl"} ></i>:
item.type==="course_group"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-fenban mr10 fl":"iconfont icon-fenban mr10 fl"} ></i>: item.type==="course_group"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-fenban mr10 fl":"iconfont icon-fenban mr10 fl"} ></i>:
item.type==="video"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-bofang1 mr10 fl":"iconfont icon-bofang1 mr10 fl"} ></i>: item.type==="video"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-bofang2 mr10 fl":"iconfont icon-bofang2 mr10 fl"} ></i>:
item.type==="statistics"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-tongji mr10 fl":"iconfont icon-tongji mr10 fl"} ></i>:"" item.type==="statistics"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-tongji mr10 fl":"iconfont icon-tongji mr10 fl"} ></i>:""
} }

@ -133,7 +133,12 @@ function CourseGroupList(props) {
modalsType={DownloadType} modalsType={DownloadType}
/> />
<Titlesearchsection <Titlesearchsection
title={"分班列表"} title={
<ul className="course_publicNav">
<li className="active">分班列表</li>
<li onClick={() => {props.history.push(`/courses/${courseId}/course_groups/0`)}}>未分班</li>
</ul>
}
searchValue={ searchValue } searchValue={ searchValue }
onInputSearchChange={onInputSearchChange} onInputSearchChange={onInputSearchChange}
allowClearonChange={onInputSearchChange} allowClearonChange={onInputSearchChange}
@ -211,12 +216,12 @@ function CourseGroupList(props) {
onPressEnter={onPressEnter} onPressEnter={onPressEnter}
></Titlesearchsection> ></Titlesearchsection>
{!!none_group_member_count && <div className="mt20 E9F8FF padding20-30 pointer" onClick={() => {props.history.push(`/courses/${courseId}/course_groups/0`)}}> {/* {!!none_group_member_count && <div className="mt20 E9F8FF padding20-30 pointer" onClick={() => {props.history.push(`/courses/${courseId}/course_groups/0`)}}>
<span>未分班</span> <span>未分班</span>
<span style={{color: '#999999'}}>{none_group_member_count}个学生</span> <span style={{color: '#999999'}}>{none_group_member_count}个学生</span>
<WordsBtn style="blue" className="fr">查看</WordsBtn> <WordsBtn style="blue" className="fr">查看</WordsBtn>
</div>} </div>} */}
<Spin size="large" spinning={isSpin}> <Spin size="large" spinning={isSpin}>
{course_groups && !!course_groups.length ? {course_groups && !!course_groups.length ?

@ -1,11 +1,11 @@
import React, { useState, useEffect } from 'react' import React, { useState, useEffect } from 'react'
import { Input,Checkbox,Table, Pagination, Modal,Menu ,Spin, Tooltip , Badge, Popconfirm } from "antd"; import { Input,Checkbox,Table, Pagination, Modal,Menu ,Spin, Tooltip , Badge, Popconfirm, Result } from "antd";
import axios from 'axios' import axios from 'axios'
import { WordsBtn, trigger, on, off, getUrl, downloadFile , sortDirections } from 'educoder' import { WordsBtn, trigger, on, off, getUrl, downloadFile , sortDirections } from 'educoder'
import ClipboardJS from 'clipboard' import ClipboardJS from 'clipboard'
import './studentsList.css';
/** /**
角色数组, CREATOR: 创建者, PROFESSOR: 教师, ASSISTANT_PROFESSOR: 助教, STUDENT: 学生 角色数组, CREATOR: 创建者, PROFESSOR: 教师, ASSISTANT_PROFESSOR: 助教, STUDENT: 学生
course_members_count: 0 course_members_count: 0
@ -103,10 +103,30 @@ function CourseGroupListTable(props) {
dataIndex: 'invite_code', dataIndex: 'invite_code',
key: 'invite_code', key: 'invite_code',
align:'center', align:'center',
width:"10%", width:"21%",
className:"color-grey-6", className:"color-grey-6",
render: (invite_code, record, index) => { render: (invite_code, record, index) => {
return invite_code return <React.Fragment>
<span>{invite_code}</span>
{
record.edit_auth ?
<span onClick={()=>changeInviteCode(record.id,record.invite_code_halt)} className={record.invite_code_halt ?"codeBtnStyle codeBtn_green ml10":"codeBtnStyle codeBtn_blue ml10"}>
{record.invite_code_halt ?"启用":"停用"}
</span>
:""
}
{isAdmin && !record.invite_code_halt &&
<Tooltip title={
<div>
<div>成员可以通过邀请码主动加入分班</div>
<div>点击复制邀请码</div>
</div>
}>
<WordsBtn data-clipboard-text={record.invite_code}
className={`copyBtn_${record.id} codeBtnStyle codeBtn_yellow ml10`} style={''}>复制</WordsBtn>
</Tooltip>
}
</React.Fragment>
} }
} : { } : {
title: '你当前所在分班', title: '你当前所在分班',
@ -127,22 +147,12 @@ function CourseGroupListTable(props) {
dataIndex: 'setting', dataIndex: 'setting',
key: 'setting', key: 'setting',
align:'center', align:'center',
width:"25%", width:"14%",
className:"color-grey-6", className:"color-grey-6",
render: (none, record, index) => { render: (none, record, index) => {
return <React.Fragment> return <React.Fragment>
{!isCourseEnd && isAdmin && <WordsBtn style2={{ marginRight: '12px' }} onClick={() => onDelete(record)} style={'grey'}>删除分班</WordsBtn>} {!isCourseEnd && isAdmin && <WordsBtn style2={{ marginRight: '12px' }} onClick={() => onDelete(record)} style={'grey'}>删除分班</WordsBtn>}
{isAdmin &&
<Tooltip title={
<div>
<div>成员可以通过邀请码主动加入分班</div>
<div>点击复制邀请码</div>
</div>
}>
<WordsBtn style2={{ marginRight: '12px' }} data-clipboard-text={record.invite_code}
className={`copyBtn_${record.id}`} style={''}>复制邀请码</WordsBtn>
</Tooltip>
}
{isStudent && <WordsBtn style2={{ marginRight: '12px' }} onClick={() => addToDir(record)} style={''}>加入分班</WordsBtn>} {isStudent && <WordsBtn style2={{ marginRight: '12px' }} onClick={() => addToDir(record)} style={''}>加入分班</WordsBtn>}
<WordsBtn onClick={() => onGoDetail(record)} style={''}>查看</WordsBtn> <WordsBtn onClick={() => onGoDetail(record)} style={''}>查看</WordsBtn>
</React.Fragment> </React.Fragment>
@ -209,6 +219,32 @@ function CourseGroupListTable(props) {
function onGoDetail(record) { function onGoDetail(record) {
props.history.push(`/courses/${courseId}/course_groups/${record.id}`) props.history.push(`/courses/${courseId}/course_groups/${record.id}`)
} }
// 停用和启用邀请码
function changeInviteCode(id,flag){
if(flag){
changeInviteCodeFunc(id,flag);
}else{
props.confirm({
content:"分班邀请码停用后,用户不能主动加入该分班了",
subContent:'您是否确认停用?',
onOk:() => {
changeInviteCodeFunc(id,flag)
}
})
}
}
function changeInviteCodeFunc(id,flag){
const url= `/course_groups/${id}/set_invite_code_halt.json`;
axios.post(url).then(result=>{
if(result){
props.showNotification(`邀请码${flag?"启用":"停用"}成功!`);
props.onOperationSuccess && props.onOperationSuccess();
}
}).catch(error=>{
console.log(error);
})
}
const isAdmin = props.isAdmin(); const isAdmin = props.isAdmin();
const isSuperAdmin = props.isSuperAdmin(); const isSuperAdmin = props.isSuperAdmin();
const isStudent = props.isStudent() const isStudent = props.isStudent()

@ -6,3 +6,46 @@
.E9F8FF{ .E9F8FF{
background-color: #E9F8FF; background-color: #E9F8FF;
} }
.codeBtnStyle{
height: 18px;
line-height: 18px;
padding:0px 5px;
cursor: pointer;
font-size: 12px;
border-radius: 2px;
}
.codeBtn_yellow{
border:1px solid #FF6B06;
color: #FF6B06!important;
}
.codeBtn_green{
border:1px solid #00BA38;
color: #00BA38!important;
}
.codeBtn_blue{
border:1px solid #4CACFF;
color: #4CACFF!important;
}
.course_publicNav{
display: flex;
}
.course_publicNav li{
position: relative;
margin-right: 30px;
cursor: pointer;
}
.course_publicNav li.active{
color: #4CACFF
}
.course_publicNav li.active::after{
position: absolute;
width: 100%;
height: 2px;
content: '';
left: 0px;
bottom: -33px;
background: #4CACFF;
}

@ -741,12 +741,22 @@ class studentsList extends Component{
<Titlesearchsection <Titlesearchsection
title={isParent ? (pageType == TYPE_STUDENTS ? "全部学生" : "学生列表"): title={isParent ? (pageType == TYPE_STUDENTS ? "全部学生" : "学生列表"):
<React.Fragment> <React.Fragment>
{
course_group_name ?
<span> <span>
<Tooltip title="返回至分班列表"> <Tooltip title="返回至分班列表">
<i className="icon-zuojiantou iconfont font-14" onClick={() => { this.props.history.push(`/courses/${courseId}/course_groups`)}} <i className="icon-zuojiantou iconfont font-14" onClick={() => { this.props.history.push(`/courses/${courseId}/course_groups`)}}
style={{color: '#212121', verticalAlign: 'initial', marginRight: '14px' }} style={{color: '#212121', verticalAlign: 'initial', marginRight: '14px' }}
></i> ></i>
</Tooltip>{course_group_name || ''}</span> </Tooltip>{course_group_name}
</span>
:
<ul className="course_publicNav">
<li onClick={() => { this.props.history.push(`/courses/${courseId}/course_groups`)}}>分班列表</li>
<li className="active">未分班</li>
</ul>
}
{isAdmin && invite_code && <React.Fragment> {isAdmin && invite_code && <React.Fragment>
<span className="color-grey-9 font-16 ml10">邀请码</span> <span className="color-grey-9 font-16 ml10">邀请码</span>
<span className="color-orange font-16"> <span className="color-orange font-16">

@ -30,6 +30,9 @@ class DetailTop extends Component{
OpenCourseTypes:false, OpenCourseTypes:false,
putappointmenttype:false, putappointmenttype:false,
getappointmenttype:false, getappointmenttype:false,
openpathss:false,
cancel_publics:false,
cancel_has_publics:false
} }
} }
componentDidMount(){ componentDidMount(){
@ -104,24 +107,38 @@ class DetailTop extends Component{
}) })
} }
applyissuePath=()=>{ applyissuePath=()=>{
this.setState({ let pathid=this.props.match.params.pathId;
Modalstype:true, let url ="/paths/"+pathid+"/publish.json";
Modalstopval:"发布申请已提交,请等待管理员的审核", axios.post(url).then((result)=>{
Modalsbottomval:"• 我们将在1-2个工作日内完成审核", if(result.status===200){
loadtype:true if(result.data.status===0){
}) this.props.showNotification(result.data.message)
this.props.getlistdatas();
}else if(result.data.status===1){
// window.location.reload();
} }
}
}).catch((error)=>{
console.log(error);
})
cancelissuePath=()=>{
}
postcancelissuePath=()=>{
let pathId=this.props.match.params.pathId; let pathId=this.props.match.params.pathId;
let url ="/paths/"+pathId+"/cancel_publish.json"; let url ="/paths/"+pathId+"/cancel_publish.json";
axios.get(url).then((result)=>{ axios.post(url).then((result)=>{
if(result.status===200){ if(result.status===200){
if(result.data.status===0){ if(result.data.status===0){
}else if(result.data.status===1){ }else if(result.data.status===1){
window.location.href = "/paths/" + result.data.subject_id this.cardsModalcancel()
this.props.showNotification("撤销发布成功")
this.props.getlistdatas()
// window.location.href = "/paths/" + result.data.subject_id
} }
} }
}).catch((error)=>{ }).catch((error)=>{
@ -129,44 +146,36 @@ class DetailTop extends Component{
}) })
} }
reovkissuePath=()=>{ cancelissuePath=()=>{
this.setState({ this.setState({
Modalstype: true, Modalstype: true,
Modalstopval:"是否确认撤销发布", Modalstopval: "是否确认撤销发布?",
Modalsbottomval:"确认后,回退到编辑状态", // modalsMidval:"撤销发布后,学员将无法进行练习,若您新增关",
// Modalsbottomval:"卡,学员需要重新体验实训",
cardsModalsavetype: true, cardsModalsavetype: true,
modalstyles:"848282"
}) })
}
reovkissuePaths=()=>{
let pathId=this.props.match.params.pathId;
let url ="/paths/"+pathId+"/cancel_has_publish.json";
axios.get(url).then((result)=>{
if(result.status===200){
if(result.data.status===0){
}else if(result.data.status===1){
this.setState({
cardsModalsavetype:false,
loadtype:false,
deletepathtype:false
})
window.location.href = "/paths/" + result.data.subject_id
}
}
}).catch((error)=>{
console.log(error);
})
} }
cardsModalcancel=()=>{ cardsModalcancel=()=>{
this.setState({ this.setState({
Modalstype:false, Modalstype:false,
Modalsbottomval:'', Modalsbottomval:'',
loadtype:false, loadtype:false,
deletepathtype:false, deletepathtype:false,
putappointmenttype:false putappointmenttype:false,
modalsMidval:'',
modalstyles:'',
cardsModalsavetype:false,
applyissuePath:false,
openpathss:false,
cancel_publics:false,
cancel_has_publics:false
}) })
} }
@ -317,6 +326,7 @@ class DetailTop extends Component{
// this.props.getlistdatas() // this.props.getlistdatas()
this.props.showNotification(response.data.message) this.props.showNotification(response.data.message)
}else{ }else{
this.cardsModalcancel()
this.props.showNotification(response.data.message) this.props.showNotification(response.data.message)
} }
@ -327,10 +337,93 @@ class DetailTop extends Component{
}) })
} }
postopenpaths=()=>{
let pathid=this.props.match.params.pathId;
let url ="/paths/"+pathid+"/apply_public.json";
axios.post(url).then((result)=>{
if(result.status===200){
if(result.data.status===0){
this.props.showNotification(result.data.message)
this.props.getlistdatas();
this.cardsModalcancel()
}else if(result.data.status===1){
this.props.showNotification(result.data.message)
this.props.getlistdatas();
this.cardsModalcancel()
}
}
}).catch((error)=>{
console.log(error);
})
}
openpaths=()=>{
this.setState({
Modalstype: true,
openpathss:true,
Modalstopval: "公开申请已提交,请等待管理员的审核",
modalsMidval:"• 我们将在1-2个工作日内完成审核",
Loadtype:true,
modalstyles:"848282"
})
}
postcancel_public=()=>{
let pathid=this.props.match.params.pathId;
let url ="/paths/"+pathid+"/cancel_public.json";
axios.post(url).then((result)=>{
if(result.status===200){
if(result.data.status===0){
this.cardsModalcancel()
this.props.showNotification("撤销申请公开成功")
this.props.getlistdatas();
}
}
}).catch((error)=>{
console.log(error);
})
}
cancel_public=()=>{
this.setState({
cancel_publics:true,
Modalstype: true,
Modalstopval: "是否确认撤销申请公开?",
modalsMidval:" ",
ModalsBottomval:" ",
})
}
postcancel_has_public=()=>{
let pathid=this.props.match.params.pathId;
let url ="/paths/"+pathid+"/cancel_has_public.json";
axios.post(url).then((result)=>{
if(result.status===200){
if(result.data.status===0){
this.cardsModalcancel()
this.props.showNotification("撤消公开成功")
this.props.getlistdatas();
}
}
}).catch((error)=>{
console.log(error);
})
}
cancel_has_public=()=>{
this.setState({
cancel_has_publics:true,
Modalstype: true,
Modalstopval: "是否确认撤销公开?",
modalsMidval:" ",
ModalsBottomval:" ",
})
}
render(){ render(){
let{detailInfoList}=this.props; let{detailInfoList}=this.props;
let{Modalstype,Modalstopval,cardsModalcancel,putappointmenttype,Modalsbottomval,cardsModalsavetype,loadtype,getappointmenttype}=this.state; let{Modalstype,Modalstopval,cardsModalcancel,putappointmenttype,Modalsbottomval,cardsModalsavetype,loadtype,getappointmenttype,openpathss,cancel_publics,cancel_has_publics}=this.state;
const radioStyle = { const radioStyle = {
display: 'block', display: 'block',
height: '30px', height: '30px',
@ -367,8 +460,10 @@ class DetailTop extends Component{
modalsTopval={Modalstopval} modalsTopval={Modalstopval}
modalsBottomval={Modalsbottomval} modalsBottomval={Modalsbottomval}
modalCancel={cardsModalcancel} modalCancel={cardsModalcancel}
modalSave={cardsModalsavetype===true?()=>this.reovkissuePaths():putappointmenttype===true?()=>this.getappointment():()=>this.cardsModalsave()} modalSave={cardsModalsavetype===true?()=>this.postcancelissuePath():openpathss===true?()=>this.postopenpaths():cancel_publics===true?()=>this.postcancel_public():cancel_has_publics===true?()=>this.postcancel_has_public():putappointmenttype===true?()=>this.getappointment():()=>this.cardsModalsave()}
loadtype={loadtype} loadtype={loadtype}
modalsMidval={this.state.modalsMidval}
modalstyles={this.state.modalstyles}
> >
</Modals> </Modals>
{this.state.yslJointhe===true?<Jointheclass {...this.props} {...this.state} ysljoinmodalCancel={()=>this.ysljoinmodalCancel()} ysljoinmodalCanceltwo={()=>this.ysljoinmodalCanceltwo(this.state.MenuItemskey)}></Jointheclass>:""} {this.state.yslJointhe===true?<Jointheclass {...this.props} {...this.state} ysljoinmodalCancel={()=>this.ysljoinmodalCancel()} ysljoinmodalCanceltwo={()=>this.ysljoinmodalCanceltwo(this.state.MenuItemskey)}></Jointheclass>:""}
@ -436,7 +531,7 @@ class DetailTop extends Component{
border:1px solid rgba(255,255,255,1); border:1px solid rgba(255,255,255,1);
} }
.maxwinth600{ .maxwinth600{
width:740px; width:730px;
} }
` `
} }
@ -473,33 +568,48 @@ class DetailTop extends Component{
} }
{ detailInfoList.allow_send === true? { detailInfoList.allow_send === true?
<SendPanel {...this.props} {...this.state}></SendPanel>:"" <SendPanel {...this.props} {...this.state} widths={"80px"}></SendPanel>
:""
} }
{this.props.courses===undefined?"":detailInfoList.is_creator===true?<a className={"fr font-18 color-white kaike mr20 kkbths"} onClick={()=>this.OpenCoursefun()}>开课</a>:""} {this.props.courses===undefined?"":detailInfoList.is_creator===true?<a className={"fr font-18 color-white kaike mr20 kkbths"} style={{'width':'65px'}} onClick={()=>this.OpenCoursefun()}>开课</a>:""}
{ { detailInfoList.allow_statistics===true&& detailInfoList.public_status===2?
detailInfoList.publish_status===2 && detailInfoList.allow_statistics===true? <a className="fr font-18 color-white kaike mr20 kkbths" onClick={this.cancel_has_public}>撤销公开</a>:""
<a className="fr font-18 color-white kaike mr20 kkbths" onClick={this.reovkissuePath}>撤销发布</a>:"" }
{detailInfoList.allow_statistics===true&& detailInfoList.public_status===1?
<a className="fr font-18 color-white kaike mr20 kkbths" onClick={this.cancel_public} style={{width:'135px'}}>撤销申请公开</a>:""
}
{ detailInfoList.publish_status===2&& detailInfoList.allow_statistics===true&& detailInfoList.public_status===0?
<a className="fr font-18 color-white kaike mr20 kkbths" onClick={this.openpaths}>申请公开</a>:""
} }
{ {
detailInfoList.publish_status===1 && detailInfoList.allow_statistics===true? detailInfoList.publish_status===2 && detailInfoList.allow_statistics===true&&detailInfoList.public_status===0?
<a className="fr font-18 color-white kaike mr20 kkbths" onClick={this.cancelissuePath}>撤销申请</a>:"" <a className="fr font-18 color-white kaike mr20 kkbths" onClick={this.cancelissuePath}>撤销发布</a>:""
} }
{ {
detailInfoList.publish_status===0&&detailInfoList.allow_add_member===true? detailInfoList.publish_status===0&&detailInfoList.allow_add_member===true?
<a className="fr font-18 color-white kaike mr20 kkbths" onClick={this.applyissuePath}>申请发布</a>:"" <a className="fr font-18 color-white kaike mr20 kkbths"
style={{'width':'65px'}}
onClick={this.applyissuePath}>发布</a>:""
} }
{detailInfoList===undefined?"":detailInfoList.allow_delete===true?<a {detailInfoList===undefined?"":detailInfoList.allow_delete===true?<a
className={"fr font-18 color-white kaike mr20 kkbths"} className={"fr font-18 color-white kaike mr20 kkbths"}
onClick={this.allow_deletepath} onClick={this.allow_deletepath}
style={{'width':'65px'}}
>删除</a>:""} >删除</a>:""}
{detailInfoList===undefined?"":detailInfoList.allow_statistics===true? {detailInfoList===undefined?"":detailInfoList.allow_statistics===true?
<Link to={"/paths/"+this.props.match.params.pathId+"/edit"} className="fr font-18 color-white kaike mr20 kkbths" > <Link to={"/paths/"+this.props.match.params.pathId+"/edit"}
style={{'width':'65px'}}
className="fr font-18 color-white kaike mr20 kkbths" >
编辑 编辑
</Link> </Link>
:"" :""

@ -180,7 +180,9 @@ class sendPanel extends Component{
{ {
this.props.detailInfoList===undefined?"":this.props.detailInfoList.allow_send===true? this.props.detailInfoList===undefined?"":this.props.detailInfoList.allow_send===true?
<Tooltip placement="bottom" title="以实训作业的形式发送到我的课堂"> <Tooltip placement="bottom" title="以实训作业的形式发送到我的课堂">
<a onClick = {this.SentToLesson} className="fr font-18 color-white kaike mr20 kkbths"> <a onClick = {this.SentToLesson} className="fr font-18 color-white kaike mr20 kkbths"
style={{width:this.props&&this.props.widths}}
>
发送至 发送至
</a> </a>
</Tooltip>:'' </Tooltip>:''

@ -252,6 +252,8 @@ class InfosPath extends Component{
href="javascript:void(0)" onClick={() => this.changeStatus("applying")} className="w60">待审核</a></li> href="javascript:void(0)" onClick={() => this.changeStatus("applying")} className="w60">待审核</a></li>
<li className={status == "published" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a <li className={status == "published" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a
href="javascript:void(0)" onClick={() => this.changeStatus("published")} className="w60">已发布</a></li> href="javascript:void(0)" onClick={() => this.changeStatus("published")} className="w60">已发布</a></li>
<li className={status == "publiced" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a
onClick={() => this.changeStatus("publiced")} className="w60" href="javascript:void(0)">已公开</a></li>
</div> </div>
} }
{ {

@ -265,10 +265,10 @@ class InfosShixun extends Component{
<a onClick={() => this.changeStatus()} className="w32" href="javascript:void(0)">全部</a></li> <a onClick={() => this.changeStatus()} className="w32" href="javascript:void(0)">全部</a></li>
<li className={status == "editing" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a <li className={status == "editing" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a
onClick={() => this.changeStatus("editing")} className="w60" href="javascript:void(0)">编辑中</a></li> onClick={() => this.changeStatus("editing")} className="w60" href="javascript:void(0)">编辑中</a></li>
<li className={status == "published" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a
onClick={() => this.changeStatus("published")} className="w60" href="javascript:void(0)">已发布</a></li>
<li className={status == "applying" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a <li className={status == "applying" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a
onClick={() => this.changeStatus("applying")} className="w60" href="javascript:void(0)">待审核</a></li> onClick={() => this.changeStatus("applying")} className="w60" href="javascript:void(0)">待审核</a></li>
<li className={status == "published" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a
onClick={() => this.changeStatus("published")} className="w60" href="javascript:void(0)">已发布</a></li>
<li className={status == "publiced" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a <li className={status == "publiced" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a
onClick={() => this.changeStatus("publiced")} className="w60" href="javascript:void(0)">已公开</a></li> onClick={() => this.changeStatus("publiced")} className="w60" href="javascript:void(0)">已公开</a></li>
<li className={status == "closed" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a <li className={status == "closed" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 384 KiB

After

Width:  |  Height:  |  Size: 393 KiB

Loading…
Cancel
Save