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

日历代码处理

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