@ztocwst/rc-pro-materials 0.2.2 → 0.2.3-4.1

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 (301) hide show
  1. package/README.md +17 -17
  2. package/build/index.js +8 -8
  3. package/build/lowcode/assets-daily.json +11 -11
  4. package/build/lowcode/assets-dev.json +8 -8
  5. package/build/lowcode/assets-prod.json +11 -11
  6. package/build/lowcode/designer.html +2 -2
  7. package/build/lowcode/index.html +2 -2
  8. package/build/lowcode/index.js +1 -1
  9. package/build/lowcode/meta.js +1 -1
  10. package/build/lowcode/preview.css +1 -1
  11. package/build/lowcode/preview.js +4 -5
  12. package/build/lowcode/render/default/view.css +1 -2
  13. package/build/lowcode/render/default/view.js +9 -58
  14. package/build/lowcode/view.css +1 -2
  15. package/build/lowcode/view.js +10 -59
  16. package/dist/SCM_Comps.css +2 -2
  17. package/dist/SCM_Comps.js +22 -53
  18. package/dist/SCM_Comps.js.map +1 -1
  19. package/es/components/z-Ellipsis/ellipsis.d.ts +4 -4
  20. package/es/components/z-Ellipsis/index.d.ts +3 -3
  21. package/es/components/z-agg-block/index.d.ts +3 -3
  22. package/es/components/z-agg-block/index.less +134 -134
  23. package/es/components/z-agg-block/z-agg-block.d.ts +27 -27
  24. package/es/components/z-agg-block/z-agg-block.js +1 -1
  25. package/es/components/z-auth/auth.d.ts +9 -9
  26. package/es/components/z-auth/index.d.ts +3 -3
  27. package/es/components/z-box/box.d.ts +20 -20
  28. package/es/components/z-box/index.d.ts +3 -3
  29. package/es/components/z-box/index.less +4 -4
  30. package/es/components/z-button/index.d.ts +3 -3
  31. package/es/components/z-button/z-button.d.ts +4 -4
  32. package/es/components/z-config-provider/configProvider.d.ts +4 -4
  33. package/es/components/z-config-provider/configProvider.js +45 -4
  34. package/es/components/z-config-provider/index.d.ts +3 -3
  35. package/es/components/z-data-table/data-table.d.ts +9 -0
  36. package/es/components/z-data-table/data-table.js +24 -0
  37. package/es/components/z-data-table/index.d.ts +3 -0
  38. package/es/components/z-data-table/index.js +2 -0
  39. package/es/components/z-div/div.d.ts +6 -6
  40. package/es/components/z-div/index.d.ts +2 -2
  41. package/es/components/z-editTable/editTable.d.ts +11 -11
  42. package/es/components/z-editTable/editTable.js +3 -4
  43. package/es/components/z-editTable/index.d.ts +2 -2
  44. package/es/components/z-form/index.d.ts +3 -3
  45. package/es/components/z-form/z-form.d.ts +10 -10
  46. package/es/components/z-form/z-form.js +1 -1
  47. package/es/components/z-list/index.d.ts +3 -3
  48. package/es/components/z-list/list.d.ts +17 -17
  49. package/es/components/z-list/list.js +3 -3
  50. package/es/components/z-operation-records/index.d.ts +3 -3
  51. package/es/components/z-operation-records/operationRecords.d.ts +4 -4
  52. package/es/components/z-pointer-block/index.d.ts +3 -3
  53. package/es/components/z-pointer-block/index.less +15 -15
  54. package/es/components/z-pointer-block/z-pointer-block.d.ts +16 -16
  55. package/es/components/z-preview/index.d.ts +3 -3
  56. package/es/components/z-preview/preview.d.ts +4 -4
  57. package/es/components/z-pro-provider/index.d.ts +3 -3
  58. package/es/components/z-pro-provider/z-pro-provider.d.ts +6 -6
  59. package/es/components/z-ranking-list/index.d.ts +2 -2
  60. package/es/components/z-ranking-list/index.less +49 -49
  61. package/es/components/z-ranking-list/z-ranking-list.d.ts +14 -14
  62. package/es/components/z-ranking-list/z-ranking-list.js +2 -3
  63. package/es/components/z-simple-bar/index.d.ts +3 -3
  64. package/es/components/z-simple-bar/index.less +9 -9
  65. package/es/components/z-simple-bar/z-simple-bar.d.ts +27 -27
  66. package/es/components/z-singleFactory/index.d.ts +2 -2
  67. package/es/components/z-singleFactory/zSingerFactory.d.ts +2 -3
  68. package/es/components/z-slick/index.d.ts +3 -0
  69. package/es/components/z-slick/index.js +2 -0
  70. package/es/components/z-slick/slick.d.ts +47 -0
  71. package/es/components/z-slick/slick.js +35 -0
  72. package/es/components/z-statistic/index.d.ts +3 -3
  73. package/es/components/z-statistic/index.less +22 -22
  74. package/es/components/z-statistic/z-statistic.d.ts +13 -13
  75. package/es/components/z-table/index.d.ts +3 -3
  76. package/es/components/z-table/table.d.ts +8 -8
  77. package/es/components/z-table/table.js +1 -1
  78. package/es/components/z-templates-data-common/components/chart-renderer/index.d.ts +12 -14
  79. package/es/components/z-templates-data-common/components/chart-renderer/index.js +33 -13
  80. package/es/components/z-templates-data-common/data-common.d.ts +20 -105
  81. package/es/components/z-templates-data-common/data-common.helper.d.ts +2 -61
  82. package/es/components/z-templates-data-common/data-common.helper.js +2 -336
  83. package/es/components/z-templates-data-common/data-common.js +81 -62
  84. package/es/components/z-templates-data-common/index.d.ts +3 -3
  85. package/es/components/z-tpl/index.d.ts +3 -3
  86. package/es/components/z-tpl/tpl.d.ts +23 -23
  87. package/es/components/z-tpl/tpl.js +3 -3
  88. package/es/components/z-warehouse/index.d.ts +2 -2
  89. package/es/components/z-warehouse/zWarehouse.d.ts +2 -3
  90. package/es/components/z-watermark/index.d.ts +3 -0
  91. package/es/components/z-watermark/index.js +2 -0
  92. package/es/components/z-watermark/zWatermark.d.ts +3 -0
  93. package/es/components/z-watermark/zWatermark.js +4 -0
  94. package/es/index.d.ts +44 -38
  95. package/es/index.js +4 -0
  96. package/es/index.scss +1 -1
  97. package/es/style.js +2 -6
  98. package/es/utils/hoc.d.ts +6 -6
  99. package/es/utils/hoc.js +3 -3
  100. package/es/utils/index.d.ts +13 -13
  101. package/es/utils/index.js +5 -1
  102. package/es/utils/props/button.d.ts +13 -13
  103. package/es/utils/props/common.d.ts +7 -1
  104. package/es/utils/props/common.js +17 -0
  105. package/es/utils/props/editTable.d.ts +3 -3
  106. package/es/utils/props/editTable.js +21 -14
  107. package/es/utils/props/form.d.ts +36 -0
  108. package/es/utils/props/form.js +33 -14
  109. package/es/utils/props/listTpl.d.ts +29 -29
  110. package/es/utils/props/microModal.d.ts +7 -7
  111. package/es/utils/props/microModal.js +0 -1
  112. package/es/utils/props/microSwitch.d.ts +1 -1
  113. package/es/utils/props/microSwitch.js +4 -3
  114. package/es/utils/props/modalSelect.d.ts +6 -6
  115. package/es/utils/props/operationRecords.d.ts +2 -2
  116. package/es/utils/props/operationRecords.js +4 -4
  117. package/es/utils/props/preview.d.ts +2 -2
  118. package/es/utils/props/preview.js +4 -4
  119. package/es/utils/props/tpl.d.ts +173 -162
  120. package/es/utils/props/warehouseAndFactory.d.ts +1 -1
  121. package/es/utils/rcProRequest.d.ts +3 -3
  122. package/es/utils/rcProRequest.js +3 -3
  123. package/es/variables.scss +3 -3
  124. package/lib/components/z-Ellipsis/ellipsis.d.ts +4 -4
  125. package/lib/components/z-Ellipsis/ellipsis.js +3 -4
  126. package/lib/components/z-Ellipsis/index.d.ts +3 -3
  127. package/lib/components/z-Ellipsis/index.js +1 -2
  128. package/lib/components/z-agg-block/index.d.ts +3 -3
  129. package/lib/components/z-agg-block/index.js +1 -2
  130. package/lib/components/z-agg-block/index.less +134 -134
  131. package/lib/components/z-agg-block/z-agg-block.d.ts +27 -27
  132. package/lib/components/z-agg-block/z-agg-block.js +2 -3
  133. package/lib/components/z-auth/auth.d.ts +9 -9
  134. package/lib/components/z-auth/auth.js +1 -2
  135. package/lib/components/z-auth/index.d.ts +3 -3
  136. package/lib/components/z-auth/index.js +1 -2
  137. package/lib/components/z-box/box.d.ts +20 -20
  138. package/lib/components/z-box/box.js +1 -2
  139. package/lib/components/z-box/index.d.ts +3 -3
  140. package/lib/components/z-box/index.js +1 -2
  141. package/lib/components/z-box/index.less +4 -4
  142. package/lib/components/z-button/index.d.ts +3 -3
  143. package/lib/components/z-button/index.js +1 -2
  144. package/lib/components/z-button/z-button.d.ts +4 -4
  145. package/lib/components/z-button/z-button.js +4 -4
  146. package/lib/components/z-config-provider/configProvider.d.ts +4 -4
  147. package/lib/components/z-config-provider/configProvider.js +47 -7
  148. package/lib/components/z-config-provider/index.d.ts +3 -3
  149. package/lib/components/z-config-provider/index.js +1 -2
  150. package/lib/components/z-data-table/data-table.d.ts +9 -0
  151. package/lib/components/z-data-table/data-table.js +27 -0
  152. package/lib/components/z-data-table/index.d.ts +3 -0
  153. package/lib/components/z-data-table/index.js +7 -0
  154. package/lib/components/z-div/div.d.ts +6 -6
  155. package/lib/components/z-div/div.js +1 -2
  156. package/lib/components/z-div/index.d.ts +2 -2
  157. package/lib/components/z-div/index.js +1 -2
  158. package/lib/components/z-editTable/editTable.d.ts +11 -11
  159. package/lib/components/z-editTable/editTable.js +7 -9
  160. package/lib/components/z-editTable/index.d.ts +2 -2
  161. package/lib/components/z-editTable/index.js +1 -2
  162. package/lib/components/z-form/index.d.ts +3 -3
  163. package/lib/components/z-form/index.js +1 -2
  164. package/lib/components/z-form/z-form.d.ts +10 -10
  165. package/lib/components/z-form/z-form.js +5 -6
  166. package/lib/components/z-list/index.d.ts +3 -3
  167. package/lib/components/z-list/index.js +1 -2
  168. package/lib/components/z-list/list.d.ts +17 -17
  169. package/lib/components/z-list/list.js +7 -8
  170. package/lib/components/z-operation-records/index.d.ts +3 -3
  171. package/lib/components/z-operation-records/index.js +1 -2
  172. package/lib/components/z-operation-records/operationRecords.d.ts +4 -4
  173. package/lib/components/z-operation-records/operationRecords.js +3 -4
  174. package/lib/components/z-pointer-block/index.d.ts +3 -3
  175. package/lib/components/z-pointer-block/index.js +1 -2
  176. package/lib/components/z-pointer-block/index.less +15 -15
  177. package/lib/components/z-pointer-block/z-pointer-block.d.ts +16 -16
  178. package/lib/components/z-pointer-block/z-pointer-block.js +1 -2
  179. package/lib/components/z-preview/index.d.ts +3 -3
  180. package/lib/components/z-preview/index.js +1 -2
  181. package/lib/components/z-preview/preview.d.ts +4 -4
  182. package/lib/components/z-preview/preview.js +3 -4
  183. package/lib/components/z-pro-provider/index.d.ts +3 -3
  184. package/lib/components/z-pro-provider/index.js +1 -2
  185. package/lib/components/z-pro-provider/z-pro-provider.d.ts +6 -6
  186. package/lib/components/z-pro-provider/z-pro-provider.js +3 -4
  187. package/lib/components/z-ranking-list/index.d.ts +2 -2
  188. package/lib/components/z-ranking-list/index.js +1 -2
  189. package/lib/components/z-ranking-list/index.less +49 -49
  190. package/lib/components/z-ranking-list/z-ranking-list.d.ts +14 -14
  191. package/lib/components/z-ranking-list/z-ranking-list.js +5 -7
  192. package/lib/components/z-simple-bar/index.d.ts +3 -3
  193. package/lib/components/z-simple-bar/index.js +1 -2
  194. package/lib/components/z-simple-bar/index.less +9 -9
  195. package/lib/components/z-simple-bar/z-simple-bar.d.ts +27 -27
  196. package/lib/components/z-simple-bar/z-simple-bar.js +1 -2
  197. package/lib/components/z-singleFactory/index.d.ts +2 -2
  198. package/lib/components/z-singleFactory/index.js +1 -2
  199. package/lib/components/z-singleFactory/zSingerFactory.d.ts +2 -3
  200. package/lib/components/z-singleFactory/zSingerFactory.js +3 -4
  201. package/lib/components/z-slick/index.d.ts +3 -0
  202. package/lib/components/z-slick/index.js +7 -0
  203. package/lib/components/z-slick/slick.d.ts +47 -0
  204. package/lib/components/z-slick/slick.js +39 -0
  205. package/lib/components/z-statistic/index.d.ts +3 -3
  206. package/lib/components/z-statistic/index.js +1 -2
  207. package/lib/components/z-statistic/index.less +22 -22
  208. package/lib/components/z-statistic/z-statistic.d.ts +13 -13
  209. package/lib/components/z-statistic/z-statistic.js +1 -2
  210. package/lib/components/z-table/index.d.ts +3 -3
  211. package/lib/components/z-table/index.js +1 -2
  212. package/lib/components/z-table/table.d.ts +8 -8
  213. package/lib/components/z-table/table.js +5 -6
  214. package/lib/components/z-templates-data-common/components/chart-renderer/index.d.ts +12 -14
  215. package/lib/components/z-templates-data-common/components/chart-renderer/index.js +36 -17
  216. package/lib/components/z-templates-data-common/data-common.d.ts +20 -105
  217. package/lib/components/z-templates-data-common/data-common.helper.d.ts +2 -61
  218. package/lib/components/z-templates-data-common/data-common.helper.js +3 -351
  219. package/lib/components/z-templates-data-common/data-common.js +85 -66
  220. package/lib/components/z-templates-data-common/index.d.ts +3 -3
  221. package/lib/components/z-templates-data-common/index.js +1 -2
  222. package/lib/components/z-tpl/index.d.ts +3 -3
  223. package/lib/components/z-tpl/index.js +1 -2
  224. package/lib/components/z-tpl/tpl.d.ts +23 -23
  225. package/lib/components/z-tpl/tpl.js +7 -8
  226. package/lib/components/z-warehouse/index.d.ts +2 -2
  227. package/lib/components/z-warehouse/index.js +1 -2
  228. package/lib/components/z-warehouse/zWarehouse.d.ts +2 -3
  229. package/lib/components/z-warehouse/zWarehouse.js +3 -4
  230. package/lib/components/z-watermark/index.d.ts +3 -0
  231. package/lib/components/z-watermark/index.js +7 -0
  232. package/lib/components/z-watermark/zWatermark.d.ts +3 -0
  233. package/lib/components/z-watermark/zWatermark.js +8 -0
  234. package/lib/index.d.ts +44 -38
  235. package/lib/index.js +8 -2
  236. package/lib/index.scss +1 -1
  237. package/lib/style.js +1 -3
  238. package/lib/utils/hoc.d.ts +6 -6
  239. package/lib/utils/hoc.js +3 -3
  240. package/lib/utils/index.d.ts +13 -13
  241. package/lib/utils/index.js +7 -4
  242. package/lib/utils/props/button.d.ts +13 -13
  243. package/lib/utils/props/button.js +2 -3
  244. package/lib/utils/props/common.d.ts +7 -1
  245. package/lib/utils/props/common.js +19 -3
  246. package/lib/utils/props/editTable.d.ts +3 -3
  247. package/lib/utils/props/editTable.js +23 -17
  248. package/lib/utils/props/form.d.ts +36 -0
  249. package/lib/utils/props/form.js +35 -17
  250. package/lib/utils/props/listTpl.d.ts +29 -29
  251. package/lib/utils/props/listTpl.js +2 -3
  252. package/lib/utils/props/microModal.d.ts +7 -7
  253. package/lib/utils/props/microModal.js +1 -3
  254. package/lib/utils/props/microSwitch.d.ts +1 -1
  255. package/lib/utils/props/microSwitch.js +5 -4
  256. package/lib/utils/props/modalSelect.d.ts +6 -6
  257. package/lib/utils/props/modalSelect.js +2 -4
  258. package/lib/utils/props/operationRecords.d.ts +2 -2
  259. package/lib/utils/props/operationRecords.js +6 -7
  260. package/lib/utils/props/preview.d.ts +2 -2
  261. package/lib/utils/props/preview.js +6 -7
  262. package/lib/utils/props/tpl.d.ts +173 -162
  263. package/lib/utils/props/tpl.js +3 -5
  264. package/lib/utils/props/warehouseAndFactory.d.ts +1 -1
  265. package/lib/utils/props/warehouseAndFactory.js +2 -3
  266. package/lib/utils/rcProRequest.d.ts +3 -3
  267. package/lib/utils/rcProRequest.js +3 -4
  268. package/lib/variables.scss +3 -3
  269. package/package.json +5 -5
  270. package/es/components/z-templates-data-common/components/custom-renderer/index.d.ts +0 -13
  271. package/es/components/z-templates-data-common/components/custom-renderer/index.js +0 -172
  272. package/es/components/z-templates-data-common/components/dim-target/dim-target.helper.d.ts +0 -39
  273. package/es/components/z-templates-data-common/components/dim-target/dim-target.helper.js +0 -1
  274. package/es/components/z-templates-data-common/components/dim-target/index.d.ts +0 -16
  275. package/es/components/z-templates-data-common/components/dim-target/index.js +0 -430
  276. package/es/components/z-templates-data-common/components/dim-target/index.less +0 -49
  277. package/es/components/z-templates-data-common/components/dim-target/useUpdateEffect.d.ts +0 -8
  278. package/es/components/z-templates-data-common/components/dim-target/useUpdateEffect.js +0 -26
  279. package/es/components/z-templates-data-common/components/link-renderer/index.d.ts +0 -16
  280. package/es/components/z-templates-data-common/components/link-renderer/index.js +0 -320
  281. package/es/components/z-templates-data-common/components/link-renderer/index.less +0 -33
  282. package/es/components/z-templates-data-common/components/table-renderer/index.d.ts +0 -6
  283. package/es/components/z-templates-data-common/components/table-renderer/index.js +0 -481
  284. package/es/components/z-templates-data-common/components/table-renderer/table-renderer.helper.d.ts +0 -64
  285. package/es/components/z-templates-data-common/components/table-renderer/table-renderer.helper.js +0 -220
  286. package/lib/components/z-templates-data-common/components/custom-renderer/index.d.ts +0 -13
  287. package/lib/components/z-templates-data-common/components/custom-renderer/index.js +0 -178
  288. package/lib/components/z-templates-data-common/components/dim-target/dim-target.helper.d.ts +0 -39
  289. package/lib/components/z-templates-data-common/components/dim-target/dim-target.helper.js +0 -3
  290. package/lib/components/z-templates-data-common/components/dim-target/index.d.ts +0 -16
  291. package/lib/components/z-templates-data-common/components/dim-target/index.js +0 -438
  292. package/lib/components/z-templates-data-common/components/dim-target/index.less +0 -49
  293. package/lib/components/z-templates-data-common/components/dim-target/useUpdateEffect.d.ts +0 -8
  294. package/lib/components/z-templates-data-common/components/dim-target/useUpdateEffect.js +0 -30
  295. package/lib/components/z-templates-data-common/components/link-renderer/index.d.ts +0 -16
  296. package/lib/components/z-templates-data-common/components/link-renderer/index.js +0 -326
  297. package/lib/components/z-templates-data-common/components/link-renderer/index.less +0 -33
  298. package/lib/components/z-templates-data-common/components/table-renderer/index.d.ts +0 -6
  299. package/lib/components/z-templates-data-common/components/table-renderer/index.js +0 -487
  300. package/lib/components/z-templates-data-common/components/table-renderer/table-renderer.helper.d.ts +0 -64
  301. package/lib/components/z-templates-data-common/components/table-renderer/table-renderer.helper.js +0 -229
