提交 1aab2653 编写于 作者: Mosher's avatar Mosher

update:更新引擎

上级 735b2c6d
...@@ -60,7 +60,7 @@ export default class EditView2Engine extends EditViewEngine { ...@@ -60,7 +60,7 @@ export default class EditView2Engine extends EditViewEngine {
* @param {any[]} args * @param {any[]} args
* @memberof EditView2Engine * @memberof EditView2Engine
*/ */
public drbarEvent(eventName: string, args: any[]): void { public drbarEvent(eventName: string, args: any): void {
if (Object.is(eventName, 'selectionchange')) { if (Object.is(eventName, 'selectionchange')) {
this.drBarSelectionChange(args); this.drBarSelectionChange(args);
} }
...@@ -72,13 +72,15 @@ export default class EditView2Engine extends EditViewEngine { ...@@ -72,13 +72,15 @@ export default class EditView2Engine extends EditViewEngine {
* @param {any[]} args * @param {any[]} args
* @memberof EditView2Engine * @memberof EditView2Engine
*/ */
public drBarSelectionChange(args: any[]): void { public drBarSelectionChange(data: any): void {
const item = args[0]; if (data) {
if (!item || Object.keys(item).length === 0) { this.view.drItem = data;
return; if (this.getDRBar()) {
this.setViewState2({ tag: this.getDRBar().name, action: 'change', viewdata: data });
}
this.view.$forceUpdate();
} }
this.view.selection = {}; this.view.$emit('selectionchange', data);
Object.assign(this.view.selection, JSON.parse(JSON.stringify(item)));
} }
/** /**
...@@ -89,10 +91,13 @@ export default class EditView2Engine extends EditViewEngine { ...@@ -89,10 +91,13 @@ export default class EditView2Engine extends EditViewEngine {
*/ */
public onFormLoad(arg: any = {}): void { public onFormLoad(arg: any = {}): void {
super.onFormLoad(arg); super.onFormLoad(arg);
this.view.formData = arg;
if (this.getDRBar()) { if (this.getDRBar()) {
const tag = this.getDRBar().name; const tag = this.getDRBar().name;
this.setViewState2({ tag: tag, action: 'state', viewdata: this.view.vieparams }); Object.assign(arg, {
srfparentdename: this.getForm().appDeCodeName,
srfparentkey: arg.srfkey,
});
this.setViewState2({ tag: tag, action: 'state', viewdata: arg });
} }
} }
...@@ -104,10 +109,13 @@ export default class EditView2Engine extends EditViewEngine { ...@@ -104,10 +109,13 @@ export default class EditView2Engine extends EditViewEngine {
*/ */
public onFormSave(arg: any = {}): void { public onFormSave(arg: any = {}): void {
super.onFormSave(arg); super.onFormSave(arg);
this.view.formData = arg;
if (this.getDRBar()) { if (this.getDRBar()) {
const tag = this.getDRBar().name; const tag = this.getDRBar().name;
this.setViewState2({ tag: tag, action: 'state', viewdata: this.view.viewparams }); Object.assign(arg, {
srfparentdename: this.getForm().appDeCodeName,
srfparentkey: arg.srfkey,
});
this.setViewState2({ tag: tag, action: 'state', viewdata: arg });
} }
} }
...@@ -122,7 +130,7 @@ export default class EditView2Engine extends EditViewEngine { ...@@ -122,7 +130,7 @@ export default class EditView2Engine extends EditViewEngine {
} }
/** /**
* @description 销毁 * @description 视图销毁
* @memberof EditView2Engine * @memberof EditView2Engine
*/ */
public destroy() { public destroy() {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册