config.vue
3.62 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
<template>
<collapse-item name="按钮配置" :expanded="true">
<setting-item-box name="默认值" :alone="true">
<n-select size="small" v-model:value="optionData.buttonType" :options="buttonTypeOptions" />
</setting-item-box>
<setting-item-box name="虚线">
<setting-item name="">
<n-switch v-model:value="optionData.buttonDashed" />
</setting-item>
</setting-item-box>
<setting-item-box name="透明">
<setting-item name="">
<n-switch v-model:value="optionData.buttonGhost" />
</setting-item>
</setting-item-box>
<setting-item-box name="颜色">
<setting-item name="">
<n-color-picker size="small" :modes="['hex']" v-model:value="optionData.buttonColor"></n-color-picker>
</setting-item>
</setting-item-box>
<setting-item-box name="文字颜色">
<setting-item name="">
<n-color-picker size="small" :modes="['hex']" v-model:value="optionData.buttonTextColor"></n-color-picker>
</setting-item>
</setting-item-box>
<setting-item-box name="文字大小">
<setting-item name="">
<n-input-number v-model:value="optionData.buttonTextSize" />
</setting-item>
</setting-item-box>
<setting-item-box :alone="true">
<template #name>
<n-text>跳转</n-text>
<n-tooltip trigger="hover">
<template #trigger>
<n-icon size="21" :depth="3">
<help-outline-icon></help-outline-icon>
</n-icon>
</template>
<span class="help-span">{{ threeFileHelpMessgae }}</span>
</n-tooltip>
</template>
<setting-item v-for="(item, index) in optionData.dataset" :key="index">
<n-input v-model:value="item.label" size="small" placeholder="按钮文字"></n-input>
<div style="height: 5px"></div>
<n-input v-model:value="item.currentButton" size="small" placeholder="填写当前按钮id(事件里面)"></n-input>
<div style="height: 5px"></div>
<n-input v-model:value="item.targetButton" size="small" placeholder="填写目标按钮id(事件里面)"></n-input>
<div style="height: 5px"></div>
<n-input v-model:value="item.current" size="small" placeholder="填写当前页面id(事件里面)"></n-input>
<div style="height: 5px"></div>
<n-input v-model:value="item.target" size="small" placeholder="填写目标页面id(事件里面)"></n-input>
<div style="height: 5px"></div>
</setting-item>
</setting-item-box>
</collapse-item>
</template>
<script lang="ts" setup>
import { PropType, ref } from 'vue'
import { CollapseItem, SettingItemBox } from '@/components/Pages/ChartItemSetting'
import { option } from './config'
import { icon } from '@/plugins'
defineProps({
optionData: {
type: Object as PropType<typeof option>,
required: true
}
})
const { HelpOutlineIcon } = icon.ionicons5
const threeFileHelpMessgae = ref(`
在事件里面复制对应组件id,填写你要跳转的目标,相当于一个按钮就绑定了一个页面(分组),然后跳转到另一个页面,其实就是点击当前页隐藏,目标页显示
`)
const buttonTypeOptions = [
{
label: 'default',
value: 'default'
},
{
label: 'primary',
value: 'primary'
},
{
label: 'tertiary',
value: 'tertiary'
},
{
label: 'info',
value: 'info'
},
{
label: 'success',
value: 'success'
},
{
label: 'warning',
value: 'warning'
},
{
label: 'error',
value: 'error'
}
]
</script>
<style lang="scss" scoped>
.help-span {
display: flex;
flex-wrap: wrap;
width: 8vw;
color: white;
}
</style>