dev_aliyun2
harry 5 years ago
parent 24155b753f
commit a440bfd6d7

@ -5236,11 +5236,6 @@
"es6-symbol": "^3.1.1" "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": { "es6-symbol": {
"version": "3.1.3", "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", "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": { "flvplayer": {
"version": "1.1.5", "version": "1.1.5",
"resolved": "https://registry.npm.taobao.org/flvplayer/download/flvplayer-1.1.5.tgz", "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", "resolved": "https://registry.npm.taobao.org/websocket-extensions/download/websocket-extensions-0.1.3.tgz",
"integrity": "sha1-XS/yKXcAPsaHpLhwc9+7rBRszyk=" "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": { "whatwg-encoding": {
"version": "1.0.5", "version": "1.0.5",
"resolved": "https://registry.npm.taobao.org/whatwg-encoding/download/whatwg-encoding-1.0.5.tgz", "resolved": "https://registry.npm.taobao.org/whatwg-encoding/download/whatwg-encoding-1.0.5.tgz",

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

@ -21,23 +21,8 @@ import _ from 'lodash'
import TPIContext from './TPIContext' import TPIContext from './TPIContext'
import { import {
EDU_ADMIN, EDU_SHIXUN_MANAGER, EDU_SHIXUN_MEMBER, EDU_CERTIFICATION_TEACHER 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' } 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, const testSetsExpandedArrayInitVal = [false, false, false, false, false,
false, false, false, false, false, false, false, false, false, false,

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

Loading…
Cancel
Save