dev_aliyun2
harry 5 years ago
parent 24155b753f
commit a440bfd6d7

@ -5236,11 +5236,6 @@
"es6-symbol": "^3.1.1"
}
},
"es6-promise": {
"version": "4.2.8",
"resolved": "https://registry.npm.taobao.org/es6-promise/download/es6-promise-4.2.8.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fes6-promise%2Fdownload%2Fes6-promise-4.2.8.tgz",
"integrity": "sha1-TrIVlMlyvEBVPSduUQU5FD21Pgo="
},
"es6-symbol": {
"version": "3.1.3",
"resolved": "https://registry.npm.taobao.org/es6-symbol/download/es6-symbol-3.1.3.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fes6-symbol%2Fdownload%2Fes6-symbol-3.1.3.tgz",
@ -6336,15 +6331,6 @@
}
}
},
"flv.js": {
"version": "1.5.0",
"resolved": "https://registry.npm.taobao.org/flv.js/download/flv.js-1.5.0.tgz",
"integrity": "sha1-+lm+1DkdcENc+odArEDsAHDvmK4=",
"requires": {
"es6-promise": "^4.2.5",
"webworkify": "^1.5.0"
}
},
"flvplayer": {
"version": "1.1.5",
"resolved": "https://registry.npm.taobao.org/flvplayer/download/flvplayer-1.1.5.tgz",
@ -17871,11 +17857,6 @@
"resolved": "https://registry.npm.taobao.org/websocket-extensions/download/websocket-extensions-0.1.3.tgz",
"integrity": "sha1-XS/yKXcAPsaHpLhwc9+7rBRszyk="
},
"webworkify": {
"version": "1.5.0",
"resolved": "https://registry.npm.taobao.org/webworkify/download/webworkify-1.5.0.tgz",
"integrity": "sha1-c0rYendN5uvdVG4dPgJ9pbj0pCw="
},
"whatwg-encoding": {
"version": "1.0.5",
"resolved": "https://registry.npm.taobao.org/whatwg-encoding/download/whatwg-encoding-1.0.5.tgz",

@ -14,7 +14,6 @@
"codemirror": "^5.52.0",
"echarts": "^4.2.0-rc.2",
"editor.md": "^1.5.0",
"flv.js": "^1.5.0",
"flvplayer": "^1.1.5",
"immutability-helper": "^3.0.1",
"js-base64": "^2.5.2",

@ -21,23 +21,8 @@ import _ from 'lodash'
import TPIContext from './TPIContext'
import {
EDU_ADMIN, EDU_SHIXUN_MANAGER, EDU_SHIXUN_MEMBER, EDU_CERTIFICATION_TEACHER
, EDU_GAME_MANAGER, EDU_TEACHER, EDU_NORMAL, EDU_BUSINESS, CNotificationHOC, getRandomNumber
, EDU_TEACHER, EDU_NORMAL, EDU_BUSINESS, CNotificationHOC, getRandomNumber
} from 'educoder'
import { MuiThemeProvider, createMuiTheme, withStyles } from 'material-ui/styles';
import MUIDialogStyleUtil from '../modules/page/component/MUIDialogStyleUtil'
const styles = MUIDialogStyleUtil.getTwoButtonStyle()
// 主题自定义
const theme = createMuiTheme({
palette: {
primary: {
main: '#4CACFF',
contrastText: 'rgba(255, 255, 255, 0.87)'
},
secondary: { main: '#4CACFF' }, // This is just green.A700 as hex.
},
});
const testSetsExpandedArrayInitVal = [false, false, false, false, false,
false, false, false, false, false,

@ -1,85 +1,85 @@
import React,{ Component } from "react";
import { Radio , Modal } from 'antd';
import React, { Component } from "react";
import { Radio, Modal } from 'antd';
import './video.css';
import axios from 'axios';
class MoveBox extends Component{
constructor(props){
class MoveBox extends Component {
constructor(props) {
super(props);
this.state={
data:undefined,
selectSubId:undefined
this.state = {
data: undefined,
selectSubId: undefined
}
}
componentDidUpdate=(prevProps)=>{
if(this.props.id && this.props.visible && this.props.id !== prevProps.id){
componentDidUpdate = (prevProps) => {
if (this.props.id && this.props.visible && this.props.id !== prevProps.id) {
this.getSubList(this.props.mainId);
}
}
getSubList=(id)=>{
getSubList = (id) => {
const url = `/course_modules/${id}.json`;
axios.get(url).then(result=>{
if(result){
axios.get(url).then(result => {
if (result) {
let list = result.data.course_module && result.data.course_module.course_second_categories;
let defaultId = list.length>0 ? list[0].id : undefined;
let defaultId = list.length > 0 ? list[0].id : undefined;
this.setState({
data:result.data.course_module,
selectSubId:defaultId
data: result.data.course_module,
selectSubId: defaultId
})
}
}).catch(error=>{
}).catch(error => {
console.log(error);
})
}
cancelMove=()=>{
cancelMove = () => {
const { setMoveVisible } = this.props;
setMoveVisible && setMoveVisible(false);
}
// 选择子目录
selectSub=(e)=>{
selectSub = (e) => {
this.setState({
selectSubId:e.target.value
selectSubId: e.target.value
})
}
handleSubmit=()=>{
handleSubmit = () => {
const CourseId = this.props.match.params.coursesId;
const { id } = this.props;
const { selectSubId } = this.state;
const url = `/courses/${CourseId}/move_to_category.json`;
axios.post(url,{
video_ids:[id],
new_category_id:selectSubId
}).then(result=>{
axios.post(url, {
video_ids: [id],
new_category_id: selectSubId
}).then(result => {
if(result){
if (result) {
const { setMoveVisible , successFunc , updataleftNavfun} = this.props;
const { setMoveVisible, successFunc, updataleftNavfun } = this.props;
updataleftNavfun && updataleftNavfun();
setMoveVisible && setMoveVisible(false);
successFunc && successFunc();
try {
this.props.showNotification(result.data.message);
}catch (e) {
} catch (e) {
}
}
}).catch(error=>{
}).catch(error => {
console.log(error);
})
}
render(){
const { visible , id } = this.props;
const { data , selectSubId } = this.state;
render() {
const { visible, id } = this.props;
const { data, selectSubId } = this.state;
let list = data && data.course_second_categories && data.course_second_categories.length>0?data.course_second_categories:undefined;
let list = data && data.course_second_categories && data.course_second_categories.length > 0 ? data.course_second_categories : undefined;
return(
return (
<Modal
visible={visible}
width="560px"
@ -116,8 +116,8 @@ class MoveBox extends Component{
</style>
<Radio.Group onChange={this.selectSub} value={selectSubId}>
{
list && list.map((item,key)=>{
return(
list && list.map((item, key) => {
return (
<Radio value={item.id} key={item.id}>
{item.name}
</Radio>

Loading…
Cancel
Save