@ztocwst/rc-pro-materials 0.2.42 → 0.2.43

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.
Files changed (29) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/meta.js +1 -1
  5. package/build/lowcode/render/default/view.js +5 -5
  6. package/build/lowcode/view.js +5 -5
  7. package/dist/SCM_Comps.js +5 -5
  8. package/dist/SCM_Comps.js.map +1 -1
  9. package/es/components/z-data-stat-description/index.d.ts +3 -0
  10. package/es/components/z-data-stat-description/index.js +2 -0
  11. package/es/components/z-data-stat-description/z-data-stat-description.d.ts +34 -0
  12. package/es/components/z-data-stat-description/z-data-stat-description.js +169 -0
  13. package/es/components/z-templates-data-common/components/chart-renderer/index.d.ts +6 -2
  14. package/es/components/z-templates-data-common/components/chart-renderer/index.js +41 -1
  15. package/es/components/z-templates-data-common/data-common.d.ts +5 -1
  16. package/es/index.d.ts +2 -0
  17. package/es/index.js +1 -0
  18. package/es/style.js +2 -0
  19. package/lib/components/z-data-stat-description/index.d.ts +3 -0
  20. package/lib/components/z-data-stat-description/index.js +7 -0
  21. package/lib/components/z-data-stat-description/z-data-stat-description.d.ts +34 -0
  22. package/lib/components/z-data-stat-description/z-data-stat-description.js +176 -0
  23. package/lib/components/z-templates-data-common/components/chart-renderer/index.d.ts +6 -2
  24. package/lib/components/z-templates-data-common/components/chart-renderer/index.js +41 -1
  25. package/lib/components/z-templates-data-common/data-common.d.ts +5 -1
  26. package/lib/index.d.ts +2 -0
  27. package/lib/index.js +4 -2
  28. package/lib/style.js +2 -0
  29. package/package.json +3 -3
