mirror of
https://gitee.com/dromara/go-view.git
synced 2025-02-23 15:52:49 +08:00
commit
617b940d64
@ -13,6 +13,16 @@ export const WritingModeObject = {
|
|||||||
[WritingModeEnum.VERTICAL]: 'vertical-rl'
|
[WritingModeEnum.VERTICAL]: 'vertical-rl'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export enum FontWeightEnum {
|
||||||
|
NORMAL = '常规',
|
||||||
|
BOLD = '加粗',
|
||||||
|
}
|
||||||
|
|
||||||
|
export const FontWeightObject = {
|
||||||
|
[FontWeightEnum.NORMAL]: 'normal',
|
||||||
|
[FontWeightEnum.BOLD]: 'bold',
|
||||||
|
}
|
||||||
|
|
||||||
export const option = {
|
export const option = {
|
||||||
link: '',
|
link: '',
|
||||||
linkHead: 'http://',
|
linkHead: 'http://',
|
||||||
@ -22,6 +32,7 @@ export const option = {
|
|||||||
paddingX: 10,
|
paddingX: 10,
|
||||||
paddingY: 10,
|
paddingY: 10,
|
||||||
textAlign: 'center', // 水平对齐方式
|
textAlign: 'center', // 水平对齐方式
|
||||||
|
fontWeight: 'normal',
|
||||||
|
|
||||||
// 边框
|
// 边框
|
||||||
borderWidth: 0,
|
borderWidth: 0,
|
||||||
|
@ -29,7 +29,13 @@
|
|||||||
<setting-item name="字体大小">
|
<setting-item name="字体大小">
|
||||||
<n-input-number v-model:value="optionData.fontSize" size="small" placeholder="字体大小"></n-input-number>
|
<n-input-number v-model:value="optionData.fontSize" size="small" placeholder="字体大小"></n-input-number>
|
||||||
</setting-item>
|
</setting-item>
|
||||||
|
<setting-item name="字体粗细">
|
||||||
|
<n-select
|
||||||
|
v-model:value="optionData.fontWeight"
|
||||||
|
size="small"
|
||||||
|
:options="fontWeightOptions"
|
||||||
|
/>
|
||||||
|
</setting-item>
|
||||||
<setting-item name="X轴内边距">
|
<setting-item name="X轴内边距">
|
||||||
<n-input-number v-model:value="optionData.paddingX" size="small" placeholder="输入内边距"></n-input-number>
|
<n-input-number v-model:value="optionData.paddingX" size="small" placeholder="输入内边距"></n-input-number>
|
||||||
</setting-item>
|
</setting-item>
|
||||||
@ -81,7 +87,9 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { PropType } from 'vue'
|
import { PropType } from 'vue'
|
||||||
import { option, WritingModeEnum, WritingModeObject } from './config'
|
import { option, WritingModeEnum, WritingModeObject,
|
||||||
|
FontWeightEnum,
|
||||||
|
FontWeightObject, } from './config'
|
||||||
import { CollapseItem, SettingItemBox, SettingItem } from '@/components/Pages/ChartItemSetting'
|
import { CollapseItem, SettingItemBox, SettingItem } from '@/components/Pages/ChartItemSetting'
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
optionData: {
|
optionData: {
|
||||||
@ -106,6 +114,16 @@ const verticalOptions = [
|
|||||||
value: WritingModeObject[WritingModeEnum.VERTICAL]
|
value: WritingModeObject[WritingModeEnum.VERTICAL]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
const fontWeightOptions = [
|
||||||
|
{
|
||||||
|
label: FontWeightEnum.NORMAL,
|
||||||
|
value: FontWeightObject[FontWeightEnum.NORMAL],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: FontWeightEnum.BOLD,
|
||||||
|
value: FontWeightObject[FontWeightEnum.BOLD],
|
||||||
|
},
|
||||||
|
];
|
||||||
const handleLinkClick = () => {
|
const handleLinkClick = () => {
|
||||||
window.open(props.optionData.linkHead + props.optionData.link)
|
window.open(props.optionData.linkHead + props.optionData.link)
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,8 @@ const {
|
|||||||
borderColor,
|
borderColor,
|
||||||
borderRadius,
|
borderRadius,
|
||||||
writingMode,
|
writingMode,
|
||||||
backgroundColor
|
backgroundColor,
|
||||||
|
fontWeight
|
||||||
} = toRefs(props.chartConfig.option)
|
} = toRefs(props.chartConfig.option)
|
||||||
|
|
||||||
const option = shallowReactive({
|
const option = shallowReactive({
|
||||||
@ -76,7 +77,7 @@ const click = () => {
|
|||||||
font-size: v-bind('fontSize + "px"');
|
font-size: v-bind('fontSize + "px"');
|
||||||
letter-spacing: v-bind('letterSpacing + "px"');
|
letter-spacing: v-bind('letterSpacing + "px"');
|
||||||
writing-mode: v-bind('writingMode');
|
writing-mode: v-bind('writingMode');
|
||||||
|
font-weight: v-bind('fontWeight');
|
||||||
border-style: solid;
|
border-style: solid;
|
||||||
border-width: v-bind('borderWidth + "px"');
|
border-width: v-bind('borderWidth + "px"');
|
||||||
border-radius: v-bind('borderRadius + "px"');
|
border-radius: v-bind('borderRadius + "px"');
|
||||||
|
Loading…
Reference in New Issue
Block a user