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

PCqiandao
cxt 5 years ago
commit 771b2e731d

@ -55,7 +55,7 @@ export const formatDelta = (deltas) => {
*/
export const operate = (text, key, value) => {
let operatedText = null;
debugger;
switch (key) {
case 'bold':
operatedText = `<strong>${text}</strong>`;

@ -34,7 +34,7 @@ class CompetitionContentsMd extends Component{
}else{
chart_rules.rule_contents.map((items,keys)=>{
debugger
if(parseInt(this.props.tabkey)===items.competition_stage_id){
console.log(items)
this.contentMdRef.current.setValue(items.content);

@ -684,12 +684,24 @@ class CoursesIndex extends Component{
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
{/* 子目录普通作业 */}
<Route path="/classrooms/:coursesId/common_homework/:category_id" exact
render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
{/* 分组作业 */}
<Route path="/classrooms/:coursesId/group_homeworks/:category_id" exact
render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
{/* 分组作业 */}
<Route path="/classrooms/:coursesId/group_homework/:category_id" exact
render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
{/* 普通作业 */}
<Route path="/classrooms/:coursesId/common_homeworks/" strict
@ -697,6 +709,12 @@ class CoursesIndex extends Component{
(props) => (<CommonWork {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
{/* 子普通作业 */}
<Route path="/classrooms/:coursesId/common_homework/" strict
render={
(props) => (<CommonWork {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
{/* 分组作业 */}
<Route path="/classrooms/:coursesId/group_homeworks/" strict
@ -705,6 +723,14 @@ class CoursesIndex extends Component{
}
></Route>
{/* 分组作业 */}
<Route path="/classrooms/:coursesId/group_homework/" strict
render={
(props) => (<GroupWork {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
{/* 问卷答题 */}
<Route path="/classrooms/:coursesId/polls/:pollId/users/:login"
render={

@ -230,6 +230,12 @@ class ListPageIndex extends Component{
(props) => (<CommonWork {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 普通作业 */}
<Route path="/classrooms/:coursesId/common_homework/:category_id"
render={
(props) => (<CommonWork {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 作品列表 */}
<Route path="/classrooms/:coursesId/group_homeworks/:category_id"
@ -237,6 +243,12 @@ class ListPageIndex extends Component{
(props) => (<CommonWork {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 作品列表 */}
<Route path="/classrooms/:coursesId/group_homework/:category_id"
render={
(props) => (<CommonWork {...this.props} {...props} {...this.state} />)
}
></Route>
<Route exact path="/classrooms/:coursesId/boards/:boardId"
render={

@ -222,6 +222,8 @@ class CommonWorkDetailIndex extends Component{
let exportUrl = `/homework_commons/${workId}/works_list.zip?${queryString.stringify(params)}`
let exportResultUrl = `/homework_commons/${workId}/works_list.xlsx?${queryString.stringify(params)}`
document.title=course_name === undefined ? "" : course_name;
console.log(category_id)
return (
<div>
<PublishRightnow ref={this.publishModal} showActionButton={false} {...this.props} checkBoxValues={[workId]}
@ -426,6 +428,12 @@ class CommonWorkDetailIndex extends Component{
}
></Route>
<Route exact path="/classrooms/:coursesId/common_homework/:workId/setting"
render={
(props) => (<CommonWorkSetting {...this.props} {...props} {...this.state} {...commonHandler}/>)
}
></Route>
{/* 作品列表 */}
<Route exact path="/classrooms/:coursesId/common_homeworks/:workId/list"
render={
@ -433,17 +441,35 @@ class CommonWorkDetailIndex extends Component{
}
></Route>
{/* 作品列表 */}
<Route exact path="/classrooms/:coursesId/common_homework/:workId/list"
render={
(props) => (<CommonWorkList ref="commonWorkList" triggerRef={this.bindRef} {...this.props} {...props} {...this.state} {...commonHandler}/>)
}
></Route>
{/* 作业问答 */}
<Route exact path="/classrooms/:coursesId/common_homeworks/:workId/question"
render={
(props) => (<CommonWorkQuestion {...this.props} {...props} {...this.state} {...commonHandler}/>)
}
></Route>
<Route exact path="/classrooms/:coursesId/common_homework/:workId/question"
render={
(props) => (<CommonWorkQuestion {...this.props} {...props} {...this.state} {...commonHandler}/>)
}
></Route>
<Route exact path="/classrooms/:coursesId/common_homeworks/:workId/answer"
render={
(props) => (<CommonWorkAnswer {...this.props} {...props} {...this.state} {...commonHandler}/>)
}
></Route>
<Route exact path="/classrooms/:coursesId/common_homework/:workId/answer"
render={
(props) => (<CommonWorkAnswer {...this.props} {...props} {...this.state} {...commonHandler}/>)
}
></Route>
<Route exact path="/classrooms/:coursesId/group_homeworks/:workId/setting"
@ -451,25 +477,43 @@ class CommonWorkDetailIndex extends Component{
(props) => (<CommonWorkSetting {...this.props} {...props} {...this.state} {...commonHandler}/>)
}
></Route>
<Route exact path="/classrooms/:coursesId/group_homework/:workId/setting"
render={
(props) => (<CommonWorkSetting {...this.props} {...props} {...this.state} {...commonHandler}/>)
}
></Route>
{/* 作品列表 */}
<Route exact path="/classrooms/:coursesId/group_homeworks/:workId/list"
render={
(props) => (<CommonWorkList triggerRef={this.bindRef} {...this.props} {...props} {...this.state} {...commonHandler}/>)
}
></Route>
<Route exact path="/classrooms/:coursesId/group_homework/:workId/list"
render={
(props) => (<CommonWorkList triggerRef={this.bindRef} {...this.props} {...props} {...this.state} {...commonHandler}/>)
}
></Route>
{/* 作业问答 */}
<Route exact path="/classrooms/:coursesId/group_homeworks/:workId/question"
render={
(props) => (<CommonWorkQuestion {...this.props} {...props} {...this.state} {...commonHandler}/>)
}
></Route>
<Route exact path="/classrooms/:coursesId/group_homework/:workId/question"
render={
(props) => (<CommonWorkQuestion {...this.props} {...props} {...this.state} {...commonHandler}/>)
}
></Route>
<Route exact path="/classrooms/:coursesId/group_homeworks/:workId/answer"
render={
(props) => (<CommonWorkAnswer {...this.props} {...props} {...this.state} {...commonHandler}/>)
}
></Route>
<Route exact path="/classrooms/:coursesId/group_homework/:workId/answer"
render={
(props) => (<CommonWorkAnswer {...this.props} {...props} {...this.state} {...commonHandler}/>)
}
></Route>
</Switch>
</div>
</div>

@ -163,7 +163,7 @@ class CommonWorkItem extends Component{
}
<div className="flex1" onClick={() => this.props.onItemClick(Object.assign({}, item, {id: item.homework_id})) }>
<p className="clearfix mb20">
<p className="clearfix">
{canNotLink?<span className={"fl font-16 font-bd mt2 comnonwidth580 pointer color-grey-name"}
title={ canNotLink ? "私有属性,非课堂成员不能访问" : item.name}
>
@ -199,7 +199,13 @@ class CommonWorkItem extends Component{
</li>
} */}
</p>
<p className="color-grey-9 clearfix">
{
item && item.upper_category_name &&
// <ConditionToolTip title={discussMessage.upper_category_name} condition={ discussMessage.upper_category_name.length > 22 }>
<div className="color-grey9 task-hide mt5" title={item.upper_category_name}>所属目录{item.upper_category_name}</div>
// </ConditionToolTip>
}
<p className="color-grey-9 clearfix mt10">
{ item.author && <span className="mr20 fl">{item.author}</span> }
{item.commit_count===undefined?"":<span className="mr20 fl">{item.commit_count} 已交</span>}
{item.uncommit_count===undefined?"":<span className="mr20 fl">{item.uncommit_count} 未交</span>}

@ -68,6 +68,12 @@ class CoursesWorkIndex extends Component{
(props) => (<CommonWorkDetailIndex {...this.props} {...props} {...this.state} />)
}
></Route>
<Route exact path="/classrooms/:coursesId/common_homework/:workId/setting"
render={
(props) => (<CommonWorkDetailIndex {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 作品列表 */}
<Route exact path="/classrooms/:coursesId/common_homeworks/:workId/list"
@ -75,17 +81,36 @@ class CoursesWorkIndex extends Component{
(props) => (<CommonWorkDetailIndex {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 作品列表 */}
<Route exact path="/classrooms/:coursesId/common_homework/:workId/list"
render={
(props) => (<CommonWorkDetailIndex {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 作业问答 */}
<Route exact path="/classrooms/:coursesId/common_homeworks/:workId/question"
render={
(props) => (<CommonWorkDetailIndex {...this.props} {...props} {...this.state} />)
}
></Route>
<Route exact path="/classrooms/:coursesId/common_homework/:workId/question"
render={
(props) => (<CommonWorkDetailIndex {...this.props} {...props} {...this.state} />)
}
></Route>
<Route exact path="/classrooms/:coursesId/common_homeworks/:workId/answer"
render={
(props) => (<CommonWorkDetailIndex {...this.props} {...props} {...this.state} />)
}
></Route>
<Route exact path="/classrooms/:coursesId/common_homework/:workId/answer"
render={
(props) => (<CommonWorkDetailIndex {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 评阅 */}
<Route exact path="/classrooms/:coursesId/common_homeworks/:workId/:studentWorkId/appraise"
@ -93,6 +118,12 @@ class CoursesWorkIndex extends Component{
(props) => (<CommonWorkAppraise {...this.props} {...props} {...this.state} />)
}
></Route>
<Route exact path="/classrooms/:coursesId/common_homework/:workId/:studentWorkId/appraise"
render={
(props) => (<CommonWorkAppraise {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 提交作品 */}
<Route exact path="/classrooms/:coursesId/common_homeworks/:workId/post"
@ -100,11 +131,22 @@ class CoursesWorkIndex extends Component{
(props) => (<CommonWorkPost {...this.props} {...props} {...this.state} />)
}
></Route>
<Route exact path="/classrooms/:coursesId/common_homework/:workId/post"
render={
(props) => (<CommonWorkPost {...this.props} {...props} {...this.state} />)
}
></Route>
<Route exact path="/classrooms/:coursesId/common_homeworks/:workId/:studentWorkId/post_edit"
render={
(props) => (<CommonWorkPost {...this.props} {...props} {...this.state} />)
}
></Route>
<Route exact path="/classrooms/:coursesId/common_homework/:workId/:studentWorkId/post_edit"
render={
(props) => (<CommonWorkPost {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 新建 */}
@ -114,12 +156,23 @@ class CoursesWorkIndex extends Component{
(props) => (<NewWork {...this.props} {...props} {...this.state} />)
}
></Route>
<Route exact path="/classrooms/:coursesId/common_homework/:workId/:pageType"
render={
(props) => (<NewWork {...this.props} {...props} {...this.state} />)
}
></Route>
<Route exact path="/classrooms/:coursesId/common_homeworks/:categroy_id/new"
render={
(props) => (<NewWork {...this.props} {...props} {...this.state} />)
}
></Route>
<Route exact path="/classrooms/:coursesId/common_homework/:categroy_id/new"
render={
(props) => (<NewWork {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 作业列表 */}
@ -128,6 +181,11 @@ class CoursesWorkIndex extends Component{
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
}
></Route>
<Route path="/classrooms/:coursesId/common_homework"
render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
}
></Route>
{/* --------------------------------------------------------------------- */}

@ -71,6 +71,11 @@ class CoursesWorkIndex extends Component{
(props) => (<CommonWorkDetailIndex {...this.props} {...props} {...this.state} />)
}
></Route>
<Route exact path="/classrooms/:coursesId/group_homework/:workId/setting"
render={
(props) => (<CommonWorkDetailIndex {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 作品列表 */}
<Route exact path="/classrooms/:coursesId/group_homeworks/:workId/list"
@ -78,6 +83,11 @@ class CoursesWorkIndex extends Component{
(props) => (<CommonWorkDetailIndex {...this.props} {...props} {...this.state} />)
}
></Route>
<Route exact path="/classrooms/:coursesId/group_homework/:workId/list"
render={
(props) => (<CommonWorkDetailIndex {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 作业问答 */}
<Route exact path="/classrooms/:coursesId/group_homeworks/:workId/question"
@ -85,31 +95,56 @@ class CoursesWorkIndex extends Component{
(props) => (<CommonWorkDetailIndex {...this.props} {...props} {...this.state} />)
}
></Route>
<Route exact path="/classrooms/:coursesId/group_homework/:workId/question"
render={
(props) => (<CommonWorkDetailIndex {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 参考答案 */}
<Route exact path="/classrooms/:coursesId/group_homeworks/:workId/answer"
render={
(props) => (<CommonWorkDetailIndex {...this.props} {...props} {...this.state} />)
}
></Route>
<Route exact path="/classrooms/:coursesId/group_homework/:workId/answer"
render={
(props) => (<CommonWorkDetailIndex {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 评阅 */}
<Route exact path="/classrooms/:coursesId/group_homeworks/:workId/:studentWorkId/appraise"
render={
(props) => (<CommonWorkAppraise {...this.props} {...props} {...this.state} />)
}
></Route>
<Route exact path="/classrooms/:coursesId/group_homework/:workId/:studentWorkId/appraise"
render={
(props) => (<CommonWorkAppraise {...this.props} {...props} {...this.state} />)
}
></Route>
<Route exact path="/classrooms/:coursesId/group_homeworks/:workId/post"
render={
(props) => (<CommonWorkPost {...this.props} {...props} {...this.state} />)
}
></Route>
<Route exact path="/classrooms/:coursesId/group_homeworks/:workId/:studentWorkId/post_edit"
<Route exact path="/classrooms/:coursesId/group_homework/:workId/post"
render={
(props) => (<CommonWorkPost {...this.props} {...props} {...this.state} />)
}
></Route>
<Route exact path="/classrooms/:coursesId/group_homeworks/:workId/:studentWorkId/post_edit"
render={
(props) => (<CommonWorkPost {...this.props} {...props} {...this.state} />)
}
></Route>
<Route exact path="/classrooms/:coursesId/group_homework/:workId/:studentWorkId/post_edit"
render={
(props) => (<CommonWorkPost {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 新建 */}
{/* http://localhost:3007/classrooms/1309/group_homeworks/9299/edit/1 */}
<Route exact path="/classrooms/:coursesId/group_homeworks/:workId/:pageType"
@ -117,11 +152,21 @@ class CoursesWorkIndex extends Component{
(props) => (<NewWork {...this.props} {...props} {...this.state} />)
}
></Route>
<Route exact path="/classrooms/:coursesId/group_homework/:workId/:pageType"
render={
(props) => (<NewWork {...this.props} {...props} {...this.state} />)
}
></Route>
<Route exact path="/classrooms/:coursesId/group_homeworks/:categroy_id/new"
render={
(props) => (<NewWork {...this.props} {...props} {...this.state} />)
}
></Route>
<Route exact path="/classrooms/:coursesId/group_homework/:categroy_id/new"
render={
(props) => (<NewWork {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 作业列表 */}
<Route path="/classrooms/:coursesId/group_homeworks"
@ -129,6 +174,12 @@ class CoursesWorkIndex extends Component{
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 作业列表 */}
<Route path="/classrooms/:coursesId/group_homework"
render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
}
></Route>
</Switch>

@ -34,8 +34,17 @@ class NewWork extends Component{
}
}
fetchCourseData = (courseId) => {
let newcategory=undefined;
if(this.props.match.path==="/classrooms/:coursesId/common_homework/:workId/:pageType"||this.props.match.path==="/classrooms/:coursesId/group_homework/:workId/:pageType"){
newcategory=this.props.match.params.workId
}
const isGroup = this.props.isGroup()
const url = `/courses/${courseId}/homework_commons/new.json?type=${isGroup ? 3 : 1}`
let url=""
if(newcategory){
url = `/courses/${courseId}/homework_commons/new.json?type=${isGroup ? 3 : 1}&category=${newcategory}`;
}else{
url = `/courses/${courseId}/homework_commons/new.json?type=${isGroup ? 3 : 1}`
}
axios.get(url, {
})
.then((response) => {
@ -54,7 +63,17 @@ class NewWork extends Component{
});
}
fetchWork = (workId) => {
const url = `/homework_commons/${workId}/edit.json`
let newcategory=undefined;
if(this.props.match.path==="/classrooms/:coursesId/common_homework/:workId/:pageType"||this.props.match.path==="/classrooms/:coursesId/group_homework/:workId/:pageType"){
newcategory=this.props.match.params.workId
}
let url=""
if(newcategory){
url = `/homework_commons/${workId}/edit.json?category=${newcategory}`;
}else{
url = `/homework_commons/${workId}/edit.json`
}
axios.get(url, {
})
.then((response) => {
@ -96,6 +115,9 @@ class NewWork extends Component{
doNew = (params) => {
const coursesId = this.props.match.params.coursesId
const newUrl = `/courses/${coursesId}/homework_commons.json`
if(this.props.match.path==="/classrooms/:coursesId/common_homework/:workId/:pageType"||this.props.match.path==="/classrooms/:coursesId/group_homework/:workId/:pageType"){
params.category=this.props.match.params.workId
}
axios.post(newUrl, params)
.then((response) => {

@ -96,7 +96,7 @@ class PublishRightnow extends Component{
}
homeworkstartend=(arg_group_ids,endtime)=>{
debugger
if (this.usingCheckBeforePost && this.props.checkBeforePost) {
const goOn = this.props.checkBeforePost();
if (!goOn) {
@ -104,7 +104,7 @@ class PublishRightnow extends Component{
return;
}
}
debugger
const isPublish = this.props.isPublish;
let group_ids = arg_group_ids
if (this.usingCheckBeforePost) {
@ -112,7 +112,7 @@ class PublishRightnow extends Component{
return item.id
})
}
debugger
if(this.state.course_groups.length>0){
if (this.state.course_groups.length && (!group_ids || group_ids&&group_ids.length == 0)) {
this.props.showNotification('请至少选择一个分班');

@ -130,9 +130,9 @@ class UseBank extends Component{
})
}
onSave = () => {
debugger
const { checkBoxValues } = this.state;
const { object_type } = this.props
const { object_type,category_id } = this.props
if(checkBoxValues.length==0){
this.setState({
isChecked:"请先选择"+engNameMap[object_type]
@ -149,7 +149,8 @@ class UseBank extends Component{
, {
"object_type": object_type,
"bank_id": checkBoxValues,
"course_id": courseId
"course_id": courseId,
"category":category_id
}
)
.then((response) => {

@ -31,7 +31,7 @@ export function RouteHOC(options = {}) {
// common_homework group_homework
// 是否是分组作业
isGroup = () => {
return window.location.pathname.indexOf('group_homeworks') != -1
return window.location.pathname.indexOf('group_homeworks') != -1||window.location.pathname.indexOf('group_homework') != -1
}
getModuleName = (isChinese) => {
const isGroup = this.isGroup()
@ -39,9 +39,30 @@ export function RouteHOC(options = {}) {
let chName = isGroup ? '分组作业' : '普通作业'
return chName;
}
const secondName = isGroup ? 'group_homeworks' : 'common_homeworks'
if(window.location.pathname.indexOf('group_homeworks') != -1){
const secondName ='group_homeworks';
return secondName;
}
if(window.location.pathname.indexOf('group_homework') != -1){
const secondName ='group_homework';
return secondName;
}
if(window.location.pathname.indexOf('common_homeworks') != -1){
const secondName ='common_homeworks';
return secondName;
}
if(window.location.pathname.indexOf('common_homework') != -1){
const secondName ='common_homework';
return secondName;
}
}
getModuleType = () => {
const isGroup = this.isGroup()
return isGroup ? 3 : 1

@ -6,7 +6,7 @@ import '../css/busyWork.css'
import CommonWorkItem from './CommonWorkItem'
import PublishRightnow from './PublishRightnow'
import ConnectProject from './ConnectProject'
import { WordsBtn, on, off } from 'educoder'
import { WordsBtn, on, off ,trigger} from 'educoder'
import Modals from '../../modals/Modals'
import NoneData from "../coursesPublic/NoneData"
import Titlesearchsection from '../common/titleSearch/TitleSearchSection';
@ -34,7 +34,9 @@ class commonWork extends Component{
totalCount:0,
checkAll:false,
checkBoxValues:[],
isSpin:false
isSpin:false,
category_id:undefined,
course_module:[]
}
}
//输入搜索条件
@ -45,8 +47,8 @@ class commonWork extends Component{
}
//搜索查询
searchStudent=()=>{
let {page,search,order}=this.state;
this.getList(1,search,order);
let {category_id,search,order}=this.state;
this.getList(1,search,order,category_id);
}
openConnectionProject = (work) => {
this.refs['connectProject'].openConnectionProject(work)
@ -69,23 +71,53 @@ class commonWork extends Component{
}
componentDidUpdate(prevProps, prevState) {
if (prevProps.match.path != this.props.match.path) {
if (prevProps.coursesidtype != this.props.coursesidtype||prevProps.match.params.category_id!=this.props.match.params.category_id) {
if (this.props.match.path === "/classrooms/:coursesId/common_homeworks/:category_id" || this.props.match.path === "/classrooms/:coursesId/common_homework/:category_id"||
this.props.match.path === "/classrooms/:coursesId/group_homeworks/:category_id" || this.props.match.path === "/classrooms/:coursesId/group_homework/:category_id"
) {
if (this.props.coursesidtype === "node" && this.props.match.path === "/classrooms/:coursesId/common_homeworks/:category_id"||
this.props.coursesidtype === "node" && this.props.match.path === "/classrooms/:coursesId/group_homeworks/:category_id"
) {
this.clearSelection()
this.setState({selectedKeys: 'all', order: ''}, () => {
this._getList()
})
}
if (this.props.coursesidtype === "child" && this.props.match.path === "/classrooms/:coursesId/common_homework/:category_id"||
this.props.coursesidtype === "child" && this.props.match.path === "/classrooms/:coursesId/group_homework/:category_id"
) {
this.clearSelection()
this.setState({selectedKeys: 'all', order: ''}, () => {
this._getList(this.props.match.params.category_id)
})
}
}
_getList = () => {
}
}
_getList = (id) => {
this.setState({
isSpin:true
isSpin:true,
category_id:id
})
let {page,search,order}=this.state;
this.getList(page,search,order);
this.getList(page,search,order,id);
}
componentDidMount(){
if(this.props.match.path === "/classrooms/:coursesId/common_homeworks/:category_id"||this.props.match.path === "/classrooms/:coursesId/group_homeworks/:category_id"){
this._getList()
}
if(this.props.match.path === "/classrooms/:coursesId/common_homework/:category_id"||this.props.match.path === "/classrooms/:coursesId/group_homework/:category_id") {
this._getList(this.props.match.params.category_id)
}
on('updateNavSuccess', this.updateNavSuccess)
}
@ -93,8 +125,13 @@ class commonWork extends Component{
off('updateNavSuccess', this.updateNavSuccess)
}
updateNavSuccess = () => {
if(this.props.match.path === "/classrooms/:coursesId/common_homeworks/:category_id"||this.props.match.path === "/classrooms/:coursesId/group_homeworks/:category_id"){
this._getList()
}
if(this.props.match.path === "/classrooms/:coursesId/common_homework/:category_id"||this.props.match.path === "/classrooms/:coursesId/group_homework/:category_id") {
this._getList(this.props.match.params.category_id)
}
}
useBankSuccess = (checkBoxValues, newWorkIdArray) => {
this.setState({
@ -104,11 +141,12 @@ class commonWork extends Component{
this.refs['publishModalRef'].open()
})
let {search, order}=this.state;
this.getList(1, search, order);
let {search, order,category_id}=this.state;
this.getList(1, search, order,category_id);
}
getList=(page,search,order)=>{
getList=(page,search,order,category_id)=>{
this.setState({
isSpin:true
})
@ -121,6 +159,9 @@ class commonWork extends Component{
if(search!=""){
url+="&search="+search;
}
if(category_id){
url+="&category="+category_id;
}
axios.get(encodeURI(url)).then((result)=>{
if(result.status==200){
this.setState({
@ -130,6 +171,32 @@ class commonWork extends Component{
page:page,
...result.data
})
this.getdatas(result.data.main_category_id)
}
}).catch((error)=>{
this.setState({
isSpin:false
})
})
}
getdatas=(main_category_id)=>{
let newcourse_module=[]
let urls=`/course_modules/${main_category_id}.json`
axios.get(encodeURI(urls)).then((result)=>{
if(result.status==200){
newcourse_module.push({name:result.data.course_module.module_name,id:result.data.course_module.id})
if(result.data.course_module.course_second_categories.length>0){
result.data.course_module.course_second_categories.map((item,key)=>{
newcourse_module.push(item)
})
}
this.setState({
course_module:newcourse_module
})
}
}).catch((error)=>{
this.setState({
@ -148,8 +215,8 @@ class commonWork extends Component{
checkBoxValues:[],
checkAll:false
})
let {search}=this.state;
this.getList(1,search,e.key==="all"?"":e.key);
let {search,category_id}=this.state;
this.getList(1,search,e.key==="all"?"":e.key,category_id);
}
onPageChange=(pageNumber)=>{
@ -157,8 +224,8 @@ class commonWork extends Component{
page:pageNumber,
checkBoxValues:[]
})
let {search,order}=this.state;
this.getList(pageNumber,search,order);
let {search,order,category_id}=this.state;
this.getList(pageNumber,search,order,category_id);
}
// 全选和反选
@ -191,7 +258,7 @@ class commonWork extends Component{
}
onWorkDelete = () => {
const { checkBoxValues } = this.state;
const { checkBoxValues,category_id} = this.state;
const len = checkBoxValues.length;
if (len == 0) {
this.props.showNotification('请先选择要删除的作业')
@ -209,13 +276,14 @@ class commonWork extends Component{
axios.post(url, {
homework_ids: checkBoxValues,
all_check: 0,
// category:category_id
// group_ids
}).then((response) => {
if (response.data.status == 0) {
this.props.showNotification('删除成功')
this.clearSelection()
let {search,order}=this.state;
this.getList(1,search,order);
this.getList(1,search,order,category_id);
this.props.updataleftNavfun()
}
@ -231,7 +299,7 @@ class commonWork extends Component{
}
//
onSetPublic = () => {
const { checkBoxValues } = this.state;
const { checkBoxValues,category_id } = this.state;
const len = checkBoxValues.length;
if (len == 0) {
this.props.showNotification('请先选择要公开的作业')
@ -252,7 +320,7 @@ class commonWork extends Component{
if (response.data.status == 0) {
this.props.showNotification('设为公开操作成功')
let {search,order, page}=this.state;
this.getList(page,search,order);
this.getList(page,search,order,category_id);
}
}).catch((error) => {
@ -262,8 +330,8 @@ class commonWork extends Component{
})
}
doWhenSuccess = () => {
let {search,order, page}=this.state;
this.getList(page,search,order);
let {search,order, page,category_id}=this.state;
this.getList(page,search,order,category_id);
this.setState({
checkBoxValues:[]
})
@ -279,7 +347,7 @@ class commonWork extends Component{
this.onChangeSelect(checkBoxValues)
}
addToBank = () => {
const { checkBoxValues } = this.state;
const { checkBoxValues,category_id } = this.state;
const len = checkBoxValues.length;
if (len == 0) {
this.props.showNotification('请先选择要加入题库的作业')
@ -294,7 +362,7 @@ class commonWork extends Component{
if (response.data.status == 0) {
this.props.showNotification('加入成功')
let {search,order}=this.state;
this.getList(1,search,order);
this.getList(1,search,order,category_id);
}
}).catch((error) => {
@ -302,26 +370,69 @@ class commonWork extends Component{
})
}
connectSuccess = () => {
let {page,search,order}=this.state;
this.getList(page,search,order);
let {page,search,order,category_id}=this.state;
this.getList(page,search,order,category_id);
}
cancelConnectionProject = (work) => {
let workId=this.props.match.params.workId;
let courseId=this.props.match.params.coursesId;
let {page,search,order,category_id}=this.state;
const url = `/homework_commons/${work.homework_id}/student_works/cancel_relate_project.json`
axios.get(url).then((response)=> {
if (response.data.status == 0) {
let {page,search,order}=this.state;
this.getList(page,search,order);
this.getList(page,search,order,category_id);
this.props.showNotification('取消关联成功')
}
}).catch((error)=>{
console.log(error)
})
}
addDir = (id) => {
if(!id){
trigger('addcommon_homeworks', parseInt(this.props.match.params.category_id))
}else{
let data={id:parseInt(id),name:this.state.category_name}
trigger('editcommon_homeworks', data)
}
}
newaddDir = () => {
trigger('addcommon_homeworks', parseInt(this.state.main_category_id))
}
moveTo = (item) => {
const len = this.state.checkBoxValues.length
if (len == 0) {
this.props.showNotification('请先在列表中选择要移动的作业')
return;
}
const checkBoxValues = this.state.checkBoxValues;
const coursesId= this.props.match.params.coursesId;
const category_id=this.state.category_id;
const url = `/courses/${coursesId}/homework_commons/move_to_category.json`
axios.post(url, {
homework_ids: checkBoxValues,
new_category_id: item.id,
category_id:!category_id?undefined:category_id
})
.then((response) => {
if (response.data.status == 0) {
console.log('--- 成功')
this.props.showNotification('作业移动成功')
this.props.updataleftNavfun()
this.setState({
checkBoxValues:[]
})
this.updateNavSuccess()
}
})
.catch(function (error) {
console.log(error);
});
}
render(){
let {
@ -334,11 +445,13 @@ class commonWork extends Component{
totalCount,
checkAll,
checkBoxValues,
course_module,
task_count,
published_count,
unpublished_count,
main_category_name,
category_name,
category_id
}=this.state;
const { coursedata } = this.props;
if (!coursedata) {
@ -350,9 +463,8 @@ class commonWork extends Component{
const isGroup = this.props.isGroup()
const isAdmin = this.props.isAdmin()
const bid = this.props.match.params.category_id
// <CourseLayoutcomponent {...this.props}>
// </CourseLayoutcomponent>
return(
<div>
@ -387,7 +499,7 @@ class commonWork extends Component{
<Titlesearchsection
title={main_category_name}
title={!category_id?main_category_name:category_name}
searchValue={ search }
// searchtype={this.props.isAdmin||this.props.isStudent ?true:false}
onInputSearchChange={this.inputStudent}
@ -399,6 +511,9 @@ class commonWork extends Component{
{ isAdmin && <li className="fr">
<UseBank {...this.props} {...this.state} object_type={isGroup ? "group" : "normal"} useBankSuccess={this.useBankSuccess}></UseBank>
</li> }
{ isAdmin && <li className="fr mr30">
<WordsBtn style="blue" className="fr" onClick={()=>this.addDir(category_id)}>{!category_id?"新建目录":"目录重命名"}</WordsBtn>
</li> }
</React.Fragment>
}
secondRowBotton={
@ -450,9 +565,33 @@ class commonWork extends Component{
</li>
{ !!course_public && <li className="li_line"><a href="javascript:void(0)" onClick={this.onSetPublic} className="color-grey-9">设为公开</a></li>}
{this.props.user&&this.props.user.main_site===true?<li><a href="javascript:void(0)" className="color-grey-9"
{this.props.user&&this.props.user.main_site===true?<li class="li_line"><a href="javascript:void(0)" className="color-grey-9"
onClick={this.addToBank}
>加入题库</a></li>:""}
<li className="li_line drop_down">
移动到...<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu"
style={{"right":"0px","left":"unset", maxHeight: '318px', overflowY: 'auto', minWidth: '200px'}}>
{ course_module && course_module.length > 10 && <p className="drop_down_search">
<Input placeholder="搜索" value={this.state.dirSearchValue} onChange={(e) => {this.setState({dirSearchValue: e.target.value})}}/>
</p> }
{
course_module && course_module.filter((item)=> {
return item.id != bid && (!this.state.dirSearchValue || item.name.indexOf(this.state.dirSearchValue) != -1)
}).map( (item, index) => {
return <li key={`i_${index}`} onClick={() => this.moveTo(item)} title={item.name}>{item.name}</li>
})
}
{ isAdmin &&
<p className="drop_down_btn">
<a href="javascript:void(0)" className="color-grey-6"
onClick={()=>this.newaddDir()}
>新建目录...</a>
</p>
}
{/* <p className="drop_down_btn"><a href="javascript:void(0)" className="color-grey-6">添加分班...</a></p> */}
</ul>
</li>
</div>
{/* 设为公开 */}
<Modals

@ -34,7 +34,7 @@ class CompetitionContentsMd extends Component{
}else{
chart_rules.rule_contents.map((items,keys)=>{
debugger
if(parseInt(this.props.tabkey)===items.competition_stage_id){
console.log(items)
this.contentMdRef.current.setValue(items.content);

@ -142,6 +142,8 @@ class Coursesleftnav extends Component{
off('editshixunmainname',this.editshixunmainname)
off('videoAdd',this.addVideo)
off('editVideo',this.editVideo)
off('addcommon_homeworks',this.addcommon_homeworks)
off('editcommon_homeworks',this.editcommon_homeworks)
}
addshixunchild=(e, data)=>{
this.Navmodalnames(e,1,"shixun_homework",data);
@ -149,6 +151,12 @@ class Coursesleftnav extends Component{
editshixunchild=(e, data)=>{
this.Navmodalnames(e,4,"editSecondname",data.id,data.name);
}
addcommon_homeworks=(e, data)=>{
this.Navmodalnames(e,1,"common_homework",data);
}
editcommon_homeworks=(e, data)=>{
this.Navmodalnames(e,4,"editSecondname",data.id,data.name);
}
editshixunmainname=(e, data)=>{
this.Navmodalnames(e,3,"editname",data.id,data.name);
}
@ -196,7 +204,8 @@ class Coursesleftnav extends Component{
on('editshixunmainname',this.editshixunmainname);
on('videoAdd',this.addVideo);
on('editVideo',this.editVideo)
on('addcommon_homeworks',this.addcommon_homeworks)
on('editcommon_homeworks',this.editcommon_homeworks)
let courstype=this.props.match.url;
@ -537,7 +546,7 @@ class Coursesleftnav extends Component{
}
saveNavmodapost=(url,value,positiontype,coursesId,type)=>{
console.log(positiontype)
axios.post(url,
{name:value}).then((result)=>{
if(result!=undefined){
@ -548,6 +557,23 @@ class Coursesleftnav extends Component{
description:result.data.message
});
if(positiontype==="common_homeworks"||positiontype==="common_homework"||positiontype==="group_homeworks"||positiontype==="group_homework"){
if(type===true){
this.updasaveNavmoda()
trigger('updateNavSuccess')
}else{
this.updasaveNavmoda()
if(positiontype==="common_homeworks"){
this.props.history.push(`/classrooms/${coursesId}/common_homework/${result.data.category_id}`);
}
if(positiontype==="group_homeworks"){
this.props.history.push(`/classrooms/${coursesId}/group_homework/${result.data.category_id}`);
}
}
return
}
if(positiontype==="shixun_homeworks"||positiontype==="shixun_homework"){
if(type===true){
this.updasaveNavmoda()
@ -557,6 +583,7 @@ class Coursesleftnav extends Component{
this.props.history.push(`/classrooms/${coursesId}/shixun_homework/${result.data.category_id}`);
}
return
}
if(positiontype==="files"||positiontype==="file"){
@ -569,22 +596,25 @@ class Coursesleftnav extends Component{
this.updasaveNavmoda()
this.props.history.push(`/classrooms/${coursesId}/file/${result.data.category_id}`);
}
return
}
if(positiontype==="boards"){
this.updasaveNavmoda()
trigger('updateNavSuccess')
this.props.history.push(`/classrooms/${coursesId}/boards/${result.data.category_id}`);
return
}
if(positiontype!="course_groups"&&positiontype!="shixun_homeworks"&&positiontype!="shixun_homework"){
this.updasaveNavmoda()
return
}
if(positiontype==="course_groups"){
this.props.updataleftNavfun();
this.props.history.push(`/classrooms/${coursesId}/course_groups/${result.data.group_id}`);
return
}
}
@ -864,6 +894,10 @@ class Coursesleftnav extends Component{
{/*公告栏*/}
{/*作业*/}
{item.type==="shixun_homework"?<div onClick={e=>this.Navmodalnames(e,1,"shixun_homework",item.id)}>新建目录</div>:""}
{/* 普通作业 */}
{item.type==="common_homework"?<div onClick={e=>this.Navmodalnames(e,1,"common_homeworks",item.id)}>新建目录</div>:""}
{/*/!* 分组作业 *!/*/}
{item.type==="group_homework"?<div onClick={e=>this.Navmodalnames(e,1,"group_homeworks",item.id)}>新建目录</div>:""}
{/*资源*/}
{item.type==="attachment"?<div onClick={e=>this.Navmodalnames(e,1,"attachment",item.id)}>新建目录</div>:""}
{/* 视频 */}
@ -894,8 +928,8 @@ class Coursesleftnav extends Component{
let {twosandiantypes,twosandiantypenum}=this.state;
return (item.type==="graduation"?"": <div className={item.type===twosandiantypes&&twosandiantypenum===index?"sandianboxs":"sandianboxs"} >
{/*作业/资源*/}
{item.type==="shixun_homework"||item.type==="attachment"||item.type==="graduation"?<div onClick={e=>this.Navmodalnames(e,4,"editSecondname",iem.category_id,iem.category_name)}>重命名</div>:""}
{item.type==="shixun_homework"||item.type==="attachment"?<div onClick={e=>this.deleteSecondary(e,1,iem.category_id)}>删除</div>:""}
{item.type==="shixun_homework"||item.type==="attachment"||item.type==="graduation"||item.type==="common_homework"||item.type==="group_homework"?<div onClick={e=>this.Navmodalnames(e,4,"editSecondname",iem.category_id,iem.category_name)}>重命名</div>:""}
{item.type==="shixun_homework"||item.type==="attachment"||item.type==="common_homework"||item.type==="group_homework"?<div onClick={e=>this.deleteSecondary(e,1,iem.category_id)}>删除</div>:""}
{/*分班*/}
{item.type==="course_group"?<div onClick={e=>this.Navmodalnames(e,5,"editSecondname",iem.category_id,iem.category_name)}>重命名</div>:""}
{item.type==="course_group"?<div onClick={e=>this.deleteSecondary(e,2,iem.category_id)}>删除</div>:""}

@ -156,7 +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){

@ -144,7 +144,7 @@ class EditableCourseSupportSetting extends Component {
}
for (let i = 0 ; i < keys.length - 1; i++) {
if (keys[i] == keys[i + 1]) {
debugger;
}
}
this.position2Target_idMap = this._reverseMap(reverseMap);

@ -277,7 +277,7 @@ class EcStudentList extends Component {
};
//删除学生
deletelistbthenters=()=>{
debugger
let {Myschoolstudents,studentall} =this.state;
let major_id=this.props.match.params.majorId;
let year_id=this.props.match.params.yearId;

@ -668,7 +668,7 @@ class MemoDetail extends Component {
// --------------------------------------------------------------------------------------------帖子獎勵 END
showCommentInput = () => {
debugger
if (window.__useKindEditor === true) {
this.refs.editor.showEditor();
} else {

@ -469,7 +469,7 @@ class LoginDialog extends Component {
autologin:isGoingValue
}
).then((response) => {
debugger;
if(response===undefined){
return
}

@ -95,7 +95,7 @@ class SendTopics extends Component{
}catch (e) {
}
debugger
if(this.props.mysendall===true){
//详情页面跳过来的
try {
@ -119,7 +119,7 @@ debugger
}
}else{
//外部多个列表页跳过来的
debugger
try {
var rurls="";
if(this.props.category==="normal"){

@ -16,7 +16,7 @@ class PackageIndexNEIBanner extends Component {
}
onChange=(current)=>{
debugger
console.log('onChange:', current);
this.setState({ current });
};

@ -63,7 +63,7 @@ class PaperDeletModel extends Component {
}
NewknTypedeltyoedels=()=>{
debugger
if(this.state.newkntypeinput.length===0){
this.setState({
errorestit:'请输入知识点',

@ -475,7 +475,7 @@ class Comthetestpaperst extends Component {
//////console.log('Clicked! But prevent default.');
}
deletesobject = (item, index) => {
debugger
var tmp = this.state.Knowpoints;
for (var i = 0; i < tmp.length; i++) {
if (i ===index) {

@ -123,7 +123,7 @@ class Paperreview_item extends Component {
}
axios.post(url, data)
.then((result) => {
debugger
if (result.data.status == 0) {
// this.props.showNotification(`拖动成功`);
this.props.getdata();

@ -106,7 +106,7 @@ class Audit_situationComponent extends Component {
}
showModal = (id,status) => {
debugger
this.setState({
visible: true,
editid:id,

@ -97,7 +97,7 @@ class Newshixuns extends Component {
})
const mdContnet = this.contentMdRef.current.getValue().trim();
this.props.form.validateFieldsAndScroll((err, values) => {
debugger
if (!err) {
console.log('Received values of form: ', values);

@ -94,7 +94,7 @@ class LoginRegisterComponent extends Component {
}
//倒计时
getverificationcode = () => {
debugger
if(this.state.login === undefined || this.state.login.length===0){
this.openNotification("请输入手机号或邮箱");
return;

@ -352,7 +352,7 @@ class LoginRegisterComponent extends Component {
login: this.state.login,
password: this.state.password,
}).then((response) => {
debugger
if (response === undefined) {
return
}

@ -110,7 +110,7 @@ class NewGtaskForms extends Component{
}
handleSubmit = () => {
console.log(this.props)
let {contentFileList,min_num,max_num,base_on_project}=this.state;
let {data}=this.props;
let task_type=data.task_type

Loading…
Cancel
Save