config.vue
4.75 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
<template>
<collapse-item name="展示方式" :expanded="true">
<setting-item-box name="选择方式">
<n-select v-model:value="optionData.isPanel" size="small" :options="panelOptions" />
</setting-item-box>
</collapse-item>
<collapse-item name="时间配置" :expanded="true">
<setting-item-box name="基础">
<setting-item name="类型">
<n-select v-model:value="optionData.componentInteractEventKey" size="small" :options="datePickerTypeOptions" />
</setting-item>
</setting-item-box>
<setting-item-box name="默认值" :alone="true">
<n-date-picker size="small" v-model:value="optionData.dataset" :type="optionData.componentInteractEventKey" />
</setting-item-box>
<setting-item-box name="文字颜色" :alone="true">
<SettingItem name="颜色">
<n-color-picker
size="small"
:modes="['hex']"
v-model:value="optionData.selectStyleOptions.textColor"
></n-color-picker>
</SettingItem>
<SettingItem>
<n-button size="small" @click="optionData.selectStyleOptions.textColor = 'black'"> 恢复默认 </n-button>
</SettingItem>
</setting-item-box>
<setting-item-box name="背景颜色" :alone="true">
<SettingItem name="颜色">
<n-color-picker
size="small"
:modes="['hex']"
v-model:value="optionData.selectStyleOptions.textBackgroundColor"
></n-color-picker>
</SettingItem>
<SettingItem>
<n-button size="small" @click="optionData.selectStyleOptions.textBackgroundColor = 'white'">
恢复默认
</n-button>
</SettingItem>
</setting-item-box>
<setting-item-box name="透明度" :alone="true">
<SettingItem name="透明度">
<n-input-number
:min="0"
:max="1"
v-model:value="optionData.selectStyleOptions.textBackgroundColorAlpha"
clearable
/>
</SettingItem>
</setting-item-box>
<setting-item-box name="弹出框背景色" :alone="true">
<SettingItem name="背景色">
<n-color-picker
size="small"
:modes="['hex']"
v-model:value="optionData.selectStyleOptions.textSelectModalBackgroundColor"
></n-color-picker>
</SettingItem>
<SettingItem>
<n-button size="small" @click="optionData.selectStyleOptions.textSelectModalBackgroundColor = 'white'">
恢复默认
</n-button>
</SettingItem>
</setting-item-box>
<setting-item-box name="弹出框文字颜色" :alone="true">
<SettingItem name="颜色">
<n-color-picker
size="small"
:modes="['hex']"
v-model:value="optionData.selectStyleOptions.textSelectModalTextColor"
></n-color-picker>
</SettingItem>
<SettingItem>
<n-button size="small" @click="optionData.selectStyleOptions.textSelectModalTextColor = 'black'">
恢复默认
</n-button>
</SettingItem>
</setting-item-box>
<setting-item-box name="图标颜色" :alone="true">
<SettingItem name="颜色">
<n-color-picker
size="small"
:modes="['hex']"
v-model:value="optionData.selectStyleOptions.iconColor"
></n-color-picker>
</SettingItem>
<SettingItem>
<n-button size="small" @click="optionData.selectStyleOptions.iconColor = 'black'"> 恢复默认 </n-button>
</SettingItem>
</setting-item-box>
</collapse-item>
</template>
<script lang="ts" setup>
import { PropType } from 'vue'
import { icon } from '@/plugins'
import { CollapseItem, SettingItemBox, SettingItem } from '@/components/Pages/ChartItemSetting'
import { option } from './config'
import { ComponentInteractEventEnum } from './interact'
const { HelpOutlineIcon } = icon.ionicons5
const props = defineProps({
optionData: {
type: Object as PropType<typeof option>,
required: true
}
})
const panelOptions = [
{
label: '下拉展示',
value: 0
},
{
label: '面板展示',
value: 1
}
]
const datePickerTypeOptions = [
{
label: '日期',
value: ComponentInteractEventEnum.DATE
},
{
label: '日期时间',
value: ComponentInteractEventEnum.DATE_TIME
},
{
label: '日期范围',
value: ComponentInteractEventEnum.DATE_RANGE
},
{
label: '月份',
value: ComponentInteractEventEnum.MONTH
},
{
label: '月份范围',
value: ComponentInteractEventEnum.MONTH_RANGE
},
{
label: '年份',
value: ComponentInteractEventEnum.YEAR
},
{
label: '年份范围',
value: ComponentInteractEventEnum.YEAR_RANGE
},
{
label: '季度',
value: ComponentInteractEventEnum.QUARTER
},
{
label: '季度范围',
value: ComponentInteractEventEnum.QUARTER_RANGE
}
]
</script>