@ztocwst/rc-pro-materials 0.1.30 → 0.1.32
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.css +1 -1
- package/build/lowcode/render/default/view.js +3 -3
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +3 -3
- package/dist/SCM_Comps.css +1 -1
- package/dist/SCM_Comps.js +6 -6
- package/dist/SCM_Comps.js.map +1 -1
- package/es/components/z-operation-records/index.d.ts +1 -1
- package/es/components/z-operation-records/operationRecords.js +2 -2
- package/es/components/z-pointer-block/index.less +1 -1
- package/es/components/z-pointer-block/z-pointer-block.js +1 -1
- package/es/components/z-templates-data-common/components/custom-renderer/index.js +2 -0
- package/es/components/z-templates-data-common/components/link-renderer/index.d.ts +3 -3
- package/es/components/z-templates-data-common/components/link-renderer/index.js +18 -14
- package/es/components/z-templates-data-common/components/table-renderer/index.js +2 -0
- package/es/components/z-templates-data-common/components/table-renderer/table-renderer.helper.js +7 -6
- package/es/components/z-templates-data-common/data-common.d.ts +3 -0
- package/es/components/z-templates-data-common/data-common.helper.js +3 -3
- package/es/utils/props/operationRecords.js +7 -3
- package/lib/components/z-operation-records/index.d.ts +1 -1
- package/lib/components/z-operation-records/operationRecords.js +1 -1
- package/lib/components/z-pointer-block/index.less +1 -1
- package/lib/components/z-pointer-block/z-pointer-block.js +1 -1
- package/lib/components/z-templates-data-common/components/custom-renderer/index.js +2 -0
- package/lib/components/z-templates-data-common/components/link-renderer/index.d.ts +3 -3
- package/lib/components/z-templates-data-common/components/link-renderer/index.js +18 -14
- package/lib/components/z-templates-data-common/components/table-renderer/index.js +2 -0
- package/lib/components/z-templates-data-common/components/table-renderer/table-renderer.helper.js +6 -5
- package/lib/components/z-templates-data-common/data-common.d.ts +3 -0
- package/lib/components/z-templates-data-common/data-common.helper.js +3 -3
- package/lib/utils/props/operationRecords.js +7 -3
- package/package.json +3 -3
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ProLog } from '@ztocwst/rc-pro';
|
|
3
3
|
import { processOperationRecordsProps } from "../../utils";
|
|
4
4
|
var ZOperationRecords = function ZOperationRecords(props) {
|
|
5
5
|
var operationProps = processOperationRecordsProps(props);
|
|
6
6
|
console.log('ZOperationRecords', operationProps, 1);
|
|
7
|
-
return /*#__PURE__*/React.createElement(
|
|
7
|
+
return /*#__PURE__*/React.createElement(ProLog, operationProps);
|
|
8
8
|
};
|
|
9
9
|
export default ZOperationRecords;
|
|
@@ -18,6 +18,7 @@ var CustomRenderer = function CustomRenderer(props) {
|
|
|
18
18
|
dimJson = _ref.dimJson,
|
|
19
19
|
indexJson = _ref.indexJson,
|
|
20
20
|
linkPage = _ref.linkPage,
|
|
21
|
+
linkPageTitle = _ref.linkPageTitle,
|
|
21
22
|
onConfirm = _ref.onConfirm,
|
|
22
23
|
formatter = _ref.formatter;
|
|
23
24
|
var rcProContext = useContext(RcConfigContext);
|
|
@@ -152,6 +153,7 @@ var CustomRenderer = function CustomRenderer(props) {
|
|
|
152
153
|
chartRef: linkChartRef,
|
|
153
154
|
dimJson: dimJson,
|
|
154
155
|
linkPage: linkPage,
|
|
156
|
+
linkPageTitle: linkPageTitle,
|
|
155
157
|
onConfirm: onConfirm,
|
|
156
158
|
onBack: function onBack() {
|
|
157
159
|
setIsLink(false);
|
|
@@ -3,14 +3,14 @@ import type { CheckboxValueType } from 'antd/es/checkbox/Group';
|
|
|
3
3
|
import type { TypeChartSettingProps } from '../../data-common';
|
|
4
4
|
import './index.less';
|
|
5
5
|
export interface linkParamsType extends Pick<TypeChartSettingProps, 'dataSetName'> {
|
|
6
|
-
index?: number;
|
|
6
|
+
index?: number | string;
|
|
7
7
|
width?: number;
|
|
8
8
|
dimension?: CheckboxValueType[];
|
|
9
9
|
record?: Record<string, any>;
|
|
10
10
|
}
|
|
11
|
-
export interface linkStateType extends linkParamsType, Pick<TypeChartSettingProps, 'title' | 'autoLoad' | 'refreshRate'> {
|
|
11
|
+
export interface linkStateType extends linkParamsType, Pick<TypeChartSettingProps, 'chartTitle' | 'title' | 'autoLoad' | 'refreshRate'> {
|
|
12
12
|
}
|
|
13
|
-
declare const LinkRenderer: (props: Pick<TypeChartSettingProps, "onConfirm" | "
|
|
13
|
+
declare const LinkRenderer: (props: Pick<TypeChartSettingProps, "onConfirm" | "chartRef" | "dimJson" | "linkPage" | "linkPageTitle"> & {
|
|
14
14
|
onBack?: () => void;
|
|
15
15
|
}) => import("react").JSX.Element;
|
|
16
16
|
export default LinkRenderer;
|
|
@@ -17,9 +17,9 @@ var LinkRenderer = function LinkRenderer(props) {
|
|
|
17
17
|
var _tableOptions$paginat, _linkPage$filter;
|
|
18
18
|
var dimJson = props.dimJson,
|
|
19
19
|
linkPage = props.linkPage,
|
|
20
|
+
linkPageTitle = props.linkPageTitle,
|
|
20
21
|
chartRef = props.chartRef,
|
|
21
22
|
onConfirm = props.onConfirm,
|
|
22
|
-
formatter = props.formatter,
|
|
23
23
|
onBack = props.onBack;
|
|
24
24
|
var rcProContext = useContext(RcConfigContext);
|
|
25
25
|
var _ref = rcProContext || {},
|
|
@@ -59,7 +59,7 @@ var LinkRenderer = function LinkRenderer(props) {
|
|
|
59
59
|
return function () {
|
|
60
60
|
handleClearInterval();
|
|
61
61
|
};
|
|
62
|
-
}, [linkState.dataSetName, linkState.autoLoad]);
|
|
62
|
+
}, [linkState.dataSetName, linkState.index, linkState.autoLoad]);
|
|
63
63
|
|
|
64
64
|
// 获取表头
|
|
65
65
|
var handleGetColumns = function handleGetColumns(stateParams) {
|
|
@@ -85,7 +85,7 @@ var LinkRenderer = function LinkRenderer(props) {
|
|
|
85
85
|
var getDataSource = /*#__PURE__*/function () {
|
|
86
86
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(params) {
|
|
87
87
|
var _dimJson$data;
|
|
88
|
-
var dataSetName, index, dimension, record, columns, queryBind, queryCache, query, queryKeys, recordKeys, dim, queryParams, data, queryData;
|
|
88
|
+
var dataSetName, index, dimension, record, columns, _linkPage$index, queryBind, formatter, queryCache, query, queryKeys, recordKeys, dim, queryParams, data, queryData;
|
|
89
89
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
90
90
|
while (1) switch (_context.prev = _context.next) {
|
|
91
91
|
case 0:
|
|
@@ -95,7 +95,7 @@ var LinkRenderer = function LinkRenderer(props) {
|
|
|
95
95
|
dataSetName = linkState.dataSetName, index = linkState.index, dimension = linkState.dimension, record = linkState.record;
|
|
96
96
|
columns = handleGetColumns(_extends({}, linkState));
|
|
97
97
|
/** 查看queryBind是否有 当前查询条件和当前数据源参数(paraJson)建立绑定关系;有的话替换成绑定关系中的"键",没有则是默认查询配置的"键",上一级数据源的维度 "值" 或 当前查询条件的"值"入参 */
|
|
98
|
-
|
|
98
|
+
_linkPage$index = linkPage[index], queryBind = _linkPage$index.queryBind, formatter = _linkPage$index.formatter;
|
|
99
99
|
queryCache = queryCacheRef.current;
|
|
100
100
|
query = {};
|
|
101
101
|
queryKeys = Object.keys(queryCache);
|
|
@@ -207,13 +207,15 @@ var LinkRenderer = function LinkRenderer(props) {
|
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
|
-
var _linkPage$
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
210
|
+
var _linkPage$index2 = linkPage[index],
|
|
211
|
+
chartTitle = _linkPage$index2.chartTitle,
|
|
212
|
+
title = _linkPage$index2.title,
|
|
213
|
+
autoLoad = _linkPage$index2.autoLoad,
|
|
214
|
+
refreshRate = _linkPage$index2.refreshRate;
|
|
214
215
|
var stateData = _extends({}, state, {
|
|
215
216
|
width: width,
|
|
216
217
|
index: index,
|
|
218
|
+
chartTitle: chartTitle,
|
|
217
219
|
title: title,
|
|
218
220
|
autoLoad: autoLoad,
|
|
219
221
|
refreshRate: refreshRate
|
|
@@ -249,13 +251,15 @@ var LinkRenderer = function LinkRenderer(props) {
|
|
|
249
251
|
var _ref6 = (value === null || value === void 0 ? void 0 : value.split(separator)) || [],
|
|
250
252
|
dataSetName = _ref6[0],
|
|
251
253
|
index = _ref6[1];
|
|
252
|
-
var _linkPage$
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
254
|
+
var _linkPage$index3 = linkPage[index],
|
|
255
|
+
chartTitle = _linkPage$index3.chartTitle,
|
|
256
|
+
title = _linkPage$index3.title,
|
|
257
|
+
autoLoad = _linkPage$index3.autoLoad,
|
|
258
|
+
refreshRate = _linkPage$index3.refreshRate;
|
|
256
259
|
var stateData = _extends({}, linkState, {
|
|
257
260
|
dataSetName: dataSetName,
|
|
258
261
|
index: index,
|
|
262
|
+
chartTitle: chartTitle,
|
|
259
263
|
title: title,
|
|
260
264
|
autoLoad: autoLoad,
|
|
261
265
|
refreshRate: refreshRate
|
|
@@ -270,10 +274,10 @@ var LinkRenderer = function LinkRenderer(props) {
|
|
|
270
274
|
}, /*#__PURE__*/React.createElement(ArrowLeftOutlined, {
|
|
271
275
|
className: "arrow-left",
|
|
272
276
|
onClick: onBack
|
|
273
|
-
}), /*#__PURE__*/React.createElement("span", null, linkState
|
|
277
|
+
}), /*#__PURE__*/React.createElement("span", null, linkState.chartTitle || linkPageTitle)), (linkPage === null || linkPage === void 0 ? void 0 : (_linkPage$filter = linkPage.filter(function (field) {
|
|
274
278
|
return (field === null || field === void 0 ? void 0 : field.dataSetName) === linkState.dataSetName;
|
|
275
279
|
})) === null || _linkPage$filter === void 0 ? void 0 : _linkPage$filter.length) <= 1 ? null : /*#__PURE__*/React.createElement(_Radio.Group, {
|
|
276
|
-
value: "" + (linkState === null || linkState === void 0 ? void 0 : linkState.
|
|
280
|
+
value: "" + (linkState === null || linkState === void 0 ? void 0 : linkState.dataSetName) + separator + linkState.index,
|
|
277
281
|
onChange: handleLinkChange
|
|
278
282
|
}, linkPage === null || linkPage === void 0 ? void 0 : linkPage.map(function (field, index) {
|
|
279
283
|
return (field === null || field === void 0 ? void 0 : field.dataSetName) === linkState.dataSetName ? /*#__PURE__*/React.createElement(_Radio.Button, {
|
|
@@ -23,6 +23,7 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
23
23
|
dimJson = props.dimJson,
|
|
24
24
|
indexJson = props.indexJson,
|
|
25
25
|
expressions = props.expressions,
|
|
26
|
+
linkPageTitle = props.linkPageTitle,
|
|
26
27
|
linkPage = props.linkPage,
|
|
27
28
|
queryBind = props.queryBind,
|
|
28
29
|
chartRef = props.chartRef,
|
|
@@ -470,6 +471,7 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
470
471
|
chartRef: linkChartRef,
|
|
471
472
|
dimJson: dimJson,
|
|
472
473
|
linkPage: linkPage,
|
|
474
|
+
linkPageTitle: linkPageTitle,
|
|
473
475
|
onConfirm: onConfirm,
|
|
474
476
|
onBack: function onBack() {
|
|
475
477
|
setIsLink(false);
|
package/es/components/z-templates-data-common/components/table-renderer/table-renderer.helper.js
CHANGED
|
@@ -3,7 +3,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
3
3
|
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
4
|
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); }
|
|
5
5
|
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; }
|
|
6
|
-
import { computeWidth, handleDecimal, handleThousand, handlePercent, handleLink, handleCondition, getDimTarget } from "../../data-common.helper";
|
|
6
|
+
import { separator, computeWidth, handleDecimal, handleThousand, handlePercent, handleLink, handleCondition, getDimTarget } from "../../data-common.helper";
|
|
7
7
|
export var stringTrim = function stringTrim(str) {
|
|
8
8
|
if (!str) return '';
|
|
9
9
|
return str.replace(/`|'|"/g, '');
|
|
@@ -174,7 +174,7 @@ export var handleValueFormat = function handleValueFormat(value, record, find, c
|
|
|
174
174
|
export var handleColumns = function handleColumns(option, expressions, onLink) {
|
|
175
175
|
var dimTarget = [].concat(option.dimension, option.index);
|
|
176
176
|
return dimTarget.map(function (title) {
|
|
177
|
-
var _find3, _find4, _title$toString;
|
|
177
|
+
var _find3, _find3$link, _find4, _find5, _title$toString;
|
|
178
178
|
var find;
|
|
179
179
|
var dataIndex;
|
|
180
180
|
var condition;
|
|
@@ -199,17 +199,18 @@ export var handleColumns = function handleColumns(option, expressions, onLink) {
|
|
|
199
199
|
// condition = expressions?.filter((item) => item?.index?.includes(find?.name));
|
|
200
200
|
// }
|
|
201
201
|
|
|
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
|
+
dataSetName = _ref4[0];
|
|
202
204
|
return {
|
|
203
205
|
title: title,
|
|
204
206
|
dataIndex: dataIndex,
|
|
205
207
|
ellipsis: true,
|
|
206
|
-
sorter: (
|
|
207
|
-
width: ((
|
|
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),
|
|
208
210
|
render: function render(value, record) {
|
|
209
211
|
return handleValueFormat(value, record, find, condition, function () {
|
|
210
|
-
var _find5;
|
|
211
212
|
return onLink({
|
|
212
|
-
dataSetName:
|
|
213
|
+
dataSetName: dataSetName,
|
|
213
214
|
record: record
|
|
214
215
|
});
|
|
215
216
|
});
|
|
@@ -35,6 +35,8 @@ export interface TypeTargetProps {
|
|
|
35
35
|
}
|
|
36
36
|
/** 表格相关配置 */
|
|
37
37
|
export interface TypeChartSettingProps {
|
|
38
|
+
/** 二级页标题 */
|
|
39
|
+
chartTitle?: string;
|
|
38
40
|
/** 标题 */
|
|
39
41
|
title?: string;
|
|
40
42
|
/** 维度配置 */
|
|
@@ -67,6 +69,7 @@ export interface TypeChartSettingProps {
|
|
|
67
69
|
};
|
|
68
70
|
/** 条件格式设置 */
|
|
69
71
|
expressions?: any[] | [];
|
|
72
|
+
linkPageTitle?: string;
|
|
70
73
|
/** 下钻二级页设置 */
|
|
71
74
|
linkPage?: TypeChartSettingProps[];
|
|
72
75
|
/** 数据源参数"键"" 和 查询参数"值" 和 上一级维度(dim)"值" 关系绑定 */
|
|
@@ -157,16 +157,16 @@ export var handleCondition = function handleCondition(value, handledValue, condi
|
|
|
157
157
|
};
|
|
158
158
|
|
|
159
159
|
// mock
|
|
160
|
-
var token = 'scm:tenant:token:2:104:
|
|
160
|
+
var token = 'scm:tenant:token:2:104:177217352666D386AA01E5AF6293727D';
|
|
161
161
|
|
|
162
162
|
/** 获取维度指标 */
|
|
163
163
|
export var getDimTarget = /*#__PURE__*/function () {
|
|
164
164
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(rcProContext, params) {
|
|
165
|
-
var _ref2, materialsRequest, env,
|
|
165
|
+
var _ref2, materialsRequest, env, res, _res;
|
|
166
166
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
167
167
|
while (1) switch (_context.prev = _context.next) {
|
|
168
168
|
case 0:
|
|
169
|
-
_ref2 = rcProContext || {}, materialsRequest = _ref2.materialsRequest, env = _ref2.env
|
|
169
|
+
_ref2 = rcProContext || {}, materialsRequest = _ref2.materialsRequest, env = _ref2.env; // 供应链里由子应用透传
|
|
170
170
|
if (!materialsRequest) {
|
|
171
171
|
_context.next = 6;
|
|
172
172
|
break;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
3
|
-
var _excluded = ["timelineProps", "columns", "transform", "
|
|
3
|
+
var _excluded = ["timelineProps", "request", "columns", "transform", "timeItemProps", "valueEnum"];
|
|
4
4
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
5
5
|
|
|
6
6
|
import { processJsonOrFunctionProps } from "../../../lib";
|
|
@@ -9,9 +9,11 @@ import { processJsonOrFunctionProps } from "../../../lib";
|
|
|
9
9
|
var processOperationProps = function processOperationProps(props) {
|
|
10
10
|
var processObjectValue = function processObjectValue(obj) {
|
|
11
11
|
var timelineProps = obj.timelineProps,
|
|
12
|
+
request = obj.request,
|
|
12
13
|
columns = obj.columns,
|
|
13
14
|
transform = obj.transform,
|
|
14
|
-
|
|
15
|
+
timeItemProps = obj.timeItemProps,
|
|
16
|
+
valueEnum = obj.valueEnum,
|
|
15
17
|
rest = _objectWithoutPropertiesLoose(obj, _excluded);
|
|
16
18
|
return _extends({}, columns !== null && columns !== void 0 && columns.length ? {
|
|
17
19
|
columns: columns === null || columns === void 0 ? void 0 : columns.map(function (v) {
|
|
@@ -19,7 +21,9 @@ var processOperationProps = function processOperationProps(props) {
|
|
|
19
21
|
})
|
|
20
22
|
} : [], transform ? {
|
|
21
23
|
transform: transform
|
|
22
|
-
} : {}, timelineProps ? processJsonOrFunctionProps(timelineProps) : {},
|
|
24
|
+
} : {}, timelineProps ? processJsonOrFunctionProps(timelineProps) : {}, timeItemProps ? processJsonOrFunctionProps(timeItemProps) : {}, valueEnum ? {
|
|
25
|
+
valueEnum: valueEnum
|
|
26
|
+
} : {}, rest);
|
|
23
27
|
};
|
|
24
28
|
if (Array.isArray(props)) {
|
|
25
29
|
return props === null || props === void 0 ? void 0 : props.map(function (e) {
|
|
@@ -10,7 +10,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
10
10
|
var ZOperationRecords = function ZOperationRecords(props) {
|
|
11
11
|
var operationProps = (0, _utils.processOperationRecordsProps)(props);
|
|
12
12
|
console.log('ZOperationRecords', operationProps, 1);
|
|
13
|
-
return /*#__PURE__*/React.createElement(_rcPro.
|
|
13
|
+
return /*#__PURE__*/React.createElement(_rcPro.ProLog, operationProps);
|
|
14
14
|
};
|
|
15
15
|
var _default = ZOperationRecords;
|
|
16
16
|
exports["default"] = _default;
|
|
@@ -35,7 +35,7 @@ var ZPointerBlock = function ZPointerBlock(props) {
|
|
|
35
35
|
value: value,
|
|
36
36
|
groupSeparator: ""
|
|
37
37
|
})), icon ? /*#__PURE__*/React.createElement(_col["default"], {
|
|
38
|
-
className: "icon"
|
|
38
|
+
className: "z-pointer-icon"
|
|
39
39
|
}, icon) : null));
|
|
40
40
|
};
|
|
41
41
|
var _default = ZPointerBlock;
|
|
@@ -23,6 +23,7 @@ var CustomRenderer = function CustomRenderer(props) {
|
|
|
23
23
|
dimJson = _ref.dimJson,
|
|
24
24
|
indexJson = _ref.indexJson,
|
|
25
25
|
linkPage = _ref.linkPage,
|
|
26
|
+
linkPageTitle = _ref.linkPageTitle,
|
|
26
27
|
onConfirm = _ref.onConfirm,
|
|
27
28
|
formatter = _ref.formatter;
|
|
28
29
|
var rcProContext = (0, _react.useContext)(_rcPro.RcConfigContext);
|
|
@@ -157,6 +158,7 @@ var CustomRenderer = function CustomRenderer(props) {
|
|
|
157
158
|
chartRef: linkChartRef,
|
|
158
159
|
dimJson: dimJson,
|
|
159
160
|
linkPage: linkPage,
|
|
161
|
+
linkPageTitle: linkPageTitle,
|
|
160
162
|
onConfirm: onConfirm,
|
|
161
163
|
onBack: function onBack() {
|
|
162
164
|
setIsLink(false);
|
|
@@ -3,14 +3,14 @@ import type { CheckboxValueType } from 'antd/es/checkbox/Group';
|
|
|
3
3
|
import type { TypeChartSettingProps } from '../../data-common';
|
|
4
4
|
import './index.less';
|
|
5
5
|
export interface linkParamsType extends Pick<TypeChartSettingProps, 'dataSetName'> {
|
|
6
|
-
index?: number;
|
|
6
|
+
index?: number | string;
|
|
7
7
|
width?: number;
|
|
8
8
|
dimension?: CheckboxValueType[];
|
|
9
9
|
record?: Record<string, any>;
|
|
10
10
|
}
|
|
11
|
-
export interface linkStateType extends linkParamsType, Pick<TypeChartSettingProps, 'title' | 'autoLoad' | 'refreshRate'> {
|
|
11
|
+
export interface linkStateType extends linkParamsType, Pick<TypeChartSettingProps, 'chartTitle' | 'title' | 'autoLoad' | 'refreshRate'> {
|
|
12
12
|
}
|
|
13
|
-
declare const LinkRenderer: (props: Pick<TypeChartSettingProps, "onConfirm" | "
|
|
13
|
+
declare const LinkRenderer: (props: Pick<TypeChartSettingProps, "onConfirm" | "chartRef" | "dimJson" | "linkPage" | "linkPageTitle"> & {
|
|
14
14
|
onBack?: () => void;
|
|
15
15
|
}) => import("react").JSX.Element;
|
|
16
16
|
export default LinkRenderer;
|
|
@@ -22,9 +22,9 @@ var LinkRenderer = function LinkRenderer(props) {
|
|
|
22
22
|
var _tableOptions$paginat, _linkPage$filter;
|
|
23
23
|
var dimJson = props.dimJson,
|
|
24
24
|
linkPage = props.linkPage,
|
|
25
|
+
linkPageTitle = props.linkPageTitle,
|
|
25
26
|
chartRef = props.chartRef,
|
|
26
27
|
onConfirm = props.onConfirm,
|
|
27
|
-
formatter = props.formatter,
|
|
28
28
|
onBack = props.onBack;
|
|
29
29
|
var rcProContext = (0, _react.useContext)(_rcPro.RcConfigContext);
|
|
30
30
|
var _ref = rcProContext || {},
|
|
@@ -64,7 +64,7 @@ var LinkRenderer = function LinkRenderer(props) {
|
|
|
64
64
|
return function () {
|
|
65
65
|
handleClearInterval();
|
|
66
66
|
};
|
|
67
|
-
}, [linkState.dataSetName, linkState.autoLoad]);
|
|
67
|
+
}, [linkState.dataSetName, linkState.index, linkState.autoLoad]);
|
|
68
68
|
|
|
69
69
|
// 获取表头
|
|
70
70
|
var handleGetColumns = function handleGetColumns(stateParams) {
|
|
@@ -90,7 +90,7 @@ var LinkRenderer = function LinkRenderer(props) {
|
|
|
90
90
|
var getDataSource = /*#__PURE__*/function () {
|
|
91
91
|
var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(params) {
|
|
92
92
|
var _dimJson$data;
|
|
93
|
-
var dataSetName, index, dimension, record, columns, queryBind, queryCache, query, queryKeys, recordKeys, dim, queryParams, data, queryData;
|
|
93
|
+
var dataSetName, index, dimension, record, columns, _linkPage$index, queryBind, formatter, queryCache, query, queryKeys, recordKeys, dim, queryParams, data, queryData;
|
|
94
94
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
95
95
|
while (1) switch (_context.prev = _context.next) {
|
|
96
96
|
case 0:
|
|
@@ -100,7 +100,7 @@ var LinkRenderer = function LinkRenderer(props) {
|
|
|
100
100
|
dataSetName = linkState.dataSetName, index = linkState.index, dimension = linkState.dimension, record = linkState.record;
|
|
101
101
|
columns = handleGetColumns((0, _extends2["default"])({}, linkState));
|
|
102
102
|
/** 查看queryBind是否有 当前查询条件和当前数据源参数(paraJson)建立绑定关系;有的话替换成绑定关系中的"键",没有则是默认查询配置的"键",上一级数据源的维度 "值" 或 当前查询条件的"值"入参 */
|
|
103
|
-
|
|
103
|
+
_linkPage$index = linkPage[index], queryBind = _linkPage$index.queryBind, formatter = _linkPage$index.formatter;
|
|
104
104
|
queryCache = queryCacheRef.current;
|
|
105
105
|
query = {};
|
|
106
106
|
queryKeys = Object.keys(queryCache);
|
|
@@ -212,13 +212,15 @@ var LinkRenderer = function LinkRenderer(props) {
|
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
|
-
var _linkPage$
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
215
|
+
var _linkPage$index2 = linkPage[index],
|
|
216
|
+
chartTitle = _linkPage$index2.chartTitle,
|
|
217
|
+
title = _linkPage$index2.title,
|
|
218
|
+
autoLoad = _linkPage$index2.autoLoad,
|
|
219
|
+
refreshRate = _linkPage$index2.refreshRate;
|
|
219
220
|
var stateData = (0, _extends2["default"])({}, state, {
|
|
220
221
|
width: width,
|
|
221
222
|
index: index,
|
|
223
|
+
chartTitle: chartTitle,
|
|
222
224
|
title: title,
|
|
223
225
|
autoLoad: autoLoad,
|
|
224
226
|
refreshRate: refreshRate
|
|
@@ -254,13 +256,15 @@ var LinkRenderer = function LinkRenderer(props) {
|
|
|
254
256
|
var _ref6 = (value === null || value === void 0 ? void 0 : value.split(_dataCommon.separator)) || [],
|
|
255
257
|
dataSetName = _ref6[0],
|
|
256
258
|
index = _ref6[1];
|
|
257
|
-
var _linkPage$
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
259
|
+
var _linkPage$index3 = linkPage[index],
|
|
260
|
+
chartTitle = _linkPage$index3.chartTitle,
|
|
261
|
+
title = _linkPage$index3.title,
|
|
262
|
+
autoLoad = _linkPage$index3.autoLoad,
|
|
263
|
+
refreshRate = _linkPage$index3.refreshRate;
|
|
261
264
|
var stateData = (0, _extends2["default"])({}, linkState, {
|
|
262
265
|
dataSetName: dataSetName,
|
|
263
266
|
index: index,
|
|
267
|
+
chartTitle: chartTitle,
|
|
264
268
|
title: title,
|
|
265
269
|
autoLoad: autoLoad,
|
|
266
270
|
refreshRate: refreshRate
|
|
@@ -275,10 +279,10 @@ var LinkRenderer = function LinkRenderer(props) {
|
|
|
275
279
|
}, /*#__PURE__*/React.createElement(_icons.ArrowLeftOutlined, {
|
|
276
280
|
className: "arrow-left",
|
|
277
281
|
onClick: onBack
|
|
278
|
-
}), /*#__PURE__*/React.createElement("span", null, linkState
|
|
282
|
+
}), /*#__PURE__*/React.createElement("span", null, linkState.chartTitle || linkPageTitle)), (linkPage === null || linkPage === void 0 ? void 0 : (_linkPage$filter = linkPage.filter(function (field) {
|
|
279
283
|
return (field === null || field === void 0 ? void 0 : field.dataSetName) === linkState.dataSetName;
|
|
280
284
|
})) === null || _linkPage$filter === void 0 ? void 0 : _linkPage$filter.length) <= 1 ? null : /*#__PURE__*/React.createElement(_radio["default"].Group, {
|
|
281
|
-
value: "" + (linkState === null || linkState === void 0 ? void 0 : linkState.
|
|
285
|
+
value: "" + (linkState === null || linkState === void 0 ? void 0 : linkState.dataSetName) + _dataCommon.separator + linkState.index,
|
|
282
286
|
onChange: handleLinkChange
|
|
283
287
|
}, linkPage === null || linkPage === void 0 ? void 0 : linkPage.map(function (field, index) {
|
|
284
288
|
return (field === null || field === void 0 ? void 0 : field.dataSetName) === linkState.dataSetName ? /*#__PURE__*/React.createElement(_radio["default"].Button, {
|
|
@@ -28,6 +28,7 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
28
28
|
dimJson = props.dimJson,
|
|
29
29
|
indexJson = props.indexJson,
|
|
30
30
|
expressions = props.expressions,
|
|
31
|
+
linkPageTitle = props.linkPageTitle,
|
|
31
32
|
linkPage = props.linkPage,
|
|
32
33
|
queryBind = props.queryBind,
|
|
33
34
|
chartRef = props.chartRef,
|
|
@@ -475,6 +476,7 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
475
476
|
chartRef: linkChartRef,
|
|
476
477
|
dimJson: dimJson,
|
|
477
478
|
linkPage: linkPage,
|
|
479
|
+
linkPageTitle: linkPageTitle,
|
|
478
480
|
onConfirm: onConfirm,
|
|
479
481
|
onBack: function onBack() {
|
|
480
482
|
setIsLink(false);
|
package/lib/components/z-templates-data-common/components/table-renderer/table-renderer.helper.js
CHANGED
|
@@ -182,7 +182,7 @@ exports.handleValueFormat = handleValueFormat;
|
|
|
182
182
|
var handleColumns = function handleColumns(option, expressions, onLink) {
|
|
183
183
|
var dimTarget = [].concat(option.dimension, option.index);
|
|
184
184
|
return dimTarget.map(function (title) {
|
|
185
|
-
var _find3, _find4, _title$toString;
|
|
185
|
+
var _find3, _find3$link, _find4, _find5, _title$toString;
|
|
186
186
|
var find;
|
|
187
187
|
var dataIndex;
|
|
188
188
|
var condition;
|
|
@@ -207,17 +207,18 @@ var handleColumns = function handleColumns(option, expressions, onLink) {
|
|
|
207
207
|
// condition = expressions?.filter((item) => item?.index?.includes(find?.name));
|
|
208
208
|
// }
|
|
209
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];
|
|
210
212
|
return {
|
|
211
213
|
title: title,
|
|
212
214
|
dataIndex: dataIndex,
|
|
213
215
|
ellipsis: true,
|
|
214
|
-
sorter: (
|
|
215
|
-
width: ((
|
|
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),
|
|
216
218
|
render: function render(value, record) {
|
|
217
219
|
return handleValueFormat(value, record, find, condition, function () {
|
|
218
|
-
var _find5;
|
|
219
220
|
return onLink({
|
|
220
|
-
dataSetName:
|
|
221
|
+
dataSetName: dataSetName,
|
|
221
222
|
record: record
|
|
222
223
|
});
|
|
223
224
|
});
|
|
@@ -35,6 +35,8 @@ export interface TypeTargetProps {
|
|
|
35
35
|
}
|
|
36
36
|
/** 表格相关配置 */
|
|
37
37
|
export interface TypeChartSettingProps {
|
|
38
|
+
/** 二级页标题 */
|
|
39
|
+
chartTitle?: string;
|
|
38
40
|
/** 标题 */
|
|
39
41
|
title?: string;
|
|
40
42
|
/** 维度配置 */
|
|
@@ -67,6 +69,7 @@ export interface TypeChartSettingProps {
|
|
|
67
69
|
};
|
|
68
70
|
/** 条件格式设置 */
|
|
69
71
|
expressions?: any[] | [];
|
|
72
|
+
linkPageTitle?: string;
|
|
70
73
|
/** 下钻二级页设置 */
|
|
71
74
|
linkPage?: TypeChartSettingProps[];
|
|
72
75
|
/** 数据源参数"键"" 和 查询参数"值" 和 上一级维度(dim)"值" 关系绑定 */
|
|
@@ -172,16 +172,16 @@ 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:
|
|
175
|
+
var token = 'scm:tenant:token:2:104:177217352666D386AA01E5AF6293727D';
|
|
176
176
|
|
|
177
177
|
/** 获取维度指标 */
|
|
178
178
|
var getDimTarget = /*#__PURE__*/function () {
|
|
179
179
|
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(rcProContext, params) {
|
|
180
|
-
var _ref2, materialsRequest, env,
|
|
180
|
+
var _ref2, materialsRequest, env, res, _res;
|
|
181
181
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
182
182
|
while (1) switch (_context.prev = _context.next) {
|
|
183
183
|
case 0:
|
|
184
|
-
_ref2 = rcProContext || {}, materialsRequest = _ref2.materialsRequest, env = _ref2.env
|
|
184
|
+
_ref2 = rcProContext || {}, materialsRequest = _ref2.materialsRequest, env = _ref2.env; // 供应链里由子应用透传
|
|
185
185
|
if (!materialsRequest) {
|
|
186
186
|
_context.next = 6;
|
|
187
187
|
break;
|
|
@@ -6,14 +6,16 @@ exports.processOperationRecordsProps = void 0;
|
|
|
6
6
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
7
7
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
8
8
|
var _lib = require("../../../lib");
|
|
9
|
-
var _excluded = ["timelineProps", "columns", "transform", "
|
|
9
|
+
var _excluded = ["timelineProps", "request", "columns", "transform", "timeItemProps", "valueEnum"]; // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
10
10
|
// preview 处理
|
|
11
11
|
var processOperationProps = function processOperationProps(props) {
|
|
12
12
|
var processObjectValue = function processObjectValue(obj) {
|
|
13
13
|
var timelineProps = obj.timelineProps,
|
|
14
|
+
request = obj.request,
|
|
14
15
|
columns = obj.columns,
|
|
15
16
|
transform = obj.transform,
|
|
16
|
-
|
|
17
|
+
timeItemProps = obj.timeItemProps,
|
|
18
|
+
valueEnum = obj.valueEnum,
|
|
17
19
|
rest = (0, _objectWithoutPropertiesLoose2["default"])(obj, _excluded);
|
|
18
20
|
return (0, _extends2["default"])({}, columns !== null && columns !== void 0 && columns.length ? {
|
|
19
21
|
columns: columns === null || columns === void 0 ? void 0 : columns.map(function (v) {
|
|
@@ -21,7 +23,9 @@ var processOperationProps = function processOperationProps(props) {
|
|
|
21
23
|
})
|
|
22
24
|
} : [], transform ? {
|
|
23
25
|
transform: transform
|
|
24
|
-
} : {}, timelineProps ? (0, _lib.processJsonOrFunctionProps)(timelineProps) : {},
|
|
26
|
+
} : {}, timelineProps ? (0, _lib.processJsonOrFunctionProps)(timelineProps) : {}, timeItemProps ? (0, _lib.processJsonOrFunctionProps)(timeItemProps) : {}, valueEnum ? {
|
|
27
|
+
valueEnum: valueEnum
|
|
28
|
+
} : {}, rest);
|
|
25
29
|
};
|
|
26
30
|
if (Array.isArray(props)) {
|
|
27
31
|
return props === null || props === void 0 ? void 0 : props.map(function (e) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ztocwst/rc-pro-materials",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.32",
|
|
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.1.
|
|
89
|
+
"materialSchema": "https://npm.onmicrosoft.cn/@ztocwst/rc-pro-materials@0.1.32/build/lowcode/assets-prod.json"
|
|
90
90
|
},
|
|
91
|
-
"homepage": "https://unpkg.com/@ztocwst/rc-pro-materials@0.1.
|
|
91
|
+
"homepage": "https://unpkg.com/@ztocwst/rc-pro-materials@0.1.32/build/index.html",
|
|
92
92
|
"publishConfig": {
|
|
93
93
|
"registry": "https://registry.npmjs.org/",
|
|
94
94
|
"access": "public"
|