mirror of
https://gitee.com/dromara/go-view.git
synced 2024-12-02 11:48:36 +08:00
feat: 新增顶部功能
This commit is contained in:
parent
1031d3e248
commit
f00935d795
@ -1,12 +1,15 @@
|
|||||||
<template>
|
<template>
|
||||||
<n-layout-header bordered class="go-header">
|
<n-layout-header bordered class="go-header">
|
||||||
<header class="go-header-box">
|
<header class="go-header-box">
|
||||||
<div class="li">
|
<div>
|
||||||
<n-space>
|
<n-space>
|
||||||
<slot name="left"></slot>
|
<slot name="left"></slot>
|
||||||
</n-space>
|
</n-space>
|
||||||
</div>
|
</div>
|
||||||
<div class="ri">
|
<div>
|
||||||
|
<slot name="center"></slot>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
<n-space>
|
<n-space>
|
||||||
<slot name="ri-left"> </slot>
|
<slot name="ri-left"> </slot>
|
||||||
<LangSelect />
|
<LangSelect />
|
||||||
|
@ -3,6 +3,9 @@
|
|||||||
<template #left>
|
<template #left>
|
||||||
<slot name="left"></slot>
|
<slot name="left"></slot>
|
||||||
</template>
|
</template>
|
||||||
|
<template #center>
|
||||||
|
<slot name="center"></slot>
|
||||||
|
</template>
|
||||||
<template #ri-left>
|
<template #ri-left>
|
||||||
<slot name="ri-left"></slot>
|
<slot name="ri-left"></slot>
|
||||||
</template>
|
</template>
|
||||||
|
@ -31,7 +31,9 @@ import {
|
|||||||
DuplicateOutline as DuplicateOutlineIcon,
|
DuplicateOutline as DuplicateOutlineIcon,
|
||||||
Fish as FishIcon,
|
Fish as FishIcon,
|
||||||
BarChart as BarChartIcon,
|
BarChart as BarChartIcon,
|
||||||
Albums as AlbumsIcon
|
Layers as LayersIcon,
|
||||||
|
Prism as PrismIcon,
|
||||||
|
CubeOutline as CubeIcon
|
||||||
} from '@vicons/ionicons5'
|
} from '@vicons/ionicons5'
|
||||||
|
|
||||||
// ionicons5 在这里
|
// ionicons5 在这里
|
||||||
@ -101,7 +103,10 @@ const ionicons5 = {
|
|||||||
// 图表
|
// 图表
|
||||||
BarChartIcon,
|
BarChartIcon,
|
||||||
// 图层
|
// 图层
|
||||||
AlbumsIcon
|
LayersIcon,
|
||||||
|
// 组件详情设置(三棱镜)
|
||||||
|
PrismIcon,
|
||||||
|
CubeIcon
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://www.xicons.org/#/ 还有很多
|
// https://www.xicons.org/#/ 还有很多
|
||||||
|
20
src/store/modules/chartLayoutStore/chartLayoutStore.d.ts
vendored
Normal file
20
src/store/modules/chartLayoutStore/chartLayoutStore.d.ts
vendored
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
import { ThemeEnum } from '@/enums/styleEnum'
|
||||||
|
|
||||||
|
export interface ChartLayoutType {
|
||||||
|
// 图层控制
|
||||||
|
layers: true,
|
||||||
|
// 图表组件
|
||||||
|
charts: true,
|
||||||
|
// 详情设置
|
||||||
|
details: true,
|
||||||
|
// 对齐线
|
||||||
|
alignLine: true,
|
||||||
|
// 滤镜
|
||||||
|
filter: {
|
||||||
|
// 色相
|
||||||
|
// 饱和度
|
||||||
|
// 亮度
|
||||||
|
// 对比度
|
||||||
|
// 不透明度
|
||||||
|
}
|
||||||
|
}
|
@ -5,13 +5,14 @@
|
|||||||
<template #left>
|
<template #left>
|
||||||
<HeaderLeftBtn />
|
<HeaderLeftBtn />
|
||||||
</template>
|
</template>
|
||||||
|
<template #center>
|
||||||
|
<HeaderTitle />
|
||||||
|
</template>
|
||||||
<template #ri-left>
|
<template #ri-left>
|
||||||
<HeaderRightBtn />
|
<HeaderRightBtn />
|
||||||
</template>
|
</template>
|
||||||
</HeaderPro>
|
</HeaderPro>
|
||||||
<n-layout-content>
|
<n-layout-content> </n-layout-content>
|
||||||
|
|
||||||
</n-layout-content>
|
|
||||||
</n-layout>
|
</n-layout>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -20,6 +21,7 @@
|
|||||||
import { HeaderPro } from '@/layout/components/HeaderPro'
|
import { HeaderPro } from '@/layout/components/HeaderPro'
|
||||||
import { HeaderLeftBtn } from './layout/components/HeaderLeftBtn/index'
|
import { HeaderLeftBtn } from './layout/components/HeaderLeftBtn/index'
|
||||||
import { HeaderRightBtn } from './layout/components/HeaderRightBtn/index'
|
import { HeaderRightBtn } from './layout/components/HeaderRightBtn/index'
|
||||||
|
import { HeaderTitle } from './layout/components/HeaderTitle/index'
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<n-space>
|
<n-space class="header-left-btn">
|
||||||
<n-tooltip
|
<n-tooltip
|
||||||
v-for="item in btnList"
|
v-for="item in btnList"
|
||||||
:key="item.title"
|
:key="item.title"
|
||||||
@ -7,7 +7,7 @@
|
|||||||
trigger="hover"
|
trigger="hover"
|
||||||
>
|
>
|
||||||
<template #trigger>
|
<template #trigger>
|
||||||
<n-button type="info" size="small" ghost>
|
<n-button type="info" size="small" ghost @click="item.fn">
|
||||||
<component :is="item.icon"></component>
|
<component :is="item.icon"></component>
|
||||||
</n-button>
|
</n-button>
|
||||||
</template>
|
</template>
|
||||||
@ -20,20 +20,45 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { reactive } from 'vue'
|
import { reactive } from 'vue'
|
||||||
import { icon } from '@/plugins'
|
|
||||||
const { AlbumsIcon, BarChartIcon } = icon.ionicons5
|
|
||||||
import { renderIcon } from '@/utils'
|
import { renderIcon } from '@/utils'
|
||||||
|
import { icon } from '@/plugins'
|
||||||
|
const { LayersIcon, BarChartIcon, PrismIcon } = icon.ionicons5
|
||||||
|
|
||||||
|
const layers = () => {
|
||||||
|
console.log('选择了图层控制')
|
||||||
|
}
|
||||||
|
|
||||||
|
const charts = () => {
|
||||||
|
console.log('选择了图表组件')
|
||||||
|
}
|
||||||
|
|
||||||
|
const details = () => {
|
||||||
|
console.log('选择了详情')
|
||||||
|
}
|
||||||
|
|
||||||
const btnList = reactive([
|
const btnList = reactive([
|
||||||
{
|
{
|
||||||
|
fn: layers,
|
||||||
select: true,
|
select: true,
|
||||||
title: '图层控制',
|
title: '图层控制',
|
||||||
icon: renderIcon(AlbumsIcon)
|
icon: renderIcon(LayersIcon)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
fn: charts,
|
||||||
select: true,
|
select: true,
|
||||||
title: '图表组件',
|
title: '图表组件',
|
||||||
icon: renderIcon(BarChartIcon)
|
icon: renderIcon(BarChartIcon)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fn: details,
|
||||||
|
select: true,
|
||||||
|
title: '详情设置',
|
||||||
|
icon: renderIcon(PrismIcon)
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
</script>
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.header-left-btn {
|
||||||
|
padding-right: 212px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
3
src/views/chart/layout/components/HeaderTitle/index.ts
Normal file
3
src/views/chart/layout/components/HeaderTitle/index.ts
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
import HeaderTitle from './index.vue'
|
||||||
|
|
||||||
|
export { HeaderTitle }
|
52
src/views/chart/layout/components/HeaderTitle/index.vue
Normal file
52
src/views/chart/layout/components/HeaderTitle/index.vue
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
<template>
|
||||||
|
<n-space>
|
||||||
|
<n-icon size="20" :depth="3">
|
||||||
|
<FishIcon />
|
||||||
|
</n-icon>
|
||||||
|
<n-text @click="handleFocus">
|
||||||
|
工作空间 -
|
||||||
|
<n-button v-show="!focus" secondary round size="tiny">
|
||||||
|
{{ comTitle }}
|
||||||
|
</n-button>
|
||||||
|
</n-text>
|
||||||
|
|
||||||
|
<n-input
|
||||||
|
v-show="focus"
|
||||||
|
ref="inputInstRef"
|
||||||
|
size="small"
|
||||||
|
type="text"
|
||||||
|
maxlength="16"
|
||||||
|
show-count
|
||||||
|
round
|
||||||
|
placeholder="请输入项目名称"
|
||||||
|
v-model:value.trim="title"
|
||||||
|
@blur="handleBlur"
|
||||||
|
/>
|
||||||
|
</n-space>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, nextTick, computed } from 'vue'
|
||||||
|
import { icon } from '@/plugins'
|
||||||
|
const { FishIcon } = icon.ionicons5
|
||||||
|
|
||||||
|
const focus = ref<boolean>(false)
|
||||||
|
const title = ref<string>('')
|
||||||
|
const inputInstRef = ref(null)
|
||||||
|
|
||||||
|
const comTitle = computed(() => {
|
||||||
|
title.value = title.value.replace(/\s/g,"");
|
||||||
|
return title.value.length ? title.value : '新项目'
|
||||||
|
})
|
||||||
|
|
||||||
|
const handleFocus = () => {
|
||||||
|
focus.value = true
|
||||||
|
nextTick(() => {
|
||||||
|
;(<any>inputInstRef).value.focus()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleBlur = () => {
|
||||||
|
focus.value = false
|
||||||
|
}
|
||||||
|
</script>
|
@ -36,7 +36,7 @@
|
|||||||
<template #action>
|
<template #action>
|
||||||
<n-space class="list-footer" justify="space-between">
|
<n-space class="list-footer" justify="space-between">
|
||||||
<n-text depth="3">
|
<n-text depth="3">
|
||||||
{{$t('project.last_edit')}}:
|
{{$t('project.last_edit')}}:
|
||||||
<n-time :time="new Date()" format="yyyy-MM-dd hh:mm" />
|
<n-time :time="new Date()" format="yyyy-MM-dd hh:mm" />
|
||||||
</n-text>
|
</n-text>
|
||||||
<!-- 工具 -->
|
<!-- 工具 -->
|
||||||
|
Loading…
Reference in New Issue
Block a user