fix: 新增图表列表数据

This commit is contained in:
MTrun
2022-01-13 16:20:25 +08:00
parent 24c649d19f
commit f243dbdd55
10 changed files with 120 additions and 43 deletions
@@ -1,7 +1,7 @@
<template>
<router-view #default="{ Component, route }">
<!-- todo 动画暂时不生效待处理 -->
<transition name="v-modal" mode="out-in" appear>
<transition name="fade" mode="out-in" appear>
<component
v-if="route.noKeepAlive"
:is="Component"
+3
View File
@@ -7,6 +7,9 @@ import { setupNaive, setupDirectives, setupCustomComponents } from '@/plugins'
import { AppProvider } from '@/components/AppProvider/index'
import { setHtmlTheme } from '@/utils'
// 引入动画
import 'animate.css/animate.min.css'
async function appInit() {
const appProvider = createApp(AppProvider)
+1 -1
View File
@@ -2,7 +2,7 @@ import type { App } from 'vue'
import { Skeleton } from '@/components/Skeleton'
/**
* 全局注册自定义组件 待完善
* 全局注册自定义组件
* @param app
*/
export function setupCustomComponents(app: App) {
+13
View File
@@ -30,17 +30,30 @@
opacity: 0;
}
100% {
opacity: 1;
}
}
@keyframes v-modal-out {
0% {
opacity: 1;
}
100% {
opacity: 0;
}
}
// 渐变
.fade-enter,
.fade-leave-to {
opacity: 0;
}
.fade-enter-active,
.fade-leave-active {
transition: opacity .2s ease;
}
// 移动动画
.list-complete-item {
transition: all 1s;
@@ -22,10 +22,8 @@
</n-space>
</div>
<aside class="content">
<n-scrollbar x-scrollable>
<n-scrollbar>
<slot></slot>
</n-scrollbar>
<n-scrollbar>
<slot></slot>
</n-scrollbar>
</aside>
<div v-if="showBottom" class="bottom go-mt-0">
@@ -1,9 +1,54 @@
<template>
<div>
我是图表咯
<div class="go-chart-common">
<n-menu
class="common-menu-width"
v-model:value="selectValue"
:options="menuOptions"
:icon-size="16"
:indent="18"
/>
<div>
右侧的小组将列表
</div>
</div>
</template>
<script setup lang="Ts"></script>
<script setup lang="ts">
import { reactive, ref } from 'vue'
import { renderLang } from '@/utils'
<style lang="scss" scoped></style>
const menuOptions = reactive([
{
key: 'ChartCommon',
label: renderLang('图表')
},
{
key: 'TextCommon',
label: renderLang('信息')
},
{
key: 'TableCommon',
label: renderLang('表格')
},
{
key: 'DecorateCommon',
label: renderLang('装饰')
}
])
const selectValue = ref<string>(menuOptions[0]['key'])
</script>
<style lang="scss" scoped>
/* 列表的宽度 */
$topHeight: 36px;
@include go('chart-common') {
display: flex;
height: calc(100vh - #{$--header-height} - #{$topHeight});
.common-menu-width {
@include filter-bg-color('background-color2');
}
}
</style>
@@ -23,9 +23,11 @@
@update:value="clickItemHandle"
/>
<div class="menu-component-box">
<keep-alive>
<component :is="selectNode"></component>
</keep-alive>
<transition name="component-fade" mode="out-in">
<keep-alive>
<component :is="selectNode"></component>
</keep-alive>
</transition>
</div>
</div>
</aside>
@@ -33,7 +35,7 @@
</template>
<script setup lang="ts">
import { reactive, ref, toRefs, computed } from 'vue'
import { reactive, ref, toRefs } from 'vue'
import { icon } from '@/plugins'
import { renderLang, renderIcon } from '@/utils'
import { ContentBox } from '../ContentBox/index'
@@ -47,7 +49,12 @@ import { DecorateCommon } from './components/DecorateCommon'
// 图标
const { BarChartIcon } = icon.ionicons5
const { TableSplitIcon, RoadmapIcon, SpellCheckIcon, GraphicalDataFlowIcon } = icon.carbon
const {
TableSplitIcon,
RoadmapIcon,
SpellCheckIcon,
GraphicalDataFlowIcon
} = icon.carbon
// 全局颜色
const designStore = useDesignStore()
@@ -104,7 +111,6 @@ const clickItemHandle = <T extends { node: any }>(key: string, item: T) => {
}
beforeSelect = key
}
</script>
<style lang="scss" scoped>
@@ -126,40 +132,42 @@ $topHeight: 36px;
display: flex;
height: calc(100vh - #{$--header-height} - #{$topHeight});
.menu-width {
@include filter-bg-color('background-color2');
flex-shrink: 0;
@include filter-bg-color('background-color3');
}
.menu-component-box {
flex-shrink: 0;
width: $width - $widthScoped;
overflow: hidden;
}
}
@include deep() {
.n-menu-item {
/* position: relative; */
height: auto !important;
&.n-menu-item--selected {
&::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;
.menu-width {
.n-menu-item {
height: auto !important;
&.n-menu-item--selected {
&::after {
content: '';
position: absolute;
left: 2px;
top: 0;
height: 100%;
width: 3px;
background-color: v-bind('themeColor');
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;
}
}
.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;
}
}
}
+2 -1
View File
@@ -37,7 +37,8 @@ import { ContentDetails } from './components/ContentDetails/index'
<style lang="scss" scoped>
$height: 100vh;
@include go('bg-point') {
@include background-image('background-point');
@extend .go-point-bg;
}
@include go('chart') {
height: $height;