@bit-sun/business-component 4.0.13-alpha.16 → 4.0.13-alpha.18

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.
@@ -4,9 +4,10 @@ export declare const columnsPerRow = 4;
4
4
  export declare const ColSpan = 6;
5
5
  export declare const handleSourceName: (sName: any) => any;
6
6
  export declare const makeUniqueValue: () => string;
7
- export declare const getFormRowInfo: (list: any) => {
7
+ export declare const getFormRowInfo: (list: any, tableSearchColSpan: number) => {
8
8
  totalRows: number;
9
9
  emptyArray: any[];
10
+ ColSpan: number;
10
11
  };
11
12
  export declare const defaultVisibleFieldsCount = 7;
12
13
  export declare const getVisibleFieldsCount: (modalTableProps: any) => any;
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, 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';
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, DatePicker, Typography, Alert, Breadcrumb, Drawer as Drawer$1, List, Radio, Tree, Result, Affix, Cascader, 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';
@@ -4092,14 +4092,16 @@ var makeUniqueValue = function makeUniqueValue() {
4092
4092
  return generateUnitKey;
4093
4093
  };
4094
4094
  // ------------------------------------------处理样式相关--开始----------------------------------------
4095
- var getFormRowInfo = function getFormRowInfo(list) {
4096
- var totalRows = Math.ceil(list.length / columnsPerRow); // 计算总行数
4097
- var lastRowColumns = (list.length + 1) % columnsPerRow; // 计算最后一行的实际列数
4098
- var emptySlots = lastRowColumns === 0 ? 0 : columnsPerRow - lastRowColumns; // 计算最后一行的空位数
4095
+ var getFormRowInfo = function getFormRowInfo(list, tableSearchColSpan) {
4096
+ var lastColumnsPerRow = tableSearchColSpan == 6 ? columnsPerRow : 3;
4097
+ var totalRows = Math.ceil(list.length / lastColumnsPerRow); // 计算总行数
4098
+ var lastRowColumns = (list.length + 1) % lastColumnsPerRow; // 计算最后一行的实际列数
4099
+ var emptySlots = lastRowColumns === 0 ? 0 : lastColumnsPerRow - lastRowColumns; // 计算最后一行的空位数
4099
4100
  var emptyArray = new Array(emptySlots).fill(null); // 生成长度为 emptySlots 的数组
4100
4101
  return {
4101
4102
  totalRows: totalRows,
4102
- emptyArray: emptyArray
4103
+ emptyArray: emptyArray,
4104
+ ColSpan: tableSearchColSpan !== null && tableSearchColSpan !== void 0 ? tableSearchColSpan : ColSpan
4103
4105
  };
4104
4106
  };
4105
4107
  var defaultVisibleFieldsCount = 7;
@@ -5559,7 +5561,7 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
5559
5561
  pageSize: pageSize,
5560
5562
  currentPage: currentPage
5561
5563
  }, otherParams), fixedParam), params);
5562
- if (isNil(queryParams[selectParamsKey])) {
5564
+ if (isNil(queryParams[selectParamsKey]) && (searchValue === null || searchValue === void 0 ? void 0 : searchValue.length)) {
5563
5565
  queryParams[selectParamsKey] = searchValue;
5564
5566
  }
5565
5567
  var getRequest;
@@ -5926,15 +5928,16 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
5926
5928
  return false;
5927
5929
  }
5928
5930
  };
5929
- var _getFormRowInfo = getFormRowInfo(list),
5930
- emptyArray = _getFormRowInfo.emptyArray;
5931
+ var _getFormRowInfo = getFormRowInfo(list, modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.tableSearchColSpan),
5932
+ emptyArray = _getFormRowInfo.emptyArray,
5933
+ ColSpan = _getFormRowInfo.ColSpan;
5931
5934
  var addKong = (emptyArray === null || emptyArray === void 0 ? void 0 : emptyArray.map(function (i) {
5932
5935
  return {
5933
5936
  type: 'kong'
5934
5937
  };
5935
5938
  })) || [];
5936
5939
  return list === null || list === void 0 ? void 0 : (_list$concat = list.concat(addKong)) === null || _list$concat === void 0 ? void 0 : _list$concat.map(function (i, index) {
5937
- var _i$field, _i$field3, _i$field5, _i$field6, _i$field7, _i$field8, _i$field9;
5940
+ var _i$field, _i$field3, _i$field5, _i$field7, _i$field9, _i$field10, _i$field11, _i$field12, _i$field13;
5938
5941
  if ((i === null || i === void 0 ? void 0 : i.type) === 'kong') return /*#__PURE__*/React$1.createElement(Col, {
5939
5942
  span: ColSpan,
5940
5943
  key: i
@@ -5983,7 +5986,44 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
5983
5986
  disabled: setDisabled(i.name)
5984
5987
  }))));
5985
5988
  }
