|
@@ -121,37 +121,6 @@ export class Scope {
|
|
|
viewModel: vmodel,
|
|
|
yvanScope: this,
|
|
|
referenceHolder: true,
|
|
|
-
|
|
|
- listeners: {
|
|
|
- renderedchange(sender, item, rendered, opts) {
|
|
|
- // 记录句柄
|
|
|
- if (rendered) {
|
|
|
- that._handle = this
|
|
|
- window['cp'] = that
|
|
|
-
|
|
|
- // 调用onLoad回调
|
|
|
- try {
|
|
|
- that._onLoad(sender)
|
|
|
- } catch (e) {
|
|
|
- console.error('errorAt onLoad', e)
|
|
|
- }
|
|
|
-
|
|
|
- const $back = $(sender.el.dom)
|
|
|
- .find('.navbar>.x-panelheader')
|
|
|
- .find('.x-body-el>.fa-angle-left')
|
|
|
- $back.on('click', () => {
|
|
|
- that._handle.close()
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
- // 如果vjson中配置了 afterrender ,需要恢复状态
|
|
|
- if (typeof that.vjson.listeners?.renderedchange === 'function') {
|
|
|
- that.vjson.listeners.renderedchange.apply(this, arguments)
|
|
|
- }
|
|
|
-
|
|
|
- this.fireEvent('afterrender', sender)
|
|
|
- },
|
|
|
- },
|
|
|
},
|
|
|
vjsonOption,
|
|
|
that.vjson,
|
|
@@ -176,15 +145,28 @@ export class Scope {
|
|
|
|
|
|
this.viewModel = that._handle.getViewModel()
|
|
|
this.viewModel.yvanScope = this
|
|
|
-
|
|
|
- Ext.Viewport.add(that._handle)
|
|
|
-
|
|
|
- // that._handle = Ext.Viewport.add(config)
|
|
|
- if (allowBack) {
|
|
|
- that._handle.show();
|
|
|
- }
|
|
|
-
|
|
|
that._handle.on({
|
|
|
+ renderedchange(sender, item, rendered, opts) {
|
|
|
+ // 记录句柄
|
|
|
+ if (rendered) {
|
|
|
+ that._handle = this
|
|
|
+ window['cp'] = that
|
|
|
+
|
|
|
+ // 调用onLoad回调
|
|
|
+ try {
|
|
|
+ that._onLoad()
|
|
|
+ } catch (e) {
|
|
|
+ console.error('errorAt onLoad', e)
|
|
|
+ }
|
|
|
+
|
|
|
+ const $back = $(sender.el.dom)
|
|
|
+ .find('.navbar>.x-panelheader')
|
|
|
+ .find('.x-body-el>.fa-angle-left')
|
|
|
+ $back.on('click', () => {
|
|
|
+ that._handle.close()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
destroy() {
|
|
|
// 卸载
|
|
|
window['cp'] = Ext.Viewport.items.getAt(Ext.Viewport.items.items.length - 2).getViewModel().yvanScope
|
|
@@ -192,6 +174,13 @@ export class Scope {
|
|
|
}
|
|
|
})
|
|
|
|
|
|
+ Ext.Viewport.add(that._handle)
|
|
|
+
|
|
|
+ // that._handle = Ext.Viewport.add(config)
|
|
|
+ if (allowBack) {
|
|
|
+ that._handle.show();
|
|
|
+ }
|
|
|
+
|
|
|
return that._handle
|
|
|
}
|
|
|
|