fix: 新增 chart 顶部按钮

This commit is contained in:
MTrun 2022-01-05 18:04:41 +08:00
parent d9641d6690
commit 2194ca5cd6
10 changed files with 111 additions and 14 deletions

View File

@ -1,9 +1,14 @@
<template>
<Header>
<template #left>
<slot name="left"></slot>
</template>
<template #ri-left>
<slot name="ri-left"></slot>
</template>
<template #ri-right>
<UserInfo />
<slot name="ri-right"></slot>
</template>
</Header>
</template>

View File

@ -7,7 +7,7 @@ import {
Trash as TrashIcon,
Pencil as PencilIcon,
HammerOutline as HammerIcon,
ApertureSharp as ApertureSharpIcon,
DesktopOutline as DesktopOutlineIcon,
DownloadOutline as DownloadIcon,
Open as OpenIcon,
Send as SendIcon,
@ -29,7 +29,9 @@ import {
CodeSlash as CodeSlashIcon,
Duplicate as DuplicateIcon,
DuplicateOutline as DuplicateOutlineIcon,
Fish as FishIcon
Fish as FishIcon,
BarChart as BarChartIcon,
Albums as AlbumsIcon
} from '@vicons/ionicons5'
// ionicons5 在这里
@ -73,7 +75,7 @@ const ionicons5 = {
// 编辑2锤子
HammerIcon,
// 预览
ApertureSharpIcon,
DesktopOutlineIcon,
// 下载
DownloadIcon,
// 导出
@ -95,7 +97,11 @@ const ionicons5 = {
// 语言
LanguageIcon,
// 新项目(鱼)
FishIcon
FishIcon,
// 图表
BarChartIcon,
// 图层
AlbumsIcon
}
// https://www.xicons.org/#/ 还有很多

View File

@ -10,7 +10,7 @@
}
@mixin deep() {
::v-deep {
:deep {
@content;
}
}

View File

@ -1,11 +1,16 @@
<template>
<div class="go-chart">
<n-layout>
<HeaderPro />
<HeaderPro>
<template #left>
<HeaderLeftBtn />
</template>
<template #ri-left>
<HeaderRightBtn />
</template>
</HeaderPro>
<n-layout-content>
<TransitionMain>
<router-view />
</TransitionMain>
</n-layout-content>
</n-layout>
</div>
@ -13,8 +18,8 @@
<script setup lang="ts">
import { HeaderPro } from '@/layout/components/HeaderPro'
import { requireFallbackImg } from '@/utils'
import { TransitionMain } from '@/layout/components/TransitionMain/index'
import { HeaderLeftBtn } from './layout/components/HeaderLeftBtn/index'
import { HeaderRightBtn } from './layout/components/HeaderRightBtn/index'
</script>
<style lang="scss" scoped>

View File

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

View File

@ -0,0 +1,39 @@
<template>
<n-space>
<n-tooltip
v-for="item in btnList"
:key="item.title"
placement="bottom"
trigger="hover"
>
<template #trigger>
<n-button type="info" size="small" ghost>
<component :is="item.icon"></component>
</n-button>
</template>
<span>
{{ item.title }}
</span>
</n-tooltip>
</n-space>
</template>
<script setup lang="ts">
import { reactive } from 'vue'
import { icon } from '@/plugins'
const { AlbumsIcon, BarChartIcon } = icon.ionicons5
import { renderIcon } from '@/utils'
const btnList = reactive([
{
select: true,
title: '图层控制',
icon: renderIcon(AlbumsIcon)
},
{
select: true,
title: '图表组件',
icon: renderIcon(BarChartIcon)
}
])
</script>

View File

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

View File

@ -0,0 +1,37 @@
<template>
<n-space class="go-mt-0">
<n-button v-for="item in btnList" :key="item.title" ghost>
<template #icon>
<component :is="item.icon"></component>
</template>
<span>
{{ item.title }}
</span>
</n-button>
</n-space>
</template>
<script setup lang="ts">
import { reactive } from 'vue'
import { renderIcon } from '@/utils'
import { icon } from '@/plugins'
const { DesktopOutlineIcon, SendIcon } = icon.ionicons5
const btnList = reactive([
{
select: true,
title: '预览',
icon: renderIcon(DesktopOutlineIcon)
},
{
select: true,
title: '发布',
icon: renderIcon(SendIcon)
}
])
</script>
<style lang="scss" scoped>
.align-center {
margin-top: -4px;
}
</style>

View File

@ -25,7 +25,6 @@
<script setup lang="ts">
import { Sider } from './layout/components/Sider'
// import { Header } from './layout/components/Header/index'
import { HeaderPro } from '@/layout/components/HeaderPro'
import { TransitionMain } from '@/layout/components/TransitionMain/index'
</script>

View File

@ -95,7 +95,7 @@ const {
CopyIcon,
TrashIcon,
PencilIcon,
ApertureSharpIcon,
DesktopOutlineIcon,
DownloadIcon,
HammerIcon,
SendIcon
@ -126,7 +126,7 @@ const selectOptions = reactive([
{
label: t('global.r_preview'),
key: 'preview',
icon: renderIcon(ApertureSharpIcon)
icon: renderIcon(DesktopOutlineIcon)
},
{
label: t('global.r_copy'),