5986
- if ((i === null || i === void 0 ? void 0 : i.type) === 'businessSearchSelect' || (i === null || i === void 0 ? void 0 : (_i$field5 = i.field) === null || _i$field5 === void 0 ? void 0 : _i$field5.type) === 'businessSearchSelect') {
5989
+ if ((i === null || i === void 0 ? void 0 : i.type) === 'rangepicker' || (i === null || i === void 0 ? void 0 : (_i$field5 = i.field) === null || _i$field5 === void 0 ? void 0 : _i$field5.type) === 'rangepicker') {
5990
+ var _i$initialValue, _i$field6;
5991
+ return /*#__PURE__*/React$1.createElement(Col, {
5992
+ span: ColSpan,
5993
+ key: i.name
5994
+ }, /*#__PURE__*/React$1.createElement(Form.Item, {
5995
+ name: i.name,
5996
+ label: i.label,
5997
+ key: i.name,
5998
+ initialValue: (_i$initialValue = i === null || i === void 0 ? void 0 : i.initialValue) !== null && _i$initialValue !== void 0 ? _i$initialValue : []
5999
+ }, /*#__PURE__*/React$1.createElement(DatePicker.RangePicker, _objectSpread2(_objectSpread2({
6000
+ style: {
6001
+ width: '100%'
6002
+ },
6003
+ placeholder: "\u8BF7\u9009\u62E9"
6004
+ }, i === null || i === void 0 ? void 0 : (_i$field6 = i.field) === null || _i$field6 === void 0 ? void 0 : _i$field6.props), {}, {
6005
+ disabled: setDisabled(i.name)
6006
+ }))));
6007
+ }
6008
+ if ((i === null || i === void 0 ? void 0 : i.type) === 'datepicker' || (i === null || i === void 0 ? void 0 : (_i$field7 = i.field) === null || _i$field7 === void 0 ? void 0 : _i$field7.type) === 'datepicker') {
6009
+ var _i$field8;
6010
+ return /*#__PURE__*/React$1.createElement(Col, {
6011
+ span: ColSpan,
6012
+ key: i.name
6013
+ }, /*#__PURE__*/React$1.createElement(Form.Item, {
6014
+ name: i.name,
6015
+ label: i.label,
6016
+ key: i.name
6017
+ }, /*#__PURE__*/React$1.createElement(DatePicker, _objectSpread2(_objectSpread2({
6018
+ style: {
6019
+ width: '100%'
6020
+ },
6021
+ placeholder: "\u8BF7\u9009\u62E9"
6022
+ }, i === null || i === void 0 ? void 0 : (_i$field8 = i.field) === null || _i$field8 === void 0 ? void 0 : _i$field8.props), {}, {
6023
+ disabled: setDisabled(i.name)
6024
+ }))));
6025
+ }
6026
+ if ((i === null || i === void 0 ? void 0 : i.type) === 'businessSearchSelect' || (i === null || i === void 0 ? void 0 : (_i$field9 = i.field) === null || _i$field9 === void 0 ? void 0 : _i$field9.type) === 'businessSearchSelect') {
5987
6027
  return /*#__PURE__*/React$1.createElement(Col, {
5988
6028
  span: ColSpan,
5989
6029
  key: i.name
@@ -5995,7 +6035,7 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
5995
6035
  disabled: setDisabled(i.name)
5996
6036
  }))));
5997
6037
  }
5998
- if ((i === null || i === void 0 ? void 0 : i.type) === 'multipleQueryInput' || (i === null || i === void 0 ? void 0 : (_i$field6 = i.field) === null || _i$field6 === void 0 ? void 0 : _i$field6.type) === 'multipleQueryInput') {
6038
+ if ((i === null || i === void 0 ? void 0 : i.type) === 'multipleQueryInput' || (i === null || i === void 0 ? void 0 : (_i$field10 = i.field) === null || _i$field10 === void 0 ? void 0 : _i$field10.type) === 'multipleQueryInput') {
5999
6039
  return /*#__PURE__*/React$1.createElement(Col, {
6000
6040
  span: ColSpan,
6001
6041
  key: i.name
@@ -6009,7 +6049,7 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
6009
6049
  }
6010
6050
  })));
6011
6051
  }
6012
- if ((i === null || i === void 0 ? void 0 : (_i$field7 = i.field) === null || _i$field7 === void 0 ? void 0 : _i$field7.type) === 'proppertySelector') {
6052
+ if ((i === null || i === void 0 ? void 0 : (_i$field11 = i.field) === null || _i$field11 === void 0 ? void 0 : _i$field11.type) === 'proppertySelector') {
6013
6053
  return /*#__PURE__*/React$1.createElement(Col, {
6014
6054
  span: ColSpan,
6015
6055
  key: i.name
@@ -6019,7 +6059,7 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
6019
6059
  key: i.name
6020
6060
  }, /*#__PURE__*/React$1.createElement(PropertySelector, null)));
6021
6061
  }
