@cloudbase/weda-ui 0.2.17 → 2.0.8

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 (269) hide show
  1. package/README.md +3 -0
  2. package/package.json +10 -5
  3. package/src/configs/components/button.json +0 -2
  4. package/src/configs/components/calendar.json +9 -3
  5. package/src/configs/components/carousel.json +18 -9
  6. package/src/configs/components/chart/bar.json +31 -12
  7. package/src/configs/components/chart/line.json +27 -10
  8. package/src/configs/components/chart/pie.json +22 -8
  9. package/src/configs/components/chart/statisticsCard.json +61 -13
  10. package/src/configs/components/container.json +7 -2
  11. package/src/configs/components/dataView.json +31 -11
  12. package/src/configs/components/form/checkbox.json +97 -5
  13. package/src/configs/components/form/radio.json +123 -4
  14. package/src/configs/components/form/select.json +247 -13
  15. package/src/configs/components/graphicCard.json +90 -75
  16. package/src/configs/components/image.json +19 -8
  17. package/src/configs/components/link.json +25 -6
  18. package/src/configs/components/listView.json +83 -27
  19. package/src/configs/components/lottery.json +153 -0
  20. package/src/configs/components/modal.json +37 -5
  21. package/src/configs/components/navLayout.json +97 -79
  22. package/src/configs/components/navigationBar.json +59 -0
  23. package/src/configs/components/richtextview.json +6 -2
  24. package/src/configs/components/scrollVeiw.json +98 -34
  25. package/src/configs/components/swiper.json +22 -10
  26. package/src/configs/components/tabs.json +54 -9
  27. package/src/configs/components/text.json +43 -30
  28. package/src/configs/components/wxOpenApi/phone.json +141 -0
  29. package/src/configs/components/wxOpenApi/phoneCode.json +121 -0
  30. package/src/configs/components/wxOpenApi/share.json +167 -0
  31. package/src/configs/components/wxOpenApi/userInfo.json +174 -0
  32. package/src/configs/index.js +13 -0
  33. package/src/docs/common/format.tsx +112 -0
  34. package/src/docs/common/tableView.css +164 -0
  35. package/src/docs/common/tableView.tsx +273 -0
  36. package/src/docs/compsdocs/chart/Bar.mdx +159 -0
  37. package/src/docs/compsdocs/chart/Line.mdx +100 -0
  38. package/src/docs/compsdocs/chart/Pie.mdx +83 -0
  39. package/src/docs/compsdocs/chart/_category_.json +1 -0
  40. package/src/docs/compsdocs/chart/statisticsCard.mdx +51 -0
  41. package/src/docs/compsdocs/database/DataView.mdx +33 -0
  42. package/src/docs/compsdocs/database/ListView.mdx +33 -0
  43. package/src/docs/compsdocs/database/_category_.json +1 -0
  44. package/src/docs/compsdocs/form/Form.mdx +35 -0
  45. package/src/docs/compsdocs/form/FormCheckbox.mdx +35 -0
  46. package/src/docs/compsdocs/form/FormDate.mdx +30 -0
  47. package/src/docs/compsdocs/form/FormEmail.mdx +30 -0
  48. package/src/docs/compsdocs/form/FormImageUploader.mdx +31 -0
  49. package/src/docs/compsdocs/form/FormInput.mdx +30 -0
  50. package/src/docs/compsdocs/form/FormLocation.mdx +64 -0
  51. package/src/docs/compsdocs/form/FormPhone.mdx +30 -0
  52. package/src/docs/compsdocs/form/FormRadio.mdx +35 -0
  53. package/src/docs/compsdocs/form/FormRegion.mdx +30 -0
  54. package/src/docs/compsdocs/form/FormSelect.mdx +36 -0
  55. package/src/docs/compsdocs/form/FormSwitch.mdx +30 -0
  56. package/src/docs/compsdocs/form/FormTextarea.mdx +30 -0
  57. package/src/docs/compsdocs/form/FormTime.mdx +30 -0
  58. package/src/docs/compsdocs/form/FormUploadFile.mdx +30 -0
  59. package/src/docs/compsdocs/form/FormUrl.mdx +30 -0
  60. package/src/docs/compsdocs/form/_category_.json +1 -0
  61. package/src/docs/compsdocs/grid/Card.mdx +32 -0
  62. package/src/docs/compsdocs/grid/Container.mdx +42 -0
  63. package/src/docs/compsdocs/grid/Footer.mdx +31 -0
  64. package/src/docs/compsdocs/grid/GridLayout.mdx +32 -0
  65. package/src/docs/compsdocs/grid/Header.mdx +31 -0
  66. package/src/docs/compsdocs/grid/Layout.mdx +25 -0
  67. package/src/docs/compsdocs/grid/List.mdx +31 -0
  68. package/src/docs/compsdocs/grid/ScrollView.mdx +37 -0
  69. package/src/docs/compsdocs/grid/Swiper.mdx +58 -0
  70. package/src/docs/compsdocs/grid/_category_.json +1 -0
  71. package/src/docs/compsdocs/media/Icon.mdx +31 -0
  72. package/src/docs/compsdocs/media/Image.mdx +55 -0
  73. package/src/docs/compsdocs/media/_category_.json +1 -0
  74. package/src/docs/compsdocs/model/ModelCreate.mdx +20 -0
  75. package/src/docs/compsdocs/model/ModelDetail.mdx +20 -0
  76. package/src/docs/compsdocs/model/ModelTable.mdx +24 -0
  77. package/src/docs/compsdocs/model/ModelUpdate.mdx +21 -0
  78. package/src/docs/compsdocs/model/PageLayout.mdx +21 -0
  79. package/src/docs/compsdocs/model/_category_.json +1 -0
  80. package/src/docs/compsdocs/navmenu/Classification.mdx +38 -0
  81. package/src/docs/compsdocs/navmenu/NavBar.mdx +43 -0
  82. package/src/docs/compsdocs/navmenu/NavLayout.mdx +30 -0
  83. package/src/docs/compsdocs/navmenu/TabBar.mdx +43 -0
  84. package/src/docs/compsdocs/navmenu/TabBarItem.mdx +29 -0
  85. package/src/docs/compsdocs/navmenu/_category_.json +1 -0
  86. package/src/docs/compsdocs/senior/Lottery.mdx +48 -0
  87. package/src/docs/compsdocs/senior/Modal.mdx +58 -0
  88. package/src/docs/compsdocs/senior/SlotMachine.mdx +52 -0
  89. package/src/docs/compsdocs/senior/_category_.json +1 -0
  90. package/src/docs/compsdocs/show/Calendar.mdx +29 -0
  91. package/src/docs/compsdocs/show/Divider.mdx +31 -0
  92. package/src/docs/compsdocs/show/GraphicCard.mdx +30 -0
  93. package/src/docs/compsdocs/show/Item.mdx +32 -0
  94. package/src/docs/compsdocs/show/ItemList.mdx +47 -0
  95. package/src/docs/compsdocs/show/Media.mdx +25 -0
  96. package/src/docs/compsdocs/show/StatusTip.mdx +25 -0
  97. package/src/docs/compsdocs/show/Swiper.mdx +33 -0
  98. package/src/docs/compsdocs/show/Tabs.mdx +38 -0
  99. package/src/docs/compsdocs/show/_category_.json +1 -0
  100. package/src/docs/compsdocs/show/button.mdx +25 -0
  101. package/src/docs/compsdocs/text/Link.mdx +43 -0
  102. package/src/docs/compsdocs/text/RichTextView.mdx +36 -0
  103. package/src/docs/compsdocs/text/Text.mdx +31 -0
  104. package/src/docs/compsdocs/text/Title.mdx +32 -0
  105. package/src/docs/compsdocs/text/_category_.json +1 -0
  106. package/src/docs/compsdocs/wxOpen/Phone.mdx +60 -0
  107. package/src/docs/compsdocs/wxOpen/Share.mdx +46 -0
  108. package/src/docs/compsdocs/wxOpen/UserInfo.mdx +60 -0
  109. package/src/docs/compsdocs/wxOpen/_category_.json +4 -0
  110. package/src/index.js +2 -0
  111. package/src/mp/components/button/index.js +18 -2
  112. package/src/mp/components/button/index.wxml +7 -4
  113. package/src/mp/components/chart/bar/index.js +6 -2
  114. package/src/mp/components/chart/common/core/eChartBar.js +9 -8
  115. package/src/mp/components/chart/common/core/eChartBase.js +20 -16
  116. package/src/mp/components/chart/common/core/eChartLine.js +6 -5
  117. package/src/mp/components/chart/line/index.js +10 -6
  118. package/src/mp/components/chart/pie/index.js +6 -2
  119. package/src/mp/components/chart/statisticsCard/index.js +33 -6
  120. package/src/mp/components/dataView/index.json +1 -1
  121. package/src/mp/components/form/checkbox/index.js +41 -2
  122. package/src/mp/components/form/checkbox/index.wxml +1 -1
  123. package/src/mp/components/form/form/index.wxml +1 -2
  124. package/src/mp/components/form/formcell/index.wxml +1 -1
  125. package/src/mp/components/form/formcell/index.wxss +17 -0
  126. package/src/mp/components/form/input/index.js +1 -1
  127. package/src/mp/components/form/input/index.wxss +15 -0
  128. package/src/mp/components/form/location/index.js +43 -2
  129. package/src/mp/components/form/location/index.wxss +4 -6
  130. package/src/mp/components/form/radio/index.js +34 -1
  131. package/src/mp/components/form/select/index.js +351 -41
  132. package/src/mp/components/form/select/index.wxml +17 -2
  133. package/src/mp/components/form/select/index.wxss +4 -0
  134. package/src/mp/components/form/select/region/index.js +101 -0
  135. package/src/mp/components/form/textarea/index.js +1 -1
  136. package/src/mp/components/form/textarea/index.wxss +4 -0
  137. package/src/mp/components/form/uploader/index.js +39 -27
  138. package/src/mp/components/form/uploader/index.json +3 -2
  139. package/src/mp/components/form/uploader/index.wxml +11 -7
  140. package/src/mp/components/form/uploader/index.wxss +20 -2
  141. package/src/mp/components/form/uploader/weui-uploader.js +209 -0
  142. package/src/mp/components/form/uploader/weui-uploader.json +7 -0
  143. package/src/mp/components/form/uploader/weui-uploader.wxml +45 -0
  144. package/src/mp/components/form/uploader/weui-uploader.wxss +1 -0
  145. package/src/mp/components/form/uploaderFile/index.js +10 -6
  146. package/src/mp/components/form/uploaderFile/index.wxss +4 -4
  147. package/src/mp/components/image/index.wxss +3 -2
  148. package/src/mp/components/listView/index.js +38 -43
  149. package/src/mp/components/listView/index.wxml +1 -1
  150. package/src/mp/components/listView/index.wxss +5 -0
  151. package/src/mp/components/lottery/index.js +270 -0
  152. package/src/mp/components/{internals/listView → lottery}/index.json +0 -0
  153. package/src/mp/components/lottery/index.wxml +43 -0
  154. package/src/mp/components/lottery/index.wxss +317 -0
  155. package/src/mp/components/navigationBar/index.js +193 -0
  156. package/src/mp/components/navigationBar/index.json +6 -0
  157. package/src/mp/components/navigationBar/index.wxml +88 -0
  158. package/src/mp/components/navigationBar/index.wxss +1257 -0
  159. package/src/mp/components/tabs/index.js +7 -2
  160. package/src/mp/components/tabs/index.wxml +2 -1
  161. package/src/mp/components/text/index.js +0 -25
  162. package/src/mp/components/text/index.wxml +3 -3
  163. package/src/mp/components/wxOpenApi/phone/index.js +117 -0
  164. package/src/mp/components/wxOpenApi/phone/index.json +4 -0
  165. package/src/mp/components/wxOpenApi/phone/index.wxml +15 -0
  166. package/src/mp/components/wxOpenApi/phone/index.wxss +22 -0
  167. package/src/mp/components/wxOpenApi/phoneCode/index.js +89 -0
  168. package/src/mp/components/wxOpenApi/phoneCode/index.json +4 -0
  169. package/src/mp/components/wxOpenApi/phoneCode/index.wxml +15 -0
  170. package/src/mp/components/wxOpenApi/phoneCode/index.wxss +22 -0
  171. package/src/mp/components/wxOpenApi/share/index.js +117 -0
  172. package/src/mp/components/wxOpenApi/share/index.json +4 -0
  173. package/src/mp/components/wxOpenApi/share/index.wxml +15 -0
  174. package/src/mp/components/wxOpenApi/share/index.wxss +22 -0
  175. package/src/mp/components/wxOpenApi/userInfo/index.js +88 -0
  176. package/src/mp/components/wxOpenApi/userInfo/index.json +4 -0
  177. package/src/mp/components/wxOpenApi/userInfo/index.wxml +14 -0
  178. package/src/mp/components/wxOpenApi/userInfo/index.wxss +22 -0
  179. package/src/mp/index.json +7 -1
  180. package/src/mp/style/weda-ui.wxss +16 -0
  181. package/src/mp/utils/constant.js +15 -0
  182. package/src/mp/utils/destr.js +48 -0
  183. package/src/mp/utils/lodash.js +2 -0
  184. package/src/mp/utils/platform.js +10 -0
  185. package/src/mp/utils/tcb.js +44 -0
  186. package/src/web/components/button/index.css +8 -1
  187. package/src/web/components/button/index.tsx +10 -9
  188. package/src/web/components/calendar/index.jsx +1 -1
  189. package/src/web/components/carousel/index.tsx +8 -8
  190. package/src/web/components/chart/bar/index.tsx +40 -39
  191. package/src/web/components/chart/common/config/line.js +1 -1
  192. package/src/web/components/chart/common/core/eChartBar.js +7 -6
  193. package/src/web/components/chart/common/core/eChartBase.ts +20 -16
  194. package/src/web/components/chart/common/core/eChartLine.js +8 -6
  195. package/src/web/components/chart/line/index.tsx +40 -39
  196. package/src/web/components/chart/statisticsCard/index.tsx +29 -8
  197. package/src/web/components/form/checkbox/index.tsx +61 -23
  198. package/src/web/components/form/form/index.css +5 -1
  199. package/src/web/components/form/form/index.tsx +3 -1
  200. package/src/web/components/form/formcell/index.css +22 -1
  201. package/src/web/components/form/formcell/index.tsx +11 -6
  202. package/src/web/components/form/input/index.css +7 -12
  203. package/src/web/components/form/location/components/LocationH5/index.css +4 -7
  204. package/src/web/components/form/location/components/LocationH5/location.h5.jsx +1 -1
  205. package/src/web/components/form/radio/index.tsx +90 -53
  206. package/src/web/components/form/select/h5.tsx +370 -73
  207. package/src/web/components/form/select/index.css +15 -0
  208. package/src/web/components/form/select/index.tsx +392 -145
  209. package/src/web/components/form/select/region/index.ts +122 -31
  210. package/src/web/components/form/select/time.jsx +89 -0
  211. package/src/web/components/form/select/year.tsx +170 -0
  212. package/src/web/components/form/textarea/index.css +4 -0
  213. package/src/web/components/form/textarea/index.tsx +2 -2
  214. package/src/web/components/form/tips/index.css +4 -0
  215. package/src/web/components/form/tips/index.tsx +4 -3
  216. package/src/web/components/form/uploader/index.css +26 -2
  217. package/src/web/components/form/uploader/uploader.h5.tsx +89 -57
  218. package/src/web/components/form/uploader/uploader.pc.tsx +4 -4
  219. package/src/web/components/form/uploaderFile/index.css +2 -4
  220. package/src/web/components/form/uploaderFile/uploadFile.h5.tsx +13 -7
  221. package/src/web/components/form/uploaderFile/uploadFile.pc.tsx +13 -5
  222. package/src/web/components/image/image.tsx +1 -1
  223. package/src/web/components/image/index.css +3 -3
  224. package/src/web/components/image/index.tsx +6 -7
  225. package/src/web/components/index.js +8 -0
  226. package/src/web/components/link/index.tsx +7 -4
  227. package/src/web/components/listView/index.css +4 -0
  228. package/src/web/components/listView/index.tsx +12 -20
  229. package/src/web/components/lottery/index.css +327 -0
  230. package/src/web/components/lottery/index.tsx +567 -0
  231. package/src/web/components/lottery/lotteryUtil.ts +130 -0
  232. package/src/web/components/modal/index.tsx +3 -1
  233. package/src/web/components/navLayout/index.tsx +2 -2
  234. package/src/web/components/navigationBar/chevron-right--double.svg +3 -0
  235. package/src/web/components/navigationBar/common.tsx +198 -0
  236. package/src/web/components/navigationBar/h5Menu.tsx +179 -0
  237. package/src/web/components/navigationBar/horizontalMenu.tsx +200 -0
  238. package/src/web/components/navigationBar/index.css +762 -0
  239. package/src/web/components/navigationBar/index.tsx +230 -0
  240. package/src/web/components/navigationBar/type.d.ts +111 -0
  241. package/src/web/components/navigationBar/verticalMenu.tsx +81 -0
  242. package/src/web/components/phone/index.css +0 -0
  243. package/src/web/components/phone/index.tsx +22 -0
  244. package/src/web/components/phoneCode/index.css +0 -0
  245. package/src/web/components/phoneCode/index.tsx +22 -0
  246. package/src/web/components/picker/timePicker.tsx +2 -2
  247. package/src/web/components/richTextView/index.tsx +3 -5
  248. package/src/web/components/share/index.css +0 -0
  249. package/src/web/components/share/index.tsx +38 -0
  250. package/src/web/components/slot/index.tsx +1 -1
  251. package/src/web/components/tabs/index.tsx +2 -0
  252. package/src/web/components/tabs/tabs.h5.tsx +43 -33
  253. package/src/web/components/tabs/tabs.pc.tsx +23 -10
  254. package/src/web/components/text/index.tsx +12 -20
  255. package/src/web/components/userInfo/index.css +0 -0
  256. package/src/web/components/userInfo/index.tsx +30 -0
  257. package/src/web/utils/{constant.js → constant.ts} +17 -2
  258. package/src/web/utils/lodash.ts +2 -0
  259. package/src/web/utils/platform.js +9 -0
  260. package/src/web/utils/tcb.js +26 -0
  261. package/src/web/weda-ui.css +7 -1
  262. package/src/mp/components/internals/listView/arrow-right-line.svg +0 -3
  263. package/src/mp/components/internals/listView/index.js +0 -286
  264. package/src/mp/components/internals/listView/index.wxml +0 -40
  265. package/src/mp/components/internals/listView/index.wxss +0 -150
  266. package/src/mp/components/internals/listView/more-line.svg +0 -3
  267. package/src/web/components/form/select/region/cities.ts +0 -2410
  268. package/src/web/components/form/select/region/provinces.ts +0 -240
  269. package/src/web/components/form/select/region/regions.ts +0 -20645
