config.vue
1.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
<template>
<div>
<CollapseItem :name="t('charts.chart.sankey')" :expanded="true">
<SettingItemBox :name="t('common.styleText')">
<SettingItem :name="t('common.dirextionText')">
<n-select
v-model:value="sankeyConfig.orient"
size="small"
:options="orientList"
:placeholder="t('charts.chart.selectDirection')"
/>
</SettingItem>
<SettingItem :name="t('charts.chart.promptLabel')">
<n-select
v-model:value="optionData.tooltip.show"
size="small"
:options="toolTipSwitch"
:placeholder="t('common.isEnabled')"
/>
</SettingItem>
</SettingItemBox>
</CollapseItem>
</div>
</template>
<script setup lang="ts">
import { PropType, computed } from 'vue'
import { CollapseItem, SettingItemBox, SettingItem } from '@/components/Pages/ChartItemSetting'
// import { option, orientList, toolTipSwitch } from './config'
import { option} from './config'
import { GlobalThemeJsonType } from '@/settings/chartThemes/index'
const props = defineProps({
optionData: {
type: Object as PropType<typeof option & GlobalThemeJsonType>,
required: true
}
})
const t = window['$t']
const sankeyConfig = computed<typeof option.series>(() => {
return props.optionData.series
})
// 图表方向
const orientList = [
{ label: t('common.orientList.horizontal'), value: 'horizontal' },
{ label: t('common.orientList.vertical'), value: 'vertical' }
]
// 标签展示
const toolTipSwitch = [
{ label: t('common.toolTipSwitch.open'), value: 1 },
{ label: t('common.toolTipSwitch.close'), value: 0 }
]
</script>