@cloudbase/weda-ui 3.4.15 → 3.4.16
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/dist/configs/components/dataView.js +0 -3
- package/dist/configs/components/listView.js +0 -1
- package/dist/configs/components/wd-official-account.js +0 -1
- package/dist/configs/index.js +0 -2
- package/dist/style/index.scss +1 -1
- package/dist/web/actions/showMessage/index.js +1 -1
- package/dist/web/actions/showModal/index.js +1 -1
- package/dist/web/components/button/index.js +1 -1
- package/dist/web/components/calendar/index.js +1 -1
- package/dist/web/components/carousel/index.js +1 -1
- package/dist/web/components/chart/common/echarts.js +0 -1
- package/dist/web/components/chart/statisticsCard/index.js +1 -1
- package/dist/web/components/customer-service/customer-service.js +0 -1
- package/dist/web/components/flow/process/constants.js +1 -3
- package/dist/web/components/form/checkbox/index.js +0 -1
- package/dist/web/components/form/enumSelect/index.js +0 -2
- package/dist/web/components/form/form/index.js +1 -1
- package/dist/web/components/form/formcell/index.js +1 -1
- package/dist/web/components/form/input/index.js +1 -1
- package/dist/web/components/form/location/common/mapChoose.js +1 -1
- package/dist/web/components/form/location/common/selectModal.js +1 -1
- package/dist/web/components/form/location/components/LocationH5/location.h5.js +1 -1
- package/dist/web/components/form/location/components/LocationPC/location.PC.js +1 -1
- package/dist/web/components/form/location/index.js +1 -1
- package/dist/web/components/form/radio/index.js +1 -1
- package/dist/web/components/form/select/allTimePicker/calendar.js +1 -1
- package/dist/web/components/form/select/allTimePicker/index.js +1 -1
- package/dist/web/components/form/select/dropdown-select/h5.js +1 -1
- package/dist/web/components/form/select/dropdown-select/pc.js +1 -1
- package/dist/web/components/form/select/index.js +1 -2
- package/dist/web/components/form/select/status/allEmpty.js +1 -1
- package/dist/web/components/form/select/status/empty.js +1 -1
- package/dist/web/components/form/select/status/loading.js +1 -1
- package/dist/web/components/form/select/status/retry.js +1 -1
- package/dist/web/components/form/select/year.js +1 -1
- package/dist/web/components/form/selectMultiple/dropdown-select/h5.js +1 -1
- package/dist/web/components/form/selectMultiple/dropdown-select/pc.js +1 -1
- package/dist/web/components/form/selectMultiple/index.js +0 -1
- package/dist/web/components/form/selectMultiple/status/allEmpty.js +1 -1
- package/dist/web/components/form/selectMultiple/status/empty.js +1 -1
- package/dist/web/components/form/selectMultiple/status/loading.js +1 -1
- package/dist/web/components/form/selectMultiple/status/retry.js +1 -1
- package/dist/web/components/form/switch/index.js +0 -1
- package/dist/web/components/form/textarea/index.js +1 -1
- package/dist/web/components/form/tips/index.js +1 -1
- package/dist/web/components/form/uploader/index.js +1 -1
- package/dist/web/components/form/uploaderFile/index.js +1 -1
- package/dist/web/components/form/userOrgSelect/component/depart-select/index.js +1 -0
- package/dist/web/components/form/userOrgSelect/component/user-select-h5/index.js +1 -1
- package/dist/web/components/form-checkbox/index.js +0 -1
- package/dist/web/components/form-date/index.js +0 -1
- package/dist/web/components/form-depart-tree-select/index.js +0 -1
- package/dist/web/components/form-image-uploader/index.js +0 -1
- package/dist/web/components/form-input/index.js +0 -1
- package/dist/web/components/form-location/index.js +0 -1
- package/dist/web/components/form-multi-region/index.js +0 -1
- package/dist/web/components/form-phone/index.js +0 -1
- package/dist/web/components/form-radio/index.js +0 -1
- package/dist/web/components/form-rich-text/index.js +0 -1
- package/dist/web/components/form-select/index.js +0 -1
- package/dist/web/components/form-select-multiple/index.js +0 -1
- package/dist/web/components/form-switch/index.js +0 -1
- package/dist/web/components/form-text-area/index.js +0 -1
- package/dist/web/components/form-time/index.js +0 -1
- package/dist/web/components/form-upload-file/index.js +0 -1
- package/dist/web/components/form-url/index.js +0 -1
- package/dist/web/components/form-user-tree-select/index.js +0 -1
- package/dist/web/components/formdetail/index.css +9 -0
- package/dist/web/components/formdetail/index.js +1 -1
- package/dist/web/components/graphicCard/index.js +1 -1
- package/dist/web/components/grid/col.js +1 -1
- package/dist/web/components/grid/grid.js +2 -1
- package/dist/web/components/grid/row.js +1 -1
- package/dist/web/components/image/index.js +1 -1
- package/dist/web/components/index.js +31 -2
- package/dist/web/components/link/index.js +1 -1
- package/dist/web/components/listView/index.js +1 -1
- package/dist/web/components/lottery/index.js +3 -5
- package/dist/web/components/modal/modal.h5.js +1 -1
- package/dist/web/components/modal/modal.pc.js +0 -1
- package/dist/web/components/navLayout/index.js +1 -1
- package/dist/web/components/navigationBar/index.js +1 -1
- package/dist/web/components/pageLayout/PageContent/index.js +1 -1
- package/dist/web/components/pageLayout/index.js +1 -1
- package/dist/web/components/phone/index.js +0 -1
- package/dist/web/components/phoneCode/index.js +0 -1
- package/dist/web/components/picker/datePicker.js +0 -1
- package/dist/web/components/picker/picker.js +0 -1
- package/dist/web/components/picker/timePicker.js +0 -1
- package/dist/web/components/qrcode/qr-code.js +0 -1
- package/dist/web/components/richText/index.js +3 -3
- package/dist/web/components/richTextView/index.js +1 -1
- package/dist/web/components/scrollView/index.js +0 -1
- package/dist/web/components/share/index.js +0 -1
- package/dist/web/components/statusContent/index.css +6 -3
- package/dist/web/components/statusContent/index.js +1 -1
- package/dist/web/components/swiper/index.js +2 -2
- package/dist/web/components/table/BaseTable.js +2 -1
- package/dist/web/components/table/ExportFileModalByApi/index.js +1 -1
- package/dist/web/components/table/Form/Location.js +1 -1
- package/dist/web/components/table/ImportFileModal/index.js +1 -1
- package/dist/web/components/table/ImportFileModalByApi/index.js +2 -0
- package/dist/web/components/table/SelectableBlock/index.js +1 -1
- package/dist/web/components/table/UserDepartment/ViewCell.js +1 -1
- package/dist/web/components/table/index.js +1 -1
- package/dist/web/components/tabs/index.js +0 -1
- package/dist/web/components/tabs/tabs.h5.js +1 -0
- package/dist/web/components/text/index.js +1 -1
- package/dist/web/components/uploaderFileView/index.js +1 -1
- package/dist/web/components/uploaderView/index.js +1 -1
- package/dist/web/components/userInfo/index.js +0 -1
- package/dist/web/components/wd-bubble/wd-bubble.js +0 -1
- package/dist/web/components/wd-button/wd-button.js +0 -1
- package/dist/web/components/wd-form/index.js +0 -1
- package/dist/web/components/wd-icon/wd-icon.js +1 -1
- package/dist/web/components/wd-image/index.js +0 -1
- package/dist/web/components/wd-link/wd-link.js +0 -1
- package/dist/web/components/wd-official-account/index.js +1 -1
- package/dist/web/components/wd-table/components/ExportFileModalByApi/ExportFileModalByApi.js +1 -1
- package/dist/web/components/wd-table/components/ExportFileModalByApi/index.js +1 -1
- package/dist/web/components/wd-table/components/FieldRender/Form/Location.js +1 -1
- package/dist/web/components/wd-table/components/FieldRender/UserDepartment/ViewCell.js +1 -1
- package/dist/web/components/wd-table/components/ImportFileModalByApi/index.js +0 -1
- package/dist/web/components/wd-table/wd-table.js +0 -1
- package/dist/web/components/wd-text/wd-text.js +0 -1
- package/dist/web/components/web-view/web-view.js +1 -1
- package/dist/web/components/wedaVideo/index.js +2 -1
- package/dist/web/utils/platform.js +1 -1
- package/dist/web/weda-ui.css +25 -0
- package/package.json +1 -16
- package/dist/configs/components/echart.js +0 -505
- package/dist/web/actions/showMessage/style.js +0 -2
- package/dist/web/actions/showModal/style.js +0 -2
- package/dist/web/components/button/style.js +0 -2
- package/dist/web/components/calendar/style.js +0 -2
- package/dist/web/components/carousel/style.js +0 -2
- package/dist/web/components/chart/statisticsCard/style.js +0 -2
- package/dist/web/components/echart/echart.js +0 -82
- package/dist/web/components/echart/index.js +0 -3
- package/dist/web/components/form/checkbox/style.js +0 -2
- package/dist/web/components/form/enumSelect/style.js +0 -1
- package/dist/web/components/form/form/style.js +0 -2
- package/dist/web/components/form/formcell/style.js +0 -2
- package/dist/web/components/form/input/style.js +0 -2
- package/dist/web/components/form/location/common/style.js +0 -3
- package/dist/web/components/form/location/components/LocationH5/style.js +0 -2
- package/dist/web/components/form/location/components/LocationPC/style.js +0 -2
- package/dist/web/components/form/location/style.js +0 -1
- package/dist/web/components/form/radio/style.js +0 -2
- package/dist/web/components/form/select/allTimePicker/style.js +0 -3
- package/dist/web/components/form/select/dropdown-select/style.js +0 -2
- package/dist/web/components/form/select/moment-locale.js +0 -1
- package/dist/web/components/form/select/status/style.js +0 -2
- package/dist/web/components/form/select/style.js +0 -2
- package/dist/web/components/form/selectMultiple/dropdown-select/style.js +0 -2
- package/dist/web/components/form/selectMultiple/index.css +0 -37
- package/dist/web/components/form/selectMultiple/status/style.js +0 -2
- package/dist/web/components/form/selectMultiple/style.js +0 -2
- package/dist/web/components/form/switch/style.js +0 -2
- package/dist/web/components/form/textarea/style.js +0 -2
- package/dist/web/components/form/tips/style.js +0 -3
- package/dist/web/components/form/uploader/style.js +0 -2
- package/dist/web/components/form/uploaderFile/style.js +0 -2
- package/dist/web/components/form/userOrgSelect/component/user-select-h5/style.js +0 -3
- package/dist/web/components/form-image-uploader/style.js +0 -1
- package/dist/web/components/formdetail/style.js +0 -2
- package/dist/web/components/graphicCard/style.js +0 -2
- package/dist/web/components/grid/style.js +0 -2
- package/dist/web/components/image/style.js +0 -2
- package/dist/web/components/link/style.js +0 -2
- package/dist/web/components/listView/style.js +0 -2
- package/dist/web/components/lottery/style.js +0 -2
- package/dist/web/components/modal/style.js +0 -3
- package/dist/web/components/navLayout/style.js +0 -3
- package/dist/web/components/navigationBar/style.js +0 -2
- package/dist/web/components/pageLayout/PageContent/style.js +0 -2
- package/dist/web/components/pageLayout/style.js +0 -2
- package/dist/web/components/picker/style.js +0 -1
- package/dist/web/components/richText/style.js +0 -2
- package/dist/web/components/richTextView/style.js +0 -2
- package/dist/web/components/scrollView/style.js +0 -1
- package/dist/web/components/statusContent/style.js +0 -2
- package/dist/web/components/style.js +0 -5
- package/dist/web/components/swiper/style.js +0 -2
- package/dist/web/components/table/ExportFileModalByApi/style.js +0 -3
- package/dist/web/components/table/Form/style.js +0 -2
- package/dist/web/components/table/ImportFileModal/style.js +0 -2
- package/dist/web/components/table/ImportFileModalByApi/style.js +0 -3
- package/dist/web/components/table/SelectableBlock/style.js +0 -2
- package/dist/web/components/table/UserDepartment/style.js +0 -2
- package/dist/web/components/table/style.js +0 -4
- package/dist/web/components/tabs/style.js +0 -2
- package/dist/web/components/text/style.js +0 -3
- package/dist/web/components/uploaderFileView/style.js +0 -2
- package/dist/web/components/uploaderView/style.js +0 -2
- package/dist/web/components/wd-official-account/style.js +0 -2
- package/dist/web/components/wd-table/components/ExportFileModalByApi/style.js +0 -2
- package/dist/web/components/wd-table/components/FieldRender/Form/style.js +0 -2
- package/dist/web/components/wd-table/components/FieldRender/UserDepartment/style.js +0 -2
- package/dist/web/components/wd-table/components/ImportFileModalByApi/style.js +0 -1
- package/dist/web/components/web-view/style.js +0 -2
- package/dist/web/components/wedaVideo/style.js +0 -4
|
@@ -1,505 +0,0 @@
|
|
|
1
|
-
import { defineConfig, Type, Tuple } from '../type-utils';
|
|
2
|
-
const containerBodyTemplate = `
|
|
3
|
-
{{#with $self as |$self|}}
|
|
4
|
-
|
|
5
|
-
{{#if (helper_utils '===' $self.attributes.template 'line')}}
|
|
6
|
-
[attributes]
|
|
7
|
-
':option'="{
|
|
8
|
-
// X 轴数据
|
|
9
|
-
xAxis: {
|
|
10
|
-
data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
|
|
11
|
-
},
|
|
12
|
-
// Y轴 系列数据
|
|
13
|
-
series: [
|
|
14
|
-
{
|
|
15
|
-
data: [150, 230, 224, 218, 135, 147, 260],
|
|
16
|
-
type: 'line', // 图表类型: 折线图line
|
|
17
|
-
name: '分数', // 图例名称
|
|
18
|
-
label: { // 图形标签
|
|
19
|
-
show: true,
|
|
20
|
-
formatter: '{c}' // 标签值,通常无需关注。https://echarts.apache.org/zh/option.html#tooltip.formatter
|
|
21
|
-
},
|
|
22
|
-
// 线条颜色样式
|
|
23
|
-
lineStyle: {
|
|
24
|
-
color: '#2A70E2' // 折线颜色
|
|
25
|
-
},
|
|
26
|
-
// 折线拐点标志样式
|
|
27
|
-
itemStyle:{
|
|
28
|
-
color: 'auto' // 拐点颜色,默认
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
],
|
|
32
|
-
yAxis: {
|
|
33
|
-
type: 'value' // Y 轴格式,通常无需修改
|
|
34
|
-
},
|
|
35
|
-
// 标题展示
|
|
36
|
-
title: {
|
|
37
|
-
show: true,
|
|
38
|
-
text: '折线图标题',
|
|
39
|
-
x: 'center', //水平居中
|
|
40
|
-
},
|
|
41
|
-
// 图例展示
|
|
42
|
-
legend: {
|
|
43
|
-
show: true,
|
|
44
|
-
bottom: 0
|
|
45
|
-
},
|
|
46
|
-
}"
|
|
47
|
-
|
|
48
|
-
{{else if (helper_utils '===' $self.attributes.template 'empty')}}
|
|
49
|
-
[attributes]
|
|
50
|
-
':option'="{
|
|
51
|
-
}"
|
|
52
|
-
|
|
53
|
-
{{else if (helper_utils '===' $self.attributes.template 'square')}}
|
|
54
|
-
[attributes]
|
|
55
|
-
':option'="{
|
|
56
|
-
// X 轴数据
|
|
57
|
-
xAxis: {
|
|
58
|
-
data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
|
|
59
|
-
},
|
|
60
|
-
// Y轴 系列数据
|
|
61
|
-
series: [
|
|
62
|
-
{
|
|
63
|
-
data: [150, 230, 224, 218, 135, 147, 260],
|
|
64
|
-
type: 'line', // 图表类型: 折线图line
|
|
65
|
-
name: '分数', // 图例名称
|
|
66
|
-
label: { // 图形标签
|
|
67
|
-
show: true,
|
|
68
|
-
formatter: '{c}' // 标签值,通常无需关注。https://echarts.apache.org/zh/option.html#tooltip.formatter
|
|
69
|
-
},
|
|
70
|
-
// 线条颜色样式
|
|
71
|
-
lineStyle: {
|
|
72
|
-
color: '#2A70E2' // 折线颜色
|
|
73
|
-
},
|
|
74
|
-
// 面积颜色样式
|
|
75
|
-
areaStyle: {
|
|
76
|
-
opacity: 0.7, // 透明度,值为0-1
|
|
77
|
-
color: '#2A70E2' // 面积颜色
|
|
78
|
-
},
|
|
79
|
-
// 折线拐点标志样式
|
|
80
|
-
itemStyle:{
|
|
81
|
-
color: 'auto' // 拐点颜色,默认
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
],
|
|
85
|
-
yAxis: {
|
|
86
|
-
type: 'value' // Y 轴格式,通常无需修改
|
|
87
|
-
},
|
|
88
|
-
// 标题展示
|
|
89
|
-
title: {
|
|
90
|
-
show: true,
|
|
91
|
-
text: '折线图标题',
|
|
92
|
-
x: 'center', //水平居中
|
|
93
|
-
},
|
|
94
|
-
// 图例展示
|
|
95
|
-
legend: {
|
|
96
|
-
show: true,
|
|
97
|
-
bottom: 0
|
|
98
|
-
},
|
|
99
|
-
}"
|
|
100
|
-
|
|
101
|
-
{{else if (helper_utils '===' $self.attributes.template 'bar')}}
|
|
102
|
-
[attributes]
|
|
103
|
-
':option'="{
|
|
104
|
-
// X 轴数据
|
|
105
|
-
xAxis: {
|
|
106
|
-
data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
|
|
107
|
-
},
|
|
108
|
-
// Y轴 系列数据
|
|
109
|
-
series: [
|
|
110
|
-
{
|
|
111
|
-
data: [150, 230, 224, 218, 135, 147, 260],
|
|
112
|
-
type: 'bar', // 图表类型:柱状图bar
|
|
113
|
-
name: '分数', // 图例名称
|
|
114
|
-
label: { // 图形标签
|
|
115
|
-
show: true,
|
|
116
|
-
formatter: '{c}' // 标签值,通常无需关注。https://echarts.apache.org/zh/option.html#tooltip.formatter
|
|
117
|
-
},
|
|
118
|
-
// 线条颜色样式
|
|
119
|
-
lineStyle: {
|
|
120
|
-
color: '#2A70E2' // 折线颜色
|
|
121
|
-
},
|
|
122
|
-
// 折线拐点标志样式
|
|
123
|
-
itemStyle:{
|
|
124
|
-
color: 'auto' // 拐点颜色,默认
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
],
|
|
128
|
-
yAxis: {
|
|
129
|
-
type: 'value' // Y 轴格式,通常无需修改
|
|
130
|
-
},
|
|
131
|
-
// 标题展示
|
|
132
|
-
title: {
|
|
133
|
-
show: true,
|
|
134
|
-
text: '柱状图标题',
|
|
135
|
-
x: 'center', //水平居中
|
|
136
|
-
},
|
|
137
|
-
// 图例展示
|
|
138
|
-
legend: {
|
|
139
|
-
show: true,
|
|
140
|
-
bottom: 0
|
|
141
|
-
},
|
|
142
|
-
}"
|
|
143
|
-
|
|
144
|
-
{{else if (helper_utils '===' $self.attributes.template 'pie')}}
|
|
145
|
-
[attributes]
|
|
146
|
-
':option'="{
|
|
147
|
-
// 饼图数据
|
|
148
|
-
series: [
|
|
149
|
-
{
|
|
150
|
-
type: 'pie', //图表类型:饼状图
|
|
151
|
-
data: [
|
|
152
|
-
{
|
|
153
|
-
value: 1080,
|
|
154
|
-
name: '一月份',
|
|
155
|
-
itemStyle: {
|
|
156
|
-
color: '#587' //饼图颜色
|
|
157
|
-
}
|
|
158
|
-
},
|
|
159
|
-
{ value: 735, name: '二月份' },
|
|
160
|
-
{ value: 580, name: '三月份' },
|
|
161
|
-
{ value: 484, name: '四月份' },
|
|
162
|
-
{ value: 300, name: '五月份' }
|
|
163
|
-
],
|
|
164
|
-
// 图形上的文本标签
|
|
165
|
-
label: {
|
|
166
|
-
show:true,
|
|
167
|
-
position: 'outside' // outside|inside|inner|center
|
|
168
|
-
} ,
|
|
169
|
-
radius: '50%', //半径
|
|
170
|
-
}
|
|
171
|
-
],
|
|
172
|
-
title: {
|
|
173
|
-
text: '饼状图标题',
|
|
174
|
-
x: 'center'
|
|
175
|
-
},
|
|
176
|
-
tooltip: {
|
|
177
|
-
trigger: 'item'
|
|
178
|
-
},
|
|
179
|
-
legend: {
|
|
180
|
-
show: true,
|
|
181
|
-
bottom: 0
|
|
182
|
-
},
|
|
183
|
-
}"
|
|
184
|
-
|
|
185
|
-
{{else if (helper_utils '===' $self.attributes.template 'scatter')}}
|
|
186
|
-
[attributes]
|
|
187
|
-
':option'="{
|
|
188
|
-
// 图表数据
|
|
189
|
-
series: [
|
|
190
|
-
{
|
|
191
|
-
type: 'scatter', //图表类型:散点(气泡)图
|
|
192
|
-
data: [
|
|
193
|
-
[0, 2], // 横纵坐标的值 [x,y]
|
|
194
|
-
[10.0, 8.04],
|
|
195
|
-
[8.07, 6.95],
|
|
196
|
-
[13.0, 7.58],
|
|
197
|
-
[9.05, 8.81],
|
|
198
|
-
[11.0, 8.33],
|
|
199
|
-
[14.0, 7.66],
|
|
200
|
-
[13.4, 6.81],
|
|
201
|
-
[10.0, 6.33],
|
|
202
|
-
[14.0, 8.96],
|
|
203
|
-
[12.5, 6.82],
|
|
204
|
-
[9.15, 7.2],
|
|
205
|
-
[11.5, 7.2],
|
|
206
|
-
[3.03, 4.23],
|
|
207
|
-
[12.2, 7.83],
|
|
208
|
-
[2.02, 4.47],
|
|
209
|
-
[1.05, 3.33],
|
|
210
|
-
[4.05, 4.96],
|
|
211
|
-
[6.03, 7.24],
|
|
212
|
-
[12.0, 6.26],
|
|
213
|
-
[12.0, 8.84],
|
|
214
|
-
[7.08, 5.82],
|
|
215
|
-
[5.02, 5.68]
|
|
216
|
-
],
|
|
217
|
-
name: '系列1',
|
|
218
|
-
color: '#2A70E2', //标记颜色
|
|
219
|
-
symbolSize: 20 // 标记大小
|
|
220
|
-
}
|
|
221
|
-
],
|
|
222
|
-
xAxis: {},
|
|
223
|
-
yAxis: {},
|
|
224
|
-
title: {
|
|
225
|
-
text: '散点图标题',
|
|
226
|
-
x: 'center'
|
|
227
|
-
},
|
|
228
|
-
legend: {
|
|
229
|
-
show: true,
|
|
230
|
-
bottom: 0
|
|
231
|
-
}
|
|
232
|
-
}"
|
|
233
|
-
|
|
234
|
-
{{else if (helper_utils '===' $self.attributes.template 'gauge')}}
|
|
235
|
-
[attributes]
|
|
236
|
-
':option'="{
|
|
237
|
-
// 仪表盘数据
|
|
238
|
-
series: [
|
|
239
|
-
{
|
|
240
|
-
// 数据
|
|
241
|
-
data: [
|
|
242
|
-
{
|
|
243
|
-
value: 50,
|
|
244
|
-
name: '得分'
|
|
245
|
-
}
|
|
246
|
-
],
|
|
247
|
-
detail: {
|
|
248
|
-
formatter: '{value}'
|
|
249
|
-
},
|
|
250
|
-
name: '比赛结果',//图表名称,在图表提示中获取
|
|
251
|
-
type: 'gauge',// 图表类型:仪表盘gauge
|
|
252
|
-
}
|
|
253
|
-
],
|
|
254
|
-
// 图表提示
|
|
255
|
-
tooltip: {
|
|
256
|
-
formatter: '{a}{b} : {c}'
|
|
257
|
-
},
|
|
258
|
-
}"
|
|
259
|
-
|
|
260
|
-
{{/if}}
|
|
261
|
-
{{/with}}
|
|
262
|
-
`;
|
|
263
|
-
const data = Type.Object({
|
|
264
|
-
template: Type.String({
|
|
265
|
-
'x-index': 10,
|
|
266
|
-
title: '模板',
|
|
267
|
-
default: 'square',
|
|
268
|
-
description: '预设模板',
|
|
269
|
-
enum: Tuple([
|
|
270
|
-
{
|
|
271
|
-
label: '仪表盘',
|
|
272
|
-
value: 'gauge',
|
|
273
|
-
tooltip: '仪表盘',
|
|
274
|
-
src: 'https://cloudcache.tencent-cloud.com/qcloud/ui/static/static_source_business/d7d2fabe-57c8-46e7-8e07-1af6c32d171b.png',
|
|
275
|
-
},
|
|
276
|
-
{
|
|
277
|
-
label: '面积图',
|
|
278
|
-
value: 'square',
|
|
279
|
-
tooltip: '面积图',
|
|
280
|
-
src: 'https://cloudcache.tencent-cloud.com/qcloud/ui/static/static_source_business/18eb13e5-d60c-4b01-9044-5f14c3923445.png',
|
|
281
|
-
},
|
|
282
|
-
{
|
|
283
|
-
label: '散点图',
|
|
284
|
-
value: 'scatter',
|
|
285
|
-
tooltip: '散点图',
|
|
286
|
-
src: 'https://cloudcache.tencent-cloud.com/qcloud/ui/static/static_source_business/f14b0a64-6aaf-4d66-8245-9a1cb4f23a44.png',
|
|
287
|
-
},
|
|
288
|
-
{
|
|
289
|
-
label: '折线图',
|
|
290
|
-
value: 'line',
|
|
291
|
-
tooltip: '折线图',
|
|
292
|
-
src: 'https://cloudcache.tencent-cloud.com/qcloud/ui/static/static_source_business/55bf0f3d-fd6f-402f-8660-890225631bfa.png',
|
|
293
|
-
},
|
|
294
|
-
{
|
|
295
|
-
label: '柱状图',
|
|
296
|
-
value: 'bar',
|
|
297
|
-
tooltip: '柱状图',
|
|
298
|
-
src: 'https://cloudcache.tencent-cloud.com/qcloud/ui/static/static_source_business/9e39a145-af61-41ff-bf80-dd15c5d1adf9.png',
|
|
299
|
-
},
|
|
300
|
-
{
|
|
301
|
-
label: '饼图',
|
|
302
|
-
value: 'pie',
|
|
303
|
-
tooltip: '饼图',
|
|
304
|
-
src: 'https://cloudcache.tencent-cloud.com/qcloud/ui/static/static_source_business/d4586440-ab84-4c4e-bf06-2621523d2a3f.png',
|
|
305
|
-
},
|
|
306
|
-
{
|
|
307
|
-
label: '不使用模板',
|
|
308
|
-
value: 'empty',
|
|
309
|
-
tooltip: '不使用模板',
|
|
310
|
-
src: 'https://cloudcache.tencent-cloud.com/qcloud/ui/static/static_source_business/924e8472-9c52-46bc-bae7-e1ec30b92974.svg',
|
|
311
|
-
},
|
|
312
|
-
]),
|
|
313
|
-
'x-component': 'data-sources-template-selector',
|
|
314
|
-
'x-props': {
|
|
315
|
-
'data-hidebind': true,
|
|
316
|
-
},
|
|
317
|
-
'x-category': '基础',
|
|
318
|
-
}),
|
|
319
|
-
option: Type.Unknown({
|
|
320
|
-
type: 'object',
|
|
321
|
-
title: '图表配置项(option)',
|
|
322
|
-
description: '',
|
|
323
|
-
'x-helper-text': '通用图表可配置多种Echarts的图表,Option的type属性指定图表类型。您可以直接查看[Echarts官方图表示例](https://echarts.apache.org/examples/zh/index.html#chart-type-line),快速配置不同类型的图表。详见[通用图表使用文档](https://docs.cloudbase.net/lowcode/components/wedaUI/src/docs/compsdocs/chart/Chart#属性说明)',
|
|
324
|
-
'x-index': 20,
|
|
325
|
-
'x-component': 'jsontext',
|
|
326
|
-
'x-component-props': {
|
|
327
|
-
autoSize: { minRows: 2, maxRows: 10 },
|
|
328
|
-
},
|
|
329
|
-
'x-category': '基础',
|
|
330
|
-
default: {},
|
|
331
|
-
}),
|
|
332
|
-
dark: Type.Boolean({
|
|
333
|
-
default: false,
|
|
334
|
-
title: '深色模式',
|
|
335
|
-
'x-index': 30,
|
|
336
|
-
'x-category': '基础',
|
|
337
|
-
}),
|
|
338
|
-
opts: Type.Object({}, {
|
|
339
|
-
title: 'chart初始化参数',
|
|
340
|
-
'x-index': 40,
|
|
341
|
-
'x-category': '高级属性',
|
|
342
|
-
'x-component': 'jsontext',
|
|
343
|
-
'x-component-props': {
|
|
344
|
-
autoSize: { minRows: 2, maxRows: 10 },
|
|
345
|
-
},
|
|
346
|
-
'x-helper-text': '可配置render渲染模式等,对应[图表初始化init方法的opts配置项](https://echarts.apache.org/zh/api.html#echarts.init)',
|
|
347
|
-
default: {},
|
|
348
|
-
}),
|
|
349
|
-
});
|
|
350
|
-
const properties = Type.Object({
|
|
351
|
-
echartsInstance: Type.Unknown({
|
|
352
|
-
type: 'object',
|
|
353
|
-
title: '图表实例',
|
|
354
|
-
}),
|
|
355
|
-
});
|
|
356
|
-
// export default
|
|
357
|
-
const config = defineConfig({
|
|
358
|
-
$schema: 'https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/schema/lcds_component.json',
|
|
359
|
-
// 属性定义
|
|
360
|
-
data,
|
|
361
|
-
// 只读属性定义
|
|
362
|
-
properties,
|
|
363
|
-
// 样式API
|
|
364
|
-
classes: [
|
|
365
|
-
{
|
|
366
|
-
name: '根元素',
|
|
367
|
-
selector: '.wd-chart',
|
|
368
|
-
description: '树组件根元素',
|
|
369
|
-
},
|
|
370
|
-
{
|
|
371
|
-
name: 'PC 端按钮根元素',
|
|
372
|
-
selector: '.wd-pc-chart',
|
|
373
|
-
description: '可以为 PC 端的编写样式',
|
|
374
|
-
},
|
|
375
|
-
{
|
|
376
|
-
name: 'H5 端按钮根元素',
|
|
377
|
-
selector: '.wd-h5-chart',
|
|
378
|
-
description: '可以为 H5 端的编写样式',
|
|
379
|
-
},
|
|
380
|
-
],
|
|
381
|
-
// 组件方法
|
|
382
|
-
methods: [
|
|
383
|
-
{
|
|
384
|
-
name: 'setOption',
|
|
385
|
-
label: '设置图表配置',
|
|
386
|
-
'x-platforms': ['MOBILEWEB', 'PCWEB'],
|
|
387
|
-
description: '设置图表实例的配置项以及数据,万能接口,所有参数和数据的修改都可以通过 setOption 完成',
|
|
388
|
-
params: Type.Object({
|
|
389
|
-
option: Type.Unknown({
|
|
390
|
-
type: 'object',
|
|
391
|
-
title: '图表配置',
|
|
392
|
-
}),
|
|
393
|
-
opts: Type.Optional(Type.Object({
|
|
394
|
-
notMerge: Type.Optional(Type.Boolean()),
|
|
395
|
-
replaceMerge: Type.Optional(Type.Union([Type.String(), Type.Array(Type.String())])),
|
|
396
|
-
lazyUpdate: Type.Optional(Type.Boolean()),
|
|
397
|
-
})),
|
|
398
|
-
}),
|
|
399
|
-
},
|
|
400
|
-
{
|
|
401
|
-
name: 'setTheme',
|
|
402
|
-
label: '设置主题',
|
|
403
|
-
'x-platforms': ['MOBILEWEB', 'PCWEB'],
|
|
404
|
-
description: '设置图表实例的主题',
|
|
405
|
-
params: Type.Object({
|
|
406
|
-
theme: Type.String(),
|
|
407
|
-
}),
|
|
408
|
-
},
|
|
409
|
-
],
|
|
410
|
-
// 组件对外暴露事件
|
|
411
|
-
events: [
|
|
412
|
-
{
|
|
413
|
-
title: '单击',
|
|
414
|
-
name: 'click',
|
|
415
|
-
description: '',
|
|
416
|
-
'x-platforms': ['MOBILEWEB', 'PCWEB'],
|
|
417
|
-
detail: Type.Unknown(),
|
|
418
|
-
},
|
|
419
|
-
{
|
|
420
|
-
title: '双击',
|
|
421
|
-
name: 'dblclick',
|
|
422
|
-
description: '',
|
|
423
|
-
'x-platforms': ['MOBILEWEB', 'PCWEB'],
|
|
424
|
-
detail: Type.Unknown(),
|
|
425
|
-
},
|
|
426
|
-
],
|
|
427
|
-
isContainer: true,
|
|
428
|
-
// 组件元信息
|
|
429
|
-
meta: {
|
|
430
|
-
name: 'Chart',
|
|
431
|
-
// 组件别名,用于生成组件 id,例如 Icon1
|
|
432
|
-
componentName: 'Chart',
|
|
433
|
-
title: '通用图表',
|
|
434
|
-
description: '通用图表是一个万能图表,可配置出多种图表如折线图、饼状图、面积图、地图、漏斗图、仪表盘等。',
|
|
435
|
-
icon: '../../icons/Chart.svg',
|
|
436
|
-
category: '图表',
|
|
437
|
-
categoryOrder: 600,
|
|
438
|
-
componentOrder: 570,
|
|
439
|
-
platform: ['MOBILEWEB', 'PCWEB'],
|
|
440
|
-
visible: ['APP'],
|
|
441
|
-
docsUrl: 'https://docs.cloudbase.net/lowcode/components/wedaUI/src/docs/compsdocs/chart/Chart',
|
|
442
|
-
// 快捷编辑时展示在编辑区的属性
|
|
443
|
-
// shortcut: {
|
|
444
|
-
// props: ['line', 'checkable'],
|
|
445
|
-
// },
|
|
446
|
-
group: {
|
|
447
|
-
['基础']: {
|
|
448
|
-
'x-index': 1,
|
|
449
|
-
expand: true,
|
|
450
|
-
},
|
|
451
|
-
['高级属性']: {
|
|
452
|
-
'x-index': 2,
|
|
453
|
-
expand: true,
|
|
454
|
-
},
|
|
455
|
-
},
|
|
456
|
-
templates: [
|
|
457
|
-
{
|
|
458
|
-
when: '$attached',
|
|
459
|
-
to: '$children',
|
|
460
|
-
body: containerBodyTemplate,
|
|
461
|
-
},
|
|
462
|
-
{
|
|
463
|
-
when: 'template',
|
|
464
|
-
to: '$children',
|
|
465
|
-
body: containerBodyTemplate,
|
|
466
|
-
},
|
|
467
|
-
],
|
|
468
|
-
inlineStyleForm: {
|
|
469
|
-
fontSize: {
|
|
470
|
-
visible: false,
|
|
471
|
-
},
|
|
472
|
-
color: {
|
|
473
|
-
visible: false,
|
|
474
|
-
},
|
|
475
|
-
fontWeight: {
|
|
476
|
-
visible: false,
|
|
477
|
-
},
|
|
478
|
-
lineHeight: {
|
|
479
|
-
visible: false,
|
|
480
|
-
},
|
|
481
|
-
justifyContent: {
|
|
482
|
-
visible: false,
|
|
483
|
-
},
|
|
484
|
-
flexDirection: {
|
|
485
|
-
visible: false,
|
|
486
|
-
},
|
|
487
|
-
border: {
|
|
488
|
-
visible: false,
|
|
489
|
-
},
|
|
490
|
-
background: {
|
|
491
|
-
visible: false,
|
|
492
|
-
},
|
|
493
|
-
boxShadow: {
|
|
494
|
-
visible: false,
|
|
495
|
-
},
|
|
496
|
-
opacity: {
|
|
497
|
-
visible: false,
|
|
498
|
-
},
|
|
499
|
-
alignItems: {
|
|
500
|
-
visible: false,
|
|
501
|
-
},
|
|
502
|
-
},
|
|
503
|
-
},
|
|
504
|
-
});
|
|
505
|
-
export default config;
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
/* eslint-disable max-lines */
|
|
3
|
-
import { forwardRef, useImperativeHandle, useState, useCallback, useEffect, } from 'react';
|
|
4
|
-
import classNames from '../../utils/classnames';
|
|
5
|
-
import { useConfig } from '../../utils/config-context';
|
|
6
|
-
import { usePlatform } from '../../utils/platform';
|
|
7
|
-
let ReactEcharts = null;
|
|
8
|
-
const getEchartInstance = async () => {
|
|
9
|
-
if (ReactEcharts)
|
|
10
|
-
return ReactEcharts;
|
|
11
|
-
const { default: _ } = await import(
|
|
12
|
-
/* webpackChunkName: "echarts-for-react" */ 'echarts-for-react');
|
|
13
|
-
ReactEcharts = _;
|
|
14
|
-
};
|
|
15
|
-
export const Echart = forwardRef(function Echart(props, ref) {
|
|
16
|
-
const { className = '', style, id } = props;
|
|
17
|
-
const platform = usePlatform();
|
|
18
|
-
// 样式
|
|
19
|
-
const { classPrefix } = useConfig();
|
|
20
|
-
// 响应式css api
|
|
21
|
-
const platformCss = `${classPrefix}-${platform}-chart`;
|
|
22
|
-
const classes = {
|
|
23
|
-
[`${classPrefix}-chart`]: true,
|
|
24
|
-
[platformCss]: true,
|
|
25
|
-
};
|
|
26
|
-
const [init, setInit] = useState(false);
|
|
27
|
-
// 图表实例
|
|
28
|
-
const [echartsInstance, setEchartsInstance] = useState(null);
|
|
29
|
-
// 主题
|
|
30
|
-
const [themeState, setThemeState] = useState('');
|
|
31
|
-
useEffect(() => {
|
|
32
|
-
getEchartInstance().then(() => setInit(true));
|
|
33
|
-
}, []);
|
|
34
|
-
/**
|
|
35
|
-
* 设置图表配置
|
|
36
|
-
*/
|
|
37
|
-
const setOption = useCallback((opts) => {
|
|
38
|
-
if (echartsInstance && opts)
|
|
39
|
-
echartsInstance.setOption(opts);
|
|
40
|
-
}, [echartsInstance]);
|
|
41
|
-
/**
|
|
42
|
-
* 设置主题
|
|
43
|
-
*/
|
|
44
|
-
const setTheme = useCallback((opts) => {
|
|
45
|
-
if (echartsInstance && (opts === null || opts === void 0 ? void 0 : opts.theme))
|
|
46
|
-
setThemeState(opts.theme);
|
|
47
|
-
}, [echartsInstance]);
|
|
48
|
-
// Widget API,挂载组件只读属性和组件方法
|
|
49
|
-
useImperativeHandle(ref, () => {
|
|
50
|
-
return {
|
|
51
|
-
setOption,
|
|
52
|
-
setTheme,
|
|
53
|
-
echartsInstance,
|
|
54
|
-
};
|
|
55
|
-
}, [echartsInstance, setOption, setTheme]);
|
|
56
|
-
/**
|
|
57
|
-
* 获取图表实例
|
|
58
|
-
* @param instance
|
|
59
|
-
*/
|
|
60
|
-
const onChartReadyCallback = (instance) => {
|
|
61
|
-
setEchartsInstance(instance);
|
|
62
|
-
};
|
|
63
|
-
/**
|
|
64
|
-
* 单击
|
|
65
|
-
*/
|
|
66
|
-
const click = useCallback((...args) => {
|
|
67
|
-
var _a;
|
|
68
|
-
(_a = props.events) === null || _a === void 0 ? void 0 : _a.click(...args);
|
|
69
|
-
}, [props.events]);
|
|
70
|
-
/**
|
|
71
|
-
* 双击
|
|
72
|
-
*/
|
|
73
|
-
const dblclick = useCallback((...args) => {
|
|
74
|
-
var _a;
|
|
75
|
-
(_a = props.events) === null || _a === void 0 ? void 0 : _a.dblclick(...args);
|
|
76
|
-
}, [props.events]);
|
|
77
|
-
const onEvents = {
|
|
78
|
-
click,
|
|
79
|
-
dblclick,
|
|
80
|
-
};
|
|
81
|
-
return (_jsx("div", { id: id, style: { width: '100%', ...style }, "data-testid": "wd-chart-test", children: init && (_jsx(ReactEcharts, { style: style, className: classNames(classes, className), option: props.option || {}, theme: themeState || (props.dark ? 'dark' : 'auto'), opts: props.opts, onChartReady: onChartReadyCallback, onEvents: onEvents })) }));
|
|
82
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '../../style';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.css';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import 'moment/locale/zh-cn';
|