@cloudbase/weda-ui 2.0.11 → 2.0.27

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 (262) hide show
  1. package/README.md +1 -0
  2. package/package.json +39 -35
  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 +14 -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 +44 -45
  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 +68 -68
  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 +89 -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/mp/components/calendar/index.js +4 -1
  40. package/src/mp/components/calendar/index.json +3 -2
  41. package/src/mp/components/calendar/index.wxml +6 -28
  42. package/src/mp/components/calendar/index.wxss +17 -16
  43. package/src/mp/components/carousel/index.json +1 -1
  44. package/src/mp/components/carousel/index.wxml +3 -30
  45. package/src/mp/components/chart/bar/index.wxml +1 -6
  46. package/src/mp/components/chart/ec-canvas/ec-canvas.json +1 -1
  47. package/src/mp/components/chart/ec-canvas/ec-canvas.wxml +2 -19
  48. package/src/mp/components/chart/line/index.wxml +1 -6
  49. package/src/mp/components/chart/pie/index.wxml +1 -6
  50. package/src/mp/components/chart/statisticsCard/index.wxml +1 -5
  51. package/src/mp/components/chart/statisticsCard/index.wxss +7 -10
  52. package/src/mp/components/dataView/index.wxml +1 -13
  53. package/src/mp/components/form/checkbox/index.js +5 -1
  54. package/src/mp/components/form/checkbox/index.wxml +3 -18
  55. package/src/mp/components/form/formcell/index.wxss +5 -0
  56. package/src/mp/components/form/input/index.js +1 -1
  57. package/src/mp/components/form/input/index.wxml +3 -16
  58. package/src/mp/components/form/input/index.wxss +7 -1
  59. package/src/mp/components/form/location/components/mapChoose/index.json +1 -1
  60. package/src/mp/components/form/location/components/mapChoose/index.wxml +11 -58
  61. package/src/mp/components/form/location/index.js +7 -1
  62. package/src/mp/components/form/location/index.json +1 -1
  63. package/src/mp/components/form/location/index.wxml +7 -43
  64. package/src/mp/components/form/radio/index.js +5 -1
  65. package/src/mp/components/form/radio/index.wxml +2 -14
  66. package/src/mp/components/form/select/index.js +2 -2
  67. package/src/mp/components/form/select/index.wxml +3 -33
  68. package/src/mp/components/form/select/index.wxss +9 -0
  69. package/src/mp/components/form/switch/index.wxml +2 -13
  70. package/src/mp/components/form/textarea/index.js +6 -0
  71. package/src/mp/components/form/textarea/index.wxml +4 -23
  72. package/src/mp/components/form/textarea/index.wxss +5 -0
  73. package/src/mp/components/form/uploader/index.wxml +2 -20
  74. package/src/mp/components/form/uploader/weui-uploader.json +6 -6
  75. package/src/mp/components/form/uploader/weui-uploader.wxml +10 -53
  76. package/src/mp/components/form/uploaderFile/index.wxml +14 -71
  77. package/src/mp/components/graphicCard/index.js +9 -11
  78. package/src/mp/components/graphicCard/index.wxml +6 -34
  79. package/src/mp/components/graphicCard/index.wxss +6 -6
  80. package/src/mp/components/image/index.wxml +3 -21
  81. package/src/mp/components/listView/index.wxml +8 -33
  82. package/src/mp/components/listView/index.wxss +2 -2
  83. package/src/mp/components/lottery/index.wxml +7 -31
  84. package/src/mp/components/navLayout/index.js +9 -12
  85. package/src/mp/components/navLayout/index.wxml +6 -30
  86. package/src/mp/components/navLayout/index.wxss +10 -10
  87. package/src/mp/components/navigationBar/index.json +1 -2
  88. package/src/mp/components/navigationBar/index.wxml +29 -146
  89. package/src/mp/components/navigationBar/index.wxss +10 -10
  90. package/src/mp/components/richText/index.wxml +1 -1
  91. package/src/mp/components/richText/index.wxss +7 -5
  92. package/src/mp/components/swiper/index.wxml +1 -14
  93. package/src/mp/components/tabs/index.json +1 -1
  94. package/src/mp/components/tabs/index.wxml +3 -22
  95. package/src/mp/components/tabs/index.wxss +1 -2
  96. package/src/mp/components/text/index.wxml +1 -7
  97. package/src/mp/components/wedaVideo/index.js +86 -0
  98. package/src/mp/components/wedaVideo/index.json +4 -0
  99. package/src/mp/components/wedaVideo/index.wxml +4 -0
  100. package/src/mp/components/wedaVideo/index.wxss +20 -0
  101. package/src/mp/components/wxOpenApi/phone/index.js +1 -9
  102. package/src/mp/components/wxOpenApi/phone/index.wxml +1 -11
  103. package/src/mp/components/wxOpenApi/phoneCode/index.json +1 -1
  104. package/src/mp/components/wxOpenApi/phoneCode/index.wxml +1 -11
  105. package/src/mp/components/wxOpenApi/share/index.wxml +1 -11
  106. package/src/mp/components/wxOpenApi/userInfo/index.wxml +1 -10
  107. package/src/mp/index.json +1 -0
  108. package/src/mp/style/weda-ui.wxss +16 -6
  109. package/src/web/actions/showModal/index.tsx +5 -4
  110. package/src/web/components/calendar/index.css +99 -65
  111. package/src/web/components/chart/common/core/eChartBase.ts +55 -42
  112. package/src/web/components/chart/common/core/type.ts +23 -23
  113. package/src/web/components/chart/common/echart.css +12 -12
  114. package/src/web/components/chart/common/echarts.ts +3 -5
  115. package/src/web/components/chart/common/useChart.tsx +34 -16
  116. package/src/web/components/chart/statisticsCard/index.css +9 -8
  117. package/src/web/components/container/index.tsx +3 -4
  118. package/src/web/components/drawer/index.tsx +15 -4
  119. package/src/web/components/form/checkbox/index.tsx +32 -31
  120. package/src/web/components/form/enumSelect/NormalSelect.tsx +0 -2
  121. package/src/web/components/form/form/index.css +3 -6
  122. package/src/web/components/form/form/index.tsx +2 -1
  123. package/src/web/components/form/formcell/index.css +6 -17
  124. package/src/web/components/form/formcell/index.tsx +2 -6
  125. package/src/web/components/form/input/index.css +8 -4
  126. package/src/web/components/form/input/index.tsx +61 -53
  127. package/src/web/components/form/location/common/mapChoose.css +13 -11
  128. package/src/web/components/form/location/common/selectModal.jsx +2 -11
  129. package/src/web/components/form/location/common/useLocationInfo.js +4 -0
  130. package/src/web/components/form/location/components/LocationH5/index.css +19 -20
  131. package/src/web/components/form/location/components/LocationH5/location.h5.jsx +11 -1
  132. package/src/web/components/form/location/components/LocationPC/Header.jsx +0 -13
  133. package/src/web/components/form/location/components/LocationPC/location.PC.jsx +14 -5
  134. package/src/web/components/form/radio/index.tsx +32 -26
  135. package/src/web/components/form/renderDecorator.tsx +23 -26
  136. package/src/web/components/form/select/h5.tsx +2 -2
  137. package/src/web/components/form/select/index.css +9 -0
  138. package/src/web/components/form/select/index.tsx +76 -49
  139. package/src/web/components/form/select/region/index.ts +101 -80
  140. package/src/web/components/form/select/year.tsx +2 -0
  141. package/src/web/components/form/switch/index.tsx +40 -40
  142. package/src/web/components/form/textarea/index.css +4 -0
  143. package/src/web/components/form/textarea/index.tsx +38 -25
  144. package/src/web/components/form/types.d.ts +10 -10
  145. package/src/web/components/form/uploader/index.css +10 -0
  146. package/src/web/components/form/uploader/uploader.h5.tsx +3 -6
  147. package/src/web/components/form/uploader/uploader.pc.tsx +3 -6
  148. package/src/web/components/form/uploaderFile/index.css +24 -23
  149. package/src/web/components/form/uploaderFile/index.jsx +0 -5
  150. package/src/web/components/form/uploaderFile/uploadFile.h5.tsx +24 -15
  151. package/src/web/components/form/uploaderFile/uploadFile.pc.tsx +21 -13
  152. package/src/web/components/graphicCard/index.css +6 -6
  153. package/src/web/components/image/image.tsx +2 -2
  154. package/src/web/components/image/index.css +9 -7
  155. package/src/web/components/image/index.tsx +28 -11
  156. package/src/web/components/index.js +1 -0
  157. package/src/web/components/link/index.tsx +12 -12
  158. package/src/web/components/listView/index.css +8 -8
  159. package/src/web/components/lottery/index.css +43 -37
  160. package/src/web/components/lottery/index.tsx +3 -3
  161. package/src/web/components/modal/index.tsx +34 -34
  162. package/src/web/components/navLayout/index.css +25 -25
  163. package/src/web/components/navigationBar/index.css +26 -26
  164. package/src/web/components/picker/datePicker.tsx +3 -3
  165. package/src/web/components/picker/picker.tsx +3 -3
  166. package/src/web/components/richText/index.jsx +41 -46
  167. package/src/web/components/richTextView/index.css +7 -3
  168. package/src/web/components/richTextView/index.tsx +4 -6
  169. package/src/web/components/scrollView/index.tsx +2 -2
  170. package/src/web/components/slot/index.tsx +3 -4
  171. package/src/web/components/swiper/index.css +1 -1
  172. package/src/web/components/swiper/index.tsx +33 -15
  173. package/src/web/components/tabs/index.css +2 -3
  174. package/src/web/components/tabs/index.tsx +6 -6
  175. package/src/web/components/tabs/tabs.h5.tsx +17 -12
  176. package/src/web/components/tabs/tabs.pc.tsx +45 -34
  177. package/src/web/components/text/index.css +1 -1
  178. package/src/web/components/wedaVideo/index.css +42 -0
  179. package/src/web/components/wedaVideo/index.tsx +208 -0
  180. package/src/web/utils/constant.ts +2 -1
  181. package/src/web/utils/loading-fallback.tsx +2 -2
  182. package/src/web/utils/lodash.ts +1 -1
  183. package/src/web/utils/platform.js +13 -0
  184. package/src/web/utils/useSetState.ts +6 -2
  185. package/src/web/weda-ui.css +23 -8
  186. package/src/docs/common/format.tsx +0 -112
  187. package/src/docs/common/tableView.css +0 -164
  188. package/src/docs/common/tableView.tsx +0 -273
  189. package/src/docs/compsdocs/chart/Bar.mdx +0 -159
  190. package/src/docs/compsdocs/chart/Line.mdx +0 -100
  191. package/src/docs/compsdocs/chart/Pie.mdx +0 -83
  192. package/src/docs/compsdocs/chart/_category_.json +0 -1
  193. package/src/docs/compsdocs/chart/statisticsCard.mdx +0 -51
  194. package/src/docs/compsdocs/database/DataView.mdx +0 -33
  195. package/src/docs/compsdocs/database/ListView.mdx +0 -33
  196. package/src/docs/compsdocs/database/_category_.json +0 -1
  197. package/src/docs/compsdocs/form/Form.mdx +0 -35
  198. package/src/docs/compsdocs/form/FormCheckbox.mdx +0 -35
  199. package/src/docs/compsdocs/form/FormDate.mdx +0 -30
  200. package/src/docs/compsdocs/form/FormEmail.mdx +0 -30
  201. package/src/docs/compsdocs/form/FormImageUploader.mdx +0 -31
  202. package/src/docs/compsdocs/form/FormInput.mdx +0 -30
  203. package/src/docs/compsdocs/form/FormLocation.mdx +0 -64
  204. package/src/docs/compsdocs/form/FormPhone.mdx +0 -30
  205. package/src/docs/compsdocs/form/FormRadio.mdx +0 -35
  206. package/src/docs/compsdocs/form/FormRegion.mdx +0 -30
  207. package/src/docs/compsdocs/form/FormSelect.mdx +0 -36
  208. package/src/docs/compsdocs/form/FormSwitch.mdx +0 -30
  209. package/src/docs/compsdocs/form/FormTextarea.mdx +0 -30
  210. package/src/docs/compsdocs/form/FormTime.mdx +0 -30
  211. package/src/docs/compsdocs/form/FormUploadFile.mdx +0 -30
  212. package/src/docs/compsdocs/form/FormUrl.mdx +0 -30
  213. package/src/docs/compsdocs/form/_category_.json +0 -1
  214. package/src/docs/compsdocs/grid/Card.mdx +0 -32
  215. package/src/docs/compsdocs/grid/Container.mdx +0 -42
  216. package/src/docs/compsdocs/grid/Footer.mdx +0 -31
  217. package/src/docs/compsdocs/grid/GridLayout.mdx +0 -32
  218. package/src/docs/compsdocs/grid/Header.mdx +0 -31
  219. package/src/docs/compsdocs/grid/Layout.mdx +0 -25
  220. package/src/docs/compsdocs/grid/List.mdx +0 -31
  221. package/src/docs/compsdocs/grid/ScrollView.mdx +0 -37
  222. package/src/docs/compsdocs/grid/Swiper.mdx +0 -58
  223. package/src/docs/compsdocs/grid/_category_.json +0 -1
  224. package/src/docs/compsdocs/media/Icon.mdx +0 -31
  225. package/src/docs/compsdocs/media/Image.mdx +0 -55
  226. package/src/docs/compsdocs/media/_category_.json +0 -1
  227. package/src/docs/compsdocs/model/ModelCreate.mdx +0 -20
  228. package/src/docs/compsdocs/model/ModelDetail.mdx +0 -20
  229. package/src/docs/compsdocs/model/ModelTable.mdx +0 -24
  230. package/src/docs/compsdocs/model/ModelUpdate.mdx +0 -21
  231. package/src/docs/compsdocs/model/PageLayout.mdx +0 -21
  232. package/src/docs/compsdocs/model/_category_.json +0 -1
  233. package/src/docs/compsdocs/navmenu/Classification.mdx +0 -38
  234. package/src/docs/compsdocs/navmenu/NavBar.mdx +0 -43
  235. package/src/docs/compsdocs/navmenu/NavLayout.mdx +0 -30
  236. package/src/docs/compsdocs/navmenu/TabBar.mdx +0 -43
  237. package/src/docs/compsdocs/navmenu/TabBarItem.mdx +0 -29
  238. package/src/docs/compsdocs/navmenu/_category_.json +0 -1
  239. package/src/docs/compsdocs/senior/Lottery.mdx +0 -48
  240. package/src/docs/compsdocs/senior/Modal.mdx +0 -58
  241. package/src/docs/compsdocs/senior/SlotMachine.mdx +0 -52
  242. package/src/docs/compsdocs/senior/_category_.json +0 -1
  243. package/src/docs/compsdocs/show/Calendar.mdx +0 -29
  244. package/src/docs/compsdocs/show/Divider.mdx +0 -31
  245. package/src/docs/compsdocs/show/GraphicCard.mdx +0 -30
  246. package/src/docs/compsdocs/show/Item.mdx +0 -32
  247. package/src/docs/compsdocs/show/ItemList.mdx +0 -47
  248. package/src/docs/compsdocs/show/Media.mdx +0 -25
  249. package/src/docs/compsdocs/show/StatusTip.mdx +0 -25
  250. package/src/docs/compsdocs/show/Swiper.mdx +0 -33
  251. package/src/docs/compsdocs/show/Tabs.mdx +0 -38
  252. package/src/docs/compsdocs/show/_category_.json +0 -1
  253. package/src/docs/compsdocs/show/button.mdx +0 -25
  254. package/src/docs/compsdocs/text/Link.mdx +0 -43
  255. package/src/docs/compsdocs/text/RichTextView.mdx +0 -36
  256. package/src/docs/compsdocs/text/Text.mdx +0 -31
  257. package/src/docs/compsdocs/text/Title.mdx +0 -32
  258. package/src/docs/compsdocs/text/_category_.json +0 -1
  259. package/src/docs/compsdocs/wxOpen/Phone.mdx +0 -60
  260. package/src/docs/compsdocs/wxOpen/Share.mdx +0 -46
  261. package/src/docs/compsdocs/wxOpen/UserInfo.mdx +0 -60
  262. package/src/docs/compsdocs/wxOpen/_category_.json +0 -4
