@ztocwst/rc-pro-materials 0.2.16 → 0.2.17

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 (25) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/meta.js +1 -1
  5. package/build/lowcode/render/default/view.js +5 -5
  6. package/build/lowcode/view.js +5 -5
  7. package/dist/SCM_Comps.js +3 -3
  8. package/dist/SCM_Comps.js.map +1 -1
  9. package/es/components/z-templates-data-common/components/link-renderer/index.d.ts +1 -1
  10. package/es/components/z-templates-data-common/components/link-renderer/index.js +2 -1
  11. package/es/components/z-templates-data-common/components/table-renderer/index.js +4 -1
  12. package/es/components/z-templates-data-common/components/table-renderer/table-renderer.helper.d.ts +1 -1
  13. package/es/components/z-templates-data-common/components/table-renderer/table-renderer.helper.js +20 -1
  14. package/es/components/z-templates-data-common/data-common.d.ts +15 -0
  15. package/es/components/z-templates-data-common/data-common.helper.js +1 -1
  16. package/es/components/z-templates-data-common/data-common.js +65 -47
  17. package/lib/components/z-templates-data-common/components/link-renderer/index.d.ts +1 -1
  18. package/lib/components/z-templates-data-common/components/link-renderer/index.js +2 -1
  19. package/lib/components/z-templates-data-common/components/table-renderer/index.js +4 -1
  20. package/lib/components/z-templates-data-common/components/table-renderer/table-renderer.helper.d.ts +1 -1
  21. package/lib/components/z-templates-data-common/components/table-renderer/table-renderer.helper.js +20 -1
  22. package/lib/components/z-templates-data-common/data-common.d.ts +15 -0
  23. package/lib/components/z-templates-data-common/data-common.helper.js +1 -1
  24. package/lib/components/z-templates-data-common/data-common.js +65 -47
  25. package/package.json +3 -3
@@ -8,7 +8,7 @@ export interface linkParamsType extends Pick<TypeChartSettingProps, 'dataSetName
8
8
  dimension?: CheckboxValueType[];
9
9
  record?: Record<string, any>;
10
10
  }
