@zgfe/modules-attribution 1.1.5 → 1.1.6-alpha.0

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.
@@ -1,18 +1,13 @@
1
1
  import React from 'react';
2
2
  import { Table } from 'antd';
3
3
  import './styles/index.less';
4
- import empty from '../../images/empty.png';
5
4
  var TableList = function TableList(props) {
6
5
  var classPrefix = 'table-list';
7
6
  var tableDataList = props.tableDataList,
8
7
  total = props.total;
9
8
  return /*#__PURE__*/React.createElement("div", {
10
9
  className: classPrefix
11
- }, !tableDataList.dataSource && !props.loading && /*#__PURE__*/React.createElement("div", {
12
- className: "".concat(classPrefix, "-empty-tips")
13
- }, /*#__PURE__*/React.createElement("img", {
14
- src: empty
15
- }), /*#__PURE__*/React.createElement("p", null, "\u8BF7\u9009\u62E9\u6761\u4EF6\u8FDB\u884C\u67E5\u8BE2")), (tableDataList.dataSource || props.loading) && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Table, {
10
+ }, /*#__PURE__*/React.createElement(Table, {
16
11
  dataSource: tableDataList.dataSource,
17
12
  columns: tableDataList.columns,
18
13
  rowKey: "key",
@@ -24,6 +19,6 @@ var TableList = function TableList(props) {
24
19
  showSizeChanger: total > 10
25
20
  },
26
21
  loading: props.loading
27
- })));
22
+ }));
28
23
  };
29
24
  export default TableList;
@@ -8,13 +8,13 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
8
8
  function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
9
9
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
10
10
  import React, { useContext, useEffect, useState } from 'react';
11
+ import { Empty } from 'antd';
11
12
  import request from '../../utils/request';
12
13
  import { Apis } from '../../constants';
13
14
  import { BizGlobalDataContext } from '@zgfe/business-lib';
14
15
  import { TableList } from '../../components';
15
16
  import { handleTableData } from '../content/utils';
16
17
  var AttributeChart = function AttributeChart(props) {
17
- console.log('AttributeChart', props);
18
18
  var _useState = useState(false),
19
19
  _useState2 = _slicedToArray(_useState, 2),
20
20
  loading = _useState2[0],
@@ -61,6 +61,12 @@ var AttributeChart = function AttributeChart(props) {
61
61
  setLoading(false);
62
62
  });
63
63
  };
64
+ if (!tableDataList.dataSource.length || !tableDataList.columns.length) {
65
+ return /*#__PURE__*/React.createElement(Empty, {
66
+ image: Empty.PRESENTED_IMAGE_SIMPLE,
67
+ description: "\u6682\u65E0\u6570\u636E"
68
+ });
69
+ }
64
70
  return /*#__PURE__*/React.createElement(TableList, {
65
71
  total: total,
66
72
  tableDataList: tableDataList,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/modules-attribution",
3
- "version": "1.1.5",
3
+ "version": "1.1.6-alpha.0",
4
4
  "module": "es/index.js",
5
5
  "typings": "es/index.d.ts",
6
6
  "files": [
@@ -50,5 +50,5 @@
50
50
  "react": "^16.12.0 || ^17.0.0",
51
51
  "yorkie": "^2.0.0"
52
52
  },
53
- "gitHead": "e7cefbd3c53e261d2de675a225d30b7a57f3b844"
53
+ "gitHead": "ce3dee788ff8ef90a906a29debd02cce9dfa35e3"
54
54
  }