Merge branch 'dev_aliyun' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun
commit
65761f15f5
@ -1,4 +1,4 @@
|
|||||||
json.(attendance, :name, :mode)
|
json.(attendance, :id, :name, :mode)
|
||||||
json.attendance_date attendance.attendance_date.strftime("%Y/%m/%d")
|
json.attendance_date attendance.attendance_date.strftime("%Y/%m/%d")
|
||||||
json.start_time attendance.start_time.strftime("%H:%M")
|
json.start_time attendance.start_time.strftime("%H:%M")
|
||||||
json.end_time attendance.end_time.strftime("%H:%M")
|
json.end_time attendance.end_time.strftime("%H:%M")
|
||||||
|
@ -0,0 +1,5 @@
|
|||||||
|
class AddLinkToAttachments < ActiveRecord::Migration[5.2]
|
||||||
|
def change
|
||||||
|
add_column :attachments, :link, :string
|
||||||
|
end
|
||||||
|
end
|
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 394 KiB After Width: | Height: | Size: 404 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,21 @@
|
|||||||
|
import Quill from "quill";
|
||||||
|
const Inline = Quill.import('blots/inline');
|
||||||
|
|
||||||
|
export default class LinkBlot extends Inline {
|
||||||
|
static create(value) {
|
||||||
|
let node = super.create()
|
||||||
|
let rs = value
|
||||||
|
if (rs.indexOf('http://') < 0) {
|
||||||
|
rs = 'http://' + rs
|
||||||
|
}
|
||||||
|
node.setAttribute('href', rs)
|
||||||
|
node.setAttribute('target', '_blank')
|
||||||
|
return node;
|
||||||
|
}
|
||||||
|
|
||||||
|
static formats(node) {
|
||||||
|
return node.getAttribute('href');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
LinkBlot.blotName = 'link'
|
||||||
|
LinkBlot.tagName = 'a'
|
@ -0,0 +1,128 @@
|
|||||||
|
import React,{ Component } from "react";
|
||||||
|
import { Radio , Modal } from 'antd';
|
||||||
|
import './video.css';
|
||||||
|
import axios from 'axios';
|
||||||
|
class MoveBox extends Component{
|
||||||
|
constructor(props){
|
||||||
|
super(props);
|
||||||
|
this.state={
|
||||||
|
data:undefined,
|
||||||
|
selectSubId:undefined
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
componentDidUpdate=(prevProps)=>{
|
||||||
|
if(this.props.id && this.props.visible && this.props.id !== prevProps.id){
|
||||||
|
this.getSubList(this.props.mainId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
getSubList=(id)=>{
|
||||||
|
const url = `/course_modules/${id}.json`;
|
||||||
|
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;
|
||||||
|
this.setState({
|
||||||
|
data:result.data.course_module,
|
||||||
|
selectSubId:defaultId
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}).catch(error=>{
|
||||||
|
console.log(error);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
cancelMove=()=>{
|
||||||
|
const { setMoveVisible } = this.props;
|
||||||
|
setMoveVisible && setMoveVisible(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 选择子目录
|
||||||
|
selectSub=(e)=>{
|
||||||
|
this.setState({
|
||||||
|
selectSubId:e.target.value
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
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=>{
|
||||||
|
if(result){
|
||||||
|
const { setMoveVisible , successFunc , updataleftNavfun} = this.props;
|
||||||
|
updataleftNavfun && updataleftNavfun();
|
||||||
|
setMoveVisible && setMoveVisible(false);
|
||||||
|
successFunc && successFunc();
|
||||||
|
}
|
||||||
|
}).catch(error=>{
|
||||||
|
console.log(error);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
return(
|
||||||
|
<Modal
|
||||||
|
visible={visible}
|
||||||
|
width="560px"
|
||||||
|
title={'移动到'}
|
||||||
|
footer={null}
|
||||||
|
closable={false}
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
<style>
|
||||||
|
{
|
||||||
|
`
|
||||||
|
.ant-radio-group.ant-radio-group-outline{
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
.ant-radio-wrapper{
|
||||||
|
margin-bottom:5px;
|
||||||
|
display:flex;
|
||||||
|
}
|
||||||
|
.ant-radio{
|
||||||
|
margin-top:2px;
|
||||||
|
}
|
||||||
|
.ant-radio-group.ant-radio-group-outline span:last-child{
|
||||||
|
max-height: 450px;
|
||||||
|
display: block;
|
||||||
|
flex: 1;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
|
||||||
|
}
|
||||||
|
`
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<Radio.Group onChange={this.selectSub} value={selectSubId}>
|
||||||
|
{
|
||||||
|
list && list.map((item,key)=>{
|
||||||
|
return(
|
||||||
|
<Radio value={item.id} key={item.id}>
|
||||||
|
{item.name}
|
||||||
|
</Radio>
|
||||||
|
)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</Radio.Group>
|
||||||
|
<div className="clearfix mt30 edu-txt-center">
|
||||||
|
<a onClick={this.cancelMove} className="task-btn mr30">取消</a>
|
||||||
|
<a type="submit" onClick={this.handleSubmit} className="task-btn task-btn-orange">确定</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Modal>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
export default MoveBox;
|
After Width: | Height: | Size: 68 KiB |
Loading…
Reference in new issue