升级日程安排,工作记录的日历控件到最新新版,功能更强大,体验更舒适
This commit is contained in:
parent
484d58350b
commit
9cf940bb3a
@ -133,6 +133,9 @@ class Plan extends BaseController
|
|||||||
}
|
}
|
||||||
if ($param['end_time'] <= $param['start_time']) {
|
if ($param['end_time'] <= $param['start_time']) {
|
||||||
return to_assign(1, "结束时间需要大于开始时间");
|
return to_assign(1, "结束时间需要大于开始时间");
|
||||||
|
}
|
||||||
|
if ($param['start_time'] <= time()) {
|
||||||
|
return to_assign(1, "开始时间需要大于当前时间");
|
||||||
}
|
}
|
||||||
if (isset($param['remind_type'])) {
|
if (isset($param['remind_type'])) {
|
||||||
if($param['remind_type']==1){
|
if($param['remind_type']==1){
|
||||||
@ -197,7 +200,7 @@ class Plan extends BaseController
|
|||||||
$id = get_params('id');
|
$id = get_params('id');
|
||||||
$schedule = Db::name('Plan')->where(['id' => $id])->find();
|
$schedule = Db::name('Plan')->where(['id' => $id])->find();
|
||||||
if (!empty($schedule)) {
|
if (!empty($schedule)) {
|
||||||
$schedule['remind_time'] = date('Y-m-d H:i', $schedule['remind_time']);
|
$schedule['remind_time'] = $schedule['remind_time'] == 0?'-':date('Y-m-d H:i', $schedule['remind_time']);
|
||||||
$schedule['start_time_a'] = date('Y-m-d', $schedule['start_time']);
|
$schedule['start_time_a'] = date('Y-m-d', $schedule['start_time']);
|
||||||
$schedule['end_time_a'] = date('Y-m-d', $schedule['end_time']);
|
$schedule['end_time_a'] = date('Y-m-d', $schedule['end_time']);
|
||||||
$schedule['start_time_b'] = date('H:i', $schedule['start_time']);
|
$schedule['start_time_b'] = date('H:i', $schedule['start_time']);
|
||||||
|
@ -416,13 +416,13 @@ user-select: none;}
|
|||||||
height: 'auto',//自动高度
|
height: 'auto',//自动高度
|
||||||
navLinks: true, // can click day/week names to navigate views
|
navLinks: true, // can click day/week names to navigate views
|
||||||
editable: true,//确定是否可以拖拉调整日历事件的时间。
|
editable: true,//确定是否可以拖拉调整日历事件的时间。
|
||||||
eventResizeStop:function(ev) {
|
eventResize:function(ev) {
|
||||||
var arg = ev.event
|
var arg = ev.event
|
||||||
console.log(arg);
|
console.log(arg);
|
||||||
var detail={};
|
var detail={};
|
||||||
detail['id']=arg.id;
|
detail['id']=arg.id;
|
||||||
detail['start_time_a']=arg.start.getFullYear()+'-'+(arg.start.getMonth()+1)+'-'+(arg.start.getDate());
|
detail['start_time_a']=arg.start.getFullYear()+'-'+addZero(arg.start.getMonth()+1)+'-'+addZero(arg.start.getDate());
|
||||||
detail['end_time_a']=arg.end.getFullYear()+'-'+(arg.end.getMonth()+1)+'-'+(arg.end.getDate());
|
detail['end_time_a']=arg.end.getFullYear()+'-'+addZero(arg.end.getMonth()+1)+'-'+addZero(arg.end.getDate());
|
||||||
detail['start_time_b']=addZero(arg.start.getHours())+':'+addZero(arg.start.getMinutes());
|
detail['start_time_b']=addZero(arg.start.getHours())+':'+addZero(arg.start.getMinutes());
|
||||||
detail['end_time_b']=addZero(arg.end.getHours())+':'+addZero(arg.end.getMinutes());
|
detail['end_time_b']=addZero(arg.end.getHours())+':'+addZero(arg.end.getMinutes());
|
||||||
console.log(detail);
|
console.log(detail);
|
||||||
@ -443,8 +443,8 @@ user-select: none;}
|
|||||||
console.log(arg);
|
console.log(arg);
|
||||||
var detail={};
|
var detail={};
|
||||||
detail['id']=arg.id;
|
detail['id']=arg.id;
|
||||||
detail['start_time_a']=arg.start.getFullYear()+'-'+(arg.start.getMonth()+1)+'-'+(arg.start.getDate());
|
detail['start_time_a']=arg.start.getFullYear()+'-'+addZero(arg.start.getMonth()+1)+'-'+addZero(arg.start.getDate());
|
||||||
detail['end_time_a']=arg.end.getFullYear()+'-'+(arg.end.getMonth()+1)+'-'+(arg.end.getDate());
|
detail['end_time_a']=arg.end.getFullYear()+'-'+addZero(arg.end.getMonth()+1)+'-'+addZero(arg.end.getDate());
|
||||||
detail['start_time_b']=addZero(arg.start.getHours())+':'+addZero(arg.start.getMinutes());
|
detail['start_time_b']=addZero(arg.start.getHours())+':'+addZero(arg.start.getMinutes());
|
||||||
detail['end_time_b']=addZero(arg.end.getHours())+':'+addZero(arg.end.getMinutes());
|
detail['end_time_b']=addZero(arg.end.getHours())+':'+addZero(arg.end.getMinutes());
|
||||||
console.log(detail);
|
console.log(detail);
|
||||||
@ -463,12 +463,11 @@ user-select: none;}
|
|||||||
selectable: true,//拖拉选择日期
|
selectable: true,//拖拉选择日期
|
||||||
selectMirror: true,//是否在用户拖动时绘制"占位符"事件。
|
selectMirror: true,//是否在用户拖动时绘制"占位符"事件。
|
||||||
select: function(arg) {
|
select: function(arg) {
|
||||||
//console.log(arg);
|
|
||||||
var detail={};
|
var detail={};
|
||||||
detail['id']=0;
|
detail['id']=0;
|
||||||
detail['title']='';
|
detail['title']='';
|
||||||
detail['start_time_a']=arg.start.getFullYear()+'-'+(arg.start.getMonth()+1)+'-'+(arg.start.getDate());
|
detail['start_time_a']=arg.start.getFullYear()+'-'+addZero(arg.start.getMonth()+1)+'-'+addZero(arg.start.getDate());
|
||||||
detail['end_time_a']=arg.end.getFullYear()+'-'+(arg.end.getMonth()+1)+'-'+(arg.end.getDate());
|
detail['end_time_a']=arg.end.getFullYear()+'-'+addZero(arg.end.getMonth()+1)+'-'+addZero(arg.end.getDate());
|
||||||
detail['start_time_b']=addZero(arg.start.getHours())+':'+addZero(arg.start.getMinutes());
|
detail['start_time_b']=addZero(arg.start.getHours())+':'+addZero(arg.start.getMinutes());
|
||||||
detail['end_time_b']=addZero(arg.end.getHours())+':'+addZero(arg.end.getMinutes());
|
detail['end_time_b']=addZero(arg.end.getHours())+':'+addZero(arg.end.getMinutes());
|
||||||
detail['remark']='';
|
detail['remark']='';
|
||||||
@ -476,12 +475,18 @@ user-select: none;}
|
|||||||
detail['remind_type']=0;
|
detail['remind_type']=0;
|
||||||
//console.log(detail);
|
//console.log(detail);
|
||||||
addEvent(detail);
|
addEvent(detail);
|
||||||
calendar.unselect()
|
|
||||||
},
|
},
|
||||||
nowIndicator: true,
|
nowIndicator: true,
|
||||||
weekNumbers: true,// 是否开启周数
|
weekNumbers: true,// 是否开启周数
|
||||||
displayEventEnd: false, //所有视图显示结束时间
|
displayEventEnd: false, //所有视图显示结束时间
|
||||||
eventTimeFormat: { // like '14:30:00'
|
eventTimeFormat: { // 事件的时间格式,like '14:30:00'
|
||||||
|
hour: '2-digit',
|
||||||
|
minute: '2-digit',
|
||||||
|
//second: '2-digit',
|
||||||
|
meridiem: false,
|
||||||
|
hour12: false //设置时间为24小时
|
||||||
|
},
|
||||||
|
slotLabelFormat: { // 列表视图左边的时间格式,like '14:30:00'
|
||||||
hour: '2-digit',
|
hour: '2-digit',
|
||||||
minute: '2-digit',
|
minute: '2-digit',
|
||||||
//second: '2-digit',
|
//second: '2-digit',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user