6022
- if ((i === null || i === void 0 ? void 0 : (_i$field8 = i.field) === null || _i$field8 === void 0 ? void 0 : _i$field8.type) === 'multipleQuerySearchSelect') {
6062
+ if ((i === null || i === void 0 ? void 0 : (_i$field12 = i.field) === null || _i$field12 === void 0 ? void 0 : _i$field12.type) === 'multipleQuerySearchSelect') {
6023
6063
  return /*#__PURE__*/React$1.createElement(Col, {
6024
6064
  span: ColSpan,
6025
6065
  key: i.name
@@ -6048,7 +6088,7 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
6048
6088
  placeholder: "\u8BF7\u8F93\u5165",
6049
6089
  allowClear: true,
6050
6090
  maxLength: 100
6051
- }, i === null || i === void 0 ? void 0 : (_i$field9 = i.field) === null || _i$field9 === void 0 ? void 0 : _i$field9.props), {}, {
6091
+ }, i === null || i === void 0 ? void 0 : (_i$field13 = i.field) === null || _i$field13 === void 0 ? void 0 : _i$field13.props), {}, {
6052
6092
  disabled: setDisabled(i.name)
6053
6093
  }))));
6054
6094
  });
@@ -6335,7 +6375,7 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
6335
6375
  }))), needModalTable && isModalVisible && (/*#__PURE__*/React$1.createElement(Modal, _objectSpread2({
6336
6376
  maskClosable: false,
6337
6377
  destroyOnClose: true,
6338
- width: "80%",
6378
+ width: "calc(100% - 320px)",
6339
6379
  title: modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.modalTableTitle,
6340
6380
  visible: isModalVisible,
6341
6381
  confirmLoading: confirmLoading,
@@ -13732,16 +13772,18 @@ var CommodityEntry = function CommodityEntry(props) {
13732
13772
  modalProps = _useState2[0],
13733
13773
  setModalProps = _useState2[1];
13734
13774
  var handleOk = function handleOk() {
13735
- var _dataValidationRef$cu;
13775
+ var _dataValidationRef$cu, _dataValidationRef$cu2;
13736
13776
  // 方法获取当前组件内部的数据,然后进行自身的业务操作
13737
- var resultData = (_dataValidationRef$cu = dataValidationRef.current) === null || _dataValidationRef$cu === void 0 ? void 0 : _dataValidationRef$cu.getValidateData();
13738
- if (!resultData.successData.length) {
13739
- message$1.error("无校验通过数据,请校验数据");
13740
- return;
13741
- }
13742
- if (resultData.failData.length) {
13743
- message$1.error("\u6709".concat(resultData.failData.length, "\u6761\u6821\u9A8C\u5931\u8D25\u6570\u636E"));
13744
- return;
13777
+ var resultData = (props === null || props === void 0 ? void 0 : props.notValid) ? (_dataValidationRef$cu = dataValidationRef.current) === null || _dataValidationRef$cu === void 0 ? void 0 : _dataValidationRef$cu.getData() : (_dataValidationRef$cu2 = dataValidationRef.current) === null || _dataValidationRef$cu2 === void 0 ? void 0 : _dataValidationRef$cu2.getValidateData();
13778
+ if (!!!(props === null || props === void 0 ? void 0 : props.notValid)) {
13779
+ if (!resultData.successData.length) {
13780
+ message$1.error("无校验通过数据,请校验数据");
13781
+ return;
13782
+ }
13783
+ if (resultData.failData.length) {
13784
+ message$1.error("\u6709".concat(resultData.failData.length, "\u6761\u6821\u9A8C\u5931\u8D25\u6570\u636E"));
13785
+ return;
13786
+ }
13745
13787
  }
13746
13788
  callbackHandleOk(resultData, function () {
13747
13789
  modalProps.hideModal();
@@ -16203,7 +16245,7 @@ var DetailWrapper = /*#__PURE__*/React$1.memo(function (_ref) {
16203
16245
  return true;
16204
16246
  });
16205
16247
 
16206
- var css_248z$h = ".bs_home_page_head_wrapper {\n height: 32px;\n position: sticky;\n background: #fff;\n width: 100%;\n top: 0px;\n z-index: 10;\n}\n.home_page_head {\n display: flex;\n justify-content: space-between;\n align-items: center;\n background-color: #FFFFFF;\n border-bottom: 1px solid #f0f0f0;\n padding: 6px 16px 5px;\n font-weight: 500;\n}\n.home_page_head .home_page_title_wrapper {\n display: flex;\n align-items: center;\n height: 20px;\n line-height: 20px;\n}\n.home_page_head .home_page_title {\n font-family: PingFangSC-Medium;\n font-weight: 600;\n font-size: 16px;\n color: #000000;\n letter-spacing: 0;\n flex-grow: 1;\n padding-right: 10px;\n display: none;\n}\n.home_page_head .ant-breadcrumb {\n display: block !important;\n}\n.home_page_head .ant-breadcrumb .ant-breadcrumb-separator {\n margin: 0 2px;\n}\n.home_page_head .ant-breadcrumb li .bread_name {\n color: #8B8B8B;\n font-size: 12px;\n line-height: 16px;\n cursor: pointer;\n}\n.home_page_head .ant-breadcrumb li .bread_name_last {\n color: #282828;\n}\n";
16248
+ var css_248z$h = ".bs_home_page_head_wrapper {\n position: sticky;\n background: #fff;\n width: 100%;\n top: 0px;\n z-index: 10;\n}\n.home_page_head {\n display: flex;\n justify-content: space-between;\n align-items: center;\n background-color: #FFFFFF;\n border-bottom: 1px solid #f0f0f0;\n padding: 6px 16px 5px;\n font-weight: 500;\n}\n.home_page_head .home_page_title_wrapper {\n display: flex;\n align-items: center;\n height: 20px;\n line-height: 20px;\n}\n.home_page_head .home_page_title {\n font-family: PingFangSC-Medium;\n font-weight: 600;\n font-size: 16px;\n color: #000000;\n letter-spacing: 0;\n flex-grow: 1;\n padding-right: 10px;\n display: none;\n}\n.home_page_head .ant-breadcrumb {\n display: block !important;\n}\n.home_page_head .ant-breadcrumb .ant-breadcrumb-separator {\n margin: 0 2px;\n}\n.home_page_head .ant-breadcrumb li .bread_name {\n color: #8B8B8B;\n font-size: 12px;\n line-height: 16px;\n cursor: pointer;\n}\n.home_page_head .ant-breadcrumb li .bread_name_last {\n color: #282828;\n}\n";
16207
16249
  styleInject(css_248z$h);
16208
16250
 
16209
16251
  var _excluded$e = ["children"];
package/dist/index.js CHANGED
@@ -4115,14 +4115,16 @@ var makeUniqueValue = function makeUniqueValue() {
4115
4115
  return generateUnitKey;
4116
4116
  };
4117
4117
  // ------------------------------------------处理样式相关--开始----------------------------------------
4118
- var getFormRowInfo = function getFormRowInfo(list) {
4119
- var totalRows = Math.ceil(list.length / columnsPerRow); // 计算总行数
4120
- var lastRowColumns = (list.length + 1) % columnsPerRow; // 计算最后一行的实际列数
4121
- var emptySlots = lastRowColumns === 0 ? 0 : columnsPerRow - lastRowColumns; // 计算最后一行的空位数
4118
+ var getFormRowInfo = function getFormRowInfo(list, tableSearchColSpan) {
4119
+ var lastColumnsPerRow = tableSearchColSpan == 6 ? columnsPerRow : 3;
4120
+ var totalRows = Math.ceil(list.length / lastColumnsPerRow); // 计算总行数
4121
+ var lastRowColumns = (list.length + 1) % lastColumnsPerRow; // 计算最后一行的实际列数
4122
+ var emptySlots = lastRowColumns === 0 ? 0 : lastColumnsPerRow - lastRowColumns; // 计算最后一行的空位数
4122
4123
  var emptyArray = new Array(emptySlots).fill(null); // 生成长度为 emptySlots 的数组
4123
4124
  return {
4124
4125
  totalRows: totalRows,
4125
- emptyArray: emptyArray
4126
+ emptyArray: emptyArray,
4127
+ ColSpan: tableSearchColSpan !== null && tableSearchColSpan !== void 0 ? tableSearchColSpan : ColSpan
4126
4128
  };
4127
4129
  };
4128
4130
  var defaultVisibleFieldsCount = 7;
@@ -5582,7 +5584,7 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
5582
5584
  pageSize: pageSize,
5583
5585
  currentPage: currentPage
5584
5586
  }, otherParams), fixedParam), params);
5585
- if (_.isNil(queryParams[selectParamsKey])) {
5587
+ if (_.isNil(queryParams[selectParamsKey]) && (searchValue === null || searchValue === void 0 ? void 0 : searchValue.length)) {
5586
5588
  queryParams[selectParamsKey] = searchValue;
5587
5589
  }
5588
5590
  var getRequest;
@@ -5949,15 +5951,16 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
5949
5951
  return false;
5950
5952
  }
5951
5953
  };
5952
- var _getFormRowInfo = getFormRowInfo(list),
5953
- emptyArray = _getFormRowInfo.emptyArray;
5954
+ var _getFormRowInfo = getFormRowInfo(list, modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.tableSearchColSpan),
5955
+ emptyArray = _getFormRowInfo.emptyArray,
5956
+ ColSpan = _getFormRowInfo.ColSpan;
5954
5957
  var addKong = (emptyArray === null || emptyArray === void 0 ? void 0 : emptyArray.map(function (i) {
5955
5958
  return {
5956
5959
  type: 'kong'
5957
5960
  };
5958
5961
  })) || [];
5959
5962
  return list === null || list === void 0 ? void 0 : (_list$concat = list.concat(addKong)) === null || _list$concat === void 0 ? void 0 : _list$concat.map(function (i, index) {
5960
- var _i$field, _i$field3, _i$field5, _i$field6, _i$field7, _i$field8, _i$field9;
5963
+ var _i$field, _i$field3, _i$field5, _i$field7, _i$field9, _i$field10, _i$field11, _i$field12, _i$field13;
5961
5964
  if ((i === null || i === void 0 ? void 0 : i.type) === 'kong') return /*#__PURE__*/React__default['default'].createElement(antd.Col, {
5962
5965
  span: ColSpan,
5963
5966
  key: i
@@ -6006,7 +6009,44 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
6006
6009
  disabled: setDisabled(i.name)
6007
6010
  }))));
6008
6011
  }
6009
- if ((i === null || i === void 0 ? void 0 : i.type) === 'businessSearchSelect' || (i === null || i === void 0 ? void 0 : (_i$field5 = i.field) === null || _i$field5 === void 0 ? void 0 : _i$field5.type) === 'businessSearchSelect') {
6012
+ if ((i === null || i === void 0 ? void 0 : i.type) === 'rangepicker' || (i === null || i === void 0 ? void 0 : (_i$field5 = i.field) === null || _i$field5 === void 0 ? void 0 : _i$field5.type) === 'rangepicker') {
6013
+ var _i$initialValue, _i$field6;
6014
+ return /*#__PURE__*/React__default['default'].createElement(antd.Col, {
6015
+ span: ColSpan,
6016
+ key: i.name
6017
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
6018
+ name: i.name,
6019
+ label: i.label,
6020
+ key: i.name,
6021
+ initialValue: (_i$initialValue = i === null || i === void 0 ? void 0 : i.initialValue) !== null && _i$initialValue !== void 0 ? _i$initialValue : []
6022
+ }, /*#__PURE__*/React__default['default'].createElement(antd.DatePicker.RangePicker, _objectSpread2(_objectSpread2({
6023
+ style: {
6024
+ width: '100%'
6025
+ },
6026
+ placeholder: "\u8BF7\u9009\u62E9"
6027
+ }, i === null || i === void 0 ? void 0 : (_i$field6 = i.field) === null || _i$field6 === void 0 ? void 0 : _i$field6.props), {}, {
6028
+ disabled: setDisabled(i.name)
6029
+ }))));
6030
+ }
6031
+ if ((i === null || i === void 0 ? void 0 : i.type) === 'datepicker' || (i === null || i === void 0 ? void 0 : (_i$field7 = i.field) === null || _i$field7 === void 0 ? void 0 : _i$field7.type) === 'datepicker') {
6032
+ var _i$field8;
6033
+ return /*#__PURE__*/React__default['default'].createElement(antd.Col, {
6034
+ span: ColSpan,
6035
+ key: i.name
6036
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
6037
+ name: i.name,
6038
+ label: i.label,
6039
+ key: i.name
6040
+ }, /*#__PURE__*/React__default['default'].createElement(antd.DatePicker, _objectSpread2(_objectSpread2({
6041
+ style: {
6042
+ width: '100%'
6043
+ },
6044
+ placeholder: "\u8BF7\u9009\u62E9"
6045
+ }, i === null || i === void 0 ? void 0 : (_i$field8 = i.field) === null || _i$field8 === void 0 ? void 0 : _i$field8.props), {}, {
6046
+ disabled: setDisabled(i.name)
6047
+ }))));
6048
+ }
6049
+ if ((i === null || i === void 0 ? void 0 : i.type) === 'businessSearchSelect' || (i === null || i === void 0 ? void 0 : (_i$field9 = i.field) === null || _i$field9 === void 0 ? void 0 : _i$field9.type) === 'businessSearchSelect') {
6010
6050
  return /*#__PURE__*/React__default['default'].createElement(antd.Col, {
6011
6051
  span: ColSpan,
6012
6052
  key: i.name
@@ -6018,7 +6058,7 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
6018
6058
  disabled: setDisabled(i.name)
6019
6059
  }))));
