*/}
- {/*{this.state.fileList.length===0?"":this.state.fileList.map((item,key)=>{*/}
- {/*return(*/}
- {/*
*/}
- {/**/}
- {/**/}
- {/**/}
- {/**/}
- {/*{item.name}*/}
- {/**/}
- {/**/}
- {/*{item.response===undefined?"":isNaN(bytesToSize(item.filesize))?"123":bytesToSize(item.filesize)}*/}
- {/**/}
- {/*this.onAttachmentRemove(item.response===undefined?"":item.response.id&&item.response.id)}>*/}
- {/*
*/}
- {/*)*/}
- {/*})}*/}
-
{this.state.newfileListtypes===true?
请先上传资源
:""}
@@ -647,21 +501,6 @@ class Selectsetting extends Component{
margin-top:10px;
}
`}
-
- {/*
*/}
- {/**/}
- {/*勾选后所有用户可见,否则仅课堂成员可见*/}
- {/**/}
- {/*
*/}
- {/*{this.props.has_course_groups&&this.props.has_course_groups===true?:""}*/}
- {this.state.course_groupss&&this.state.course_groupss.length>0?
- 统一设置(选中则所有分班使用相同的发布设置,否则各个单独设置)
- :""}
-
-
-
- {/*this.props.has_course_groups&&this.props.has_course_groups===true?:""*/}
-
- {unified_setting===false?
- this.state.course_groups&&this.state.course_groups.map((item,key)=>{
- return(
-
-
-
-
-
-
- this.onChangeTimepublishs(e,index,key)}
- // onChange={ this.onChangeTimepublish }
- disabledTime={disabledDateTime}
- disabledDate={disabledDate}
- />
-
- {key!=0?this.deletegrouppublish(key)}>:""}
- {key===course_groups.length-1?:""}
-
- )
- }):""}
-
-
+ {this.props.course_is_public===true?
+ 公开:
+ 选中,所有用户可见,否则课堂成员可见
+
+
:""}
- {unified_setting===true?
-
-
-
-
-
:""}
- {/*{this.state.course_group_idtypes===true?
请选择分班
:""}*/}
-
- {/*{course_group_publish_timestype===true?
请填写完整
:""}*/}
+
+
+ 发布设置:
+
+
+ 立即发布
+
+
+ 延迟发布
+
+
+ (按照设置的时间定时发布)
+
+
+
{this.state.descriptiontypes===true?
描述不能超过最大限制:100个字符
:""}
+ {this.state.Radiovaluetype===true?
发布时间不能为空
:""}
diff --git a/public/react/src/modules/courses/coursesPublic/sendResource.js b/public/react/src/modules/courses/coursesPublic/sendResource.js
index fbc2ebeb2..bf810a140 100644
--- a/public/react/src/modules/courses/coursesPublic/sendResource.js
+++ b/public/react/src/modules/courses/coursesPublic/sendResource.js
@@ -1,5 +1,5 @@
import React,{ Component } from "react";
-import { Modal,Checkbox,Upload,Button,Icon,message,DatePicker,Select,Tooltip} from "antd";
+import { Modal,Checkbox,Upload,Button,Icon,message,DatePicker,Select,Tooltip,Radio} from "antd";
import axios from 'axios';
import Modals from '../../modals/Modals';
import {getUrl,handleDateString,bytesToSize,appendFileSizeToUploadFileAll} from 'educoder';
@@ -40,7 +40,6 @@ class Sendresource extends Component{
ModalSave:"",
fileListtype:false,
loadtype:false,
- is_unified_setting:true,
is_public:false,
datatime:undefined,
// moment(new Date()).format('YYYY-MM-DD HH:mm:ss'),
@@ -50,7 +49,9 @@ class Sendresource extends Component{
publish_time :""
}],
course_groups:undefined,
- course_groups_count:undefined
+ course_groups_count:undefined,
+ Radiovalue:0,
+ Radiovaluetype:false
}
}
@@ -101,37 +102,6 @@ class Sendresource extends Component{
}
}
- // onAttachmentRemove = (file) => {
- //
- // this.setState({
- // fileListtype:false,
- // })
- // // confirm({
- // // title: '确定要删除这个附件吗?',
- // // okText: '确定',
- // // cancelText: '取消',
- // // // content: 'Some descriptions',
- // // onOk: () => {
- // // this.deleteAttachment(file)
- // // },
- // // onCancel() {
- // // console.log('Cancel');
- // // },
- // // });
- // // return false;
- //
- // // this.setState({
- // // Modalstype:true,
- // // Modalstopval:'确定要删除这个附件吗?',
- // // ModalSave: ()=>this.deleteAttachment(file),
- // // ModalCancel:this.cancelAttachment
- // // })
- // // return false;
- //
- // this.deleteAttachment(file);
- // }
-
-
onAttachmentRemove = (file) => {
if(!file.percent || file.percent == 100){
const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
@@ -174,8 +144,7 @@ class Sendresource extends Component{
}
Saves=()=>{
- let id=this.props.categoryid;
- let {fileList,description,is_public,is_unified_setting,datatime,course_group_publish_times} =this.state;
+ let {fileList,description,is_public,datatime,Radiovalue} =this.state;
let newfileList=[];
for(var list of fileList){
@@ -188,17 +157,19 @@ class Sendresource extends Component{
})
return
}
- // if(is_unified_setting===false){
- // course_group_publish_times.forEach((item,key)=>{
- // if(item.course_group_id===undefined||item.publish_time===undefined){
- // this.setState({
- // course_group_publish_timestype:true
- // })
- // return
- // }
- // })
- //
- // }
+
+ if(this.state.Radiovalue===1){
+ if(datatime===undefined||datatime===null||datatime=== ""){
+ this.setState({
+ Radiovaluetype:true
+ })
+ return
+ }else{
+ this.setState({
+ Radiovaluetype:false
+ })
+ }
+ }
@@ -222,22 +193,14 @@ class Sendresource extends Component{
course_second_category_id:this.props.coursesidtype===undefined||this.props.coursesidtype==="node"?0:attachmentId,
attachment_ids:newfileList,
is_public:is_public,
- is_unified_setting:is_unified_setting,
- publish_time:is_unified_setting===true?datatime===undefined? moment(new Date()).format('YYYY-MM-DD HH:mm'):datatime:undefined,
+ publish_time:Radiovalue===1?datatime===undefined? undefined:datatime:undefined,
description:description,
- course_group_publish_times:is_unified_setting===false?course_group_publish_times:undefined
+ delay_publish:Radiovalue,
}).then((result)=>{
if(result.data.status===0){
- // this.setState({
- // Modalstype:true,
- // Modalstopval:result.data.message,
- // ModalSave:this.ModalCancelModalCancel,
- // loadtype:true
- // })
this.ModalCancelModalCancel();
this.props.updataleftNavfun();
- // this.props.showNotification(result.data.message);
this.props.showNotification("上传资源成功");
this.props.setupdate(this.props.attachmentId)
}
@@ -253,14 +216,6 @@ class Sendresource extends Component{
})
}
- onChangesetting=(e)=>{
-
- this.setState({
- is_unified_setting:e.target.checked
- })
-
- }
-
onChangepublic=(e)=>{
this.setState({
@@ -289,50 +244,15 @@ class Sendresource extends Component{
}
- selectassigngroups=(e,index,key)=>{
- let {course_group_publish_times}=this.state;
- let newgroup_publish=course_group_publish_times;
- for(var i=0; i
{
this.setState({
- course_group_publish_times:newgroup_publish,
- })
+ Radiovalue: e.target.value,
+ });
}
-
- deletegrouppublish=(key)=>{
- let newlist=this.state.course_group_publish_times;
- newlist.splice(key,1);
- this.setState({
- course_group_publish_times:newlist
- })
- }
-
- addgrouppublish=()=>{
- let newlist=this.state.course_group_publish_times;
- newlist.push( {
- course_group_id : undefined,
- publish_time :undefined
- })
- this.setState({
- course_group_publish_times:newlist
- })
- }
-
render(){
- let {settextarea,newfileListtype,descriptiontype,
- course_group_publish_timestype,
- Modalstopval,
- ModalCancel,
- ModalSave,
- loadtype,
- is_unified_setting,
+ let { newfileListtype,descriptiontype,
is_public,
datatime,
- course_group_publish_times,
- course_groups
}=this.state;
const uploadProps = {
@@ -350,7 +270,11 @@ class Sendresource extends Component{
return isLt150M;
},
};
-
+ const radioStyle = {
+ display: 'block',
+ height: '30px',
+ lineHeight: '30px',
+ };
return(
{/*提示*/}
@@ -389,6 +313,7 @@ class Sendresource extends Component{
margin-right: 5px;
}
.ant-upload-list-item:hover .ant-upload-list-item-info{
+ padding: 0 12px 0 0px;
background-color:#fff;
}
.upload_1 .ant-upload-list {
@@ -437,42 +362,12 @@ class Sendresource extends Component{
-
(单个文件最大150M)
+
(单个文件最大150M)
:""}
- {/**/}
- {/*{this.state.fileList.length===0?"":this.state.fileList.map((item,key)=>{*/}
- {/*debugger*/}
- {/*return(*/}
- {/*
*/}
- {/**/}
- {/**/}
- {/**/}
- {/**/}
- {/*{item.name}*/}
- {/**/}
- {/**/}
- {/*{item.response===undefined?"":isNaN(bytesToSize(item.filesize))?"":bytesToSize(item.filesize)}*/}
- {/**/}
- {/*this.onAttachmentRemove(item.response===undefined?"":item.response.id&&item.response.id)}>*/}
- {/*
*/}
- {/*)*/}
- {/*})}*/}
+
{newfileListtype===true&&this.state.fileListtype===false?
请先上传资源
:""}
@@ -484,13 +379,12 @@ class Sendresource extends Component{
}
`}
- {/*
*/}
- {/*勾选后所有用户可见,否则仅课堂成员可见*/}
- {/**/}
+ {this.props.course_is_public===true?
+ 公开:
+ 选中,所有用户可见,否则课堂成员可见
+
+
:""}
- {this.state.course_groups_count&&this.state.course_groups_count>0?
- 统一设置(选中则所有分班使用相同的发布设置,否则各个单独设置)
- :""}
-
- {is_unified_setting===false?
- course_group_publish_times.map((item,key)=>{
- return(
-
-
-
-
- this.onChangeTimepublish(e,index,key,2)}
- // onChange={ this.onChangeTimepublish }
- disabledTime={disabledDateTime}
- disabledDate={disabledDate}
- />
- {key!=0?this.deletegrouppublish(key)}>:""}
- {key===course_group_publish_times.length-1&&key:""}
-
- )
- })
-
- :""}
-
-
- {is_unified_setting===true?
-
- this.onChangeTimepublish(e,index,undefined,1)}
- disabledTime={disabledDateTime}
- disabledDate={disabledDate}
- />
-
-
:""}
+
+
+ 发布设置:
+
+
+ 立即发布
+
+
+ 延迟发布
+ this.onChangeTimepublish(e,index,undefined,1)}
+ disabledTime={disabledDateTime}
+ disabledDate={disabledDate}
+ disabled={this.state.Radiovalue===1?false:true}
+ />
+
+ (按照设置的时间定时发布)
+
+
+
{/*{course_group_publish_timestype===true?
请填写完整
:""}*/}
{descriptiontype===true?
请输入资源描述,最大限制100个字符
:""}
+ {this.state.Radiovaluetype===true?
发布时间不能为空
:""}
{this.props.Cancelname}
this.Saves()}>{this.props.Savesname}
diff --git a/public/react/src/modules/courses/members/CourseGroupList.js b/public/react/src/modules/courses/members/CourseGroupList.js
index ec0b23fb3..664e0d95a 100644
--- a/public/react/src/modules/courses/members/CourseGroupList.js
+++ b/public/react/src/modules/courses/members/CourseGroupList.js
@@ -152,7 +152,7 @@ function CourseGroupList(props) {
}
{
// pageType !== TYPE_STUDENTS &&
- !isCourseEnd && isAdmin && isParent &&
addDir()}>新建分班 }
+ !isCourseEnd && isAdmin &&
addDir()}>新建分班 }
{/* {
isAdmin && !isParent && course_group_id != 0 &&
deleteDir()}>删除分班 } */}
{/* {
diff --git a/public/react/src/modules/courses/members/CourseGroupListTable.js b/public/react/src/modules/courses/members/CourseGroupListTable.js
index 84edb2fc5..1560183f5 100644
--- a/public/react/src/modules/courses/members/CourseGroupListTable.js
+++ b/public/react/src/modules/courses/members/CourseGroupListTable.js
@@ -28,7 +28,6 @@ function CourseGroupListTable(props) {
}
course_groups.forEach((record) => {
const id = record.id
- debugger;
let _clipboard = new ClipboardJS(`.copyBtn_${id}`);
_clipboard.on('success', (e) => {
props.showNotification('复制成功')
@@ -142,7 +141,7 @@ function CourseGroupListTable(props) {
return columns
}
- const addToDir = async (record) => {
+ const doAddToDir = async (record) => {
const courseId = props.match.params.coursesId
const url = `/courses/${courseId}/join_course_group.json`
const course_group_id = record.id
@@ -151,11 +150,27 @@ function CourseGroupListTable(props) {
course_group_id
})
if (response && response.data.status == 0) {
- props.showNotification('加入成功')
+ props.showNotification(`已加入分班:${record.name}`)
props.updataleftNavfun()
props.onOperationSuccess && props.onOperationSuccess()
}
}
+ const addToDir = (record) => {
+ props.confirm({
+
+ content: `是否确认加入分班: ${record.name}?`,
+
+ okText: '确认',
+ cancelText: '取消',
+
+ onOk: () => {
+ doAddToDir(record)
+ },
+ onCancel() {
+ console.log('Cancel');
+ },
+ });
+ }
function onDelete(record) {
props.confirm({
@@ -198,7 +213,7 @@ function CourseGroupListTable(props) {
const dataSource = course_groups.map(item => {
return {
...item,
- subStringOfMember_manager : item.member_manager.length > 92
+ subStringOfMember_manager : (item.member_manager && item.member_manager.length > 92)
? item.member_manager.substring(0, 92) + '...' : null
}
})
diff --git a/public/react/src/modules/courses/members/studentsList.js b/public/react/src/modules/courses/members/studentsList.js
index 9acc4c0bf..38a89584d 100644
--- a/public/react/src/modules/courses/members/studentsList.js
+++ b/public/react/src/modules/courses/members/studentsList.js
@@ -130,7 +130,7 @@ const buildColumns = (that,isParent) => {
}
const isAdmin = that.props.isAdmin()
if (isAdmin) {
- columns.unshift({
+ !that.isStudentPage && columns.unshift({
title: '',
dataIndex: 'check',
key: 'check',
@@ -547,7 +547,7 @@ class studentsList extends Component{
addDir = () => {
trigger('groupAdd', this.props.coursesids)
}
- addToDir = async () => {
+ doAddToDir = async () => {
const courseId = this.props.match.params.coursesId
const url = `/courses/${courseId}/join_course_group.json`
const course_group_id = this.props.match.params.course_group_id
@@ -556,11 +556,27 @@ class studentsList extends Component{
course_group_id
})
if (response && response.data.status == 0) {
- this.props.showNotification('加入成功')
+ this.props.showNotification(`已加入分班:${this.state.course_group_name}`)
this.props.updataleftNavfun()
this.fetchAll()
}
}
+ addToDir = (record) => {
+ this.props.confirm({
+
+ content: `是否确认加入分班: ${this.state.course_group_name}?`,
+
+ okText: '确认',
+ cancelText: '取消',
+
+ onOk: () => {
+ this.doAddToDir()
+ },
+ onCancel() {
+ console.log('Cancel');
+ },
+ });
+ }
renameDir = () => {
const course_group_id = this.props.match.params.course_group_id
trigger('groupRename', { id: parseInt(course_group_id), name: this.state.course_group_name})
@@ -670,7 +686,8 @@ class studentsList extends Component{
} else {
pageType = TYPE_COURSE_GOURP_CHILD
}
-
+ const isStudentPage = pageType == TYPE_STUDENTS
+ this.isStudentPage = isStudentPage
return(
@@ -708,23 +725,24 @@ class studentsList extends Component{
searchPlaceholder={ '请输入姓名、学号进行搜索' }
firstRowRight={
- {
+ {/* {
// pageType !== TYPE_STUDENTS &&
- isSuperAdmin &&
+ !isStudentPage && isSuperAdmin &&
this.refs['createGroupByImportModal'].setVisible(true)}>导入创建分班
- }
+ } */}
+
{
- // pageType !== TYPE_STUDENTS &&
- !isCourseEnd && isAdmin && isParent && this.addDir()}>添加分班 }
+ !isStudentPage && isAdmin && !isParent && course_group_id != 0 && this.deleteDir()}>删除分班 }
{
- isStudent && !isParent && course_group_id != 0 && this.addToDir()}>加入分班 }
+ !isStudentPage && isAdmin && !isParent && course_group_id != 0 && this.renameDir()}>分班重命名 }
{
- isAdmin && !isParent && course_group_id != 0 && this.deleteDir()}>删除分班 }
+ !isStudentPage && !isCourseEnd && isAdmin && isParent && this.addDir()}>新建分班 }
+
{
- isAdmin && !isParent && course_group_id != 0 && this.renameDir()}>分班重命名 }
+ !isStudentPage && isStudent && !isParent && course_group_id != 0 && this.addToDir()}>加入分班 }