@cloudbase/weda-ui 2.0.11 → 2.0.12

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.
Files changed (194) hide show
  1. package/README.md +1 -0
  2. package/package.json +5 -4
  3. package/src/configs/components/button.json +60 -13
  4. package/src/configs/components/calendar.json +3 -3
  5. package/src/configs/components/carousel.json +57 -47
  6. package/src/configs/components/chart/bar.json +4 -13
  7. package/src/configs/components/chart/line.json +4 -13
  8. package/src/configs/components/chart/pie.json +3 -10
  9. package/src/configs/components/chart/statisticsCard.json +1 -4
  10. package/src/configs/components/container.json +1 -3
  11. package/src/configs/components/dataView.json +7 -15
  12. package/src/configs/components/drawer.json +24 -6
  13. package/src/configs/components/form/form.json +19 -0
  14. package/src/configs/components/form/input.json +20 -5
  15. package/src/configs/components/form/location.json +51 -48
  16. package/src/configs/components/form/radio.json +1 -3
  17. package/src/configs/components/form/richText.json +14 -14
  18. package/src/configs/components/form/select.json +62 -82
  19. package/src/configs/components/form/textarea.json +6 -1
  20. package/src/configs/components/form/uploader.json +64 -64
  21. package/src/configs/components/form/uploaderFile.json +1 -2
  22. package/src/configs/components/graphicCard.json +43 -44
  23. package/src/configs/components/image.json +44 -40
  24. package/src/configs/components/link.json +5 -10
  25. package/src/configs/components/listView.json +2 -8
  26. package/src/configs/components/lottery.json +7 -3
  27. package/src/configs/components/modal.json +26 -21
  28. package/src/configs/components/navLayout.json +66 -67
  29. package/src/configs/components/navigationBar.json +4 -1
  30. package/src/configs/components/richtextview.json +1 -1
  31. package/src/configs/components/scrollVeiw.json +14 -42
  32. package/src/configs/components/swiper.json +9 -9
  33. package/src/configs/components/wedaVideo.json +86 -0
  34. package/src/configs/components/wxOpenApi/phone.json +7 -21
  35. package/src/configs/components/wxOpenApi/phoneCode.json +7 -19
  36. package/src/configs/components/wxOpenApi/share.json +14 -24
  37. package/src/configs/components/wxOpenApi/userInfo.json +9 -27
  38. package/src/configs/index.js +2 -0
  39. package/src/docs/common/format.tsx +4 -1
  40. package/src/docs/common/tableView.css +3 -3
  41. package/src/docs/common/tableView.tsx +18 -8
  42. package/src/docs/compsdocs/form/FormLocation.mdx +1 -1
  43. package/src/docs/compsdocs/form/FormSelect.mdx +0 -1
  44. package/src/docs/compsdocs/grid/Card.mdx +0 -1
  45. package/src/docs/compsdocs/grid/Container.mdx +0 -1
  46. package/src/docs/compsdocs/grid/GridLayout.mdx +0 -1
  47. package/src/docs/compsdocs/grid/ScrollView.mdx +2 -2
  48. package/src/docs/compsdocs/grid/Swiper.mdx +1 -2
  49. package/src/docs/compsdocs/media/Icon.mdx +1 -1
  50. package/src/docs/compsdocs/media/Image.mdx +6 -6
  51. package/src/docs/compsdocs/model/ModelCreate.mdx +24 -0
  52. package/src/docs/compsdocs/model/ModelDetail.mdx +24 -0
  53. package/src/docs/compsdocs/model/ModelTable.mdx +133 -1
  54. package/src/docs/compsdocs/model/ModelUpdate.mdx +24 -1
  55. package/src/docs/compsdocs/navmenu/Classification.mdx +2 -3
  56. package/src/docs/compsdocs/navmenu/NavBar.mdx +14 -5
  57. package/src/docs/compsdocs/navmenu/NavLayout.mdx +0 -1
  58. package/src/docs/compsdocs/navmenu/TabBar.mdx +3 -3
  59. package/src/docs/compsdocs/navmenu/TabBarItem.mdx +1 -1
  60. package/src/docs/compsdocs/senior/Lottery.mdx +3 -6
  61. package/src/docs/compsdocs/senior/Modal.mdx +2 -3
  62. package/src/docs/compsdocs/senior/SlotMachine.mdx +2 -5
  63. package/src/docs/compsdocs/senior/_category_.json +1 -1
  64. package/src/docs/compsdocs/show/GraphicCard.mdx +0 -1
  65. package/src/docs/compsdocs/show/Item.mdx +0 -1
  66. package/src/docs/compsdocs/show/ItemList.mdx +1 -0
  67. package/src/docs/compsdocs/show/Tabs.mdx +2 -3
  68. package/src/docs/compsdocs/text/Link.mdx +1 -1
  69. package/src/docs/compsdocs/text/RichTextView.mdx +1 -2
  70. package/src/docs/compsdocs/text/Text.mdx +1 -1
  71. package/src/docs/compsdocs/text/Title.mdx +1 -2
  72. package/src/docs/compsdocs/wxOpen/Phone.mdx +1 -2
  73. package/src/docs/compsdocs/wxOpen/Share.mdx +0 -1
  74. package/src/docs/compsdocs/wxOpen/UserInfo.mdx +1 -2
  75. package/src/mp/components/calendar/index.json +1 -1
  76. package/src/mp/components/calendar/index.wxml +5 -27
  77. package/src/mp/components/carousel/index.json +1 -1
  78. package/src/mp/components/carousel/index.wxml +3 -30
  79. package/src/mp/components/chart/bar/index.wxml +1 -6
  80. package/src/mp/components/chart/ec-canvas/ec-canvas.json +1 -1
  81. package/src/mp/components/chart/ec-canvas/ec-canvas.wxml +2 -19
  82. package/src/mp/components/chart/line/index.wxml +1 -6
  83. package/src/mp/components/chart/pie/index.wxml +1 -6
  84. package/src/mp/components/chart/statisticsCard/index.wxml +1 -5
  85. package/src/mp/components/dataView/index.wxml +1 -13
  86. package/src/mp/components/form/checkbox/index.wxml +3 -18
  87. package/src/mp/components/form/formcell/index.wxss +5 -0
  88. package/src/mp/components/form/input/index.wxml +3 -16
  89. package/src/mp/components/form/input/index.wxss +7 -1
  90. package/src/mp/components/form/location/components/mapChoose/index.json +1 -1
  91. package/src/mp/components/form/location/components/mapChoose/index.wxml +11 -58
  92. package/src/mp/components/form/location/index.js +7 -1
  93. package/src/mp/components/form/location/index.json +1 -1
  94. package/src/mp/components/form/location/index.wxml +7 -43
  95. package/src/mp/components/form/radio/index.wxml +2 -14
  96. package/src/mp/components/form/select/index.wxml +3 -33
  97. package/src/mp/components/form/select/index.wxss +9 -0
  98. package/src/mp/components/form/switch/index.wxml +2 -13
  99. package/src/mp/components/form/textarea/index.wxml +4 -23
  100. package/src/mp/components/form/textarea/index.wxss +5 -0
  101. package/src/mp/components/form/uploader/index.wxml +2 -20
  102. package/src/mp/components/form/uploader/weui-uploader.json +6 -6
  103. package/src/mp/components/form/uploader/weui-uploader.wxml +10 -53
  104. package/src/mp/components/form/uploaderFile/index.wxml +14 -71
  105. package/src/mp/components/graphicCard/index.js +9 -11
  106. package/src/mp/components/graphicCard/index.wxml +6 -34
  107. package/src/mp/components/image/index.wxml +3 -21
  108. package/src/mp/components/listView/index.wxml +8 -33
  109. package/src/mp/components/lottery/index.wxml +7 -31
  110. package/src/mp/components/navLayout/index.js +9 -12
  111. package/src/mp/components/navLayout/index.wxml +6 -30
  112. package/src/mp/components/navigationBar/index.json +1 -2
  113. package/src/mp/components/navigationBar/index.wxml +29 -146
  114. package/src/mp/components/swiper/index.wxml +1 -14
  115. package/src/mp/components/tabs/index.json +1 -1
  116. package/src/mp/components/tabs/index.wxml +3 -22
  117. package/src/mp/components/text/index.wxml +1 -7
  118. package/src/mp/components/wedaVideo/index.js +86 -0
  119. package/src/mp/components/wedaVideo/index.json +4 -0
  120. package/src/mp/components/wedaVideo/index.wxml +4 -0
  121. package/src/mp/components/wedaVideo/index.wxss +20 -0
  122. package/src/mp/components/wxOpenApi/phone/index.js +1 -9
  123. package/src/mp/components/wxOpenApi/phone/index.wxml +1 -11
  124. package/src/mp/components/wxOpenApi/phoneCode/index.json +1 -1
  125. package/src/mp/components/wxOpenApi/phoneCode/index.wxml +1 -11
  126. package/src/mp/components/wxOpenApi/share/index.wxml +1 -11
  127. package/src/mp/components/wxOpenApi/userInfo/index.wxml +1 -10
  128. package/src/mp/index.json +1 -0
  129. package/src/mp/style/weda-ui.wxss +12 -4
  130. package/src/web/actions/showModal/index.tsx +5 -4
  131. package/src/web/components/calendar/index.css +81 -34
  132. package/src/web/components/chart/common/core/eChartBase.ts +55 -42
  133. package/src/web/components/chart/common/core/type.ts +23 -23
  134. package/src/web/components/chart/common/echart.css +12 -12
  135. package/src/web/components/chart/common/echarts.ts +3 -5
  136. package/src/web/components/chart/common/useChart.tsx +34 -16
  137. package/src/web/components/container/index.tsx +3 -4
  138. package/src/web/components/drawer/index.tsx +15 -4
  139. package/src/web/components/form/checkbox/index.tsx +32 -31
  140. package/src/web/components/form/enumSelect/NormalSelect.tsx +0 -2
  141. package/src/web/components/form/form/index.css +3 -6
  142. package/src/web/components/form/form/index.tsx +2 -1
  143. package/src/web/components/form/formcell/index.css +5 -3
  144. package/src/web/components/form/formcell/index.tsx +2 -6
  145. package/src/web/components/form/input/index.css +4 -4
  146. package/src/web/components/form/input/index.tsx +61 -53
  147. package/src/web/components/form/location/common/selectModal.jsx +2 -11
  148. package/src/web/components/form/location/common/useLocationInfo.js +4 -0
  149. package/src/web/components/form/location/components/LocationH5/index.css +0 -1
  150. package/src/web/components/form/location/components/LocationH5/location.h5.jsx +11 -1
  151. package/src/web/components/form/location/components/LocationPC/Header.jsx +0 -13
  152. package/src/web/components/form/location/components/LocationPC/location.PC.jsx +14 -5
  153. package/src/web/components/form/radio/index.tsx +32 -26
  154. package/src/web/components/form/renderDecorator.tsx +23 -26
  155. package/src/web/components/form/select/h5.tsx +1 -1
  156. package/src/web/components/form/select/index.css +9 -0
  157. package/src/web/components/form/select/index.tsx +75 -48
  158. package/src/web/components/form/select/region/index.ts +101 -80
  159. package/src/web/components/form/select/year.tsx +2 -0
  160. package/src/web/components/form/switch/index.tsx +40 -40
  161. package/src/web/components/form/textarea/index.css +4 -0
  162. package/src/web/components/form/textarea/index.tsx +26 -25
  163. package/src/web/components/form/types.d.ts +10 -10
  164. package/src/web/components/form/uploaderFile/index.jsx +0 -5
  165. package/src/web/components/form/uploaderFile/uploadFile.h5.tsx +15 -11
  166. package/src/web/components/form/uploaderFile/uploadFile.pc.tsx +14 -9
  167. package/src/web/components/image/image.tsx +2 -2
  168. package/src/web/components/image/index.css +9 -7
  169. package/src/web/components/image/index.tsx +28 -11
  170. package/src/web/components/index.js +1 -0
  171. package/src/web/components/link/index.tsx +12 -12
  172. package/src/web/components/lottery/index.css +43 -37
  173. package/src/web/components/lottery/index.tsx +2 -2
  174. package/src/web/components/modal/index.tsx +34 -34
  175. package/src/web/components/picker/datePicker.tsx +3 -3
  176. package/src/web/components/picker/picker.tsx +3 -3
  177. package/src/web/components/richText/index.jsx +41 -46
  178. package/src/web/components/richTextView/index.tsx +4 -6
  179. package/src/web/components/scrollView/index.tsx +2 -2
  180. package/src/web/components/slot/index.tsx +3 -4
  181. package/src/web/components/swiper/index.css +1 -1
  182. package/src/web/components/swiper/index.tsx +33 -15
  183. package/src/web/components/tabs/index.css +1 -1
  184. package/src/web/components/tabs/index.tsx +6 -6
  185. package/src/web/components/tabs/tabs.h5.tsx +17 -12
  186. package/src/web/components/tabs/tabs.pc.tsx +45 -34
  187. package/src/web/components/text/index.css +1 -1
  188. package/src/web/components/wedaVideo/index.css +42 -0
  189. package/src/web/components/wedaVideo/index.tsx +198 -0
  190. package/src/web/utils/constant.ts +2 -1
  191. package/src/web/utils/loading-fallback.tsx +2 -2
  192. package/src/web/utils/lodash.ts +1 -1
  193. package/src/web/utils/useSetState.ts +6 -2
  194. package/src/web/weda-ui.css +13 -0
