feat: 서버 탭 전환 시 뷰 모드 유지 및 대시보드/맵 에디터 스타일 표준화
- 서버 탭 복귀 시 최근 선택한 뷰 모드(목록/위치) 상태 유지 및 currentViewMode 상태 일원화 - 개인PC 대시보드 및 맵 에디터의 인라인 CSS 스타일을 공통 CSS 및 변수 클래스로 분리 및 가독성 개선 - Vite 멀티페이지 빌드 설정(vite.config.ts) 추가
This commit is contained in:
@@ -177,11 +177,7 @@ export function createListView(container: HTMLElement, config: ListViewConfig) {
|
||||
}
|
||||
let currentFilters: any = (state as any).listFilters[filterKey];
|
||||
|
||||
// 서버 탭이 아닐 경우 '자산 현황' 뷰 진입 방지 및 강제 'asset' 모드 (PC 탭은 자산 현황 숨김)
|
||||
const isServer = config.title === '서버';
|
||||
if (!isServer) {
|
||||
(state as any).currentViewMode = 'asset';
|
||||
}
|
||||
|
||||
// 1. 컨텐츠 영역 생성 (먼저 생성하여 참조 가능하게 함)
|
||||
const contentWrapper = document.createElement('div');
|
||||
@@ -817,7 +813,8 @@ export function createListView(container: HTMLElement, config: ListViewConfig) {
|
||||
|
||||
const switchView = () => {
|
||||
contentWrapper.innerHTML = '';
|
||||
if ((state as any).currentViewMode === 'asset') {
|
||||
const isAssetMode = !isServer || state.viewMode === 'list';
|
||||
if (isAssetMode) {
|
||||
filterBar.style.display = 'flex'; contentWrapper.style.overflowY = 'hidden';
|
||||
contentWrapper.appendChild(tableWrapper); updateTable();
|
||||
} else {
|
||||
@@ -834,7 +831,7 @@ export function createListView(container: HTMLElement, config: ListViewConfig) {
|
||||
extraHTML: isServer ? `
|
||||
<div class="search-item">
|
||||
<label class="list-view-toggle-label">
|
||||
<input type="checkbox" id="chk-list-view" ${(state as any).currentViewMode === 'asset' ? 'checked' : ''} />
|
||||
<input type="checkbox" id="chk-list-view" ${state.viewMode === 'list' ? 'checked' : ''} />
|
||||
목록보기
|
||||
</label>
|
||||
</div>
|
||||
@@ -878,13 +875,11 @@ export function createListView(container: HTMLElement, config: ListViewConfig) {
|
||||
const chkBox = filterBar.querySelector('#chk-list-view') as HTMLInputElement;
|
||||
|
||||
const handleToggle = () => {
|
||||
const isListMode = (state as any).currentViewMode === 'asset';
|
||||
const isListMode = chkBox.checked;
|
||||
if (isListMode) {
|
||||
state.viewMode = 'location';
|
||||
(state as any).currentViewMode = 'location';
|
||||
} else {
|
||||
state.viewMode = 'list';
|
||||
(state as any).currentViewMode = 'asset';
|
||||
} else {
|
||||
state.viewMode = 'location';
|
||||
}
|
||||
window.dispatchEvent(new Event('refresh-view'));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user