@@ -0,0 +1,273 @@
1
+ import React, { useRef, useContext } from 'react';
2
+ import { components } from '../../configs/index';
3
+ import { objFormat, ICompsConfig } from './format';
4
+ import './tableView.css';
5
+ export interface ComponentDocument {
6
+ exampleMap?: {
7
+ [key: string]: {
8
+ component: React.ComponentType;
9
+ code: string;
10
+ };
11
+ };
12
+ codeMap?: {
13
+ [key: string]: {
14
+ code: string;
15
+ };
16
+ };
17
+ data?: {
18
+ [key: string]: {
19
+ code: string;
20
+ };
21
+ };
22
+ }
23
+ function createFragment(nodes: React.ReactNodeArray) {
24
+ return React.createElement(React.Fragment, {}, ...nodes);
25
+ }
26
+ export interface TableLayoutViewProps {
27
+ componentKey?: string;
28
+ document: ComponentDocument;
29
+ variables?: object;
30
+ }
31
+
32
+ function getCompsMeta(key, type, origin) {
33
+ var compsMeta: ICompsConfig;
34
+ try {
35
+ switch (origin) {
36
+ case 'lowCode':
37
+ var metaLowcode = require('/docs/lowcode/components/wedaUI/lowcode-comps/weda_standard/comps/' +
38
+ key +
39
+ '.comp.json');
40
+ if (type && type == 'event') {
41
+ compsMeta = metaLowcode['emitEvents'];
42
+ } else if (type && (type == 'attribute' || type == 'slot')) {
43
+ compsMeta = metaLowcode['dataForm'];
44
+ } else if (type && type == 'description') {
45
+ compsMeta = metaLowcode['meta'];
46
+ }
47
+
48
+ return compsMeta;
49
+ case 'sourceCode':
50
+ if (type && type == 'event') {
51
+ compsMeta = components[key]['events']||{};
52
+ } else if (type && (type == 'attribute' || type == 'slot')) {
53
+ compsMeta = components[key]['data']['properties']||{};
54
+ } else if (type && type == 'description') {
55
+ compsMeta = components[key]['meta']||{};
56
+ }
57
+ return compsMeta;
58
+ }
59
+ } catch (e) {
60
+ return null;
61
+ }
62
+ }
63
+ export default function TableLayoutView({ componentKey, type, origin }) {
64
+ var compsMeta = getCompsMeta(componentKey, type, origin);
65
+ var tableView = [];
66
+ if (compsMeta && type != 'description') {
67
+ tableView = objFormat(compsMeta, type, origin);
68
+ } else {
69
+ tableView.push(compsMeta);
70
+ }
71
+
72
+ return (
73
+ <>
74
+ {type == 'attribute' && tableView.length > 0 && (
75
+ <>
76
+ <div className="tea-table__header">
77
+ <table className="tea-table__box">
78
+ <colgroup>
79
+ <col style={{ width: '18%' }}></col>
80
+ <col style={{ width: '10%' }}></col>
81
+ <col style={{ width: '15%' }}></col>
82
+ <col style={{ width: '25%' }}></col>
83
+ <col style={{ width: 'auto' }}></col>
84
+ </colgroup>
85
+ <thead>
86
+ <tr>
87
+ <th className="">
88
+ <div>
89
+ <span className="tea-text-overflow" title="属性名">
90
+ 属性名
91
+ </span>
92
+ </div>
93
+ </th>
94
+ <th className="">
95
+ <div>
96
+ <span className="tea-text-overflow" title="类型">
97
+ 类型
98
+ </span>
99
+ </div>
100
+ </th>
101
+ <th className="">
102
+ <div>
103
+ <span className="tea-text-overflow" title="属性分组">
104
+ 属性分组
105
+ </span>
106
+ </div>
107
+ </th>
108
+ <th className="">
109
+ <div>
110
+ <span className="tea-text-overflow" title="默认值">
111
+ 默认值
112
+ </span>
113
+ </div>
114
+ </th>
115
+ <th className="">
116
+ <div>
117
+ <span className="tea-text-overflow" title="说明">
118
+ 说明
119
+ </span>
120
+ </div>
121
+ </th>
122
+ </tr>
123
+ </thead>
124
+ </table>
125
+ </div>
126
+ <table className="tea-table__box">
127
+ <colgroup>
128
+ <col style={{ width: '18%' }}></col>
129
+ <col style={{ width: '10%' }}></col>
130
+ <col style={{ width: '15%' }}></col>
131
+ <col style={{ width: '25%' }}></col>
132
+ <col style={{ width: 'auto' }}></col>
133
+ </colgroup>
134
+ <tbody>
135
+ {tableView.map((row, index) => (
136
+ <tr key={index}>
137
+ <td>{row.title}</td>
138
+ <td>
139
+ <code>{row.type}</code>
140
+ </td>
141
+ <td>{row['x-category']}</td>
142
+ <td>{row.default}</td>
143
+ <td>{row.description}</td>
144
+ </tr>
145
+ ))}
146
+ </tbody>
147
+ </table>
148
+ </>
149
+ )}
150
+ {type == 'slot' && tableView.length > 0 && (
151
+ <>
152
+ <div className="tea-table__header">
153
+ <table className="tea-table__box">
154
+ <colgroup>
155
+ <col style={{ width: '18%' }}></col>
156
+ <col style={{ width: 'auto' }}></col>
157
+ </colgroup>
158
+ <thead>
159
+ <tr>
160
+ <th className="">
161
+ <div>
162
+ <span className="tea-text-overflow" title="属性名">
163
+ 名称
164
+ </span>
165
+ </div>
166
+ </th>
167
+ <th className="">
168
+ <div>
169
+ <span className="tea-text-overflow" title="类型">
170
+ 说明
171
+ </span>
172
+ </div>
173
+ </th>
174
+ </tr>
175
+ </thead>
176
+ </table>
177
+ </div>
178
+ <table className="tea-table__box">
179
+ <colgroup>
180
+ <col style={{ width: '18%' }}></col>
181
+ <col style={{ width: 'auto' }}></col>
182
+ </colgroup>
183
+ <tbody>
184
+ {tableView.map((row, index) => (
185
+ <tr key={index}>
186
+ <td>{row.code}</td>
187
+ <td>{row.description}</td>
188
+ </tr>
189
+ ))}
190
+ </tbody>
191
+ </table>
192
+ </>
193
+ )}
194
+ {type == 'event' && tableView.length > 0 && (
195
+ <>
196
+ <div className="tea-table__header">
197
+ <table className="tea-table__box">
198
+ <colgroup>
199
+ <col style={{ width: '18%' }}></col>
200
+ <col style={{ width: '25%' }}></col>
201
+ <col style={{ width: '16%' }}></col>
202
+ <col style={{ width: 'auto' }}></col>
203
+ </colgroup>
204
+ <thead>
205
+ <tr>
206
+ <th className="">
207
+ <div>
208
+ <span className="tea-text-overflow" title="事件名">
209
+ 事件名
210
+ </span>
211
+ </div>
212
+ </th>
213
+ <th className="">
214
+ <div>
215
+ <span className="tea-text-overflow" title="事件code">
216
+ 事件code
217
+ </span>
218
+ </div>
219
+ </th>
220
+ <th className="">
221
+ <div>
222
+ <span className="tea-text-overflow" title="适用情况">
223
+ 适用情况
224
+ </span>
225
+ </div>
226
+ </th>
227
+ <th className="">
228
+ <div>
229
+ <span className="tea-text-overflow" title="说明">
230
+ 说明
231
+ </span>
232
+ </div>
233
+ </th>
234
+ </tr>
235
+ </thead>
236
+ </table>
237
+ </div>
238
+ <table className="tea-table__box">
239
+ <colgroup>
240
+ <col style={{ width: '18%' }}></col>
241
+ <col style={{ width: '25%' }}></col>
242
+ <col style={{ width: '16%' }}></col>
243
+ <col style={{ width: 'auto' }}></col>
244
+ </colgroup>
245
+ <tbody>
246
+ {tableView.map((row, index) => (
247
+ <tr key={index}>
248
+ <td>{row.name}</td>
249
+ <td>
250
+ <code>{row.title}</code>
251
+ </td>
252
+ <td>{row.platforms}</td>
253
+ <td>{row.description}</td>
254
+ </tr>
255
+ ))}
256
+ </tbody>
257
+ </table>
258
+ </>
259
+ )}
260
+ {type == 'description' && tableView.length > 0 && (
261
+ <>
262
+ <h2>
263
+ <a aria-hidden="true" className="anchor enhancedAnchor_node_modules-@docusaurus-theme-classic-lib-next-theme-Heading-styles-module" id="适用场景"></a>
264
+ 适用场景
265
+ <a className="hash-link" href="#适用场景" title="标题的直接链接">#</a>
266
+ </h2>
267
+ <p>{tableView[0]?.description?tableView[0]?.description:tableView[0]?.desc}</p>
268
+ </>
269
+ )}
270
+ {tableView.length == 0 && <p>无</p>}
271
+ </>
272
+ );
273
+ }
@@ -0,0 +1,159 @@
1
+ # 柱状图
2
+
3
+ <TableLayoutView
4
+ componentKey="Bar"
5
+ type="description"
6
+ origin="sourceCode"
7
+ ></TableLayoutView>
8
+
9
+ <img
10
+ src="https://qcloudimg.tencent-cloud.cn/raw/bb95e133b8b4aa28acc22917116e76c2.png"
11
+ width="40%"
12
+ ></img>
13
+
14
+ ## 使用说明
15
+
16
+ 进入**应用编辑器**页面,将**图表组件** > **柱状图**组件拖进相应容器即可。
17
+
18
+ ## 属性
19
+
20
+ import TableLayoutView from '../../common/tableView';
21
+
22
+ <TableLayoutView
23
+ componentKey="Bar"
24
+ type="attribute"
25
+ origin="sourceCode"
26
+ ></TableLayoutView>
27
+
28
+ ## 事件
29
+
30
+ <TableLayoutView
31
+ componentKey="Bar"
32
+ type="event"
33
+ origin="sourceCode"
34
+ ></TableLayoutView>
35
+
36
+ ### 进阶属性
37
+
38
+ 支持配置坐标轴样式、数据标签和显示单位等属性。
39
+
40
+ - 显示单位:数值量级支持 `个/十/百/千/万/十万/百万/千万/亿`。
41
+ - 小数位数:支持设置 `0-10` 位小数。
42
+ - 后缀:支持自定义。默认根据数量级生成 `-/十/百/千/万/十万/百万/千万/亿`。
43
+
44
+ ### 自定义连接器使用场景
45
+
46
+ 当数据源配置时选择 [自定义连接器](https://cloud.tencent.com/document/product/1301/68457),需用户自行在自定义连接器内按照参数结构定义数据,才可正常在统计卡片组件内渲染,详情请参见 [图表组件参数定义](https://cloud.tencent.com/document/product/1301/71197)。
47
+
48
+ > ?当使用自定义连接器时,数据筛选、字段选择、统计方式、统计空值属性均需用户在所建自定义连接器内自行定义,其他属性与数据模型使用场景配置保持一致。
49
+
50
+ ## 使用示例
51
+
52
+ 下列示例数据源为销售业绩表。示例数据配置如下表所示。更多数据配置操作请参见 [数据模型](https://cloud.tencent.com/document/product/1301/68452)。
53
+
54
+ | 销售姓名 | 客户地区 | 销售总额 | 销售单数 | 性别 |
55
+ | -------- | -------- | -------- | -------- | ---- |
56
+ | 张三 | 北京 | 1000000 | 3 | 男 |
57
+ | 赵四 | 北京 | 2000000 | 2 | 男 |
58
+ | 赵四 | 上海 | 100000 | 1 | 男 |
59
+ | 王五 | 上海 | 200000 | 1 | 男 |
60
+ | 王五 | 深圳 | 500000 | 1 | 男 |
61
+ | 李六 | 北京 | 5000000 | 6 | 女 |
62
+ | 李六 | 深圳 | 200000 | 1 | 女 |
63
+
64
+ ### 示例 1:各销售人员的销售总业绩对比(纵向)
65
+
66
+ 1. 新建**柱状图**组件,进入右侧**属性** > **基础属性**页面,单击**数据源**下拉菜单,选择**销售业绩表**并选择**统计**方法。
67
+ <img
68
+ src="https://qcloudimg.tencent-cloud.cn/raw/246dfdeed6b8173d2ec4d5124e4e7412.png"
69
+ width="50%"
70
+ ></img>
71
+ 2. 在**维度(X 轴)**单击**字段选择**下拉菜单,选择**销售姓名**。
72
+ <img
73
+ src="https://qcloudimg.tencent-cloud.cn/raw/3286b7330f0d13703c347a4def16cea0.png"
74
+ width="50%"
75
+ ></img>
76
+ 3. 在**数值(Y 轴)**下,单击**添加 Y 轴字段**。**字段**类型选择**销售总额**,**关系**类型选择**求和**。
77
+ <img
78
+ src="https://qcloudimg.tencent-cloud.cn/raw/34429ad0bb7df362b77b8d9f25df2534.png"
79
+ width="50%"
80
+ ></img>
81
+ 4. 下拉右侧属性,进入**进阶属性**内单击开启**显示单位**。单击**数量值级**下拉菜单设置为**万**,**后缀**项设置为万。
82
+ <img
83
+ src="https://qcloudimg.tencent-cloud.cn/raw/1ee81e2f0863fb12754d9d3a1b671bcf.png"
84
+ width="50%"
85
+ ></img>
86
+ 5. 根据需要修改标题、坐标轴样式、图例样式等属性,最终效果如下图展示:
87
+
88
+ <img
89
+ src="https://qcloudimg.tencent-cloud.cn/raw/59e7f5e7d7dd1ab170b5a983c08643bf.png"
90
+ width="50%"
91
+ ></img>
92
+
93
+ ### 示例 2:各销售人员的销售总业绩对比(纵向)- 按照地区对比
94
+
95
+ 在 [示例 1]的配置基础上,增加分组字段,单击**分组**下拉菜单,选择**客户地区**。
96
+
97
+ <img
98
+ src="https://qcloudimg.tencent-cloud.cn/raw/f06d382dbbbe971dd8ddc2aba8e6630f.png"
99
+ width="50%"
100
+ ></img>
101
+
102
+ 最终效果展示:
103
+
104
+ <img
105
+ src="https://qcloudimg.tencent-cloud.cn/raw/2228adb1cbbc6df66787b41496e516ac.png"
106
+ width="50%"
107
+ ></img>
108
+
109
+ 单击开启**是否堆叠**功能,可查看堆叠效果:
110
+
111
+ <img
112
+ src="https://qcloudimg.tencent-cloud.cn/raw/3cc42d66be3fc18adaee450f9f85d691.png"
113
+ width="50%"
114
+ ></img>
115
+
116
+ ### 示例 3:各销售人员的销售总业绩对比(纵向)- 仅查看性别为男的数据
117
+
118
+ 1. 在 [示例 1]的配置基础上,单击**数据筛选**。
119
+ <img
120
+ src="https://qcloudimg.tencent-cloud.cn/raw/a5f691429af099b6598f864b8b069a7d.png"
121
+ width="50%"
122
+ ></img>
123
+ 2. 设置相应数据筛选参数,单击**确定**增加筛选条件。
124
+
125
+ <img
126
+ src="https://qcloudimg.tencent-cloud.cn/raw/2e8899bf24ce2f249cfad4b25c8cb2f2.png"
127
+ width="50%"
128
+ ></img>
129
+
130
+ ### 示例 4:各销售人员的"客户覆盖地区数"对比和"总销售单数"对比(横向)
131
+
132
+ 1. **柱形图方向**单击选择**横向**。
133
+
134
+ <img
135
+ src="https://qcloudimg.tencent-cloud.cn/raw/1b5eaad5033960447387d0dead4148af.png"
136
+ width="50%"
137
+ ></img>
138
+
139
+ 2. 在**维度(Y 轴)**单击**字段选择**下拉菜单,选择**销售姓名**。
140
+ 3. 在**数值(X 轴)**下,单击**添加字段**。添加以下两个字段:
141
+
142
+ - 字段 1:客户地区;统计方式:计数
143
+ - 字段 2:销售单数;统计方式:求和
144
+
145
+ <img
146
+ src="https://qcloudimg.tencent-cloud.cn/raw/fee0ff35a0a8181fc1687ac8eaeabd63.png"
147
+ width="50%"
148
+ ></img>
149
+
150
+ 3. 最终效果展示:
151
+
152
+ <img
153
+ src="https://qcloudimg.tencent-cloud.cn/raw/6b3f96ce483e40da66e4866caa2c6f29.png"
154
+ width="50%"
155
+ ></img>
156
+
157
+ ## 限制说明
158
+
159
+ 维度轴不支持设置时间类型,可设置日期类型和日期时间类型。
@@ -0,0 +1,100 @@
1
+ # 折线图
2
+
3
+ <TableLayoutView
4
+ componentKey="Line"
5
+ type="description"
6
+ origin="sourceCode"
7
+ ></TableLayoutView>
8
+
9
+ <img
10
+ src="https://qcloudimg.tencent-cloud.cn/raw/8a53bc16ae84ef05d6dac6fa037718cb.png"
11
+ width="50%"
12
+ ></img>
13
+
14
+ ## 使用说明
15
+
16
+ 进入**应用编辑器**页面,将**图表组件** > **折线图**组件拖进相应容器即可。
17
+
18
+ ## 属性
19
+
20
+ import TableLayoutView from '../../common/tableView';
21
+
22
+ <TableLayoutView
23
+ componentKey="Line"
24
+ type="attribute"
25
+ origin="sourceCode"
26
+ ></TableLayoutView>
27
+
28
+ ## 事件
29
+
30
+ <TableLayoutView
31
+ componentKey="Line"
32
+ type="event"
33
+ origin="sourceCode"
34
+ ></TableLayoutView>
35
+
36
+ ### 高级属性
37
+
38
+ 支持配置坐标轴样式、数据标签和显示单位等属性。
39
+
40
+ - 显示单位:数值量级支持 `个/十/百/千/万/十万/百万/千万/亿`。
41
+ - 小数位数:支持设置 `0-10` 位小数。
42
+ - 后缀:支持自定义。默认根据数量级生成 `-/十/百/千/万/十万/百万/千万/亿`。
43
+
44
+ ### 自定义连接器使用场景
45
+
46
+ 当数据源配置时选择 [自定义连接器](https://cloud.tencent.com/document/product/1301/68457),需用户自行在自定义连接器内按照参数结构定义数据,才可正常在统计卡片组件内渲染,详情请参见 [图表组件参数定义](https://cloud.tencent.com/document/product/1301/71197)。
47
+
48
+ > ?当使用自定义连接器时,数据筛选、字段选择、统计方式、统计空值属性均需用户在所建自定义连接器内自行定义,其他属性与数据模型使用场景配置保持一致。
49
+
50
+ ## 使用示例
51
+
52
+ 下列示例数据源为销售业绩表。示例数据配置如下表所示。更多数据配置操作请参见 [数据模型](https://cloud.tencent.com/document/product/1301/68452)。
53
+
54
+ | 销售姓名 | 客户地区 | 销售总额 | 销售单数 | 性别 | 成单日期 |
55
+ | -------- | -------- | -------- | -------- | ---- | ---------- |
56
+ | 张三 | 北京 | 1000000 | 3 | 男 | 2022-01-01 |
57
+ | 赵四 | 北京 | 2000000 | 2 | 男 | 2022-02-02 |
58
+ | 赵四 | 上海 | 100000 | 1 | 男 | 2022-03-03 |
59
+ | 王五 | 上海 | 200000 | 1 | 男 | 2021-04-04 |
60
+ | 王五 | 深圳 | 500000 | 1 | 男 | 2021-05-05 |
61
+ | 李六 | 北京 | 5000000 | 6 | 女 | 2021-06-06 |
62
+ | 李六 | 深圳 | 200000 | 1 | 女 | 2021-07-07 |
63
+
64
+ #### 示例:月度销售总额变化趋势
65
+
66
+ 1. 新建**折线图**组件,进入右侧**属性** > **基础属性**页面,单击**数据源**下拉菜单,选择**销售业绩表**并选择**统计**方法。
67
+
68
+ <img
69
+ src="https://qcloudimg.tencent-cloud.cn/raw/246dfdeed6b8173d2ec4d5124e4e7412.png"
70
+ width="50%"
71
+ ></img>
72
+
73
+ 2. 在**维度(X 轴)**单击**字段选择**下拉菜单,选择**成单日期**。
74
+
75
+ <img
76
+ src="https://qcloudimg.tencent-cloud.cn/raw/32e0dd58a2e63e26128c1c109648d468.png"
77
+ width="50%"
78
+ ></img>
79
+
80
+ 3. 在**数值(Y 轴)**下,单击**添加 Y 轴字段**。**字段**类型选择**销售总额**,**关系**类型选择**求和**。
81
+
82
+ <img
83
+ src="https://qcloudimg.tencent-cloud.cn/raw/34429ad0bb7df362b77b8d9f25df2534.png"
84
+ width="50%"
85
+ ></img>
86
+
87
+ 4. 下拉右侧属性,进入**进阶属性**内单击开启**显示单位**。单击**数量值级**下拉菜单设置为**万**,**后缀**项设置为万。
88
+
89
+ <img
90
+ src="https://qcloudimg.tencent-cloud.cn/raw/1ee81e2f0863fb12754d9d3a1b671bcf.png"
91
+ width="50%"
92
+ ></img>
93
+
94
+ 5. 根据需要修改标题、坐标轴样式或图例样式等属性。
95
+
96
+ > ?更多示例配置可参见 [柱状图](https://cloud.tencent.com/document/product/1301/71404)。
97
+
98
+ ## 限制说明
99
+
100
+ 维度轴不支持设置时间类型,可设置日期类型和日期时间类型。
@@ -0,0 +1,83 @@
1
+ # 饼状图
2
+
3
+ <TableLayoutView
4
+ componentKey="Pie"
5
+ type="description"
6
+ origin="sourceCode"
7
+ ></TableLayoutView>
8
+
9
+ <img
10
+ src="https://qcloudimg.tencent-cloud.cn/raw/d75f51e450035e3e889c7b951ffee7f9.png"
11
+ width="40%"
12
+ ></img>
13
+
14
+ ## 使用说明
15
+
16
+ 进入**应用编辑器**页面,将**图表组件** > **饼图**组件拖进相应容器即可。
17
+
18
+ ## 属性
19
+
20
+ import TableLayoutView from '../../common/tableView';
21
+
22
+ <TableLayoutView
23
+ componentKey="Pie"
24
+ type="attribute"
25
+ origin="sourceCode"
26
+ ></TableLayoutView>
27
+
28
+ ## 事件
29
+
30
+ <TableLayoutView
31
+ componentKey="Pie"
32
+ type="event"
33
+ origin="sourceCode"
34
+ ></TableLayoutView>
35
+
36
+ ### 高级属性
37
+
38
+ 支持配置数据标签和显示单位等属性。
39
+
40
+ - 显示单位:数值量级支持 `个/十/百/千/万/十万/百万/千万/亿`。
41
+ - 小数位数:支持设置 `0-10` 位小数。
42
+ - 后缀:支持自定义。默认根据数量级生成 `-/十/百/千/万/十万/百万/千万/亿`。
43
+
44
+ ### 自定义连接器使用场景
45
+
46
+ 当数据源配置时选择 [自定义连接器](https://cloud.tencent.com/document/product/1301/68457),需用户自行在自定义连接器内按照参数结构定义数据,才可正常在统计卡片组件内渲染,详情请参见 [图表组件参数定义](https://cloud.tencent.com/document/product/1301/71197)。
47
+
48
+ > ?当使用自定义连接器时,数据筛选、字段选择、统计方式、统计空值属性均需用户在所建自定义连接器内自行定义,其他属性与数据模型使用场景配置保持一致。
49
+
50
+ ## 使用示例
51
+
52
+ 下列示例数据源为销售业绩表。示例数据配置如下表所示。更多数据配置操作请参见 [数据模型](https://cloud.tencent.com/document/product/1301/68452)。
53
+
54
+ | 销售姓名 | 客户地区 | 销售总额 | 销售单数 | 性别 |
55
+ | -------- | -------- | -------- | -------- | ---- |
56
+ | 张三 | 北京 | 1000000 | 3 | 男 |
57
+ | 赵四 | 北京 | 2000000 | 2 | 男 |
58
+ | 赵四 | 上海 | 100000 | 1 | 男 |
59
+ | 王五 | 上海 | 200000 | 1 | 男 |
60
+ | 王五 | 深圳 | 500000 | 1 | 男 |
61
+ | 李六 | 北京 | 5000000 | 6 | 女 |
62
+ | 李六 | 深圳 | 200000 | 1 | 女 |
63
+
64
+ #### 示例:各客户地区的销售业绩占比
65
+
66
+ 1. 新建**饼图**组件,进入右侧**属性** > **基础属性**页面,单击**数据源**下拉菜单,选择**销售业绩表**并选择**统计**方法。
67
+ <img
68
+ src="https://qcloudimg.tencent-cloud.cn/raw/246dfdeed6b8173d2ec4d5124e4e7412.png"
69
+ width="50%"
70
+ ></img>
71
+ 2. 在**维度**单击**字段选择**下拉菜单,选择**客户地区**。
72
+ 3. 在**数值**下,单击**添加字段**。**字段**类型选择**销售总额**,**关系**类型选择**求和**。
73
+ 4. 下拉右侧属性,进入**进阶属性**内单击开启**显示百分比**。单击**数量值级**下拉菜单设置为**万**,**后缀**项设置为万。
74
+ 5. 根据需要修改标题、坐标轴样式、图例样式等属性,最终效果如下图展示:
75
+
76
+ <img
77
+ src="https://qcloudimg.tencent-cloud.cn/raw/aba2546bbf1baa6c72bbff6434968b3e.png"
78
+ width="50%"
79
+ ></img>
80
+
81
+ ## 限制说明
82
+
83
+ 维度轴不支持设置时间类型,可设置日期类型和日期时间类型。
@@ -0,0 +1 @@
1
+ { "label": "图表组件", "position": 90 }
@@ -0,0 +1,51 @@
1
+ # 统计卡片
2
+
3
+ <TableLayoutView
4
+ componentKey="StatisticsCard"
5
+ type="description"
6
+ origin="sourceCode"
7
+ ></TableLayoutView>
8
+
9
+ <img
10
+ src="https://qcloudimg.tencent-cloud.cn/raw/6ac75a333be3162b6b0dc7850ccbcf3d.png"
11
+ width="60%"
12
+ ></img>
13
+
14
+ ## 使用说明
15
+
16
+ ### 数据模型使用场景
17
+
18
+ 1. 为统计卡片设置数据源,选择已经建好的 [数据模型](https://cloud.tencent.com/document/product/1301/68452),选择数据源方法-统计。
19
+ 1. 通过数据筛选配置数据取值范围,详情请参见 [数据筛选配置文档](https://cloud.tencent.com/document/product/1301/71198)。
20
+ 1. 选择需要进行统计的字段。
21
+ 1. 根据所选择字段,进行针对该字段的统计方式设置。
22
+ 目前“数字”类型字段的支持计数、求和、最大值、最小值、平均值;其他类型字段仅支持计数。
23
+ 1. 选择是否统计空值,默认不统计空值。
24
+
25
+ - 支持显示单位设置。 数值量级:个/十/百/千/万/十万/百万/千万/亿。
26
+ - 小数位数:支持设置 `0-10` 位小数。
27
+ - 后缀:支持自定义。默认根据数量级生成 `-/十/百/千/万/十万/百万/千万/亿`。
28
+
29
+ ## 属性
30
+
31
+ import TableLayoutView from '../../common/tableView';
32
+
33
+ <TableLayoutView
34
+ componentKey="StatisticsCard"
35
+ type="attribute"
36
+ origin="sourceCode"
37
+ ></TableLayoutView>
38
+
39
+ ## 事件
40
+
41
+ <TableLayoutView
42
+ componentKey="StatisticsCard"
43
+ type="event"
44
+ origin="sourceCode"
45
+ ></TableLayoutView>
46
+
47
+ ### 自定义连接器使用场景
48
+
49
+ 当数据源配置时选择 [自定义连接器](https://cloud.tencent.com/document/product/1301/68457),需用户自行在自定义连接器内按照参数结构定义数据,才可正常在统计卡片组件内渲染,详情请参见 [图表组件参数定义](https://cloud.tencent.com/document/product/1301/71197)。
50
+
51
+ > ? 当使用自定义连接器时,数据筛选、字段选择、统计方式、统计空值属性均需用户在所建自定义连接器内自行定义,其他属性与数据模型使用场景配置保持一致。