[2차][BO] 일계부 등록 현황 SelectBox 선택시 Tab 활성화 오류 수정, 새로고침 검색월 유지 추가
This commit is contained in:
@@ -228,16 +228,23 @@
|
||||
|
||||
<script>
|
||||
const tabStorageName = 'tabActive';
|
||||
const monthStorageName = 'recordMonth';
|
||||
let tabActive = 'tab1';
|
||||
let tabMonth = document.reqForm.recordMonth.value;
|
||||
window.onpageshow = function (event) {
|
||||
if (event.persisted || (window.performance && window.performance.navigation.type == 1)) {
|
||||
if (('sessionStorage' in window) && window['sessionStorage'] !== null) {
|
||||
if (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)) {
|
||||
sessionStorage.removeItem(tabStorageName);
|
||||
sessionStorage.removeItem(monthStorageName);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -262,7 +269,7 @@
|
||||
const selectedTab = document.querySelector('.tab-label[aria-selected="true"]');
|
||||
if (!selectedTab) return;
|
||||
|
||||
getTabData(selectedTab.dataset.tabType);
|
||||
getTabData(selectedTab.dataset.tabType, selectedTab.dataset.tabValue);
|
||||
}
|
||||
|
||||
const getTabData = (tabType, tabValue) => {
|
||||
@@ -282,6 +289,7 @@
|
||||
}
|
||||
|
||||
sessionStorage.setItem(tabStorageName, tabValue);
|
||||
sessionStorage.setItem(monthStorageName, document.reqForm.recordMonth.value);
|
||||
|
||||
document.querySelector('.component-tab').ui.setValue(tabValue);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user