AdministratorApe.js
2.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
//*
// 管理员列表
// */
import Loger from "../Loger";
import Ape from "./Ape";
import $ from "jquery";
import ClassDataProxy from "proxy/ClassDataProxy";
import MessageTypes from "../MessageTypes";
import dateUI from 'libs/laydate';
let loger = Loger.getLoger('PC-AdministratorApe');
class AdministratorApe extends Ape {
constructor() {
super();
this.isLocalStorage();
this.addEvent();
this.init();
}
init() {
$('#classManagementRight0').show();
$('#recordUl .recordLi').on('click',this._switchover.bind(this));//课堂分类
//日历插件
this._dateUI();
}
addEvent() {
}
isLocalStorage(){
//设置当前时间 给输入框默认值
this._setNewTime();
}
_switchover(evt){
$(evt.currentTarget).addClass('recordLiCheck').siblings().removeClass('recordLiCheck');
let ind = $(evt.currentTarget).attr('data');
this._emit(MessageTypes.SWITCH_CLASS,ind);
if(ind > 1){
$('.classManagementRight').eq(ind-1).show().siblings().hide();
}else{
$('#recordUl .recordLi').eq(0).addClass('recordLiCheck').siblings().removeClass('recordLiCheck');
$('.classManagementRight').eq(0).show().siblings().hide();
}
}
_dateUI(){
//执行一个laydate实例
dateUI.render({
elem: '.liveInfoCenterLiveStart' //指定元素
});
//执行一个laydate实例
dateUI.render({
elem: '.liveInfoCenterLiveEnd' //指定元素
});
//执行一个laydate实例
dateUI.render({
elem: '#createClassStartTime' //指定元素
});
//执行一个laydate实例
dateUI.render({
elem: '#createClassEndTime' //指定元素
});
//执行一个laydate实例
dateUI.render({
elem: '#createUserAbortTime' //指定元素
});
}
//设置当前时间 给输入框默认值
_setNewTime(){
let newDate = new Date();
let ysar = newDate.getFullYear();
let month = newDate.getMonth()+1;//月
let date = newDate.getDate();//日
month<10?'0'+month:month;
date<10?'0'+date:date;
let time = ysar+'-'+month+'-'+date;
$('.liveInfoCenterLiveStart').html(time);
$('.liveInfoCenterLiveEnd').html(time);
$('#createUserAbortTime').html(time);
}
}
export default AdministratorApe;