提交 47d66614 编写于 作者: zcdtk's avatar zcdtk

处理日历删除逻辑

根据激活项删除对应应用实体数据
上级 7418fc61
......@@ -87,7 +87,6 @@ import moment from 'moment';
*/
public eventsDate :any = {};
/**
* 日历项集合对象
*
......@@ -150,7 +149,6 @@ import moment from 'moment';
*/
protected calendarStyle: string = '${ctrl.getCalendarStyle()?lower_case}';
/**
* 获取多项数据
*
......@@ -160,7 +158,6 @@ import moment from 'moment';
public getDatas(): any[] {
return [];
}
/**
* 时间轴加载条数
......@@ -207,6 +204,7 @@ import moment from 'moment';
});
}
}
/**
* 事件绘制数据
*
......@@ -236,16 +234,16 @@ import moment from 'moment';
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected ionChange($event:any) {
let { detail: _detail } = $event;
if (!_detail) {
return ;
}
let { value: _value } = _detail;
if (!_value) {
return ;
}
this.activeItem = _value;
this.formatData(new Date(this.year+'/'+(this.month+1)+'/'+this.day));
let { detail: _detail } = $event;
if (!_detail) {
return ;
}
let { value: _value } = _detail;
if (!_value) {
return ;
}
this.activeItem = _value;
this.formatData(new Date(this.year+'/'+(this.month+1)+'/'+this.day));
}
/**
......@@ -254,7 +252,7 @@ import moment from 'moment';
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected selectday(year: any, month: any, weekIndex: any) {
this.value = [year, month, this.day];
this.value = [year, month, this.day];
}
/**
......@@ -263,13 +261,13 @@ import moment from 'moment';
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected prev(year: any, month: any, weekIndex: any) {
if(this.calendarStyle == "month_timeline" || this.calendarStyle == "month"){
this.selectday(year, month, this.day);
this.formatData(new Date(year+'/'+month+'/'+'1'));
}
if(this.calendarStyle == "week_timeline" || this.calendarStyle == "week"){
this.countWeeks(year,month,weekIndex);
}
if(this.calendarStyle == "month_timeline" || this.calendarStyle == "month"){
this.selectday(year, month, this.day);
this.formatData(new Date(year+'/'+month+'/'+'1'));
}
if(this.calendarStyle == "week_timeline" || this.calendarStyle == "week"){
this.countWeeks(year,month,weekIndex);
}
}
/**
......@@ -278,17 +276,15 @@ import moment from 'moment';
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected next(year: any, month: any, weekIndex: any) {
if(this.calendarStyle == "month_timeline" || this.calendarStyle == "month" ){
this.selectday(year, month, this.day);
this.formatData(new Date(year+'/'+month+'/'+'1'));
}
if(this.calendarStyle == "week_timeline" || this.calendarStyle == "week"){
this.countWeeks(year,month,weekIndex);
}
if(this.calendarStyle == "month_timeline" || this.calendarStyle == "month" ){
this.selectday(year, month, this.day);
this.formatData(new Date(year+'/'+month+'/'+'1'));
}
if(this.calendarStyle == "week_timeline" || this.calendarStyle == "week"){
this.countWeeks(year,month,weekIndex);
}
}
/**
* 删除
*
......@@ -297,16 +293,18 @@ import moment from 'moment';
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public async remove(datas: any[]): Promise<any> {
const calendarItemModel: any = this.calendarItemsModel.get(this.activeItem);
let { appde, keyPSAppDEField, majorPSAppDEField }: { appde: string, keyPSAppDEField: string, majorPSAppDEField: string } = calendarItemModel;
let arg: any = {};
let keys: Array<string> = [];
let infoStr: string = '';
datas.forEach((data: any, index: number) => {
keys.push(data.id);
keys.push(data[keyPSAppDEField]);
if (index < 5) {
if (!Object.is(infoStr, '')) {
infoStr += '、';
}
infoStr += data.display_name;
infoStr += data[majorPSAppDEField];
}
});
......@@ -317,8 +315,8 @@ import moment from 'moment';
}
return new Promise((resolve, reject) => {
const _remove = async () => {
let _context: any = { mail_activity: keys.join(';') }
const response: any = await this.service.delete('Remove', Object.assign({}, this.context, _context), arg, this.showBusyIndicator);
let _context: any = { [appde]: keys.join(';') }
const response: any = await this.service.delete(this.activeItem, { ...this.context, ..._context }, arg, this.showBusyIndicator);
if (response && response.status === 200) {
this.$notice.success('删除成功');
this.formatData(this.currentDate);
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册