@@ -1,487 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- exports.__esModule = true;
5
- exports["default"] = void 0;
6
- var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
7
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
8
- var _table = _interopRequireDefault(require("antd/lib/table"));
9
- var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
10
- var _react = require("react");
11
- var _rcPro = require("@ztocwst/rc-pro");
12
- var _dataCommon = require("../../data-common.helper");
13
- var _tableRenderer = require("./table-renderer.helper");
14
- var _dimTarget = _interopRequireDefault(require("../dim-target"));
15
- var _linkRenderer = _interopRequireDefault(require("../link-renderer"));
16
- function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
17
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
18
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
19
- var TableRenderer = function TableRenderer(props) {
20
- var _tableOptions$paginat;
21
- var activeKey = props.activeKey,
22
- autoLoad = props.autoLoad,
23
- refreshRate = props.refreshRate,
24
- dataSetName = props.dataSetName,
25
- remember = props.remember,
26
- exporter = props.exporter,
27
- exportConfig = props.exportConfig,
28
- dimJson = props.dimJson,
29
- indexJson = props.indexJson,
30
- expressions = props.expressions,
31
- linkPageTitle = props.linkPageTitle,
32
- linkPage = props.linkPage,
33
- queryBind = props.queryBind,
34
- chartRef = props.chartRef,
35
- onConfirm = props.onConfirm,
36
- formatter = props.formatter;
37
- var dimTargetRef = (0, _react.useRef)(null);
38
- var queryCacheRef = (0, _react.useRef)(null);
39
- var tableRef = (0, _react.useRef)(null);
40
- var _useState = (0, _react.useState)(false),
41
- loading = _useState[0],
42
- setLoading = _useState[1];
43
- var _useState2 = (0, _react.useState)(_dataCommon.tableConfigDefault),
44
- config = _useState2[0],
45
- setConfig = _useState2[1];
46
- /** 维度指标初始数据 */
47
- var _useState3 = (0, _react.useState)(),
48
- dimTargetValue = _useState3[0],
49
- setDimTargetValue = _useState3[1];
50
- /** 合计 数据 */
51
- var amounted = (0, _react.useRef)({});
52
- var rcProContext = (0, _react.useContext)(_rcPro.RcConfigContext);
53
- var _ref = rcProContext || {},
54
- BASE_URL = _ref.BASE_URL,
55
- _ref$tableOptions = _ref.tableOptions,
56
- tableOptions = _ref$tableOptions === void 0 ? {} : _ref$tableOptions;
57
- var defaultPageSize = (tableOptions === null || tableOptions === void 0 ? void 0 : (_tableOptions$paginat = tableOptions.pagination) === null || _tableOptions$paginat === void 0 ? void 0 : _tableOptions$paginat.defaultPageSize) || 20;
58
- var _useState4 = (0, _react.useState)(false),
59
- isLink = _useState4[0],
60
- setIsLink = _useState4[1];
61
- var linkChartRef = (0, _react.useRef)();
62
- var timer = null;
63
- var getDimTargetValues = function getDimTargetValues() {
64
- var _dimTargetRef$current;
65
- return (dimTargetRef === null || dimTargetRef === void 0 ? void 0 : (_dimTargetRef$current = dimTargetRef.current) === null || _dimTargetRef$current === void 0 ? void 0 : _dimTargetRef$current.getDimTargetValues()) || {};
66
- };
67
- var buttons = [{
68
- name: '确认',
69
- action: 'btn',
70
- props: {
71
- loading: loading,
72
- type: 'primary'
73
- },
74
- onClick: function onClick() {
75
- var option = getDimTargetValues();
76
- handleUpdateColumns(option);
77
- onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm();
78
- }
79
- }, exporter ? {
80
- action: 'btn',
81
- name: exportConfig === null || exportConfig === void 0 ? void 0 : exportConfig.name,
82
- fileConfig: {
83
- type: 'export',
84
- params: {
85
- menuId: exportConfig === null || exportConfig === void 0 ? void 0 : exportConfig.menuId,
86
- operateType: 'EXPORT'
87
- },
88
- request: {
89
- submit: {
90
- url: BASE_URL + "/data/forward/v1/bigdata/report/" + dataSetName + "/export",
91
- method: 'POST',
92
- formatter: function () {
93
- var _formatter = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(values) {
94
- var bigDataBody, _ref2, _ref2$temp, temp;
95
- return _regenerator["default"].wrap(function _callee$(_context) {
96
- while (1) switch (_context.prev = _context.next) {
97
- case 0:
98
- bigDataBody = getBigDataBody();
99
- _ref2 = values || {}, _ref2$temp = _ref2.temp, temp = _ref2$temp === void 0 ? {} : _ref2$temp;
100
- return _context.abrupt("return", {
101
- buttonCode: exportConfig === null || exportConfig === void 0 ? void 0 : exportConfig.code,
102
- templateId: temp === null || temp === void 0 ? void 0 : temp.value,
103
- bigDataBody: bigDataBody
104
- });
105
- case 3:
106
- case "end":
107
- return _context.stop();
108
- }
109
- }, _callee);
110
- }));
111
- function formatter(_x) {
112
- return _formatter.apply(this, arguments);
113
- }
114
- return formatter;
115
- }()
116
- }
117
- }
118
- }
119
- } : null];
120
- var summary = function summary() {
121
- var _getDimTargetValues = getDimTargetValues(),
122
- _getDimTargetValues$d = _getDimTargetValues.dimension,
123
- dimension = _getDimTargetValues$d === void 0 ? [] : _getDimTargetValues$d,
124
- _getDimTargetValues$i = _getDimTargetValues.index,
125
- index = _getDimTargetValues$i === void 0 ? [] : _getDimTargetValues$i,
126
- _getDimTargetValues$i2 = _getDimTargetValues.indexSource,
127
- indexSource = _getDimTargetValues$i2 === void 0 ? [] : _getDimTargetValues$i2;
128
- var indexAmounted = indexSource === null || indexSource === void 0 ? void 0 : indexSource.filter(function (cur) {
129
- return cur.amounted;
130
- });
131
- if (!indexAmounted.length) return;
132
- var summaryColumns = ['总计'].concat(dimension, index);
133
- return /*#__PURE__*/React.createElement(_table["default"].Summary, {
134
- fixed: true
135
- }, /*#__PURE__*/React.createElement(_table["default"].Summary.Row, null, summaryColumns.map(function (name, idx) {
136
- var find = indexSource === null || indexSource === void 0 ? void 0 : indexSource.find(function (item) {
137
- return item.alias === name || item.name === name;
138
- });
139
- var dataIndex = find === null || find === void 0 ? void 0 : find.name;
140
- return /*#__PURE__*/React.createElement(_table["default"].Summary.Cell, {
141
- key: idx === null || idx === void 0 ? void 0 : idx.toString(),
142
- index: idx
143
- }, !idx ? name : dataIndex ? (0, _tableRenderer.handleValueFormat)(amounted.current[dataIndex], amounted.current, find) : '');
144
- })));
145
- };
146
- var onLink = function onLink(values) {
147
- var _linkChartRef$current, _linkChartRef$current2;
148
- var _getDimTargetValues2 = getDimTargetValues(),
149
- _getDimTargetValues2$ = _getDimTargetValues2.dimension,
150
- dimension = _getDimTargetValues2$ === void 0 ? [] : _getDimTargetValues2$;
151
- setIsLink(true);
152
- (_linkChartRef$current = linkChartRef.current) === null || _linkChartRef$current === void 0 ? void 0 : (_linkChartRef$current2 = _linkChartRef$current.initial) === null || _linkChartRef$current2 === void 0 ? void 0 : _linkChartRef$current2.call(_linkChartRef$current, (0, _extends2["default"])({}, values, {
153
- dimension: dimension
154
- }));
155
- };
156
- var handleUpdateColumns = /*#__PURE__*/function () {
157
- var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(option) {
158
- var _tableRef$current;
159
- var columns;
160
- return _regenerator["default"].wrap(function _callee2$(_context2) {
161
- while (1) switch (_context2.prev = _context2.next) {
162
- case 0:
163
- columns = (0, _tableRenderer.handleColumns)(option, expressions, onLink);
164
- (_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 ? void 0 : _tableRef$current.updateColumns(columns);
165
- case 2:
166
- case "end":
167
- return _context2.stop();
168
- }
169
- }, _callee2);
170
- }));
171
- return function handleUpdateColumns(_x2) {
172
- return _ref3.apply(this, arguments);
173
- };
174
- }();
175
- var getBigDataBody = function getBigDataBody(params) {
176
- if (params === void 0) {
177
- params = {};
178
- }
179
- var _getDimTargetValues3 = getDimTargetValues(),
180
- _getDimTargetValues3$ = _getDimTargetValues3.dimension,
181
- dimension = _getDimTargetValues3$ === void 0 ? [] : _getDimTargetValues3$,
182
- _getDimTargetValues3$2 = _getDimTargetValues3.dimensionSource,
183
- dimensionSource = _getDimTargetValues3$2 === void 0 ? [] : _getDimTargetValues3$2,
184
- _getDimTargetValues3$3 = _getDimTargetValues3.index,
185
- index = _getDimTargetValues3$3 === void 0 ? [] : _getDimTargetValues3$3,
186
- _getDimTargetValues3$4 = _getDimTargetValues3.indexSource,
187
- indexSource = _getDimTargetValues3$4 === void 0 ? [] : _getDimTargetValues3$4;
188
-
189
- /** 通过 queryBind查看是否有绑定关系 有的话替换成绑定关系中的key 没有则是默认配置的key */
190
- var queryCache = queryCacheRef.current;
191
- var query = {};
192
- var queryKeys = Object.keys(queryCache);
193
- if (queryKeys !== null && queryKeys !== void 0 && queryKeys.length) {
194
- queryKeys.forEach(function (k) {
195
- var _queryBind$find;
196
- // "键"(有建立绑定关系 取当前数据源参数(paraJson)的"键",没有则是默认查询配置的"键")
197
- var key = (queryBind === null || queryBind === void 0 ? void 0 : (_queryBind$find = queryBind.find(function (item) {
198
- return (item === null || item === void 0 ? void 0 : item.currentQueryKey) === k;
199
- })) === null || _queryBind$find === void 0 ? void 0 : _queryBind$find.sourceQueryKey) || k;
200
- query[key] = queryCache[k];
201
- });
202
- }
203
-
204
- /** 维度收集 */
205
- var dim = [];
206
- for (var _iterator = _createForOfIteratorHelperLoose(dimensionSource), _step; !(_step = _iterator()).done;) {
207
- var cur = _step.value;
208
- if (dimension.includes(cur.alias || cur.description)) {
209
- dim.push({
210
- name: cur.name,
211
- description: cur.description
212
- });
213
- }
214
- }
215
-
216
- /** 指标收集 */
217
- var target = [];
218
- for (var _iterator2 = _createForOfIteratorHelperLoose(indexSource), _step2; !(_step2 = _iterator2()).done;) {
219
- var _cur = _step2.value;
220
- if (index.includes(_cur.alias || _cur.name)) {
221
- target.push({
222
- description: _cur.name
223
- });
224
- }
225
- }
226
- var queryParams = (0, _dataCommon.handleQueryParams)(query);
227
- var data = (0, _extends2["default"])({
228
- queryParams: queryParams,
229
- dim: dim,
230
- target: target
231
- }, params, {
232
- pageNum: 1,
233
- pageSize: defaultPageSize,
234
- dataSetName: dataSetName
235
- });
236
- return formatter ? formatter === null || formatter === void 0 ? void 0 : formatter(data) : data;
237
- };
238
-
239
- // 获取数据源
240
- var getDataSource = /*#__PURE__*/function () {
241
- var _ref4 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(params) {
242
- var data, _yield$getReportData, success, _yield$getReportData$, result;
243
- return _regenerator["default"].wrap(function _callee3$(_context3) {
244
- while (1) switch (_context3.prev = _context3.next) {
245
- case 0:
246
- if (params === void 0) {
247
- params = {};
248
- }
249
- if (!loading) {
250
- _context3.next = 3;
251
- break;
252
- }
253
- return _context3.abrupt("return");
254
- case 3:
255
- _context3.prev = 3;
256
- data = getBigDataBody(params);
257
- setLoading(true);
258
- _context3.next = 8;
259
- return (0, _dataCommon.getReportData)(rcProContext, data);
260
- case 8:
261
- _yield$getReportData = _context3.sent;
262
- success = _yield$getReportData.success;
263
- _yield$getReportData$ = _yield$getReportData.result;
264
- result = _yield$getReportData$ === void 0 ? {} : _yield$getReportData$;
265
- setLoading(false);
266
- return _context3.abrupt("return", {
267
- success: success,
268
- result: result
269
- });
270
- case 16:
271
- _context3.prev = 16;
272
- _context3.t0 = _context3["catch"](3);
273
- setLoading(false);
274
- console.error(_context3.t0);
275
- case 20:
276
- case "end":
277
- return _context3.stop();
278
- }
279
- }, _callee3, null, [[3, 16]]);
280
- }));
281
- return function getDataSource(_x3) {
282
- return _ref4.apply(this, arguments);
283
- };
284
- }();
285
- var initial = /*#__PURE__*/function () {
286
- var _ref5 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(params) {
287
- var result, dims, targets, option;
288
- return _regenerator["default"].wrap(function _callee4$(_context4) {
289
- while (1) switch (_context4.prev = _context4.next) {
290
- case 0:
291
- _context4.next = 2;
292
- return (0, _tableRenderer.getDimTargetData)(rcProContext, (0, _extends2["default"])({
293
- dataSetName: dataSetName
294
- }, params), {
295
- dimJson: dimJson,
296
- indexJson: indexJson
297
- });
298
- case 2:
299
- result = _context4.sent;
300
- if (result) {
301
- dims = result.dims, targets = result.targets;
302
- option = {
303
- dimension: dims === null || dims === void 0 ? void 0 : dims.dimension,
304
- dimensionSource: dims === null || dims === void 0 ? void 0 : dims.dimensionSource,
305
- index: targets === null || targets === void 0 ? void 0 : targets.index,
306
- indexSource: targets === null || targets === void 0 ? void 0 : targets.indexSource
307
- };
308
- handleUpdateColumns(option);
309
- setDimTargetValue(result);
310
- setConfig((0, _extends2["default"])({}, _dataCommon.tableConfigDefault, {
311
- pagination: {
312
- showSizeChanger: true,
313
- defaultPageSize: defaultPageSize
314
- },
315
- summary: summary,
316
- request: function request(data) {
317
- var _data$pagination, _data$pagination2, _data$sorter;
318
- var pagination = {
319
- pageNum: (_data$pagination = data.pagination) === null || _data$pagination === void 0 ? void 0 : _data$pagination.current,
320
- pageSize: (_data$pagination2 = data.pagination) === null || _data$pagination2 === void 0 ? void 0 : _data$pagination2.pageSize
321
- };
322
- var orderBy = [];
323
- if ((_data$sorter = data.sorter) !== null && _data$sorter !== void 0 && _data$sorter.order) {
324
- var _data$sorter2, _data$sorter3, _data$sorter3$order;
325
- orderBy.push({
326
- name: (_data$sorter2 = data.sorter) === null || _data$sorter2 === void 0 ? void 0 : _data$sorter2.field,
327
- sort: (_data$sorter3 = data.sorter) === null || _data$sorter3 === void 0 ? void 0 : (_data$sorter3$order = _data$sorter3.order) === null || _data$sorter3$order === void 0 ? void 0 : _data$sorter3$order.slice(0, -3)
328
- });
329
- }
330
- return getDataSource((0, _extends2["default"])({}, pagination, {
331
- orderBy: orderBy
332
- }));
333
- }
334
- }));
335
- }
336
- case 4:
337
- case "end":
338
- return _context4.stop();
339
- }
340
- }, _callee4);
341
- }));
342
- return function initial(_x4) {
343
- return _ref5.apply(this, arguments);
344
- };
345
- }();
346
- (0, _react.useEffect)(function () {
347
- if (dataSetName) {
348
- initial();
349
- }
350
- }, [dataSetName, dimJson, indexJson]);
351
- var handleClearInterval = function handleClearInterval() {
352
- if (timer) {
353
- clearInterval(timer);
354
- timer = null;
355
- }
356
- };
357
- (0, _react.useEffect)(function () {
358
- var _ref6 = (activeKey === null || activeKey === void 0 ? void 0 : activeKey.split(_dataCommon.separator)) || [],
359
- currentKey = _ref6[0];
360
- if (currentKey === dataSetName) {
361
- if (autoLoad) {
362
- if (refreshRate) {
363
- handleClearInterval();
364
- timer = window.setInterval(function () {
365
- return onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm();
366
- }, refreshRate * _dataCommon.timeUnit);
367
- } else {
368
- onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm();
369
- }
370
- }
371
- } else {
372
- handleClearInterval();
373
- }
374
- return function () {
375
- handleClearInterval();
376
- };
377
- }, [activeKey, autoLoad]);
378
- var queryChart = /*#__PURE__*/function () {
379
- var _ref7 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(value) {
380
- var _linkChartRef$current3;
381
- return _regenerator["default"].wrap(function _callee6$(_context6) {
382
- while (1) switch (_context6.prev = _context6.next) {
383
- case 0:
384
- if (isLink) {
385
- (_linkChartRef$current3 = linkChartRef.current) === null || _linkChartRef$current3 === void 0 ? void 0 : _linkChartRef$current3.queryChart(value);
386
- } else {
387
- queryCacheRef.current = value[dataSetName] || value;
388
- setTimeout( /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
389
- var _tableRef$current2;
390
- var _getDimTargetValues4, _getDimTargetValues4$, indexSource, indexAmounted, target, _iterator3, _step3, cur, _ref9, success, _ref9$result, result, _result$data, _result$data$, data;
391
- return _regenerator["default"].wrap(function _callee5$(_context5) {
392
- while (1) switch (_context5.prev = _context5.next) {
393
- case 0:
394
- (_tableRef$current2 = tableRef.current) === null || _tableRef$current2 === void 0 ? void 0 : _tableRef$current2.refreshTable({
395
- current: 1
396
- });
397
- _getDimTargetValues4 = getDimTargetValues(), _getDimTargetValues4$ = _getDimTargetValues4.indexSource, indexSource = _getDimTargetValues4$ === void 0 ? [] : _getDimTargetValues4$;
398
- indexAmounted = indexSource === null || indexSource === void 0 ? void 0 : indexSource.filter(function (cur) {
399
- return cur.amounted;
400
- });
401
- if (!(indexAmounted !== null && indexAmounted !== void 0 && indexAmounted.length)) {
402
- _context5.next = 16;
403
- break;
404
- }
405
- target = [];
406
- for (_iterator3 = _createForOfIteratorHelperLoose(indexAmounted); !(_step3 = _iterator3()).done;) {
407
- cur = _step3.value;
408
- target.push({
409
- description: cur.name
410
- });
411
- }
412
- _context5.next = 8;
413
- return getDataSource({
414
- dim: [],
415
- target: target
416
- });
417
- case 8:
418
- _context5.t0 = _context5.sent;
419
- if (_context5.t0) {
420
- _context5.next = 11;
421
- break;
422
- }
423
- _context5.t0 = {};
424
- case 11:
425
- _ref9 = _context5.t0;
426
- success = _ref9.success;
427
- _ref9$result = _ref9.result;
428
- result = _ref9$result === void 0 ? {} : _ref9$result;
429
- if (success) {
430
- _result$data = result === null || result === void 0 ? void 0 : result.data, _result$data$ = _result$data[0], data = _result$data$ === void 0 ? {} : _result$data$;
431
- amounted.current = data;
432
- }
433
- case 16:
434
- case "end":
435
- return _context5.stop();
436
- }
437
- }, _callee5);
438
- })), 200);
439
- }
440
- case 1:
441
- case "end":
442
- return _context6.stop();
443
- }
444
- }, _callee6);
445
- }));
446
- return function queryChart(_x5) {
447
- return _ref7.apply(this, arguments);
448
- };
449
- }();
450
- (0, _react.useImperativeHandle)(chartRef, function () {
451
- return {
452
- onLink: onLink,
453
- queryChart: queryChart
454
- };
455
- });
456
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
457
- style: {
458
- display: !isLink ? 'block' : 'none'
459
- }
460
- }, /*#__PURE__*/React.createElement(_dimTarget["default"], {
461
- dimTargetRef: dimTargetRef,
462
- value: dimTargetValue,
463
- remember: remember,
464
- dataSetName: dataSetName,
465
- buttons: buttons.filter(function (item) {
466
- return item;
467
- })
468
- }), /*#__PURE__*/React.createElement(_rcPro.ProTable, {
469
- ref: tableRef,
470
- config: config
471
- })), /*#__PURE__*/React.createElement("div", {
472
- style: {
473
- display: isLink ? 'block' : 'none'
474
- }
475
- }, /*#__PURE__*/React.createElement(_linkRenderer["default"], {
476
- chartRef: linkChartRef,
477
- dimJson: dimJson,
478
- linkPage: linkPage,
479
- linkPageTitle: linkPageTitle,
480
- onConfirm: onConfirm,
481
- onBack: function onBack() {
482
- setIsLink(false);
483
- }
484
- })));
485
- };
486
- var _default = TableRenderer;
487
- exports["default"] = _default;
@@ -1,64 +0,0 @@
1
- import { TypeChartSettingProps } from '../../data-common';
2
- import type { linkParamsType } from '../link-renderer';
3
- import type { DimTargetChangeOptionType } from '../dim-target/dim-target.helper';
4
- import type { valueType } from '../../data-common.helper';
5
- export declare const stringTrim: (str: string) => string;
6
- /**
7
- * 维度指标数据源处理
8
- */
9
- export declare const handleDimTargetFormat: (dimTargetSource: Pick<TypeChartSettingProps, 'dimJson' | 'indexJson'>, result?: Record<string, any>) => {
10
- rememberCheck: boolean;
11
- dims: {
12
- all: boolean;
13
- title: string;
14
- indeterminate: boolean;
15
- dimension: any[];
16
- dimensionSource: Omit<import("../../data-common").TypeTargetProps, "amounted" | "enName" | "isFilter">[];
17
- };
18
- targets: {
19
- all: boolean;
20
- title: string;
21
- indeterminate: boolean;
22
- index: any[];
23
- indexSource: import("../../data-common").TypeTargetProps[];
24
- };
25
- };
26
- /**
27
- * 获取维度指标数据源
28
- */
29
- export declare const getDimTargetData: (rcProContext: any, params: Record<string, any>, dimTargetSource: Pick<TypeChartSettingProps, 'dimJson' | 'indexJson'>) => Promise<{
30
- rememberCheck: boolean;
31
- dims: {
32
- all: boolean;
33
- title: string;
34
- indeterminate: boolean;
35
- dimension: any[];
36
- dimensionSource: Omit<import("../../data-common").TypeTargetProps, "amounted" | "enName" | "isFilter">[];
37
- };
38
- targets: {
39
- all: boolean;
40
- title: string;
41
- indeterminate: boolean;
42
- index: any[];
43
- indexSource: import("../../data-common").TypeTargetProps[];
44
- };
45
- }>;
46
- /**
47
- * 数据渲染格式处理
48
- */
49
- export declare const handleValueFormat: (value: valueType, record: Record<string, any>, find?: Record<string, any>, condition?: any[], onLink?: () => void) => any;
50
- /**
51
- * 条件格式
52
- */
53
- export type ExpressionsType = any[] | [];
54
- /**
55
- * 根据维度指标获取表格列
56
- */
57
- export declare const handleColumns: (option: DimTargetChangeOptionType, expressions?: ExpressionsType, onLink?: (v: linkParamsType) => void) => {
58
- title: import("antd/es/checkbox/Group").CheckboxValueType;
59
- dataIndex: string;
60
- ellipsis: boolean;
61
- sorter: any;
62
- width: any;
63
- render: (value: valueType, record: Record<string, any>) => any;
64
- }[];