@ztocwst/rc-pro-materials 0.1.26 → 0.1.28
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 +2 -2
- package/build/lowcode/index.html +2 -2
- 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 -1
- package/build/lowcode/render/default/view.js +8 -8
- package/build/lowcode/view.css +1 -1
- 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 +332 -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 +8 -0
- package/es/utils/rcProRequest.d.ts +2 -0
- package/es/utils/rcProRequest.js +30 -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 +350 -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/lib/utils/rcProRequest.d.ts +2 -0
- package/lib/utils/rcProRequest.js +36 -0
- package/package.json +3 -3
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
exports.__esModule = true;
|
|
5
|
+
exports["default"] = void 0;
|
|
6
|
+
var _tabs = _interopRequireDefault(require("antd/lib/tabs"));
|
|
7
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _dataCommon = require("../../data-common.helper");
|
|
10
|
+
var _tableRenderer = _interopRequireDefault(require("../table-renderer"));
|
|
11
|
+
var _customRenderer = _interopRequireDefault(require("../custom-renderer"));
|
|
12
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
14
|
+
var ChartRenderer = function ChartRenderer(_ref) {
|
|
15
|
+
var chartRenderRef = _ref.chartRenderRef,
|
|
16
|
+
chartSetting = _ref.chartSetting,
|
|
17
|
+
onConfirm = _ref.onConfirm;
|
|
18
|
+
var isObject = Object.prototype.toString.call(chartSetting) === '[object Object]';
|
|
19
|
+
var isArray = Array.isArray(chartSetting);
|
|
20
|
+
var _chartRef = (0, _react.useRef)({});
|
|
21
|
+
var _useState = (0, _react.useState)(),
|
|
22
|
+
activeKey = _useState[0],
|
|
23
|
+
setActiveKey = _useState[1];
|
|
24
|
+
var onLink = function onLink(values) {
|
|
25
|
+
if (isObject && ! /*#__PURE__*/_react["default"].isValidElement(chartSetting) || isArray && !chartSetting.every(function (e) {
|
|
26
|
+
return /*#__PURE__*/_react["default"].isValidElement(e);
|
|
27
|
+
})) {
|
|
28
|
+
var _chartRef$current$act, _chartRef$current$act2;
|
|
29
|
+
(_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);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
var queryChart = function queryChart(values) {
|
|
33
|
+
if (isObject && ! /*#__PURE__*/_react["default"].isValidElement(chartSetting) || isArray && !chartSetting.every(function (e) {
|
|
34
|
+
return /*#__PURE__*/_react["default"].isValidElement(e);
|
|
35
|
+
})) {
|
|
36
|
+
var _chartRef$current$act3, _chartRef$current$act4;
|
|
37
|
+
(_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);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
(0, _react.useEffect)(function () {
|
|
41
|
+
if (isObject && ! /*#__PURE__*/_react["default"].isValidElement(chartSetting)) {
|
|
42
|
+
setActiveKey(chartSetting === null || chartSetting === void 0 ? void 0 : chartSetting.dataSetName);
|
|
43
|
+
}
|
|
44
|
+
if (isArray && !chartSetting.every(function (e) {
|
|
45
|
+
return /*#__PURE__*/_react["default"].isValidElement(e);
|
|
46
|
+
})) {
|
|
47
|
+
if (chartSetting.length) {
|
|
48
|
+
var index = 0;
|
|
49
|
+
var item = chartSetting[index];
|
|
50
|
+
setActiveKey("" + (item === null || item === void 0 ? void 0 : item.dataSetName) + _dataCommon.separator + index);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}, []);
|
|
54
|
+
var handleTabsChange = function handleTabsChange(key) {
|
|
55
|
+
return setActiveKey(key);
|
|
56
|
+
};
|
|
57
|
+
(0, _react.useImperativeHandle)(chartRenderRef, function () {
|
|
58
|
+
return {
|
|
59
|
+
onLink: onLink,
|
|
60
|
+
queryChart: queryChart
|
|
61
|
+
};
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
// react子节点
|
|
65
|
+
if ( /*#__PURE__*/_react["default"].isValidElement(chartSetting)) {
|
|
66
|
+
return chartSetting;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// 多个react子节点
|
|
70
|
+
if (isArray && chartSetting.every(function (e) {
|
|
71
|
+
return /*#__PURE__*/_react["default"].isValidElement(e);
|
|
72
|
+
})) {
|
|
73
|
+
return chartSetting;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// 普通列表json对象
|
|
77
|
+
if (isObject) {
|
|
78
|
+
return /*#__PURE__*/_react["default"].createElement(_tableRenderer["default"], (0, _extends2["default"])({}, chartSetting, {
|
|
79
|
+
activeKey: activeKey,
|
|
80
|
+
chartRef: function chartRef(ref) {
|
|
81
|
+
_chartRef.current[chartSetting === null || chartSetting === void 0 ? void 0 : chartSetting.dataSetName] = ref;
|
|
82
|
+
},
|
|
83
|
+
onConfirm: onConfirm
|
|
84
|
+
}));
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// 数组
|
|
88
|
+
if (isArray && !chartSetting.every(function (e) {
|
|
89
|
+
return /*#__PURE__*/_react["default"].isValidElement(e);
|
|
90
|
+
})) {
|
|
91
|
+
return /*#__PURE__*/_react["default"].createElement(_tabs["default"], {
|
|
92
|
+
activeKey: activeKey,
|
|
93
|
+
onChange: handleTabsChange
|
|
94
|
+
}, chartSetting.map(function (e, i) {
|
|
95
|
+
return /*#__PURE__*/_react["default"].createElement(_tabs["default"].TabPane, {
|
|
96
|
+
tab: "" + ((e === null || e === void 0 ? void 0 : e.title) || ''),
|
|
97
|
+
key: "" + (e === null || e === void 0 ? void 0 : e.dataSetName) + _dataCommon.separator + i.toString()
|
|
98
|
+
}, e !== null && e !== void 0 && e.custom ? /*#__PURE__*/_react["default"].createElement(_customRenderer["default"], (0, _extends2["default"])({}, e, {
|
|
99
|
+
activeKey: activeKey,
|
|
100
|
+
chartRef: function chartRef(ref) {
|
|
101
|
+
_chartRef.current["" + (e === null || e === void 0 ? void 0 : e.dataSetName) + _dataCommon.separator + i] = ref;
|
|
102
|
+
},
|
|
103
|
+
onConfirm: onConfirm
|
|
104
|
+
})) : /*#__PURE__*/_react["default"].createElement(_tableRenderer["default"], (0, _extends2["default"])({}, e, {
|
|
105
|
+
activeKey: activeKey,
|
|
106
|
+
chartRef: function chartRef(ref) {
|
|
107
|
+
_chartRef.current["" + (e === null || e === void 0 ? void 0 : e.dataSetName) + _dataCommon.separator + i] = ref;
|
|
108
|
+
},
|
|
109
|
+
onConfirm: onConfirm
|
|
110
|
+
})));
|
|
111
|
+
}));
|
|
112
|
+
}
|
|
113
|
+
return null;
|
|
114
|
+
};
|
|
115
|
+
var _default = ChartRenderer;
|
|
116
|
+
exports["default"] = _default;
|
|
@@ -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,167 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
exports.__esModule = true;
|
|
5
|
+
exports["default"] = void 0;
|
|
6
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
7
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _react = require("react");
|
|
10
|
+
var _rcPro = require("@ztocwst/rc-pro");
|
|
11
|
+
var _dataCommon = require("../../data-common.helper");
|
|
12
|
+
var _linkRenderer = _interopRequireDefault(require("../link-renderer"));
|
|
13
|
+
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."); }
|
|
14
|
+
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); }
|
|
15
|
+
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; }
|
|
16
|
+
var CustomRenderer = function CustomRenderer(props) {
|
|
17
|
+
var _props$child;
|
|
18
|
+
var _ref = props || {},
|
|
19
|
+
activeKey = _ref.activeKey,
|
|
20
|
+
autoLoad = _ref.autoLoad,
|
|
21
|
+
refreshRate = _ref.refreshRate,
|
|
22
|
+
dataSetName = _ref.dataSetName,
|
|
23
|
+
dimJson = _ref.dimJson,
|
|
24
|
+
indexJson = _ref.indexJson,
|
|
25
|
+
linkPage = _ref.linkPage,
|
|
26
|
+
onConfirm = _ref.onConfirm,
|
|
27
|
+
formatter = _ref.formatter;
|
|
28
|
+
var rcProContext = (0, _react.useContext)(_rcPro.RcConfigContext);
|
|
29
|
+
var _useState = (0, _react.useState)(),
|
|
30
|
+
result = _useState[0],
|
|
31
|
+
setResult = _useState[1];
|
|
32
|
+
var _useState2 = (0, _react.useState)(false),
|
|
33
|
+
isLink = _useState2[0],
|
|
34
|
+
setIsLink = _useState2[1];
|
|
35
|
+
var linkChartRef = (0, _react.useRef)();
|
|
36
|
+
var timer = null;
|
|
37
|
+
var onLink = function onLink(values) {
|
|
38
|
+
var _linkChartRef$current, _linkChartRef$current2;
|
|
39
|
+
setIsLink(true);
|
|
40
|
+
(_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, (0, _extends2["default"])({}, values));
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
// 获取数据源
|
|
44
|
+
var getDataSource = /*#__PURE__*/function () {
|
|
45
|
+
var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(query) {
|
|
46
|
+
var _indexJson$data, target, _iterator, _step, item, queryParams, data, res;
|
|
47
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
48
|
+
while (1) switch (_context.prev = _context.next) {
|
|
49
|
+
case 0:
|
|
50
|
+
if (query === void 0) {
|
|
51
|
+
query = {};
|
|
52
|
+
}
|
|
53
|
+
_context.prev = 1;
|
|
54
|
+
target = [];
|
|
55
|
+
if (indexJson !== null && indexJson !== void 0 && (_indexJson$data = indexJson.data) !== null && _indexJson$data !== void 0 && _indexJson$data.length) {
|
|
56
|
+
for (_iterator = _createForOfIteratorHelperLoose(indexJson.data); !(_step = _iterator()).done;) {
|
|
57
|
+
item = _step.value;
|
|
58
|
+
target.push({
|
|
59
|
+
description: item.name
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
queryParams = (0, _dataCommon.handleQueryParams)(query);
|
|
64
|
+
data = {
|
|
65
|
+
target: target,
|
|
66
|
+
queryParams: queryParams,
|
|
67
|
+
dataSetName: dataSetName
|
|
68
|
+
};
|
|
69
|
+
_context.next = 8;
|
|
70
|
+
return (0, _dataCommon.getReportData)(rcProContext, formatter ? formatter === null || formatter === void 0 ? void 0 : formatter(data) : data);
|
|
71
|
+
case 8:
|
|
72
|
+
res = _context.sent;
|
|
73
|
+
if (res !== null && res !== void 0 && res.success) {
|
|
74
|
+
setResult(res === null || res === void 0 ? void 0 : res.result);
|
|
75
|
+
}
|
|
76
|
+
_context.next = 16;
|
|
77
|
+
break;
|
|
78
|
+
case 12:
|
|
79
|
+
_context.prev = 12;
|
|
80
|
+
_context.t0 = _context["catch"](1);
|
|
81
|
+
setResult(null);
|
|
82
|
+
console.error(_context.t0);
|
|
83
|
+
case 16:
|
|
84
|
+
case "end":
|
|
85
|
+
return _context.stop();
|
|
86
|
+
}
|
|
87
|
+
}, _callee, null, [[1, 12]]);
|
|
88
|
+
}));
|
|
89
|
+
return function getDataSource(_x) {
|
|
90
|
+
return _ref2.apply(this, arguments);
|
|
91
|
+
};
|
|
92
|
+
}();
|
|
93
|
+
var queryChart = /*#__PURE__*/function () {
|
|
94
|
+
var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(value) {
|
|
95
|
+
var queryParams, _linkChartRef$current3;
|
|
96
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
97
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
98
|
+
case 0:
|
|
99
|
+
queryParams = value[dataSetName] || value;
|
|
100
|
+
if (isLink) {
|
|
101
|
+
(_linkChartRef$current3 = linkChartRef.current) === null || _linkChartRef$current3 === void 0 ? void 0 : _linkChartRef$current3.queryChart(queryParams);
|
|
102
|
+
} else {
|
|
103
|
+
getDataSource(queryParams);
|
|
104
|
+
}
|
|
105
|
+
case 2:
|
|
106
|
+
case "end":
|
|
107
|
+
return _context2.stop();
|
|
108
|
+
}
|
|
109
|
+
}, _callee2);
|
|
110
|
+
}));
|
|
111
|
+
return function queryChart(_x2) {
|
|
112
|
+
return _ref3.apply(this, arguments);
|
|
113
|
+
};
|
|
114
|
+
}();
|
|
115
|
+
var handleClearInterval = function handleClearInterval() {
|
|
116
|
+
if (timer) {
|
|
117
|
+
clearInterval(timer);
|
|
118
|
+
timer = null;
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
(0, _react.useEffect)(function () {
|
|
122
|
+
var _ref4 = (activeKey === null || activeKey === void 0 ? void 0 : activeKey.split(_dataCommon.separator)) || [],
|
|
123
|
+
currentKey = _ref4[0];
|
|
124
|
+
if (currentKey === dataSetName) {
|
|
125
|
+
if (autoLoad) {
|
|
126
|
+
if (refreshRate) {
|
|
127
|
+
handleClearInterval();
|
|
128
|
+
timer = window.setInterval(function () {
|
|
129
|
+
return onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm();
|
|
130
|
+
}, refreshRate * _dataCommon.timeUnit);
|
|
131
|
+
} else {
|
|
132
|
+
onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm();
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
} else {
|
|
136
|
+
handleClearInterval();
|
|
137
|
+
}
|
|
138
|
+
return function () {
|
|
139
|
+
handleClearInterval();
|
|
140
|
+
};
|
|
141
|
+
}, [activeKey, autoLoad]);
|
|
142
|
+
(0, _react.useImperativeHandle)(props.chartRef, function () {
|
|
143
|
+
return {
|
|
144
|
+
onLink: onLink,
|
|
145
|
+
queryChart: queryChart
|
|
146
|
+
};
|
|
147
|
+
});
|
|
148
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
149
|
+
style: {
|
|
150
|
+
display: !isLink ? 'block' : 'none'
|
|
151
|
+
}
|
|
152
|
+
}, (_props$child = props.child) === null || _props$child === void 0 ? void 0 : _props$child.call(props, result)), /*#__PURE__*/React.createElement("div", {
|
|
153
|
+
style: {
|
|
154
|
+
display: isLink ? 'block' : 'none'
|
|
155
|
+
}
|
|
156
|
+
}, /*#__PURE__*/React.createElement(_linkRenderer["default"], {
|
|
157
|
+
chartRef: linkChartRef,
|
|
158
|
+
dimJson: dimJson,
|
|
159
|
+
linkPage: linkPage,
|
|
160
|
+
onConfirm: onConfirm,
|
|
161
|
+
onBack: function onBack() {
|
|
162
|
+
setIsLink(false);
|
|
163
|
+
}
|
|
164
|
+
})));
|
|
165
|
+
};
|
|
166
|
+
var _default = CustomRenderer;
|
|
167
|
+
exports["default"] = _default;
|
|
@@ -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,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;
|