|
|
@@ -81,15 +81,15 @@ export default {
|
|
|
},
|
|
|
*changeTab(action, { select, call, put }) {
|
|
|
const home = yield select(state => state.present.home);
|
|
|
- const { tabs } = home;
|
|
|
+ const { tabs, selectedTab } = home;
|
|
|
const { tab } = action;
|
|
|
let fields = [];
|
|
|
|
|
|
- yield put({ type: 'setSelectedTab', tab });
|
|
|
let fTab = tabs.find(t => t.code === tab.code);
|
|
|
- if(!fTab) {
|
|
|
+ if(!fTab || (!!selectedTab && fTab.code === selectedTab.code && !!fTab.config)) {
|
|
|
return false;
|
|
|
}else {
|
|
|
+ yield put({ type: 'setSelectedTab', tab });
|
|
|
let data = { ...fTab.config };
|
|
|
for(let key in data) {
|
|
|
fields.push({
|
|
|
@@ -111,8 +111,9 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
*closeTabs(action, { select, call, put }) {
|
|
|
- const { tabs } = action;
|
|
|
+ const { tabs, tab } = action;
|
|
|
|
|
|
+ yield put({ type: 'changeTab', tab });
|
|
|
yield put({ type: 'removeTabs', tabs });
|
|
|
},
|
|
|
*closeAllTabs(action, { select, call, put }) {
|