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

新增事件标注功能

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