@ztocwst/rc-pro-materials 0.2.25 → 0.2.27
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.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.js +2 -2
- package/build/lowcode/view.js +2 -2
- package/dist/SCM_Comps.js +2 -2
- package/dist/SCM_Comps.js.map +1 -1
- package/es/components/z-data-table/components/custom-renderer/index.js +67 -37
- package/es/components/z-data-table/components/link-renderer/index.js +45 -26
- package/es/components/z-data-table/components/table-renderer/index.js +81 -65
- package/es/components/z-data-table/components/table-renderer/table-renderer.helper.d.ts +1 -14
- package/es/components/z-data-table/components/table-renderer/table-renderer.helper.js +26 -35
- package/es/components/z-data-table/data-table.d.ts +2 -1
- package/es/components/z-data-table/data-table.helper.d.ts +1 -0
- package/es/components/z-data-table/data-table.helper.js +2 -1
- package/lib/components/z-data-table/components/custom-renderer/index.js +67 -37
- package/lib/components/z-data-table/components/link-renderer/index.js +45 -26
- package/lib/components/z-data-table/components/table-renderer/index.js +81 -65
- package/lib/components/z-data-table/components/table-renderer/table-renderer.helper.d.ts +1 -14
- package/lib/components/z-data-table/components/table-renderer/table-renderer.helper.js +26 -34
- package/lib/components/z-data-table/data-table.d.ts +2 -1
- package/lib/components/z-data-table/data-table.helper.d.ts +1 -0
- package/lib/components/z-data-table/data-table.helper.js +2 -1
- package/package.json +5 -5
|
@@ -32,7 +32,6 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
32
32
|
dimJson = props.dimJson,
|
|
33
33
|
indexJson = props.indexJson,
|
|
34
34
|
actionJson = props.actionJson,
|
|
35
|
-
expressions = props.expressions,
|
|
36
35
|
linkPageTitle = props.linkPageTitle,
|
|
37
36
|
linkPage = props.linkPage,
|
|
38
37
|
queryBind = props.queryBind,
|
|
@@ -45,13 +44,10 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
45
44
|
var _useState = (0, _react.useState)(false),
|
|
46
45
|
loading = _useState[0],
|
|
47
46
|
setLoading = _useState[1];
|
|
48
|
-
var _useState2 = (0, _react.useState)(_dataTable.tableConfigDefault),
|
|
49
|
-
config = _useState2[0],
|
|
50
|
-
setConfig = _useState2[1];
|
|
51
47
|
/** 维度指标初始数据 */
|
|
52
|
-
var
|
|
53
|
-
dimTargetValue =
|
|
54
|
-
setDimTargetValue =
|
|
48
|
+
var _useState2 = (0, _react.useState)(),
|
|
49
|
+
dimTargetValue = _useState2[0],
|
|
50
|
+
setDimTargetValue = _useState2[1];
|
|
55
51
|
/** 合计 数据 */
|
|
56
52
|
var amounted = (0, _react.useRef)({});
|
|
57
53
|
var rcProContext = (0, _react.useContext)(_rcPro.RcConfigContext);
|
|
@@ -60,11 +56,12 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
60
56
|
_ref$tableOptions = _ref.tableOptions,
|
|
61
57
|
tableOptions = _ref$tableOptions === void 0 ? {} : _ref$tableOptions;
|
|
62
58
|
var defaultPageSize = (tableOptions === null || tableOptions === void 0 ? void 0 : (_tableOptions$paginat = tableOptions.pagination) === null || _tableOptions$paginat === void 0 ? void 0 : _tableOptions$paginat.defaultPageSize) || 20;
|
|
63
|
-
var
|
|
64
|
-
isLink =
|
|
65
|
-
setIsLink =
|
|
59
|
+
var _useState3 = (0, _react.useState)(false),
|
|
60
|
+
isLink = _useState3[0],
|
|
61
|
+
setIsLink = _useState3[1];
|
|
66
62
|
var linkChartRef = (0, _react.useRef)();
|
|
67
63
|
var timer = null;
|
|
64
|
+
var timeout = null;
|
|
68
65
|
var getDimTargetValues = function getDimTargetValues() {
|
|
69
66
|
var _dimTargetRef$current;
|
|
70
67
|
return (dimTargetRef === null || dimTargetRef === void 0 ? void 0 : (_dimTargetRef$current = dimTargetRef.current) === null || _dimTargetRef$current === void 0 ? void 0 : _dimTargetRef$current.getDimTargetValues()) || {};
|
|
@@ -167,7 +164,7 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
167
164
|
var _tableRef$current;
|
|
168
165
|
var columns = (0, _tableRenderer.handleColumns)((0, _extends2["default"])({}, option, {
|
|
169
166
|
actionJson: actionJson
|
|
170
|
-
}),
|
|
167
|
+
}), linkPage, onLink);
|
|
171
168
|
(_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 ? void 0 : _tableRef$current.updateColumns(columns);
|
|
172
169
|
};
|
|
173
170
|
var getBigDataBody = function getBigDataBody(params) {
|
|
@@ -230,9 +227,10 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
230
227
|
description: cur.description
|
|
231
228
|
});
|
|
232
229
|
if (cur !== null && cur !== void 0 && cur.sorted) {
|
|
230
|
+
var _cur$defaultSorted;
|
|
233
231
|
orderBys.push({
|
|
234
232
|
name: cur.description,
|
|
235
|
-
sort: _dataTable.defaultSort
|
|
233
|
+
sort: cur.defaultSorted ? (_cur$defaultSorted = cur.defaultSorted) === null || _cur$defaultSorted === void 0 ? void 0 : _cur$defaultSorted.slice(0, -3) : _dataTable.defaultSort
|
|
236
234
|
});
|
|
237
235
|
}
|
|
238
236
|
}
|
|
@@ -247,9 +245,10 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
247
245
|
description: _cur.name
|
|
248
246
|
});
|
|
249
247
|
if (_cur !== null && _cur !== void 0 && _cur.sorted) {
|
|
248
|
+
var _cur$defaultSorted2;
|
|
250
249
|
orderBys.push({
|
|
251
250
|
name: _cur.name,
|
|
252
|
-
sort: _dataTable.defaultSort
|
|
251
|
+
sort: _cur.defaultSorted ? (_cur$defaultSorted2 = _cur.defaultSorted) === null || _cur$defaultSorted2 === void 0 ? void 0 : _cur$defaultSorted2.slice(0, -3) : _dataTable.defaultSort
|
|
253
252
|
});
|
|
254
253
|
}
|
|
255
254
|
}
|
|
@@ -291,7 +290,7 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
291
290
|
// 获取数据源
|
|
292
291
|
var getDataSource = /*#__PURE__*/function () {
|
|
293
292
|
var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(params) {
|
|
294
|
-
var data,
|
|
293
|
+
var data, _ref4, success, _ref4$result, result;
|
|
295
294
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
296
295
|
while (1) switch (_context2.prev = _context2.next) {
|
|
297
296
|
case 0:
|
|
@@ -310,32 +309,39 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
310
309
|
_context2.next = 8;
|
|
311
310
|
return (0, _dataTable.getReportData)(rcProContext, data);
|
|
312
311
|
case 8:
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
312
|
+
_context2.t0 = _context2.sent;
|
|
313
|
+
if (_context2.t0) {
|
|
314
|
+
_context2.next = 11;
|
|
315
|
+
break;
|
|
316
|
+
}
|
|
317
|
+
_context2.t0 = {};
|
|
318
|
+
case 11:
|
|
319
|
+
_ref4 = _context2.t0;
|
|
320
|
+
success = _ref4.success;
|
|
321
|
+
_ref4$result = _ref4.result;
|
|
322
|
+
result = _ref4$result === void 0 ? {} : _ref4$result;
|
|
317
323
|
setLoading(false);
|
|
318
324
|
return _context2.abrupt("return", {
|
|
319
325
|
success: success,
|
|
320
326
|
result: result
|
|
321
327
|
});
|
|
322
|
-
case
|
|
323
|
-
_context2.prev =
|
|
324
|
-
_context2.
|
|
328
|
+
case 19:
|
|
329
|
+
_context2.prev = 19;
|
|
330
|
+
_context2.t1 = _context2["catch"](3);
|
|
325
331
|
setLoading(false);
|
|
326
|
-
console.error(_context2.
|
|
327
|
-
case
|
|
332
|
+
console.error(_context2.t1);
|
|
333
|
+
case 23:
|
|
328
334
|
case "end":
|
|
329
335
|
return _context2.stop();
|
|
330
336
|
}
|
|
331
|
-
}, _callee2, null, [[3,
|
|
337
|
+
}, _callee2, null, [[3, 19]]);
|
|
332
338
|
}));
|
|
333
339
|
return function getDataSource(_x2) {
|
|
334
340
|
return _ref3.apply(this, arguments);
|
|
335
341
|
};
|
|
336
342
|
}();
|
|
337
343
|
var initial = /*#__PURE__*/function () {
|
|
338
|
-
var
|
|
344
|
+
var _ref5 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(params) {
|
|
339
345
|
var result, dims, targets, option;
|
|
340
346
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
341
347
|
while (1) switch (_context3.prev = _context3.next) {
|
|
@@ -359,31 +365,6 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
359
365
|
};
|
|
360
366
|
handleUpdateColumns(option);
|
|
361
367
|
setDimTargetValue(result);
|
|
362
|
-
setConfig((0, _extends2["default"])({}, _dataTable.tableConfigDefault, {
|
|
363
|
-
pagination: {
|
|
364
|
-
showSizeChanger: true,
|
|
365
|
-
defaultPageSize: defaultPageSize
|
|
366
|
-
},
|
|
367
|
-
summary: summary,
|
|
368
|
-
request: function request(data) {
|
|
369
|
-
var _data$pagination, _data$pagination2, _data$sorter;
|
|
370
|
-
var pagination = {
|
|
371
|
-
pageNum: (_data$pagination = data.pagination) === null || _data$pagination === void 0 ? void 0 : _data$pagination.current,
|
|
372
|
-
pageSize: (_data$pagination2 = data.pagination) === null || _data$pagination2 === void 0 ? void 0 : _data$pagination2.pageSize
|
|
373
|
-
};
|
|
374
|
-
var orderBy = [];
|
|
375
|
-
if ((_data$sorter = data.sorter) !== null && _data$sorter !== void 0 && _data$sorter.order) {
|
|
376
|
-
var _data$sorter2, _data$sorter3, _data$sorter3$order;
|
|
377
|
-
orderBy.push({
|
|
378
|
-
name: (_data$sorter2 = data.sorter) === null || _data$sorter2 === void 0 ? void 0 : _data$sorter2.field,
|
|
379
|
-
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)
|
|
380
|
-
});
|
|
381
|
-
}
|
|
382
|
-
return getDataSource((0, _extends2["default"])({}, pagination, {
|
|
383
|
-
orderBy: orderBy
|
|
384
|
-
}));
|
|
385
|
-
}
|
|
386
|
-
}));
|
|
387
368
|
}
|
|
388
369
|
case 4:
|
|
389
370
|
case "end":
|
|
@@ -392,7 +373,7 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
392
373
|
}, _callee3);
|
|
393
374
|
}));
|
|
394
375
|
return function initial(_x3) {
|
|
395
|
-
return
|
|
376
|
+
return _ref5.apply(this, arguments);
|
|
396
377
|
};
|
|
397
378
|
}();
|
|
398
379
|
(0, _react.useEffect)(function () {
|
|
@@ -406,6 +387,12 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
406
387
|
timer = null;
|
|
407
388
|
}
|
|
408
389
|
};
|
|
390
|
+
var handleClearTimeout = function handleClearTimeout() {
|
|
391
|
+
if (timeout) {
|
|
392
|
+
clearTimeout(timeout);
|
|
393
|
+
timeout = null;
|
|
394
|
+
}
|
|
395
|
+
};
|
|
409
396
|
var onload = function onload() {
|
|
410
397
|
if (autoLoad) {
|
|
411
398
|
if (refreshRate) {
|
|
@@ -422,8 +409,8 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
422
409
|
};
|
|
423
410
|
(0, _react.useEffect)(function () {
|
|
424
411
|
if (currentKey) {
|
|
425
|
-
var
|
|
426
|
-
curDataSetName =
|
|
412
|
+
var _ref6 = currentKey.split(_dataTable.separator) || [],
|
|
413
|
+
curDataSetName = _ref6[0];
|
|
427
414
|
if (curDataSetName === dataSetName) {
|
|
428
415
|
onload();
|
|
429
416
|
} else {
|
|
@@ -437,18 +424,21 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
437
424
|
};
|
|
438
425
|
}, [currentKey, autoLoad]);
|
|
439
426
|
var queryChart = /*#__PURE__*/function () {
|
|
440
|
-
var
|
|
441
|
-
var _linkChartRef$current3;
|
|
427
|
+
var _ref7 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(value) {
|
|
428
|
+
var _linkChartRef$current3, _value;
|
|
442
429
|
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
|
443
430
|
while (1) switch (_context5.prev = _context5.next) {
|
|
444
431
|
case 0:
|
|
432
|
+
if (value === void 0) {
|
|
433
|
+
value = {};
|
|
434
|
+
}
|
|
445
435
|
if (isLink) {
|
|
446
436
|
(_linkChartRef$current3 = linkChartRef.current) === null || _linkChartRef$current3 === void 0 ? void 0 : _linkChartRef$current3.queryChart(value);
|
|
447
437
|
} else {
|
|
448
|
-
queryCacheRef.current = value[dataSetName] || value;
|
|
449
|
-
setTimeout( /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
|
|
438
|
+
queryCacheRef.current = ((_value = value) === null || _value === void 0 ? void 0 : _value[dataSetName]) || value;
|
|
439
|
+
timeout = window.setTimeout( /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
|
|
450
440
|
var _tableRef$current2;
|
|
451
|
-
var _getDimTargetValues4, _getDimTargetValues4$, indexSource, indexAmounted, target, _iterator4, _step4, cur,
|
|
441
|
+
var _getDimTargetValues4, _getDimTargetValues4$, indexSource, indexAmounted, target, _iterator4, _step4, cur, _ref9, success, _ref9$result, result, _result$data, _result$data$, data;
|
|
452
442
|
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
453
443
|
while (1) switch (_context4.prev = _context4.next) {
|
|
454
444
|
case 0:
|
|
@@ -483,29 +473,31 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
483
473
|
}
|
|
484
474
|
_context4.t0 = {};
|
|
485
475
|
case 11:
|
|
486
|
-
|
|
487
|
-
success =
|
|
488
|
-
|
|
489
|
-
result =
|
|
476
|
+
_ref9 = _context4.t0;
|
|
477
|
+
success = _ref9.success;
|
|
478
|
+
_ref9$result = _ref9.result;
|
|
479
|
+
result = _ref9$result === void 0 ? {} : _ref9$result;
|
|
490
480
|
if (success) {
|
|
491
481
|
_result$data = result === null || result === void 0 ? void 0 : result.data, _result$data$ = _result$data[0], data = _result$data$ === void 0 ? {} : _result$data$;
|
|
492
482
|
amounted.current = data;
|
|
493
483
|
}
|
|
494
484
|
case 16:
|
|
485
|
+
handleClearTimeout();
|
|
486
|
+
case 17:
|
|
495
487
|
case "end":
|
|
496
488
|
return _context4.stop();
|
|
497
489
|
}
|
|
498
490
|
}, _callee4);
|
|
499
491
|
})), 200);
|
|
500
492
|
}
|
|
501
|
-
case
|
|
493
|
+
case 2:
|
|
502
494
|
case "end":
|
|
503
495
|
return _context5.stop();
|
|
504
496
|
}
|
|
505
497
|
}, _callee5);
|
|
506
498
|
}));
|
|
507
499
|
return function queryChart(_x4) {
|
|
508
|
-
return
|
|
500
|
+
return _ref7.apply(this, arguments);
|
|
509
501
|
};
|
|
510
502
|
}();
|
|
511
503
|
(0, _react.useImperativeHandle)(chartRef, function () {
|
|
@@ -528,7 +520,31 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
528
520
|
})
|
|
529
521
|
}), /*#__PURE__*/React.createElement(_rcPro.ProTable, {
|
|
530
522
|
ref: tableRef,
|
|
531
|
-
config:
|
|
523
|
+
config: (0, _extends2["default"])({}, _dataTable.tableConfigDefault, {
|
|
524
|
+
pagination: {
|
|
525
|
+
showSizeChanger: true,
|
|
526
|
+
defaultPageSize: defaultPageSize
|
|
527
|
+
},
|
|
528
|
+
summary: summary,
|
|
529
|
+
request: function request(data) {
|
|
530
|
+
var _data$pagination, _data$pagination2, _data$sorter;
|
|
531
|
+
var pagination = {
|
|
532
|
+
pageNum: (_data$pagination = data.pagination) === null || _data$pagination === void 0 ? void 0 : _data$pagination.current,
|
|
533
|
+
pageSize: (_data$pagination2 = data.pagination) === null || _data$pagination2 === void 0 ? void 0 : _data$pagination2.pageSize
|
|
534
|
+
};
|
|
535
|
+
var orderBy = [];
|
|
536
|
+
if ((_data$sorter = data.sorter) !== null && _data$sorter !== void 0 && _data$sorter.order) {
|
|
537
|
+
var _data$sorter2, _data$sorter3, _data$sorter3$order;
|
|
538
|
+
orderBy.push({
|
|
539
|
+
name: (_data$sorter2 = data.sorter) === null || _data$sorter2 === void 0 ? void 0 : _data$sorter2.field,
|
|
540
|
+
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)
|
|
541
|
+
});
|
|
542
|
+
}
|
|
543
|
+
return getDataSource((0, _extends2["default"])({}, pagination, {
|
|
544
|
+
orderBy: orderBy
|
|
545
|
+
}));
|
|
546
|
+
}
|
|
547
|
+
})
|
|
532
548
|
})), /*#__PURE__*/React.createElement("div", {
|
|
533
549
|
style: {
|
|
534
550
|
display: isLink ? 'block' : 'none'
|
|
@@ -47,20 +47,7 @@ export declare const getDimTargetData: (rcProContext: any, params: Record<string
|
|
|
47
47
|
* 数据渲染格式处理
|
|
48
48
|
*/
|
|
49
49
|
export declare const handleValueFormat: (value: valueType, record: Record<string, any>, config?: Record<string, any>, condition?: any[], onLink?: () => void) => any;
|
|
50
|
-
/**
|
|
51
|
-
* 条件格式
|
|
52
|
-
*/
|
|
53
|
-
export type ExpressionsType = any[] | [];
|
|
54
50
|
/**
|
|
55
51
|
* 根据维度指标获取表格列
|
|
56
52
|
*/
|
|
57
|
-
export declare const handleColumns: (option: DimTargetChangeOptionType & Pick<TypeZDataTableProps, 'actionJson'>,
|
|
58
|
-
title: import("antd/es/checkbox/Group").CheckboxValueType;
|
|
59
|
-
dataIndex: string;
|
|
60
|
-
ellipsis: boolean;
|
|
61
|
-
defaultSortOrder: string;
|
|
62
|
-
sorter: any;
|
|
63
|
-
width: any;
|
|
64
|
-
fixed: any;
|
|
65
|
-
render: (value: valueType, record: Record<string, any>) => any;
|
|
66
|
-
}[];
|
|
53
|
+
export declare const handleColumns: (option: DimTargetChangeOptionType & Pick<TypeZDataTableProps, 'actionJson'>, linkPage?: TypeZDataTableProps[], onLink?: (v: linkParamsType) => void) => any[];
|
|
@@ -3,9 +3,9 @@
|
|
|
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
6
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
8
7
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
10
|
var _dataTable = require("../../data-table.helper");
|
|
11
11
|
var _excluded = ["isFixed", "fixed", "render"];
|
|
@@ -175,71 +175,63 @@ var handleValueFormat = function handleValueFormat(value, record, config, condit
|
|
|
175
175
|
return (_val = val) !== null && _val !== void 0 ? _val : "-";
|
|
176
176
|
};
|
|
177
177
|
|
|
178
|
-
/**
|
|
179
|
-
* 条件格式
|
|
180
|
-
*/
|
|
181
|
-
exports.handleValueFormat = handleValueFormat;
|
|
182
178
|
/**
|
|
183
179
|
* 根据维度指标获取表格列
|
|
184
180
|
*/
|
|
185
|
-
|
|
181
|
+
exports.handleValueFormat = handleValueFormat;
|
|
182
|
+
var handleColumns = function handleColumns(option, linkPage, onLink) {
|
|
186
183
|
var _option$actionJson;
|
|
187
|
-
|
|
184
|
+
// let isFirst = true
|
|
188
185
|
var dimTarget = [].concat(option.dimension, option.index);
|
|
189
186
|
var columns = dimTarget.map(function (title) {
|
|
190
|
-
var
|
|
187
|
+
var _config3, _config3$link, _config4, _config5, _config6, _config6$otherProps, _config7, _config8, _config9, _config10, _config11, _title$toString, _config12, _config13, _config14;
|
|
191
188
|
var config;
|
|
192
189
|
var dataIndex;
|
|
193
|
-
var defaultSortOrder;
|
|
194
190
|
var condition;
|
|
195
191
|
if (!config) {
|
|
196
|
-
var _option$dimensionSour, _config
|
|
192
|
+
var _option$dimensionSour, _config;
|
|
197
193
|
/* 通过别名或名称 查找当前维度的配置 */
|
|
198
194
|
config = (_option$dimensionSour = option.dimensionSource) === null || _option$dimensionSour === void 0 ? void 0 : _option$dimensionSour.find(function (item) {
|
|
199
195
|
return item.alias === title || item.description === title;
|
|
200
196
|
});
|
|
201
197
|
dataIndex = (_config = config) === null || _config === void 0 ? void 0 : _config.description;
|
|
202
|
-
if
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
}
|
|
198
|
+
// if(config?.sorted && isFirst){
|
|
199
|
+
// isFirst = false
|
|
200
|
+
// }
|
|
206
201
|
}
|
|
202
|
+
|
|
207
203
|
if (!config) {
|
|
208
|
-
var _option$indexSource,
|
|
204
|
+
var _option$indexSource, _config2;
|
|
209
205
|
/* 通过别名或名称 查找当前指标的配置 */
|
|
210
206
|
config = (_option$indexSource = option.indexSource) === null || _option$indexSource === void 0 ? void 0 : _option$indexSource.find(function (item) {
|
|
211
207
|
return item.alias === title || item.name === title;
|
|
212
208
|
});
|
|
213
|
-
dataIndex = (
|
|
214
|
-
if
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
}
|
|
209
|
+
dataIndex = (_config2 = config) === null || _config2 === void 0 ? void 0 : _config2.name;
|
|
210
|
+
// if(config?.sorted && isFirst){
|
|
211
|
+
// isFirst = false
|
|
212
|
+
// }
|
|
218
213
|
}
|
|
219
|
-
/* 条件格式设置 */
|
|
220
|
-
// if (expressions?.length) {
|
|
221
|
-
// condition = expressions?.filter((item) => item?.index?.includes(config?.name));
|
|
222
|
-
// }
|
|
223
214
|
|
|
224
|
-
var _ref4 = ((
|
|
215
|
+
var _ref4 = ((_config3 = config) === null || _config3 === void 0 ? void 0 : (_config3$link = _config3.link) === null || _config3$link === void 0 ? void 0 : _config3$link.split(_dataTable.separator)) || [],
|
|
225
216
|
dataSetName = _ref4[0];
|
|
226
217
|
var index;
|
|
227
|
-
if ((
|
|
218
|
+
if ((_config4 = config) !== null && _config4 !== void 0 && _config4.link && linkPage !== null && linkPage !== void 0 && linkPage.length) {
|
|
228
219
|
index = linkPage.findIndex(function (link) {
|
|
229
220
|
return "" + link.dataSetName + _dataTable.separator + link.title === config.link;
|
|
230
221
|
});
|
|
231
222
|
}
|
|
232
|
-
|
|
223
|
+
var other = (0, _extends2["default"])({}, (0, _dataTable.getType)((_config5 = config) === null || _config5 === void 0 ? void 0 : _config5.otherProps) === 'function' ? (_config6 = config) === null || _config6 === void 0 ? void 0 : (_config6$otherProps = _config6.otherProps) === null || _config6$otherProps === void 0 ? void 0 : _config6$otherProps.call(_config6) : (_config7 = config) === null || _config7 === void 0 ? void 0 : _config7.otherProps);
|
|
224
|
+
return (0, _extends2["default"])({}, other, {
|
|
233
225
|
title: title,
|
|
234
226
|
dataIndex: dataIndex,
|
|
235
227
|
ellipsis: true,
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
width: ((
|
|
239
|
-
fixed: (
|
|
228
|
+
sorter: (_config8 = config) === null || _config8 === void 0 ? void 0 : _config8.sorted,
|
|
229
|
+
defaultSortOrder: (_config9 = config) !== null && _config9 !== void 0 && _config9.sorted ? ((_config10 = config) === null || _config10 === void 0 ? void 0 : _config10.defaultSorted) || _dataTable.defaultSort + "end" : undefined,
|
|
230
|
+
width: ((_config11 = config) === null || _config11 === void 0 ? void 0 : _config11.width) || (0, _dataTable.computeWidth)(title === null || title === void 0 ? void 0 : (_title$toString = title.toString()) === null || _title$toString === void 0 ? void 0 : _title$toString.length),
|
|
231
|
+
fixed: (_config12 = config) !== null && _config12 !== void 0 && _config12.isFixed ? ((_config13 = config) === null || _config13 === void 0 ? void 0 : _config13.fixed) || ((_config14 = config) === null || _config14 === void 0 ? void 0 : _config14.isFixed) : false,
|
|
240
232
|
render: function render(value, record) {
|
|
241
|
-
var _config$render,
|
|
242
|
-
return config.custom ? (_config$render = (
|
|
233
|
+
var _config$render, _config15;
|
|
234
|
+
return config.custom ? (_config$render = (_config15 = config).render) === null || _config$render === void 0 ? void 0 : _config$render.call(_config15, value, record, config, condition) : handleValueFormat(value, record, config, condition, function () {
|
|
243
235
|
return onLink({
|
|
244
236
|
dataSetName: dataSetName,
|
|
245
237
|
index: index,
|
|
@@ -247,7 +239,7 @@ var handleColumns = function handleColumns(option, expressions, linkPage, onLink
|
|
|
247
239
|
});
|
|
248
240
|
});
|
|
249
241
|
}
|
|
250
|
-
};
|
|
242
|
+
});
|
|
251
243
|
});
|
|
252
244
|
if (option !== null && option !== void 0 && (_option$actionJson = option.actionJson) !== null && _option$actionJson !== void 0 && _option$actionJson.custom) {
|
|
253
245
|
var _columns$fn;
|
|
@@ -20,6 +20,8 @@ export interface TypeTargetProps {
|
|
|
20
20
|
percent: boolean;
|
|
21
21
|
/** 是否允许排序 */
|
|
22
22
|
sorted: boolean;
|
|
23
|
+
/** 默认排序 */
|
|
24
|
+
defaultSorted?: string;
|
|
23
25
|
/** 宽度 */
|
|
24
26
|
width: number;
|
|
25
27
|
/** 是否合计 */
|
|
@@ -91,7 +93,6 @@ export interface TypeZDataTableProps {
|
|
|
91
93
|
menuId: string;
|
|
92
94
|
};
|
|
93
95
|
/** 条件格式设置 */
|
|
94
|
-
expressions?: any[] | [];
|
|
95
96
|
linkPageTitle?: string;
|
|
96
97
|
/** 下钻二级页设置 */
|
|
97
98
|
linkPage?: TypeZDataTableProps[];
|
|
@@ -14,6 +14,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
14
14
|
var tableConfigDefault = {
|
|
15
15
|
manual: true,
|
|
16
16
|
toolBars: false,
|
|
17
|
+
resizable: false,
|
|
17
18
|
hideDefRowSelection: true,
|
|
18
19
|
columns: []
|
|
19
20
|
};
|
|
@@ -193,7 +194,7 @@ var handleCondition = function handleCondition(value, handledValue, conditions)
|
|
|
193
194
|
|
|
194
195
|
// mock
|
|
195
196
|
exports.handleCondition = handleCondition;
|
|
196
|
-
var token = 'scm:tenant:token:2:104:
|
|
197
|
+
var token = 'scm:tenant:token:2:104:9e53d7bb-7dac-4e2e-a371-060007dc9f76';
|
|
197
198
|
|
|
198
199
|
/** 获取维度指标 */
|
|
199
200
|
var getDimTarget = /*#__PURE__*/function () {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ztocwst/rc-pro-materials",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.27",
|
|
4
4
|
"description": "@ztocwst/rc-pro-materials",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"f2elint-fix": "f2elint fix",
|
|
23
23
|
"dumi": "cross-env APP_ROOT=docs dumi dev",
|
|
24
24
|
"dumi:build": "cross-env APP_ROOT=docs dumi build",
|
|
25
|
-
"prepublishOnly": "npm run build && npm run lowcode:build",
|
|
25
|
+
"-prepublishOnly": "npm run build && npm run lowcode:build",
|
|
26
26
|
"ding": "node ./scripts/notify",
|
|
27
27
|
"postpublish": "npm run ding"
|
|
28
28
|
},
|
|
@@ -86,11 +86,11 @@
|
|
|
86
86
|
},
|
|
87
87
|
"componentConfig": {
|
|
88
88
|
"isComponentLibrary": true,
|
|
89
|
-
"materialSchema": "https://npm.ztocwst.com/@ztocwst/rc-pro-materials@0.2.
|
|
89
|
+
"materialSchema": "https://npm.ztocwst.com/@ztocwst/rc-pro-materials@0.2.27/build/lowcode/assets-prod.json"
|
|
90
90
|
},
|
|
91
|
-
"homepage": "https://unpkg.com/@ztocwst/rc-pro-materials@0.2.
|
|
91
|
+
"homepage": "https://unpkg.com/@ztocwst/rc-pro-materials@0.2.27/build/index.html",
|
|
92
92
|
"publishConfig": {
|
|
93
93
|
"registry": "https://registry.npmjs.org/",
|
|
94
94
|
"access": "public"
|
|
95
95
|
}
|
|
96
|
-
}
|
|
96
|
+
}
|