11
- export interface linkStateType extends linkParamsType, Pick<TypeChartSettingProps, 'chartTitle' | 'custom' | 'child' | 'title' | 'autoLoad' | 'refreshRate'> {
11
+ export interface linkStateType extends linkParamsType, Pick<TypeChartSettingProps, 'chartTitle' | 'custom' | 'child' | 'title' | 'autoLoad' | 'refreshRate' | 'actionJson'> {
12
12
  }
13
13
  declare const LinkRenderer: (props: Pick<TypeChartSettingProps, "onConfirm" | "chartRef" | "dimJson" | "linkPage" | "linkPageTitle"> & {
14
14
  onBack?: () => void;
@@ -88,7 +88,8 @@ var LinkRenderer = function LinkRenderer(props) {
88
88
  dimension: [],
89
89
  dimensionSource: [],
90
90
  index: (targets === null || targets === void 0 ? void 0 : targets.index) || [],
91
- indexSource: (targets === null || targets === void 0 ? void 0 : targets.indexSource) || []
91
+ indexSource: (targets === null || targets === void 0 ? void 0 : targets.indexSource) || [],
92
+ actionJson: linkState === null || linkState === void 0 ? void 0 : linkState.actionJson
92
93
  };
93
94
  return handleColumns(option);
94
95
  };
@@ -22,6 +22,7 @@ var TableRenderer = function TableRenderer(props) {
22
22
  exportConfig = props.exportConfig,
23
23
  dimJson = props.dimJson,
24
24
  indexJson = props.indexJson,
25
+ actionJson = props.actionJson,
25
26
  expressions = props.expressions,
26
27
  linkPageTitle = props.linkPageTitle,
27
28
  linkPage = props.linkPage,
@@ -155,7 +156,9 @@ var TableRenderer = function TableRenderer(props) {
155
156
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
156
157
  while (1) switch (_context2.prev = _context2.next) {
157
158
  case 0:
158
- columns = handleColumns(option, expressions, linkPage, onLink);
159
+ columns = handleColumns(_extends({}, option, {
160
+ actionJson: actionJson
161
+ }), expressions, linkPage, onLink);
159
162
  (_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 ? void 0 : _tableRef$current.updateColumns(columns);
160
163
  case 2:
161
164
  case "end":
@@ -54,7 +54,7 @@ export type ExpressionsType = any[] | [];
54
54
  /**
55
55
  * 根据维度指标获取表格列
56
56
  */
57
- export declare const handleColumns: (option: DimTargetChangeOptionType, expressions?: ExpressionsType, linkPage?: TypeChartSettingProps[], onLink?: (v: linkParamsType) => void) => {
57
+ export declare const handleColumns: (option: DimTargetChangeOptionType & Pick<TypeChartSettingProps, 'actionJson'>, expressions?: ExpressionsType, linkPage?: TypeChartSettingProps[], onLink?: (v: linkParamsType) => void) => {
58
58
  title: import("antd/es/checkbox/Group").CheckboxValueType;
59
59
  dataIndex: string;
60
60
  ellipsis: boolean;
@@ -1,4 +1,7 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
1
3
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
4
+ var _excluded = ["isFixed", "fixed", "render"];
2
5
  import _regeneratorRuntime from "@babel/runtime/regenerator";
3
6
  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."); }
4
7
  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); }
@@ -172,8 +175,9 @@ export var handleValueFormat = function handleValueFormat(value, record, config,
172
175
  * 根据维度指标获取表格列
173
176
  */
174
177
  export var handleColumns = function handleColumns(option, expressions, linkPage, onLink) {
178
+ var _option$actionJson;
175
179
  var dimTarget = [].concat(option.dimension, option.index);
176
- return dimTarget.map(function (title) {
180
+ var columns = dimTarget.map(function (title) {
177
181
  var _config3, _config3$link, _config4, _config5, _config6, _title$toString, _config7, _config8, _config9;
178
182
  var config;
179
183
  var dataIndex;
@@ -226,4 +230,19 @@ export var handleColumns = function handleColumns(option, expressions, linkPage,
226
230
  }
227
231
  };
228
232
  });
233
+ if (option !== null && option !== void 0 && (_option$actionJson = option.actionJson) !== null && _option$actionJson !== void 0 && _option$actionJson.custom) {
234
+ var _ref5 = (option === null || option === void 0 ? void 0 : option.actionJson) || {},
235
+ isFixed = _ref5.isFixed,
236
+ fixed = _ref5.fixed,
237
+ _render = _ref5.render,
238
+ values = _objectWithoutPropertiesLoose(_ref5, _excluded);
239
+ columns.push(_extends({}, values, {
240
+ dataIndex: 'action',
241
+ fixed: isFixed ? fixed || isFixed : false,
242
+ render: function render(_, record) {
243
+ return _render === null || _render === void 0 ? void 0 : _render(record);
244
+ }
245
+ }));
246
+ }
247
+ return columns;
229
248
  };
@@ -65,6 +65,21 @@ export interface TypeChartSettingProps {
65
65
  remember?: boolean;
66
66
  /** 导出 */
67
67
  exporter?: boolean;
68
+ /** 操作列(表头)配置 */
69
+ actionJson?: {
70
+ /** 表头名称 */
71
+ title: string;
72
+ /** 宽度 */
73
+ width?: number;
74
+ /** 固定列 */
75
+ isFixed: boolean;
76
+ /** 固定到 */
77
+ fixed?: string;
78
+ /** 自定义渲染 */
79
+ custom: boolean;
80
+ /** 自定义渲染方法 */
81
+ render?: (p: any) => React.ReactNode;
82
+ };
68
83
  /** 导出配置 */
69
84
  exportConfig?: {
70
85
  name: string;
@@ -157,7 +157,7 @@ export var handleCondition = function handleCondition(value, handledValue, condi
157
157
  };
158
158
 
159
159
  // mock
160
- var token = 'scm:tenant:token:2:104:DB0D80CD71B76AF4A8858729478BA945';
160
+ var token = 'scm:tenant:token:2:9:64174758CFF5CA5921E1EC31750DDBDC';
161
161
 
162
162
  /** 获取维度指标 */
163
163
  export var getDimTarget = /*#__PURE__*/function () {
@@ -29,50 +29,66 @@ var ZTemplatesDataCommon = /*#__PURE__*/React.forwardRef(function (props, ref) {
29
29
  var onFinish = function onFinish(values) {
30
30
  chartRenderRef.current.queryChart(values);
31
31
  };
32
- var onConfirm = /*#__PURE__*/function () {
32
+ var onQueryValues = /*#__PURE__*/function () {
33
33
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
34
- var _yield$formRef$curren, _formRef$current, _formRef$current$vali, values;
34
+ var _formRef$current$vali, _formRef$current, _formRef$current$vali2;
35
35
  return _regeneratorRuntime.wrap(function _callee$(_context) {
36
36
  while (1) switch (_context.prev = _context.next) {
37
37
  case 0:
38
- _context.prev = 0;
39
- _context.next = 3;
40
- return (_formRef$current = formRef.current) === null || _formRef$current === void 0 ? void 0 : (_formRef$current$vali = _formRef$current.validateFieldsReturnFormatValue) === null || _formRef$current$vali === void 0 ? void 0 : _formRef$current$vali.call(_formRef$current);
38
+ return _context.abrupt("return", (_formRef$current$vali = (_formRef$current = formRef.current) === null || _formRef$current === void 0 ? void 0 : (_formRef$current$vali2 = _formRef$current.validateFields) === null || _formRef$current$vali2 === void 0 ? void 0 : _formRef$current$vali2.call(_formRef$current)) !== null && _formRef$current$vali !== void 0 ? _formRef$current$vali : {});
39
+ case 1:
40
+ case "end":
41
+ return _context.stop();
42
+ }
43
+ }, _callee);
44
+ }));
45
+ return function onQueryValues() {
46
+ return _ref.apply(this, arguments);
47
+ };
48
+ }();
49
+ var onQueryFormatValues = /*#__PURE__*/function () {
50
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
51
+ var _formRef$current$vali3, _formRef$current2, _formRef$current2$val;
52
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
53
+ while (1) switch (_context2.prev = _context2.next) {
54
+ case 0:
55
+ return _context2.abrupt("return", (_formRef$current$vali3 = (_formRef$current2 = formRef.current) === null || _formRef$current2 === void 0 ? void 0 : (_formRef$current2$val = _formRef$current2.validateFieldsReturnFormatValue) === null || _formRef$current2$val === void 0 ? void 0 : _formRef$current2$val.call(_formRef$current2)) !== null && _formRef$current$vali3 !== void 0 ? _formRef$current$vali3 : {});
56
+ case 1:
57
+ case "end":
58
+ return _context2.stop();
59
+ }
60
+ }, _callee2);
61
+ }));
62
+ return function onQueryFormatValues() {
63
+ return _ref2.apply(this, arguments);
64
+ };
65
+ }();
66
+ var onConfirm = /*#__PURE__*/function () {
67
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
68
+ var values;
69
+ return _regeneratorRuntime.wrap(function _callee3$(_context3) {
70
+ while (1) switch (_context3.prev = _context3.next) {
71
+ case 0:
72
+ _context3.prev = 0;
73
+ _context3.next = 3;
74
+ return onQueryFormatValues();
41
75
  case 3:
42
- _context.t1 = _yield$formRef$curren = _context.sent;
43
- _context.t0 = _context.t1 !== null;
44
- if (!_context.t0) {
45
- _context.next = 7;
46
- break;
47
- }
48
- _context.t0 = _yield$formRef$curren !== void 0;
49
- case 7:
50
- if (!_context.t0) {
51
- _context.next = 11;
52
- break;
53
- }
54
- _context.t2 = _yield$formRef$curren;
55
- _context.next = 12;
56
- break;
57
- case 11:
58
- _context.t2 = {};
59
- case 12:
60
- values = _context.t2;
76
+ values = _context3.sent;
61
77
  chartRenderRef.current.queryChart(values);
62
- _context.next = 19;
78
+ _context3.next = 10;
63
79
  break;
64
- case 16:
65
- _context.prev = 16;
66
- _context.t3 = _context["catch"](0);
67
- console.error(_context.t3);
68
- case 19:
80
+ case 7:
81
+ _context3.prev = 7;
82
+ _context3.t0 = _context3["catch"](0);
83
+ console.error(_context3.t0);
84
+ case 10:
69
85
  case "end":
70
- return _context.stop();
86
+ return _context3.stop();
71
87
  }
72
- }, _callee, null, [[0, 16]]);
88
+ }, _callee3, null, [[0, 7]]);
73
89
  }));
74
90
  return function onConfirm() {
75
- return _ref.apply(this, arguments);
91
+ return _ref3.apply(this, arguments);
76
92
  };
77
93
  }();
78
94
  var onLink = function onLink(values) {
@@ -81,7 +97,9 @@ var ZTemplatesDataCommon = /*#__PURE__*/React.forwardRef(function (props, ref) {
81
97
  };
82
98
  useImperativeHandle(ref, function () {
83
99
  return {
84
- onLink: onLink
100
+ onLink: onLink,
101
+ onQueryValues: onQueryValues,
102
+ onQueryFormatValues: onQueryFormatValues
85
103
  };
86
104
  });
87
105
  var formProps = processFormProps(querySetting);
@@ -90,32 +108,32 @@ var ZTemplatesDataCommon = /*#__PURE__*/React.forwardRef(function (props, ref) {
90
108
  formRef: formRef,
91
109
  onValuesChange: function onValuesChange(changeValues) {},
92
110
  onFinish: /*#__PURE__*/function () {
93
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(formatData) {
111
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(formatData) {
94
112
  var _formProps$onFinish;
95
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
96
- while (1) switch (_context2.prev = _context2.next) {
113
+ return _regeneratorRuntime.wrap(function _callee4$(_context4) {
114
+ while (1) switch (_context4.prev = _context4.next) {
97
115
  case 0:
98
- _context2.prev = 0;
99
- _context2.next = 3;
116
+ _context4.prev = 0;
117
+ _context4.next = 3;
100
118
  return (_formProps$onFinish = formProps.onFinish) === null || _formProps$onFinish === void 0 ? void 0 : _formProps$onFinish.call(formProps, formatData);
101
119
  case 3:
102
- _context2.next = 5;
120
+ _context4.next = 5;
103
121
  return onFinish === null || onFinish === void 0 ? void 0 : onFinish(formatData);
104
122
  case 5:
105
- _context2.next = 10;
123
+ _context4.next = 10;
106
124
  break;
107
125
  case 7:
108
- _context2.prev = 7;
109
- _context2.t0 = _context2["catch"](0);
110
- _message.error(_context2.t0);
126
+ _context4.prev = 7;
127
+ _context4.t0 = _context4["catch"](0);
128
+ _message.error(_context4.t0);
111
129
  case 10:
112
130
  case "end":
113
- return _context2.stop();
131
+ return _context4.stop();
114
132
  }
115
- }, _callee2, null, [[0, 7]]);
133
+ }, _callee4, null, [[0, 7]]);
116
134
  }));
117
135
  return function (_x) {
118
- return _ref2.apply(this, arguments);
136
+ return _ref4.apply(this, arguments);
119
137
  };
120
138
  }()
121
139
  })), /*#__PURE__*/React.createElement(ChartRenderer, {
@@ -8,7 +8,7 @@ export interface linkParamsType extends Pick<TypeChartSettingProps, 'dataSetName
8
8
  dimension?: CheckboxValueType[];
9
9
  record?: Record<string, any>;
10
10
  }
11
- export interface linkStateType extends linkParamsType, Pick<TypeChartSettingProps, 'chartTitle' | 'custom' | 'child' | 'title' | 'autoLoad' | 'refreshRate'> {
11
+ export interface linkStateType extends linkParamsType, Pick<TypeChartSettingProps, 'chartTitle' | 'custom' | 'child' | 'title' | 'autoLoad' | 'refreshRate' | 'actionJson'> {
12
12
  }
13
13
  declare const LinkRenderer: (props: Pick<TypeChartSettingProps, "onConfirm" | "chartRef" | "dimJson" | "linkPage" | "linkPageTitle"> & {
14
14
  onBack?: () => void;
@@ -93,7 +93,8 @@ var LinkRenderer = function LinkRenderer(props) {
93
93
  dimension: [],
94
94
  dimensionSource: [],
95
95
  index: (targets === null || targets === void 0 ? void 0 : targets.index) || [],
96
- indexSource: (targets === null || targets === void 0 ? void 0 : targets.indexSource) || []
96
+ indexSource: (targets === null || targets === void 0 ? void 0 : targets.indexSource) || [],
97
+ actionJson: linkState === null || linkState === void 0 ? void 0 : linkState.actionJson
97
98
  };
98
99
  return (0, _tableRenderer.handleColumns)(option);
99
100
  };
@@ -27,6 +27,7 @@ var TableRenderer = function TableRenderer(props) {
27
27
  exportConfig = props.exportConfig,
28
28
  dimJson = props.dimJson,
29
29
  indexJson = props.indexJson,
30
+ actionJson = props.actionJson,
30
31
  expressions = props.expressions,
31
32
  linkPageTitle = props.linkPageTitle,
32
33
  linkPage = props.linkPage,
@@ -160,7 +161,9 @@ var TableRenderer = function TableRenderer(props) {
160
161
  return _regenerator["default"].wrap(function _callee2$(_context2) {
161
162
  while (1) switch (_context2.prev = _context2.next) {
162
163
  case 0:
163
- columns = (0, _tableRenderer.handleColumns)(option, expressions, linkPage, onLink);
164
+ columns = (0, _tableRenderer.handleColumns)((0, _extends2["default"])({}, option, {
165
+ actionJson: actionJson
166
+ }), expressions, linkPage, onLink);
164
167
  (_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 ? void 0 : _tableRef$current.updateColumns(columns);
165
168
  case 2:
166
169
  case "end":
@@ -54,7 +54,7 @@ export type ExpressionsType = any[] | [];
54
54
  /**
55
55
  * 根据维度指标获取表格列
56
56
  */
57
- export declare const handleColumns: (option: DimTargetChangeOptionType, expressions?: ExpressionsType, linkPage?: TypeChartSettingProps[], onLink?: (v: linkParamsType) => void) => {
57
+ export declare const handleColumns: (option: DimTargetChangeOptionType & Pick<TypeChartSettingProps, 'actionJson'>, expressions?: ExpressionsType, linkPage?: TypeChartSettingProps[], onLink?: (v: linkParamsType) => void) => {
58
58
  title: import("antd/es/checkbox/Group").CheckboxValueType;
59
59
  dataIndex: string;
60
60
  ellipsis: boolean;
@@ -3,9 +3,12 @@
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
4
  exports.__esModule = true;
5
5
  exports.stringTrim = exports.handleValueFormat = exports.handleDimTargetFormat = exports.handleColumns = exports.getDimTargetData = void 0;
6
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
7
+ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
6
8
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
7
9
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
8
10
  var _dataCommon = require("../../data-common.helper");
11
+ var _excluded = ["isFixed", "fixed", "render"];
9
12
  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
13
  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
14
  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; }
@@ -180,8 +183,9 @@ exports.handleValueFormat = handleValueFormat;
180
183
  * 根据维度指标获取表格列
181
184
  */
182
185
  var handleColumns = function handleColumns(option, expressions, linkPage, onLink) {
186
+ var _option$actionJson;
183
187
  var dimTarget = [].concat(option.dimension, option.index);
184
- return dimTarget.map(function (title) {
188
+ var columns = dimTarget.map(function (title) {
185
189
  var _config3, _config3$link, _config4, _config5, _config6, _title$toString, _config7, _config8, _config9;
186
190
  var config;
187
191
  var dataIndex;
@@ -234,5 +238,20 @@ var handleColumns = function handleColumns(option, expressions, linkPage, onLink
234
238
  }
235
239
  };
236
240
  });
241
+ if (option !== null && option !== void 0 && (_option$actionJson = option.actionJson) !== null && _option$actionJson !== void 0 && _option$actionJson.custom) {
242
+ var _ref5 = (option === null || option === void 0 ? void 0 : option.actionJson) || {},
243
+ isFixed = _ref5.isFixed,
244
+ fixed = _ref5.fixed,
245
+ _render = _ref5.render,
246
+ values = (0, _objectWithoutPropertiesLoose2["default"])(_ref5, _excluded);
247
+ columns.push((0, _extends2["default"])({}, values, {
248
+ dataIndex: 'action',
249
+ fixed: isFixed ? fixed || isFixed : false,
250
+ render: function render(_, record) {
251
+ return _render === null || _render === void 0 ? void 0 : _render(record);
252
+ }
253
+ }));
254
+ }
255
+ return columns;
237
256
  };
238
257
  exports.handleColumns = handleColumns;
@@ -65,6 +65,21 @@ export interface TypeChartSettingProps {
65
65
  remember?: boolean;
66
66
  /** 导出 */
67
67
  exporter?: boolean;
68
+ /** 操作列(表头)配置 */
69
+ actionJson?: {
70
+ /** 表头名称 */
71
+ title: string;
72
+ /** 宽度 */
73
+ width?: number;
74
+ /** 固定列 */
75
+ isFixed: boolean;
76
+ /** 固定到 */
77
+ fixed?: string;
78
+ /** 自定义渲染 */
79
+ custom: boolean;
80
+ /** 自定义渲染方法 */
81
+ render?: (p: any) => React.ReactNode;
82
+ };
68
83
  /** 导出配置 */
69
84
  exportConfig?: {
70
85
  name: string;
@@ -172,7 +172,7 @@ var handleCondition = function handleCondition(value, handledValue, conditions)
172
172
 
173
173
  // mock
174
174
  exports.handleCondition = handleCondition;
175
- var token = 'scm:tenant:token:2:104:DB0D80CD71B76AF4A8858729478BA945';
175
+ var token = 'scm:tenant:token:2:9:64174758CFF5CA5921E1EC31750DDBDC';
176
176
 
177
177
  /** 获取维度指标 */
178
178
  var getDimTarget = /*#__PURE__*/function () {
@@ -35,50 +35,66 @@ var ZTemplatesDataCommon = /*#__PURE__*/_react["default"].forwardRef(function (p
35
35
  var onFinish = function onFinish(values) {
36
36
  chartRenderRef.current.queryChart(values);
37
37
  };
38
- var onConfirm = /*#__PURE__*/function () {
38
+ var onQueryValues = /*#__PURE__*/function () {
39
39
  var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
40
- var _yield$formRef$curren, _formRef$current, _formRef$current$vali, values;
40
+ var _formRef$current$vali, _formRef$current, _formRef$current$vali2;
41
41
  return _regenerator["default"].wrap(function _callee$(_context) {
42
42
  while (1) switch (_context.prev = _context.next) {
43
43
  case 0:
44
- _context.prev = 0;
45
- _context.next = 3;
46
- return (_formRef$current = formRef.current) === null || _formRef$current === void 0 ? void 0 : (_formRef$current$vali = _formRef$current.validateFieldsReturnFormatValue) === null || _formRef$current$vali === void 0 ? void 0 : _formRef$current$vali.call(_formRef$current);
44
+ return _context.abrupt("return", (_formRef$current$vali = (_formRef$current = formRef.current) === null || _formRef$current === void 0 ? void 0 : (_formRef$current$vali2 = _formRef$current.validateFields) === null || _formRef$current$vali2 === void 0 ? void 0 : _formRef$current$vali2.call(_formRef$current)) !== null && _formRef$current$vali !== void 0 ? _formRef$current$vali : {});
45
+ case 1:
46
+ case "end":
47
+ return _context.stop();
48
+ }
49
+ }, _callee);
50
+ }));
51
+ return function onQueryValues() {
52
+ return _ref.apply(this, arguments);
53
+ };
54
+ }();
55
+ var onQueryFormatValues = /*#__PURE__*/function () {
56
+ var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
57
+ var _formRef$current$vali3, _formRef$current2, _formRef$current2$val;
58
+ return _regenerator["default"].wrap(function _callee2$(_context2) {
59
+ while (1) switch (_context2.prev = _context2.next) {
60
+ case 0:
61
+ return _context2.abrupt("return", (_formRef$current$vali3 = (_formRef$current2 = formRef.current) === null || _formRef$current2 === void 0 ? void 0 : (_formRef$current2$val = _formRef$current2.validateFieldsReturnFormatValue) === null || _formRef$current2$val === void 0 ? void 0 : _formRef$current2$val.call(_formRef$current2)) !== null && _formRef$current$vali3 !== void 0 ? _formRef$current$vali3 : {});
62
+ case 1:
63
+ case "end":
64
+ return _context2.stop();
65
+ }
66
+ }, _callee2);
67
+ }));
68
+ return function onQueryFormatValues() {
69
+ return _ref2.apply(this, arguments);
70
+ };
71
+ }();
72
+ var onConfirm = /*#__PURE__*/function () {
73
+ var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
74
+ var values;
75
+ return _regenerator["default"].wrap(function _callee3$(_context3) {
76
+ while (1) switch (_context3.prev = _context3.next) {
77
+ case 0:
78
+ _context3.prev = 0;
79
+ _context3.next = 3;
80
+ return onQueryFormatValues();
47
81
  case 3:
48
- _context.t1 = _yield$formRef$curren = _context.sent;
49
- _context.t0 = _context.t1 !== null;
50
- if (!_context.t0) {
51
- _context.next = 7;
52
- break;
53
- }
54
- _context.t0 = _yield$formRef$curren !== void 0;
55
- case 7:
56
- if (!_context.t0) {
57
- _context.next = 11;
58
- break;
59
- }
60
- _context.t2 = _yield$formRef$curren;
61
- _context.next = 12;
62
- break;
63
- case 11:
64
- _context.t2 = {};
65
- case 12:
66
- values = _context.t2;
82
+ values = _context3.sent;
67
83
  chartRenderRef.current.queryChart(values);
68
- _context.next = 19;
84
+ _context3.next = 10;
69
85
  break;
70
- case 16:
71
- _context.prev = 16;
72
- _context.t3 = _context["catch"](0);
73
- console.error(_context.t3);
74
- case 19:
86
+ case 7:
87
+ _context3.prev = 7;
88
+ _context3.t0 = _context3["catch"](0);
89
+ console.error(_context3.t0);
90
+ case 10:
75
91
  case "end":
76
- return _context.stop();
92
+ return _context3.stop();
77
93
  }
78
- }, _callee, null, [[0, 16]]);
94
+ }, _callee3, null, [[0, 7]]);
79
95
  }));
80
96
  return function onConfirm() {
81
- return _ref.apply(this, arguments);
97
+ return _ref3.apply(this, arguments);
82
98
  };
83
99
  }();
84
100
  var onLink = function onLink(values) {
@@ -87,7 +103,9 @@ var ZTemplatesDataCommon = /*#__PURE__*/_react["default"].forwardRef(function (p
87
103
  };
88
104
  (0, _react.useImperativeHandle)(ref, function () {
89
105
  return {
90
- onLink: onLink
106
+ onLink: onLink,
107
+ onQueryValues: onQueryValues,
108
+ onQueryFormatValues: onQueryFormatValues
91
109
  };
92
110
  });
93
111
  var formProps = (0, _utils.processFormProps)(querySetting);
@@ -96,32 +114,32 @@ var ZTemplatesDataCommon = /*#__PURE__*/_react["default"].forwardRef(function (p
96
114
  formRef: formRef,
97
115
  onValuesChange: function onValuesChange(changeValues) {},
98
116
  onFinish: /*#__PURE__*/function () {
99
- var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(formatData) {
117
+ var _ref4 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(formatData) {
100
118
  var _formProps$onFinish;
101
- return _regenerator["default"].wrap(function _callee2$(_context2) {
102
- while (1) switch (_context2.prev = _context2.next) {
119
+ return _regenerator["default"].wrap(function _callee4$(_context4) {
120
+ while (1) switch (_context4.prev = _context4.next) {
103
121
  case 0:
104
- _context2.prev = 0;
105
- _context2.next = 3;
122
+ _context4.prev = 0;
123
+ _context4.next = 3;
106
124
  return (_formProps$onFinish = formProps.onFinish) === null || _formProps$onFinish === void 0 ? void 0 : _formProps$onFinish.call(formProps, formatData);
107
125
  case 3:
108
- _context2.next = 5;
126
+ _context4.next = 5;
109
127
  return onFinish === null || onFinish === void 0 ? void 0 : onFinish(formatData);
110
128
  case 5:
111
- _context2.next = 10;
129
+ _context4.next = 10;
112
130
  break;
113
131
  case 7:
114
- _context2.prev = 7;
115
- _context2.t0 = _context2["catch"](0);
116
- _message2["default"].error(_context2.t0);
132
+ _context4.prev = 7;
133
+ _context4.t0 = _context4["catch"](0);
134
+ _message2["default"].error(_context4.t0);
117
135
  case 10:
118
136
  case "end":
119
- return _context2.stop();
137
+ return _context4.stop();
120
138
  }
121
- }, _callee2, null, [[0, 7]]);
139
+ }, _callee4, null, [[0, 7]]);
122
140
  }));
123
141
  return function (_x) {
124
- return _ref2.apply(this, arguments);
142
+ return _ref4.apply(this, arguments);
125
143
  };
126
144
  }()
127
145
  })), /*#__PURE__*/_react["default"].createElement(_chartRenderer["default"], {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ztocwst/rc-pro-materials",
3
- "version": "0.2.16",
3
+ "version": "0.2.17",
4
4
  "description": "@ztocwst/rc-pro-materials",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -86,9 +86,9 @@
86
86
  },
87
87
  "componentConfig": {
88
88
  "isComponentLibrary": true,
89
- "materialSchema": "https://npm.ztocwst.com/@ztocwst/rc-pro-materials@0.2.16/build/lowcode/assets-prod.json"
89
+ "materialSchema": "https://npm.ztocwst.com/@ztocwst/rc-pro-materials@0.2.17/build/lowcode/assets-prod.json"
90
90
  },
91
- "homepage": "https://unpkg.com/@ztocwst/rc-pro-materials@0.2.16/build/index.html",
91
+ "homepage": "https://unpkg.com/@ztocwst/rc-pro-materials@0.2.17/build/index.html",
92
92
  "publishConfig": {
93
93
  "registry": "https://registry.npmjs.org/",
94
94
  "access": "public"