@cloudbase/weda-ui 0.2.16 → 1.0.24
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/README.md +41 -169
- package/package.json +23 -11
- package/src/configs/components/calendar.json +4 -1
- package/src/configs/components/chart/bar.json +724 -0
- package/src/configs/components/chart/line.json +679 -0
- package/src/configs/components/chart/pie.json +497 -0
- package/src/configs/components/chart/statisticsCard.json +61 -13
- package/src/configs/components/container.json +7 -2
- package/src/configs/components/dataView.json +21 -6
- package/src/configs/components/form/checkbox.json +97 -5
- package/src/configs/components/form/radio.json +96 -4
- package/src/configs/components/form/select.json +245 -11
- package/src/configs/components/graphicCard.json +84 -73
- package/src/configs/components/image.json +7 -2
- package/src/configs/components/link.json +19 -3
- package/src/configs/components/listView.json +65 -18
- package/src/configs/components/lottery.json +151 -0
- package/src/configs/components/modal.json +37 -5
- package/src/configs/components/navLayout.json +87 -75
- package/src/configs/components/navigationBar.json +59 -0
- package/src/configs/components/richtextview.json +4 -1
- package/src/configs/components/scrollVeiw.json +74 -22
- package/src/configs/components/swiper.json +4 -1
- package/src/configs/components/tabs.json +51 -8
- package/src/configs/components/text.json +33 -25
- package/src/configs/components/wxOpenApi/phone.json +141 -0
- package/src/configs/components/wxOpenApi/phoneCode.json +121 -0
- package/src/configs/components/wxOpenApi/share.json +167 -0
- package/src/configs/components/wxOpenApi/userInfo.json +174 -0
- package/src/configs/index.js +20 -0
- package/src/index.js +2 -0
- package/src/mp/components/button/index.wxml +1 -2
- package/src/mp/components/chart/bar/index.js +258 -0
- package/src/mp/components/chart/bar/index.json +6 -0
- package/src/mp/components/chart/bar/index.wxml +3 -0
- package/src/mp/components/chart/bar/index.wxss +9 -0
- package/src/mp/components/chart/common/config/bar.js +50 -0
- package/src/mp/components/chart/common/config/global.js +16 -0
- package/src/mp/components/chart/common/config/line.js +48 -0
- package/src/mp/components/chart/common/config/pie.js +36 -0
- package/src/mp/components/chart/common/core/eChartBar.js +263 -0
- package/src/mp/components/chart/common/core/eChartBase.js +375 -0
- package/src/mp/components/chart/common/core/eChartLine.js +229 -0
- package/src/mp/components/chart/common/core/eChartPie.js +166 -0
- package/src/mp/components/chart/common/lib/echarts.min.js +18 -0
- package/src/mp/components/chart/ec-canvas/ec-canvas.js +277 -0
- package/src/mp/components/chart/ec-canvas/ec-canvas.json +4 -0
- package/src/mp/components/chart/ec-canvas/ec-canvas.wxml +4 -0
- package/src/mp/components/chart/ec-canvas/ec-canvas.wxss +4 -0
- package/src/mp/components/chart/ec-canvas/wx-canvas.js +107 -0
- package/src/mp/components/chart/line/index.js +247 -0
- package/src/mp/components/chart/line/index.json +6 -0
- package/src/mp/components/chart/line/index.wxml +3 -0
- package/src/mp/components/chart/line/index.wxss +9 -0
- package/src/mp/components/chart/pie/index.js +182 -0
- package/src/mp/components/chart/pie/index.json +6 -0
- package/src/mp/components/chart/pie/index.wxml +4 -0
- package/src/mp/components/chart/pie/index.wxss +9 -0
- package/src/mp/components/chart/statisticsCard/index.js +33 -6
- package/src/mp/components/form/checkbox/index.js +41 -2
- package/src/mp/components/form/checkbox/index.wxml +1 -1
- package/src/mp/components/form/form/index.wxml +1 -2
- package/src/mp/components/form/input/index.js +1 -1
- package/src/mp/components/form/location/index.js +43 -2
- package/src/mp/components/form/radio/index.js +38 -0
- package/src/mp/components/form/select/index.js +348 -40
- package/src/mp/components/form/select/index.wxml +21 -6
- package/src/mp/components/form/select/region/index.js +101 -0
- package/src/mp/components/form/textarea/index.wxml +6 -5
- package/src/mp/components/form/uploader/index.js +76 -44
- package/src/mp/components/form/uploader/index.wxml +15 -3
- package/src/mp/components/form/uploaderFile/index.js +61 -29
- package/src/mp/components/graphicCard/index.js +26 -28
- package/src/mp/components/listView/index.js +52 -64
- package/src/mp/components/listView/index.wxml +2 -2
- package/src/mp/components/listView/index.wxss +5 -0
- package/src/mp/components/lottery/index.js +270 -0
- package/src/mp/components/lottery/index.json +4 -0
- package/src/mp/components/lottery/index.wxml +43 -0
- package/src/mp/components/lottery/index.wxss +317 -0
- package/src/mp/components/navLayout/index.js +3 -3
- package/src/mp/components/navigationBar/index.js +193 -0
- package/src/mp/components/navigationBar/index.json +6 -0
- package/src/mp/components/navigationBar/index.wxml +88 -0
- package/src/mp/components/navigationBar/index.wxss +1257 -0
- package/src/mp/components/tabs/index.js +7 -2
- package/src/mp/components/tabs/index.wxml +2 -1
- package/src/mp/components/text/index.js +0 -25
- package/src/mp/components/text/index.wxml +3 -3
- package/src/mp/components/wxOpenApi/phone/index.js +117 -0
- package/src/mp/components/wxOpenApi/phone/index.json +4 -0
- package/src/mp/components/wxOpenApi/phone/index.wxml +15 -0
- package/src/mp/components/wxOpenApi/phone/index.wxss +22 -0
- package/src/mp/components/wxOpenApi/phoneCode/index.js +89 -0
- package/src/mp/components/wxOpenApi/phoneCode/index.json +4 -0
- package/src/mp/components/wxOpenApi/phoneCode/index.wxml +15 -0
- package/src/mp/components/wxOpenApi/phoneCode/index.wxss +22 -0
- package/src/mp/components/wxOpenApi/share/index.js +117 -0
- package/src/mp/components/wxOpenApi/share/index.json +4 -0
- package/src/mp/components/wxOpenApi/share/index.wxml +15 -0
- package/src/mp/components/wxOpenApi/share/index.wxss +22 -0
- package/src/mp/components/wxOpenApi/userInfo/index.js +88 -0
- package/src/mp/components/wxOpenApi/userInfo/index.json +4 -0
- package/src/mp/components/wxOpenApi/userInfo/index.wxml +14 -0
- package/src/mp/components/wxOpenApi/userInfo/index.wxss +22 -0
- package/src/mp/index.json +10 -1
- package/src/mp/style/weda-ui.wxss +2 -0
- package/src/mp/utils/constant.js +15 -0
- package/src/mp/utils/destr.js +48 -0
- package/src/mp/utils/lodash.js +2 -0
- package/src/mp/utils/platform.js +25 -0
- package/src/mp/utils/tcb.js +44 -0
- package/src/setupTests.js +2 -1
- package/src/web/components/button/index.css +8 -1
- package/src/web/components/button/index.tsx +3 -2
- package/src/web/components/chart/bar/index.tsx +140 -0
- package/src/web/components/chart/common/config/bar.js +49 -0
- package/src/web/components/chart/common/config/global.js +16 -0
- package/src/web/components/chart/common/config/line.js +50 -0
- package/src/web/components/chart/common/config/pie.js +37 -0
- package/src/web/components/chart/common/core/eChartBar.js +265 -0
- package/src/web/components/chart/common/core/eChartBase.ts +383 -0
- package/src/web/components/chart/common/core/eChartLine.js +231 -0
- package/src/web/components/chart/common/core/eChartPie.js +170 -0
- package/src/web/components/chart/common/core/type.ts +34 -0
- package/src/web/components/chart/common/echart.css +106 -0
- package/src/web/components/chart/common/echarts.ts +33 -0
- package/src/web/components/chart/common/useChart.tsx +69 -0
- package/src/web/components/chart/line/index.tsx +136 -0
- package/src/web/components/chart/pie/index.tsx +99 -0
- package/src/web/components/chart/statisticsCard/index.tsx +29 -8
- package/src/web/components/form/checkbox/index.tsx +61 -23
- package/src/web/components/form/formcell/index.tsx +10 -5
- package/src/web/components/form/location/components/LocationH5/location.h5.jsx +3 -3
- package/src/web/components/form/location/components/LocationPC/location.PC.jsx +2 -2
- package/src/web/components/form/radio/index.tsx +90 -53
- package/src/web/components/form/select/h5.tsx +371 -72
- package/src/web/components/form/select/index.css +10 -0
- package/src/web/components/form/select/index.tsx +392 -145
- package/src/web/components/form/select/region/index.ts +122 -31
- package/src/web/components/form/select/time.jsx +90 -0
- package/src/web/components/form/select/year.tsx +170 -0
- package/src/web/components/form/tips/index.css +4 -0
- package/src/web/components/form/tips/index.tsx +4 -3
- package/src/web/components/form/uploader/uploader.h5.tsx +28 -19
- package/src/web/components/form/uploader/uploader.pc.tsx +17 -20
- package/src/web/components/form/uploaderFile/uploadFile.h5.tsx +48 -44
- package/src/web/components/form/uploaderFile/uploadFile.pc.tsx +28 -26
- package/src/web/components/graphicCard/index.css +1 -5
- package/src/web/components/graphicCard/index.tsx +4 -3
- package/src/web/components/image/image.tsx +1 -1
- package/src/web/components/image/index.tsx +1 -1
- package/src/web/components/index.js +13 -2
- package/src/web/components/link/index.tsx +6 -3
- package/src/web/components/listView/index.css +4 -0
- package/src/web/components/listView/index.tsx +10 -18
- package/src/web/components/lottery/index.css +327 -0
- package/src/web/components/lottery/index.tsx +567 -0
- package/src/web/components/lottery/lotteryUtil.ts +130 -0
- package/src/web/components/modal/index.tsx +3 -1
- package/src/web/components/navigationBar/chevron-right--double.svg +3 -0
- package/src/web/components/navigationBar/common.tsx +198 -0
- package/src/web/components/navigationBar/h5Menu.tsx +179 -0
- package/src/web/components/navigationBar/horizontalMenu.tsx +200 -0
- package/src/web/components/navigationBar/index.css +762 -0
- package/src/web/components/navigationBar/index.tsx +231 -0
- package/src/web/components/navigationBar/type.d.ts +111 -0
- package/src/web/components/navigationBar/verticalMenu.tsx +81 -0
- package/src/web/components/phone/index.css +0 -0
- package/src/web/components/phone/index.tsx +22 -0
- package/src/web/components/phoneCode/index.css +0 -0
- package/src/web/components/phoneCode/index.tsx +22 -0
- package/src/web/components/richTextView/index.tsx +3 -5
- package/src/web/components/share/index.css +0 -0
- package/src/web/components/share/index.tsx +38 -0
- package/src/web/components/tabs/index.tsx +2 -0
- package/src/web/components/tabs/tabs.h5.tsx +43 -33
- package/src/web/components/tabs/tabs.pc.tsx +23 -10
- package/src/web/components/text/index.tsx +6 -14
- package/src/web/components/userInfo/index.css +0 -0
- package/src/web/components/userInfo/index.tsx +30 -0
- package/src/web/utils/{constant.js → constant.ts} +17 -2
- package/src/web/utils/lodash.ts +2 -0
- package/src/web/utils/platform.js +10 -1
- package/src/web/utils/tcb.js +20 -6
- package/src/web/weda-ui.css +2 -0
- package/CHANGELOG.md +0 -240
- package/src/.DS_Store +0 -0
- package/src/configs/.DS_Store +0 -0
- package/src/mp/.gitignore +0 -10
- package/src/web/.DS_Store +0 -0
- package/src/web/components/form/select/region/cities.ts +0 -2410
- package/src/web/components/form/select/region/provinces.ts +0 -240
- package/src/web/components/form/select/region/regions.ts +0 -20645
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/schema/lcds_component.json",
|
|
3
|
+
"data": {
|
|
4
|
+
"properties": {
|
|
5
|
+
"text": {
|
|
6
|
+
"title": "按钮标题",
|
|
7
|
+
"default": "获取用户信息",
|
|
8
|
+
"type": "string",
|
|
9
|
+
"x-category": "基础属性",
|
|
10
|
+
"remarks": "按钮组件的标题",
|
|
11
|
+
"x-platforms": [
|
|
12
|
+
"MP"
|
|
13
|
+
],
|
|
14
|
+
"x-index": 1
|
|
15
|
+
},
|
|
16
|
+
"type": {
|
|
17
|
+
"title": "按钮风格",
|
|
18
|
+
"type": "string",
|
|
19
|
+
"default": "wechat",
|
|
20
|
+
"remarks": "按钮组件的风格,相对于普通按钮组件,新增“微信”按钮风格",
|
|
21
|
+
"enum": [
|
|
22
|
+
{
|
|
23
|
+
"label": "默认",
|
|
24
|
+
"value": "default"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"label": "微信",
|
|
28
|
+
"value": "wechat"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"label": "主要",
|
|
32
|
+
"value": "primary"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"label": "警告",
|
|
36
|
+
"value": "warn"
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
"x-category": "基础属性",
|
|
40
|
+
"x-platforms": [
|
|
41
|
+
"MP"
|
|
42
|
+
],
|
|
43
|
+
"x-index": 2
|
|
44
|
+
},
|
|
45
|
+
"size": {
|
|
46
|
+
"title": "按钮大小",
|
|
47
|
+
"type": "string",
|
|
48
|
+
"default": "default",
|
|
49
|
+
"remarks": "按钮的大小",
|
|
50
|
+
"enum": [
|
|
51
|
+
{
|
|
52
|
+
"label": "中",
|
|
53
|
+
"value": "default"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"label": "小",
|
|
57
|
+
"value": "mini"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"label": "大",
|
|
61
|
+
"value": "large"
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
"x-category": "基础属性",
|
|
65
|
+
"x-platforms": [
|
|
66
|
+
"MP"
|
|
67
|
+
],
|
|
68
|
+
"x-index": 3
|
|
69
|
+
},
|
|
70
|
+
"usage": {
|
|
71
|
+
"title": "{{text('信息用途', help('声明获取用户个人信息的用途\\n不超过30个字符'))}}",
|
|
72
|
+
"type": "string",
|
|
73
|
+
"default": "",
|
|
74
|
+
"x-category": "基础属性",
|
|
75
|
+
"remarks": "声明获取用户个人信息的用途,不超过30个字符,若不填写将导致功能失效",
|
|
76
|
+
"required": true,
|
|
77
|
+
"x-rules": [
|
|
78
|
+
{
|
|
79
|
+
"message": "该字段必填",
|
|
80
|
+
"required": true
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"message": "不超过30个字符",
|
|
84
|
+
"pattern": "^.{0,30}$"
|
|
85
|
+
}
|
|
86
|
+
],
|
|
87
|
+
"description": "声明获取用户个人信息的用途,不超过30个字符,若不填写将导致功能失效",
|
|
88
|
+
"x-component": "textarea",
|
|
89
|
+
"x-platforms": [
|
|
90
|
+
"MP"
|
|
91
|
+
],
|
|
92
|
+
"x-index": 4
|
|
93
|
+
},
|
|
94
|
+
"language": {
|
|
95
|
+
"title": "语言",
|
|
96
|
+
"type": "string",
|
|
97
|
+
"default": "zh_CN",
|
|
98
|
+
"description": "",
|
|
99
|
+
"remarks": "用户当前国家、省份、城市所使用的语言",
|
|
100
|
+
"enum": [
|
|
101
|
+
{
|
|
102
|
+
"label": "简体中文",
|
|
103
|
+
"value": "zh_CN"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"label": "繁体中文",
|
|
107
|
+
"value": "zh_TW"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"label": "英文",
|
|
111
|
+
"value": "en"
|
|
112
|
+
}
|
|
113
|
+
],
|
|
114
|
+
"x-category": "基础属性",
|
|
115
|
+
"x-platforms": [
|
|
116
|
+
"MP"
|
|
117
|
+
],
|
|
118
|
+
"x-index": 5
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
"events": [
|
|
123
|
+
{
|
|
124
|
+
"title": "用户信息授权成功",
|
|
125
|
+
"name": "userinfosuccess",
|
|
126
|
+
"remarks": "弹窗中点击了允许按钮后触发的事件",
|
|
127
|
+
"x-platforms": [
|
|
128
|
+
"MP"
|
|
129
|
+
],
|
|
130
|
+
"detail": {
|
|
131
|
+
"avatarUrl": {
|
|
132
|
+
"type": "string",
|
|
133
|
+
"title": "用户头像",
|
|
134
|
+
"x-index": 1
|
|
135
|
+
},
|
|
136
|
+
"nickName": {
|
|
137
|
+
"type": "string",
|
|
138
|
+
"title": "微信昵称",
|
|
139
|
+
"x-index": 2
|
|
140
|
+
},
|
|
141
|
+
"language": {
|
|
142
|
+
"type": "string",
|
|
143
|
+
"title": "语言",
|
|
144
|
+
"x-index": 4
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"title": "用户信息授权失败",
|
|
150
|
+
"name": "userinfofail",
|
|
151
|
+
"remarks": "弹窗中点击了拒绝按钮后触发的事件",
|
|
152
|
+
"x-platforms": [
|
|
153
|
+
"MP"
|
|
154
|
+
]
|
|
155
|
+
}
|
|
156
|
+
],
|
|
157
|
+
"meta": {
|
|
158
|
+
"title": "获取用户信息",
|
|
159
|
+
"description": "能够在小程序运行态对用户的微信头像、微信昵称等信息进行获取。",
|
|
160
|
+
"icon": "//imgcache.qq.com/qcloud/lowcode/static/ide/left-material-icon/UserInfo.svg",
|
|
161
|
+
"category": "微信开放能力",
|
|
162
|
+
"categoryOrder": 100,
|
|
163
|
+
"componentOrder": 1,
|
|
164
|
+
"platform": [
|
|
165
|
+
"MP"
|
|
166
|
+
],
|
|
167
|
+
"visible": [
|
|
168
|
+
"APP"
|
|
169
|
+
]
|
|
170
|
+
},
|
|
171
|
+
"configMeta": {
|
|
172
|
+
"docsUrl": "https://docs.cloudbase.net/lowcode/components/wedaUI/src/docs/compsdocs/wxOpen/UserInfo"
|
|
173
|
+
}
|
|
174
|
+
}
|
package/src/configs/index.js
CHANGED
|
@@ -35,9 +35,20 @@ import showToast from './actions/showToast.json';
|
|
|
35
35
|
import showModal from './actions/showModal.json';
|
|
36
36
|
|
|
37
37
|
import ListView from './components/listView.json';
|
|
38
|
+
import NavigationBar from './components/navigationBar.json';
|
|
39
|
+
import Line from './components/chart/line.json';
|
|
40
|
+
import Bar from './components/chart/bar.json';
|
|
41
|
+
import Pie from './components/chart/pie.json';
|
|
42
|
+
|
|
38
43
|
import DataView from './components/dataView.json';
|
|
39
44
|
import StatisticsCard from './components/chart/statisticsCard.json';
|
|
40
45
|
import GraphicCard from './components/graphicCard.json';
|
|
46
|
+
import Phone from './components/wxOpenApi/phone.json';
|
|
47
|
+
import PhoneCode from './components/wxOpenApi/phoneCode.json';
|
|
48
|
+
import Share from './components/wxOpenApi/share.json';
|
|
49
|
+
import UserInfo from './components/wxOpenApi/userInfo.json';
|
|
50
|
+
|
|
51
|
+
import Lottery from './components/lottery.json';
|
|
41
52
|
export const components = {
|
|
42
53
|
Button,
|
|
43
54
|
Text,
|
|
@@ -74,8 +85,17 @@ export const components = {
|
|
|
74
85
|
ListView,
|
|
75
86
|
DataView,
|
|
76
87
|
NavLayout,
|
|
88
|
+
NavigationBar,
|
|
89
|
+
Line,
|
|
90
|
+
Bar,
|
|
91
|
+
Pie,
|
|
77
92
|
StatisticsCard,
|
|
78
93
|
GraphicCard,
|
|
94
|
+
Phone,
|
|
95
|
+
PhoneCode,
|
|
96
|
+
Share,
|
|
97
|
+
UserInfo,
|
|
98
|
+
Lottery,
|
|
79
99
|
};
|
|
80
100
|
|
|
81
101
|
export const actions = {
|
package/src/index.js
CHANGED
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import * as echarts from '../common/lib/echarts.min';
|
|
2
|
+
import EchartBar from '../common/core/eChartBar';
|
|
3
|
+
Component({
|
|
4
|
+
options: {
|
|
5
|
+
virtualHost: true,
|
|
6
|
+
multipleSlots: true,
|
|
7
|
+
},
|
|
8
|
+
properties: {
|
|
9
|
+
id: {
|
|
10
|
+
type: String,
|
|
11
|
+
value: '',
|
|
12
|
+
},
|
|
13
|
+
className: {
|
|
14
|
+
type: String,
|
|
15
|
+
value: '',
|
|
16
|
+
},
|
|
17
|
+
style: {
|
|
18
|
+
type: String,
|
|
19
|
+
value: '',
|
|
20
|
+
},
|
|
21
|
+
directionType: {
|
|
22
|
+
// 柱状图方向
|
|
23
|
+
type: String,
|
|
24
|
+
value: 'lengthways',
|
|
25
|
+
},
|
|
26
|
+
isPile: {
|
|
27
|
+
// 柱状图方向
|
|
28
|
+
type: Boolean,
|
|
29
|
+
value: false,
|
|
30
|
+
},
|
|
31
|
+
title: {
|
|
32
|
+
// 图表标题
|
|
33
|
+
type: String,
|
|
34
|
+
},
|
|
35
|
+
isTitle: {
|
|
36
|
+
// 是否显示标题
|
|
37
|
+
type: Boolean,
|
|
38
|
+
value: false,
|
|
39
|
+
},
|
|
40
|
+
titleLocation: {
|
|
41
|
+
type: String,
|
|
42
|
+
value: 'top',
|
|
43
|
+
},
|
|
44
|
+
dataSource: {
|
|
45
|
+
// 数据源
|
|
46
|
+
type: Object,
|
|
47
|
+
},
|
|
48
|
+
filterData: {
|
|
49
|
+
// 数据筛选
|
|
50
|
+
type: Array,
|
|
51
|
+
value: [],
|
|
52
|
+
},
|
|
53
|
+
setColor: {
|
|
54
|
+
// 设置颜色
|
|
55
|
+
type: Array,
|
|
56
|
+
value: [],
|
|
57
|
+
},
|
|
58
|
+
xField: {
|
|
59
|
+
// x轴字段选择
|
|
60
|
+
type: Object,
|
|
61
|
+
value: {
|
|
62
|
+
format: '',
|
|
63
|
+
type: '', // 数据源字段 类型
|
|
64
|
+
title: '', // 字段名中文
|
|
65
|
+
name: '', // 字段名英文
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
xStatistics: {
|
|
69
|
+
// x轴统计维度
|
|
70
|
+
type: String,
|
|
71
|
+
value: '', // 统计纬度, 只有选择时间类型才有,y 年,m月,d 日,w周,h时,min 分,s秒
|
|
72
|
+
},
|
|
73
|
+
groupKey: {
|
|
74
|
+
// x轴字段选择
|
|
75
|
+
type: Object,
|
|
76
|
+
value: {
|
|
77
|
+
format: '',
|
|
78
|
+
type: '', // 数据源字段 类型
|
|
79
|
+
title: '', // 字段名中文
|
|
80
|
+
name: '', // 字段名英文
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
groupKeyTimeSpan: {
|
|
84
|
+
// x轴统计维度
|
|
85
|
+
type: String,
|
|
86
|
+
value: '', // 统计纬度, 只有选择时间类型才有,y 年,m月,d 日,w周,h时,min 分,s秒
|
|
87
|
+
},
|
|
88
|
+
xIsCountEmpty: {
|
|
89
|
+
// x轴 是否统计空值
|
|
90
|
+
type: Boolean,
|
|
91
|
+
value: false,
|
|
92
|
+
},
|
|
93
|
+
yField: {
|
|
94
|
+
// Y轴字段,分组字段,是否分组
|
|
95
|
+
type: Object,
|
|
96
|
+
value: {
|
|
97
|
+
numValue: [{ key: '', operationType: '' }],
|
|
98
|
+
groupKey: '',
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
isLegend: {
|
|
102
|
+
// 是否显示图例
|
|
103
|
+
type: Boolean,
|
|
104
|
+
value: false,
|
|
105
|
+
},
|
|
106
|
+
legend: {
|
|
107
|
+
// 图例
|
|
108
|
+
type: String,
|
|
109
|
+
value: 'bottom', // 上top,下 bottom
|
|
110
|
+
},
|
|
111
|
+
|
|
112
|
+
// 高级属性
|
|
113
|
+
isXaxisName: {
|
|
114
|
+
// 是否显示坐标轴名称
|
|
115
|
+
type: Boolean,
|
|
116
|
+
value: true,
|
|
117
|
+
},
|
|
118
|
+
xAxisName: {
|
|
119
|
+
// 是否显示坐标轴名称
|
|
120
|
+
type: String,
|
|
121
|
+
value: '',
|
|
122
|
+
},
|
|
123
|
+
isXaxisAxisLabelShow: {
|
|
124
|
+
// 是否显示标签
|
|
125
|
+
type: Boolean,
|
|
126
|
+
value: true,
|
|
127
|
+
},
|
|
128
|
+
isXaxisAxisTickShow: {
|
|
129
|
+
// 显示X轴刻度线
|
|
130
|
+
type: Boolean,
|
|
131
|
+
value: true,
|
|
132
|
+
},
|
|
133
|
+
isXaxisAxisLabelRotate: {
|
|
134
|
+
// 文字自动倾斜
|
|
135
|
+
type: Boolean,
|
|
136
|
+
value: false,
|
|
137
|
+
},
|
|
138
|
+
isYAxisShow: {
|
|
139
|
+
// 是否显示 Y 轴刻度线
|
|
140
|
+
type: Boolean,
|
|
141
|
+
value: true,
|
|
142
|
+
},
|
|
143
|
+
isYAxisName: {
|
|
144
|
+
// 是否显示 Y坐标轴名称
|
|
145
|
+
type: Boolean,
|
|
146
|
+
value: true,
|
|
147
|
+
},
|
|
148
|
+
isYAxisSplitlineLinestyleWidth: {
|
|
149
|
+
// 是否显示网格线 ,yAxis.splitLine.lineStyle.width设置为0
|
|
150
|
+
type: Boolean,
|
|
151
|
+
value: true,
|
|
152
|
+
},
|
|
153
|
+
yAxisSplitlineLinestyleType: {
|
|
154
|
+
// 网格线线条类型 solid,dashed,dotted
|
|
155
|
+
type: String,
|
|
156
|
+
value: 'dashed',
|
|
157
|
+
},
|
|
158
|
+
yAxisName: {
|
|
159
|
+
// Y坐标轴名称 显示名称后需要设置居中,轴线距离属性 yAxis.nameLocation='middle' yAxis.nameGap =20
|
|
160
|
+
type: String,
|
|
161
|
+
value: '',
|
|
162
|
+
},
|
|
163
|
+
yAxisMin: {
|
|
164
|
+
// Y轴刻度最小值
|
|
165
|
+
type: Number,
|
|
166
|
+
value: 0,
|
|
167
|
+
},
|
|
168
|
+
yAxisMax: {
|
|
169
|
+
// Y轴刻度最大值, 切记如果为0时,则不设置
|
|
170
|
+
type: Number,
|
|
171
|
+
value: 0,
|
|
172
|
+
},
|
|
173
|
+
isSeriesShowSymbol: {
|
|
174
|
+
// 是否显示数据标签 开启后 属性 series.label.show 要同时设置为true
|
|
175
|
+
type: Boolean,
|
|
176
|
+
value: true,
|
|
177
|
+
},
|
|
178
|
+
isUnit: {
|
|
179
|
+
// 显示单位
|
|
180
|
+
type: Boolean,
|
|
181
|
+
value: false,
|
|
182
|
+
},
|
|
183
|
+
unit: {
|
|
184
|
+
// 数字显示的单位 百分比,千分比,千,万,百万,亿,十亿
|
|
185
|
+
type: String,
|
|
186
|
+
value: '%',
|
|
187
|
+
},
|
|
188
|
+
decimalDigits: {
|
|
189
|
+
// 小数位数
|
|
190
|
+
type: Number,
|
|
191
|
+
value: 0,
|
|
192
|
+
},
|
|
193
|
+
suffix: {
|
|
194
|
+
// 后缀
|
|
195
|
+
type: String,
|
|
196
|
+
value: '',
|
|
197
|
+
},
|
|
198
|
+
|
|
199
|
+
},
|
|
200
|
+
data: {
|
|
201
|
+
ec: {},
|
|
202
|
+
canvas_id: {
|
|
203
|
+
type: String,
|
|
204
|
+
value: `canvas_bar_${Date.now()}_${Math.random() * 100}`,
|
|
205
|
+
},
|
|
206
|
+
},
|
|
207
|
+
lifetimes: {
|
|
208
|
+
attached() {
|
|
209
|
+
// 在组件实例进入页面节点树时执行
|
|
210
|
+
this.initData();
|
|
211
|
+
},
|
|
212
|
+
detached() {
|
|
213
|
+
// 在组件实例被从页面节点树移除时执行
|
|
214
|
+
},
|
|
215
|
+
},
|
|
216
|
+
// 以下是旧式的定义方式,可以保持对 <2.2.3 版本基础库的兼容
|
|
217
|
+
attached() {
|
|
218
|
+
// 在组件实例进入页面节点树时执行
|
|
219
|
+
this.initData();
|
|
220
|
+
},
|
|
221
|
+
detached() {
|
|
222
|
+
// 在组件实例被从页面节点树移除时执行
|
|
223
|
+
},
|
|
224
|
+
observers: {
|
|
225
|
+
// 当参数变化时
|
|
226
|
+
'**': async function() {
|
|
227
|
+
const objEChartBar = new EchartBar();
|
|
228
|
+
await objEChartBar.setOptions(this.properties);
|
|
229
|
+
const options = await objEChartBar.getOptions();
|
|
230
|
+
this._chart && this._chart.setOption(options);
|
|
231
|
+
},
|
|
232
|
+
},
|
|
233
|
+
methods: {
|
|
234
|
+
initData() {
|
|
235
|
+
this.setData({
|
|
236
|
+
ec: {
|
|
237
|
+
onInit: this.initChart.bind(this),
|
|
238
|
+
},
|
|
239
|
+
});
|
|
240
|
+
},
|
|
241
|
+
async initChart(canvas, width, height, dpr) {
|
|
242
|
+
const objEchart = echarts.init(canvas, null, {
|
|
243
|
+
width,
|
|
244
|
+
height,
|
|
245
|
+
devicePixelRatio: dpr,
|
|
246
|
+
});
|
|
247
|
+
canvas.setChart(objEchart);
|
|
248
|
+
const objEChartBar = new EchartBar();
|
|
249
|
+
await objEChartBar.setOptions(this.properties);
|
|
250
|
+
const options = await objEChartBar.getOptions();
|
|
251
|
+
// objEchart.clear();
|
|
252
|
+
console.log('设置前参数bar', options);
|
|
253
|
+
objEchart.setOption(options);
|
|
254
|
+
this._chart = objEchart;
|
|
255
|
+
return objEchart;
|
|
256
|
+
},
|
|
257
|
+
},
|
|
258
|
+
});
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/** 根据当前环境获取 pc 上配置,还是 H5上的配置 */
|
|
2
|
+
const getConfig = () => {
|
|
3
|
+
const barH5 = {
|
|
4
|
+
xAxis: {
|
|
5
|
+
name: 'X轴名',
|
|
6
|
+
nameTextStyle: { align: 'center' },
|
|
7
|
+
axisLabel: {
|
|
8
|
+
show: true, // 刻度标签显示
|
|
9
|
+
rotate: 0, // 字体倾斜
|
|
10
|
+
},
|
|
11
|
+
axisTick: {
|
|
12
|
+
show: true, // 刻度显示
|
|
13
|
+
},
|
|
14
|
+
type: 'category',
|
|
15
|
+
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
|
|
16
|
+
inverse:false,
|
|
17
|
+
},
|
|
18
|
+
yAxis: {
|
|
19
|
+
type: 'value',
|
|
20
|
+
show: true, // y轴刻度线
|
|
21
|
+
name: 'Y轴名',
|
|
22
|
+
splitLine: {
|
|
23
|
+
lineStyle: {
|
|
24
|
+
width: 1, // 网格线宽度,为0则不显示
|
|
25
|
+
type: 'dashed', //solid,dashed,dotted
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
axisLabel: { padding: [0, -10, 0, 0] },
|
|
29
|
+
min: null,
|
|
30
|
+
max: null,
|
|
31
|
+
},
|
|
32
|
+
series: [
|
|
33
|
+
{
|
|
34
|
+
name: 'demo',
|
|
35
|
+
data: [820, 932, 901, 934, 1290, 1330, 1320],
|
|
36
|
+
type: 'bar',
|
|
37
|
+
itemStyle: {
|
|
38
|
+
color: 'green',
|
|
39
|
+
},
|
|
40
|
+
smooth: true,
|
|
41
|
+
showSymbol: true, //是否显示线条上数据标签
|
|
42
|
+
label: {
|
|
43
|
+
show: true, // 显示线条上的数据
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
};
|
|
48
|
+
return barH5;
|
|
49
|
+
};
|
|
50
|
+
export default getConfig;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** 根据当前环境获取 pc 上配置,还是 H5上的配置 */
|
|
2
|
+
const getConfig = () => {
|
|
3
|
+
const globalH5 = {
|
|
4
|
+
title: {
|
|
5
|
+
text: 'demo实例',
|
|
6
|
+
show: true,
|
|
7
|
+
left: '45%',
|
|
8
|
+
},
|
|
9
|
+
legend: {
|
|
10
|
+
top: '83%',
|
|
11
|
+
},
|
|
12
|
+
tooltip: {},
|
|
13
|
+
};
|
|
14
|
+
return globalH5;
|
|
15
|
+
};
|
|
16
|
+
export default getConfig;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/** 根据当前环境获取 pc 上配置,还是 H5上的配置 */
|
|
2
|
+
const getConfig = () => {
|
|
3
|
+
const lineH5 = {
|
|
4
|
+
xAxis: {
|
|
5
|
+
name: 'X轴名',
|
|
6
|
+
nameTextStyle: { align: 'center' },
|
|
7
|
+
axisLabel: {
|
|
8
|
+
show: true, // 刻度标签显示
|
|
9
|
+
rotate: 0, // 字体倾斜
|
|
10
|
+
},
|
|
11
|
+
axisTick: {
|
|
12
|
+
show: true, // 刻度显示
|
|
13
|
+
},
|
|
14
|
+
type: 'category',
|
|
15
|
+
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
|
|
16
|
+
},
|
|
17
|
+
yAxis: {
|
|
18
|
+
type: 'value',
|
|
19
|
+
show: true, // y轴刻度线
|
|
20
|
+
name: 'Y轴名',
|
|
21
|
+
splitLine: {
|
|
22
|
+
lineStyle: {
|
|
23
|
+
width: 1, // 网格线宽度,为0则不显示
|
|
24
|
+
type: 'dashed', //solid,dashed,dotted
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
axisLabel: {
|
|
28
|
+
padding: [0, -10, 0, 0],
|
|
29
|
+
},
|
|
30
|
+
min: null,
|
|
31
|
+
max: null,
|
|
32
|
+
},
|
|
33
|
+
series: [
|
|
34
|
+
{
|
|
35
|
+
name: 'demo',
|
|
36
|
+
data: [820, 932, 901, 934, 1290, 1330, 1320],
|
|
37
|
+
type: 'line',
|
|
38
|
+
smooth: true,
|
|
39
|
+
showSymbol: true, //是否显示线条上数据标签
|
|
40
|
+
label: {
|
|
41
|
+
show: true, // 显示线条上的数据
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
};
|
|
46
|
+
return lineH5;
|
|
47
|
+
};
|
|
48
|
+
export default getConfig;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** 根据当前环境获取 pc 上配置,还是 H5上的配置 */
|
|
2
|
+
const getConfig = () => {
|
|
3
|
+
const pieH5 = {
|
|
4
|
+
series: [
|
|
5
|
+
{
|
|
6
|
+
// name: 'demo',
|
|
7
|
+
data: [
|
|
8
|
+
{ value: 820, name: '实例数据1', tooltip: {}, itemStyle: {} },
|
|
9
|
+
{ value: 932, name: '实例数据2', tooltip: {}, itemStyle: {} },
|
|
10
|
+
{ value: 901, name: '实例数据3', tooltip: {}, itemStyle: {} },
|
|
11
|
+
{ value: 934, name: '实例数据4', tooltip: {}, itemStyle: {} },
|
|
12
|
+
{ value: 1290, name: '实例数据5', tooltip: {}, itemStyle: {} },
|
|
13
|
+
],
|
|
14
|
+
label: {
|
|
15
|
+
show: true,
|
|
16
|
+
position: 'inner',
|
|
17
|
+
normal: {
|
|
18
|
+
formatter: null,
|
|
19
|
+
position: 'inner',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
type: 'pie',
|
|
23
|
+
radius: '70%',
|
|
24
|
+
emphasis: {
|
|
25
|
+
itemStyle: {
|
|
26
|
+
shadowBlur: 10,
|
|
27
|
+
shadowOffsetX: 0,
|
|
28
|
+
shadowColor: 'rgba(0, 0, 0, 0.5)',
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
};
|
|
34
|
+
return pieH5;
|
|
35
|
+
};
|
|
36
|
+
export default getConfig;
|