@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,229 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- exports.__esModule = true;
5
- exports.stringTrim = exports.handleValueFormat = exports.handleDimTargetFormat = exports.handleColumns = exports.getDimTargetData = void 0;
6
- var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
7
- var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
8
- var _dataCommon = require("../../data-common.helper");
9
- 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."); }
10
- 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); }
11
- 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; }
12
- var stringTrim = function stringTrim(str) {
13
- if (!str) return '';
14
- return str.replace(/`|'|"/g, '');
15
- };
16
-
17
- /**
18
- * 维度指标数据源处理
19
- */
20
- exports.stringTrim = stringTrim;
21
- var handleDimTargetFormat = function handleDimTargetFormat(dimTargetSource, result) {
22
- var _dimJson$data, _indexJson$data;
23
- var _ref = dimTargetSource || {},
24
- dimJson = _ref.dimJson,
25
- indexJson = _ref.indexJson;
26
- /** chartSetting 传入维度数据源 */
27
- var dimensionSource = dimJson !== null && dimJson !== void 0 && (_dimJson$data = dimJson.data) !== null && _dimJson$data !== void 0 && _dimJson$data.length ? dimJson === null || dimJson === void 0 ? void 0 : dimJson.data : [];
28
- /** chartSetting 传入指标数据源 */
29
- var indexSource = indexJson !== null && indexJson !== void 0 && (_indexJson$data = indexJson.data) !== null && _indexJson$data !== void 0 && _indexJson$data.length ? indexJson === null || indexJson === void 0 ? void 0 : indexJson.data : [];
30
- var _ref2 = result || {},
31
- customIndexJson = _ref2.customIndexJson,
32
- customDimJson = _ref2.customDimJson;
33
- var rememberCheck = !!customDimJson || !!customIndexJson;
34
- /** 记住勾选保存的维度;别名容易被修改,保存的是 description 属性 */
35
- var customDim = customDimJson ? JSON.parse(customDimJson) : [];
36
- /** 记住勾选保存的指标;别名容易被修改,保存的是 name 属性 */
37
- var customIndex = customIndexJson ? JSON.parse(customIndexJson) : [];
38
- /** 维度 */
39
- var dimension = [];
40
- /** 指标 */
41
- var index = [];
42
- if (dimensionSource.length) {
43
- for (var _iterator = _createForOfIteratorHelperLoose(dimensionSource), _step; !(_step = _iterator()).done;) {
44
- var item = _step.value;
45
- var selected = item === null || item === void 0 ? void 0 : item.checked;
46
- var alias = item === null || item === void 0 ? void 0 : item.alias;
47
- var description = stringTrim(item.description);
48
- if (customDim !== null && customDim !== void 0 && customDim.length) {
49
- selected = customDim.includes(description);
50
- }
51
- if (selected) {
52
- dimension.push(alias || description);
53
- }
54
- item.description = description;
55
- }
56
- }
57
- if (indexSource.length) {
58
- for (var _iterator2 = _createForOfIteratorHelperLoose(indexSource), _step2; !(_step2 = _iterator2()).done;) {
59
- var _item = _step2.value;
60
- var _selected = _item === null || _item === void 0 ? void 0 : _item.checked;
61
- var _alias = _item === null || _item === void 0 ? void 0 : _item.alias;
62
- var name = stringTrim(_item.name);
63
- if (customIndex !== null && customIndex !== void 0 && customIndex.length) {
64
- _selected = customIndex.includes(name);
65
- }
66
- if (_selected) {
67
- index.push(_alias || name);
68
- }
69
- _item.name = name;
70
- }
71
- }
72
-
73
- /* 维度全选 */
74
- var dimAll = !!dimensionSource.length && dimensionSource.length === dimension.length;
75
- /* 维度不确定选中 */
76
- var dimIndeterminate = dimAll ? false : !!dimension.length;
77
-
78
- /* 指标全选 */
79
- var targetAll = !!indexSource.length && indexSource.length === index.length;
80
- /* 指标不确定选中 */
81
- var targetsIndeterminate = targetAll ? false : !!index.length;
82
- return {
83
- rememberCheck: rememberCheck,
84
- dims: {
85
- all: dimAll,
86
- title: dimJson === null || dimJson === void 0 ? void 0 : dimJson.title,
87
- indeterminate: dimIndeterminate,
88
- dimension: dimension,
89
- dimensionSource: dimensionSource
90
- },
91
- targets: {
92
- all: targetAll,
93
- title: indexJson === null || indexJson === void 0 ? void 0 : indexJson.title,
94
- indeterminate: targetsIndeterminate,
95
- index: index,
96
- indexSource: indexSource
97
- }
98
- };
99
- };
100
-
101
- /**
102
- * 获取维度指标数据源
103
- */
104
- exports.handleDimTargetFormat = handleDimTargetFormat;
105
- var getDimTargetData = /*#__PURE__*/function () {
106
- var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(rcProContext, params, dimTargetSource) {
107
- var _yield$getDimTarget, success, _yield$getDimTarget$r, result;
108
- return _regenerator["default"].wrap(function _callee$(_context) {
109
- while (1) switch (_context.prev = _context.next) {
110
- case 0:
111
- if (params !== null && params !== void 0 && params.dataSetName) {
112
- _context.next = 2;
113
- break;
114
- }
115
- return _context.abrupt("return", handleDimTargetFormat(dimTargetSource));
116
- case 2:
117
- _context.prev = 2;
118
- _context.next = 5;
119
- return (0, _dataCommon.getDimTarget)(rcProContext, params);
120
- case 5:
121
- _yield$getDimTarget = _context.sent;
122
- success = _yield$getDimTarget.success;
123
- _yield$getDimTarget$r = _yield$getDimTarget.result;
124
- result = _yield$getDimTarget$r === void 0 ? {} : _yield$getDimTarget$r;
125
- if (!success) {
126
- _context.next = 11;
127
- break;
128
- }
129
- return _context.abrupt("return", handleDimTargetFormat(dimTargetSource, result));
130
- case 11:
131
- _context.next = 16;
132
- break;
133
- case 13:
134
- _context.prev = 13;
135
- _context.t0 = _context["catch"](2);
136
- return _context.abrupt("return", Promise.reject(_context.t0));
137
- case 16:
138
- case "end":
139
- return _context.stop();
140
- }
141
- }, _callee, null, [[2, 13]]);
142
- }));
143
- return function getDimTargetData(_x, _x2, _x3) {
144
- return _ref3.apply(this, arguments);
145
- };
146
- }();
147
-
148
- /**
149
- * 数据渲染格式处理
150
- */
151
- exports.getDimTargetData = getDimTargetData;
152
- var handleValueFormat = function handleValueFormat(value, record, find, condition, onLink) {
153
- var _val;
154
- var val = value;
155
- if (typeof value === 'number') {
156
- if (!(find !== null && find !== void 0 && find.percent) && typeof (find === null || find === void 0 ? void 0 : find.precision) === 'number') {
157
- val = (0, _dataCommon.handleDecimal)(val, find.precision);
158
- }
159
- if (find !== null && find !== void 0 && find.thousand) {
160
- val = (0, _dataCommon.handleThousand)(val);
161
- }
162
- if (find !== null && find !== void 0 && find.percent) {
163
- val = (0, _dataCommon.handlePercent)(val, find.precision);
164
- }
165
- }
166
- if (find !== null && find !== void 0 && find.link) {
167
- val = (0, _dataCommon.handleLink)(value, onLink);
168
- }
169
- if (condition !== null && condition !== void 0 && condition.length) {
170
- val = (0, _dataCommon.handleCondition)(value, val, condition);
171
- }
172
- return (_val = val) !== null && _val !== void 0 ? _val : "-";
173
- };
174
-
175
- /**
176
- * 条件格式
177
- */
178
- exports.handleValueFormat = handleValueFormat;
179
- /**
180
- * 根据维度指标获取表格列
181
- */
182
- var handleColumns = function handleColumns(option, expressions, onLink) {
183
- var dimTarget = [].concat(option.dimension, option.index);
184
- return dimTarget.map(function (title) {
185
- var _find3, _find3$link, _find4, _find5, _title$toString;
186
- var find;
187
- var dataIndex;
188
- var condition;
189
- if (!find) {
190
- var _option$dimensionSour, _find;
191
- /* 通过别名或名称 查找当前维度的配置 */
192
- find = (_option$dimensionSour = option.dimensionSource) === null || _option$dimensionSour === void 0 ? void 0 : _option$dimensionSour.find(function (item) {
193
- return item.alias === title || item.description === title;
194
- });
195
- dataIndex = (_find = find) === null || _find === void 0 ? void 0 : _find.description;
196
- }
197
- if (!find) {
198
- var _option$indexSource, _find2;
199
- /* 通过别名或名称 查找当前指标的配置 */
200
- find = (_option$indexSource = option.indexSource) === null || _option$indexSource === void 0 ? void 0 : _option$indexSource.find(function (item) {
201
- return item.alias === title || item.name === title;
202
- });
203
- dataIndex = (_find2 = find) === null || _find2 === void 0 ? void 0 : _find2.name;
204
- }
205
- /* 条件格式设置 */
206
- // if (expressions?.length) {
207
- // condition = expressions?.filter((item) => item?.index?.includes(find?.name));
208
- // }
209
-
210
- var _ref4 = ((_find3 = find) === null || _find3 === void 0 ? void 0 : (_find3$link = _find3.link) === null || _find3$link === void 0 ? void 0 : _find3$link.split(_dataCommon.separator)) || [],
211
- dataSetName = _ref4[0];
212
- return {
213
- title: title,
214
- dataIndex: dataIndex,
215
- ellipsis: true,
216
- sorter: (_find4 = find) === null || _find4 === void 0 ? void 0 : _find4.sorted,
217
- width: ((_find5 = find) === null || _find5 === void 0 ? void 0 : _find5.width) || (0, _dataCommon.computeWidth)(title === null || title === void 0 ? void 0 : (_title$toString = title.toString()) === null || _title$toString === void 0 ? void 0 : _title$toString.length),
218
- render: function render(value, record) {
219
- return handleValueFormat(value, record, find, condition, function () {
220
- return onLink({
221
- dataSetName: dataSetName,
222
- record: record
223
- });
224
- });
225
- }
226
- };
227
- });
228
- };
229
- exports.handleColumns = handleColumns;