@vyr/echarts-browser 0.0.33 → 0.0.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/common/provider.ts +3 -5
- package/src/locale/Language.ts +1 -5
- package/src/locale/LanguageProvider.ts +2 -13
- package/src/option/Echart.ts +5 -12
- package/src/service/index.ts +2 -4
- package/src/service/inspector/EchartViewer.vue +5 -213
- package/src/service/inspector/index.ts +2 -5
- package/src/service/sidebar/action/AddEchartsAction.ts +9 -18
- package/src/service/inspector/BarServiceEchartViewer.vue +0 -105
- package/src/service/inspector/LineServiceEchartViewer.vue +0 -60
- package/src/service/inspector/PieServiceEchartViewer.vue +0 -138
package/package.json
CHANGED
package/src/common/provider.ts
CHANGED
|
@@ -3,12 +3,10 @@ import { Descriptor } from "@vyr/engine";
|
|
|
3
3
|
|
|
4
4
|
const providerKey = Symbol()
|
|
5
5
|
|
|
6
|
-
const providerDescriptor = (descriptor: Ref<Descriptor | null>) => {
|
|
6
|
+
export const providerDescriptor = (descriptor: Ref<Descriptor | null>) => {
|
|
7
7
|
provide(providerKey, descriptor)
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
const useDescriptor = <T extends Descriptor = Descriptor>() => {
|
|
10
|
+
export const useDescriptor = <T extends Descriptor = Descriptor>() => {
|
|
11
11
|
return inject(providerKey) as Ref<T>
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export { providerDescriptor, useDescriptor }
|
|
12
|
+
}
|
package/src/locale/Language.ts
CHANGED
|
@@ -3,8 +3,4 @@ import { zhCnLanguageProvider, ZhCNLanguageProvider } from "./LanguageProvider";
|
|
|
3
3
|
|
|
4
4
|
Locale.register(zhCnLanguageProvider)
|
|
5
5
|
|
|
6
|
-
const language = Locale.getLanguage<ZhCNLanguageProvider>(zhCnLanguageProvider.name)
|
|
7
|
-
|
|
8
|
-
export {
|
|
9
|
-
language
|
|
10
|
-
}
|
|
6
|
+
export const language = Locale.getLanguage<ZhCNLanguageProvider>(zhCnLanguageProvider.name)
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { LanguageProvider } from '@vyr/locale'
|
|
2
2
|
|
|
3
|
-
interface ZhCNLanguageProvider extends LanguageProvider {
|
|
3
|
+
export interface ZhCNLanguageProvider extends LanguageProvider {
|
|
4
4
|
'descriptor.type.Echart': string
|
|
5
|
-
'descriptor.type.BarServiceEchart': string
|
|
6
|
-
'descriptor.type.LineServiceEchart': string
|
|
7
|
-
'descriptor.type.PieServiceEchart': string
|
|
8
5
|
|
|
9
6
|
'option.Echart.type.value.label': string
|
|
10
7
|
'option.Echart.type.category.label': string
|
|
@@ -94,14 +91,11 @@ interface ZhCNLanguageProvider extends LanguageProvider {
|
|
|
94
91
|
'sidebar.action.AddEcharts.label': string
|
|
95
92
|
}
|
|
96
93
|
|
|
97
|
-
const zhCnLanguageProvider: ZhCNLanguageProvider = {
|
|
94
|
+
export const zhCnLanguageProvider: ZhCNLanguageProvider = {
|
|
98
95
|
id: 'zh_CN',
|
|
99
96
|
name: '@vyr/echarts-browser',
|
|
100
97
|
|
|
101
98
|
'descriptor.type.Echart': '图表',
|
|
102
|
-
'descriptor.type.BarServiceEchart': '柱状图',
|
|
103
|
-
'descriptor.type.LineServiceEchart': '折线图',
|
|
104
|
-
'descriptor.type.PieServiceEchart': '饼状图',
|
|
105
99
|
|
|
106
100
|
'option.Echart.type.value.label': '数值轴',
|
|
107
101
|
'option.Echart.type.category.label': '类目轴',
|
|
@@ -185,9 +179,4 @@ const zhCnLanguageProvider: ZhCNLanguageProvider = {
|
|
|
185
179
|
'inspector.Pie.base.label.color': '标签颜色',
|
|
186
180
|
|
|
187
181
|
'sidebar.action.AddEcharts.label': '新增图表',
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
export {
|
|
191
|
-
ZhCNLanguageProvider,
|
|
192
|
-
zhCnLanguageProvider,
|
|
193
182
|
}
|
package/src/option/Echart.ts
CHANGED
|
@@ -1,32 +1,25 @@
|
|
|
1
1
|
import { language } from '../locale'
|
|
2
2
|
|
|
3
|
-
const typeOptions = [
|
|
3
|
+
export const typeOptions = [
|
|
4
4
|
{ label: language.get('option.Echart.type.value.label'), value: 'value' },
|
|
5
5
|
{ label: language.get('option.Echart.type.category.label'), value: 'category' },
|
|
6
6
|
{ label: language.get('option.Echart.type.time.label'), value: 'time' },
|
|
7
7
|
]
|
|
8
8
|
|
|
9
|
-
const roseTypeOptions = [
|
|
9
|
+
export const roseTypeOptions = [
|
|
10
10
|
{ label: language.get('option.Echart.roseType.default.label'), value: '' },
|
|
11
11
|
{ label: language.get('option.Echart.roseType.area.label'), value: 'area' },
|
|
12
12
|
{ label: language.get('option.Echart.roseType.radius.label'), value: 'radius' },
|
|
13
13
|
]
|
|
14
14
|
|
|
15
|
-
const borderTypeOptions = [
|
|
15
|
+
export const borderTypeOptions = [
|
|
16
16
|
{ label: language.get('option.Echart.border.solid.label'), value: 'solid' },
|
|
17
17
|
{ label: language.get('option.Echart.border.dashed.label'), value: 'dashed' },
|
|
18
18
|
{ label: language.get('option.Echart.border.dotted.label'), value: 'dotted' },
|
|
19
19
|
]
|
|
20
20
|
|
|
21
|
-
const triggerOptions = [
|
|
21
|
+
export const triggerOptions = [
|
|
22
22
|
{ label: language.get('option.Echart.trigger.item.label'), value: 'item' },
|
|
23
23
|
{ label: language.get('option.Echart.trigger.axis.label'), value: 'axis' },
|
|
24
24
|
{ label: language.get('option.Echart.trigger.none.label'), value: 'none' },
|
|
25
|
-
]
|
|
26
|
-
|
|
27
|
-
export {
|
|
28
|
-
typeOptions,
|
|
29
|
-
roseTypeOptions,
|
|
30
|
-
borderTypeOptions,
|
|
31
|
-
triggerOptions,
|
|
32
|
-
}
|
|
25
|
+
]
|
package/src/service/index.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { runtime, ShortcutkeyService, InspectorService } from "@vyr/runtime";
|
|
|
2
2
|
import inspectorViewer from './inspector'
|
|
3
3
|
import sidebarAction from './sidebar/action'
|
|
4
4
|
|
|
5
|
-
const setup = async () => {
|
|
5
|
+
export const setup = async () => {
|
|
6
6
|
const inspectorService = runtime.get<InspectorService>('inspector')
|
|
7
7
|
const shortcutkeyService = runtime.get<ShortcutkeyService>('shortcutkey')
|
|
8
8
|
|
|
@@ -15,6 +15,4 @@ const setup = async () => {
|
|
|
15
15
|
for (const viewer of inspectorViewer) {
|
|
16
16
|
inspectorService.set(viewer.type, viewer.import)
|
|
17
17
|
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export { setup }
|
|
18
|
+
}
|
|
@@ -1,232 +1,24 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<vyr-card v-if="descriptor" :title="language.get('descriptor.type.Echart')" :scroll="true">
|
|
3
3
|
<base-fragment :raw="raw"></base-fragment>
|
|
4
|
-
<HTML-fragment :raw="raw"></HTML-fragment>
|
|
5
|
-
<vyr-row>
|
|
6
|
-
<vyr-divider :text="language.get('inspector.Echart.xAxis')"></vyr-divider>
|
|
7
|
-
</vyr-row>
|
|
8
|
-
<vyr-row>
|
|
9
|
-
<vyr-label :label="language.get('inspector.Echart.xAxis.show')">
|
|
10
|
-
<vyr-col>
|
|
11
|
-
<vyr-select v-model="descriptor.xAxisShow" :data="option.stateOptions"></vyr-select>
|
|
12
|
-
</vyr-col>
|
|
13
|
-
</vyr-label>
|
|
14
|
-
</vyr-row>
|
|
15
|
-
<vyr-row>
|
|
16
|
-
<vyr-label :label="language.get('inspector.Echart.xAxis.type')">
|
|
17
|
-
<vyr-col>
|
|
18
|
-
<vyr-select v-model="descriptor.xAxisType" :clearable="true"
|
|
19
|
-
:data="Echart.typeOptions"></vyr-select>
|
|
20
|
-
</vyr-col>
|
|
21
|
-
</vyr-label>
|
|
22
|
-
</vyr-row>
|
|
23
|
-
<vyr-row>
|
|
24
|
-
<vyr-label :label="language.get('inspector.Echart.xAxis.line.show')">
|
|
25
|
-
<vyr-col>
|
|
26
|
-
<vyr-select v-model="descriptor.xAxisLine.show" :data="option.stateOptions"></vyr-select>
|
|
27
|
-
</vyr-col>
|
|
28
|
-
</vyr-label>
|
|
29
|
-
</vyr-row>
|
|
30
|
-
<vyr-row>
|
|
31
|
-
<vyr-label :label="language.get('inspector.Echart.xAxis.tick.show')">
|
|
32
|
-
<vyr-col>
|
|
33
|
-
<vyr-select v-model="descriptor.xAxisTick.show" :data="option.stateOptions"></vyr-select>
|
|
34
|
-
</vyr-col>
|
|
35
|
-
</vyr-label>
|
|
36
|
-
</vyr-row>
|
|
37
|
-
<vyr-row>
|
|
38
|
-
<vyr-label :label="language.get('inspector.Echart.xAxis.label.show')">
|
|
39
|
-
<vyr-col>
|
|
40
|
-
<vyr-select v-model="descriptor.xAxisLabel.show" :data="option.stateOptions"></vyr-select>
|
|
41
|
-
</vyr-col>
|
|
42
|
-
</vyr-label>
|
|
43
|
-
</vyr-row>
|
|
44
|
-
<vyr-row>
|
|
45
|
-
<vyr-label :label="language.get('inspector.Echart.xAxis.splitLine.show')">
|
|
46
|
-
<vyr-col>
|
|
47
|
-
<vyr-select v-model="descriptor.xAxisSplitLine.show" :data="option.stateOptions"></vyr-select>
|
|
48
|
-
</vyr-col>
|
|
49
|
-
</vyr-label>
|
|
50
|
-
</vyr-row>
|
|
51
|
-
<vyr-row>
|
|
52
|
-
<vyr-label :label="language.get('inspector.Echart.xAxis.font')">
|
|
53
|
-
<vyr-col :span="12">
|
|
54
|
-
<vyr-color-picker width="all" v-model="descriptor.xAxisLabel.color"></vyr-color-picker>
|
|
55
|
-
</vyr-col>
|
|
56
|
-
<vyr-col :span="12">
|
|
57
|
-
<vyr-input-number v-model="descriptor.xAxisLabel.fontSize"></vyr-input-number>
|
|
58
|
-
</vyr-col>
|
|
59
|
-
</vyr-label>
|
|
60
|
-
</vyr-row>
|
|
61
|
-
<vyr-row>
|
|
62
|
-
<vyr-divider :text="language.get('inspector.Echart.yAxis')"></vyr-divider>
|
|
63
|
-
</vyr-row>
|
|
64
|
-
<vyr-row>
|
|
65
|
-
<vyr-label :label="language.get('inspector.Echart.yAxis.show')">
|
|
66
|
-
<vyr-col>
|
|
67
|
-
<vyr-select v-model="descriptor.yAxisShow" :data="option.stateOptions"></vyr-select>
|
|
68
|
-
</vyr-col>
|
|
69
|
-
</vyr-label>
|
|
70
|
-
</vyr-row>
|
|
71
|
-
<vyr-row>
|
|
72
|
-
<vyr-label :label="language.get('inspector.Echart.yAxis.type')">
|
|
73
|
-
<vyr-col>
|
|
74
|
-
<vyr-select v-model="descriptor.yAxisType" :clearable="true"
|
|
75
|
-
:data="Echart.typeOptions"></vyr-select>
|
|
76
|
-
</vyr-col>
|
|
77
|
-
</vyr-label>
|
|
78
|
-
</vyr-row>
|
|
79
|
-
<vyr-row>
|
|
80
|
-
<vyr-label :label="language.get('inspector.Echart.yAxis.line.show')">
|
|
81
|
-
<vyr-col>
|
|
82
|
-
<vyr-select v-model="descriptor.yAxisLine.show" :data="option.stateOptions"></vyr-select>
|
|
83
|
-
</vyr-col>
|
|
84
|
-
</vyr-label>
|
|
85
|
-
</vyr-row>
|
|
86
|
-
<vyr-row>
|
|
87
|
-
<vyr-label :label="language.get('inspector.Echart.yAxis.tick.show')">
|
|
88
|
-
<vyr-col>
|
|
89
|
-
<vyr-select v-model="descriptor.yAxisTick.show" :data="option.stateOptions"></vyr-select>
|
|
90
|
-
</vyr-col>
|
|
91
|
-
</vyr-label>
|
|
92
|
-
</vyr-row>
|
|
93
|
-
<vyr-row>
|
|
94
|
-
<vyr-label :label="language.get('inspector.Echart.yAxis.label.show')">
|
|
95
|
-
<vyr-col>
|
|
96
|
-
<vyr-select v-model="descriptor.yAxisLabel.show" :data="option.stateOptions"></vyr-select>
|
|
97
|
-
</vyr-col>
|
|
98
|
-
</vyr-label>
|
|
99
|
-
</vyr-row>
|
|
100
|
-
<vyr-row>
|
|
101
|
-
<vyr-label :label="language.get('inspector.Echart.yAxis.splitLine.show')">
|
|
102
|
-
<vyr-col>
|
|
103
|
-
<vyr-select v-model="descriptor.yAxisSplitLine.show" :data="option.stateOptions"></vyr-select>
|
|
104
|
-
</vyr-col>
|
|
105
|
-
</vyr-label>
|
|
106
|
-
</vyr-row>
|
|
107
|
-
<vyr-row>
|
|
108
|
-
<vyr-label :label="language.get('inspector.Echart.yAxis.font')">
|
|
109
|
-
<vyr-col :span="12">
|
|
110
|
-
<vyr-color-picker width="all" v-model="descriptor.yAxisLabel.color"></vyr-color-picker>
|
|
111
|
-
</vyr-col>
|
|
112
|
-
<vyr-col :span="12">
|
|
113
|
-
<vyr-input-number v-model="descriptor.yAxisLabel.fontSize"></vyr-input-number>
|
|
114
|
-
</vyr-col>
|
|
115
|
-
</vyr-label>
|
|
116
|
-
</vyr-row>
|
|
117
|
-
<vyr-row>
|
|
118
|
-
<vyr-divider :text="language.get('inspector.Echart.grid')"></vyr-divider>
|
|
119
|
-
</vyr-row>
|
|
120
|
-
<vyr-row>
|
|
121
|
-
<vyr-label :label="language.get('inspector.Echart.grid.show')">
|
|
122
|
-
<vyr-col>
|
|
123
|
-
<vyr-select v-model="descriptor.gridShow" :data="option.stateOptions"></vyr-select>
|
|
124
|
-
</vyr-col>
|
|
125
|
-
</vyr-label>
|
|
126
|
-
</vyr-row>
|
|
127
|
-
<vyr-row>
|
|
128
|
-
<vyr-label :label="language.get('inspector.Echart.grid.rect.size')">
|
|
129
|
-
<vyr-col :span="12">
|
|
130
|
-
<vyr-input v-model="descriptor.gridRect.width" trigger="blur"></vyr-input>
|
|
131
|
-
</vyr-col>
|
|
132
|
-
<vyr-col :span="12">
|
|
133
|
-
<vyr-input v-model="descriptor.gridRect.height" trigger="blur"></vyr-input>
|
|
134
|
-
</vyr-col>
|
|
135
|
-
</vyr-label>
|
|
136
|
-
</vyr-row>
|
|
137
|
-
<vyr-row>
|
|
138
|
-
<vyr-label :label="language.get('inspector.Echart.grid.rect.padding.horizontal')">
|
|
139
|
-
<vyr-col :span="12">
|
|
140
|
-
<vyr-input v-model="descriptor.gridRect.left" trigger="blur"></vyr-input>
|
|
141
|
-
</vyr-col>
|
|
142
|
-
<vyr-col :span="12">
|
|
143
|
-
<vyr-input v-model="descriptor.gridRect.right" trigger="blur"></vyr-input>
|
|
144
|
-
</vyr-col>
|
|
145
|
-
</vyr-label>
|
|
146
|
-
</vyr-row>
|
|
147
|
-
<vyr-row>
|
|
148
|
-
<vyr-label :label="language.get('inspector.Echart.grid.rect.padding.vertical')">
|
|
149
|
-
<vyr-col :span="12">
|
|
150
|
-
<vyr-input v-model="descriptor.gridRect.top" trigger="blur"></vyr-input>
|
|
151
|
-
</vyr-col>
|
|
152
|
-
<vyr-col :span="12">
|
|
153
|
-
<vyr-input v-model="descriptor.gridRect.bottom" trigger="blur"></vyr-input>
|
|
154
|
-
</vyr-col>
|
|
155
|
-
</vyr-label>
|
|
156
|
-
</vyr-row>
|
|
157
|
-
<vyr-row>
|
|
158
|
-
<vyr-divider :text="language.get('inspector.Echart.legend')"></vyr-divider>
|
|
159
|
-
</vyr-row>
|
|
160
|
-
<vyr-row>
|
|
161
|
-
<vyr-label :label="language.get('inspector.Echart.legend.show')">
|
|
162
|
-
<vyr-col>
|
|
163
|
-
<vyr-select v-model="descriptor.legendShow" :data="option.stateOptions"></vyr-select>
|
|
164
|
-
</vyr-col>
|
|
165
|
-
</vyr-label>
|
|
166
|
-
</vyr-row>
|
|
167
|
-
<vyr-row>
|
|
168
|
-
<vyr-label :label="language.get('inspector.Echart.legend.rect.size')">
|
|
169
|
-
<vyr-col :span="12">
|
|
170
|
-
<vyr-input v-model="descriptor.legendRect.width" trigger="blur"></vyr-input>
|
|
171
|
-
</vyr-col>
|
|
172
|
-
<vyr-col :span="12">
|
|
173
|
-
<vyr-input v-model="descriptor.legendRect.height" trigger="blur"></vyr-input>
|
|
174
|
-
</vyr-col>
|
|
175
|
-
</vyr-label>
|
|
176
|
-
</vyr-row>
|
|
177
|
-
<vyr-row>
|
|
178
|
-
<vyr-label :label="language.get('inspector.Echart.legend.position')">
|
|
179
|
-
<vyr-col :span="12">
|
|
180
|
-
<vyr-input v-model="descriptor.legendRect.left" trigger="blur"></vyr-input>
|
|
181
|
-
</vyr-col>
|
|
182
|
-
<vyr-col :span="12">
|
|
183
|
-
<vyr-input v-model="descriptor.legendRect.top" trigger="blur"></vyr-input>
|
|
184
|
-
</vyr-col>
|
|
185
|
-
</vyr-label>
|
|
186
|
-
</vyr-row>
|
|
187
|
-
<vyr-row>
|
|
188
|
-
<vyr-label :label="language.get('inspector.Echart.legend.font')">
|
|
189
|
-
<vyr-col>
|
|
190
|
-
<vyr-color-picker width="all" v-model="descriptor.legendTextStyle.color"></vyr-color-picker>
|
|
191
|
-
</vyr-col>
|
|
192
|
-
</vyr-label>
|
|
193
|
-
</vyr-row>
|
|
194
|
-
<vyr-row>
|
|
195
|
-
<vyr-divider :text="language.get('inspector.Echart.tooltip')"></vyr-divider>
|
|
196
|
-
</vyr-row>
|
|
197
|
-
<vyr-row>
|
|
198
|
-
<vyr-label :label="language.get('inspector.Echart.tooltip.show')">
|
|
199
|
-
<vyr-col>
|
|
200
|
-
<vyr-select v-model="descriptor.tooltipShow" :data="option.stateOptions"></vyr-select>
|
|
201
|
-
</vyr-col>
|
|
202
|
-
</vyr-label>
|
|
203
|
-
</vyr-row>
|
|
204
|
-
<vyr-row>
|
|
205
|
-
<vyr-label :label="language.get('inspector.Echart.tooltip.trigger')">
|
|
206
|
-
<vyr-col>
|
|
207
|
-
<vyr-select v-model="descriptor.tooltipTrigger" :data="Echart.triggerOptions"></vyr-select>
|
|
208
|
-
</vyr-col>
|
|
209
|
-
</vyr-label>
|
|
210
|
-
</vyr-row>
|
|
211
4
|
</vyr-card>
|
|
212
5
|
</template>
|
|
213
6
|
|
|
214
7
|
|
|
215
8
|
<script lang="ts" setup>
|
|
216
9
|
import { ref, Ref, watch } from 'vue';
|
|
217
|
-
import {
|
|
218
|
-
import { VyrCard
|
|
219
|
-
import {
|
|
10
|
+
import { Echart } from '@vyr/echarts'
|
|
11
|
+
import { VyrCard } from '@vyr/design'
|
|
12
|
+
import { BaseFragment, providerDescriptor as builtinProviderDescriptor } from '@vyr/builtin'
|
|
220
13
|
import { language } from '../../locale'
|
|
221
14
|
import { providerDescriptor } from '../../common'
|
|
222
|
-
import { Echart } from '../../option'
|
|
223
15
|
|
|
224
16
|
const props = defineProps<{ raw: string, uuid: string }>()
|
|
225
17
|
|
|
226
|
-
const descriptor = ref(null) as Ref<
|
|
18
|
+
const descriptor = ref(null) as Ref<Echart | null>
|
|
227
19
|
const watchEditItem = (cur: string) => {
|
|
228
20
|
if (!cur) return descriptor.value = null
|
|
229
|
-
descriptor.value =
|
|
21
|
+
descriptor.value = Echart.get<Echart>(cur)
|
|
230
22
|
}
|
|
231
23
|
watch(() => props.uuid, watchEditItem, { immediate: true })
|
|
232
24
|
providerDescriptor(descriptor)
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Echart } from '@vyr/echarts'
|
|
2
2
|
|
|
3
3
|
export default [
|
|
4
|
-
{ type:
|
|
5
|
-
{ type: BarServiceEchartDescriptor.type, import: () => import('./BarServiceEchartViewer.vue') },
|
|
6
|
-
{ type: LineServiceEchartDescriptor.type, import: () => import('./LineServiceEchartViewer.vue') },
|
|
7
|
-
{ type: PieServiceEchartDescriptor.type, import: () => import('./PieServiceEchartViewer.vue') },
|
|
4
|
+
{ type: Echart.type, import: () => import('./EchartViewer.vue') },
|
|
8
5
|
]
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { Descriptor } from "@vyr/engine"
|
|
2
2
|
import { Action, DataService, runtime } from "@vyr/runtime"
|
|
3
|
-
import {
|
|
4
|
-
import { BarServiceEchartDescriptor, EchartDescriptor, LineServiceEchartDescriptor, PieServiceEchartDescriptor, } from "@vyr/echarts"
|
|
3
|
+
import { Echart, } from "@vyr/echarts"
|
|
5
4
|
import { language } from '../../../locale'
|
|
6
5
|
|
|
7
|
-
class AddEchartsAction extends Action {
|
|
6
|
+
export class AddEchartsAction extends Action {
|
|
8
7
|
static id = 'sidebar.AddEcharts'
|
|
9
8
|
static generate = (label: string, Class: typeof Descriptor, args: any = {}) => {
|
|
10
9
|
class ClassAction extends Action {
|
|
@@ -19,11 +18,9 @@ class AddEchartsAction extends Action {
|
|
|
19
18
|
}
|
|
20
19
|
execute() {
|
|
21
20
|
const dataService = runtime.get<DataService>('data')
|
|
22
|
-
const navigator = dataService.sidebar.get(dataService.sidebar.active)
|
|
23
|
-
if (navigator === null) return console.log(builtinLanguage.get('sidebar.action.active.notFound', { key: dataService.sidebar.active }))
|
|
24
21
|
|
|
25
|
-
|
|
26
|
-
const echart = new
|
|
22
|
+
dataService.sidebar.status.modifyMode = 'add'
|
|
23
|
+
const echart = new Echart({
|
|
27
24
|
...args,
|
|
28
25
|
width: 100,
|
|
29
26
|
wUnit: '%',
|
|
@@ -31,8 +28,8 @@ class AddEchartsAction extends Action {
|
|
|
31
28
|
hUnit: '%',
|
|
32
29
|
})
|
|
33
30
|
echart.add(new Class({ name: Class.type }))
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
dataService.sidebar.status.modifyContent = echart
|
|
32
|
+
dataService.sidebar.status.modifyValue = dataService.sidebar.status.mouseItem
|
|
36
33
|
}
|
|
37
34
|
}
|
|
38
35
|
return new ClassAction()
|
|
@@ -42,9 +39,7 @@ class AddEchartsAction extends Action {
|
|
|
42
39
|
|
|
43
40
|
constructor() {
|
|
44
41
|
super()
|
|
45
|
-
this.children.push(AddEchartsAction.generate(language.get('descriptor.type.
|
|
46
|
-
this.children.push(AddEchartsAction.generate(language.get('descriptor.type.LineServiceEchart'), LineServiceEchartDescriptor))
|
|
47
|
-
this.children.push(AddEchartsAction.generate(language.get('descriptor.type.PieServiceEchart'), PieServiceEchartDescriptor, { xAxisShow: false, yAxisShow: false }))
|
|
42
|
+
this.children.push(AddEchartsAction.generate(language.get('descriptor.type.Echart'), Echart))
|
|
48
43
|
}
|
|
49
44
|
|
|
50
45
|
update() {
|
|
@@ -52,9 +47,7 @@ class AddEchartsAction extends Action {
|
|
|
52
47
|
this.show = false
|
|
53
48
|
this.disabled = true
|
|
54
49
|
|
|
55
|
-
|
|
56
|
-
if (navigator === null) return console.log(builtinLanguage.get('sidebar.action.active.notFound', { key: dataService.sidebar.active }))
|
|
57
|
-
if (navigator.status.mouseItem === null) return
|
|
50
|
+
if (dataService.sidebar.status.mouseItem === null) return
|
|
58
51
|
|
|
59
52
|
this.show = true
|
|
60
53
|
this.disabled = false
|
|
@@ -63,6 +56,4 @@ class AddEchartsAction extends Action {
|
|
|
63
56
|
return false
|
|
64
57
|
}
|
|
65
58
|
execute() { }
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export { AddEchartsAction }
|
|
59
|
+
}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<vyr-card v-if="descriptor" :title="language.get('descriptor.type.BarServiceEchart')" :scroll="true">
|
|
3
|
-
<base-fragment :raw="raw"></base-fragment>
|
|
4
|
-
<vyr-row>
|
|
5
|
-
<vyr-label :label="language.get('inspector.Bar.base.modelValue')">
|
|
6
|
-
<vyr-col>
|
|
7
|
-
<vyr-input v-model="descriptor.modelValue" :clearable="true" trigger="blur"></vyr-input>
|
|
8
|
-
</vyr-col>
|
|
9
|
-
</vyr-label>
|
|
10
|
-
</vyr-row>
|
|
11
|
-
<vyr-row>
|
|
12
|
-
<vyr-label :label="language.get('inspector.Bar.base.barWidth')">
|
|
13
|
-
<vyr-col>
|
|
14
|
-
<vyr-input v-model="descriptor.barWidth" :clearable="true" trigger="blur"></vyr-input>
|
|
15
|
-
</vyr-col>
|
|
16
|
-
</vyr-label>
|
|
17
|
-
</vyr-row>
|
|
18
|
-
<vyr-row>
|
|
19
|
-
<vyr-label :label="language.get('inspector.Bar.base.barMaxWidth')">
|
|
20
|
-
<vyr-col>
|
|
21
|
-
<vyr-input v-model="descriptor.barMaxWidth" :clearable="true" trigger="blur"></vyr-input>
|
|
22
|
-
</vyr-col>
|
|
23
|
-
</vyr-label>
|
|
24
|
-
</vyr-row>
|
|
25
|
-
<vyr-row>
|
|
26
|
-
<vyr-label :label="language.get('inspector.Bar.base.label.show')">
|
|
27
|
-
<vyr-col>
|
|
28
|
-
<vyr-select v-model="descriptor.labelShow" :data="option.stateOptions"></vyr-select>
|
|
29
|
-
</vyr-col>
|
|
30
|
-
</vyr-label>
|
|
31
|
-
</vyr-row>
|
|
32
|
-
<vyr-row>
|
|
33
|
-
<vyr-label :label="language.get('inspector.Bar.base.label.position')">
|
|
34
|
-
<vyr-col>
|
|
35
|
-
<vyr-input v-model="descriptor.labelPosition" :clearable="true" trigger="blur"></vyr-input>
|
|
36
|
-
</vyr-col>
|
|
37
|
-
</vyr-label>
|
|
38
|
-
</vyr-row>
|
|
39
|
-
<vyr-row>
|
|
40
|
-
<vyr-label :label="language.get('inspector.Bar.base.label.color')">
|
|
41
|
-
<vyr-col>
|
|
42
|
-
<vyr-color-picker v-model="descriptor.labelColor" width="all"></vyr-color-picker>
|
|
43
|
-
</vyr-col>
|
|
44
|
-
</vyr-label>
|
|
45
|
-
</vyr-row>
|
|
46
|
-
<vyr-row>
|
|
47
|
-
<vyr-label :label="language.get('inspector.Echart.border.type')">
|
|
48
|
-
<vyr-col>
|
|
49
|
-
<vyr-select v-model="descriptor.itemStyle.borderType" :data="Echart.borderTypeOptions"></vyr-select>
|
|
50
|
-
</vyr-col>
|
|
51
|
-
</vyr-label>
|
|
52
|
-
</vyr-row>
|
|
53
|
-
<vyr-row>
|
|
54
|
-
<vyr-label :label="language.get('inspector.Echart.border.width')">
|
|
55
|
-
<vyr-col>
|
|
56
|
-
<vyr-input-number v-model="descriptor.itemStyle.borderWidth"></vyr-input-number>
|
|
57
|
-
</vyr-col>
|
|
58
|
-
</vyr-label>
|
|
59
|
-
</vyr-row>
|
|
60
|
-
<vyr-row>
|
|
61
|
-
<vyr-label :label="language.get('inspector.Echart.border.radius')">
|
|
62
|
-
<vyr-col>
|
|
63
|
-
<vyr-input-number v-model="descriptor.itemStyle.borderRadius"></vyr-input-number>
|
|
64
|
-
</vyr-col>
|
|
65
|
-
</vyr-label>
|
|
66
|
-
</vyr-row>
|
|
67
|
-
<vyr-row>
|
|
68
|
-
<vyr-label :label="language.get('inspector.Echart.border.color')">
|
|
69
|
-
<vyr-col :span="12">
|
|
70
|
-
<vyr-color-picker v-model="descriptor.itemStyle.borderColor.value" width="all"></vyr-color-picker>
|
|
71
|
-
</vyr-col>
|
|
72
|
-
<vyr-col :span="12">
|
|
73
|
-
<vyr-input-number v-model="descriptor.itemStyle.borderColor.opacity" :min="0"
|
|
74
|
-
:max="1"></vyr-input-number>
|
|
75
|
-
</vyr-col>
|
|
76
|
-
</vyr-label>
|
|
77
|
-
</vyr-row>
|
|
78
|
-
<vyr-color-item v-model="descriptor.itemStyle.color"
|
|
79
|
-
:title="language.get('inspector.Bar.base.fill')"></vyr-color-item>
|
|
80
|
-
</vyr-card>
|
|
81
|
-
</template>
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
<script lang="ts" setup>
|
|
85
|
-
import { ref, Ref, watch } from 'vue';
|
|
86
|
-
import { BarServiceEchartDescriptor } from '@vyr/echarts'
|
|
87
|
-
import { VyrCard, VyrInput, VyrRow, VyrCol, VyrLabel, VyrSelect, VyrColorPicker, VyrInputNumber } from '@vyr/design';
|
|
88
|
-
import { option, VyrColorItem, BaseFragment, providerDescriptor as builtinProviderDescriptor } from '@vyr/builtin'
|
|
89
|
-
import { language } from '../../locale'
|
|
90
|
-
import { providerDescriptor } from '../../common';
|
|
91
|
-
import { Echart } from '../../option'
|
|
92
|
-
|
|
93
|
-
const props = defineProps<{ raw: string, uuid: string }>()
|
|
94
|
-
|
|
95
|
-
const descriptor = ref(null) as Ref<BarServiceEchartDescriptor | null>
|
|
96
|
-
const watchEditItem = (cur: string) => {
|
|
97
|
-
if (!cur) return descriptor.value = null
|
|
98
|
-
descriptor.value = BarServiceEchartDescriptor.get<BarServiceEchartDescriptor>(cur)
|
|
99
|
-
}
|
|
100
|
-
watch(() => props.uuid, watchEditItem, { immediate: true })
|
|
101
|
-
providerDescriptor(descriptor)
|
|
102
|
-
builtinProviderDescriptor(descriptor)
|
|
103
|
-
</script>
|
|
104
|
-
|
|
105
|
-
<style lang="less" scoped></style>
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<vyr-card v-if="descriptor" :title="language.get('descriptor.type.LineServiceEchart')" :scroll="true">
|
|
3
|
-
<vyr-row>
|
|
4
|
-
<vyr-label :label="language.get('inspector.Line.base.modelValue')">
|
|
5
|
-
<vyr-col>
|
|
6
|
-
<vyr-input v-model="descriptor.modelValue" :clearable="true" trigger="blur"></vyr-input>
|
|
7
|
-
</vyr-col>
|
|
8
|
-
</vyr-label>
|
|
9
|
-
</vyr-row>
|
|
10
|
-
<vyr-row>
|
|
11
|
-
<vyr-label :label="language.get('inspector.Line.base.line.type')">
|
|
12
|
-
<vyr-col>
|
|
13
|
-
<vyr-select v-model="descriptor.lineStyle.type" :data="Echart.borderTypeOptions"></vyr-select>
|
|
14
|
-
</vyr-col>
|
|
15
|
-
</vyr-label>
|
|
16
|
-
</vyr-row>
|
|
17
|
-
<vyr-row>
|
|
18
|
-
<vyr-label :label="language.get('inspector.Line.base.line.width')">
|
|
19
|
-
<vyr-col>
|
|
20
|
-
<vyr-input-number v-model="descriptor.lineStyle.width" trigger="blur"></vyr-input-number>
|
|
21
|
-
</vyr-col>
|
|
22
|
-
</vyr-label>
|
|
23
|
-
</vyr-row>
|
|
24
|
-
<vyr-row>
|
|
25
|
-
<vyr-label :label="language.get('inspector.Line.base.smooth')">
|
|
26
|
-
<vyr-col>
|
|
27
|
-
<vyr-select v-model="descriptor.smooth" :data="option.stateOptions"></vyr-select>
|
|
28
|
-
</vyr-col>
|
|
29
|
-
</vyr-label>
|
|
30
|
-
</vyr-row>
|
|
31
|
-
<vyr-color-item v-model="descriptor.itemStyleColor"
|
|
32
|
-
:title="language.get('inspector.Line.base.draw')"></vyr-color-item>
|
|
33
|
-
<vyr-color-item v-model="descriptor.areaStyleColor"
|
|
34
|
-
:title="language.get('inspector.Line.base.fill')"></vyr-color-item>
|
|
35
|
-
</vyr-card>
|
|
36
|
-
</template>
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
<script lang="ts" setup>
|
|
40
|
-
import { ref, Ref, watch } from 'vue';
|
|
41
|
-
import { LineServiceEchartDescriptor } from '@vyr/echarts'
|
|
42
|
-
import { VyrCard, VyrInput, VyrRow, VyrCol, VyrLabel, VyrSelect, VyrInputNumber } from '@vyr/design';
|
|
43
|
-
import { option, VyrColorItem, providerDescriptor as builtinProviderDescriptor } from '@vyr/builtin'
|
|
44
|
-
import { language } from '../../locale'
|
|
45
|
-
import { providerDescriptor } from '../../common';
|
|
46
|
-
import { Echart } from '../../option'
|
|
47
|
-
|
|
48
|
-
const props = defineProps<{ raw: string, uuid: string }>()
|
|
49
|
-
|
|
50
|
-
const descriptor = ref(null) as Ref<LineServiceEchartDescriptor | null>
|
|
51
|
-
const watchEditItem = (cur: string) => {
|
|
52
|
-
if (!cur) return descriptor.value = null
|
|
53
|
-
descriptor.value = LineServiceEchartDescriptor.get<LineServiceEchartDescriptor>(cur)
|
|
54
|
-
}
|
|
55
|
-
watch(() => props.uuid, watchEditItem, { immediate: true })
|
|
56
|
-
providerDescriptor(descriptor)
|
|
57
|
-
builtinProviderDescriptor(descriptor)
|
|
58
|
-
</script>
|
|
59
|
-
|
|
60
|
-
<style lang="less" scoped></style>
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<vyr-card v-if="descriptor" :title="language.get('descriptor.type.PieServiceEchart')" :scroll="true">
|
|
3
|
-
<vyr-row>
|
|
4
|
-
<vyr-label :label="language.get('inspector.Pie.base.modelValue')">
|
|
5
|
-
<vyr-col>
|
|
6
|
-
<vyr-input v-model="descriptor.modelValue" :clearable="true" trigger="blur"></vyr-input>
|
|
7
|
-
</vyr-col>
|
|
8
|
-
</vyr-label>
|
|
9
|
-
</vyr-row>
|
|
10
|
-
<vyr-row>
|
|
11
|
-
<vyr-label :label="language.get('inspector.Pie.base.roseType')">
|
|
12
|
-
<vyr-col>
|
|
13
|
-
<vyr-select v-model="descriptor.roseType" :data="Echart.roseTypeOptions"></vyr-select>
|
|
14
|
-
</vyr-col>
|
|
15
|
-
</vyr-label>
|
|
16
|
-
</vyr-row>
|
|
17
|
-
<vyr-row>
|
|
18
|
-
<vyr-label :label="language.get('inspector.Pie.base.width')">
|
|
19
|
-
<vyr-col>
|
|
20
|
-
<vyr-input v-model="descriptor.width" trigger="blur"></vyr-input>
|
|
21
|
-
</vyr-col>
|
|
22
|
-
</vyr-label>
|
|
23
|
-
</vyr-row>
|
|
24
|
-
<vyr-row>
|
|
25
|
-
<vyr-label :label="language.get('inspector.Pie.base.height')">
|
|
26
|
-
<vyr-col>
|
|
27
|
-
<vyr-input v-model="descriptor.height" trigger="blur"></vyr-input>
|
|
28
|
-
</vyr-col>
|
|
29
|
-
</vyr-label>
|
|
30
|
-
</vyr-row>
|
|
31
|
-
<vyr-row>
|
|
32
|
-
<vyr-label :label="language.get('inspector.Pie.base.radius')">
|
|
33
|
-
<vyr-col :span="12">
|
|
34
|
-
<vyr-input v-model="descriptor.radius.x" trigger="blur"></vyr-input>
|
|
35
|
-
</vyr-col>
|
|
36
|
-
<vyr-col :span="12">
|
|
37
|
-
<vyr-input v-model="descriptor.radius.y" trigger="blur"></vyr-input>
|
|
38
|
-
</vyr-col>
|
|
39
|
-
</vyr-label>
|
|
40
|
-
</vyr-row>
|
|
41
|
-
<vyr-row>
|
|
42
|
-
<vyr-label :label="language.get('inspector.Pie.base.center')">
|
|
43
|
-
<vyr-col :span="12">
|
|
44
|
-
<vyr-input v-model="descriptor.center.x" trigger="blur"></vyr-input>
|
|
45
|
-
</vyr-col>
|
|
46
|
-
<vyr-col :span="12">
|
|
47
|
-
<vyr-input v-model="descriptor.center.y" trigger="blur"></vyr-input>
|
|
48
|
-
</vyr-col>
|
|
49
|
-
</vyr-label>
|
|
50
|
-
</vyr-row>
|
|
51
|
-
<vyr-row>
|
|
52
|
-
<vyr-label :label="language.get('inspector.Pie.base.label.padAngle')">
|
|
53
|
-
<vyr-col>
|
|
54
|
-
<vyr-input-number v-model="descriptor.padAngle" :min="0" :max="360"></vyr-input-number>
|
|
55
|
-
</vyr-col>
|
|
56
|
-
</vyr-label>
|
|
57
|
-
</vyr-row>
|
|
58
|
-
<vyr-row>
|
|
59
|
-
<vyr-label :label="language.get('inspector.Pie.base.label.show')">
|
|
60
|
-
<vyr-col>
|
|
61
|
-
<vyr-select v-model="descriptor.labelShow" :data="option.stateOptions"></vyr-select>
|
|
62
|
-
</vyr-col>
|
|
63
|
-
</vyr-label>
|
|
64
|
-
</vyr-row>
|
|
65
|
-
<vyr-row>
|
|
66
|
-
<vyr-label :label="language.get('inspector.Pie.base.label.position')">
|
|
67
|
-
<vyr-col>
|
|
68
|
-
<vyr-input v-model="descriptor.labelPosition" :clearable="true" trigger="blur"></vyr-input>
|
|
69
|
-
</vyr-col>
|
|
70
|
-
</vyr-label>
|
|
71
|
-
</vyr-row>
|
|
72
|
-
<vyr-row>
|
|
73
|
-
<vyr-label :label="language.get('inspector.Pie.base.label.color')">
|
|
74
|
-
<vyr-col>
|
|
75
|
-
<vyr-color-picker v-model="descriptor.labelColor" width="all"></vyr-color-picker>
|
|
76
|
-
</vyr-col>
|
|
77
|
-
</vyr-label>
|
|
78
|
-
</vyr-row>
|
|
79
|
-
<vyr-row>
|
|
80
|
-
<vyr-label :label="language.get('inspector.Echart.border.type')">
|
|
81
|
-
<vyr-col>
|
|
82
|
-
<vyr-select v-model="descriptor.itemStyle.borderType" :data="Echart.borderTypeOptions"></vyr-select>
|
|
83
|
-
</vyr-col>
|
|
84
|
-
</vyr-label>
|
|
85
|
-
</vyr-row>
|
|
86
|
-
<vyr-row>
|
|
87
|
-
<vyr-label :label="language.get('inspector.Echart.border.width')">
|
|
88
|
-
<vyr-col>
|
|
89
|
-
<vyr-input-number v-model="descriptor.itemStyle.borderWidth"></vyr-input-number>
|
|
90
|
-
</vyr-col>
|
|
91
|
-
</vyr-label>
|
|
92
|
-
</vyr-row>
|
|
93
|
-
<vyr-row>
|
|
94
|
-
<vyr-label :label="language.get('inspector.Echart.border.radius')">
|
|
95
|
-
<vyr-col>
|
|
96
|
-
<vyr-input-number v-model="descriptor.itemStyle.borderRadius"></vyr-input-number>
|
|
97
|
-
</vyr-col>
|
|
98
|
-
</vyr-label>
|
|
99
|
-
</vyr-row>
|
|
100
|
-
<vyr-row>
|
|
101
|
-
<vyr-label :label="language.get('inspector.Echart.border.color')">
|
|
102
|
-
<vyr-col :span="12">
|
|
103
|
-
<vyr-color-picker v-model="descriptor.itemStyle.borderColor.value" width="all"></vyr-color-picker>
|
|
104
|
-
</vyr-col>
|
|
105
|
-
<vyr-col :span="12">
|
|
106
|
-
<vyr-input-number v-model="descriptor.itemStyle.borderColor.opacity" :min="0"
|
|
107
|
-
:max="1"></vyr-input-number>
|
|
108
|
-
</vyr-col>
|
|
109
|
-
</vyr-label>
|
|
110
|
-
</vyr-row>
|
|
111
|
-
<vyr-color-item v-model="descriptor.itemStyle.color"
|
|
112
|
-
:title="language.get('inspector.Bar.base.fill')"></vyr-color-item>
|
|
113
|
-
</vyr-card>
|
|
114
|
-
</template>
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
<script lang="ts" setup>
|
|
118
|
-
import { ref, Ref, watch } from 'vue';
|
|
119
|
-
import { PieServiceEchartDescriptor } from '@vyr/echarts'
|
|
120
|
-
import { VyrCard, VyrInput, VyrRow, VyrCol, VyrLabel, VyrSelect, VyrColorPicker, VyrInputNumber } from '@vyr/design';
|
|
121
|
-
import { option, VyrColorItem, providerDescriptor as builtinProviderDescriptor } from '@vyr/builtin'
|
|
122
|
-
import { language } from '../../locale'
|
|
123
|
-
import { providerDescriptor } from '../../common';
|
|
124
|
-
import { Echart } from '../../option'
|
|
125
|
-
|
|
126
|
-
const props = defineProps<{ raw: string, uuid: string }>()
|
|
127
|
-
|
|
128
|
-
const descriptor = ref(null) as Ref<PieServiceEchartDescriptor | null>
|
|
129
|
-
const watchEditItem = (cur: string) => {
|
|
130
|
-
if (!cur) return descriptor.value = null
|
|
131
|
-
descriptor.value = PieServiceEchartDescriptor.get<PieServiceEchartDescriptor>(cur)
|
|
132
|
-
}
|
|
133
|
-
watch(() => props.uuid, watchEditItem, { immediate: true })
|
|
134
|
-
providerDescriptor(descriptor)
|
|
135
|
-
builtinProviderDescriptor(descriptor)
|
|
136
|
-
</script>
|
|
137
|
-
|
|
138
|
-
<style lang="less" scoped></style>
|