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

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

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