@@ -1,11 +1,12 @@
1
- /* weda_calendar */
1
+ /* weda_calendar */
2
2
 
3
3
  /* pc 日历样式 start */
4
4
  .weda-calendar.weda-calendar-pc {
5
- background: #FFFFFF;
6
- border: 0.5px solid #DCDCDC;
5
+ background: #ffffff;
6
+ border: 0.5px solid #dcdcdc;
7
7
  box-sizing: border-box;
8
- box-shadow: 0px 3px 14px 2px rgba(0, 0, 0, 0.05), 0px 8px 10px 1px rgba(0, 0, 0, 0.06), 0px 5px 5px -3px rgba(0, 0, 0, 0.1);
8
+ box-shadow: 0px 3px 14px 2px rgba(0, 0, 0, 0.05),
9
+ 0px 8px 10px 1px rgba(0, 0, 0, 0.06), 0px 5px 5px -3px rgba(0, 0, 0, 0.1);
9
10
  border-radius: 3px;
10
11
  min-width: 560px;
11
12
  }
@@ -45,24 +46,33 @@
45
46
  margin-right: 0;
46
47
  }
47
48
 
48
- .weda-calendar-pc .weda-calendar__control-section .weda-calendar__control-section-cell {
49
+ .weda-calendar-pc
50
+ .weda-calendar__control-section
51
+ .weda-calendar__control-section-cell {
49
52
  height: 100%;
50
53
  margin-right: 8px;
51
54
  }
52
55
 
53
- .weda-calendar-pc .weda-calendar__control-section .weda-calendar__control-section-cell:last-child {
56
+ .weda-calendar-pc
57
+ .weda-calendar__control-section
58
+ .weda-calendar__control-section-cell:last-child {
54
59
  margin-right: 0;
55
60
  }
56
61
 
57
- .weda-calendar-pc .weda-calendar__control-section .tea-dropdown .tea-dropdown__header {
58
- background: #E7E7E7;
62
+ .weda-calendar-pc
63
+ .weda-calendar__control-section
64
+ .tea-dropdown
65
+ .tea-dropdown__header {
66
+ background: #e7e7e7;
59
67
  border-radius: 3px;
60
68
  padding: 5px 32px 5px 12px;
61
69
  height: 32px;
62
-
63
70
  }
64
71
 
65
- .weda-calendar-pc .weda-calendar__control-section .tea-dropdown .tea-dropdown__value {
72
+ .weda-calendar-pc
73
+ .weda-calendar__control-section
74
+ .tea-dropdown
75
+ .tea-dropdown__value {
66
76
  font-size: 14px;
67
77
  line-height: 22px;
68
78
  }
@@ -124,7 +134,9 @@
124
134
  }
125
135
 
126
136
  .weda-calendar .weda-calendar__table .weda-calendar__table-head-cell:last-child,
127
- .weda-calendar .weda-calendar__table .weda-calendar__table-body-cell:last-child {
137
+ .weda-calendar
138
+ .weda-calendar__table
139
+ .weda-calendar__table-body-cell:last-child {
128
140
  margin-right: 0;
129
141
  }
130
142
 
@@ -136,7 +148,7 @@
136
148
  flex: 1;
137
149
  -webkit-box-flex: 1;
138
150
  -ms-flex: 1;
139
- border-top: 1px solid #E7E7E7;
151
+ border-top: 1px solid #e7e7e7;
140
152
  padding: 0;
141
153
  height: 87.4px;
142
154
  display: flex;
@@ -156,18 +168,24 @@
156
168
  color: rgba(0, 0, 0, 0.26);
157
169
  }
158
170
 
159
- .weda-calendar .weda-calendar__table .weda-calendar__table-body-cell.is-disabled,
160
- .weda-calendar .weda-calendar__table .weda-calendar__table-body-cell.is-invalid {
171
+ .weda-calendar
172
+ .weda-calendar__table
173
+ .weda-calendar__table-body-cell.is-disabled,
174
+ .weda-calendar
175
+ .weda-calendar__table
176
+ .weda-calendar__table-body-cell.is-invalid {
161
177
  cursor: not-allowed;
162
178
  }
163
179
 
164
- .weda-calendar .weda-calendar__table .weda-calendar__table-body-cell.is-invalid {
165
- background: #F3F3F3;
180
+ .weda-calendar
181
+ .weda-calendar__table
182
+ .weda-calendar__table-body-cell.is-invalid {
183
+ background: #f3f3f3;
166
184
  }
167
185
 
168
186
  .weda-calendar .weda-calendar__table .weda-calendar__table-body-cell.is-now {
169
- border-top-color: #0052D9;
170
- background: #ECF2FE;
187
+ border-top-color: #0052d9;
188
+ background: #ecf2fe;
171
189
  }
172
190
 
173
191
  .weda-calendar .weda-calendar__table .weda-calendar__table-body-cell-value {
@@ -179,11 +197,17 @@
179
197
  position: relative;
180
198
  }
181
199
 
182
- .weda-calendar .weda-calendar__table .weda-calendar__table-body-cell.is-disabled .weda-calendar__table-body-cell-value {
200
+ .weda-calendar
201
+ .weda-calendar__table
202
+ .weda-calendar__table-body-cell.is-disabled
203
+ .weda-calendar__table-body-cell-value {
183
204
  color: rgba(0, 0, 0, 0.26);
184
205
  }
185
206
 
186
- .weda-calendar .weda-calendar__table .weda-calendar__table-body-cell .weda-calendar__table-body-cell-marked {
207
+ .weda-calendar
208
+ .weda-calendar__table
209
+ .weda-calendar__table-body-cell
210
+ .weda-calendar__table-body-cell-marked {
187
211
  position: absolute;
188
212
  width: 6px;
189
213
  height: 6px;
@@ -198,7 +222,7 @@
198
222
  /* h5 日历样式 start */
199
223
 
200
224
  .weda-calendar.weda-calendar-h5 {
201
- background: #FFFFFF;
225
+ background: #ffffff;
202
226
  width: 100%;
203
227
  opacity: 0.9;
204
228
  }
@@ -222,18 +246,22 @@
222
246
  background-position: center;
223
247
  }
224
248
 
225
- .weda-calendar__control_h5 .weda-calendar_prevMonth.wedatea2td-icon-arrowleft--line,
226
- .weda-calendar__control_h5 .weda-calendar_nextMonth.wedatea2td-icon-arrowright--line {
249
+ .weda-calendar__control_h5
250
+ .weda-calendar_prevMonth.wedatea2td-icon-arrowleft--line,
251
+ .weda-calendar__control_h5
252
+ .weda-calendar_nextMonth.wedatea2td-icon-arrowright--line {
227
253
  position: absolute;
228
254
  top: 17px;
229
255
  width: 20px;
230
256
  height: 20px;
231
257
  }
232
258
 
233
- .weda-calendar__control_h5 .weda-calendar_prevMonth.wedatea2td-icon-arrowleft--line {
259
+ .weda-calendar__control_h5
260
+ .weda-calendar_prevMonth.wedatea2td-icon-arrowleft--line {
234
261
  left: 16px;
235
262
  }
236
- .weda-calendar__control_h5 .weda-calendar_nextMonth.wedatea2td-icon-arrowright--line {
263
+ .weda-calendar__control_h5
264
+ .weda-calendar_nextMonth.wedatea2td-icon-arrowright--line {
237
265
  right: 16px;
238
266
  }
239
267
 
@@ -336,7 +364,9 @@
336
364
  background: transparent;
337
365
  }
338
366
 
339
- .weda-calendar-h5 .weda-calendar__table-body .weda-calendar__table-body-cell-value {
367
+ .weda-calendar-h5
368
+ .weda-calendar__table-body
369
+ .weda-calendar__table-body-cell-value {
340
370
  font-size: 14px;
341
371
  text-align: center;
342
372
  border-radius: 50%;
@@ -346,37 +376,54 @@
346
376
  box-sizing: border-box;
347
377
  }
348
378
 
349
- .weda-calendar-h5 .weda-calendar__table .weda-calendar__table-body-cell.is-now .weda-calendar__table-body-cell-value {
379
+ .weda-calendar-h5
380
+ .weda-calendar__table
381
+ .weda-calendar__table-body-cell.is-now
382
+ .weda-calendar__table-body-cell-value {
350
383
  color: #fff;
351
384
  }
352
385
 
353
- .weda-calendar-h5 .weda-calendar__table .weda-calendar__table-body-cell.is-now .weda-calendar__table-body-cell-bg {
386
+ .weda-calendar-h5
387
+ .weda-calendar__table
388
+ .weda-calendar__table-body-cell.is-now
389
+ .weda-calendar__table-body-cell-bg {
354
390
  position: absolute;
355
391
  width: 24px;
356
392
  height: 24px;
357
- background: #0052D9;
393
+ background: #0052d9;
358
394
  border-radius: 100%;
359
395
  left: calc(50% - 12px);
360
396
  top: calc(50% - 12px);
361
397
  z-index: -1;
362
398
  }
363
399
 
364
- .weda-calendar-h5 .weda-calendar__table .weda-calendar__table-body-cell .weda-calendar__table-body-cell-marked {
400
+ .weda-calendar-h5
401
+ .weda-calendar__table
402
+ .weda-calendar__table-body-cell
403
+ .weda-calendar__table-body-cell-marked {
365
404
  width: 4px;
366
405
  height: 4px;
367
406
  top: calc(50% + 14px);
368
407
  }
369
408
 
370
- .weda-calendar-h5 .weda-calendar__table .weda-calendar__table-body-cell.is-disabled .weda-calendar__table-body-cell-value {
409
+ .weda-calendar-h5
410
+ .weda-calendar__table
411
+ .weda-calendar__table-body-cell.is-disabled
412
+ .weda-calendar__table-body-cell-value {
371
413
  color: rgba(0, 0, 0, 0.6);
372
414
  }
373
415
 
374
- .weda-calendar-h5 .weda-calendar__table .weda-calendar__table-body-cell.is-invalid {
416
+ .weda-calendar-h5
417
+ .weda-calendar__table
418
+ .weda-calendar__table-body-cell.is-invalid {
375
419
  background: transparent;
376
420
  }
377
421
 
378
- .weda-calendar-h5 .weda-calendar__table .weda-calendar__table-body-cell.is-invalid .weda-calendar__table-body-cell-value {
422
+ .weda-calendar-h5
423
+ .weda-calendar__table
424
+ .weda-calendar__table-body-cell.is-invalid
425
+ .weda-calendar__table-body-cell-value {
379
426
  color: #c5c5c5;
380
427
  }
381
428
 
382
- /* h5 日历样式 end */
429
+ /* h5 日历样式 end */
@@ -1,7 +1,7 @@
1
1
  import { callDataSource, callWedaApi } from '../../../../utils/tcb';
2
2
  import getConfig from '../config/global';
3
3
 
4
- export type IEchartModalBase = typeof EchartBase
4
+ export type IEchartModalBase = typeof EchartBase;
5
5
  export abstract class AbstractEchartBaseModal {
6
6
  abstract setOptions(options: any): Promise<void>;
7
7
  abstract getOptions(option: any): Promise<void>;
@@ -11,18 +11,18 @@ type IReturnData = {
11
11
  value: {
12
12
  Key: string;
13
13
  OperationType: 'count' | 'sum' | 'avg' | 'max' | 'min';
14
- }[],
15
- where: [],
14
+ }[];
15
+ where: [];
16
16
  dimension: {
17
17
  TimeSpan?: string;
18
18
  Key?: string;
19
19
  IsCountEmpty?: boolean;
20
- },
20
+ };
21
21
  group: {
22
22
  TimeSpan?: string;
23
23
  Key?: string;
24
- },
25
- }
24
+ };
25
+ };
26
26
 
27
27
  /**
28
28
  * 图表处理基类
@@ -39,7 +39,6 @@ class EchartBase extends AbstractEchartBaseModal {
39
39
 
40
40
  public async setOptions(options: any): Promise<void> {}
41
41
 
42
-
43
42
  /** 获取所有配置好的图表数据 */
44
43
  public getOptions() {
45
44
  return this.config;
@@ -52,8 +51,8 @@ class EchartBase extends AbstractEchartBaseModal {
52
51
  xStatistics,
53
52
  xIsCountEmpty,
54
53
  yField,
55
- groupKey=({} as Record<string, any>),
56
- groupKeyTimeSpan='',
54
+ groupKey = {} as Record<string, any>,
55
+ groupKeyTimeSpan = '',
57
56
  }) {
58
57
  const objReturnData: IReturnData = {
59
58
  value: [],
@@ -61,28 +60,29 @@ class EchartBase extends AbstractEchartBaseModal {
61
60
  dimension: {},
62
61
  group: {},
63
62
  };
64
- if (filterData && filterData.length > 0) { // 协议转化,把首字母改成大写
63
+ if (filterData && filterData.length > 0) {
64
+ // 协议转化,把首字母改成大写
65
65
  objReturnData.where = filterData.map((val) => {
66
66
  let arrLogicData = val.logicData;
67
67
  if (val.logicData && val.logicData.length > 0) {
68
- arrLogicData = val.logicData.map((mval)=>{
68
+ arrLogicData = val.logicData.map((mval) => {
69
69
  return {
70
70
  Key: mval.key,
71
71
  Rel: mval.rel,
72
72
  Value: mval.value,
73
73
  Logic: mval.logic,
74
74
  Extra: {
75
- Type:mval?.extra?.type,
76
- Format:mval?.extra?.format,
77
- IsExpression:mval?.extra?.isExpression,
75
+ Type: mval?.extra?.type,
76
+ Format: mval?.extra?.format,
77
+ IsExpression: mval?.extra?.isExpression,
78
78
  },
79
- ValueType:mval.valueType,
80
- Expression:mval.expression
79
+ ValueType: mval.valueType,
80
+ Expression: mval.expression,
81
81
  };
82
82
  });
83
83
  }
84
84
  return {
85
- GroupLogic:val.groupLogic,
85
+ GroupLogic: val.groupLogic,
86
86
  LogicData: arrLogicData,
87
87
  };
88
88
  });
@@ -121,7 +121,7 @@ class EchartBase extends AbstractEchartBaseModal {
121
121
  sourceName = '',
122
122
  methods = '',
123
123
  dataSourceType = '',
124
- params,
124
+ params
125
125
  ) {
126
126
  try {
127
127
  if (dataSourceType === 'database') {
@@ -157,20 +157,20 @@ class EchartBase extends AbstractEchartBaseModal {
157
157
  this.config.title.right = null;
158
158
  }
159
159
 
160
- protected setLegend({ isLegend, legend= 'top'}) {
160
+ protected setLegend({ isLegend, legend = 'top' }) {
161
161
  this.config.legend.show = isLegend;
162
162
  switch (legend) {
163
- case 'top' :
163
+ case 'top':
164
164
  this.config.legend.orient = 'horizontal';
165
165
  this.config.legend.x = 'center';
166
166
  this.config.legend.top = '6%';
167
167
  break;
168
- case 'left' :
168
+ case 'left':
169
169
  this.config.legend.orient = 'vertical';
170
170
  this.config.legend.top = '30%';
171
171
  this.config.legend.left = '1%';
172
172
  break;
173
- case 'right' :
173
+ case 'right':
174
174
  this.config.legend.orient = 'vertical';
175
175
  this.config.legend.top = '30%';
176
176
  this.config.legend.right = '6%';
@@ -194,11 +194,11 @@ class EchartBase extends AbstractEchartBaseModal {
194
194
  sortedXAxisData.forEach((itemSource) => {
195
195
  let value = itemSource.XLabel.Value;
196
196
  if (formatType === 'datetime') {
197
- value = this.formatTime(itemSource.XLabel.Value, 'dt');
197
+ value = this.formatTime(itemSource.XLabel.Value, 'dt');
198
198
  } else if (formatType === 'date') {
199
- value = this.formatTime(itemSource.XLabel.Value, 'd');
199
+ value = this.formatTime(itemSource.XLabel.Value, 'd');
200
200
  } else if (formatType === 'time') {
201
- value = this.formatTime(itemSource.XLabel.Value, 't');
201
+ value = this.formatTime(itemSource.XLabel.Value, 't');
202
202
  }
203
203
  xAxisData.push(value);
204
204
  });
@@ -208,16 +208,19 @@ class EchartBase extends AbstractEchartBaseModal {
208
208
  }
209
209
  protected sortXAxisData(arrData, formatType = ''): Array<any> {
210
210
  let xFields = [...arrData];
211
- if(['datetime', 'date', 'time'].includes(formatType)) {
211
+ if (['datetime', 'date', 'time'].includes(formatType)) {
212
212
  xFields.sort((a, b) => {
213
- if(a.XLabel.Value && b.XLabel.Value ) {
214
- return new Date(a.XLabel.Value).getTime() - new Date(b.XLabel.Value).getTime();
213
+ if (a.XLabel.Value && b.XLabel.Value) {
214
+ return (
215
+ new Date(a.XLabel.Value).getTime() -
216
+ new Date(b.XLabel.Value).getTime()
217
+ );
215
218
  }
216
219
  // 产品需求空值放最后
217
- if(!a.XLabel.Value) {
220
+ if (!a.XLabel.Value) {
218
221
  return 1;
219
222
  }
220
- if(!b.XLabel.Value) {
223
+ if (!b.XLabel.Value) {
221
224
  return -1;
222
225
  }
223
226
  });
@@ -232,16 +235,17 @@ class EchartBase extends AbstractEchartBaseModal {
232
235
  * @param { string } timeType 需要格式化的类型 dt:日期时间,d:日期,t:时间
233
236
  * @returns { string } 格式化结果
234
237
  */
235
- private formatTime(time, timeType='dt') {
236
- if(typeof time === 'undefined' || time === null) {
238
+ private formatTime(time, timeType = 'dt') {
239
+ if (typeof time === 'undefined' || time === null) {
237
240
  return '空';
238
241
  }
239
- if (typeof(time) === 'string') { // 如果是字符串,代表后台返回的就是格式化的时间格式,则这里不再做格式化处理
242
+ if (typeof time === 'string') {
243
+ // 如果是字符串,代表后台返回的就是格式化的时间格式,则这里不再做格式化处理
240
244
  return time;
241
245
  }
242
246
  const date = new Date(time + 8 * 3600 * 1000);
243
247
  let startNum = 0;
244
- let endNum = 19;
248
+ let endNum = 19;
245
249
  if (timeType === 'd') {
246
250
  startNum = 0;
247
251
  endNum = 10;
@@ -301,13 +305,18 @@ class EchartBase extends AbstractEchartBaseModal {
301
305
  this.config.xAxis.name = isXaxisName ? xAxisName : '';
302
306
  }
303
307
  // 显示X轴刻度线
304
- protected setIsXaxisAxisTickShow({ isXaxisAxisTickShow }) {
305
- this.config.xAxis.axisTick = {show:isXaxisAxisTickShow};
308
+ protected setIsXaxisAxisTickShow({ isXaxisAxisTickShow }) {
309
+ this.config.xAxis.axisTick = { show: isXaxisAxisTickShow };
306
310
  }
307
311
  // X 轴文字倾斜
308
- protected setIsXaxisAxisLabelRotate({ isXaxisAxisLabelRotate, xStatistics, angle = 30}) {
312
+ protected setIsXaxisAxisLabelRotate({
313
+ isXaxisAxisLabelRotate,
314
+ xStatistics,
315
+ angle = 30,
316
+ }) {
309
317
  this.config.xAxis.axisLabel.rotate = isXaxisAxisLabelRotate ? angle : 0;
310
- if (isXaxisAxisLabelRotate || xStatistics) { // 如果X轴是时间类型,自动斜30度展示
318
+ if (isXaxisAxisLabelRotate || xStatistics) {
319
+ // 如果X轴是时间类型,自动斜30度展示
311
320
  this.config.xAxis.axisLabel.rotate = angle;
312
321
  } else {
313
322
  this.config.xAxis.axisLabel.rotate = 0;
@@ -319,8 +328,10 @@ class EchartBase extends AbstractEchartBaseModal {
319
328
  isYAxisSplitlineLinestyleWidth,
320
329
  yAxisSplitlineLinestyleType,
321
330
  }) {
322
- this.config.yAxis.splitLine = {lineStyle:{}};
323
- this.config.yAxis.splitLine.lineStyle.width = isYAxisSplitlineLinestyleWidth ? 1 : 0;
331
+ this.config.yAxis.splitLine = { lineStyle: {} };
332
+ this.config.yAxis.splitLine.lineStyle.width = isYAxisSplitlineLinestyleWidth
333
+ ? 1
334
+ : 0;
324
335
  this.config.yAxis.splitLine.lineStyle.type = yAxisSplitlineLinestyleType;
325
336
  }
326
337
  // 显示 Y 轴刻度 最大值,最小值
@@ -344,7 +355,9 @@ class EchartBase extends AbstractEchartBaseModal {
344
355
  */
345
356
  protected setEmptyValue(xIsCountEmpty) {
346
357
  if (!xIsCountEmpty) {
347
- const nonEmpty = this.config.xAxis.data.filter(item => item !== undefined && item !== null);
358
+ const nonEmpty = this.config.xAxis.data.filter(
359
+ (item) => item !== undefined && item !== null
360
+ );
348
361
  this.config.xAxis.data = nonEmpty;
349
362
  }
350
363
  }
@@ -357,7 +370,7 @@ class EchartBase extends AbstractEchartBaseModal {
357
370
  private removeEmpty(arrXAxis) {
358
371
  const arrNewxAxis = [];
359
372
  if (arrXAxis.length > 0) {
360
- for(let i = 0; i < arrXAxis.length; i++) {
373
+ for (let i = 0; i < arrXAxis.length; i++) {
361
374
  if (arrXAxis[i]) {
362
375
  arrNewxAxis.push(arrXAxis[i]);
363
376
  }
@@ -1,34 +1,34 @@
1
1
  export interface DataSource {
2
- name:string, // 数据源名
3
- type:string, // 数据源类型
4
- subType:string, // 数据源子类型
5
- provider?:string, // 内置连接器类型
6
- methodName:string // 数据源方法名
2
+ name: string; // 数据源名
3
+ type: string; // 数据源类型
4
+ subType: string; // 数据源子类型
5
+ provider?: string; // 内置连接器类型
6
+ methodName: string; // 数据源方法名
7
7
  }
8
8
  export interface ObjSource {
9
- dataSourceName:string, // 数据源名
10
- dataSourceType:string, // 数据源类型
11
- dataSourceMethodName:string // 数据源方法名
9
+ dataSourceName: string; // 数据源名
10
+ dataSourceType: string; // 数据源类型
11
+ dataSourceMethodName: string; // 数据源方法名
12
12
  }
13
13
  export interface Xfield {
14
- format:string,
15
- type:string,
16
- title:string,
17
- name:string,
14
+ format: string;
15
+ type: string;
16
+ title: string;
17
+ name: string;
18
18
  }
19
19
  enum CountType {
20
- 'count',
21
- 'sum',
22
- 'avg',
23
- 'max',
24
- 'min'
20
+ 'count',
21
+ 'sum',
22
+ 'avg',
23
+ 'max',
24
+ 'min',
25
25
  }
26
26
  export interface YfieldOne {
27
- key:string,
28
- operationType:CountType,
29
- title?:string,
27
+ key: string;
28
+ operationType: CountType;
29
+ title?: string;
30
30
  }
31
31
  export interface Yfield {
32
- groupKey?:string,
33
- numValue?:Array<YfieldOne>,
34
- }
32
+ groupKey?: string;
33
+ numValue?: Array<YfieldOne>;
34
+ }
@@ -17,17 +17,17 @@
17
17
  }
18
18
  .weda-ui-echart .echart-light-box {
19
19
  position: relative;
20
- background-color: #F4F5F6;
20
+ background-color: #f4f5f6;
21
21
  }
22
22
  .weda-ui-echart .echart-light-body {
23
23
  background-color: #ffffff;
24
24
  }
25
25
  .weda-ui-echart .echart-dark-box {
26
26
  position: relative;
27
- background-color: #4B5D6C;
27
+ background-color: #4b5d6c;
28
28
  }
29
29
  .weda-ui-echart .echart-dark-body {
30
- background-color: #1D1F24;
30
+ background-color: #1d1f24;
31
31
  margin: 6px;
32
32
  }
33
33
  .weda-ui-echart .btn-grounp {
@@ -67,20 +67,20 @@
67
67
  user-select: none;
68
68
  transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
69
69
  position: relative;
70
- color: #4B5D6C;
70
+ color: #4b5d6c;
71
71
  background-color: #fff;
72
- border-color: #CCD2D8;
72
+ border-color: #ccd2d8;
73
73
  }
74
74
  .weda-ui-echart .button,
75
- .weda-ui-echart html [type="button"],
76
- .weda-ui-echart [type="reset"],
77
- .weda-ui-echart [type="submit"] {
75
+ .weda-ui-echart html [type='button'],
76
+ .weda-ui-echart [type='reset'],
77
+ .weda-ui-echart [type='submit'] {
78
78
  -webkit-appearance: button;
79
79
  }
80
80
  .weda-ui-echart .ant-btn-primary {
81
81
  color: #fff;
82
- background-color: #4A62E7;
83
- border-color: #4A62E7;
82
+ background-color: #4a62e7;
83
+ border-color: #4a62e7;
84
84
  }
85
85
  .weda-ui-echart .ant-btn:not([disabled]):hover {
86
86
  text-decoration: none;
@@ -94,9 +94,9 @@
94
94
  }
95
95
  .weda-ui-echart .ant-btn:hover,
96
96
  .weda-ui-echart .ant-btn:focus {
97
- color: #4A62E7;
97
+ color: #4a62e7;
98
98
  background-color: #fff;
99
- border-color: #4A62E7;
99
+ border-color: #4a62e7;
100
100
  }
101
101
  .weda-ui-echart .ant-btn-primary:hover,
102
102
  .weda-ui-echart .ant-btn-primary:focus {
@@ -7,7 +7,7 @@ import {
7
7
  TitleComponent,
8
8
  TooltipComponent,
9
9
  LegendComponent,
10
- GridComponent
10
+ GridComponent,
11
11
  } from 'echarts/components';
12
12
  // 标签自动布局,全局过渡动画等特性
13
13
  import { LabelLayout, UniversalTransition } from 'echarts/features';
@@ -25,9 +25,7 @@ echarts.use([
25
25
  CanvasRenderer,
26
26
  BarChart,
27
27
  LineChart,
28
- PieChart
28
+ PieChart,
29
29
  ]);
30
30
 
31
- export {
32
- echarts
33
- };
31
+ export { echarts };