1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
import { ViewEngine } from './view-engine';
/**
* 视图引擎基础
*
* @export
* @class GridViewEngine
*/
export class WizardViewEngine extends ViewEngine {
/**
* 向导面板部件
*
* @protected
* @type {*}
* @memberof EditViewEngine
*/
protected wizardpanel: any;
/**
* 初始化编辑视图引擎
*
* @param {*} [options={}]
* @memberof EditViewEngine
*/
public init(options: any = {}): void {
this.wizardpanel = options.wizardpanel;
super.init(options);
}
/**
* 引擎加载
*
* @param {*} [opts={}]
* @memberof EditViewEngine
*/
public load(opts: any = {}): void {
super.load(opts);
if (this.getWizardPanel()) {
const tag = this.getWizardPanel().name;
this.setViewState2({ tag: tag, action: 'load', viewdata: this.view.context });
}
}
/**
* 部件事件机制
*
* @param {string} ctrlName
* @param {string} eventName
* @param {*} args
* @memberof ViewEngine
*/
public onCtrlEvent(ctrlName: string, eventName: string, args: any): void {
if (Object.is(ctrlName, 'wizardpanel')) {
this.wizardPanelEvent(eventName, args);
}
super.onCtrlEvent(ctrlName, eventName, args);
}
/**
* 事件处理
*
* @param {string} eventName
* @param {any[]} args
* @memberof MDViewEngine
*/
public wizardPanelEvent(eventName: string, args: any): void {
if (Object.is(eventName, 'finish')) {
this.onfinish(args);
}
}
/**
* 完成
*
* @param {*} args
* @memberof WizardViewEngine
*/
public onfinish(args: any): void {
this.emitViewEvent('viewdataschange', [args]);
if(!this.view.viewDefaultUsage){
this.emitViewEvent('close', null);
}else{
this.view.$tabPageExp.onClose(this.view.$route.fullPath);
}
}
/**
* 获取向导面板
*
* @returns {*}
* @memberof WizardViewEngine
*/
public getWizardPanel(): any {
return this.wizardpanel;
}
/**
* @description 视图销毁
* @memberof WizardViewEngine
*/
public destroyed() {
super.destroyed();
this.wizardpanel = null;
}
}