@ztocwst/rc-pro-materials 0.2.11 → 0.2.13

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.
@@ -155,7 +155,7 @@ var TableRenderer = function TableRenderer(props) {
155
155
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
156
156
  while (1) switch (_context2.prev = _context2.next) {
157
157
  case 0:
158
- columns = handleColumns(option, expressions, onLink);
158
+ columns = handleColumns(option, expressions, linkPage, onLink);
159
159
  (_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 ? void 0 : _tableRef$current.updateColumns(columns);
160
160
  case 2:
161
161
  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, onLink?: (v: linkParamsType) => void) => {
57
+ export declare const handleColumns: (option: DimTargetChangeOptionType, 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;
@@ -171,10 +171,10 @@ export var handleValueFormat = function handleValueFormat(value, record, find, c
171
171
  /**
172
172
  * 根据维度指标获取表格列
173
173
  */
174
- export var handleColumns = function handleColumns(option, expressions, onLink) {
174
+ export var handleColumns = function handleColumns(option, expressions, linkPage, onLink) {
175
175
  var dimTarget = [].concat(option.dimension, option.index);
176
176
  return dimTarget.map(function (title) {
177
- var _find3, _find3$link, _find4, _find5, _title$toString;
177
+ var _find3, _find3$link, _find4, _find5, _find6, _title$toString;
178
178
  var find;
179
179
  var dataIndex;
180
180
  var condition;
@@ -201,16 +201,23 @@ export var handleColumns = function handleColumns(option, expressions, onLink) {
201
201
 
202
202
  var _ref4 = ((_find3 = find) === null || _find3 === void 0 ? void 0 : (_find3$link = _find3.link) === null || _find3$link === void 0 ? void 0 : _find3$link.split(separator)) || [],
203
203
  dataSetName = _ref4[0];
204
+ var index;
205
+ if ((_find4 = find) !== null && _find4 !== void 0 && _find4.link && linkPage !== null && linkPage !== void 0 && linkPage.length) {
206
+ index = linkPage.findIndex(function (link) {
207
+ return "" + link.dataSetName + separator + link.title === find.link;
208
+ });
209
+ }
204
210
  return {
205
211
  title: title,
206
212
  dataIndex: dataIndex,
207
213
  ellipsis: true,
208
- sorter: (_find4 = find) === null || _find4 === void 0 ? void 0 : _find4.sorted,
209
- width: ((_find5 = find) === null || _find5 === void 0 ? void 0 : _find5.width) || computeWidth(title === null || title === void 0 ? void 0 : (_title$toString = title.toString()) === null || _title$toString === void 0 ? void 0 : _title$toString.length),
214
+ sorter: (_find5 = find) === null || _find5 === void 0 ? void 0 : _find5.sorted,
215
+ width: ((_find6 = find) === null || _find6 === void 0 ? void 0 : _find6.width) || computeWidth(title === null || title === void 0 ? void 0 : (_title$toString = title.toString()) === null || _title$toString === void 0 ? void 0 : _title$toString.length),
210
216
  render: function render(value, record) {
211
217
  return handleValueFormat(value, record, find, condition, function () {
212
218
  return onLink({
213
219
  dataSetName: dataSetName,
220
+ index: index,
214
221
  record: record
215
222
  });
216
223
  });
@@ -160,7 +160,7 @@ var TableRenderer = function TableRenderer(props) {
160
160
  return _regenerator["default"].wrap(function _callee2$(_context2) {
161
161
  while (1) switch (_context2.prev = _context2.next) {
162
162
  case 0:
163
- columns = (0, _tableRenderer.handleColumns)(option, expressions, onLink);
163
+ columns = (0, _tableRenderer.handleColumns)(option, expressions, linkPage, onLink);
164
164
  (_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 ? void 0 : _tableRef$current.updateColumns(columns);
165
165
  case 2:
166
166
  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, onLink?: (v: linkParamsType) => void) => {
57
+ export declare const handleColumns: (option: DimTargetChangeOptionType, 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;
@@ -179,10 +179,10 @@ exports.handleValueFormat = handleValueFormat;
179
179
  /**
180
180
  * 根据维度指标获取表格列
181
181
  */
182
- var handleColumns = function handleColumns(option, expressions, onLink) {
182
+ var handleColumns = function handleColumns(option, expressions, linkPage, onLink) {
183
183
  var dimTarget = [].concat(option.dimension, option.index);
184
184
  return dimTarget.map(function (title) {
185
- var _find3, _find3$link, _find4, _find5, _title$toString;
185
+ var _find3, _find3$link, _find4, _find5, _find6, _title$toString;
186
186
  var find;
187
187
  var dataIndex;
188
188
  var condition;
@@ -209,16 +209,23 @@ var handleColumns = function handleColumns(option, expressions, onLink) {
209
209
 
210
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
211
  dataSetName = _ref4[0];
212
+ var index;
213
+ if ((_find4 = find) !== null && _find4 !== void 0 && _find4.link && linkPage !== null && linkPage !== void 0 && linkPage.length) {
214
+ index = linkPage.findIndex(function (link) {
215
+ return "" + link.dataSetName + _dataCommon.separator + link.title === find.link;
216
+ });
217
+ }
212
218
  return {
213
219
  title: title,
214
220
  dataIndex: dataIndex,
215
221
  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),
222
+ sorter: (_find5 = find) === null || _find5 === void 0 ? void 0 : _find5.sorted,
223
+ width: ((_find6 = find) === null || _find6 === void 0 ? void 0 : _find6.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
224
  render: function render(value, record) {
219
225
  return handleValueFormat(value, record, find, condition, function () {
220
226
  return onLink({
221
227
  dataSetName: dataSetName,
228
+ index: index,
222
229
  record: record
223
230
  });
224
231
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ztocwst/rc-pro-materials",
3
- "version": "0.2.11",
3
+ "version": "0.2.13",
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.onmicrosoft.cn/@ztocwst/rc-pro-materials@0.2.11/build/lowcode/assets-prod.json"
89
+ "materialSchema": "https://npm.onmicrosoft.cn/@ztocwst/rc-pro-materials@0.2.13/build/lowcode/assets-prod.json"
90
90
  },
91
- "homepage": "https://unpkg.com/@ztocwst/rc-pro-materials@0.2.11/build/index.html",
91
+ "homepage": "https://unpkg.com/@ztocwst/rc-pro-materials@0.2.13/build/index.html",
92
92
  "publishConfig": {
93
93
  "registry": "https://registry.npmjs.org/",
94
94
  "access": "public"