提交 0037455a 编写于 作者: KK's avatar KK

新增事件标注功能

上级 dff7e55b
......@@ -6,7 +6,7 @@
<div v-if="show" :class="['calender_box' , activeItem]">
<#-- 日历样式----月 -->
<#if ctrl.getCalendarStyle() == "MONTH" || ctrl.getCalendarStyle() == "MONTH_TIMELINE">
<Calendar
<app-calendar
ref="calendar"
@prev="prev"
@next="next"
......@@ -16,8 +16,9 @@
@select="clickDay"
@selectYear="selectYear"
@selectMonth="selectMonth"
:sign="sign"
:events="eventsDate"
:tileContent="tileContent"/>
:tileContent="tileContent"></app-calendar>
<#-- 日历样式----天 -->
<#elseif ctrl.getCalendarStyle() == "DAY">
<div class="calendar-tools">
......@@ -29,7 +30,7 @@
</div>
<#-- 日历样式----周 -->
<#elseif ctrl.getCalendarStyle() == "WEEK" || ctrl.getCalendarStyle() == "WEEK_TIMELINE">
<Calendar
<app-calendar
ref="calendar"
:weekSwitch="true"
:value="value"
......@@ -38,9 +39,10 @@
:markDate="markDate"
:responsive="true"
@select="clickDay"
:sign="sign"
@selectYear="selectYear"
@selectMonth="selectMonth"
:tileContent="tileContent"/>
:tileContent="tileContent"></app-calendar>
<#-- 日历样式----时间轴 -->
<#elseif ctrl.getCalendarStyle() == "TIMELINE">
......
......@@ -41,6 +41,13 @@ import moment from 'moment';
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected start: any;
/**
* 标志数据
* @type {Array<any>}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public sign: Array<any> = []
/**
* 结束时间
......@@ -258,7 +265,7 @@ import moment from 'moment';
*
* @param {any[]} datas
* @returns {Promise<any>}
* @memberof Mdctrl
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public async remove(datas: any[]): Promise<any> {
let arg: any = {};
......@@ -443,6 +450,31 @@ import moment from 'moment';
}
</#list>
</#if>
this.setSign();
}
/**
* 格式化标志数据
*
* @param any
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public setSign(){
this.sign = JSON.parse(JSON.stringify(this.evendata[this.activeItem]));
this.sign.forEach((item:any) => {
if(item.time.length == 10){
let year = item.time.split('-')[0];
let month = item.time.split('-')[1];
let day = item.time.split('-')[2];
if( month < 10 ){
month = month.replace('0','')
}
if(day < 10){
day = day.replace('0','')
}
item.time = year+'-'+month+'-'+day;
}
});
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册