@ztocwst/rc-pro-materials 0.1.25 → 0.1.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 +8 -8
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/designer.html +4 -4
- package/build/lowcode/index.html +4 -4
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +5 -5
- package/build/lowcode/render/default/view.css +1 -2
- package/build/lowcode/render/default/view.js +8 -8
- package/build/lowcode/view.css +1 -2
- package/build/lowcode/view.js +9 -9
- package/dist/SCM_Comps.css +1 -1
- package/dist/SCM_Comps.js +9 -9
- package/dist/SCM_Comps.js.map +1 -1
- package/es/components/z-templates-data-common/components/chart-renderer/index.d.ts +14 -0
- package/es/components/z-templates-data-common/components/chart-renderer/index.js +108 -0
- package/es/components/z-templates-data-common/components/custom-renderer/index.d.ts +13 -0
- package/es/components/z-templates-data-common/components/custom-renderer/index.js +161 -0
- package/es/components/z-templates-data-common/components/dim-target/dim-target.helper.d.ts +39 -0
- package/es/components/z-templates-data-common/components/dim-target/dim-target.helper.js +1 -0
- package/es/components/z-templates-data-common/components/dim-target/index.d.ts +16 -0
- package/es/components/z-templates-data-common/components/dim-target/index.js +430 -0
- package/es/components/z-templates-data-common/components/dim-target/index.less +49 -0
- package/es/components/z-templates-data-common/components/dim-target/useUpdateEffect.d.ts +8 -0
- package/es/components/z-templates-data-common/components/dim-target/useUpdateEffect.js +26 -0
- package/es/components/z-templates-data-common/components/link-renderer/index.d.ts +16 -0
- package/es/components/z-templates-data-common/components/link-renderer/index.js +316 -0
- package/es/components/z-templates-data-common/components/link-renderer/index.less +31 -0
- package/es/components/z-templates-data-common/components/table-renderer/index.d.ts +6 -0
- package/es/components/z-templates-data-common/components/table-renderer/index.js +479 -0
- package/es/components/z-templates-data-common/components/table-renderer/table-renderer.helper.d.ts +64 -0
- package/es/components/z-templates-data-common/components/table-renderer/table-renderer.helper.js +219 -0
- package/es/components/z-templates-data-common/data-common.d.ts +102 -0
- package/es/components/z-templates-data-common/data-common.helper.d.ts +61 -0
- package/es/components/z-templates-data-common/data-common.helper.js +330 -0
- package/es/components/z-templates-data-common/data-common.js +141 -0
- package/es/components/z-templates-data-common/index.d.ts +3 -0
- package/es/components/z-templates-data-common/index.js +2 -0
- package/es/index.d.ts +2 -0
- package/es/index.js +1 -0
- package/es/style.js +4 -0
- package/lib/components/z-templates-data-common/components/chart-renderer/index.d.ts +14 -0
- package/lib/components/z-templates-data-common/components/chart-renderer/index.js +116 -0
- package/lib/components/z-templates-data-common/components/custom-renderer/index.d.ts +13 -0
- package/lib/components/z-templates-data-common/components/custom-renderer/index.js +167 -0
- package/lib/components/z-templates-data-common/components/dim-target/dim-target.helper.d.ts +39 -0
- package/lib/components/z-templates-data-common/components/dim-target/dim-target.helper.js +3 -0
- package/lib/components/z-templates-data-common/components/dim-target/index.d.ts +16 -0
- package/lib/components/z-templates-data-common/components/dim-target/index.js +438 -0
- package/lib/components/z-templates-data-common/components/dim-target/index.less +49 -0
- package/lib/components/z-templates-data-common/components/dim-target/useUpdateEffect.d.ts +8 -0
- package/lib/components/z-templates-data-common/components/dim-target/useUpdateEffect.js +30 -0
- package/lib/components/z-templates-data-common/components/link-renderer/index.d.ts +16 -0
- package/lib/components/z-templates-data-common/components/link-renderer/index.js +322 -0
- package/lib/components/z-templates-data-common/components/link-renderer/index.less +31 -0
- package/lib/components/z-templates-data-common/components/table-renderer/index.d.ts +6 -0
- package/lib/components/z-templates-data-common/components/table-renderer/index.js +485 -0
- package/lib/components/z-templates-data-common/components/table-renderer/table-renderer.helper.d.ts +64 -0
- package/lib/components/z-templates-data-common/components/table-renderer/table-renderer.helper.js +228 -0
- package/lib/components/z-templates-data-common/data-common.d.ts +102 -0
- package/lib/components/z-templates-data-common/data-common.helper.d.ts +61 -0
- package/lib/components/z-templates-data-common/data-common.helper.js +349 -0
- package/lib/components/z-templates-data-common/data-common.js +147 -0
- package/lib/components/z-templates-data-common/index.d.ts +3 -0
- package/lib/components/z-templates-data-common/index.js +8 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +4 -2
- package/lib/style.js +4 -0
- package/package.json +4 -3
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { TypeZTemplatesDataCommonProps } from '../../data-common';
|
|
3
|
+
import type { linkParamsType } from '../link-renderer';
|
|
4
|
+
export interface ChartRendererProps {
|
|
5
|
+
chartSetting?: Pick<TypeZTemplatesDataCommonProps, 'chartSetting'>;
|
|
6
|
+
chartRenderRef?: React.Ref<{
|
|
7
|
+
onLink: (v: linkParamsType) => void;
|
|
8
|
+
queryChart: (v: Record<string, any>, d: string | undefined) => void;
|
|
9
|
+
}>;
|
|
10
|
+
/** 确认 */
|
|
11
|
+
onConfirm?: () => void;
|
|
12
|
+
}
|
|
13
|
+
declare const ChartRenderer: ({ chartRenderRef, chartSetting, onConfirm }: ChartRendererProps) => JSX.Element | Pick<TypeZTemplatesDataCommonProps, "chartSetting">;
|
|
14
|
+
export default ChartRenderer;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import _Tabs from "antd/es/tabs";
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
import React, { useRef, useState, useEffect, useImperativeHandle } from 'react';
|
|
4
|
+
import { separator } from "../../data-common.helper";
|
|
5
|
+
import TableRenderer from "../table-renderer";
|
|
6
|
+
import CustomRenderer from "../custom-renderer";
|
|
7
|
+
var ChartRenderer = function ChartRenderer(_ref) {
|
|
8
|
+
var chartRenderRef = _ref.chartRenderRef,
|
|
9
|
+
chartSetting = _ref.chartSetting,
|
|
10
|
+
onConfirm = _ref.onConfirm;
|
|
11
|
+
var isObject = Object.prototype.toString.call(chartSetting) === '[object Object]';
|
|
12
|
+
var isArray = Array.isArray(chartSetting);
|
|
13
|
+
var _chartRef = useRef({});
|
|
14
|
+
var _useState = useState(),
|
|
15
|
+
activeKey = _useState[0],
|
|
16
|
+
setActiveKey = _useState[1];
|
|
17
|
+
var onLink = function onLink(values) {
|
|
18
|
+
if (isObject && ! /*#__PURE__*/React.isValidElement(chartSetting) || isArray && !chartSetting.every(function (e) {
|
|
19
|
+
return /*#__PURE__*/React.isValidElement(e);
|
|
20
|
+
})) {
|
|
21
|
+
var _chartRef$current$act, _chartRef$current$act2;
|
|
22
|
+
(_chartRef$current$act = _chartRef.current[activeKey]) === null || _chartRef$current$act === void 0 ? void 0 : (_chartRef$current$act2 = _chartRef$current$act.onLink) === null || _chartRef$current$act2 === void 0 ? void 0 : _chartRef$current$act2.call(_chartRef$current$act, values);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
var queryChart = function queryChart(values) {
|
|
26
|
+
if (isObject && ! /*#__PURE__*/React.isValidElement(chartSetting) || isArray && !chartSetting.every(function (e) {
|
|
27
|
+
return /*#__PURE__*/React.isValidElement(e);
|
|
28
|
+
})) {
|
|
29
|
+
var _chartRef$current$act3, _chartRef$current$act4;
|
|
30
|
+
(_chartRef$current$act3 = _chartRef.current[activeKey]) === null || _chartRef$current$act3 === void 0 ? void 0 : (_chartRef$current$act4 = _chartRef$current$act3.queryChart) === null || _chartRef$current$act4 === void 0 ? void 0 : _chartRef$current$act4.call(_chartRef$current$act3, values);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
useEffect(function () {
|
|
34
|
+
if (isObject && ! /*#__PURE__*/React.isValidElement(chartSetting)) {
|
|
35
|
+
setActiveKey(chartSetting === null || chartSetting === void 0 ? void 0 : chartSetting.dataSetName);
|
|
36
|
+
}
|
|
37
|
+
if (isArray && !chartSetting.every(function (e) {
|
|
38
|
+
return /*#__PURE__*/React.isValidElement(e);
|
|
39
|
+
})) {
|
|
40
|
+
if (chartSetting.length) {
|
|
41
|
+
var index = 0;
|
|
42
|
+
var item = chartSetting[index];
|
|
43
|
+
setActiveKey("" + (item === null || item === void 0 ? void 0 : item.dataSetName) + separator + index);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}, []);
|
|
47
|
+
var handleTabsChange = function handleTabsChange(key) {
|
|
48
|
+
return setActiveKey(key);
|
|
49
|
+
};
|
|
50
|
+
useImperativeHandle(chartRenderRef, function () {
|
|
51
|
+
return {
|
|
52
|
+
onLink: onLink,
|
|
53
|
+
queryChart: queryChart
|
|
54
|
+
};
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
// react子节点
|
|
58
|
+
if ( /*#__PURE__*/React.isValidElement(chartSetting)) {
|
|
59
|
+
return chartSetting;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// 多个react子节点
|
|
63
|
+
if (isArray && chartSetting.every(function (e) {
|
|
64
|
+
return /*#__PURE__*/React.isValidElement(e);
|
|
65
|
+
})) {
|
|
66
|
+
return chartSetting;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// 普通列表json对象
|
|
70
|
+
if (isObject) {
|
|
71
|
+
return /*#__PURE__*/React.createElement(TableRenderer, _extends({}, chartSetting, {
|
|
72
|
+
activeKey: activeKey,
|
|
73
|
+
chartRef: function chartRef(ref) {
|
|
74
|
+
_chartRef.current[chartSetting === null || chartSetting === void 0 ? void 0 : chartSetting.dataSetName] = ref;
|
|
75
|
+
},
|
|
76
|
+
onConfirm: onConfirm
|
|
77
|
+
}));
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// 数组
|
|
81
|
+
if (isArray && !chartSetting.every(function (e) {
|
|
82
|
+
return /*#__PURE__*/React.isValidElement(e);
|
|
83
|
+
})) {
|
|
84
|
+
return /*#__PURE__*/React.createElement(_Tabs, {
|
|
85
|
+
activeKey: activeKey,
|
|
86
|
+
onChange: handleTabsChange
|
|
87
|
+
}, chartSetting.map(function (e, i) {
|
|
88
|
+
return /*#__PURE__*/React.createElement(_Tabs.TabPane, {
|
|
89
|
+
tab: "" + ((e === null || e === void 0 ? void 0 : e.title) || ''),
|
|
90
|
+
key: "" + (e === null || e === void 0 ? void 0 : e.dataSetName) + separator + i.toString()
|
|
91
|
+
}, e !== null && e !== void 0 && e.custom ? /*#__PURE__*/React.createElement(CustomRenderer, _extends({}, e, {
|
|
92
|
+
activeKey: activeKey,
|
|
93
|
+
chartRef: function chartRef(ref) {
|
|
94
|
+
_chartRef.current["" + (e === null || e === void 0 ? void 0 : e.dataSetName) + separator + i] = ref;
|
|
95
|
+
},
|
|
96
|
+
onConfirm: onConfirm
|
|
97
|
+
})) : /*#__PURE__*/React.createElement(TableRenderer, _extends({}, e, {
|
|
98
|
+
activeKey: activeKey,
|
|
99
|
+
chartRef: function chartRef(ref) {
|
|
100
|
+
_chartRef.current["" + (e === null || e === void 0 ? void 0 : e.dataSetName) + separator + i] = ref;
|
|
101
|
+
},
|
|
102
|
+
onConfirm: onConfirm
|
|
103
|
+
})));
|
|
104
|
+
}));
|
|
105
|
+
}
|
|
106
|
+
return null;
|
|
107
|
+
};
|
|
108
|
+
export default ChartRenderer;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { TypeChartSettingProps } from '../../data-common';
|
|
3
|
+
import type { linkParamsType } from '../link-renderer';
|
|
4
|
+
declare const CustomRenderer: (props: TypeChartSettingProps & {
|
|
5
|
+
activeKey: string;
|
|
6
|
+
custom: boolean;
|
|
7
|
+
child: (p: any) => React.ReactNode;
|
|
8
|
+
chartRef?: import("react").Ref<{
|
|
9
|
+
onLink: (v: linkParamsType) => void;
|
|
10
|
+
queryChart: (v: Record<string, any>, d: string | undefined) => void;
|
|
11
|
+
}>;
|
|
12
|
+
}) => import("react").JSX.Element;
|
|
13
|
+
export default CustomRenderer;
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
|
+
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."); }
|
|
5
|
+
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); }
|
|
6
|
+
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; }
|
|
7
|
+
import { useState, useEffect, useRef, useContext, useImperativeHandle } from 'react';
|
|
8
|
+
import { RcConfigContext } from '@ztocwst/rc-pro';
|
|
9
|
+
import { separator, timeUnit, handleQueryParams, getReportData } from "../../data-common.helper";
|
|
10
|
+
import LinkRenderer from "../link-renderer";
|
|
11
|
+
var CustomRenderer = function CustomRenderer(props) {
|
|
12
|
+
var _props$child;
|
|
13
|
+
var _ref = props || {},
|
|
14
|
+
activeKey = _ref.activeKey,
|
|
15
|
+
autoLoad = _ref.autoLoad,
|
|
16
|
+
refreshRate = _ref.refreshRate,
|
|
17
|
+
dataSetName = _ref.dataSetName,
|
|
18
|
+
dimJson = _ref.dimJson,
|
|
19
|
+
indexJson = _ref.indexJson,
|
|
20
|
+
linkPage = _ref.linkPage,
|
|
21
|
+
onConfirm = _ref.onConfirm,
|
|
22
|
+
formatter = _ref.formatter;
|
|
23
|
+
var rcProContext = useContext(RcConfigContext);
|
|
24
|
+
var _useState = useState(),
|
|
25
|
+
result = _useState[0],
|
|
26
|
+
setResult = _useState[1];
|
|
27
|
+
var _useState2 = useState(false),
|
|
28
|
+
isLink = _useState2[0],
|
|
29
|
+
setIsLink = _useState2[1];
|
|
30
|
+
var linkChartRef = useRef();
|
|
31
|
+
var timer = null;
|
|
32
|
+
var onLink = function onLink(values) {
|
|
33
|
+
var _linkChartRef$current, _linkChartRef$current2;
|
|
34
|
+
setIsLink(true);
|
|
35
|
+
(_linkChartRef$current = linkChartRef.current) === null || _linkChartRef$current === void 0 ? void 0 : (_linkChartRef$current2 = _linkChartRef$current.initial) === null || _linkChartRef$current2 === void 0 ? void 0 : _linkChartRef$current2.call(_linkChartRef$current, _extends({}, values));
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
// 获取数据源
|
|
39
|
+
var getDataSource = /*#__PURE__*/function () {
|
|
40
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(query) {
|
|
41
|
+
var _indexJson$data, target, _iterator, _step, item, queryParams, data, res;
|
|
42
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
43
|
+
while (1) switch (_context.prev = _context.next) {
|
|
44
|
+
case 0:
|
|
45
|
+
if (query === void 0) {
|
|
46
|
+
query = {};
|
|
47
|
+
}
|
|
48
|
+
_context.prev = 1;
|
|
49
|
+
target = [];
|
|
50
|
+
if (indexJson !== null && indexJson !== void 0 && (_indexJson$data = indexJson.data) !== null && _indexJson$data !== void 0 && _indexJson$data.length) {
|
|
51
|
+
for (_iterator = _createForOfIteratorHelperLoose(indexJson.data); !(_step = _iterator()).done;) {
|
|
52
|
+
item = _step.value;
|
|
53
|
+
target.push({
|
|
54
|
+
description: item.name
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
queryParams = handleQueryParams(query);
|
|
59
|
+
data = {
|
|
60
|
+
target: target,
|
|
61
|
+
queryParams: queryParams,
|
|
62
|
+
dataSetName: dataSetName
|
|
63
|
+
};
|
|
64
|
+
_context.next = 8;
|
|
65
|
+
return getReportData(rcProContext, formatter ? formatter === null || formatter === void 0 ? void 0 : formatter(data) : data);
|
|
66
|
+
case 8:
|
|
67
|
+
res = _context.sent;
|
|
68
|
+
if (res !== null && res !== void 0 && res.success) {
|
|
69
|
+
setResult(res === null || res === void 0 ? void 0 : res.result);
|
|
70
|
+
}
|
|
71
|
+
_context.next = 16;
|
|
72
|
+
break;
|
|
73
|
+
case 12:
|
|
74
|
+
_context.prev = 12;
|
|
75
|
+
_context.t0 = _context["catch"](1);
|
|
76
|
+
setResult(null);
|
|
77
|
+
console.error(_context.t0);
|
|
78
|
+
case 16:
|
|
79
|
+
case "end":
|
|
80
|
+
return _context.stop();
|
|
81
|
+
}
|
|
82
|
+
}, _callee, null, [[1, 12]]);
|
|
83
|
+
}));
|
|
84
|
+
return function getDataSource(_x) {
|
|
85
|
+
return _ref2.apply(this, arguments);
|
|
86
|
+
};
|
|
87
|
+
}();
|
|
88
|
+
var queryChart = /*#__PURE__*/function () {
|
|
89
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(value) {
|
|
90
|
+
var queryParams, _linkChartRef$current3;
|
|
91
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
92
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
93
|
+
case 0:
|
|
94
|
+
queryParams = value[dataSetName] || value;
|
|
95
|
+
if (isLink) {
|
|
96
|
+
(_linkChartRef$current3 = linkChartRef.current) === null || _linkChartRef$current3 === void 0 ? void 0 : _linkChartRef$current3.queryChart(queryParams);
|
|
97
|
+
} else {
|
|
98
|
+
getDataSource(queryParams);
|
|
99
|
+
}
|
|
100
|
+
case 2:
|
|
101
|
+
case "end":
|
|
102
|
+
return _context2.stop();
|
|
103
|
+
}
|
|
104
|
+
}, _callee2);
|
|
105
|
+
}));
|
|
106
|
+
return function queryChart(_x2) {
|
|
107
|
+
return _ref3.apply(this, arguments);
|
|
108
|
+
};
|
|
109
|
+
}();
|
|
110
|
+
var handleClearInterval = function handleClearInterval() {
|
|
111
|
+
if (timer) {
|
|
112
|
+
clearInterval(timer);
|
|
113
|
+
timer = null;
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
useEffect(function () {
|
|
117
|
+
var _ref4 = (activeKey === null || activeKey === void 0 ? void 0 : activeKey.split(separator)) || [],
|
|
118
|
+
currentKey = _ref4[0];
|
|
119
|
+
if (currentKey === dataSetName) {
|
|
120
|
+
if (autoLoad) {
|
|
121
|
+
if (refreshRate) {
|
|
122
|
+
handleClearInterval();
|
|
123
|
+
timer = window.setInterval(function () {
|
|
124
|
+
return onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm();
|
|
125
|
+
}, refreshRate * timeUnit);
|
|
126
|
+
} else {
|
|
127
|
+
onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm();
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
} else {
|
|
131
|
+
handleClearInterval();
|
|
132
|
+
}
|
|
133
|
+
return function () {
|
|
134
|
+
handleClearInterval();
|
|
135
|
+
};
|
|
136
|
+
}, [activeKey, autoLoad]);
|
|
137
|
+
useImperativeHandle(props.chartRef, function () {
|
|
138
|
+
return {
|
|
139
|
+
onLink: onLink,
|
|
140
|
+
queryChart: queryChart
|
|
141
|
+
};
|
|
142
|
+
});
|
|
143
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
144
|
+
style: {
|
|
145
|
+
display: !isLink ? 'block' : 'none'
|
|
146
|
+
}
|
|
147
|
+
}, (_props$child = props.child) === null || _props$child === void 0 ? void 0 : _props$child.call(props, result)), /*#__PURE__*/React.createElement("div", {
|
|
148
|
+
style: {
|
|
149
|
+
display: isLink ? 'block' : 'none'
|
|
150
|
+
}
|
|
151
|
+
}, /*#__PURE__*/React.createElement(LinkRenderer, {
|
|
152
|
+
chartRef: linkChartRef,
|
|
153
|
+
dimJson: dimJson,
|
|
154
|
+
linkPage: linkPage,
|
|
155
|
+
onConfirm: onConfirm,
|
|
156
|
+
onBack: function onBack() {
|
|
157
|
+
setIsLink(false);
|
|
158
|
+
}
|
|
159
|
+
})));
|
|
160
|
+
};
|
|
161
|
+
export default CustomRenderer;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { CheckboxValueType } from 'antd/es/checkbox/Group';
|
|
2
|
+
import { TypeTargetProps } from '../../data-common';
|
|
3
|
+
/**
|
|
4
|
+
* 维度状态
|
|
5
|
+
*/
|
|
6
|
+
export interface DimsType {
|
|
7
|
+
title: string;
|
|
8
|
+
all: boolean;
|
|
9
|
+
indeterminate: boolean;
|
|
10
|
+
dimension: CheckboxValueType[];
|
|
11
|
+
dimensionSource: Array<Omit<TypeTargetProps, 'amounted' | 'enName' | 'isFilter'>>;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* 指标状态
|
|
15
|
+
*/
|
|
16
|
+
export interface TargetsType {
|
|
17
|
+
title: string;
|
|
18
|
+
all: boolean;
|
|
19
|
+
indeterminate: boolean;
|
|
20
|
+
index: CheckboxValueType[];
|
|
21
|
+
indexSource: TypeTargetProps[];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* 维度指标组件初始
|
|
25
|
+
*/
|
|
26
|
+
export interface DimTargetInitialValueType {
|
|
27
|
+
dims: DimsType;
|
|
28
|
+
targets: TargetsType;
|
|
29
|
+
rememberCheck: boolean;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* 维度指标 Change value
|
|
33
|
+
*/
|
|
34
|
+
export interface DimTargetChangeOptionType {
|
|
35
|
+
dimension: CheckboxValueType[];
|
|
36
|
+
dimensionSource: Array<Omit<TypeTargetProps, 'amounted' | 'enName' | 'isFilter'>>;
|
|
37
|
+
index: CheckboxValueType[];
|
|
38
|
+
indexSource: TypeTargetProps[];
|
|
39
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ProButtonItemsProps } from '@ztocwst/rc-pro';
|
|
3
|
+
import type { DimTargetChangeOptionType, DimTargetInitialValueType } from './dim-target.helper';
|
|
4
|
+
import './index.less';
|
|
5
|
+
export interface DimTargetProps {
|
|
6
|
+
value?: DimTargetInitialValueType;
|
|
7
|
+
dataSetName?: string;
|
|
8
|
+
remember?: boolean;
|
|
9
|
+
buttons?: ProButtonItemsProps[];
|
|
10
|
+
dimTargetRef?: React.Ref<{
|
|
11
|
+
getDimTargetValues: () => DimTargetChangeOptionType;
|
|
12
|
+
}>;
|
|
13
|
+
onChange?: (v: DimTargetChangeOptionType) => void;
|
|
14
|
+
}
|
|
15
|
+
declare const DimTarget: ({ value, dataSetName, remember, buttons, dimTargetRef, onChange, }: DimTargetProps) => JSX.Element;
|
|
16
|
+
export default DimTarget;
|