mirror of
https://github.com/continew-org/continew-admin-ui.git
synced 2026-01-13 10:57:10 +08:00
refactor: 调整 eslint.config.js,优化代码格式
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
<template>
|
||||
<div class="layout-mix">
|
||||
<section v-if="isDesktop" class="layout-mix-left" :class="{ 'app-menu-dark': appStore.menuDark }"
|
||||
:style="appStore.menuDark ? appStore.themeCSSVar : undefined">
|
||||
<section
|
||||
v-if="isDesktop" class="layout-mix-left" :class="{ 'app-menu-dark': appStore.menuDark }"
|
||||
:style="appStore.menuDark ? appStore.themeCSSVar : undefined"
|
||||
>
|
||||
<Logo :collapsed="appStore.menuCollapse"></Logo>
|
||||
<Menu :menus="leftMenus" :menu-style="{ width: '220px', flex: 1 }"></Menu>
|
||||
</section>
|
||||
@@ -9,8 +11,10 @@
|
||||
<section class="layout-mix-right">
|
||||
<header class="header">
|
||||
<MenuFoldBtn></MenuFoldBtn>
|
||||
<a-menu v-if="isDesktop" mode="horizontal" :selected-keys="activeMenu" :auto-open-selected="false"
|
||||
:trigger-props="{ animationName: 'slide-dynamic-origin' }" @menu-item-click="onMenuItemClick">
|
||||
<a-menu
|
||||
v-if="isDesktop" mode="horizontal" :selected-keys="activeMenu" :auto-open-selected="false"
|
||||
:trigger-props="{ animationName: 'slide-dynamic-origin' }" @menu-item-click="onMenuItemClick"
|
||||
>
|
||||
<a-menu-item v-for="item in topMenus" :key="item.path">
|
||||
<template #icon>
|
||||
<GiSvgIcon :name="getMenuIcon(item)" :size="24" />
|
||||
@@ -94,7 +98,7 @@ watch(
|
||||
getLeftMenus(newPath)
|
||||
})
|
||||
},
|
||||
{ immediate: true }
|
||||
{ immediate: true },
|
||||
)
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
<template>
|
||||
<div v-if="isDesktop" class="asider" :class="{ 'app-menu-dark': appStore.menuDark }"
|
||||
:style="appStore.menuDark ? appStore.themeCSSVar : undefined">
|
||||
<a-layout-sider class="menu" collapsible breakpoint="xl" hide-trigger :width="230"
|
||||
:collapsed="appStore.menuCollapse" @collapse="handleCollapse">
|
||||
<div
|
||||
v-if="isDesktop" class="asider" :class="{ 'app-menu-dark': appStore.menuDark }"
|
||||
:style="appStore.menuDark ? appStore.themeCSSVar : undefined"
|
||||
>
|
||||
<a-layout-sider
|
||||
class="menu" collapsible breakpoint="xl" hide-trigger :width="230"
|
||||
:collapsed="appStore.menuCollapse" @collapse="handleCollapse"
|
||||
>
|
||||
<Logo :collapsed="appStore.menuCollapse"></Logo>
|
||||
<a-scrollbar outer-class="menu-scroll-view" style="height: 100%; overflow: auto">
|
||||
<Menu></Menu>
|
||||
|
||||
@@ -30,7 +30,7 @@ const queryParam = reactive({
|
||||
isRead: false,
|
||||
sort: ['createTime,desc'],
|
||||
page: 1,
|
||||
size: 5
|
||||
size: 5,
|
||||
})
|
||||
|
||||
const messageList = ref<MessageResp[]>()
|
||||
|
||||
@@ -6,16 +6,20 @@
|
||||
<a-space>
|
||||
<a-badge>
|
||||
<template #content>
|
||||
<icon-check-circle-fill v-if="appStore.layout === 'left'" style="color: rgb(var(--success-6))"
|
||||
:size="16"></icon-check-circle-fill>
|
||||
<icon-check-circle-fill
|
||||
v-if="appStore.layout === 'left'" style="color: rgb(var(--success-6))"
|
||||
:size="16"
|
||||
></icon-check-circle-fill>
|
||||
</template>
|
||||
<LayoutItem mode="left" @click="appStore.layout = 'left'"></LayoutItem>
|
||||
<p class="layout-text">默认布局</p>
|
||||
</a-badge>
|
||||
<a-badge>
|
||||
<template #content>
|
||||
<icon-check-circle-fill v-if="appStore.layout === 'mix'" :size="16"
|
||||
style="color: rgb(var(--success-6))"></icon-check-circle-fill>
|
||||
<icon-check-circle-fill
|
||||
v-if="appStore.layout === 'mix'" :size="16"
|
||||
style="color: rgb(var(--success-6))"
|
||||
></icon-check-circle-fill>
|
||||
</template>
|
||||
<LayoutItem mode="mix" @click="appStore.layout = 'mix'"></LayoutItem>
|
||||
<p class="layout-text">混合布局</p>
|
||||
@@ -25,8 +29,10 @@
|
||||
|
||||
<a-divider orientation="center">系统主题</a-divider>
|
||||
<a-row justify="center">
|
||||
<ColorPicker theme="dark" :color="appStore.themeColor" :sucker-hide="true" :colors-default="defaultColorList"
|
||||
@change-color="changeColor"></ColorPicker>
|
||||
<ColorPicker
|
||||
theme="dark" :color="appStore.themeColor" :sucker-hide="true" :colors-default="defaultColorList"
|
||||
@change-color="changeColor"
|
||||
></ColorPicker>
|
||||
</a-row>
|
||||
|
||||
<a-divider orientation="center">界面显示</a-divider>
|
||||
@@ -36,16 +42,20 @@
|
||||
<a-switch v-model="appStore.tab" />
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="页签风格">
|
||||
<a-select v-model="appStore.tabMode" placeholder="请选择" :options="tabModeList" :disabled="!appStore.tab"
|
||||
:trigger-props="{ autoFitPopupMinWidth: true }" :style="{ width: '120px' }">
|
||||
<a-select
|
||||
v-model="appStore.tabMode" placeholder="请选择" :options="tabModeList" :disabled="!appStore.tab"
|
||||
:trigger-props="{ autoFitPopupMinWidth: true }" :style="{ width: '120px' }"
|
||||
>
|
||||
</a-select>
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="动画显示">
|
||||
<a-switch v-model="appStore.animate" />
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="动画显示">
|
||||
<a-select v-model="appStore.animateMode" placeholder="请选择" :options="animateModeList"
|
||||
:disabled="!appStore.animate" :style="{ width: '120px' }">
|
||||
<a-select
|
||||
v-model="appStore.animateMode" placeholder="请选择" :options="animateModeList"
|
||||
:disabled="!appStore.animate" :style="{ width: '120px' }"
|
||||
>
|
||||
</a-select>
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="深色菜单">
|
||||
@@ -72,17 +82,16 @@
|
||||
import { ColorPicker } from 'vue-color-kit'
|
||||
import 'vue-color-kit/dist/vue-color-kit.css'
|
||||
import LayoutItem from './components/LayoutItem.vue'
|
||||
import { useAppStore, useUserStore } from '@/stores'
|
||||
import { useAppStore } from '@/stores'
|
||||
|
||||
defineOptions({ name: 'SettingDrawer' })
|
||||
const appStore = useAppStore()
|
||||
const userStore = useUserStore()
|
||||
const visible = ref(false)
|
||||
|
||||
const tabModeList: App.TabItem[] = [
|
||||
{ label: '卡片', value: 'card' },
|
||||
{ label: '间隔卡片', value: 'card-gutter' },
|
||||
{ label: '圆角', value: 'rounded' }
|
||||
{ label: '圆角', value: 'rounded' },
|
||||
]
|
||||
|
||||
const animateModeList: App.AnimateItem[] = [
|
||||
@@ -90,14 +99,13 @@ const animateModeList: App.AnimateItem[] = [
|
||||
{ label: '滑动', value: 'fade-slide' },
|
||||
{ label: '渐变', value: 'fade' },
|
||||
{ label: '底部滑出', value: 'fade-bottom' },
|
||||
{ label: '缩放消退', value: 'fade-scale' }
|
||||
{ label: '缩放消退', value: 'fade-scale' },
|
||||
]
|
||||
|
||||
const open = () => {
|
||||
visible.value = true
|
||||
}
|
||||
|
||||
const waterMarkPlaceholder = ref<string>()
|
||||
defineExpose({ open })
|
||||
|
||||
// 默认显示的主题色列表
|
||||
@@ -117,10 +125,10 @@ const defaultColorList = [
|
||||
'#43a047',
|
||||
'#e53935',
|
||||
'#f4511e',
|
||||
'#6d4c41'
|
||||
'#6d4c41',
|
||||
]
|
||||
|
||||
type ColorObj = {
|
||||
interface ColorObj {
|
||||
hex: string
|
||||
hsv: { h: number, s: number, v: number }
|
||||
rgba: { r: number, g: number, b: number, a: number }
|
||||
|
||||
@@ -140,7 +140,7 @@ const logout = () => {
|
||||
} catch (error) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
import { useAppStore } from '@/stores'
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
collapsed: false
|
||||
collapsed: false,
|
||||
})
|
||||
const appStore = useAppStore()
|
||||
const title = computed(() => appStore.getTitle())
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
<a-menu-item
|
||||
v-if="
|
||||
isOneShowingChild
|
||||
&& (!onlyOneChild?.children || onlyOneChild?.meta?.noShowingChildren)
|
||||
&& !item?.meta?.alwaysShow
|
||||
&& (!onlyOneChild?.children || onlyOneChild?.meta?.noShowingChildren)
|
||||
&& !item?.meta?.alwaysShow
|
||||
"
|
||||
v-bind="attrs"
|
||||
:key="onlyOneChild?.path"
|
||||
|
||||
@@ -73,7 +73,7 @@ watch(
|
||||
() => route.fullPath,
|
||||
() => {
|
||||
handleRouteChange()
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
// 点击页签
|
||||
|
||||
Reference in New Issue
Block a user