@@ -2,8 +2,10 @@ import * as ReactDOM from 'react-dom';
2
2
  import * as React from 'react';
3
3
  import { forwardRef, useState, useEffect, useImperativeHandle } from 'react';
4
4
  import { Modal, Button, Text, ModalProps, ConfigProvider } from 'tea-component';
5
- import type { ModalShowHandle, ModalShowOptions } from 'tea-component/lib/modal/ModalShow';
6
-
5
+ import type {
6
+ ModalShowHandle,
7
+ ModalShowOptions,
8
+ } from 'tea-component/lib/modal/ModalShow';
7
9
 
8
10
  interface ModalShowInstance {
9
11
  setVisible: React.Dispatch<React.SetStateAction<boolean>>;
@@ -26,9 +28,8 @@ const ModalShow = forwardRef(function ModalShow(
26
28
  return <Modal {...props} visible={visible} />;
27
29
  });
28
30
 
29
-
30
31
  function show(options: ModalShowOptions): ModalShowHandle {
31
- const el = document.createElement("div");
32
+ const el = document.createElement('div');
32
33
 
33
34
  const instanceRef = React.createRef<ModalShowInstance>();
34
35
 
@@ -1,11 +1,16 @@
1
- /* weda_calendar */
1
+ /* weda_calendar */
2
+
3
+ .weda-calendar {
4
+ font-size: 14px;
5
+ }
2
6
 
3
7
  /* pc 日历样式 start */
4
8
  .weda-calendar.weda-calendar-pc {
5
- background: #FFFFFF;
6
- border: 0.5px solid #DCDCDC;
9
+ background: #ffffff;
10
+ border: 0.5px solid #dcdcdc;
7
11
  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);
12
+ box-shadow: 0px 3px 14px 2px rgba(0, 0, 0, 0.05),
13
+ 0px 8px 10px 1px rgba(0, 0, 0, 0.06), 0px 5px 5px -3px rgba(0, 0, 0, 0.1);
9
14
  border-radius: 3px;
10
15
  min-width: 560px;
11
16
  }
@@ -45,31 +50,22 @@
45
50
  margin-right: 0;
46
51
  }