6020
6060
  }
6021
- if ((i === null || i === void 0 ? void 0 : i.type) === 'multipleQueryInput' || (i === null || i === void 0 ? void 0 : (_i$field6 = i.field) === null || _i$field6 === void 0 ? void 0 : _i$field6.type) === 'multipleQueryInput') {
6061
+ if ((i === null || i === void 0 ? void 0 : i.type) === 'multipleQueryInput' || (i === null || i === void 0 ? void 0 : (_i$field10 = i.field) === null || _i$field10 === void 0 ? void 0 : _i$field10.type) === 'multipleQueryInput') {
6022
6062
  return /*#__PURE__*/React__default['default'].createElement(antd.Col, {
6023
6063
  span: ColSpan,
6024
6064
  key: i.name
@@ -6032,7 +6072,7 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
6032
6072
  }
6033
6073
  })));
6034
6074
  }
6035
- if ((i === null || i === void 0 ? void 0 : (_i$field7 = i.field) === null || _i$field7 === void 0 ? void 0 : _i$field7.type) === 'proppertySelector') {
6075
+ if ((i === null || i === void 0 ? void 0 : (_i$field11 = i.field) === null || _i$field11 === void 0 ? void 0 : _i$field11.type) === 'proppertySelector') {
6036
6076
  return /*#__PURE__*/React__default['default'].createElement(antd.Col, {
6037
6077
  span: ColSpan,
6038
6078
  key: i.name
@@ -6042,7 +6082,7 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
6042
6082
  key: i.name
6043
6083
  }, /*#__PURE__*/React__default['default'].createElement(PropertySelector, null)));
6044
6084
  }
