提交 754bb349 编写于 作者: zcdtk's avatar zcdtk

日历代码处理

上级 6beddc58
......@@ -513,41 +513,44 @@ import moment from 'moment';
/**
* 解析日历事件数据
*
* @protected
* @param {string} tag
* @param {string} mark
* @returns {Array<any>}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public parsingData(tag:string,mark:string) :Array<any>{
let dataItem :any = [];
if(this.calendarItems[tag]){
this.calendarItems[tag].forEach((item:any) => {
if(dataItem.length == 0){
dataItem.push({time:item[mark].substring(0, 10),evens:[item]});
}else{
dataItem.forEach((sig:any)=>{
if(sig.time.substring(0, 10) != item[mark].substring(0, 10)){
dataItem.push({time:item[mark].substring(0, 10),evens:[item]});
}
})}
if(item[mark]){
if (this.evendata[tag].length > 0) {
this.evendata[tag].forEach((i: any) => {
if (i.time === item[mark].substring(0, 10)) {
if (i.evens) {
i.evens.push(item);
public parsingData(tag: string, mark: string): Array<any> {
let dataItem: any = [];
if (this.calendarItems[tag]) {
this.calendarItems[tag].forEach((item: any) => {
if (dataItem.length == 0) {
dataItem.push({ time: item[mark].substring(0, 10), evens: [item] });
} else {
dataItem.forEach((sig: any) => {
if (sig.time.substring(0, 10) != item[mark].substring(0, 10)) {
dataItem.push({ time: item[mark].substring(0, 10), evens: [item] });
}
} else {
})
}
if (item[mark]) {
if (this.evendata[tag].length > 0) {
this.evendata[tag].forEach((i: any) => {
if (i.time === item[mark].substring(0, 10)) {
if (i.evens) {
i.evens.push(item);
}
} else {
this.evendata[tag].push({
time: item[mark].substring(0, 10),
evens: [item]
});
}
});
} else {
this.evendata[tag].push({
time: item[mark].substring(0, 10),
evens: [item]
time: item[mark].substring(0, 10),
evens: [item]
});
}
});
} else {
this.evendata[tag].push({
time: item[mark].substring(0, 10),
evens: [item]
});
}
}
}
});
}
......@@ -629,7 +632,7 @@ import moment from 'moment';
*/
protected async onEventClick($event: any): Promise<any> {
let view: any = {};
let _context: any = Object.assign({},this.context);
let _context: any = { ...this.context };
let itemType = $event.itemType;
switch(itemType) {
<#if ctrl.getPSSysCalendarItems()??>
......@@ -645,22 +648,19 @@ import moment from 'moment';
</#if>
}
if (Object.is(view.placement, 'INDEXVIEWTAB') || Object.is(view.placement, '')) {
const routePath = this.$viewTool.buildUpRoutePath(this.$route, this.context, view.deResParameters, view.parameters, [JSON.parse(JSON.stringify(_context))] , JSON.parse(JSON.stringify(this.viewparams)));
const routePath = this.globaluiservice.openService.formatRouteParam(this.context, view.deResParameters, view.parameters, [_context], this.viewparams);
this.$router.push(routePath);
} else {
let container: Subject<any> = new Subject();
let response: any;
if (Object.is(view.placement, 'POPUPMODAL')) {
container = await this.$appmodal.openModal(view, JSON.parse(JSON.stringify(_context)), JSON.parse(JSON.stringify(this.viewparams)));
response = await this.$appmodal.openModal(view, _context, { ...this.viewparams });
} else if (view.placement.startsWith('DRAWER')) {
container = await this.$appdrawer.openDrawer(view, JSON.parse(JSON.stringify(_context)), JSON.parse(JSON.stringify(this.viewparams)));
response = await this.$appdrawer.openDrawer(view, _context, { ...this.viewparams });
}
container.subscribe((result: any) => {
if (!result || !Object.is(result.ret, 'OK')) {
return;
}
if (response && Object.is(response.ret, 'OK')) {
// 刷新日历
this.load(Object.assign(this.viewparams, { "start": this.start, "end": this.end }));
});
}
}
}
/**
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册