Merge branch 'household_tab' into dev
This commit is contained in:
@@ -234,16 +234,23 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
const tabStorageName = 'tabActive';
|
const tabStorageName = 'tabActive';
|
||||||
|
const monthStorageName = 'recordMonth';
|
||||||
let tabActive = 'tab1';
|
let tabActive = 'tab1';
|
||||||
|
let tabMonth = document.reqForm.recordMonth.value;
|
||||||
window.onpageshow = function (event) {
|
window.onpageshow = function (event) {
|
||||||
if (event.persisted || (window.performance && window.performance.navigation.type == 1)) {
|
if (event.persisted || (window.performance && window.performance.navigation.type == 1)) {
|
||||||
if (('sessionStorage' in window) && window['sessionStorage'] !== null) {
|
if (('sessionStorage' in window) && window['sessionStorage'] !== null) {
|
||||||
if (sessionStorage.getItem(tabStorageName)) {
|
if (sessionStorage.getItem(tabStorageName)) {
|
||||||
tabActive = sessionStorage.getItem(tabStorageName);
|
tabActive = sessionStorage.getItem(tabStorageName);
|
||||||
}
|
}
|
||||||
|
if (sessionStorage.getItem(monthStorageName)) {
|
||||||
|
tabMonth = sessionStorage.getItem(monthStorageName);
|
||||||
|
document.reqForm.recordMonth.value = tabMonth;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (event.persisted || (window.performance && window.performance.navigation.type == 2)) {
|
} else if (event.persisted || (window.performance && window.performance.navigation.type == 2)) {
|
||||||
sessionStorage.removeItem(tabStorageName);
|
sessionStorage.removeItem(tabStorageName);
|
||||||
|
sessionStorage.removeItem(monthStorageName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -268,7 +275,7 @@
|
|||||||
const selectedTab = document.querySelector('.tab-label[aria-selected="true"]');
|
const selectedTab = document.querySelector('.tab-label[aria-selected="true"]');
|
||||||
if (!selectedTab) return;
|
if (!selectedTab) return;
|
||||||
|
|
||||||
getTabData(selectedTab.dataset.tabType);
|
getTabData(selectedTab.dataset.tabType, selectedTab.dataset.tabValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
const getTabData = (tabType, tabValue) => {
|
const getTabData = (tabType, tabValue) => {
|
||||||
@@ -288,6 +295,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
sessionStorage.setItem(tabStorageName, tabValue);
|
sessionStorage.setItem(tabStorageName, tabValue);
|
||||||
|
sessionStorage.setItem(monthStorageName, document.reqForm.recordMonth.value);
|
||||||
|
|
||||||
document.querySelector('.component-tab').ui.setValue(tabValue);
|
document.querySelector('.component-tab').ui.setValue(tabValue);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user