6045
- if ((i === null || i === void 0 ? void 0 : (_i$field8 = i.field) === null || _i$field8 === void 0 ? void 0 : _i$field8.type) === 'multipleQuerySearchSelect') {
6085
+ if ((i === null || i === void 0 ? void 0 : (_i$field12 = i.field) === null || _i$field12 === void 0 ? void 0 : _i$field12.type) === 'multipleQuerySearchSelect') {
6046
6086
  return /*#__PURE__*/React__default['default'].createElement(antd.Col, {
6047
6087
  span: ColSpan,
6048
6088
  key: i.name
@@ -6071,7 +6111,7 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
6071
6111
  placeholder: "\u8BF7\u8F93\u5165",
6072
6112
  allowClear: true,
6073
6113
  maxLength: 100
6074
- }, i === null || i === void 0 ? void 0 : (_i$field9 = i.field) === null || _i$field9 === void 0 ? void 0 : _i$field9.props), {}, {
6114
+ }, i === null || i === void 0 ? void 0 : (_i$field13 = i.field) === null || _i$field13 === void 0 ? void 0 : _i$field13.props), {}, {
6075
6115
  disabled: setDisabled(i.name)
6076
6116
  }))));
6077
6117
  });
@@ -6358,7 +6398,7 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
6358
6398
  }))), needModalTable && isModalVisible && (/*#__PURE__*/React__default['default'].createElement(antd.Modal, _objectSpread2({
6359
6399
  maskClosable: false,
6360
6400
  destroyOnClose: true,
6361
- width: "80%",
6401
+ width: "calc(100% - 320px)",
6362
6402
  title: modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.modalTableTitle,
6363
6403
  visible: isModalVisible,
6364
6404
  confirmLoading: confirmLoading,
@@ -13755,16 +13795,18 @@ var CommodityEntry = function CommodityEntry(props) {
13755
13795
  modalProps = _useState2[0],
13756
13796
  setModalProps = _useState2[1];
13757
13797
  var handleOk = function handleOk() {
13758
- var _dataValidationRef$cu;
13798
+ var _dataValidationRef$cu, _dataValidationRef$cu2;
13759
13799
  // 方法获取当前组件内部的数据,然后进行自身的业务操作
13760
- var resultData = (_dataValidationRef$cu = dataValidationRef.current) === null || _dataValidationRef$cu === void 0 ? void 0 : _dataValidationRef$cu.getValidateData();
13761
- if (!resultData.successData.length) {
13762
- antd.message.error("无校验通过数据,请校验数据");
13763
- return;
13764
- }
13765
- if (resultData.failData.length) {
13766
- antd.message.error("\u6709".concat(resultData.failData.length, "\u6761\u6821\u9A8C\u5931\u8D25\u6570\u636E"));
13767
- return;
13800
+ var resultData = (props === null || props === void 0 ? void 0 : props.notValid) ? (_dataValidationRef$cu = dataValidationRef.current) === null || _dataValidationRef$cu === void 0 ? void 0 : _dataValidationRef$cu.getData() : (_dataValidationRef$cu2 = dataValidationRef.current) === null || _dataValidationRef$cu2 === void 0 ? void 0 : _dataValidationRef$cu2.getValidateData();
13801
+ if (!!!(props === null || props === void 0 ? void 0 : props.notValid)) {
13802
+ if (!resultData.successData.length) {
13803
+ antd.message.error("无校验通过数据,请校验数据");
13804
+ return;
13805
+ }
13806
+ if (resultData.failData.length) {
13807
+ antd.message.error("\u6709".concat(resultData.failData.length, "\u6761\u6821\u9A8C\u5931\u8D25\u6570\u636E"));
13808
+ return;
13809
+ }
13768
13810
  }
13769
13811
  callbackHandleOk(resultData, function () {
13770
13812
  modalProps.hideModal();
@@ -16226,7 +16268,7 @@ var DetailWrapper = /*#__PURE__*/React__default['default'].memo(function (_ref)
16226
16268
  return true;
16227
16269
  });
16228
16270
 
16229
- var css_248z$h = ".bs_home_page_head_wrapper {\n height: 32px;\n position: sticky;\n background: #fff;\n width: 100%;\n top: 0px;\n z-index: 10;\n}\n.home_page_head {\n display: flex;\n justify-content: space-between;\n align-items: center;\n background-color: #FFFFFF;\n border-bottom: 1px solid #f0f0f0;\n padding: 6px 16px 5px;\n font-weight: 500;\n}\n.home_page_head .home_page_title_wrapper {\n display: flex;\n align-items: center;\n height: 20px;\n line-height: 20px;\n}\n.home_page_head .home_page_title {\n font-family: PingFangSC-Medium;\n font-weight: 600;\n font-size: 16px;\n color: #000000;\n letter-spacing: 0;\n flex-grow: 1;\n padding-right: 10px;\n display: none;\n}\n.home_page_head .ant-breadcrumb {\n display: block !important;\n}\n.home_page_head .ant-breadcrumb .ant-breadcrumb-separator {\n margin: 0 2px;\n}\n.home_page_head .ant-breadcrumb li .bread_name {\n color: #8B8B8B;\n font-size: 12px;\n line-height: 16px;\n cursor: pointer;\n}\n.home_page_head .ant-breadcrumb li .bread_name_last {\n color: #282828;\n}\n";
16271
+ var css_248z$h = ".bs_home_page_head_wrapper {\n position: sticky;\n background: #fff;\n width: 100%;\n top: 0px;\n z-index: 10;\n}\n.home_page_head {\n display: flex;\n justify-content: space-between;\n align-items: center;\n background-color: #FFFFFF;\n border-bottom: 1px solid #f0f0f0;\n padding: 6px 16px 5px;\n font-weight: 500;\n}\n.home_page_head .home_page_title_wrapper {\n display: flex;\n align-items: center;\n height: 20px;\n line-height: 20px;\n}\n.home_page_head .home_page_title {\n font-family: PingFangSC-Medium;\n font-weight: 600;\n font-size: 16px;\n color: #000000;\n letter-spacing: 0;\n flex-grow: 1;\n padding-right: 10px;\n display: none;\n}\n.home_page_head .ant-breadcrumb {\n display: block !important;\n}\n.home_page_head .ant-breadcrumb .ant-breadcrumb-separator {\n margin: 0 2px;\n}\n.home_page_head .ant-breadcrumb li .bread_name {\n color: #8B8B8B;\n font-size: 12px;\n line-height: 16px;\n cursor: pointer;\n}\n.home_page_head .ant-breadcrumb li .bread_name_last {\n color: #282828;\n}\n";
16230
16272
  styleInject(css_248z$h);
16231
16273
 
16232
16274
  var _excluded$e = ["children"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bit-sun/business-component",
3
- "version": "4.0.13-alpha.16",
3
+ "version": "4.0.13-alpha.18",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -34,16 +34,18 @@ const CommodityEntry = (props: any) => {
34
34
 
35
35
  const handleOk = () => {
36
36
  // 方法获取当前组件内部的数据,然后进行自身的业务操作
37
- const resultData = dataValidationRef.current?.getValidateData();
37
+ let resultData = props?.notValid ? dataValidationRef.current?.getData() : dataValidationRef.current?.getValidateData();
38
38
 
39
- if (!resultData.successData.length) {
40
- message.error("无校验通过数据,请校验数据");
41
- return;
42
- }
43
-
44
- if (resultData.failData.length) {
45
- message.error(`有${resultData.failData.length}条校验失败数据`);
46
- return;
39
+ if(!(!!props?.notValid)) {
40
+ if (!resultData.successData.length) {
41
+ message.error("无校验通过数据,请校验数据");
42
+ return;
43
+ }
44
+
45
+ if (resultData.failData.length) {
46
+ message.error(`有${resultData.failData.length}条校验失败数据`);
47
+ return;
48
+ }
47
49
  }
48
50
 
49
51
  callbackHandleOk(resultData, () => {
@@ -1,5 +1,5 @@
1
1
  .bs_home_page_head_wrapper{
2
- height: 32px;
2
+ // 如果设置高度 需要考虑列表页引用有传提示参数alertProps情况,写死固定高度会导致提示遮挡筛选条件
3
3
  position: sticky;
4
4
  background: #fff;
5
5
  width: 100%;
@@ -1,13 +1,13 @@
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, Empty } from 'antd';
4
+ import { Input, Button, Modal, Select, Divider, message, Spin, Form, Table, Checkbox, TreeSelect, Tooltip, Tag, Row, Col, Space, Tabs, Empty, DatePicker } 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"
8
8
  import './index.less';
9
9
  import { BusinessSearchSelect, QueryMutipleInput, QueryMutipleSearchSelect } from '@/index';
10
- import { handleSourceName, getFormRowInfo, hasMoreQueryFields, defaultVisibleFieldsCount, getRealStr, ColSpan, getTableHeigth, getCurrentSRKs, getRenderSource, handleParams, convertUrlQueryParams, convertBodyParams, formatSelectedValue, convertResData, makeUniqueValue, handleSelectOptionsShowValue, LightHeightOption, maxTagPlaceholder, getShowStr, handleTableColumns } from './utils';
10
+ import { handleSourceName, getFormRowInfo, hasMoreQueryFields, defaultVisibleFieldsCount, getRealStr, getTableHeigth, getCurrentSRKs, getRenderSource, handleParams, convertUrlQueryParams, convertBodyParams, formatSelectedValue, convertResData, makeUniqueValue, handleSelectOptionsShowValue, LightHeightOption, maxTagPlaceholder, getShowStr, handleTableColumns } from './utils';
11
11
  import { judgeIsRequestError } from '@/utils/requestUtils';
12
12
  import zhankaitiaojian from '../../../assets/zhankaitiaojian-icon.svg';
13
13
  import PropertySelector from '@/components/Business/PropertyModal';
@@ -230,7 +230,7 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
230
230
  ...fixedParam,
231
231
  ...params,
232
232
  };
233
- if (isNil(queryParams[selectParamsKey])) {
233
+ if (isNil(queryParams[selectParamsKey])&&searchValue?.length) {
234
234
  queryParams[selectParamsKey] = searchValue;
235
235
  }
236
236
 
@@ -573,7 +573,7 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
573
573
  }
574
574
  };
575
575
 
576
- const { emptyArray } = getFormRowInfo(list);
576
+ const { emptyArray, ColSpan } = getFormRowInfo(list, modalTableProps?.tableSearchColSpan);
577
577
  const addKong = emptyArray?.map((i: any) =>({ type: 'kong'}))||[];
578
578
  return list?.concat(addKong)?.map((i: any, index: number) => {
579
579
  if(i?.type === 'kong') return <Col span={ColSpan} key={i}></Col>;
@@ -602,6 +602,25 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
602
602
  )
603
603
  }
604
604
 
605
+ if (i?.type === 'rangepicker' || i?.field?.type === 'rangepicker') {
606
+ return (
607
+ <Col span={ColSpan} key={i.name}>
608
+ <Form.Item name={i.name} label={i.label} key={i.name} initialValue={i?.initialValue ?? []}>
609
+ <DatePicker.RangePicker style={{ width: '100%' }} placeholder='请选择' {...i?.field?.props} disabled={setDisabled(i.name)}></DatePicker.RangePicker>
610
+ </Form.Item>
611
+ </Col>
612
+ )
613
+ }
614
+ if (i?.type === 'datepicker' || i?.field?.type === 'datepicker') {
615
+ return (
616
+ <Col span={ColSpan} key={i.name}>
617
+ <Form.Item name={i.name} label={i.label} key={i.name}>
618
+ <DatePicker style={{ width: '100%' }} placeholder='请选择' {...i?.field?.props} disabled={setDisabled(i.name)}></DatePicker>
619
+ </Form.Item>
620
+ </Col>
621
+ )
622
+ }
623
+
605
624
  if (i?.type === 'businessSearchSelect' || i?.field?.type === 'businessSearchSelect') {
606
625
  return (
607
626
  <Col span={ColSpan} key={i.name}>
@@ -887,7 +906,7 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
887
906
  <Modal
888
907
  maskClosable={false}
889
908
  destroyOnClose
890
- width="80%"
909
+ width={`calc(100% - 320px)`}
891
910
  title={modalTableProps?.modalTableTitle}
892
911
  visible={isModalVisible}
893
912
  confirmLoading={confirmLoading}
@@ -17,12 +17,13 @@ export const handleSourceName = (sName: any) => {
17
17
  }
18
18
 
19
19
  // ------------------------------------------处理样式相关--开始----------------------------------------
20
- export const getFormRowInfo = (list: any) => {
21
- const totalRows = Math.ceil(list.length / columnsPerRow); // 计算总行数
22
- const lastRowColumns = (list.length+1) % columnsPerRow; // 计算最后一行的实际列数
23
- const emptySlots = lastRowColumns === 0 ? 0 : columnsPerRow - lastRowColumns; // 计算最后一行的空位数
20
+ export const getFormRowInfo = (list: any, tableSearchColSpan: number) => {
21
+ const lastColumnsPerRow = tableSearchColSpan == 6 ? columnsPerRow : 3;
22
+ const totalRows = Math.ceil(list.length / lastColumnsPerRow); // 计算总行数
23
+ const lastRowColumns = (list.length+1) % lastColumnsPerRow; // 计算最后一行的实际列数
24
+ const emptySlots = lastRowColumns === 0 ? 0 : lastColumnsPerRow - lastRowColumns; // 计算最后一行的空位数
24
25
  const emptyArray = new Array(emptySlots).fill(null); // 生成长度为 emptySlots 的数组
25
- return { totalRows, emptyArray }
26
+ return { totalRows, emptyArray, ColSpan: tableSearchColSpan ?? ColSpan}
26
27
  }
27
28
 
28
29
  export const defaultVisibleFieldsCount = 7;