|
@@ -94,6 +94,8 @@ export class Scope {
|
|
|
handle.setStyle({'z-index': 1})
|
|
|
Ext.Viewport.getLayout().setAnimation({type: 'slide', direction: 'right', duration: 300})
|
|
|
Ext.Viewport.setActiveItem(handle)
|
|
|
+ Scope.SHOW_PAGE_STACK.length = 0
|
|
|
+ Scope.SHOW_PAGE_STACK.push((window as any).mainWindow)
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -126,8 +128,6 @@ export class Scope {
|
|
|
vjsonOption,
|
|
|
dataOption
|
|
|
} = option
|
|
|
-
|
|
|
-
|
|
|
this._vjsonOption = vjsonOption;
|
|
|
this._dataOption = dataOption;
|
|
|
const vmodel = _.defaultsDeep({
|
|
@@ -167,7 +167,6 @@ export class Scope {
|
|
|
}, config)
|
|
|
}
|
|
|
that._handle = Ext.create(config)
|
|
|
-
|
|
|
this.viewModel = that._handle.getViewModel()
|
|
|
this.viewModel.yvanScope = this
|
|
|
that._handle.on({
|
|
@@ -186,31 +185,35 @@ export class Scope {
|
|
|
const $back = $(sender.el.dom)
|
|
|
.find('.navbar>.x-panelheader')
|
|
|
.find('.x-body-el>.fa-angle-left')
|
|
|
+ $back.off('click');
|
|
|
$back.on('click', () => {
|
|
|
- // // 显示前一个页面
|
|
|
- // const index = Scope.SHOW_PAGE_STACK.findIndex(scope => scope === this);
|
|
|
- // if (index >= 0) {
|
|
|
- // Scope.SHOW_PAGE_STACK.splice(index, 1);
|
|
|
- // }
|
|
|
- // const scopeArr = _.sortBy(Scope.SHOW_PAGE_STACK, scope => scope._lastShowTime)
|
|
|
- // if (scopeArr.length > 0) {
|
|
|
- // const scope = scopeArr[scopeArr.length - 1]
|
|
|
- // scope._handle.setStyle({'z-index': 1})
|
|
|
- // let actived = false;
|
|
|
- // (Ext.Viewport.getItems().items as []).forEach((item, idx) => {
|
|
|
- // if (!actived && item === scope._handle) {
|
|
|
- // actived = true
|
|
|
- // Ext.Viewport.getLayout().setAnimation({type: 'slide', direction: 'right', duration: 300})
|
|
|
- // Ext.Viewport.setActiveItem(idx)
|
|
|
- // scope._lastShowTime = new Date().getTime()
|
|
|
- // }
|
|
|
- // })
|
|
|
- // }
|
|
|
+ const handle = Ext.Viewport.getActiveItem();
|
|
|
+ // 显示前一个页面
|
|
|
+ const index = Scope.SHOW_PAGE_STACK.findIndex(scope => scope._handle === handle);
|
|
|
+ // console.log("###### remove", index)
|
|
|
+ if (index >= 0) {
|
|
|
+ Scope.SHOW_PAGE_STACK.splice(index, 1);
|
|
|
+ }
|
|
|
+ const scopeArr = _.sortBy(Scope.SHOW_PAGE_STACK, scope => scope._lastShowTime)
|
|
|
+ if (scopeArr.length > 0) {
|
|
|
+ const scope = scopeArr[scopeArr.length - 1]
|
|
|
+ scope._handle.setStyle({'z-index': 1})
|
|
|
+ let actived = false;
|
|
|
+ (Ext.Viewport.getItems().items as []).forEach((item, idx) => {
|
|
|
+ if (!actived && item === scope._handle) {
|
|
|
+ actived = true
|
|
|
+ Ext.Viewport.getLayout().setAnimation({type: 'slide', direction: 'right', duration: 300})
|
|
|
+ Ext.Viewport.setActiveItem(idx)
|
|
|
+ scope._lastShowTime = new Date().getTime()
|
|
|
+ // console.log("###### show", idx, Scope.SHOW_PAGE_STACK)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
// 关闭
|
|
|
- that._handle.setStyle({'z-index': 0})
|
|
|
- Ext.Viewport.getLayout().setAnimation({type: 'slide', direction: 'right', duration: 300})
|
|
|
- Ext.Viewport.remove(that._handle)
|
|
|
- that.close()
|
|
|
+ handle.setStyle({'z-index': 0})
|
|
|
+ // Ext.Viewport.getLayout().setAnimation({type: 'slide', direction: 'right', duration: 300})
|
|
|
+ Ext.Viewport.remove(handle)
|
|
|
+ handle.close()
|
|
|
})
|
|
|
}
|
|
|
},
|
|
@@ -230,6 +233,9 @@ export class Scope {
|
|
|
}
|
|
|
}
|
|
|
Ext.Viewport.add(that._handle)
|
|
|
+ if ((window as any).mainWindow === that) {
|
|
|
+ Scope.SHOW_PAGE_STACK.length = 0
|
|
|
+ }
|
|
|
that._handle.setStyle({'z-index': 1})
|
|
|
let actived = false;
|
|
|
(Ext.Viewport.getItems().items as []).forEach((item, idx) => {
|