fix: 修改左侧的渲染样式

This commit is contained in:
MTrun 2022-01-12 10:41:26 +08:00
parent 5030cfe099
commit 3a87f0dd30
6 changed files with 76 additions and 17 deletions

View File

@ -22,11 +22,11 @@ export const getThemeOverridesHook = () => {
} }
const dartObject = { const dartObject = {
common: { common: {
primaryColor: designStore.appTheme, primaryColor: designStore.getAppTheme,
...commonObj.common ...commonObj.common
}, },
LoadingBar: { LoadingBar: {
colorLoading: designStore.appTheme colorLoading: designStore.getAppTheme
} }
} }
return designStore.getDarkTheme ? dartObject : lightObject return designStore.getDarkTheme ? dartObject : lightObject

View File

@ -44,7 +44,8 @@ import {
import { import {
TableSplit as TableSplitIcon, TableSplit as TableSplitIcon,
Roadmap as RoadmapIcon, Roadmap as RoadmapIcon,
SpellCheck as SpellCheckIcon SpellCheck as SpellCheckIcon,
GraphicalDataFlow as GraphicalDataFlowIcon
} from '@vicons/carbon' } from '@vicons/carbon'
const ionicons5 = { const ionicons5 = {
@ -131,12 +132,14 @@ const ionicons5 = {
} }
const carbon = { const carbon = {
// 信息
SpellCheckIcon,
// 图表 // 图表
RoadmapIcon, RoadmapIcon,
// 信息
SpellCheckIcon,
// 表格 // 表格
TableSplitIcon TableSplitIcon,
// 装饰
GraphicalDataFlowIcon
} }
// https://www.xicons.org/#/ 还有很多 // https://www.xicons.org/#/ 还有很多

View File

@ -0,0 +1,3 @@
import DecorateCommon from './index.vue'
export { DecorateCommon }

View File

@ -0,0 +1,9 @@
<template>
<div>
我是装饰咯
</div>
</template>
<script setup lang="Ts"></script>
<style lang="scss" scoped></style>

View File

@ -2,13 +2,13 @@
<ContentBox <ContentBox
class="go-content-charts" class="go-content-charts"
:class="{ scoped: !getCharts }" :class="{ scoped: !getCharts }"
title="全部组件" title="组件"
:depth="1" :depth="1"
:backIcon="false" :backIcon="false"
> >
<template #icon> <template #icon>
<n-icon size="14" :depth="2"> <n-icon size="14" :depth="2">
<!-- <BarChartIcon /> --> <BarChartIcon />
</n-icon> </n-icon>
</template> </template>
<!-- 图表 --> <!-- 图表 -->
@ -38,19 +38,27 @@ import { icon } from '@/plugins'
import { renderLang, renderIcon } from '@/utils' import { renderLang, renderIcon } from '@/utils'
import { ContentBox } from '../ContentBox/index' import { ContentBox } from '../ContentBox/index'
import { useChartLayoutStore } from '@/store/modules/chartLayoutStore/chartLayoutStore' import { useChartLayoutStore } from '@/store/modules/chartLayoutStore/chartLayoutStore'
import { useDesignStore } from '@/store/modules/designStore/designStore'
import { ChartCommon } from './components/ChartCommon' import { ChartCommon } from './components/ChartCommon'
import { TableCommon } from './components/TableCommon' import { TableCommon } from './components/TableCommon'
import { TextCommon } from './components/TextCommon' import { TextCommon } from './components/TextCommon'
import { DecorateCommon } from './components/DecorateCommon'
//
const { BarChartIcon } = icon.ionicons5 const { BarChartIcon } = icon.ionicons5
const { TableSplitIcon, RoadmapIcon, SpellCheckIcon } = icon.carbon const { TableSplitIcon, RoadmapIcon, SpellCheckIcon, GraphicalDataFlowIcon } = icon.carbon
//
const designStore = useDesignStore()
const themeColor = ref(designStore.getAppTheme)
//
const { setItem } = useChartLayoutStore() const { setItem } = useChartLayoutStore()
const { getCharts } = toRefs(useChartLayoutStore()) const { getCharts } = toRefs(useChartLayoutStore())
//
const collapsed = ref(false) const collapsed = ref(false)
const menuOptions = reactive([ const menuOptions = reactive([
{ {
key: 'ChartCommon', key: 'ChartCommon',
@ -69,13 +77,19 @@ const menuOptions = reactive([
icon: renderIcon(TableSplitIcon), icon: renderIcon(TableSplitIcon),
label: renderLang('表格'), label: renderLang('表格'),
node: TextCommon node: TextCommon
},
{
key: 'DecorateCommon',
icon: renderIcon(GraphicalDataFlowIcon),
label: renderLang('装饰'),
node: DecorateCommon
} }
]) ])
// //
let beforeSelect: string = menuOptions[0]['key'] let beforeSelect: string = menuOptions[0]['key']
const selectValue = ref<string>(menuOptions[0]['key']) const selectValue = ref<string>(menuOptions[0]['key'])
//
const selectNode = ref(menuOptions[0]['node']) const selectNode = ref(menuOptions[0]['node'])
// item // item
@ -90,13 +104,17 @@ const clickItemHandle = <T extends { node: any }>(key: string, item: T) => {
} }
beforeSelect = key beforeSelect = key
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
/* 整体宽度 */
$width: 300px; $width: 300px;
$widthScoped: 80px; /* 列表的宽度 */
$widthScoped: 65px;
/* 此高度与 ContentBox 组件关联*/ /* 此高度与 ContentBox 组件关联*/
$topHeight: 36px; $topHeight: 36px;
@include go(content-charts) { @include go(content-charts) {
width: $width; width: $width;
@extend .go-transition; @extend .go-transition;
@ -116,11 +134,33 @@ $topHeight: 36px;
} }
} }
@include deep() { @include deep() {
.n-menu-item-content { .n-menu-item {
padding: 0 12px !important; /* position: relative; */
} height: auto !important;
.n-menu-item-content__icon { &.n-menu-item--selected {
margin-right: 0 !important; &::after {
content: '';
position: absolute;
left: 2px;
top: 0;
height: 100%;
width: 3px;
background-color: v-bind('themeColor');
/* background-color: rgb(62, 202, 172); */
border-top-right-radius: 3px;
border-bottom-right-radius: 3px;
}
}
.n-menu-item-content {
display: flex;
flex-direction: column;
padding: 6px 12px !important;
font-size: 12px !important;
}
.n-menu-item-content__icon {
font-size: 18px !important;
margin-right: 0 !important;
}
} }
} }
} }

View File

@ -1,4 +1,5 @@
<template> <template>
<div class="go-bg-point"></div>
<div class="go-chart"> <div class="go-chart">
<n-layout> <n-layout>
<HeaderPro> <HeaderPro>
@ -35,6 +36,9 @@ import { ContentDetails } from './components/ContentDetails/index'
<style lang="scss" scoped> <style lang="scss" scoped>
$height: 100vh; $height: 100vh;
@include go('bg-point') {
}
@include go('chart') { @include go('chart') {
height: $height; height: $height;
overflow: hidden; overflow: hidden;