import { defineStore } from 'pinia'

/**
 * 布局配置
 * 修改配置时：
 * 1、需要每次都清理 `window.localStorage` 浏览器永久缓存
 * 2、或者点击布局配置最底部 `一键恢复默认` 按钮即可看到效果
 */
export const useThemeConfig = defineStore('themeConfig', {
  state: (): ThemeConfigState => ({
    themeConfig: {
      "isDrawer": false,
      "isCreateWebHistory": true,
      "primary": "#41b584",
      "isDark": false,
      "topBar": "#FFFFFF",
      "topBarColor": "#606266",
      "isTopBarColorGradual": false,
      "menuBar": "#FFFFFF",
      "menuBarColor": "#606266",
      "menuBarActiveColor": "#ecf7f2",
      "isMenuBarColorGradual": false,
      "columnsMenuBar": "#333333",
      "columnsMenuBarColor": "#eaeaea",
      "columnsMenuBarActiveColor": "#ffffff",
      "isColumnsMenuBarColorGradual": false,
      "isColumnsMenuHoverPreload": true,
      "isCollapse": false,
      "isUniqueOpened": false,
      "isFixedHeader": true,
      "isFixedHeaderChange": false,
      "isClassicSplitMenu": false,
      "isLockScreen": false,
      "lockScreenTime": 30,
      "isShowLogo": true,
      "isShowLogoChange": false,
      "isBreadcrumb": true,
      "isTagsview": false,
      "isBreadcrumbIcon": false,
      "isTagsviewIcon": false,
      "isCacheTagsView": true,
      "isSortableTagsView": true,
      "isShareTagsView": false,
      "isFooter": false,
      "isGrayscale": false,
      "isInvert": false,
      "isWatermark": false,
      "watermarkText": "NPP",
      "tagsStyle": "tags-style-five",
      "animation": "opacitys",
      "columnsAsideStyle": "columns-round",
      "columnsAsideLayout": "columns-horizontal",
      "layout": "classic",
      "isRequestRoutes": true,
      "globalTitle": "NPP",
      "globalViceTitle": "Smart Pilot",
      "globalViceTitleMsg": "NPP Smart Pilot",
      "globalI18n": "zh-cn",
      "globalComponentSize": "default"
    },
  }),
  actions: {
    setThemeConfig(data: ThemeConfigState) {
      this.themeConfig = data.themeConfig
    },
  },
})
