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

处理日历删除逻辑

根据激活项删除对应应用实体数据
上级 7418fc61
...@@ -87,7 +87,6 @@ import moment from 'moment'; ...@@ -87,7 +87,6 @@ import moment from 'moment';
*/ */
public eventsDate :any = {}; public eventsDate :any = {};
/** /**
* 日历项集合对象 * 日历项集合对象
* *
...@@ -150,7 +149,6 @@ import moment from 'moment'; ...@@ -150,7 +149,6 @@ import moment from 'moment';
*/ */
protected calendarStyle: string = '${ctrl.getCalendarStyle()?lower_case}'; protected calendarStyle: string = '${ctrl.getCalendarStyle()?lower_case}';
/** /**
* 获取多项数据 * 获取多项数据
* *
...@@ -161,7 +159,6 @@ import moment from 'moment'; ...@@ -161,7 +159,6 @@ import moment from 'moment';
return []; return [];
} }
/** /**
* 时间轴加载条数 * 时间轴加载条数
* *
...@@ -207,6 +204,7 @@ import moment from 'moment'; ...@@ -207,6 +204,7 @@ import moment from 'moment';
}); });
} }
} }
/** /**
* 事件绘制数据 * 事件绘制数据
* *
...@@ -287,8 +285,6 @@ import moment from 'moment'; ...@@ -287,8 +285,6 @@ import moment from 'moment';
} }
} }
/** /**
* 删除 * 删除
* *
...@@ -297,16 +293,18 @@ import moment from 'moment'; ...@@ -297,16 +293,18 @@ import moment from 'moment';
* @memberof ${srfclassname('${ctrl.codeName}')} * @memberof ${srfclassname('${ctrl.codeName}')}
*/ */
public async remove(datas: any[]): Promise<any> { 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 arg: any = {};
let keys: Array<string> = []; let keys: Array<string> = [];
let infoStr: string = ''; let infoStr: string = '';
datas.forEach((data: any, index: number) => { datas.forEach((data: any, index: number) => {
keys.push(data.id); keys.push(data[keyPSAppDEField]);
if (index < 5) { if (index < 5) {
if (!Object.is(infoStr, '')) { if (!Object.is(infoStr, '')) {
infoStr += '、'; infoStr += '、';
} }
infoStr += data.display_name; infoStr += data[majorPSAppDEField];
} }
}); });
...@@ -317,8 +315,8 @@ import moment from 'moment'; ...@@ -317,8 +315,8 @@ import moment from 'moment';
} }
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const _remove = async () => { const _remove = async () => {
let _context: any = { mail_activity: keys.join(';') } let _context: any = { [appde]: keys.join(';') }
const response: any = await this.service.delete('Remove', Object.assign({}, this.context, _context), arg, this.showBusyIndicator); const response: any = await this.service.delete(this.activeItem, { ...this.context, ..._context }, arg, this.showBusyIndicator);
if (response && response.status === 200) { if (response && response.status === 200) {
this.$notice.success('删除成功'); this.$notice.success('删除成功');
this.formatData(this.currentDate); this.formatData(this.currentDate);
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册