@@ -0,0 +1,3 @@
1
+ import ZDataStatDescription from './z-data-stat-description';
2
+ export type { TypeZDataStatDescriptionProps } from './z-data-stat-description';
3
+ export default ZDataStatDescription;
@@ -0,0 +1,2 @@
1
+ import ZDataStatDescription from "./z-data-stat-description";
2
+ export default ZDataStatDescription;
@@ -0,0 +1,34 @@
1
+ import { TableColumnProps } from '@ztocwst/rc-pro';
2
+ export type TypeZDataStatDescriptionProps = {
3
+ /** 指标表格列配置 */
4
+ columns: TableColumnProps[];
5
+ /** 指标名称集合, 支持异步返回 */
6
+ qtaName: string[] | (() => Promise<string[]>);
7
+ /**
8
+ * 宽度
9
+ * @default 620
10
+ */
11
+ width?: number;
12
+ /**
13
+ * 数据转换
14
+ * @description 如果数组没有返回id,建议 返回id,表格的rowKey 为 id
15
+ */
16
+ transformRequestData?: (data: any) => any;
17
+ /**
18
+ * 标题
19
+ * @default '指标说明'
20
+ * */
21
+ title?: string;
22
+ /**
23
+ * 提示
24
+ * @default '点击查看本页面所有指标相关口径、来源、责任部门'
25
+ */
26
+ tooltip?: string;
27
+ /**
28
+ * 数据集
29
+ * @default 'getBusinessCaliberList'
30
+ */
31
+ dataSetName?: string;
32
+ };
33
+ declare const ZDataStatDescription: (props: TypeZDataStatDescriptionProps) => JSX.Element;
34
+ export default ZDataStatDescription;
@@ -0,0 +1,169 @@
1
+ import _Drawer from "antd/es/drawer";
2
+ import _extends from "@babel/runtime/helpers/extends";
3
+ import _Tooltip from "antd/es/tooltip";
4
+ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
5
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
6
+ import React, { useContext, useRef, useState } from 'react';
7
+ import { ProButton, ProTable, RcConfigContext } from '@ztocwst/rc-pro';
8
+ import { InfoCircleOutlined } from '@ant-design/icons';
9
+ import { getReportData } from "../z-data-stat/util";
10
+ // http://scm.gateway.dev.ztyc.com/data/forward/v1/bigdata/report/getBusinessCaliberList
11
+ // {"bigDataBody":{"env":"dev","dataSetName":"getBusinessCaliberList","qta_name":["推单包裹数","已发包裹数","未发包裹数","发货达成率","取消包裹数","暂挂包裹数","待处理包裹数","预处理完成包裹数","波次中包裹数","波次完成包裹数","拣货中包裹数","拣货完成包裹数","复核中包裹数","复核完成包裹数","打包中包裹数","打包完成包裹数","称重完成包裹数","揽收包裹数","已发货未揽收包裹数","揽收达成率","首中心到达包裹数","首中心未到达包裹数","配送中包裹数","已签收包裹数","推单件数","推单包裹客单件","推单批量包裹数","推单散单包裹数","推单包裹批量单占比","未发包裹件数","未发包裹客单件","未发批量包裹数","未发散单包裹数","未发包裹批量单占比","已发包裹件数","已发包裹客单件","已发批量包裹数","已发散单包裹数","已发包裹批量单占比","取消单包裹占比","待处理包裹客单件","待处理批量包裹数","待处理散单包裹数","待处理包裹批量单占比","预处理完成包裹客单件","预处理完成批量包裹数","预处理完成散单包裹数","预处理完成包裹批量单占比","波次中包裹客单件","波次中批量包裹数","波次中散单包裹数","波次中包裹批量单占比","波次完成包裹客单件","波次完成批量包裹数","波次完成散单包裹数","波次完成包裹批量单占比","拣货中包裹客单件","拣货中批量包裹数","拣货中散单包裹数","拣货中包裹批量单占比","拣货完成包裹客单件","拣货完成批量包裹数","拣货完成散单包裹数","拣货完成包裹批量单占比","复核中包裹客单件","复核中批量包裹数","复核中散单包裹数","复核中包裹批量单占比","复核完成包裹客单件","复核完成批量包裹数","复核完成散单包裹数","复核完成包裹批量单占比","打包中包裹客单件","打包中批量包裹数","打包中散单包裹数","打包中包裹批量单占比","打包完成包裹客单件","打包完成批量包裹数","打包完成散单包裹数","打包完成包裹批量单占比","称重完成包裹客单件","称重完成批量包裹数","称重完成散单包裹数","称重完成包裹批量单占比","实际批量单客单件","实际批量单SKU数","实际散单客单件","实际散单SKU数"],"pageNum":1,"pageSize":20}}
12
+ // {
13
+ // "total": 37,
14
+ // "size": 20,
15
+ // "page": 1,
16
+ // "data": [
17
+ // {
18
+ // "businessCaliber": "指标定义:取消单包裹数量\n数据来源:仓配一体来自SCM\\/WMS, 快进快出来自景天导入",
19
+ // "qtaName": "取消包裹数",
20
+ // "dataSource": ""
21
+ // },
22
+ // ]
23
+ // }
24
+ var ZDataStatDescription = function ZDataStatDescription(props) {
25
+ var _props$columns = props.columns,
26
+ columns = _props$columns === void 0 ? [] : _props$columns,
27
+ _props$qtaName = props.qtaName,
28
+ qtaName = _props$qtaName === void 0 ? [] : _props$qtaName,
29
+ _props$title = props.title,
30
+ title = _props$title === void 0 ? '指标说明' : _props$title,
31
+ _props$tooltip = props.tooltip,
32
+ tooltip = _props$tooltip === void 0 ? '点击查看本页面所有指标相关口径、来源、责任部门' : _props$tooltip,
33
+ _props$dataSetName = props.dataSetName,
34
+ dataSetName = _props$dataSetName === void 0 ? 'getBusinessCaliberList' : _props$dataSetName,
35
+ _transformRequestData = props.transformRequestData,
36
+ _props$width = props.width,
37
+ width = _props$width === void 0 ? 620 : _props$width;
38
+ var rcConfigContextValue = useContext(RcConfigContext);
39
+ var tableRef = useRef(null);
40
+ var _useState = useState(false),
41
+ open = _useState[0],
42
+ setOpen = _useState[1];
43
+ var openDrawer = /*#__PURE__*/function () {
44
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
45
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
46
+ while (1) switch (_context.prev = _context.next) {
47
+ case 0:
48
+ // if (!qtaName) {
49
+ // return message.error('请配置查询指标');
50
+ // }
51
+ // let tempQta_name = [];
52
+ // if (typeof qtaName === 'function') {
53
+ // const { index: QtaArr } = await qtaName?.();
54
+ // tempQta_name = QtaArr;
55
+ // } else {
56
+ // tempQta_name = [...new Set((qtaName || []).map((e: any) => e?.name || e?.description))];
57
+ // }
58
+ // setQta_name(tempQta_name);
59
+
60
+ // setTimeout(() => {
61
+ setOpen(true);
62
+ // tableRef.current?.refreshTable();
63
+ // }, 0);
64
+ case 1:
65
+ case "end":
66
+ return _context.stop();
67
+ }
68
+ }, _callee);
69
+ }));
70
+ return function openDrawer() {
71
+ return _ref.apply(this, arguments);
72
+ };
73
+ }();
74
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ProButton, {
75
+ items: [{
76
+ name: title,
77
+ action: 'xxx',
78
+ onClick: openDrawer,
79
+ props: {
80
+ type: 'link',
81
+ color: 'default',
82
+ icon: /*#__PURE__*/React.createElement(_Tooltip, {
83
+ title: tooltip
84
+ }, /*#__PURE__*/React.createElement(InfoCircleOutlined, null))
85
+ }
86
+ }]
87
+ }), /*#__PURE__*/React.createElement(_Drawer, {
88
+ width: width,
89
+ destroyOnClose: true,
90
+ title: title,
91
+ visible: open,
92
+ open: open,
93
+ onClose: function onClose() {
94
+ return setOpen(false);
95
+ }
96
+ }, /*#__PURE__*/React.createElement(ProTable, {
97
+ ref: tableRef,
98
+ config: {
99
+ manual: false,
100
+ request: function () {
101
+ var _request = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
102
+ var pagination, newPagination, _qtaName;
103
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
104
+ while (1) switch (_context2.prev = _context2.next) {
105
+ case 0:
106
+ pagination = _ref2.pagination;
107
+ newPagination = {
108
+ pageNum: pagination === null || pagination === void 0 ? void 0 : pagination.current,
109
+ pageSize: pagination === null || pagination === void 0 ? void 0 : pagination.pageSize
110
+ };
111
+ _qtaName = qtaName || [];
112
+ if (!(typeof qtaName === 'function')) {
113
+ _context2.next = 10;
114
+ break;
115
+ }
116
+ _context2.next = 6;
117
+ return qtaName === null || qtaName === void 0 ? void 0 : qtaName();
118
+ case 6:
119
+ _context2.t0 = _context2.sent;
120
+ if (_context2.t0) {
121
+ _context2.next = 9;
122
+ break;
123
+ }
124
+ _context2.t0 = [];
125
+ case 9:
126
+ _qtaName = _context2.t0;
127
+ case 10:
128
+ _context2.next = 12;
129
+ return getReportData(_extends({
130
+ dataSetName: dataSetName,
131
+ qta_name: [].concat(new Set(_qtaName))
132
+ }, newPagination), {
133
+ request: rcConfigContextValue.materialsRequest,
134
+ env: rcConfigContextValue.env
135
+ });
136
+ case 12:
137
+ return _context2.abrupt("return", _context2.sent);
138
+ case 13:
139
+ case "end":
140
+ return _context2.stop();
141
+ }
142
+ }, _callee2);
143
+ }));
144
+ function request(_x) {
145
+ return _request.apply(this, arguments);
146
+ }
147
+ return request;
148
+ }(),
149
+ transformRequestData: function transformRequestData(data) {
150
+ if (_transformRequestData) {
151
+ return _transformRequestData(data);
152
+ }
153
+ return (data || []).map(function (e, index) {
154
+ return _extends({
155
+ id: index
156
+ }, e);
157
+ });
158
+ },
159
+ size: 'small',
160
+ rowKey: 'id',
161
+ columns: columns,
162
+ toolBars: false,
163
+ hideDefRowSelection: true,
164
+ showIndex: true,
165
+ isDynamicHeight: true
166
+ }
167
+ })));
168
+ };
169
+ export default ZDataStatDescription;
@@ -1,12 +1,16 @@
1
1
  import React from 'react';
