-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(projects): new layout,tab and add update theme settings
- Loading branch information
1 parent
488e6e3
commit 912c353
Showing
30 changed files
with
386 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
src/layouts/common/setting-drawer/components/layout-mode/components/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import LayoutCheckbox from './layout-checkbox.vue'; | ||
import LayoutCard from './layout-card.vue'; | ||
|
||
export { LayoutCheckbox }; | ||
export { LayoutCheckbox, LayoutCard }; |
81 changes: 81 additions & 0 deletions
81
src/layouts/common/setting-drawer/components/layout-mode/components/layout-card.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<template> | ||
<div | ||
class="border-2px rounded-6px cursor-pointer hover:border-primary" | ||
:class="[checked ? 'border-primary' : 'border-transparent']" | ||
> | ||
<n-tooltip :placement="activeConfig.placement" trigger="hover"> | ||
<template #trigger> | ||
<div | ||
class="layout-card__shadow gap-6px w-96px h-64px p-6px rd-4px" | ||
:class="[mode.includes('vertical') ? 'flex' : 'flex-col']" | ||
> | ||
<slot></slot> | ||
</div> | ||
</template> | ||
<span>{{ label }}</span> | ||
</n-tooltip> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { computed } from 'vue'; | ||
import type { PopoverPlacement } from 'naive-ui'; | ||
defineOptions({ name: 'LayoutCard' }); | ||
interface Props { | ||
/** 布局模式 */ | ||
mode: UnionKey.ThemeLayoutMode; | ||
/** 布局模式文本 */ | ||
label: string; | ||
/** 选中状态 */ | ||
checked: boolean; | ||
} | ||
const props = defineProps<Props>(); | ||
type LayoutConfig = Record< | ||
UnionKey.ThemeLayoutMode, | ||
{ | ||
placement: PopoverPlacement; | ||
headerClass: string; | ||
menuClass: string; | ||
mainClass: string; | ||
} | ||
>; | ||
const layoutConfig: LayoutConfig = { | ||
vertical: { | ||
placement: 'bottom-start', | ||
headerClass: '', | ||
menuClass: 'w-1/3 h-full', | ||
mainClass: 'w-2/3 h-3/4' | ||
}, | ||
'vertical-mix': { | ||
placement: 'bottom', | ||
headerClass: '', | ||
menuClass: 'w-1/4 h-full', | ||
mainClass: 'w-2/3 h-3/4' | ||
}, | ||
horizontal: { | ||
placement: 'bottom', | ||
headerClass: '', | ||
menuClass: 'w-full h-1/4', | ||
mainClass: 'w-full h-3/4' | ||
}, | ||
'horizontal-mix': { | ||
placement: 'bottom-end', | ||
headerClass: '', | ||
menuClass: 'w-full h-1/4', | ||
mainClass: 'w-2/3 h-3/4' | ||
} | ||
}; | ||
const activeConfig = computed(() => layoutConfig[props.mode]); | ||
</script> | ||
|
||
<style scoped> | ||
.layout-card__shadow { | ||
box-shadow: 0 1px 2.5px rgba(0, 0, 0, 0.18); | ||
} | ||
</style> |
Oops, something went wrong.