From daf46ebe83e714b13c1fcc050793013f05001827 Mon Sep 17 00:00:00 2001 From: chuan_wuhao <443547225@qq.com> Date: Thu, 24 Nov 2022 16:33:20 +0800 Subject: [PATCH] 16:32 --- src/.DS_Store | Bin 8196 -> 0 bytes src/components/.DS_Store | Bin 8196 -> 0 bytes src/icons/error.svg | 4 - src/layout/components/Menu/index.tsx | 50 ----- src/layout/components/MenuTag/index.scss | 14 -- src/layout/components/MenuTag/index.tsx | 61 ------ .../SiderBar/Components/SettingDrawer/hook.ts | 7 - .../Components/SettingDrawer/index.scss | 8 - .../Components/SettingDrawer/index.tsx | 143 -------------- src/layout/components/SiderBar/hook.ts | 14 -- src/layout/components/SiderBar/index.scss | 16 -- src/layout/components/SiderBar/index.tsx | 175 ------------------ src/layout/components/SiderBar/type.ts | 5 - src/layout/index.scss | 13 -- src/layout/index.tsx | 64 ------- src/router/modules/error.ts | 9 - src/router/modules/index.ts | 13 -- src/store/index.ts | 14 -- src/store/modules/menu.ts | 150 --------------- src/store/modules/setting.ts | 57 ------ src/styles/setting.scss | 3 - src/views/login/index.tsx | 63 ------- 22 files changed, 883 deletions(-) delete mode 100644 src/.DS_Store delete mode 100644 src/components/.DS_Store delete mode 100644 src/icons/error.svg delete mode 100644 src/layout/components/Menu/index.tsx delete mode 100644 src/layout/components/MenuTag/index.scss delete mode 100644 src/layout/components/MenuTag/index.tsx delete mode 100644 src/layout/components/SiderBar/Components/SettingDrawer/hook.ts delete mode 100644 src/layout/components/SiderBar/Components/SettingDrawer/index.scss delete mode 100644 src/layout/components/SiderBar/Components/SettingDrawer/index.tsx delete mode 100644 src/layout/components/SiderBar/hook.ts delete mode 100644 src/layout/components/SiderBar/index.scss delete mode 100644 src/layout/components/SiderBar/index.tsx delete mode 100644 src/layout/components/SiderBar/type.ts delete mode 100644 src/layout/index.scss delete mode 100644 src/layout/index.tsx delete mode 100644 src/router/modules/error.ts delete mode 100644 src/router/modules/index.ts delete mode 100644 src/store/index.ts delete mode 100644 src/store/modules/menu.ts delete mode 100644 src/store/modules/setting.ts delete mode 100644 src/styles/setting.scss delete mode 100644 src/views/login/index.tsx diff --git a/src/.DS_Store b/src/.DS_Store deleted file mode 100644 index 79b6d1d91c5e4be75b01c489f0446e45c14f090d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8196 zcmeHMJ#Q015S_(2%L)xb0)+zQenKpziP9X_(FUYQ)FF;#BH2F6u?gw!4}eh`I$9_Z zB@HPkDe@0MqM$+)(DL#2!*{cLd!#|g61&muSUYcap5Cr+GixFeo!LQ~XpM+kc%;2@ z8J(v|zkDj~k{Q{66^JLA($S#b-tA_?aRnU)f&xK-pg>R{C=e7_1_f|t%hswn_q8|l zL4lyaf2n|cKg4*XO^nU8Rj&?ossw;t!LVxhj5 zKbCOV#MoS09Zo`rlQ5ZusZfNHZ+w$9StdfBgQ%vv;?un1c&3;|KhnAjT9FfyW~{q|CiVXh;^!%Q@V5UU0AwB?CXg zlYf=E$UUSn`VrI^RrT2V0481>=k)pYlZ7rd*pl5vSes{#^ibkZF&()&?d;fI&guO0 z&go0NRxEy)l}!8yJO7!?-=YClYD9gS!S<O>7>kbJx##e3{J``^K7s zYf^`?dF)9Z5x&z?Fqyb3bam7Aat_<;g%&KHGw>tq{PMK|9c2C!tV++_sm<@MpL00d zEI3$ma29nKn@1vfM2f|@%HrmA+sirpd{e9ii{}jd2ycGuM|@`ot_th2@`~hc)n1nE0nAv7KPEg2594SE_iorI>7FrO?;g(B3a zgJ-F561GMj*#UMS?trY_x5%MBD)&~Tes`%uJ#wjwYQ9T@cB@!zxSgIpL}o87uj4vS zz3tW!pKrZAypNv7`{}vOxw*ZIaK7rUut^oDyrn}tp>Xk>q6R#Ma+ij5NlobNM^!G} zAk!4Au*UnbuQ3%fP&gYiLEo~`cSH?&-lAG^chK@JBAoa6^W)dKiA4oDPL4{*XWise zMLyEyHeMCDJVb~0(fn3ck>357KNbmtmuv&#Ns8txq>p#vfH+Eo=9LVZq3$p${nEd>I zktA`h>;OA3qXQ!6RGkt?YE@4l%T?Y&KSh^K#(5eQ1w-VA0N(q57-HK(sN~oNJ&l+_ P;|BrC1|HafUv=OURe=7+ diff --git a/src/icons/error.svg b/src/icons/error.svg deleted file mode 100644 index ad9fb923..00000000 --- a/src/icons/error.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/layout/components/Menu/index.tsx b/src/layout/components/Menu/index.tsx deleted file mode 100644 index fba5acdc..00000000 --- a/src/layout/components/Menu/index.tsx +++ /dev/null @@ -1,50 +0,0 @@ -import { NMenu, NLayoutSider } from 'naive-ui' -import { useMenu } from '@/store' - -const LayoutMenu = defineComponent({ - name: 'LayoutMenu', - setup() { - const menuStore = useMenu() - const { menuModelValueChange, setupAppRoutes, collapsedMenu } = menuStore - const modelMenuKey = computed({ - get: () => menuStore.menuKey, - // eslint-disable-next-line @typescript-eslint/no-empty-function - set: () => {}, - }) - const modelMenuOptions = computed(() => menuStore.options) - const modelCollapsed = computed(() => menuStore.collapsed) - - setupAppRoutes() - - return { - modelMenuKey, - menuModelValueChange, - modelMenuOptions, - modelCollapsed, - collapsedMenu, - } - }, - render() { - return ( - - - - ) - }, -}) - -export default LayoutMenu diff --git a/src/layout/components/MenuTag/index.scss b/src/layout/components/MenuTag/index.scss deleted file mode 100644 index bc091e87..00000000 --- a/src/layout/components/MenuTag/index.scss +++ /dev/null @@ -1,14 +0,0 @@ -$space: calc($layoutRouterViewContainer / 2); - -.menu-tag { - height: $layoutMenuHeight; - - & .menu-tag-sapce { - width: calc(100% - $space * 2); - padding: $space; - } - - & .n-tag { - cursor: pointer; - } -} diff --git a/src/layout/components/MenuTag/index.tsx b/src/layout/components/MenuTag/index.tsx deleted file mode 100644 index 344a5cbc..00000000 --- a/src/layout/components/MenuTag/index.tsx +++ /dev/null @@ -1,61 +0,0 @@ -import './index.scss' -import { NScrollbar, NTag, NSpace } from 'naive-ui' -import { useMenu } from '@/store' - -import type { MenuOption } from 'naive-ui' - -const MenuTag = defineComponent({ - name: 'MenuTag', - setup() { - const menuStore = useMenu() - const { menuTagOptions, menuKey } = storeToRefs(menuStore) - const { menuModelValueChange, spliceMenTagOptions } = menuStore - - const handleCloseTag = (idx: number) => { - spliceMenTagOptions(idx) - - if (menuKey.value !== '/dashboard') { - const options = menuTagOptions.value as MenuOption[] - const length = options.length - - const tag = options[length - 1] - - menuModelValueChange(tag.key as string, tag) - } - } - - const handleTagClick = (item: MenuOption) => { - menuModelValueChange(item.key as string, item) - } - - return { - menuTagOptions, - menuModelValueChange, - handleCloseTag, - menuKey, - handleTagClick, - } - }, - render() { - return ( - - - {this.menuTagOptions.map((curr: MenuOption, idx) => ( - 1 - } - onClose={() => this.handleCloseTag(idx)} - type={curr.key === this.menuKey ? 'success' : 'default'} - onClick={this.handleTagClick.bind(this, curr)} - > - {typeof curr.label === 'function' ? curr.label() : curr.label} - - ))} - - - ) - }, -}) - -export default MenuTag diff --git a/src/layout/components/SiderBar/Components/SettingDrawer/hook.ts b/src/layout/components/SiderBar/Components/SettingDrawer/hook.ts deleted file mode 100644 index 3d285190..00000000 --- a/src/layout/components/SiderBar/Components/SettingDrawer/hook.ts +++ /dev/null @@ -1,7 +0,0 @@ -export const useSwatchesColorOptions = () => [ - '#FFFFFF', - '#18A058', - '#2080F0', - '#F0A020', - 'rgba(208, 48, 80, 1)', -] diff --git a/src/layout/components/SiderBar/Components/SettingDrawer/index.scss b/src/layout/components/SiderBar/Components/SettingDrawer/index.scss deleted file mode 100644 index 760db0c1..00000000 --- a/src/layout/components/SiderBar/Components/SettingDrawer/index.scss +++ /dev/null @@ -1,8 +0,0 @@ -.setting-drawer__space { - width: 100%; - - & .n-descriptions-table-content { - display: flex !important; - justify-content: space-between; - } -} diff --git a/src/layout/components/SiderBar/Components/SettingDrawer/index.tsx b/src/layout/components/SiderBar/Components/SettingDrawer/index.tsx deleted file mode 100644 index 6ef7e098..00000000 --- a/src/layout/components/SiderBar/Components/SettingDrawer/index.tsx +++ /dev/null @@ -1,143 +0,0 @@ -import './index.scss' -import { - NDrawer, - NDrawerContent, - NDivider, - NSpace, - NSwitch, - NColorPicker, - NTooltip, - NDescriptions, - NDescriptionsItem, -} from 'naive-ui' -import RayIcon from '@/components/RayIcon/index' -import { useSwatchesColorOptions } from './hook' -import { useSetting } from '@/store' - -import type { PropType } from 'vue' - -const SettingDrawer = defineComponent({ - name: 'SettingDrawer', - props: { - show: { - type: Boolean, - default: false, - }, - placement: { - type: String as PropType, - default: 'right', - }, - width: { - type: Number, - default: 280, - }, - }, - emits: ['update:show'], - setup(props, { emit }) { - const { t } = useI18n() - const settingStore = useSetting() - - const { changeTheme, changePrimaryColor, changeMenuTagLog } = settingStore - const { themeValue, primaryColorOverride, menuTagLog } = - storeToRefs(settingStore) - - const modelShow = computed({ - get: () => props.show, - set: (bool) => { - emit('update:show', bool) - }, - }) - - const handleRailStyle = () => ({ - backgroundColor: '#000000', - }) - - return { - modelShow, - ray: t, - handleRailStyle, - changePrimaryColor, - changeTheme, - themeValue, - primaryColorOverride, - changeMenuTagLog, - menuTagLog, - } - }, - render() { - return ( - - - - - {this.ray('LayoutHeaderSettingOptions.ThemeOptions.Title')} - - - - {{ - trigger: () => ( - - {{ - 'checked-icon': () => - h( - RayIcon, - { - name: 'dark', - }, - {}, - ), - 'unchecked-icon': () => - h( - RayIcon, - { - name: 'light', - }, - {}, - ), - }} - - ), - default: () => - this.themeValue - ? this.ray('LayoutHeaderSettingOptions.ThemeOptions.Dark') - : this.ray( - 'LayoutHeaderSettingOptions.ThemeOptions.Light', - ), - }} - - - - {this.ray( - 'LayoutHeaderSettingOptions.ThemeOptions.PrimaryColorConfig', - )} - - - 界面显示 - - - - - - - - - ) - }, -}) - -export default SettingDrawer diff --git a/src/layout/components/SiderBar/hook.ts b/src/layout/components/SiderBar/hook.ts deleted file mode 100644 index 013ff83f..00000000 --- a/src/layout/components/SiderBar/hook.ts +++ /dev/null @@ -1,14 +0,0 @@ -export const useAvatarOptions = () => [ - { - key: 'person', - label: '个人信息', - }, - { - type: 'divider', - key: 'd1', - }, - { - key: 'logout', - label: '退出登陆', - }, -] diff --git a/src/layout/components/SiderBar/index.scss b/src/layout/components/SiderBar/index.scss deleted file mode 100644 index 83c39953..00000000 --- a/src/layout/components/SiderBar/index.scss +++ /dev/null @@ -1,16 +0,0 @@ -.layout-header { - height: $layoutHeaderHeight; - padding: 0 $layoutRouterViewContainer; - display: flex; - align-items: center; - - > .layout-header__method { - width: 100%; - - & .layout-header__method--icon { - cursor: pointer; - outline: none; - border: none; - } - } -} diff --git a/src/layout/components/SiderBar/index.tsx b/src/layout/components/SiderBar/index.tsx deleted file mode 100644 index 93e0a016..00000000 --- a/src/layout/components/SiderBar/index.tsx +++ /dev/null @@ -1,175 +0,0 @@ -import './index.scss' -import { NLayoutHeader, NSpace, NTooltip, NDropdown } from 'naive-ui' -import RayIcon from '@/components/RayIcon/index' -import { useSetting } from '@/store' -import { useLanguageOptions } from '@/language/index' -import SettingDrawer from './Components/SettingDrawer/index' -import { useAvatarOptions } from './hook' -import { removeCache } from '@/utils/cache' - -import type { IconEventMapOptions, IconEventMap } from './type' - -const SiderBar = defineComponent({ - name: 'SiderBar', - setup() { - const settingStore = useSetting() - - const { t } = useI18n() - const { updateLocale, changeReloadLog } = settingStore - const modelDrawerPlacement = ref(settingStore.drawerPlacement) - const showSettings = ref(false) - - const leftIconOptions = [ - { - name: 'reload', - size: 18, - tooltip: 'LayoutHeaderTooltipOptions.Reload', - }, - ] - const rightIconOptions = [ - { - name: 'language', - size: 18, - tooltip: '', - dropdown: { - methodName: 'handleSelect', // 默认为 `handleSelect` - switch: true, - options: useLanguageOptions(), - handleSelect: (key: string | number) => updateLocale(String(key)), - }, - }, - { - name: 'github', - size: 18, - tooltip: 'LayoutHeaderTooltipOptions.Github', - }, - { - name: 'setting', - size: 18, - tooltip: 'LayoutHeaderTooltipOptions.Setting', - }, - { - name: 'ray', - size: 22, - tooltip: '', - dropdown: { - methodName: 'handleSelect', // 默认为 `handleSelect` - switch: true, - options: useAvatarOptions(), - handleSelect: (key: string | number) => { - if (key === 'logout') { - window.$dialog.warning({ - title: '提示', - content: '您确定要退出登录吗', - positiveText: '确定', - negativeText: '不确定', - onPositiveClick: () => { - window.$message.info('账号退出中...') - - removeCache('all-sessionStorage') - - setTimeout(() => window.location.reload(), 2 * 1000) - }, - }) - } else { - window.$message.info('这个人很懒, 没做这个功能~') - } - }, - }, - }, - ] - const iconEventMap: IconEventMapOptions = { - reload: () => { - changeReloadLog(false) - - setTimeout(() => changeReloadLog(true)) - }, - setting: () => { - showSettings.value = true - }, - github: () => { - window.open('https://github.com/XiaoDaiGua-Ray/ray-template') - }, - } - - const handleIconClick = (key: IconEventMap) => { - iconEventMap[key]?.() - } - - return { - leftIconOptions, - rightIconOptions, - t, - handleIconClick, - modelDrawerPlacement, - showSettings, - } - }, - render() { - return ( - - - - {this.leftIconOptions.map((curr) => ( - - {{ - trigger: () => ( - - ), - default: () => this.t(curr.tooltip), - }} - - ))} - - - {this.rightIconOptions.map((curr) => - curr.dropdown?.switch ? ( - - - - ) : ( - - {{ - trigger: () => ( - - ), - default: () => this.t(curr.tooltip), - }} - - ), - )} - - - - - ) - }, -}) - -export default SiderBar diff --git a/src/layout/components/SiderBar/type.ts b/src/layout/components/SiderBar/type.ts deleted file mode 100644 index daf5ba5b..00000000 --- a/src/layout/components/SiderBar/type.ts +++ /dev/null @@ -1,5 +0,0 @@ -export interface IconEventMapOptions { - [propName: string]: (...args: unknown[]) => unknown -} - -export type IconEventMap = keyof IconEventMapOptions diff --git a/src/layout/index.scss b/src/layout/index.scss deleted file mode 100644 index ab45f31c..00000000 --- a/src/layout/index.scss +++ /dev/null @@ -1,13 +0,0 @@ -.layout { - box-sizing: border-box; - - > .layout-full { - height: 100%; - } - - & .layout-content__router-view { - // height: calc(100% - $layoutHeaderHeight - $layoutMenuHeight); - height: var(--layout-content-height); - padding: calc($layoutRouterViewContainer / 2); - } -} diff --git a/src/layout/index.tsx b/src/layout/index.tsx deleted file mode 100644 index 8160bed6..00000000 --- a/src/layout/index.tsx +++ /dev/null @@ -1,64 +0,0 @@ -import './index.scss' -import { NLayout, NLayoutContent } from 'naive-ui' -import RayTransitionComponent from '@/components/RayTransitionComponent/index.vue' -import LayoutMenu from './components/Menu/index' -import SiderBar from './components/SiderBar/index' -import MenuTag from './components/MenuTag/index' -import { useSetting } from '@/store' - -const Layout = defineComponent({ - name: 'Layout', - props: {}, - setup() { - const menuStore = useSetting() - const { height: windowHeight } = useWindowSize() - const modelReloadRoute = computed(() => menuStore.reloadRouteLog) - const modelMenuTagLog = computed(() => menuStore.menuTagLog) - const cssVarsRef = computed(() => { - let cssVar = {} - - if (menuStore.menuTagLog) { - cssVar = { - '--layout-content-height': 'calc(100% - 110px)', - } - } else { - cssVar = { - '--layout-content-height': 'calc(100% - 64px)', - } - } - - return cssVar - }) - - return { - windowHeight, - modelReloadRoute, - modelMenuTagLog, - cssVarsRef, - } - }, - render() { - return ( -
- - - - - {this.modelMenuTagLog ? : ''} - - {this.modelReloadRoute ? : ''} - - - -
- ) - }, -}) - -export default Layout diff --git a/src/router/modules/error.ts b/src/router/modules/error.ts deleted file mode 100644 index 6d683a67..00000000 --- a/src/router/modules/error.ts +++ /dev/null @@ -1,9 +0,0 @@ -export default { - path: '/error', - name: 'error', - component: () => import('@/views/error/index'), - meta: { - i18nKey: 'Error', - icon: 'error', - }, -} diff --git a/src/router/modules/index.ts b/src/router/modules/index.ts deleted file mode 100644 index 389eb8a9..00000000 --- a/src/router/modules/index.ts +++ /dev/null @@ -1,13 +0,0 @@ -import dashboard from './dashboard' -import reyl from './rely' -import error from './error' - -const routes = [dashboard, error, reyl] - -export default routes - -/** - * - * 弃用自动导入路由模块方式 - * 采用手动引入子路由模块方式 - */ diff --git a/src/store/index.ts b/src/store/index.ts deleted file mode 100644 index 64e51525..00000000 --- a/src/store/index.ts +++ /dev/null @@ -1,14 +0,0 @@ -import piniaPluginPersistedstate from 'pinia-plugin-persistedstate' - -import type { App } from 'vue' - -export { useSetting } from './modules/setting' // import { useSetting } from '@/store' 即可使用 -export { useMenu } from './modules/menu' - -const store = createPinia() - -export const setupStore = (app: App) => { - app.use(store) - - store.use(piniaPluginPersistedstate) -} diff --git a/src/store/modules/menu.ts b/src/store/modules/menu.ts deleted file mode 100644 index 5560d93e..00000000 --- a/src/store/modules/menu.ts +++ /dev/null @@ -1,150 +0,0 @@ -import { getCache, setCache } from '@/utils/cache' -import { NEllipsis } from 'naive-ui' -import RayIcon from '@/components/RayIcon/index' - -import type { MenuOption } from 'naive-ui' -import type { RouteRecordRaw } from 'vue-router' - -export const useMenu = defineStore('menu', () => { - const router = useRouter() - const route = useRoute() - const { t } = useI18n() - - const cacheMenuKey = - getCache('menuKey') === 'no' ? '/dashboard' : getCache('menuKey') - - const menuState = reactive({ - menuKey: cacheMenuKey as string | null, // 当前菜单 `key` - options: [] as RouteRecordRaw[], // 菜单列表 - collapsed: false, // 是否折叠菜单 - menuTagOptions: [] as RouteRecordRaw[], - }) - - const handleMenuTagOptions = (item: RouteRecordRaw) => { - if (item.path !== menuState.menuKey) { - const tag = menuState.menuTagOptions.find( - (curr) => curr.path === item.path, - ) - - if (!tag) { - menuState.menuTagOptions.push(item) - } - } - } - - /** - * - * @param key 菜单更新后的 `key` - * @param item 菜单当前 `item` - * - * 修改 `menu key` 后的回调函数 - */ - const menuModelValueChange = (key: string, item: MenuOption) => { - handleMenuTagOptions(item as unknown as RouteRecordRaw) - - menuState.menuKey = key - - router.push(`${item.path}`) - setCache('menuKey', key) - } - - /** - * - * @param path 路由地址 - * - * 监听路由地址变化更新菜单状态 - */ - const updateMenuKeyWhenRouteUpdate = (path: string) => { - const matchMenuItem = (options: MenuOption[]) => { - for (const i of options) { - if (i?.children?.length) { - matchMenuItem(i.children) - } - - if (path === i.path) { - menuModelValueChange(i.path, i) - - break - } - } - } - - matchMenuItem(menuState.options) - } - - /** - * - * 获取菜单列表 - * 缓存菜单 - */ - const setupAppRoutes = () => { - const layout = router.getRoutes().find((route) => route.name === 'layout') - - const resolveRoutes = (routes: RouteRecordRaw[], index: number) => { - return routes.map((curr) => { - if (curr.children?.length) { - curr.children = resolveRoutes( - curr.children as RouteRecordRaw[], - index++, - ) - } - - const route = { - ...curr, - key: curr.path, - label: () => - h(NEllipsis, null, { - default: () => t(`GlobalMenuOptions.${curr!.meta!.i18nKey}`), - }), - } - const expandIcon = { - icon: () => - h( - RayIcon, - { - name: curr?.meta?.icon as string, - size: 20, - }, - {}, - ), - } - - const attr = curr.meta?.icon ? Object.assign(route, expandIcon) : route - - // 初始化 `menu tag` - if (curr.path === cacheMenuKey) { - menuState.menuTagOptions.push(attr) - } - - return attr - }) - } - - menuState.options = resolveRoutes(layout?.children as RouteRecordRaw[], 0) - } - - /** - * - * @param collapsed 折叠菜单开关 - */ - const collapsedMenu = (collapsed: boolean) => - (menuState.collapsed = collapsed) - - const spliceMenTagOptions = (idx: number) => - menuState.menuTagOptions.splice(idx, 1) - - watch( - () => route.fullPath, - (newData) => { - updateMenuKeyWhenRouteUpdate(newData) - }, - ) - - return { - ...toRefs(menuState), - menuModelValueChange, - setupAppRoutes, - collapsedMenu, - spliceMenTagOptions, - } -}) diff --git a/src/store/modules/setting.ts b/src/store/modules/setting.ts deleted file mode 100644 index 1e9baac7..00000000 --- a/src/store/modules/setting.ts +++ /dev/null @@ -1,57 +0,0 @@ -export const useSetting = defineStore( - 'setting', - () => { - const settingState = reactive({ - drawerPlacement: 'right' as NaiveDrawerPlacement, - primaryColorOverride: { - common: { - primaryColor: '#18A058', // 主题色 - }, - }, - themeValue: false, // `true` 为黑夜主题, `false` 为白色主题 - reloadRouteLog: true, // 刷新路由开关 - menuTagLog: true, // 多标签页开关 - }) - const { locale } = useI18n() - - const updateLocale = (key: string) => { - // TODO: 修改语言 - locale.value = key - } - - const changeTheme = (bool: boolean) => { - settingState.themeValue = bool - } - - const changePrimaryColor = (value: string) => { - settingState.primaryColorOverride.common.primaryColor = value - } - - /** - * - * @param bool 刷新页面开关 - */ - const changeReloadLog = (bool: boolean) => - (settingState.reloadRouteLog = bool) - - /** - * - * @param bool 刷新页面开关 - */ - const changeMenuTagLog = (bool: boolean) => (settingState.menuTagLog = bool) - - return { - ...toRefs(settingState), - updateLocale, - changeTheme, - changePrimaryColor, - changeReloadLog, - changeMenuTagLog, - } - }, - { - persist: { - key: 'piniaSettingStore', - }, - }, -) diff --git a/src/styles/setting.scss b/src/styles/setting.scss deleted file mode 100644 index e6146e3d..00000000 --- a/src/styles/setting.scss +++ /dev/null @@ -1,3 +0,0 @@ -$layoutRouterViewContainer: 18px; -$layoutHeaderHeight: 64px; -$layoutMenuHeight: 46px; diff --git a/src/views/login/index.tsx b/src/views/login/index.tsx deleted file mode 100644 index 9e112fb3..00000000 --- a/src/views/login/index.tsx +++ /dev/null @@ -1,63 +0,0 @@ -import './index.scss' -import { - NSpace, - NCard, - NTabs, - NTabPane, - NGradientText, - NDropdown, -} from 'naive-ui' -import Signin from './components/Signin/index' -import Register from './components/Register/index' -import { useSetting } from '@/store' -import RayIcon from '@/components/RayIcon' -import { useLanguageOptions } from '@/language/index' - -const Login = defineComponent({ - name: 'Login', - setup() { - const state = reactive({ - tabsValue: 'signin', - }) - const { t } = useI18n() - const { height: windowHeight } = useWindowSize() - const settingStore = useSetting() - const { updateLocale } = settingStore - - return { - ...toRefs(state), - windowHeight, - updateLocale, - ray: t, - } - }, - render() { - return ( -
- - - this.updateLocale(key)} - > - - - - - - - - - - - - - -
- ) - }, -}) - -export default Login