2
2
  import type { DataTableInstance, DataTableProps } from '@ztocwst/rc-pro';
3
3
  import type { tabsSettingProps } from '../../data-common';
4
+ import { TypeZDataStatDescriptionProps } from '../../../z-data-stat-description';
4
5
  export interface ChartRendererProps {
5
- chartSetting?: DataTableProps | DataTableProps[] | React.ReactNode;
6
+ chartSetting?: DataTableProps | (DataTableProps & {
7
+ showIndexInfo: boolean;
8
+ indexInfo: TypeZDataStatDescriptionProps;
9
+ }[]) | React.ReactNode;
6
10
  tabsSetting?: tabsSettingProps;
7
11
  chartRenderRef?: React.Ref<DataTableInstance>;
8
12
  /** 确认 */
9
13
  onConfirm?: () => void;
10
14
  }
11
- declare const ChartRenderer: ({ chartRenderRef, tabsSetting, chartSetting, onConfirm }: ChartRendererProps) => any;
15
+ declare const ChartRenderer: ({ chartRenderRef, tabsSetting, chartSetting, onConfirm, }: ChartRendererProps) => any;
12
16
  export default ChartRenderer;
@@ -4,6 +4,30 @@ import React, { useRef, useState, useEffect, useImperativeHandle } from 'react';
4
4
  import { TableRender, CustomRender } from '@ztocwst/rc-pro';
