config.vue
2.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<template>
<CollapseItem v-for="(item, index) in seriesList" :key="index" :name="t('charts.chart.waterPolo')" :expanded="true">
<SettingItemBox :name="t('common.contentText')">
<SettingItem :name="t('common.numericalText')">
<n-input-number
v-model:value="optionData.dataset"
:min="0"
:step="0.01"
size="small"
:placeholder="t('charts.chart.waterBalvalue')"
></n-input-number>
</SettingItem>
<SettingItem :name="t('common.shapeText')">
<n-select v-model:value="item.shape" :options="shapes" placeholder="选择形状" />
</SettingItem>
<SettingItem :name="t('common.textText')">
<n-input-number
v-model:value="item.label.normal.textStyle.fontSize"
:min="0"
:step="1"
size="small"
placeholder="文字大小"
>
</n-input-number>
</SettingItem>
<SettingItem :name="t('charts.chart.color1')">
<n-color-picker
size="small"
:modes="['hex']"
v-model:value="item.color[0].colorStops[0].color"
></n-color-picker>
</SettingItem>
<SettingItem :name="t('charts.chart.color2')">
<n-color-picker
size="small"
:modes="['hex']"
v-model:value="item.color[0].colorStops[1].color"
></n-color-picker>
</SettingItem>
</SettingItemBox>
<SettingItemBox :name="t('common.backgroundText')" :alone="true">
<SettingItem>
<n-color-picker size="small" :modes="['hex']" v-model:value="item.backgroundStyle.color"></n-color-picker>
</SettingItem>
</SettingItemBox>
</CollapseItem>
</template>
<script setup lang="ts">
import { PropType, computed } from 'vue'
// import { option, shapes } from './config'
import { option } from './config'
import { CollapseItem, SettingItemBox, SettingItem } from '@/components/Pages/ChartItemSetting'
const props = defineProps({
optionData: {
type: Object as PropType<typeof option>,
required: true
}
})
const t = window['$t']
const seriesList = computed(() => {
return props.optionData.series
})
const shapes = [
{
label: t('common.symbolEnumList.circle'),
value: 'circle'
},
{
label: t('common.symbolEnumList.rect'),
value: 'rect'
},
{
label: t('common.symbolEnumList.roundRect'),
value: 'roundRect'
},
{
label: t('common.symbolEnumList.ascending'),
value: 'triangle'
},
{
label: t('common.symbolEnumList.diamond'),
value: 'diamond'
},
{
label: t('common.symbolEnumList.pin'),
value: 'pin'
},
{
label: t('common.symbolEnumList.arrow'),
value: 'arrow'
}
]
</script>