@bit-sun/business-component 4.0.13-alpha.12 → 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,
@@ -17915,7 +17926,7 @@ var BsSulaQueryTable = (function (props) {
17915
17926
  }
17916
17927
  });
17917
17928
  }
17918
- handleBssulaColumnsSpecialParams(d);
17929
+ // handleBssulaColumnsSpecialParams(d);
17919
17930
  });
17920
17931
  setCommonRenderFn(props.columns);
17921
17932
  var authButton = localStorage.getItem(getMenuAuthDataKey()) ? JSON.parse(localStorage.getItem(getMenuAuthDataKey())) : [];
@@ -17945,7 +17956,7 @@ var BsSulaQueryTable = (function (props) {
17945
17956
  var showColumns = getSettingFieldOrColumn(isReset ? [] : columnConfig, columns, 'columns');
17946
17957
  showColumns.forEach(function (item, index) {
17947
17958
  item.width = item.width || getItemDefaultWidth(item);
17948
- handleBssulaColumnsSpecialParams(item);
17959
+ // handleBssulaColumnsSpecialParams(item);
17949
17960
  item.onHeaderCell = function (column) {
17950
17961
  return _objectSpread2(_objectSpread2({}, item), {}, {
17951
17962
  width: typeof column.width === 'number' ? column.width : parseWidth(column.width),
@@ -17958,7 +17969,7 @@ var BsSulaQueryTable = (function (props) {
17958
17969
  var showExportColumns = getSettingFieldOrColumn(exportColumnConfig, columns, 'columns');
17959
17970
  showExportColumns.forEach(function (item, index) {
17960
17971
  item.width = item.width || getItemDefaultWidth(item);
17961
- handleBssulaColumnsSpecialParams(item);
17972
+ // handleBssulaColumnsSpecialParams(item);
17962
17973
  item.onHeaderCell = function (column) {
17963
17974
  return _objectSpread2(_objectSpread2({}, item), {}, {
17964
17975
  width: typeof column.width === 'number' ? column.width : parseInt(column.width.replace('px', '')),
@@ -18185,9 +18196,9 @@ var BsSulaQueryTable = (function (props) {
18185
18196
  newColumns[index] = _objectSpread2(_objectSpread2({}, newColumns[index]), {}, {
18186
18197
  width: size.width
18187
18198
  });
18188
- newColumns.forEach(function (d) {
18189
- handleBssulaColumnsSpecialParams(d);
18190
- });
18199
+ // newColumns.forEach((d: any) => {
18200
+ // handleBssulaColumnsSpecialParams(d);
18201
+ // });
18191
18202
  return _toConsumableArray(newColumns);
18192
18203
  });
18193
18204
  };
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,
@@ -17938,7 +17949,7 @@ var BsSulaQueryTable = (function (props) {
17938
17949
  }
17939
17950
  });
17940
17951
  }
17941
- handleBssulaColumnsSpecialParams(d);
17952
+ // handleBssulaColumnsSpecialParams(d);
17942
17953
  });
17943
17954
  setCommonRenderFn(props.columns);
17944
17955
  var authButton = localStorage.getItem(getMenuAuthDataKey()) ? JSON.parse(localStorage.getItem(getMenuAuthDataKey())) : [];
@@ -17968,7 +17979,7 @@ var BsSulaQueryTable = (function (props) {
17968
17979
  var showColumns = getSettingFieldOrColumn(isReset ? [] : columnConfig, columns, 'columns');
17969
17980
  showColumns.forEach(function (item, index) {
17970
17981
  item.width = item.width || getItemDefaultWidth(item);
17971
- handleBssulaColumnsSpecialParams(item);
17982
+ // handleBssulaColumnsSpecialParams(item);
17972
17983
  item.onHeaderCell = function (column) {
17973
17984
  return _objectSpread2(_objectSpread2({}, item), {}, {
17974
17985
  width: typeof column.width === 'number' ? column.width : parseWidth(column.width),
@@ -17981,7 +17992,7 @@ var BsSulaQueryTable = (function (props) {
17981
17992
  var showExportColumns = getSettingFieldOrColumn(exportColumnConfig, columns, 'columns');
17982
17993
  showExportColumns.forEach(function (item, index) {
17983
17994
  item.width = item.width || getItemDefaultWidth(item);
17984
- handleBssulaColumnsSpecialParams(item);
17995
+ // handleBssulaColumnsSpecialParams(item);
17985
17996
  item.onHeaderCell = function (column) {
17986
17997
  return _objectSpread2(_objectSpread2({}, item), {}, {
17987
17998
  width: typeof column.width === 'number' ? column.width : parseInt(column.width.replace('px', '')),
@@ -18208,9 +18219,9 @@ var BsSulaQueryTable = (function (props) {
18208
18219
  newColumns[index] = _objectSpread2(_objectSpread2({}, newColumns[index]), {}, {
18209
18220
  width: size.width
18210
18221
  });
18211
- newColumns.forEach(function (d) {
18212
- handleBssulaColumnsSpecialParams(d);
18213
- });
18222
+ // newColumns.forEach((d: any) => {
18223
+ // handleBssulaColumnsSpecialParams(d);
18224
+ // });
18214
18225
  return _toConsumableArray(newColumns);
18215
18226
  });
18216
18227
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bit-sun/business-component",
3
- "version": "4.0.13-alpha.12",
3
+ "version": "4.0.13-alpha.14",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -370,7 +370,7 @@ export default (props: any) => {
370
370
  }
371
371
  });
372
372
  }
373
- handleBssulaColumnsSpecialParams(d);
373
+ // handleBssulaColumnsSpecialParams(d);
374
374
  });
375
375
  setCommonRenderFn(props.columns);
376
376
  const authButton = localStorage.getItem(getMenuAuthDataKey())
@@ -405,7 +405,7 @@ export default (props: any) => {
405
405
 
406
406
  showColumns.forEach((item, index) => {
407
407
  item.width = item.width || getItemDefaultWidth(item);
408
- handleBssulaColumnsSpecialParams(item);
408
+ // handleBssulaColumnsSpecialParams(item);
409
409
  item.onHeaderCell = (column) => ({
410
410
  ...item,
411
411
  width:
@@ -429,7 +429,7 @@ export default (props: any) => {
429
429
 
430
430
  showExportColumns.forEach((item, index) => {
431
431
  item.width = item.width || getItemDefaultWidth(item);
432
- handleBssulaColumnsSpecialParams(item);
432
+ // handleBssulaColumnsSpecialParams(item);
433
433
  item.onHeaderCell = (column) => ({
434
434
  ...item,
435
435
  width:
@@ -715,9 +715,9 @@ export default (props: any) => {
715
715
  ...newColumns[index],
716
716
  width: size.width,
717
717
  };
718
- newColumns.forEach((d: any) => {
719
- handleBssulaColumnsSpecialParams(d);
720
- });
718
+ // newColumns.forEach((d: any) => {
719
+ // handleBssulaColumnsSpecialParams(d);
720
+ // });
721
721
  return [...newColumns];
722
722
  });
723
723
  };
@@ -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}