|
|
@ -3,13 +3,13 @@ import React,{ Component } from "react";
|
|
|
|
import {
|
|
|
|
import {
|
|
|
|
Form, Input, InputNumber, Switch, Radio,
|
|
|
|
Form, Input, InputNumber, Switch, Radio,
|
|
|
|
Slider, Button, Upload, Icon, Rate, Checkbox, message,
|
|
|
|
Slider, Button, Upload, Icon, Rate, Checkbox, message,
|
|
|
|
Row, Col, Select, Modal
|
|
|
|
Row, Col, Select, Modal, Divider
|
|
|
|
} from 'antd';
|
|
|
|
} from 'antd';
|
|
|
|
import TPMMDEditor from '../../tpm/challengesnew/TPMMDEditor';
|
|
|
|
import TPMMDEditor from '../../tpm/challengesnew/TPMMDEditor';
|
|
|
|
import axios from 'axios'
|
|
|
|
import axios from 'axios'
|
|
|
|
import './board.css'
|
|
|
|
import './board.css'
|
|
|
|
import "../common/formCommon.css"
|
|
|
|
import "../common/formCommon.css"
|
|
|
|
|
|
|
|
import AddDirModal from './AddDirModal'
|
|
|
|
import { RouteHOC } from './common.js'
|
|
|
|
import { RouteHOC } from './common.js'
|
|
|
|
import CBreadcrumb from '../common/CBreadcrumb'
|
|
|
|
import CBreadcrumb from '../common/CBreadcrumb'
|
|
|
|
import {getUploadActionUrl, bytesToSize, uploadNameSizeSeperator, appendFileSizeToUploadFile, appendFileSizeToUploadFileAll} from 'educoder';
|
|
|
|
import {getUploadActionUrl, bytesToSize, uploadNameSizeSeperator, appendFileSizeToUploadFile, appendFileSizeToUploadFileAll} from 'educoder';
|
|
|
@ -29,14 +29,14 @@ class BoardsNew extends Component{
|
|
|
|
boards: []
|
|
|
|
boards: []
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
componentDidMount = () => {
|
|
|
|
addSuccess = () => {
|
|
|
|
|
|
|
|
this.fetchBoards()
|
|
|
|
const topicId = this.props.match.params.topicId
|
|
|
|
}
|
|
|
|
|
|
|
|
fetchBoards = () => {
|
|
|
|
|
|
|
|
const isEdit = this.isEdit
|
|
|
|
const boardId = this.props.match.params.boardId
|
|
|
|
const boardId = this.props.match.params.boardId
|
|
|
|
const boardsUrl = `/courses/board_list.json?board_id=${boardId}`
|
|
|
|
|
|
|
|
const isEdit = !!topicId
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const boardsUrl = `/courses/board_list.json?board_id=${boardId}`
|
|
|
|
axios.get(boardsUrl, { })
|
|
|
|
axios.get(boardsUrl, { })
|
|
|
|
.then((response) => {
|
|
|
|
.then((response) => {
|
|
|
|
if (response.data.status == 0) {
|
|
|
|
if (response.data.status == 0) {
|
|
|
@ -57,8 +57,17 @@ class BoardsNew extends Component{
|
|
|
|
.catch(function (error) {
|
|
|
|
.catch(function (error) {
|
|
|
|
console.log(error);
|
|
|
|
console.log(error);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
componentDidMount = () => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const topicId = this.props.match.params.topicId
|
|
|
|
|
|
|
|
const isEdit = !!topicId
|
|
|
|
this.isEdit = isEdit
|
|
|
|
this.isEdit = isEdit
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const boardId = this.props.match.params.boardId
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.fetchBoards()
|
|
|
|
|
|
|
|
|
|
|
|
if (isEdit) {
|
|
|
|
if (isEdit) {
|
|
|
|
const url = `/messages/${topicId}.json`
|
|
|
|
const url = `/messages/${topicId}.json`
|
|
|
|
axios.get(url, {
|
|
|
|
axios.get(url, {
|
|
|
@ -260,6 +269,12 @@ class BoardsNew extends Component{
|
|
|
|
|
|
|
|
|
|
|
|
return(
|
|
|
|
return(
|
|
|
|
<div className="newMain ">
|
|
|
|
<div className="newMain ">
|
|
|
|
|
|
|
|
<AddDirModal {...this.props}
|
|
|
|
|
|
|
|
title="添加目录"
|
|
|
|
|
|
|
|
label="目录名称"
|
|
|
|
|
|
|
|
ref="addDirModal"
|
|
|
|
|
|
|
|
addSuccess={this.addSuccess}
|
|
|
|
|
|
|
|
></AddDirModal>
|
|
|
|
<style>{`
|
|
|
|
<style>{`
|
|
|
|
.courseForm .ant-form {
|
|
|
|
.courseForm .ant-form {
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -312,7 +327,17 @@ class BoardsNew extends Component{
|
|
|
|
{getFieldDecorator('select_board_id', {
|
|
|
|
{getFieldDecorator('select_board_id', {
|
|
|
|
// initialValue: '3779',
|
|
|
|
// initialValue: '3779',
|
|
|
|
})(
|
|
|
|
})(
|
|
|
|
<Select style={{ width: 230 }}>
|
|
|
|
<Select style={{ width: 230 }}
|
|
|
|
|
|
|
|
dropdownRender={menu => (
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
|
|
|
{menu}
|
|
|
|
|
|
|
|
<Divider style={{ margin: '4px 0' }} />
|
|
|
|
|
|
|
|
<div style={{ padding: '8px', cursor: 'pointer' }} onMouseDown={() => this.refs['addDirModal'].open()}>
|
|
|
|
|
|
|
|
<Icon type="plus" /> 添加目录
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
>
|
|
|
|
{this.state.boards.map(item => {
|
|
|
|
{this.state.boards.map(item => {
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<Option value={item.id}>{item.name}</Option>
|
|
|
|
<Option value={item.id}>{item.name}</Option>
|
|
|
|