5
5
  import { getType } from '@ztocwst/rc-pro/es/components/DataTable/DataTable.helper';
6
6
  import { separator } from "../../data-common.helper";
7
+ import ZDataStatDescription from "../../../z-data-stat-description";
8
+ // 根据activeKey获取当前tab的chartSetting
9
+ var getSettingByActiveKey = function getSettingByActiveKey(chartSetting, activeKey) {
10
+ // 目前只考虑tabs情况
11
+ if (Array.isArray(chartSetting) && activeKey) {
12
+ var _activeKey$split = activeKey.split(separator),
13
+ index = _activeKey$split[1];
14
+ return chartSetting[index];
15
+ }
16
+ return chartSetting;
17
+ };
18
+
19
+ // 获取指标集合
20
+ var getIndexData = function getIndexData(chartSetting, activeKey) {
21
+ // 目前只考虑tabs情况
22
+ if (Array.isArray(chartSetting) && activeKey) {
23
+ var _current$indexJson, _current$indexJson$da;
24
+ var current = getSettingByActiveKey(chartSetting, activeKey);
25
+ return (current === null || current === void 0 ? void 0 : (_current$indexJson = current.indexJson) === null || _current$indexJson === void 0 ? void 0 : (_current$indexJson$da = _current$indexJson.data) === null || _current$indexJson$da === void 0 ? void 0 : _current$indexJson$da.map(function (e) {
26
+ return e.name;
27
+ })) || [];
28
+ }
29
+ return [];
30
+ };
7
31
  var ChartRenderer = function ChartRenderer(_ref) {
8
32
  var chartRenderRef = _ref.chartRenderRef,
9
33
  tabsSetting = _ref.tabsSetting,
@@ -98,10 +122,26 @@ var ChartRenderer = function ChartRenderer(_ref) {
98
122
  if (isArray && !chartSetting.every(function (e) {
99
123
  return /*#__PURE__*/React.isValidElement(e);
100
124
  })) {
125
+ var getExtraContent = function getExtraContent() {
126
+ var _setting$indexInfo;
127
+ var setting = getSettingByActiveKey(chartSetting, activeKey);
128
+ if (!(setting !== null && setting !== void 0 && setting.showIndexInfo)) {
129
+ return null;
130
+ }
131
+ var qtaName = getIndexData(chartSetting, activeKey);
132
+ if (typeof (setting === null || setting === void 0 ? void 0 : (_setting$indexInfo = setting.indexInfo) === null || _setting$indexInfo === void 0 ? void 0 : _setting$indexInfo.qtaName) === 'function') {
133
+ var _setting$indexInfo2;
134
+ qtaName = setting === null || setting === void 0 ? void 0 : (_setting$indexInfo2 = setting.indexInfo) === null || _setting$indexInfo2 === void 0 ? void 0 : _setting$indexInfo2.qtaName(qtaName);
135
+ }
136
+ return /*#__PURE__*/React.createElement(ZDataStatDescription, _extends({}, setting.indexInfo, {
137
+ qtaName: qtaName
138
+ }));
139
+ };
101
140
  return /*#__PURE__*/React.createElement(_Tabs, _extends({}, tabsProps, {
102
141
  activeKey: activeKey,
103
142
  onTabClick: onTabClick,
104
- onChange: handleTabsChange
143
+ onChange: handleTabsChange,
144
+ tabBarExtraContent: getExtraContent()
105
145
  }), chartSetting === null || chartSetting === void 0 ? void 0 : chartSetting.map(function (e, i) {
106
146
  return /*#__PURE__*/React.createElement(_Tabs.TabPane, {
107
147
  tab: "" + ((e === null || e === void 0 ? void 0 : e.title) || ''),
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { ProFormRenderProps, DataTableProps } from '@ztocwst/rc-pro';
3
+ import { TypeZDataStatDescriptionProps } from '../z-data-stat-description';
3
4
  export interface tabsSettingProps {
4
5
  onTabClick?: () => void;
5
6
  extraProps?: () => Record<string, any> | Record<string, any>;
@@ -10,7 +11,10 @@ export interface TypeZTemplatesDataCommonProps {
10
11
  /** 页签配置 */
11
12
  tabsSetting?: tabsSettingProps;
12
13
  /** 内容区配置 */
13
- chartSetting: DataTableProps | DataTableProps[] | React.ReactNode;
14
+ chartSetting: DataTableProps | (DataTableProps & {
15
+ showIndexInfo: boolean;
16
+ indexInfo: TypeZDataStatDescriptionProps;
17
+ }[]) | React.ReactNode;
14
18
  _unsafe_MixedSetter_chartSetting_select?: any;
15
19
  }
16
20
  export default class ZTemplatesDataCommonContainer extends React.Component<TypeZTemplatesDataCommonProps, any> {
package/es/index.d.ts CHANGED
@@ -44,3 +44,5 @@ export { default as ZWatermark } from './components/z-watermark';
44
44
  export type { TypeWatermarkProps } from './components/z-watermark';
45
45
  export { default as ZDataStat } from './components/z-data-stat';
46
46
  export type { TypeZDataStatProps } from './components/z-data-stat';
47
+ export { default as ZDataStatDescription } from './components/z-data-stat-description';
48
+ export type { TypeZDataStatDescriptionProps } from './components/z-data-stat-description';
package/es/index.js CHANGED
@@ -28,6 +28,7 @@ export { default as ZTemplatesDataCommon } from "./components/z-templates-data-c
28
28
  export { default as ZSlick } from "./components/z-slick";
29
29
  export { default as ZWatermark } from "./components/z-watermark";
30
30
  export { default as ZDataStat } from "./components/z-data-stat";
31
+ export { default as ZDataStatDescription } from "./components/z-data-stat-description";
31
32
 
32
33
  // const bizCssPrefix = 'bizpack';
33
34
 
package/es/style.js CHANGED
@@ -21,6 +21,8 @@ import 'antd/es/row/style';
21
21
  import 'antd/es/col/style';
22
22
  import 'antd/es/message/style';
23
23
  import 'antd/es/tabs/style';
24
+ import 'antd/es/drawer/style';
25
+ import 'antd/es/tooltip/style';
24
26
  import 'antd/es/carousel/style';
25
27
  import 'antd/es/spin/style';
26
28
  import 'antd/es/list/style';
@@ -0,0 +1,3 @@
1
+ import ZDataStatDescription from './z-data-stat-description';
2
+ export type { TypeZDataStatDescriptionProps } from './z-data-stat-description';
3
+ export default ZDataStatDescription;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ exports.__esModule = true;
5
+ exports["default"] = void 0;
6
+ var _zDataStatDescription = _interopRequireDefault(require("./z-data-stat-description"));
7
+ var _default = exports["default"] = _zDataStatDescription["default"];
@@ -0,0 +1,34 @@
1
+ import { TableColumnProps } from '@ztocwst/rc-pro';
2
+ export type TypeZDataStatDescriptionProps = {
3
+ /** 指标表格列配置 */
4
+ columns: TableColumnProps[];
5
+ /** 指标名称集合, 支持异步返回 */
6
+ qtaName: string[] | (() => Promise<string[]>);
7
+ /**
8
+ * 宽度
9
+ * @default 620
10
+ */
11
+ width?: number;
12
+ /**
13
+ * 数据转换
14
+ * @description 如果数组没有返回id,建议 返回id,表格的rowKey 为 id
15
+ */
16
+ transformRequestData?: (data: any) => any;
17
+ /**
18
+ * 标题
19
+ * @default '指标说明'
20
+ * */
21
+ title?: string;
22
+ /**
23
+ * 提示
24
+ * @default '点击查看本页面所有指标相关口径、来源、责任部门'
25
+ */
26
+ tooltip?: string;
27
+ /**
28
+ * 数据集
29
+ * @default 'getBusinessCaliberList'
30
+ */
31
+ dataSetName?: string;
32
+ };
33
+ declare const ZDataStatDescription: (props: TypeZDataStatDescriptionProps) => JSX.Element;
34
+ export default ZDataStatDescription;
@@ -0,0 +1,176 @@
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 _drawer = _interopRequireDefault(require("antd/lib/drawer"));
8
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
+ var _tooltip = _interopRequireDefault(require("antd/lib/tooltip"));
10
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
11
+ var _react = _interopRequireWildcard(require("react"));
12
+ var _rcPro = require("@ztocwst/rc-pro");
13
+ var _icons = require("@ant-design/icons");
14
+ var _util = require("../z-data-stat/util");
15
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
16
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
17
+ // http://scm.gateway.dev.ztyc.com/data/forward/v1/bigdata/report/getBusinessCaliberList
18
+ // {"bigDataBody":{"env":"dev","dataSetName":"getBusinessCaliberList","qta_name":["推单包裹数","已发包裹数","未发包裹数","发货达成率","取消包裹数","暂挂包裹数","待处理包裹数","预处理完成包裹数","波次中包裹数","波次完成包裹数","拣货中包裹数","拣货完成包裹数","复核中包裹数","复核完成包裹数","打包中包裹数","打包完成包裹数","称重完成包裹数","揽收包裹数","已发货未揽收包裹数","揽收达成率","首中心到达包裹数","首中心未到达包裹数","配送中包裹数","已签收包裹数","推单件数","推单包裹客单件","推单批量包裹数","推单散单包裹数","推单包裹批量单占比","未发包裹件数","未发包裹客单件","未发批量包裹数","未发散单包裹数","未发包裹批量单占比","已发包裹件数","已发包裹客单件","已发批量包裹数","已发散单包裹数","已发包裹批量单占比","取消单包裹占比","待处理包裹客单件","待处理批量包裹数","待处理散单包裹数","待处理包裹批量单占比","预处理完成包裹客单件","预处理完成批量包裹数","预处理完成散单包裹数","预处理完成包裹批量单占比","波次中包裹客单件","波次中批量包裹数","波次中散单包裹数","波次中包裹批量单占比","波次完成包裹客单件","波次完成批量包裹数","波次完成散单包裹数","波次完成包裹批量单占比","拣货中包裹客单件","拣货中批量包裹数","拣货中散单包裹数","拣货中包裹批量单占比","拣货完成包裹客单件","拣货完成批量包裹数","拣货完成散单包裹数","拣货完成包裹批量单占比","复核中包裹客单件","复核中批量包裹数","复核中散单包裹数","复核中包裹批量单占比","复核完成包裹客单件","复核完成批量包裹数","复核完成散单包裹数","复核完成包裹批量单占比","打包中包裹客单件","打包中批量包裹数","打包中散单包裹数","打包中包裹批量单占比","打包完成包裹客单件","打包完成批量包裹数","打包完成散单包裹数","打包完成包裹批量单占比","称重完成包裹客单件","称重完成批量包裹数","称重完成散单包裹数","称重完成包裹批量单占比","实际批量单客单件","实际批量单SKU数","实际散单客单件","实际散单SKU数"],"pageNum":1,"pageSize":20}}
19
+ // {
20
+ // "total": 37,
21
+ // "size": 20,
22
+ // "page": 1,
23
+ // "data": [
24
+ // {
25
+ // "businessCaliber": "指标定义:取消单包裹数量\n数据来源:仓配一体来自SCM\\/WMS, 快进快出来自景天导入",
26
+ // "qtaName": "取消包裹数",
27
+ // "dataSource": ""
28
+ // },
29
+ // ]
30
+ // }
31
+ var ZDataStatDescription = function ZDataStatDescription(props) {
32
+ var _props$columns = props.columns,
33
+ columns = _props$columns === void 0 ? [] : _props$columns,
34
+ _props$qtaName = props.qtaName,
35
+ qtaName = _props$qtaName === void 0 ? [] : _props$qtaName,
36
+ _props$title = props.title,
37
+ title = _props$title === void 0 ? '指标说明' : _props$title,
38
+ _props$tooltip = props.tooltip,
39
+ tooltip = _props$tooltip === void 0 ? '点击查看本页面所有指标相关口径、来源、责任部门' : _props$tooltip,
40
+ _props$dataSetName = props.dataSetName,
41
+ dataSetName = _props$dataSetName === void 0 ? 'getBusinessCaliberList' : _props$dataSetName,
42
+ _transformRequestData = props.transformRequestData,
43
+ _props$width = props.width,
44
+ width = _props$width === void 0 ? 620 : _props$width;
45
+ var rcConfigContextValue = (0, _react.useContext)(_rcPro.RcConfigContext);
46
+ var tableRef = (0, _react.useRef)(null);
47
+ var _useState = (0, _react.useState)(false),
48
+ open = _useState[0],
49
+ setOpen = _useState[1];
50
+ var openDrawer = /*#__PURE__*/function () {
51
+ var _ref = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee() {
52
+ return _regenerator["default"].wrap(function _callee$(_context) {
53
+ while (1) switch (_context.prev = _context.next) {
54
+ case 0:
55
+ // if (!qtaName) {
56
+ // return message.error('请配置查询指标');
57
+ // }
58
+ // let tempQta_name = [];
59
+ // if (typeof qtaName === 'function') {
60
+ // const { index: QtaArr } = await qtaName?.();
61
+ // tempQta_name = QtaArr;
62
+ // } else {
63
+ // tempQta_name = [...new Set((qtaName || []).map((e: any) => e?.name || e?.description))];
64
+ // }
65
+ // setQta_name(tempQta_name);
66
+
67
+ // setTimeout(() => {
68
+ setOpen(true);
69
+ // tableRef.current?.refreshTable();
70
+ // }, 0);
71
+ case 1:
72
+ case "end":
73
+ return _context.stop();
74
+ }
75
+ }, _callee);
76
+ }));
77
+ return function openDrawer() {
78
+ return _ref.apply(this, arguments);
79
+ };
80
+ }();
81
+ return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_rcPro.ProButton, {
82
+ items: [{
83
+ name: title,
84
+ action: 'xxx',
85
+ onClick: openDrawer,
86
+ props: {
87
+ type: 'link',
88
+ color: 'default',
89
+ icon: /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
90
+ title: tooltip
91
+ }, /*#__PURE__*/_react["default"].createElement(_icons.InfoCircleOutlined, null))
92
+ }
93
+ }]
94
+ }), /*#__PURE__*/_react["default"].createElement(_drawer["default"], {
95
+ width: width,
96
+ destroyOnClose: true,
97
+ title: title,
98
+ visible: open,
99
+ open: open,
100
+ onClose: function onClose() {
101
+ return setOpen(false);
102
+ }
103
+ }, /*#__PURE__*/_react["default"].createElement(_rcPro.ProTable, {
104
+ ref: tableRef,
105
+ config: {
106
+ manual: false,
107
+ request: function () {
108
+ var _request = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(_ref2) {
109
+ var pagination, newPagination, _qtaName;
110
+ return _regenerator["default"].wrap(function _callee2$(_context2) {
111
+ while (1) switch (_context2.prev = _context2.next) {
112
+ case 0:
113
+ pagination = _ref2.pagination;
114
+ newPagination = {
115
+ pageNum: pagination === null || pagination === void 0 ? void 0 : pagination.current,
116
+ pageSize: pagination === null || pagination === void 0 ? void 0 : pagination.pageSize
117
+ };
118
+ _qtaName = qtaName || [];
119
+ if (!(typeof qtaName === 'function')) {
120
+ _context2.next = 10;
121
+ break;
122
+ }
123
+ _context2.next = 6;
124
+ return qtaName === null || qtaName === void 0 ? void 0 : qtaName();
125
+ case 6:
126
+ _context2.t0 = _context2.sent;
127
+ if (_context2.t0) {
128
+ _context2.next = 9;
129
+ break;
130
+ }
131
+ _context2.t0 = [];
132
+ case 9:
133
+ _qtaName = _context2.t0;
134
+ case 10:
135
+ _context2.next = 12;
136
+ return (0, _util.getReportData)((0, _extends2["default"])({
137
+ dataSetName: dataSetName,
138
+ qta_name: [].concat(new Set(_qtaName))
139
+ }, newPagination), {
140
+ request: rcConfigContextValue.materialsRequest,
141
+ env: rcConfigContextValue.env
142
+ });
143
+ case 12:
144
+ return _context2.abrupt("return", _context2.sent);
145
+ case 13:
146
+ case "end":
147
+ return _context2.stop();
148
+ }
149
+ }, _callee2);
150
+ }));
151
+ function request(_x) {
152
+ return _request.apply(this, arguments);
153
+ }
154
+ return request;
155
+ }(),
156
+ transformRequestData: function transformRequestData(data) {
157
+ if (_transformRequestData) {
158
+ return _transformRequestData(data);
159
+ }
160
+ return (data || []).map(function (e, index) {
161
+ return (0, _extends2["default"])({
162
+ id: index
163
+ }, e);
164
+ });
165
+ },
166
+ size: 'small',
167
+ rowKey: 'id',
168
+ columns: columns,
169
+ toolBars: false,
170
+ hideDefRowSelection: true,
171
+ showIndex: true,
172
+ isDynamicHeight: true
173
+ }
174
+ })));
175
+ };
176
+ var _default = exports["default"] = ZDataStatDescription;
@@ -1,12 +1,16 @@
1
1
  import React from 'react';
2
2
  import type { DataTableInstance, DataTableProps } from '@ztocwst/rc-pro';
3
3
  import type { tabsSettingProps } from '../../data-common';
4
+ import { TypeZDataStatDescriptionProps } from '../../../z-data-stat-description';
4
5
  export interface ChartRendererProps {
5
- chartSetting?: DataTableProps | DataTableProps[] | React.ReactNode;
6
+ chartSetting?: DataTableProps | (DataTableProps & {
7
+ showIndexInfo: boolean;
8
+ indexInfo: TypeZDataStatDescriptionProps;
9
+ }[]) | React.ReactNode;
6
10
  tabsSetting?: tabsSettingProps;
7
11
  chartRenderRef?: React.Ref<DataTableInstance>;
8
12
  /** 确认 */
9
13
  onConfirm?: () => void;
10
14
  }
11
- declare const ChartRenderer: ({ chartRenderRef, tabsSetting, chartSetting, onConfirm }: ChartRendererProps) => any;
15
+ declare const ChartRenderer: ({ chartRenderRef, tabsSetting, chartSetting, onConfirm, }: ChartRendererProps) => any;
12
16
  export default ChartRenderer;
@@ -9,8 +9,32 @@ var _react = _interopRequireWildcard(require("react"));
9
9
  var _rcPro = require("@ztocwst/rc-pro");
10
10
  var _DataTable = require("@ztocwst/rc-pro/es/components/DataTable/DataTable.helper");
11
11
  var _dataCommon = require("../../data-common.helper");
12
+ var _zDataStatDescription = _interopRequireDefault(require("../../../z-data-stat-description"));
12
13
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
13
14
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
15
+ // 根据activeKey获取当前tab的chartSetting
16
+ var getSettingByActiveKey = function getSettingByActiveKey(chartSetting, activeKey) {
17
+ // 目前只考虑tabs情况
18
+ if (Array.isArray(chartSetting) && activeKey) {
19
+ var _activeKey$split = activeKey.split(_dataCommon.separator),
20
+ index = _activeKey$split[1];
21
+ return chartSetting[index];
22
+ }
23
+ return chartSetting;
24
+ };
25
+
26
+ // 获取指标集合
27
+ var getIndexData = function getIndexData(chartSetting, activeKey) {
28
+ // 目前只考虑tabs情况
29
+ if (Array.isArray(chartSetting) && activeKey) {
30
+ var _current$indexJson, _current$indexJson$da;
31
+ var current = getSettingByActiveKey(chartSetting, activeKey);
32
+ return (current === null || current === void 0 ? void 0 : (_current$indexJson = current.indexJson) === null || _current$indexJson === void 0 ? void 0 : (_current$indexJson$da = _current$indexJson.data) === null || _current$indexJson$da === void 0 ? void 0 : _current$indexJson$da.map(function (e) {
33
+ return e.name;
34
+ })) || [];
35
+ }
36
+ return [];
37
+ };
14
38
  var ChartRenderer = function ChartRenderer(_ref) {
15
39
  var chartRenderRef = _ref.chartRenderRef,
16
40
  tabsSetting = _ref.tabsSetting,
@@ -105,10 +129,26 @@ var ChartRenderer = function ChartRenderer(_ref) {
105
129
  if (isArray && !chartSetting.every(function (e) {
106
130
  return /*#__PURE__*/_react["default"].isValidElement(e);
107
131
  })) {
132
+ var getExtraContent = function getExtraContent() {
133
+ var _setting$indexInfo;
134
+ var setting = getSettingByActiveKey(chartSetting, activeKey);
135
+ if (!(setting !== null && setting !== void 0 && setting.showIndexInfo)) {
136
+ return null;
137
+ }
138
+ var qtaName = getIndexData(chartSetting, activeKey);
139
+ if (typeof (setting === null || setting === void 0 ? void 0 : (_setting$indexInfo = setting.indexInfo) === null || _setting$indexInfo === void 0 ? void 0 : _setting$indexInfo.qtaName) === 'function') {
140
+ var _setting$indexInfo2;
141
+ qtaName = setting === null || setting === void 0 ? void 0 : (_setting$indexInfo2 = setting.indexInfo) === null || _setting$indexInfo2 === void 0 ? void 0 : _setting$indexInfo2.qtaName(qtaName);
142
+ }
143
+ return /*#__PURE__*/_react["default"].createElement(_zDataStatDescription["default"], (0, _extends2["default"])({}, setting.indexInfo, {
144
+ qtaName: qtaName
145
+ }));
146
+ };
108
147
  return /*#__PURE__*/_react["default"].createElement(_tabs["default"], (0, _extends2["default"])({}, tabsProps, {
109
148
  activeKey: activeKey,
110
149
  onTabClick: onTabClick,
111
- onChange: handleTabsChange
150
+ onChange: handleTabsChange,
151
+ tabBarExtraContent: getExtraContent()
112
152
  }), chartSetting === null || chartSetting === void 0 ? void 0 : chartSetting.map(function (e, i) {
113
153
  return /*#__PURE__*/_react["default"].createElement(_tabs["default"].TabPane, {
114
154
  tab: "" + ((e === null || e === void 0 ? void 0 : e.title) || ''),