47
52
 
48
- .weda-calendar-pc .weda-calendar__control-section .weda-calendar__control-section-cell {
53
+ .weda-calendar-pc
54
+ .weda-calendar__control-section
55
+ .weda-calendar__control-section-cell {
49
56
  height: 100%;
50
57
  margin-right: 8px;
51
58
  }
52
59
 
53
- .weda-calendar-pc .weda-calendar__control-section .weda-calendar__control-section-cell:last-child {
60
+ .weda-calendar-pc
61
+ .weda-calendar__control-section
62
+ .weda-calendar__control-section-cell:last-child {
54
63
  margin-right: 0;
55
64
  }
56
65
 
57
- .weda-calendar-pc .weda-calendar__control-section .tea-dropdown .tea-dropdown__header {
58
- background: #E7E7E7;
59
- border-radius: 3px;
60
- padding: 5px 32px 5px 12px;
61
- height: 32px;
62
-
63
- }
64
-
65
- .weda-calendar-pc .weda-calendar__control-section .tea-dropdown .tea-dropdown__value {
66
- font-size: 14px;
67
- line-height: 22px;
68
- }
69
-
70
66
  .weda-calendar-pc .weda-calendar__control_pc .weda-calendar__current-date {
71
- font-size: 14px;
72
- line-height: 22px;
67
+ font-size: 1em;
68
+ line-height: 1.57142em;
73
69
  color: rgba(0, 0, 0, 0.9);
74
70
  }
75
71
 
@@ -81,6 +77,7 @@
81
77
  }
82
78
 
83
79
  .weda-calendar .weda-calendar__table {
80
+ font-size: inherit;
84
81
  border-collapse: collapse;
85
82
  border-spacing: 0;
86
83
  width: 100%;
@@ -116,15 +113,17 @@
116
113
  justify-content: flex-end;
117
114
  height: 100%;
118
115
  padding: 0;
119
- font-size: 14px;
120
- line-height: 22px;
116
+ font-size: 1em;
117
+ line-height: 1.57142em;
121
118
  color: rgba(0, 0, 0, 0.6);
122
119
  margin-right: 12px;
123
120
  position: relative;
124
121
  }
125
122
 
126
123
  .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 {
124
+ .weda-calendar
125
+ .weda-calendar__table
126
+ .weda-calendar__table-body-cell:last-child {
128
127
  margin-right: 0;
129
128
  }
130
129
 
@@ -136,7 +135,7 @@
136
135
  flex: 1;
137
136
  -webkit-box-flex: 1;
138
137
  -ms-flex: 1;
139
- border-top: 1px solid #E7E7E7;
138
+ border-top: 1px solid #e7e7e7;
140
139
  padding: 0;
141
140
  height: 87.4px;
142
141
  display: flex;
@@ -156,34 +155,46 @@
156
155
  color: rgba(0, 0, 0, 0.26);
157
156
  }
158
157
 
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 {
158
+ .weda-calendar
159
+ .weda-calendar__table
160
+ .weda-calendar__table-body-cell.is-disabled,
161
+ .weda-calendar
162
+ .weda-calendar__table
163
+ .weda-calendar__table-body-cell.is-invalid {
161
164
  cursor: not-allowed;
162
165
  }
163
166
 
164
- .weda-calendar .weda-calendar__table .weda-calendar__table-body-cell.is-invalid {
165
- background: #F3F3F3;
167
+ .weda-calendar
168
+ .weda-calendar__table
169
+ .weda-calendar__table-body-cell.is-invalid {
170
+ background: #f3f3f3;
166
171
  }
167
172
 
168
173
  .weda-calendar .weda-calendar__table .weda-calendar__table-body-cell.is-now {
169
- border-top-color: #0052D9;
170
- background: #ECF2FE;
174
+ border-top-color: #0052d9;
175
+ background: #ecf2fe;
171
176
  }
172
177
 
173
178
  .weda-calendar .weda-calendar__table .weda-calendar__table-body-cell-value {
174
- font-size: 14px;
179
+ font-size: 1em;
175
180
  font-weight: 400;
176
- line-height: 22px;
181
+ line-height: 1.57142em;
177
182
  color: rgba(0, 0, 0, 0.9);
178
183
  margin-top: 3px;
179
184
  position: relative;
180
185
  }
181
186
 
182
- .weda-calendar .weda-calendar__table .weda-calendar__table-body-cell.is-disabled .weda-calendar__table-body-cell-value {
187
+ .weda-calendar
188
+ .weda-calendar__table
189
+ .weda-calendar__table-body-cell.is-disabled
190
+ .weda-calendar__table-body-cell-value {
183
191
  color: rgba(0, 0, 0, 0.26);
184
192
  }
185
193
 
186
- .weda-calendar .weda-calendar__table .weda-calendar__table-body-cell .weda-calendar__table-body-cell-marked {
194
+ .weda-calendar
195
+ .weda-calendar__table
196
+ .weda-calendar__table-body-cell
197
+ .weda-calendar__table-body-cell-marked {
187
198
  position: absolute;
188
199
  width: 6px;
189
200
  height: 6px;
@@ -198,7 +209,7 @@
198
209
  /* h5 日历样式 start */
199
210
 
200
211
  .weda-calendar.weda-calendar-h5 {
201
- background: #FFFFFF;
212
+ background: #ffffff;
202
213
  width: 100%;
203
214
  opacity: 0.9;
204
215
  }
@@ -222,29 +233,33 @@
222
233
  background-position: center;
223
234
  }
224
235
 
225
- .weda-calendar__control_h5 .weda-calendar_prevMonth.wedatea2td-icon-arrowleft--line,
226
- .weda-calendar__control_h5 .weda-calendar_nextMonth.wedatea2td-icon-arrowright--line {
236
+ .weda-calendar__control_h5
237
+ .weda-calendar_prevMonth.wedatea2td-icon-arrowleft--line,
238
+ .weda-calendar__control_h5
239
+ .weda-calendar_nextMonth.wedatea2td-icon-arrowright--line {
227
240
  position: absolute;
228
241
  top: 17px;
229
- width: 20px;
230
- height: 20px;
242
+ width: 1.42857em;
243
+ height: 1.42857em;
231
244
  }
232
245
 
233
- .weda-calendar__control_h5 .weda-calendar_prevMonth.wedatea2td-icon-arrowleft--line {
246
+ .weda-calendar__control_h5
247
+ .weda-calendar_prevMonth.wedatea2td-icon-arrowleft--line {
234
248
  left: 16px;
235
249
  }
236
- .weda-calendar__control_h5 .weda-calendar_nextMonth.wedatea2td-icon-arrowright--line {
250
+ .weda-calendar__control_h5
251
+ .weda-calendar_nextMonth.wedatea2td-icon-arrowright--line {
237
252
  right: 16px;
238
253
  }
239
254
 
240
255
  .weda-calendar__control_h5 .weda-calendar__current-date {
241
- font-size: 14px;
242
- line-height: 22px;
256
+ font-size: 1em;
257
+ line-height: 1.57142em;
243
258
  font-weight: bold;
244
259
  }
245
260
 
246
261
  .weda-calendar-h5 .weda-calendar__panel {
247
- height: 306px;
262
+ height: 21.85714em;
248
263
  padding: 20px 16px 16px 16px;
249
264
  width: 100%;
250
265
  box-sizing: border-box;
@@ -271,7 +286,7 @@
271
286
  }
272
287
 
273
288
  .weda-calendar-h5 .weda-calendar__table .weda-calendar__table-head-cell {
274
- font-size: 12px;
289
+ font-size: 0.85714em;
275
290
  line-height: 20px;
276
291
  width: 100%;
277
292
  height: 100%;
@@ -279,8 +294,8 @@
279
294
  -webkit-box-pack: center;
280
295
  -ms-flex-pack: center;
281
296
  justify-content: center;
282
- font-size: 12px;
283
- line-height: 20px;
297
+ font-size: 0.85714em;
298
+ line-height: 1.428571em;
284
299
  -webkit-box-sizing: border-box;
285
300
  box-sizing: border-box;
286
301
  }
@@ -318,8 +333,8 @@
318
333
  -webkit-box-pack: center;
319
334
  -ms-flex-pack: center;
320
335
  justify-content: center;
321
- font-size: 12px;
322
- line-height: 20px;
336
+ font-size: 0.85714em;
337
+ line-height: 1.42857em;
323
338
  -webkit-box-sizing: border-box;
324
339
  box-sizing: border-box;
325
340
  -webkit-box-pack: center;
@@ -336,47 +351,66 @@
336
351
  background: transparent;
337
352
  }
338
353
 
339
- .weda-calendar-h5 .weda-calendar__table-body .weda-calendar__table-body-cell-value {
340
- font-size: 14px;
354
+ .weda-calendar-h5
355
+ .weda-calendar__table-body
356
+ .weda-calendar__table-body-cell-value {
357
+ font-size: 1em;
341
358
  text-align: center;
342
359
  border-radius: 50%;
343
360
  width: 40px;
344
- line-height: 40px;
361
+ line-height: 2.85714em;
345
362
  margin: 0;
346
363
  box-sizing: border-box;
347
364
  }
348
365
 
349
- .weda-calendar-h5 .weda-calendar__table .weda-calendar__table-body-cell.is-now .weda-calendar__table-body-cell-value {
366
+ .weda-calendar-h5
367
+ .weda-calendar__table
368
+ .weda-calendar__table-body-cell.is-now
369
+ .weda-calendar__table-body-cell-value {
350
370
  color: #fff;
351
371
  }
352
372
 
353
- .weda-calendar-h5 .weda-calendar__table .weda-calendar__table-body-cell.is-now .weda-calendar__table-body-cell-bg {
373
+ .weda-calendar-h5
374
+ .weda-calendar__table
375
+ .weda-calendar__table-body-cell.is-now
376
+ .weda-calendar__table-body-cell-bg {
354
377
  position: absolute;
355
- width: 24px;
356
- height: 24px;
357
- background: #0052D9;
378
+ width: 1.714285em;
379
+ height: 1.714285em;
380
+ background: #0052d9;
358
381
  border-radius: 100%;
359
- left: calc(50% - 12px);
360
- top: calc(50% - 12px);
382
+ left: calc(50% - 0.85714em);
383
+ top: calc(50% - 0.85714em);
361
384
  z-index: -1;
362
385
  }
363
386
 
364
- .weda-calendar-h5 .weda-calendar__table .weda-calendar__table-body-cell .weda-calendar__table-body-cell-marked {
387
+ .weda-calendar-h5
388
+ .weda-calendar__table
389
+ .weda-calendar__table-body-cell
390
+ .weda-calendar__table-body-cell-marked {
365
391
  width: 4px;
366
392
  height: 4px;
367
393
  top: calc(50% + 14px);
368
394
  }
369
395
 
370
- .weda-calendar-h5 .weda-calendar__table .weda-calendar__table-body-cell.is-disabled .weda-calendar__table-body-cell-value {
396
+ .weda-calendar-h5
397
+ .weda-calendar__table
398
+ .weda-calendar__table-body-cell.is-disabled
399
+ .weda-calendar__table-body-cell-value {
371
400
  color: rgba(0, 0, 0, 0.6);
372
401
  }
373
402
 
374
- .weda-calendar-h5 .weda-calendar__table .weda-calendar__table-body-cell.is-invalid {
403
+ .weda-calendar-h5
404
+ .weda-calendar__table
405
+ .weda-calendar__table-body-cell.is-invalid {
375
406
  background: transparent;
376
407
  }
377
408
 
378
- .weda-calendar-h5 .weda-calendar__table .weda-calendar__table-body-cell.is-invalid .weda-calendar__table-body-cell-value {
409
+ .weda-calendar-h5
410
+ .weda-calendar__table
411
+ .weda-calendar__table-body-cell.is-invalid
412
+ .weda-calendar__table-body-cell-value {
379
413
  color: #c5c5c5;
380
414
  }
381
415
 
382
- /* h5 日历样式 end */
416
+ /* 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
+ }