|
|
@ -6,7 +6,7 @@ import '../css/busyWork.css'
|
|
|
|
import CommonWorkItem from './CommonWorkItem'
|
|
|
|
import CommonWorkItem from './CommonWorkItem'
|
|
|
|
import PublishRightnow from './PublishRightnow'
|
|
|
|
import PublishRightnow from './PublishRightnow'
|
|
|
|
import ConnectProject from './ConnectProject'
|
|
|
|
import ConnectProject from './ConnectProject'
|
|
|
|
import { WordsBtn, on, off } from 'educoder'
|
|
|
|
import { WordsBtn, on, off ,trigger} from 'educoder'
|
|
|
|
import Modals from '../../modals/Modals'
|
|
|
|
import Modals from '../../modals/Modals'
|
|
|
|
import NoneData from "../coursesPublic/NoneData"
|
|
|
|
import NoneData from "../coursesPublic/NoneData"
|
|
|
|
import Titlesearchsection from '../common/titleSearch/TitleSearchSection';
|
|
|
|
import Titlesearchsection from '../common/titleSearch/TitleSearchSection';
|
|
|
@ -34,7 +34,9 @@ class commonWork extends Component{
|
|
|
|
totalCount:0,
|
|
|
|
totalCount:0,
|
|
|
|
checkAll:false,
|
|
|
|
checkAll:false,
|
|
|
|
checkBoxValues:[],
|
|
|
|
checkBoxValues:[],
|
|
|
|
isSpin:false
|
|
|
|
isSpin:false,
|
|
|
|
|
|
|
|
category_id:undefined,
|
|
|
|
|
|
|
|
course_module:[]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//输入搜索条件
|
|
|
|
//输入搜索条件
|
|
|
@ -45,8 +47,8 @@ class commonWork extends Component{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//搜索查询
|
|
|
|
//搜索查询
|
|
|
|
searchStudent=()=>{
|
|
|
|
searchStudent=()=>{
|
|
|
|
let {page,search,order}=this.state;
|
|
|
|
let {category_id,search,order}=this.state;
|
|
|
|
this.getList(1,search,order);
|
|
|
|
this.getList(1,search,order,category_id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
openConnectionProject = (work) => {
|
|
|
|
openConnectionProject = (work) => {
|
|
|
|
this.refs['connectProject'].openConnectionProject(work)
|
|
|
|
this.refs['connectProject'].openConnectionProject(work)
|
|
|
@ -54,7 +56,7 @@ class commonWork extends Component{
|
|
|
|
|
|
|
|
|
|
|
|
// 新建
|
|
|
|
// 新建
|
|
|
|
createCommonWork=(type)=>{
|
|
|
|
createCommonWork=(type)=>{
|
|
|
|
this.props.toNewPage(this.props.match.params)
|
|
|
|
this.props.toNewPage(this.props.match.params)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
cancelDelClasses=()=>{
|
|
|
|
cancelDelClasses=()=>{
|
|
|
@ -69,23 +71,53 @@ class commonWork extends Component{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
componentDidUpdate(prevProps, prevState) {
|
|
|
|
componentDidUpdate(prevProps, prevState) {
|
|
|
|
if (prevProps.match.path != this.props.match.path) {
|
|
|
|
|
|
|
|
this.clearSelection()
|
|
|
|
if (prevProps.coursesidtype != this.props.coursesidtype||prevProps.match.params.category_id!=this.props.match.params.category_id) {
|
|
|
|
this.setState({ selectedKeys: 'all', order: '' }, () => {
|
|
|
|
if (this.props.match.path === "/classrooms/:coursesId/common_homeworks/:category_id" || this.props.match.path === "/classrooms/:coursesId/common_homework/:category_id"||
|
|
|
|
this._getList()
|
|
|
|
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({
|
|
|
|
this.setState({
|
|
|
|
isSpin:true
|
|
|
|
isSpin:true,
|
|
|
|
|
|
|
|
category_id:id
|
|
|
|
})
|
|
|
|
})
|
|
|
|
let {page,search,order}=this.state;
|
|
|
|
let {page,search,order}=this.state;
|
|
|
|
this.getList(page,search,order);
|
|
|
|
this.getList(page,search,order,id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
componentDidMount(){
|
|
|
|
componentDidMount(){
|
|
|
|
this._getList()
|
|
|
|
|
|
|
|
|
|
|
|
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)
|
|
|
|
on('updateNavSuccess', this.updateNavSuccess)
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -93,9 +125,14 @@ class commonWork extends Component{
|
|
|
|
off('updateNavSuccess', this.updateNavSuccess)
|
|
|
|
off('updateNavSuccess', this.updateNavSuccess)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
updateNavSuccess = () => {
|
|
|
|
updateNavSuccess = () => {
|
|
|
|
this._getList()
|
|
|
|
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) => {
|
|
|
|
useBankSuccess = (checkBoxValues, newWorkIdArray) => {
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
page:1,
|
|
|
|
page:1,
|
|
|
@ -103,12 +140,13 @@ class commonWork extends Component{
|
|
|
|
}, () => {
|
|
|
|
}, () => {
|
|
|
|
this.refs['publishModalRef'].open()
|
|
|
|
this.refs['publishModalRef'].open()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
let {search, order}=this.state;
|
|
|
|
let {search, order,category_id}=this.state;
|
|
|
|
this.getList(1, search, order);
|
|
|
|
this.getList(1, search, order,category_id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
getList=(page,search,order)=>{
|
|
|
|
getList=(page,search,order,category_id)=>{
|
|
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
isSpin:true
|
|
|
|
isSpin:true
|
|
|
|
})
|
|
|
|
})
|
|
|
@ -121,6 +159,9 @@ class commonWork extends Component{
|
|
|
|
if(search!=""){
|
|
|
|
if(search!=""){
|
|
|
|
url+="&search="+search;
|
|
|
|
url+="&search="+search;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(category_id){
|
|
|
|
|
|
|
|
url+="&category="+category_id;
|
|
|
|
|
|
|
|
}
|
|
|
|
axios.get(encodeURI(url)).then((result)=>{
|
|
|
|
axios.get(encodeURI(url)).then((result)=>{
|
|
|
|
if(result.status==200){
|
|
|
|
if(result.status==200){
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
@ -130,6 +171,32 @@ class commonWork extends Component{
|
|
|
|
page:page,
|
|
|
|
page:page,
|
|
|
|
...result.data
|
|
|
|
...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)=>{
|
|
|
|
}).catch((error)=>{
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
@ -148,8 +215,8 @@ class commonWork extends Component{
|
|
|
|
checkBoxValues:[],
|
|
|
|
checkBoxValues:[],
|
|
|
|
checkAll:false
|
|
|
|
checkAll:false
|
|
|
|
})
|
|
|
|
})
|
|
|
|
let {search}=this.state;
|
|
|
|
let {search,category_id}=this.state;
|
|
|
|
this.getList(1,search,e.key==="all"?"":e.key);
|
|
|
|
this.getList(1,search,e.key==="all"?"":e.key,category_id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
onPageChange=(pageNumber)=>{
|
|
|
|
onPageChange=(pageNumber)=>{
|
|
|
@ -157,8 +224,8 @@ class commonWork extends Component{
|
|
|
|
page:pageNumber,
|
|
|
|
page:pageNumber,
|
|
|
|
checkBoxValues:[]
|
|
|
|
checkBoxValues:[]
|
|
|
|
})
|
|
|
|
})
|
|
|
|
let {search,order}=this.state;
|
|
|
|
let {search,order,category_id}=this.state;
|
|
|
|
this.getList(pageNumber,search,order);
|
|
|
|
this.getList(pageNumber,search,order,category_id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 全选和反选
|
|
|
|
// 全选和反选
|
|
|
@ -191,7 +258,7 @@ class commonWork extends Component{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
onWorkDelete = () => {
|
|
|
|
onWorkDelete = () => {
|
|
|
|
const { checkBoxValues } = this.state;
|
|
|
|
const { checkBoxValues,category_id} = this.state;
|
|
|
|
const len = checkBoxValues.length;
|
|
|
|
const len = checkBoxValues.length;
|
|
|
|
if (len == 0) {
|
|
|
|
if (len == 0) {
|
|
|
|
this.props.showNotification('请先选择要删除的作业')
|
|
|
|
this.props.showNotification('请先选择要删除的作业')
|
|
|
@ -209,13 +276,14 @@ class commonWork extends Component{
|
|
|
|
axios.post(url, {
|
|
|
|
axios.post(url, {
|
|
|
|
homework_ids: checkBoxValues,
|
|
|
|
homework_ids: checkBoxValues,
|
|
|
|
all_check: 0,
|
|
|
|
all_check: 0,
|
|
|
|
|
|
|
|
// category:category_id
|
|
|
|
// group_ids
|
|
|
|
// group_ids
|
|
|
|
}).then((response) => {
|
|
|
|
}).then((response) => {
|
|
|
|
if (response.data.status == 0) {
|
|
|
|
if (response.data.status == 0) {
|
|
|
|
this.props.showNotification('删除成功')
|
|
|
|
this.props.showNotification('删除成功')
|
|
|
|
this.clearSelection()
|
|
|
|
this.clearSelection()
|
|
|
|
let {search,order}=this.state;
|
|
|
|
let {search,order}=this.state;
|
|
|
|
this.getList(1,search,order);
|
|
|
|
this.getList(1,search,order,category_id);
|
|
|
|
this.props.updataleftNavfun()
|
|
|
|
this.props.updataleftNavfun()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -224,14 +292,14 @@ class commonWork extends Component{
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
clearSelection = () => {
|
|
|
|
clearSelection = () => {
|
|
|
|
this.setState({ checkBoxValues: [], checkAll: false })
|
|
|
|
this.setState({ checkBoxValues: [], checkAll: false })
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//
|
|
|
|
//
|
|
|
|
onSetPublic = () => {
|
|
|
|
onSetPublic = () => {
|
|
|
|
const { checkBoxValues } = this.state;
|
|
|
|
const { checkBoxValues,category_id } = this.state;
|
|
|
|
const len = checkBoxValues.length;
|
|
|
|
const len = checkBoxValues.length;
|
|
|
|
if (len == 0) {
|
|
|
|
if (len == 0) {
|
|
|
|
this.props.showNotification('请先选择要公开的作业')
|
|
|
|
this.props.showNotification('请先选择要公开的作业')
|
|
|
@ -249,10 +317,10 @@ class commonWork extends Component{
|
|
|
|
homework_ids: checkBoxValues,
|
|
|
|
homework_ids: checkBoxValues,
|
|
|
|
all_check: 0
|
|
|
|
all_check: 0
|
|
|
|
}).then((response) => {
|
|
|
|
}).then((response) => {
|
|
|
|
if (response.data.status == 0) {
|
|
|
|
if (response.data.status == 0) {
|
|
|
|
this.props.showNotification('设为公开操作成功')
|
|
|
|
this.props.showNotification('设为公开操作成功')
|
|
|
|
let {search,order, page}=this.state;
|
|
|
|
let {search,order, page}=this.state;
|
|
|
|
this.getList(page,search,order);
|
|
|
|
this.getList(page,search,order,category_id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}).catch((error) => {
|
|
|
|
}).catch((error) => {
|
|
|
@ -262,8 +330,8 @@ class commonWork extends Component{
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
doWhenSuccess = () => {
|
|
|
|
doWhenSuccess = () => {
|
|
|
|
let {search,order, page}=this.state;
|
|
|
|
let {search,order, page,category_id}=this.state;
|
|
|
|
this.getList(page,search,order);
|
|
|
|
this.getList(page,search,order,category_id);
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
checkBoxValues:[]
|
|
|
|
checkBoxValues:[]
|
|
|
|
})
|
|
|
|
})
|
|
|
@ -279,7 +347,7 @@ class commonWork extends Component{
|
|
|
|
this.onChangeSelect(checkBoxValues)
|
|
|
|
this.onChangeSelect(checkBoxValues)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
addToBank = () => {
|
|
|
|
addToBank = () => {
|
|
|
|
const { checkBoxValues } = this.state;
|
|
|
|
const { checkBoxValues,category_id } = this.state;
|
|
|
|
const len = checkBoxValues.length;
|
|
|
|
const len = checkBoxValues.length;
|
|
|
|
if (len == 0) {
|
|
|
|
if (len == 0) {
|
|
|
|
this.props.showNotification('请先选择要加入题库的作业')
|
|
|
|
this.props.showNotification('请先选择要加入题库的作业')
|
|
|
@ -291,10 +359,10 @@ class commonWork extends Component{
|
|
|
|
homework_ids: checkBoxValues,
|
|
|
|
homework_ids: checkBoxValues,
|
|
|
|
all_check: 0
|
|
|
|
all_check: 0
|
|
|
|
}).then((response) => {
|
|
|
|
}).then((response) => {
|
|
|
|
if (response.data.status == 0) {
|
|
|
|
if (response.data.status == 0) {
|
|
|
|
this.props.showNotification('加入成功')
|
|
|
|
this.props.showNotification('加入成功')
|
|
|
|
let {search,order}=this.state;
|
|
|
|
let {search,order}=this.state;
|
|
|
|
this.getList(1,search,order);
|
|
|
|
this.getList(1,search,order,category_id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}).catch((error) => {
|
|
|
|
}).catch((error) => {
|
|
|
@ -302,27 +370,70 @@ class commonWork extends Component{
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
connectSuccess = () => {
|
|
|
|
connectSuccess = () => {
|
|
|
|
let {page,search,order}=this.state;
|
|
|
|
let {page,search,order,category_id}=this.state;
|
|
|
|
this.getList(page,search,order);
|
|
|
|
this.getList(page,search,order,category_id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
cancelConnectionProject = (work) => {
|
|
|
|
cancelConnectionProject = (work) => {
|
|
|
|
let workId=this.props.match.params.workId;
|
|
|
|
let workId=this.props.match.params.workId;
|
|
|
|
let courseId=this.props.match.params.coursesId;
|
|
|
|
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`
|
|
|
|
const url = `/homework_commons/${work.homework_id}/student_works/cancel_relate_project.json`
|
|
|
|
axios.get(url).then((response)=> {
|
|
|
|
axios.get(url).then((response)=> {
|
|
|
|
if (response.data.status == 0) {
|
|
|
|
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('取消关联成功')
|
|
|
|
this.props.showNotification('取消关联成功')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}).catch((error)=>{
|
|
|
|
}).catch((error)=>{
|
|
|
|
console.log(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(){
|
|
|
|
render(){
|
|
|
|
let {
|
|
|
|
let {
|
|
|
|
search,
|
|
|
|
search,
|
|
|
@ -334,11 +445,13 @@ class commonWork extends Component{
|
|
|
|
totalCount,
|
|
|
|
totalCount,
|
|
|
|
checkAll,
|
|
|
|
checkAll,
|
|
|
|
checkBoxValues,
|
|
|
|
checkBoxValues,
|
|
|
|
|
|
|
|
course_module,
|
|
|
|
task_count,
|
|
|
|
task_count,
|
|
|
|
published_count,
|
|
|
|
published_count,
|
|
|
|
unpublished_count,
|
|
|
|
unpublished_count,
|
|
|
|
main_category_name,
|
|
|
|
main_category_name,
|
|
|
|
|
|
|
|
category_name,
|
|
|
|
|
|
|
|
category_id
|
|
|
|
}=this.state;
|
|
|
|
}=this.state;
|
|
|
|
const { coursedata } = this.props;
|
|
|
|
const { coursedata } = this.props;
|
|
|
|
if (!coursedata) {
|
|
|
|
if (!coursedata) {
|
|
|
@ -350,16 +463,15 @@ class commonWork extends Component{
|
|
|
|
|
|
|
|
|
|
|
|
const isGroup = this.props.isGroup()
|
|
|
|
const isGroup = this.props.isGroup()
|
|
|
|
const isAdmin = this.props.isAdmin()
|
|
|
|
const isAdmin = this.props.isAdmin()
|
|
|
|
|
|
|
|
const bid = this.props.match.params.category_id
|
|
|
|
|
|
|
|
|
|
|
|
// <CourseLayoutcomponent {...this.props}>
|
|
|
|
|
|
|
|
// </CourseLayoutcomponent>
|
|
|
|
|
|
|
|
return(
|
|
|
|
return(
|
|
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
{/* <div className="edu-back-white">
|
|
|
|
{/* <div className="edu-back-white">
|
|
|
|
<p className="clearfix padding30 bor-bottom-greyE">
|
|
|
|
<p className="clearfix padding30 bor-bottom-greyE">
|
|
|
|
<span className="font-18 fl color-dark-21">{moduleChineseName}</span>
|
|
|
|
<span className="font-18 fl color-dark-21">{moduleChineseName}</span>
|
|
|
|
|
|
|
|
|
|
|
|
</p>
|
|
|
|
</p>
|
|
|
|
<div className="clearfix pl30 pr30">
|
|
|
|
<div className="clearfix pl30 pr30">
|
|
|
|
<div className="fl mt6 task_menu_ul">
|
|
|
|
<div className="fl mt6 task_menu_ul">
|
|
|
@ -374,7 +486,7 @@ class commonWork extends Component{
|
|
|
|
</Menu>
|
|
|
|
</Menu>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className="fr mt16 mb16 searchView">
|
|
|
|
<div className="fr mt16 mb16 searchView">
|
|
|
|
<Search
|
|
|
|
<Search
|
|
|
|
value={search}
|
|
|
|
value={search}
|
|
|
|
placeholder="请输入姓名进行搜索"
|
|
|
|
placeholder="请输入姓名进行搜索"
|
|
|
|
onInput={this.inputStudent}
|
|
|
|
onInput={this.inputStudent}
|
|
|
@ -387,7 +499,7 @@ class commonWork extends Component{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Titlesearchsection
|
|
|
|
<Titlesearchsection
|
|
|
|
title={main_category_name}
|
|
|
|
title={!category_id?main_category_name:category_name}
|
|
|
|
searchValue={ search }
|
|
|
|
searchValue={ search }
|
|
|
|
// searchtype={this.props.isAdmin||this.props.isStudent ?true:false}
|
|
|
|
// searchtype={this.props.isAdmin||this.props.isStudent ?true:false}
|
|
|
|
onInputSearchChange={this.inputStudent}
|
|
|
|
onInputSearchChange={this.inputStudent}
|
|
|
@ -399,6 +511,9 @@ class commonWork extends Component{
|
|
|
|
{ isAdmin && <li className="fr">
|
|
|
|
{ isAdmin && <li className="fr">
|
|
|
|
<UseBank {...this.props} {...this.state} object_type={isGroup ? "group" : "normal"} useBankSuccess={this.useBankSuccess}></UseBank>
|
|
|
|
<UseBank {...this.props} {...this.state} object_type={isGroup ? "group" : "normal"} useBankSuccess={this.useBankSuccess}></UseBank>
|
|
|
|
</li> }
|
|
|
|
</li> }
|
|
|
|
|
|
|
|
{ isAdmin && <li className="fr mr30">
|
|
|
|
|
|
|
|
<WordsBtn style="blue" className="fr" onClick={()=>this.addDir(category_id)}>{!category_id?"新建目录":"目录重命名"}</WordsBtn>
|
|
|
|
|
|
|
|
</li> }
|
|
|
|
</React.Fragment>
|
|
|
|
</React.Fragment>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
secondRowBotton={
|
|
|
|
secondRowBotton={
|
|
|
@ -425,7 +540,7 @@ class commonWork extends Component{
|
|
|
|
searchPlaceholder={"请输入名称进行搜索"}
|
|
|
|
searchPlaceholder={"请输入名称进行搜索"}
|
|
|
|
showSearchInput={true}
|
|
|
|
showSearchInput={true}
|
|
|
|
></Titlesearchsection>
|
|
|
|
></Titlesearchsection>
|
|
|
|
<PublishRightnow ref="publishModalRef" showActionButton={true} {...this.props} checkBoxValues={checkBoxValues}
|
|
|
|
<PublishRightnow ref="publishModalRef" showActionButton={true} {...this.props} checkBoxValues={checkBoxValues}
|
|
|
|
showActionButton={false}
|
|
|
|
showActionButton={false}
|
|
|
|
isPublish={true}
|
|
|
|
isPublish={true}
|
|
|
|
islist={true}
|
|
|
|
islist={true}
|
|
|
@ -445,14 +560,38 @@ class commonWork extends Component{
|
|
|
|
<a href="javascript:void(0)" className="color-grey-9" onClick={() => this.refs['publishModalRef'].homeworkstart()}>{ "立即发布" }</a>
|
|
|
|
<a href="javascript:void(0)" className="color-grey-9" onClick={() => this.refs['publishModalRef'].homeworkstart()}>{ "立即发布" }</a>
|
|
|
|
</li>
|
|
|
|
</li>
|
|
|
|
<li className="li_line">
|
|
|
|
<li className="li_line">
|
|
|
|
<PublishRightnow showActionButton={true} {...this.props} checkBoxValues={checkBoxValues}
|
|
|
|
<PublishRightnow showActionButton={true} {...this.props} checkBoxValues={checkBoxValues}
|
|
|
|
isPublish={false} doWhenSuccess={this.doWhenSuccess} fromListPage={true}></PublishRightnow>
|
|
|
|
isPublish={false} doWhenSuccess={this.doWhenSuccess} fromListPage={true}></PublishRightnow>
|
|
|
|
</li>
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
{ !!course_public && <li className="li_line"><a href="javascript:void(0)" onClick={this.onSetPublic} className="color-grey-9">设为公开</a></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}
|
|
|
|
onClick={this.addToBank}
|
|
|
|
>加入题库</a></li>:""}
|
|
|
|
>加入题库</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>
|
|
|
|
</div>
|
|
|
|
{/* 设为公开 */}
|
|
|
|
{/* 设为公开 */}
|
|
|
|
<Modals
|
|
|
|
<Modals
|
|
|
@ -483,7 +622,7 @@ class commonWork extends Component{
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
!!totalCount && totalCount > 15 &&
|
|
|
|
!!totalCount && totalCount > 15 &&
|
|
|
|
<div className="edu-txt-center pt30 pb10 clearfix">
|
|
|
|
<div className="edu-txt-center pt30 pb10 clearfix">
|
|
|
|
<Pagination current={page} showQuickJumper pageSize={15} total={totalCount} onChange={this.onPageChange}></Pagination>
|
|
|
|
<Pagination current={page} showQuickJumper pageSize={15} total={totalCount} onChange={this.onPageChange}></Pagination>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
}
|
|
|
|
}
|
|
|
|