@bit-sun/business-component 4.0.13-alpha.13 → 4.0.13-alpha.14

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/dist/index.esm.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import axios from 'axios';
2
2
  import request$1 from 'umi-request';
3
3
  import cookie from 'js-cookie';
4
- import { message as message$1, Tooltip, Image, Popover, Card, Avatar, Badge, Menu, Input, InputNumber, Space, Button, Dropdown, Upload, Checkbox, Modal, ConfigProvider, Tag, Select, Spin, Form, Table, Row, Col, Tabs, TreeSelect, Typography, Alert, Breadcrumb, Drawer as Drawer$1, List, Radio, Tree, Result, Affix, Cascader, DatePicker, TimePicker, Divider, Switch, Collapse } from 'antd';
4
+ import { message as message$1, Tooltip, Image, Popover, Card, Avatar, Badge, Menu, Input, InputNumber, Space, Button, Dropdown, Upload, Checkbox, Modal, ConfigProvider, Tag, Select, Spin, Form, Table, Empty, Row, Col, Tabs, TreeSelect, Typography, Alert, Breadcrumb, Drawer as Drawer$1, List, Radio, Tree, Result, Affix, Cascader, DatePicker, TimePicker, Divider, Switch, Collapse } from 'antd';
5
5
  import _, { omit, uniqBy, escapeRegExp, isNil, debounce, cloneDeep as cloneDeep$1, throttle, isEmpty } from 'lodash';
6
6
  import memoizeOne from 'memoize-one';
7
7
  import { formatMessage, history, useLocation, Link, useModel, setLocale, useIntl, request as request$3 } from 'umi';
@@ -6060,9 +6060,20 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
6060
6060
  var viCount = (modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.visibleFieldsCount) || defaultVisibleFieldsCount;
6061
6061
  return collapsed ? formItem(list === null || list === void 0 ? void 0 : list.slice(0, viCount)) : formItem(list);
6062
6062
  };
6063
+ var renderEmptyText = function renderEmptyText(text, x) {
6064
+ return /*#__PURE__*/React$1.createElement(Empty, {
6065
+ image: Empty.PRESENTED_IMAGE_SIMPLE,
6066
+ description: text,
6067
+ style: {
6068
+ margin: "".concat(x, " 0px")
6069
+ }
6070
+ });
6071
+ };
6063
6072
  var renderShowTable = function renderShowTable(tableList, type) {
6064
6073
  var tableBoxHeighth = getTableHeigth(modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.tableSearchForm);
6065
- var oSY = "calc(100vh - ".concat(tableBoxHeighth, "px - 82px)"); // 分页 24+16*2+10 「高 + margin * 2 + paddingBottom 10 」
6074
+ var x = (tableList === null || tableList === void 0 ? void 0 : tableList.length) ? 82 : 28; // 无数据没有分页,有数据计算减去:分页 24+16*2+10 「高 + margin * 2 + paddingBottom 10 」
6075
+ var oSY = "calc(100vh - ".concat(tableBoxHeighth, "px - ").concat(x, "px)");
6076
+ var mTB = "calc(50vh - ".concat(tableBoxHeighth / 2, "px - ").concat(x / 2, "px - 40px)");
6066
6077
  return /*#__PURE__*/React$1.createElement("div", {
6067
6078
  style: {
6068
6079
  height: "calc(100vh - ".concat(tableBoxHeighth, "px)")
@@ -6078,14 +6089,14 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
6078
6089
  showSizeChanger: false
6079
6090
  }),
6080
6091
  locale: {
6081
- emptyText: '暂无已选结果'
6092
+ emptyText: renderEmptyText('暂无已选结果', mTB)
6082
6093
  }
6083
6094
  } : {
6084
6095
  pagination: tablePagination,
6085
6096
  onChange: handleTableChange,
6086
6097
  loading: fetching,
6087
6098
  locale: {
6088
- emptyText: modalSearched ? '无匹配结果,请更换其他内容再试' : '请输入搜索条件'
6099
+ emptyText: modalSearched ? renderEmptyText('匹配结果,请更换其他内容再试', mTB) : renderEmptyText('请输入搜索条件', mTB)
6089
6100
  }
6090
6101
  }), {}, {
6091
6102
  rowKey: mappingValueField,
package/dist/index.js CHANGED
@@ -6083,9 +6083,20 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
6083
6083
  var viCount = (modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.visibleFieldsCount) || defaultVisibleFieldsCount;
6084
6084
  return collapsed ? formItem(list === null || list === void 0 ? void 0 : list.slice(0, viCount)) : formItem(list);
6085
6085
  };
