<template>
	<v-app :class="`${isDarkMode ? 'dark-mode' : 'light-mode'}`">
		<nuxt />
	</v-app>
</template>

<script>
import { mapState, mapActions, mapMutations } from 'vuex'; // , mapActions
export default {
	name: 'pop',
	computed: {
		...mapState({
			isDarkMode: 'isDarkMode',
		}),
	},
	data() {
		return {
			fullscreen: false,
			activeTree: [],
			clipped: false,
			fixed: false,
			miniVariant: false,
			// activeTabIdx: "",
			routerTabInstance: null,
			// programIdObj: null,
			myPrgmId: null,
			treeValue: [],
			menuIconById: {
				// MNU0003: 'mdi-chart-line',
				// MNU0004: 'mdi-alarm-light',
				// MNU0005: 'mdi-pencil-box-outline',
				// MNU0006: 'mdi-cog-outline',
				MNU0002: 'mdi-monitor',
				MNU0091: 'mdi-chart-box',
				MNU0102: 'mdi-human-male-board-poll',
				MNU0103: 'mdi-file-chart-outline',
				MNU0104: 'mdi-chart-sankey-variant',
				MNU0106: 'mdi-database-edit-outline',
				MNU0105: 'mdi-chart-bell-curve',
				MNU0006: 'mdi-bulletin-board',
				MNU0007: 'mdi-cog',
			},
			isLoading: false,
			bookmarkBtn: 0,
			myMenuList: [],
			prgmIdList: [],
			initPageData: {},
			obj: {},
			newObj: {},
		};
	},
	computed: {
		...mapState({
			myHome: 'myHome',
			indexRoot: 'indexRoot',
			treevieItems: 'treevieItems',
			menuData: 'menuData',
			menuLink: state => state.modules.menu,
			activeMenuId: state => state.activeMenuInfo.menuId,
			isDarkMode: 'isDarkMode',
			drawer: state => state.drawer,
			userInfo: state => state.userInfo,
			pageData: 'pageData',
		}),
	},
	async mounted() {
		await this.initPageDataFunc();
	},
	methods: {
		...mapMutations({
			setDrawer: 'setDrawer', // 사이드메뉴 접고 펼치기
			setPageDataInit: 'setPageDataInit',
		}),
		...mapActions({
			getMenu: 'modules/menu/getMenu', // 트리메뉴 가져오기
			chkOpenTabList: 'chkOpenTabList', // 트리메뉴 클릭 시 해당 pprgmId push
			postUpdateApi: 'modules/list/postUpdateApi',
			postApiReturn: 'modules/list/postApiReturn',
		}),
		initPageDataFunc() {
			this.newObj = {};
			this.newObj = {
				[this.$route.query.prgmId]: {},
			};

			this.setPageDataInit(this.newObj);
		},
	},
};
</script>
