提交 9bb5f8ad 编写于 作者: KK's avatar KK

日历部件——tab标签切换查询

上级 24453081
......@@ -167,6 +167,14 @@ import moment from 'moment';
*/
public count :number = 20;
/**
* 是否有选中某天
*
* @type {number}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public isSelect: boolean = false;
/**
* 获取单项树
*
......@@ -261,6 +269,7 @@ import moment from 'moment';
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected prev(year: any, month: any, weekIndex: any) {
this.isSelect = true;
if(this.calendarStyle == "month_timeline" || this.calendarStyle == "month"){
this.selectday(year, month, this.day);
this.formatData(new Date(year+'/'+month+'/'+'1'));
......@@ -276,6 +285,7 @@ import moment from 'moment';
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected next(year: any, month: any, weekIndex: any) {
this.isSelect = true;
if(this.calendarStyle == "month_timeline" || this.calendarStyle == "month" ){
this.selectday(year, month, this.day);
this.formatData(new Date(year+'/'+month+'/'+'1'));
......@@ -344,6 +354,7 @@ import moment from 'moment';
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected selectYear(year: any) {
this.isSelect = true;
this.value = [year, this.month, this.day];
this.formatData(new Date(year+'/'+this.month+'/'+this.day));
}
......@@ -354,6 +365,7 @@ import moment from 'moment';
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected selectMonth(month: any, year: any) {
this.isSelect = true;
this.selectday(year, month, this.day);
this.formatData(new Date(year+'/'+month+'/'+this.day));
}
......@@ -384,6 +396,10 @@ import moment from 'moment';
this.start = (moment as any)(curtime).startOf('day').format('YYYY-MM-DD HH:mm:ss');
this.end = (moment as any)(curtime).endOf('day').format('YYYY-MM-DD HH:mm:ss');
</#if>
if(this.isSelect){
this.start = (moment as any)(curtime).startOf('day').format('YYYY-MM-DD HH:mm:ss');
this.end = (moment as any)(curtime).endOf('day').format('YYYY-MM-DD HH:mm:ss');
}else{
<#if ctrl.getCalendarStyle() == 'MONTH' || ctrl.getCalendarStyle() == 'MONTH_TIMELINE' || ctrl.getCalendarStyle() == 'TIMELINE'>
this.start = (moment as any)(curtime).startOf('month').format('YYYY-MM-DD HH:mm:ss');
this.end = (moment as any)(curtime).endOf('month').format('YYYY-MM-DD HH:mm:ss');
......@@ -392,6 +408,7 @@ import moment from 'moment';
this.start = (moment as any)(curtime).startOf('week').format('YYYY-MM-DD HH:mm:ss');
this.end = (moment as any)(curtime).endOf('week').format('YYYY-MM-DD HH:mm:ss');
</#if>
}
this.load(Object.assign(data, {
"start": this.start,
"end": this.end
......@@ -541,6 +558,7 @@ import moment from 'moment';
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected clickDay(data: any) {
this.isSelect = true;
if (data) {
let temptime = new Date(data);
this.year = temptime.getFullYear();
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册