@ztocwst/rc-pro-materials 0.2.1 → 0.2.3-4.1
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/README.md +17 -17
- package/build/index.js +8 -8
- 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.css +1 -1
- package/build/lowcode/preview.js +4 -5
- package/build/lowcode/render/default/view.css +1 -2
- package/build/lowcode/render/default/view.js +9 -58
- package/build/lowcode/view.css +1 -2
- package/build/lowcode/view.js +10 -59
- package/dist/SCM_Comps.css +2 -2
- package/dist/SCM_Comps.js +22 -53
- package/dist/SCM_Comps.js.map +1 -1
- package/es/components/z-Ellipsis/ellipsis.d.ts +4 -4
- package/es/components/z-Ellipsis/index.d.ts +3 -3
- package/es/components/z-agg-block/index.d.ts +3 -3
- package/es/components/z-agg-block/index.less +134 -134
- package/es/components/z-agg-block/z-agg-block.d.ts +27 -27
- package/es/components/z-agg-block/z-agg-block.js +1 -1
- package/es/components/z-auth/auth.d.ts +9 -9
- package/es/components/z-auth/index.d.ts +3 -3
- package/es/components/z-box/box.d.ts +20 -20
- package/es/components/z-box/index.d.ts +3 -3
- package/es/components/z-box/index.less +4 -4
- package/es/components/z-button/index.d.ts +3 -3
- package/es/components/z-button/z-button.d.ts +4 -4
- package/es/components/z-config-provider/configProvider.d.ts +4 -4
- package/es/components/z-config-provider/configProvider.js +45 -4
- package/es/components/z-config-provider/index.d.ts +3 -3
- package/es/components/z-data-table/data-table.d.ts +9 -0
- package/es/components/z-data-table/data-table.js +24 -0
- package/es/components/z-data-table/index.d.ts +3 -0
- package/es/components/z-data-table/index.js +2 -0
- package/es/components/z-div/div.d.ts +6 -6
- package/es/components/z-div/index.d.ts +2 -2
- package/es/components/z-editTable/editTable.d.ts +11 -11
- package/es/components/z-editTable/editTable.js +3 -4
- package/es/components/z-editTable/index.d.ts +2 -2
- package/es/components/z-form/index.d.ts +3 -3
- package/es/components/z-form/z-form.d.ts +10 -10
- package/es/components/z-form/z-form.js +1 -1
- package/es/components/z-list/index.d.ts +3 -3
- package/es/components/z-list/list.d.ts +17 -17
- package/es/components/z-list/list.js +3 -3
- package/es/components/z-operation-records/index.d.ts +3 -3
- package/es/components/z-operation-records/operationRecords.d.ts +4 -4
- package/es/components/z-pointer-block/index.d.ts +3 -3
- package/es/components/z-pointer-block/index.less +15 -15
- package/es/components/z-pointer-block/z-pointer-block.d.ts +16 -16
- package/es/components/z-preview/index.d.ts +3 -3
- package/es/components/z-preview/preview.d.ts +4 -4
- package/es/components/z-pro-provider/index.d.ts +3 -3
- package/es/components/z-pro-provider/z-pro-provider.d.ts +6 -6
- package/es/components/z-ranking-list/index.d.ts +2 -2
- package/es/components/z-ranking-list/index.less +49 -49
- package/es/components/z-ranking-list/z-ranking-list.d.ts +14 -14
- package/es/components/z-ranking-list/z-ranking-list.js +2 -3
- package/es/components/z-simple-bar/index.d.ts +3 -3
- package/es/components/z-simple-bar/index.less +9 -9
- package/es/components/z-simple-bar/z-simple-bar.d.ts +27 -27
- package/es/components/z-singleFactory/index.d.ts +2 -2
- package/es/components/z-singleFactory/zSingerFactory.d.ts +2 -3
- package/es/components/z-slick/index.d.ts +3 -0
- package/es/components/z-slick/index.js +2 -0
- package/es/components/z-slick/slick.d.ts +47 -0
- package/es/components/z-slick/slick.js +35 -0
- package/es/components/z-statistic/index.d.ts +3 -3
- package/es/components/z-statistic/index.less +22 -22
- package/es/components/z-statistic/z-statistic.d.ts +13 -13
- package/es/components/z-table/index.d.ts +3 -3
- package/es/components/z-table/table.d.ts +8 -8
- package/es/components/z-table/table.js +1 -1
- package/es/components/z-templates-data-common/components/chart-renderer/index.d.ts +12 -14
- package/es/components/z-templates-data-common/components/chart-renderer/index.js +33 -13
- package/es/components/z-templates-data-common/data-common.d.ts +20 -105
- package/es/components/z-templates-data-common/data-common.helper.d.ts +2 -61
- package/es/components/z-templates-data-common/data-common.helper.js +2 -336
- package/es/components/z-templates-data-common/data-common.js +81 -62
- package/es/components/z-templates-data-common/index.d.ts +3 -3
- package/es/components/z-tpl/index.d.ts +3 -3
- package/es/components/z-tpl/tpl.d.ts +23 -23
- package/es/components/z-tpl/tpl.js +3 -3
- package/es/components/z-warehouse/index.d.ts +2 -2
- package/es/components/z-warehouse/zWarehouse.d.ts +2 -3
- package/es/components/z-watermark/index.d.ts +3 -0
- package/es/components/z-watermark/index.js +2 -0
- package/es/components/z-watermark/zWatermark.d.ts +3 -0
- package/es/components/z-watermark/zWatermark.js +4 -0
- package/es/index.d.ts +44 -38
- package/es/index.js +4 -0
- package/es/index.scss +1 -1
- package/es/style.js +2 -6
- package/es/utils/hoc.d.ts +6 -6
- package/es/utils/hoc.js +3 -3
- package/es/utils/index.d.ts +13 -13
- package/es/utils/index.js +5 -1
- package/es/utils/props/button.d.ts +13 -13
- package/es/utils/props/common.d.ts +7 -1
- package/es/utils/props/common.js +17 -0
- package/es/utils/props/editTable.d.ts +3 -3
- package/es/utils/props/editTable.js +21 -14
- package/es/utils/props/form.d.ts +36 -0
- package/es/utils/props/form.js +33 -14
- package/es/utils/props/listTpl.d.ts +29 -29
- package/es/utils/props/microModal.d.ts +7 -7
- package/es/utils/props/microModal.js +0 -1
- package/es/utils/props/microSwitch.d.ts +1 -1
- package/es/utils/props/microSwitch.js +4 -3
- package/es/utils/props/modalSelect.d.ts +6 -6
- package/es/utils/props/operationRecords.d.ts +2 -2
- package/es/utils/props/operationRecords.js +4 -4
- package/es/utils/props/preview.d.ts +2 -2
- package/es/utils/props/preview.js +4 -4
- package/es/utils/props/tpl.d.ts +173 -162
- package/es/utils/props/warehouseAndFactory.d.ts +1 -1
- package/es/utils/rcProRequest.d.ts +3 -3
- package/es/utils/rcProRequest.js +3 -3
- package/es/variables.scss +3 -3
- package/lib/components/z-Ellipsis/ellipsis.d.ts +4 -4
- package/lib/components/z-Ellipsis/ellipsis.js +3 -4
- package/lib/components/z-Ellipsis/index.d.ts +3 -3
- package/lib/components/z-Ellipsis/index.js +1 -2
- package/lib/components/z-agg-block/index.d.ts +3 -3
- package/lib/components/z-agg-block/index.js +1 -2
- package/lib/components/z-agg-block/index.less +134 -134
- package/lib/components/z-agg-block/z-agg-block.d.ts +27 -27
- package/lib/components/z-agg-block/z-agg-block.js +2 -3
- package/lib/components/z-auth/auth.d.ts +9 -9
- package/lib/components/z-auth/auth.js +1 -2
- package/lib/components/z-auth/index.d.ts +3 -3
- package/lib/components/z-auth/index.js +1 -2
- package/lib/components/z-box/box.d.ts +20 -20
- package/lib/components/z-box/box.js +1 -2
- package/lib/components/z-box/index.d.ts +3 -3
- package/lib/components/z-box/index.js +1 -2
- package/lib/components/z-box/index.less +4 -4
- package/lib/components/z-button/index.d.ts +3 -3
- package/lib/components/z-button/index.js +1 -2
- package/lib/components/z-button/z-button.d.ts +4 -4
- package/lib/components/z-button/z-button.js +4 -4
- package/lib/components/z-config-provider/configProvider.d.ts +4 -4
- package/lib/components/z-config-provider/configProvider.js +47 -7
- package/lib/components/z-config-provider/index.d.ts +3 -3
- package/lib/components/z-config-provider/index.js +1 -2
- package/lib/components/z-data-table/data-table.d.ts +9 -0
- package/lib/components/z-data-table/data-table.js +27 -0
- package/lib/components/z-data-table/index.d.ts +3 -0
- package/lib/components/z-data-table/index.js +7 -0
- package/lib/components/z-div/div.d.ts +6 -6
- package/lib/components/z-div/div.js +1 -2
- package/lib/components/z-div/index.d.ts +2 -2
- package/lib/components/z-div/index.js +1 -2
- package/lib/components/z-editTable/editTable.d.ts +11 -11
- package/lib/components/z-editTable/editTable.js +7 -9
- package/lib/components/z-editTable/index.d.ts +2 -2
- package/lib/components/z-editTable/index.js +1 -2
- package/lib/components/z-form/index.d.ts +3 -3
- package/lib/components/z-form/index.js +1 -2
- package/lib/components/z-form/z-form.d.ts +10 -10
- package/lib/components/z-form/z-form.js +5 -6
- package/lib/components/z-list/index.d.ts +3 -3
- package/lib/components/z-list/index.js +1 -2
- package/lib/components/z-list/list.d.ts +17 -17
- package/lib/components/z-list/list.js +7 -8
- package/lib/components/z-operation-records/index.d.ts +3 -3
- package/lib/components/z-operation-records/index.js +1 -2
- package/lib/components/z-operation-records/operationRecords.d.ts +4 -4
- package/lib/components/z-operation-records/operationRecords.js +3 -4
- package/lib/components/z-pointer-block/index.d.ts +3 -3
- package/lib/components/z-pointer-block/index.js +1 -2
- package/lib/components/z-pointer-block/index.less +15 -15
- package/lib/components/z-pointer-block/z-pointer-block.d.ts +16 -16
- package/lib/components/z-pointer-block/z-pointer-block.js +1 -2
- package/lib/components/z-preview/index.d.ts +3 -3
- package/lib/components/z-preview/index.js +1 -2
- package/lib/components/z-preview/preview.d.ts +4 -4
- package/lib/components/z-preview/preview.js +3 -4
- package/lib/components/z-pro-provider/index.d.ts +3 -3
- package/lib/components/z-pro-provider/index.js +1 -2
- package/lib/components/z-pro-provider/z-pro-provider.d.ts +6 -6
- package/lib/components/z-pro-provider/z-pro-provider.js +3 -4
- package/lib/components/z-ranking-list/index.d.ts +2 -2
- package/lib/components/z-ranking-list/index.js +1 -2
- package/lib/components/z-ranking-list/index.less +49 -49
- package/lib/components/z-ranking-list/z-ranking-list.d.ts +14 -14
- package/lib/components/z-ranking-list/z-ranking-list.js +5 -7
- package/lib/components/z-simple-bar/index.d.ts +3 -3
- package/lib/components/z-simple-bar/index.js +1 -2
- package/lib/components/z-simple-bar/index.less +9 -9
- package/lib/components/z-simple-bar/z-simple-bar.d.ts +27 -27
- package/lib/components/z-simple-bar/z-simple-bar.js +1 -2
- package/lib/components/z-singleFactory/index.d.ts +2 -2
- package/lib/components/z-singleFactory/index.js +1 -2
- package/lib/components/z-singleFactory/zSingerFactory.d.ts +2 -3
- package/lib/components/z-singleFactory/zSingerFactory.js +3 -4
- package/lib/components/z-slick/index.d.ts +3 -0
- package/lib/components/z-slick/index.js +7 -0
- package/lib/components/z-slick/slick.d.ts +47 -0
- package/lib/components/z-slick/slick.js +39 -0
- package/lib/components/z-statistic/index.d.ts +3 -3
- package/lib/components/z-statistic/index.js +1 -2
- package/lib/components/z-statistic/index.less +22 -22
- package/lib/components/z-statistic/z-statistic.d.ts +13 -13
- package/lib/components/z-statistic/z-statistic.js +1 -2
- package/lib/components/z-table/index.d.ts +3 -3
- package/lib/components/z-table/index.js +1 -2
- package/lib/components/z-table/table.d.ts +8 -8
- package/lib/components/z-table/table.js +5 -6
- package/lib/components/z-templates-data-common/components/chart-renderer/index.d.ts +12 -14
- package/lib/components/z-templates-data-common/components/chart-renderer/index.js +36 -17
- package/lib/components/z-templates-data-common/data-common.d.ts +20 -105
- package/lib/components/z-templates-data-common/data-common.helper.d.ts +2 -61
- package/lib/components/z-templates-data-common/data-common.helper.js +3 -351
- package/lib/components/z-templates-data-common/data-common.js +85 -66
- package/lib/components/z-templates-data-common/index.d.ts +3 -3
- package/lib/components/z-templates-data-common/index.js +1 -2
- package/lib/components/z-tpl/index.d.ts +3 -3
- package/lib/components/z-tpl/index.js +1 -2
- package/lib/components/z-tpl/tpl.d.ts +23 -23
- package/lib/components/z-tpl/tpl.js +7 -8
- package/lib/components/z-warehouse/index.d.ts +2 -2
- package/lib/components/z-warehouse/index.js +1 -2
- package/lib/components/z-warehouse/zWarehouse.d.ts +2 -3
- package/lib/components/z-warehouse/zWarehouse.js +3 -4
- package/lib/components/z-watermark/index.d.ts +3 -0
- package/lib/components/z-watermark/index.js +7 -0
- package/lib/components/z-watermark/zWatermark.d.ts +3 -0
- package/lib/components/z-watermark/zWatermark.js +8 -0
- package/lib/index.d.ts +44 -38
- package/lib/index.js +8 -2
- package/lib/index.scss +1 -1
- package/lib/style.js +1 -3
- package/lib/utils/hoc.d.ts +6 -6
- package/lib/utils/hoc.js +3 -3
- package/lib/utils/index.d.ts +13 -13
- package/lib/utils/index.js +7 -4
- package/lib/utils/props/button.d.ts +13 -13
- package/lib/utils/props/button.js +2 -3
- package/lib/utils/props/common.d.ts +7 -1
- package/lib/utils/props/common.js +19 -3
- package/lib/utils/props/editTable.d.ts +3 -3
- package/lib/utils/props/editTable.js +23 -17
- package/lib/utils/props/form.d.ts +36 -0
- package/lib/utils/props/form.js +35 -17
- package/lib/utils/props/listTpl.d.ts +29 -29
- package/lib/utils/props/listTpl.js +2 -3
- package/lib/utils/props/microModal.d.ts +7 -7
- package/lib/utils/props/microModal.js +1 -3
- package/lib/utils/props/microSwitch.d.ts +1 -1
- package/lib/utils/props/microSwitch.js +5 -4
- package/lib/utils/props/modalSelect.d.ts +6 -6
- package/lib/utils/props/modalSelect.js +2 -4
- package/lib/utils/props/operationRecords.d.ts +2 -2
- package/lib/utils/props/operationRecords.js +6 -7
- package/lib/utils/props/preview.d.ts +2 -2
- package/lib/utils/props/preview.js +6 -7
- package/lib/utils/props/tpl.d.ts +173 -162
- package/lib/utils/props/tpl.js +3 -5
- package/lib/utils/props/warehouseAndFactory.d.ts +1 -1
- package/lib/utils/props/warehouseAndFactory.js +2 -3
- package/lib/utils/rcProRequest.d.ts +3 -3
- package/lib/utils/rcProRequest.js +3 -4
- package/lib/variables.scss +3 -3
- package/package.json +5 -5
- package/es/components/z-templates-data-common/components/custom-renderer/index.d.ts +0 -13
- package/es/components/z-templates-data-common/components/custom-renderer/index.js +0 -172
- package/es/components/z-templates-data-common/components/dim-target/dim-target.helper.d.ts +0 -39
- package/es/components/z-templates-data-common/components/dim-target/dim-target.helper.js +0 -1
- package/es/components/z-templates-data-common/components/dim-target/index.d.ts +0 -16
- package/es/components/z-templates-data-common/components/dim-target/index.js +0 -430
- package/es/components/z-templates-data-common/components/dim-target/index.less +0 -49
- package/es/components/z-templates-data-common/components/dim-target/useUpdateEffect.d.ts +0 -8
- package/es/components/z-templates-data-common/components/dim-target/useUpdateEffect.js +0 -26
- package/es/components/z-templates-data-common/components/link-renderer/index.d.ts +0 -16
- package/es/components/z-templates-data-common/components/link-renderer/index.js +0 -320
- package/es/components/z-templates-data-common/components/link-renderer/index.less +0 -33
- package/es/components/z-templates-data-common/components/table-renderer/index.d.ts +0 -6
- package/es/components/z-templates-data-common/components/table-renderer/index.js +0 -481
- package/es/components/z-templates-data-common/components/table-renderer/table-renderer.helper.d.ts +0 -64
- package/es/components/z-templates-data-common/components/table-renderer/table-renderer.helper.js +0 -220
- package/lib/components/z-templates-data-common/components/custom-renderer/index.d.ts +0 -13
- package/lib/components/z-templates-data-common/components/custom-renderer/index.js +0 -178
- package/lib/components/z-templates-data-common/components/dim-target/dim-target.helper.d.ts +0 -39
- package/lib/components/z-templates-data-common/components/dim-target/dim-target.helper.js +0 -3
- package/lib/components/z-templates-data-common/components/dim-target/index.d.ts +0 -16
- package/lib/components/z-templates-data-common/components/dim-target/index.js +0 -438
- package/lib/components/z-templates-data-common/components/dim-target/index.less +0 -49
- package/lib/components/z-templates-data-common/components/dim-target/useUpdateEffect.d.ts +0 -8
- package/lib/components/z-templates-data-common/components/dim-target/useUpdateEffect.js +0 -30
- package/lib/components/z-templates-data-common/components/link-renderer/index.d.ts +0 -16
- package/lib/components/z-templates-data-common/components/link-renderer/index.js +0 -326
- package/lib/components/z-templates-data-common/components/link-renderer/index.less +0 -33
- package/lib/components/z-templates-data-common/components/table-renderer/index.d.ts +0 -6
- package/lib/components/z-templates-data-common/components/table-renderer/index.js +0 -487
- package/lib/components/z-templates-data-common/components/table-renderer/table-renderer.helper.d.ts +0 -64
- package/lib/components/z-templates-data-common/components/table-renderer/table-renderer.helper.js +0 -229
|
@@ -1,320 +0,0 @@
|
|
|
1
|
-
import _Radio from "antd/es/radio";
|
|
2
|
-
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
4
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
5
|
-
import { useEffect, useState, useRef, useContext, useImperativeHandle } from 'react';
|
|
6
|
-
import { ProTable, RcConfigContext } from '@ztocwst/rc-pro';
|
|
7
|
-
import { ArrowLeftOutlined } from '@ant-design/icons';
|
|
8
|
-
import { tableConfigDefault, separator, timeUnit, getMaxWidth, handleQueryParams, getReportData } from "../../data-common.helper";
|
|
9
|
-
import { handleDimTargetFormat, handleColumns } from "../table-renderer/table-renderer.helper";
|
|
10
|
-
import "./index.less";
|
|
11
|
-
var linkStateDefault = {
|
|
12
|
-
dataSetName: '',
|
|
13
|
-
autoLoad: false,
|
|
14
|
-
refreshRate: 0
|
|
15
|
-
};
|
|
16
|
-
var LinkRenderer = function LinkRenderer(props) {
|
|
17
|
-
var _tableOptions$paginat, _linkPage$filter;
|
|
18
|
-
var dimJson = props.dimJson,
|
|
19
|
-
linkPage = props.linkPage,
|
|
20
|
-
linkPageTitle = props.linkPageTitle,
|
|
21
|
-
chartRef = props.chartRef,
|
|
22
|
-
onConfirm = props.onConfirm,
|
|
23
|
-
onBack = props.onBack;
|
|
24
|
-
var rcProContext = useContext(RcConfigContext);
|
|
25
|
-
var _ref = rcProContext || {},
|
|
26
|
-
_ref$tableOptions = _ref.tableOptions,
|
|
27
|
-
tableOptions = _ref$tableOptions === void 0 ? {} : _ref$tableOptions;
|
|
28
|
-
var defaultPageSize = (tableOptions === null || tableOptions === void 0 ? void 0 : (_tableOptions$paginat = tableOptions.pagination) === null || _tableOptions$paginat === void 0 ? void 0 : _tableOptions$paginat.defaultPageSize) || 20;
|
|
29
|
-
var _useState = useState(linkStateDefault),
|
|
30
|
-
linkState = _useState[0],
|
|
31
|
-
setLinkState = _useState[1];
|
|
32
|
-
var tableRef = useRef(null);
|
|
33
|
-
var queryCacheRef = useRef(null);
|
|
34
|
-
var timer = null;
|
|
35
|
-
var handleClearInterval = function handleClearInterval() {
|
|
36
|
-
if (timer) {
|
|
37
|
-
clearInterval(timer);
|
|
38
|
-
timer = null;
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
useEffect(function () {
|
|
42
|
-
var dataSetName = linkState.dataSetName,
|
|
43
|
-
autoLoad = linkState.autoLoad,
|
|
44
|
-
refreshRate = linkState.refreshRate;
|
|
45
|
-
if (dataSetName) {
|
|
46
|
-
if (autoLoad) {
|
|
47
|
-
if (refreshRate) {
|
|
48
|
-
handleClearInterval();
|
|
49
|
-
timer = window.setInterval(function () {
|
|
50
|
-
return onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm();
|
|
51
|
-
}, refreshRate * timeUnit);
|
|
52
|
-
} else {
|
|
53
|
-
onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm();
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
} else {
|
|
57
|
-
handleClearInterval();
|
|
58
|
-
}
|
|
59
|
-
return function () {
|
|
60
|
-
handleClearInterval();
|
|
61
|
-
};
|
|
62
|
-
}, [linkState.dataSetName, linkState.index, linkState.autoLoad]);
|
|
63
|
-
|
|
64
|
-
// 获取表头
|
|
65
|
-
var handleGetColumns = function handleGetColumns(stateParams) {
|
|
66
|
-
var index = stateParams.index;
|
|
67
|
-
// 通过数据源接口名找到数据源配置
|
|
68
|
-
var find = linkPage[index];
|
|
69
|
-
var _ref2 = handleDimTargetFormat(find) || {},
|
|
70
|
-
targets = _ref2.targets;
|
|
71
|
-
var option = {
|
|
72
|
-
dimension: [],
|
|
73
|
-
dimensionSource: [],
|
|
74
|
-
index: (targets === null || targets === void 0 ? void 0 : targets.index) || [],
|
|
75
|
-
indexSource: (targets === null || targets === void 0 ? void 0 : targets.indexSource) || []
|
|
76
|
-
};
|
|
77
|
-
return handleColumns(option);
|
|
78
|
-
};
|
|
79
|
-
var handleUpdateColumns = function handleUpdateColumns(stateParams) {
|
|
80
|
-
var _tableRef$current;
|
|
81
|
-
var columns = handleGetColumns(_extends({}, stateParams));
|
|
82
|
-
// 更新表头
|
|
83
|
-
(_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 ? void 0 : _tableRef$current.updateColumns(columns);
|
|
84
|
-
};
|
|
85
|
-
var getDataSource = /*#__PURE__*/function () {
|
|
86
|
-
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(params) {
|
|
87
|
-
var _dimJson$data;
|
|
88
|
-
var dataSetName, index, dimension, record, columns, _linkPage$index, queryBind, formatter, queryCache, query, queryKeys, recordKeys, dim, queryParams, data, queryData;
|
|
89
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
90
|
-
while (1) switch (_context.prev = _context.next) {
|
|
91
|
-
case 0:
|
|
92
|
-
if (params === void 0) {
|
|
93
|
-
params = {};
|
|
94
|
-
}
|
|
95
|
-
dataSetName = linkState.dataSetName, index = linkState.index, dimension = linkState.dimension, record = linkState.record;
|
|
96
|
-
columns = handleGetColumns(_extends({}, linkState));
|
|
97
|
-
/** 查看queryBind是否有 当前查询条件和当前数据源参数(paraJson)建立绑定关系;有的话替换成绑定关系中的"键",没有则是默认查询配置的"键",上一级数据源的维度 "值" 或 当前查询条件的"值"入参 */
|
|
98
|
-
_linkPage$index = linkPage[index], queryBind = _linkPage$index.queryBind, formatter = _linkPage$index.formatter;
|
|
99
|
-
queryCache = queryCacheRef.current;
|
|
100
|
-
query = {};
|
|
101
|
-
queryKeys = Object.keys(queryCache);
|
|
102
|
-
if (queryKeys !== null && queryKeys !== void 0 && queryKeys.length) {
|
|
103
|
-
queryKeys.forEach(function (k) {
|
|
104
|
-
var _queryBind$find;
|
|
105
|
-
// "键"(有建立绑定关系 取当前数据源参数(paraJson)的"键",没有则是默认查询配置的"键")
|
|
106
|
-
var key = (queryBind === null || queryBind === void 0 ? void 0 : (_queryBind$find = queryBind.find(function (item) {
|
|
107
|
-
return (item === null || item === void 0 ? void 0 : item.currentQueryKey) === k;
|
|
108
|
-
})) === null || _queryBind$find === void 0 ? void 0 : _queryBind$find.sourceQueryKey) || k;
|
|
109
|
-
// "值"(当前查询条件的"值")
|
|
110
|
-
query[key] = queryCache[k];
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
recordKeys = Object.keys(record || {});
|
|
114
|
-
if (recordKeys.length) {
|
|
115
|
-
recordKeys.forEach(function (k) {
|
|
116
|
-
var _queryBind$find2;
|
|
117
|
-
// 查看是否有绑定关联关系
|
|
118
|
-
var key = queryBind === null || queryBind === void 0 ? void 0 : (_queryBind$find2 = queryBind.find(function (item) {
|
|
119
|
-
return (item === null || item === void 0 ? void 0 : item.parentDimKey) === k;
|
|
120
|
-
})) === null || _queryBind$find2 === void 0 ? void 0 : _queryBind$find2.sourceQueryKey;
|
|
121
|
-
if (key) {
|
|
122
|
-
// "值"(有建立绑定关系 取上一级数据源的维度的"值")
|
|
123
|
-
query[key] = record[k];
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
if (dimJson !== null && dimJson !== void 0 && (_dimJson$data = dimJson.data) !== null && _dimJson$data !== void 0 && _dimJson$data.length) {
|
|
128
|
-
dim = dimension === null || dimension === void 0 ? void 0 : dimension.map(function (description) {
|
|
129
|
-
var _dimJson$data2, _dimJson$data2$find;
|
|
130
|
-
return {
|
|
131
|
-
description: description,
|
|
132
|
-
name: (_dimJson$data2 = dimJson.data) === null || _dimJson$data2 === void 0 ? void 0 : (_dimJson$data2$find = _dimJson$data2.find(function (item) {
|
|
133
|
-
return item.description === description;
|
|
134
|
-
})) === null || _dimJson$data2$find === void 0 ? void 0 : _dimJson$data2$find.name
|
|
135
|
-
};
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
queryParams = handleQueryParams(query);
|
|
139
|
-
data = _extends({
|
|
140
|
-
pageNum: 1,
|
|
141
|
-
pageSize: defaultPageSize
|
|
142
|
-
}, params, {
|
|
143
|
-
queryParams: queryParams,
|
|
144
|
-
dim: dim,
|
|
145
|
-
target: columns.map(function (item) {
|
|
146
|
-
return {
|
|
147
|
-
description: item.dataIndex
|
|
148
|
-
};
|
|
149
|
-
}),
|
|
150
|
-
dataSetName: dataSetName
|
|
151
|
-
});
|
|
152
|
-
queryData = formatter ? formatter === null || formatter === void 0 ? void 0 : formatter(data) : data;
|
|
153
|
-
return _context.abrupt("return", getReportData(rcProContext, queryData).then(function (_ref4) {
|
|
154
|
-
var success = _ref4.success,
|
|
155
|
-
_ref4$result = _ref4.result,
|
|
156
|
-
result = _ref4$result === void 0 ? {} : _ref4$result;
|
|
157
|
-
return {
|
|
158
|
-
success: success,
|
|
159
|
-
result: result
|
|
160
|
-
};
|
|
161
|
-
}));
|
|
162
|
-
case 15:
|
|
163
|
-
case "end":
|
|
164
|
-
return _context.stop();
|
|
165
|
-
}
|
|
166
|
-
}, _callee);
|
|
167
|
-
}));
|
|
168
|
-
return function getDataSource(_x) {
|
|
169
|
-
return _ref3.apply(this, arguments);
|
|
170
|
-
};
|
|
171
|
-
}();
|
|
172
|
-
|
|
173
|
-
/** 初始linkState */
|
|
174
|
-
var initial = function initial(state) {
|
|
175
|
-
var _ref5 = state || {},
|
|
176
|
-
dataSetName = _ref5.dataSetName;
|
|
177
|
-
/** 二级页未配置 或 自定义dataSetName配错 直接返回 */
|
|
178
|
-
var Length = linkPage === null || linkPage === void 0 ? void 0 : linkPage.length;
|
|
179
|
-
var isHave = linkPage === null || linkPage === void 0 ? void 0 : linkPage.some(function (item) {
|
|
180
|
-
return item.dataSetName === dataSetName;
|
|
181
|
-
});
|
|
182
|
-
if (!Length || !isHave) return;
|
|
183
|
-
|
|
184
|
-
/** 可以传入二级页下标 */
|
|
185
|
-
var index = state.index || 0;
|
|
186
|
-
/** 检查传入二级下标 是否为数字 */
|
|
187
|
-
var isNumber = typeof index === 'number';
|
|
188
|
-
|
|
189
|
-
/** 收集二级页title 计算宽度 */
|
|
190
|
-
var linkTitle = [];
|
|
191
|
-
for (var i = 0; i < Length; i++) {
|
|
192
|
-
var item = linkPage[i];
|
|
193
|
-
// 找到相同的
|
|
194
|
-
if (item.dataSetName === dataSetName) {
|
|
195
|
-
linkTitle.push(item.title);
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
var width = getMaxWidth(linkTitle);
|
|
199
|
-
|
|
200
|
-
/** 二级页出现重复相同的时候 索引未配置正确 取dataSetName 出现最近一次下标 防止报错 */
|
|
201
|
-
if (!isNumber || isNumber && (index < 0 || index >= Length)) {
|
|
202
|
-
for (var _i = 0; _i < Length; _i++) {
|
|
203
|
-
var _item = linkPage[_i];
|
|
204
|
-
if (_item.dataSetName === dataSetName) {
|
|
205
|
-
index = _i;
|
|
206
|
-
break;
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
}
|
|
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;
|
|
215
|
-
var stateData = _extends({}, state, {
|
|
216
|
-
width: width,
|
|
217
|
-
index: index,
|
|
218
|
-
chartTitle: chartTitle,
|
|
219
|
-
title: title,
|
|
220
|
-
autoLoad: autoLoad,
|
|
221
|
-
refreshRate: refreshRate
|
|
222
|
-
});
|
|
223
|
-
/** 当前进入与上次进入link页不同时需要清空数据 */
|
|
224
|
-
var isSource = "" + stateData.dataSetName + separator + index === "" + linkState.dataSetName + separator + (linkState === null || linkState === void 0 ? void 0 : linkState.index);
|
|
225
|
-
var isSame = JSON.stringify(stateData === null || stateData === void 0 ? void 0 : stateData.record) === JSON.stringify(linkState === null || linkState === void 0 ? void 0 : linkState.record);
|
|
226
|
-
if (!isSource || !isSame) {
|
|
227
|
-
var _tableRef$current2, _tableRef$current2$up;
|
|
228
|
-
(_tableRef$current2 = tableRef.current) === null || _tableRef$current2 === void 0 ? void 0 : (_tableRef$current2$up = _tableRef$current2.updateDataSource) === null || _tableRef$current2$up === void 0 ? void 0 : _tableRef$current2$up.call(_tableRef$current2, []);
|
|
229
|
-
}
|
|
230
|
-
handleUpdateColumns(stateData);
|
|
231
|
-
setLinkState(stateData);
|
|
232
|
-
};
|
|
233
|
-
var queryChart = function queryChart(value) {
|
|
234
|
-
var _tableRef$current3;
|
|
235
|
-
queryCacheRef.current = value;
|
|
236
|
-
(_tableRef$current3 = tableRef.current) === null || _tableRef$current3 === void 0 ? void 0 : _tableRef$current3.refreshTable({
|
|
237
|
-
current: 1
|
|
238
|
-
});
|
|
239
|
-
};
|
|
240
|
-
useImperativeHandle(chartRef, function () {
|
|
241
|
-
return {
|
|
242
|
-
initial: initial,
|
|
243
|
-
queryChart: queryChart
|
|
244
|
-
};
|
|
245
|
-
});
|
|
246
|
-
|
|
247
|
-
/** 切换link */
|
|
248
|
-
var handleLinkChange = function handleLinkChange(event) {
|
|
249
|
-
var value = event.target.value;
|
|
250
|
-
// dataSetName 可能会重复配置 所以使用 dataSetName + 分隔符 + index
|
|
251
|
-
var _ref6 = (value === null || value === void 0 ? void 0 : value.split(separator)) || [],
|
|
252
|
-
dataSetName = _ref6[0],
|
|
253
|
-
index = _ref6[1];
|
|
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;
|
|
259
|
-
var stateData = _extends({}, linkState, {
|
|
260
|
-
dataSetName: dataSetName,
|
|
261
|
-
index: index,
|
|
262
|
-
chartTitle: chartTitle,
|
|
263
|
-
title: title,
|
|
264
|
-
autoLoad: autoLoad,
|
|
265
|
-
refreshRate: refreshRate
|
|
266
|
-
});
|
|
267
|
-
handleUpdateColumns(stateData);
|
|
268
|
-
setLinkState(stateData);
|
|
269
|
-
};
|
|
270
|
-
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
271
|
-
className: "link-head"
|
|
272
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
273
|
-
className: "link-title"
|
|
274
|
-
}, /*#__PURE__*/React.createElement(ArrowLeftOutlined, {
|
|
275
|
-
className: "arrow-left",
|
|
276
|
-
onClick: onBack
|
|
277
|
-
}), /*#__PURE__*/React.createElement("span", null, linkState.chartTitle || linkPageTitle)), (linkPage === null || linkPage === void 0 ? void 0 : (_linkPage$filter = linkPage.filter(function (field) {
|
|
278
|
-
return (field === null || field === void 0 ? void 0 : field.dataSetName) === linkState.dataSetName && (field === null || field === void 0 ? void 0 : field.chartTitle) === linkState.chartTitle;
|
|
279
|
-
})) === null || _linkPage$filter === void 0 ? void 0 : _linkPage$filter.length) <= 1 ? null : /*#__PURE__*/React.createElement(_Radio.Group, {
|
|
280
|
-
value: "" + (linkState === null || linkState === void 0 ? void 0 : linkState.dataSetName) + separator + linkState.index,
|
|
281
|
-
onChange: handleLinkChange
|
|
282
|
-
}, linkPage === null || linkPage === void 0 ? void 0 : linkPage.map(function (field, index) {
|
|
283
|
-
return (field === null || field === void 0 ? void 0 : field.dataSetName) === linkState.dataSetName && (field === null || field === void 0 ? void 0 : field.chartTitle) === linkState.chartTitle ? /*#__PURE__*/React.createElement(_Radio.Button, {
|
|
284
|
-
value: "" + (field === null || field === void 0 ? void 0 : field.dataSetName) + separator + index.toString(),
|
|
285
|
-
key: "" + (field === null || field === void 0 ? void 0 : field.dataSetName) + separator + index.toString()
|
|
286
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
287
|
-
style: {
|
|
288
|
-
textAlign: 'center',
|
|
289
|
-
width: linkState.width
|
|
290
|
-
}
|
|
291
|
-
}, field === null || field === void 0 ? void 0 : field.title)) : null;
|
|
292
|
-
}))), /*#__PURE__*/React.createElement(ProTable, {
|
|
293
|
-
ref: tableRef,
|
|
294
|
-
config: _extends({}, tableConfigDefault, {
|
|
295
|
-
pagination: {
|
|
296
|
-
showSizeChanger: true,
|
|
297
|
-
defaultPageSize: defaultPageSize
|
|
298
|
-
},
|
|
299
|
-
request: function request(data) {
|
|
300
|
-
var _data$pagination, _data$pagination2, _data$sorter;
|
|
301
|
-
var pagination = {
|
|
302
|
-
pageNum: (_data$pagination = data.pagination) === null || _data$pagination === void 0 ? void 0 : _data$pagination.current,
|
|
303
|
-
pageSize: (_data$pagination2 = data.pagination) === null || _data$pagination2 === void 0 ? void 0 : _data$pagination2.pageSize
|
|
304
|
-
};
|
|
305
|
-
var orderBy = [];
|
|
306
|
-
if ((_data$sorter = data.sorter) !== null && _data$sorter !== void 0 && _data$sorter.order) {
|
|
307
|
-
var _data$sorter2, _data$sorter3, _data$sorter3$order;
|
|
308
|
-
orderBy.push({
|
|
309
|
-
name: (_data$sorter2 = data.sorter) === null || _data$sorter2 === void 0 ? void 0 : _data$sorter2.field,
|
|
310
|
-
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)
|
|
311
|
-
});
|
|
312
|
-
}
|
|
313
|
-
return getDataSource(_extends({}, pagination, {
|
|
314
|
-
orderBy: orderBy
|
|
315
|
-
}));
|
|
316
|
-
}
|
|
317
|
-
})
|
|
318
|
-
}));
|
|
319
|
-
};
|
|
320
|
-
export default LinkRenderer;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
@root-entry-name: 'default';
|
|
2
|
-
@import (reference) '~antd/es/style/themes/index.less';
|
|
3
|
-
.link-head {
|
|
4
|
-
display: flex;
|
|
5
|
-
align-items: center;
|
|
6
|
-
margin: 12px 0;
|
|
7
|
-
.ant-radio-group {
|
|
8
|
-
flex: 1;
|
|
9
|
-
overflow-x: auto;
|
|
10
|
-
display: flex;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.link-title {
|
|
14
|
-
display: flex;
|
|
15
|
-
align-items: center;
|
|
16
|
-
margin-right: 12px;
|
|
17
|
-
font-weight: 600;
|
|
18
|
-
font-size: 20px;
|
|
19
|
-
color: #333;
|
|
20
|
-
white-space: nowrap;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.arrow-left {
|
|
24
|
-
margin-right: 5px;
|
|
25
|
-
font-size: 20px;
|
|
26
|
-
cursor: pointer;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.arrow-left:hover {
|
|
30
|
-
transition: all 0.3s ease-in;
|
|
31
|
-
color: var(--ant-primary-color, @primary-color);
|
|
32
|
-
}
|
|
33
|
-
}
|