6086
+ var renderEmptyText = function renderEmptyText(text, x) {
6087
+ return /*#__PURE__*/React__default['default'].createElement(antd.Empty, {
6088
+ image: antd.Empty.PRESENTED_IMAGE_SIMPLE,
6089
+ description: text,
6090
+ style: {
6091
+ margin: "".concat(x, " 0px")
6092
+ }
6093
+ });
6094
+ };
6086
6095
  var renderShowTable = function renderShowTable(tableList, type) {
6087
6096
  var tableBoxHeighth = getTableHeigth(modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.tableSearchForm);
6088
- var oSY = "calc(100vh - ".concat(tableBoxHeighth, "px - 82px)"); // 分页 24+16*2+10 「高 + margin * 2 + paddingBottom 10 」
6097
+ var x = (tableList === null || tableList === void 0 ? void 0 : tableList.length) ? 82 : 28; // 无数据没有分页,有数据计算减去:分页 24+16*2+10 「高 + margin * 2 + paddingBottom 10 」
6098
+ var oSY = "calc(100vh - ".concat(tableBoxHeighth, "px - ").concat(x, "px)");
6099
+ var mTB = "calc(50vh - ".concat(tableBoxHeighth / 2, "px - ").concat(x / 2, "px - 40px)");
6089
6100
  return /*#__PURE__*/React__default['default'].createElement("div", {
6090
6101
  style: {
6091
6102
  height: "calc(100vh - ".concat(tableBoxHeighth, "px)")
@@ -6101,14 +6112,14 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
6101
6112
  showSizeChanger: false
6102
6113
  }),
6103
6114
  locale: {
6104
- emptyText: '暂无已选结果'
6115
+ emptyText: renderEmptyText('暂无已选结果', mTB)
6105
6116
  }
6106
6117
  } : {
6107
6118
  pagination: tablePagination,
6108
6119
  onChange: handleTableChange,
6109
6120
  loading: fetching,
6110
6121
  locale: {
6111
- emptyText: modalSearched ? '无匹配结果,请更换其他内容再试' : '请输入搜索条件'
6122
+ emptyText: modalSearched ? renderEmptyText('匹配结果,请更换其他内容再试', mTB) : renderEmptyText('请输入搜索条件', mTB)
6112
6123
  }
6113
6124
  }), {}, {
6114
6125
  rowKey: mappingValueField,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bit-sun/business-component",
3
- "version": "4.0.13-alpha.13",
3
+ "version": "4.0.13-alpha.14",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -1,7 +1,7 @@
1
1
  // @ts-nocheck
2
2
  import React, { useState, useEffect, forwardRef, useImperativeHandle } from 'react';
3
3
  import { useDebounceFn } from 'ahooks';
4
- import { Input, Button, Modal, Select, Divider, message, Spin, Form, Table, Checkbox, TreeSelect, Tooltip, Tag, Row, Col, Space, Tabs } from 'antd';
4
+ import { Input, Button, Modal, Select, Divider, message, Spin, Form, Table, Checkbox, TreeSelect, Tooltip, Tag, Row, Col, Space, Tabs, Empty } from 'antd';
5
5
  import { SearchOutlined, CopyOutlined, CaretLeftOutlined } from '@ant-design/icons';
6
6
  import request from '@/utils/request';
7
7
  import _, { escapeRegExp, isNil, values } from "lodash"
@@ -667,9 +667,15 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
667
667
  return collapsed ? formItem(list?.slice(0,viCount)) : formItem(list)
668
668
  }
669
669
 
670
+ const renderEmptyText = (text: string,x: string) => {
671
+ return <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} description={text} style={{ margin: `${x} 0px`}} />
672
+ }
673
+
670
674
  const renderShowTable = (tableList, type) => {
671
675
  const tableBoxHeighth = getTableHeigth(modalTableProps?.tableSearchForm);
672
- const oSY = `calc(100vh - ${tableBoxHeighth}px - 82px)`; // 分页 24+16*2+10 「高 + margin * 2 + paddingBottom 10 」
676
+ const x = tableList?.length ? 82 : 28; // 无数据没有分页,有数据计算减去:分页 24+16*2+10 「高 + margin * 2 + paddingBottom 10 」
677
+ const oSY = `calc(100vh - ${tableBoxHeighth}px - ${x}px)`;
678
+ const mTB = `calc(50vh - ${tableBoxHeighth/2}px - ${x/2}px - 40px)`
673
679
  return (
674
680
  <div style={{ height: `calc(100vh - ${tableBoxHeighth}px)` }}>
675
681
  <Table
@@ -681,14 +687,14 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
681
687
  {...type=='noPage'?{
682
688
  pagination: { ...initPagination,showSizeChanger: false },
683
689
  locale: {
684
- emptyText: '暂无已选结果',
690
+ emptyText: renderEmptyText('暂无已选结果',mTB),
685
691
  }
686
692
  }:{
687
693
  pagination: tablePagination,
688
694
  onChange: handleTableChange,
689
695
  loading: fetching,
690
696
  locale: {
691
- emptyText: modalSearched? '无匹配结果,请更换其他内容再试' : '请输入搜索条件',
697
+ emptyText: modalSearched? renderEmptyText('匹配结果,请更换其他内容再试',mTB) : renderEmptyText('请输入搜索条件',mTB),
692
698
  }
693
699
  }}
694
700
  rowKey={mappingValueField}