@bit-sun/business-component 3.2.0-alpha.4 → 3.2.2

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
@@ -4578,9 +4578,9 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
4578
4578
  if (labelInValue) {
4579
4579
  var formatResult = value.map(function (i) {
4580
4580
  return {
4581
- key: i[mappingValueField],
4582
- label: i[mappingTextField],
4583
- value: i[mappingValueField]
4581
+ key: i[mappingValueField] || i.key,
4582
+ label: i[mappingTextField] || i.label,
4583
+ value: i[mappingValueField] || i.value
4584
4584
  };
4585
4585
  });
4586
4586
  onChange(selectMode ? formatResult : formatResult[0], value, source);
@@ -15615,9 +15615,6 @@ var ResizeableTitle$2 = function ResizeableTitle(props) {
15615
15615
  };
15616
15616
  var BsSulaQueryTable = (function (props) {
15617
15617
  var _props$expandable, _value$exportConfig7;
15618
- var _useState = useState('max-height' + uuid()),
15619
- _useState2 = _slicedToArray(_useState, 1),
15620
- randomKey = _useState2[0];
15621
15618
  var bsTableCode = (props === null || props === void 0 ? void 0 : props.tableCode) || window.location.hash; //设置列字段的唯一标识
15622
15619
  // 获取 table columns中所有的 key 防止有的地方是 dataindex
15623
15620
  var checkedList = useMemo(function () {
@@ -15693,39 +15690,39 @@ var BsSulaQueryTable = (function (props) {
15693
15690
  return _toConsumableArray(originConfig);
15694
15691
  };
15695
15692
  var refs = useRef(null);
15696
- var _useState3 = useState(''),
15697
- _useState4 = _slicedToArray(_useState3, 2),
15698
- pagePath = _useState4[0],
15699
- setPagePath = _useState4[1];
15693
+ var _useState = useState(''),
15694
+ _useState2 = _slicedToArray(_useState, 2),
15695
+ pagePath = _useState2[0],
15696
+ setPagePath = _useState2[1];
15700
15697
  var _useLocation = useLocation(),
15701
15698
  pathname = _useLocation.pathname,
15702
15699
  _useLocation$state = _useLocation.state,
15703
15700
  state = _useLocation$state === void 0 ? {} : _useLocation$state;
15704
- var _useState5 = useState(false),
15705
- _useState6 = _slicedToArray(_useState5, 2),
15706
- isFullScreen = _useState6[0],
15707
- setIsFnllScreen = _useState6[1];
15701
+ var _useState3 = useState(false),
15702
+ _useState4 = _slicedToArray(_useState3, 2),
15703
+ isFullScreen = _useState4[0],
15704
+ setIsFnllScreen = _useState4[1];
15708
15705
  // @ts-nocheck
15709
15706
  var value = props;
15710
15707
  var _props$fields = props.fields,
15711
15708
  fields = _props$fields === void 0 ? [] : _props$fields;
15712
- var _useState7 = useState([]),
15713
- _useState8 = _slicedToArray(_useState7, 2),
15714
- showColumn = _useState8[0],
15715
- setShowColumns = _useState8[1]; // 列字段
15709
+ var _useState5 = useState([]),
15710
+ _useState6 = _slicedToArray(_useState5, 2),
15711
+ showColumn = _useState6[0],
15712
+ setShowColumns = _useState6[1]; // 列字段
15716
15713
  var originSearchFields = getSettingFieldOrColumn(getConfigFromlocalstorage(ENUM.BROWSER_CACHE.SEARCH_FIELDS_CONDITION), fields, 'searchFields');
15717
- var _useState9 = useState(originSearchFields),
15714
+ var _useState7 = useState(originSearchFields),
15715
+ _useState8 = _slicedToArray(_useState7, 2),
15716
+ showSearchFields = _useState8[0],
15717
+ setShowSearchFields = _useState8[1]; //搜索项字段
15718
+ var _useState9 = useState([]),
15718
15719
  _useState10 = _slicedToArray(_useState9, 2),
15719
- showSearchFields = _useState10[0],
15720
- setShowSearchFields = _useState10[1]; //搜索项字段
15721
- var _useState11 = useState([]),
15720
+ showExportColumn = _useState10[0],
15721
+ setShowExportColumns = _useState10[1]; // 导出列字段
15722
+ var _useState11 = useState('100vh'),
15722
15723
  _useState12 = _slicedToArray(_useState11, 2),
15723
- showExportColumn = _useState12[0],
15724
- setShowExportColumns = _useState12[1]; // 导出列字段
15725
- var _useState13 = useState('100vh'),
15726
- _useState14 = _slicedToArray(_useState13, 2),
15727
- height = _useState14[0],
15728
- setHeight = _useState14[1];
15724
+ height = _useState12[0],
15725
+ setHeight = _useState12[1];
15729
15726
  var sortTableRef = useRef(null);
15730
15727
  var searchTableRef = useRef(null);
15731
15728
  var exportTableRef = useRef(null);
@@ -15733,34 +15730,15 @@ var BsSulaQueryTable = (function (props) {
15733
15730
  // 获取table高度
15734
15731
  var getTableHeight = function getTableHeight() {
15735
15732
  setTimeout(function () {
15736
- var clientBodyTopHeight = document.querySelector(".".concat(randomKey, " .ant-table-body")).getBoundingClientRect().top;
15737
- setHeight("calc(100vh - " + (clientBodyTopHeight + 67) + "px)");
15738
- // const cancelHeight = window.top == window ? 303 : 223;
15739
- // const isFullScreen: any =
15740
- // window.top.document.fullScreen ||
15741
- // window.top.document.webkitIsFullScreen ||
15742
- // window.top.document.mozFullScreen;
15743
- // // wujie子应用iframe首次加载获取不到client以及dom元素高度兼容处理
15744
- // let realIframeClientHeight = document.body.clientHeight ? document.body.clientHeight : window.top?.document.body.clientHeight - 76;
15745
- // let summaryHeight = document.querySelector(`.ant-tabs-tabpane-active .table-bssula-summary`) ?
15746
- // (document.querySelector(`.ant-tabs-tabpane-active .table-bssula-summary`)?.clientHeight || 22) : 0;
15747
- // let listTabHeight = document.querySelector(`.ant-tabs-tabpane-active .list_top_tab .ant-tabs-nav`) ?
15748
- // (document.querySelector(`.ant-tabs-tabpane-active .list_top_tab .ant-tabs-nav`)?.clientHeight || 48) : 0;
15749
- // const h =
15750
- // realIframeClientHeight -
15751
- // summaryHeight -
15752
- // listTabHeight -
15753
- // (document.querySelector(
15754
- // `.ant-tabs-tabpane-active .ant-form ant-form-horizontal`,
15755
- // )?.clientHeight || 0) -
15756
- // (isFullScreen
15757
- // ? 0
15758
- // : document.querySelector(
15759
- // `.ant-tabs-tabpane-active .ant-pro-page-container-warp`,
15760
- // )?.clientHeight || 0) -
15761
- // cancelHeight +
15762
- // 'px';
15763
- // setHeight(h);
15733
+ var _window$top, _document$querySelect, _document$querySelect2, _document$querySelect3, _document$querySelect4;
15734
+ var cancelHeight = window.top == window ? 303 : 223;
15735
+ var isFullScreen = window.top.document.fullScreen || window.top.document.webkitIsFullScreen || window.top.document.mozFullScreen;
15736
+ // wujie子应用iframe首次加载获取不到client以及dom元素高度兼容处理
15737
+ var realIframeClientHeight = document.body.clientHeight ? document.body.clientHeight : ((_window$top = window.top) === null || _window$top === void 0 ? void 0 : _window$top.document.body.clientHeight) - 76;
15738
+ var summaryHeight = document.querySelector(".ant-tabs-tabpane-active .table-bssula-summary") ? ((_document$querySelect = document.querySelector(".ant-tabs-tabpane-active .table-bssula-summary")) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.clientHeight) || 22 : 0;
15739
+ var listTabHeight = document.querySelector(".ant-tabs-tabpane-active .list_top_tab .ant-tabs-nav") ? ((_document$querySelect2 = document.querySelector(".ant-tabs-tabpane-active .list_top_tab .ant-tabs-nav")) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.clientHeight) || 48 : 0;
15740
+ var h = realIframeClientHeight - summaryHeight - listTabHeight - (((_document$querySelect3 = document.querySelector(".ant-tabs-tabpane-active .ant-form ant-form-horizontal")) === null || _document$querySelect3 === void 0 ? void 0 : _document$querySelect3.clientHeight) || 0) - (isFullScreen ? 0 : ((_document$querySelect4 = document.querySelector(".ant-tabs-tabpane-active .ant-pro-page-container-warp")) === null || _document$querySelect4 === void 0 ? void 0 : _document$querySelect4.clientHeight) || 0) - cancelHeight + 'px';
15741
+ setHeight(h);
15764
15742
  }, 0);
15765
15743
  };
15766
15744
  //监测是否按下esc键
@@ -15861,7 +15839,7 @@ var BsSulaQueryTable = (function (props) {
15861
15839
  };
15862
15840
  //组件初始挂载
15863
15841
  useEffect(function () {
15864
- getTableHeight();
15842
+ // getTableHeight();
15865
15843
  setInitialTableInfo();
15866
15844
  setInitialSearchFieldsInfo();
15867
15845
  window.addEventListener('resize', function (e) {
@@ -16219,10 +16197,9 @@ var BsSulaQueryTable = (function (props) {
16219
16197
  });
16220
16198
  }, [
16221
16199
  // value,
16222
- checkedList, showColumn, props.statusMapping, showSearchFields, expandedRowKeys, height]);
16200
+ checkedList, showColumn, props.statusMapping, showSearchFields, expandedRowKeys]);
16223
16201
  return /*#__PURE__*/React$1.createElement("div", {
16224
- id: "bs-sula-query-table",
16225
- className: randomKey
16202
+ id: "bs-sula-query-table"
16226
16203
  }, /*#__PURE__*/React$1.createElement(MemoQueryTable, _objectSpread2({}, memoConfig)), /*#__PURE__*/React$1.createElement(SortableTable$1, {
16227
16204
  ref: sortTableRef,
16228
16205
  setShowColumns: setShowColumns,
@@ -34957,6 +34934,21 @@ var RuleObjectComponent = /*#__PURE__*/function (_Component) {
34957
34934
  }) : pCode;
34958
34935
  }
34959
34936
  }
34937
+ if ((configItem === null || configItem === void 0 ? void 0 : configItem.inputType) === 30) {
34938
+ var _pCode$split;
34939
+ var _newPCode = Array.isArray(pCode) ? pCode === null || pCode === void 0 ? void 0 : pCode.map(function (s) {
34940
+ return isObj(s) ? s : {
34941
+ key: s,
34942
+ value: s
34943
+ };
34944
+ }) : pCode === null || pCode === void 0 ? void 0 : (_pCode$split = pCode.split(',')) === null || _pCode$split === void 0 ? void 0 : _pCode$split.map(function (s) {
34945
+ return {
34946
+ key: s,
34947
+ value: s
34948
+ };
34949
+ });
34950
+ return _newPCode || pCode || defaultValue;
34951
+ }
34960
34952
  return pCode || defaultValue;
34961
34953
  };
34962
34954
  var handleEdit = function handleEdit(code, val, functionItem) {
@@ -34967,7 +34959,7 @@ var RuleObjectComponent = /*#__PURE__*/function (_Component) {
34967
34959
  });
34968
34960
  return;
34969
34961
  }
34970
- if (Array.isArray(val)) {
34962
+ if (Array.isArray(val) && (val === null || val === void 0 ? void 0 : val.length)) {
34971
34963
  value = val.map(function (m) {
34972
34964
  return m.value || m;
34973
34965
  }).join(',');
package/dist/index.js CHANGED
@@ -4601,9 +4601,9 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
4601
4601
  if (labelInValue) {
4602
4602
  var formatResult = value.map(function (i) {
4603
4603
  return {
4604
- key: i[mappingValueField],
4605
- label: i[mappingTextField],
4606
- value: i[mappingValueField]
4604
+ key: i[mappingValueField] || i.key,
4605
+ label: i[mappingTextField] || i.label,
4606
+ value: i[mappingValueField] || i.value
4607
4607
  };
4608
4608
  });
4609
4609
  onChange(selectMode ? formatResult : formatResult[0], value, source);
@@ -15638,9 +15638,6 @@ var ResizeableTitle$2 = function ResizeableTitle(props) {
15638
15638
  };
15639
15639
  var BsSulaQueryTable = (function (props) {
15640
15640
  var _props$expandable, _value$exportConfig7;
15641
- var _useState = React$1.useState('max-height' + uuid()),
15642
- _useState2 = _slicedToArray(_useState, 1),
15643
- randomKey = _useState2[0];
15644
15641
  var bsTableCode = (props === null || props === void 0 ? void 0 : props.tableCode) || window.location.hash; //设置列字段的唯一标识
15645
15642
  // 获取 table columns中所有的 key 防止有的地方是 dataindex
15646
15643
  var checkedList = React$1.useMemo(function () {
@@ -15716,39 +15713,39 @@ var BsSulaQueryTable = (function (props) {
15716
15713
  return _toConsumableArray(originConfig);
15717
15714
  };
15718
15715
  var refs = React$1.useRef(null);
15719
- var _useState3 = React$1.useState(''),
15720
- _useState4 = _slicedToArray(_useState3, 2),
15721
- pagePath = _useState4[0],
15722
- setPagePath = _useState4[1];
15716
+ var _useState = React$1.useState(''),
15717
+ _useState2 = _slicedToArray(_useState, 2),
15718
+ pagePath = _useState2[0],
15719
+ setPagePath = _useState2[1];
15723
15720
  var _useLocation = umi.useLocation(),
15724
15721
  pathname = _useLocation.pathname,
15725
15722
  _useLocation$state = _useLocation.state,
15726
15723
  state = _useLocation$state === void 0 ? {} : _useLocation$state;
15727
- var _useState5 = React$1.useState(false),
15728
- _useState6 = _slicedToArray(_useState5, 2),
15729
- isFullScreen = _useState6[0],
15730
- setIsFnllScreen = _useState6[1];
15724
+ var _useState3 = React$1.useState(false),
15725
+ _useState4 = _slicedToArray(_useState3, 2),
15726
+ isFullScreen = _useState4[0],
15727
+ setIsFnllScreen = _useState4[1];
15731
15728
  // @ts-nocheck
15732
15729
  var value = props;
15733
15730
  var _props$fields = props.fields,
15734
15731
  fields = _props$fields === void 0 ? [] : _props$fields;
15735
- var _useState7 = React$1.useState([]),
15736
- _useState8 = _slicedToArray(_useState7, 2),
15737
- showColumn = _useState8[0],
15738
- setShowColumns = _useState8[1]; // 列字段
15732
+ var _useState5 = React$1.useState([]),
15733
+ _useState6 = _slicedToArray(_useState5, 2),
15734
+ showColumn = _useState6[0],
15735
+ setShowColumns = _useState6[1]; // 列字段
15739
15736
  var originSearchFields = getSettingFieldOrColumn(getConfigFromlocalstorage(ENUM.BROWSER_CACHE.SEARCH_FIELDS_CONDITION), fields, 'searchFields');
15740
- var _useState9 = React$1.useState(originSearchFields),
15737
+ var _useState7 = React$1.useState(originSearchFields),
15738
+ _useState8 = _slicedToArray(_useState7, 2),
15739
+ showSearchFields = _useState8[0],
15740
+ setShowSearchFields = _useState8[1]; //搜索项字段
15741
+ var _useState9 = React$1.useState([]),
15741
15742
  _useState10 = _slicedToArray(_useState9, 2),
15742
- showSearchFields = _useState10[0],
15743
- setShowSearchFields = _useState10[1]; //搜索项字段
15744
- var _useState11 = React$1.useState([]),
15743
+ showExportColumn = _useState10[0],
15744
+ setShowExportColumns = _useState10[1]; // 导出列字段
15745
+ var _useState11 = React$1.useState('100vh'),
15745
15746
  _useState12 = _slicedToArray(_useState11, 2),
15746
- showExportColumn = _useState12[0],
15747
- setShowExportColumns = _useState12[1]; // 导出列字段
15748
- var _useState13 = React$1.useState('100vh'),
15749
- _useState14 = _slicedToArray(_useState13, 2),
15750
- height = _useState14[0],
15751
- setHeight = _useState14[1];
15747
+ height = _useState12[0],
15748
+ setHeight = _useState12[1];
15752
15749
  var sortTableRef = React$1.useRef(null);
15753
15750
  var searchTableRef = React$1.useRef(null);
15754
15751
  var exportTableRef = React$1.useRef(null);
@@ -15756,34 +15753,15 @@ var BsSulaQueryTable = (function (props) {
15756
15753
  // 获取table高度
15757
15754
  var getTableHeight = function getTableHeight() {
15758
15755
  setTimeout(function () {
15759
- var clientBodyTopHeight = document.querySelector(".".concat(randomKey, " .ant-table-body")).getBoundingClientRect().top;
15760
- setHeight("calc(100vh - " + (clientBodyTopHeight + 67) + "px)");
15761
- // const cancelHeight = window.top == window ? 303 : 223;
15762
- // const isFullScreen: any =
15763
- // window.top.document.fullScreen ||
15764
- // window.top.document.webkitIsFullScreen ||
15765
- // window.top.document.mozFullScreen;
15766
- // // wujie子应用iframe首次加载获取不到client以及dom元素高度兼容处理
15767
- // let realIframeClientHeight = document.body.clientHeight ? document.body.clientHeight : window.top?.document.body.clientHeight - 76;
15768
- // let summaryHeight = document.querySelector(`.ant-tabs-tabpane-active .table-bssula-summary`) ?
15769
- // (document.querySelector(`.ant-tabs-tabpane-active .table-bssula-summary`)?.clientHeight || 22) : 0;
15770
- // let listTabHeight = document.querySelector(`.ant-tabs-tabpane-active .list_top_tab .ant-tabs-nav`) ?
15771
- // (document.querySelector(`.ant-tabs-tabpane-active .list_top_tab .ant-tabs-nav`)?.clientHeight || 48) : 0;
15772
- // const h =
15773
- // realIframeClientHeight -
15774
- // summaryHeight -
15775
- // listTabHeight -
15776
- // (document.querySelector(
15777
- // `.ant-tabs-tabpane-active .ant-form ant-form-horizontal`,
15778
- // )?.clientHeight || 0) -
15779
- // (isFullScreen
15780
- // ? 0
15781
- // : document.querySelector(
15782
- // `.ant-tabs-tabpane-active .ant-pro-page-container-warp`,
15783
- // )?.clientHeight || 0) -
15784
- // cancelHeight +
15785
- // 'px';
15786
- // setHeight(h);
15756
+ var _window$top, _document$querySelect, _document$querySelect2, _document$querySelect3, _document$querySelect4;
15757
+ var cancelHeight = window.top == window ? 303 : 223;
15758
+ var isFullScreen = window.top.document.fullScreen || window.top.document.webkitIsFullScreen || window.top.document.mozFullScreen;
15759
+ // wujie子应用iframe首次加载获取不到client以及dom元素高度兼容处理
15760
+ var realIframeClientHeight = document.body.clientHeight ? document.body.clientHeight : ((_window$top = window.top) === null || _window$top === void 0 ? void 0 : _window$top.document.body.clientHeight) - 76;
15761
+ var summaryHeight = document.querySelector(".ant-tabs-tabpane-active .table-bssula-summary") ? ((_document$querySelect = document.querySelector(".ant-tabs-tabpane-active .table-bssula-summary")) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.clientHeight) || 22 : 0;
15762
+ var listTabHeight = document.querySelector(".ant-tabs-tabpane-active .list_top_tab .ant-tabs-nav") ? ((_document$querySelect2 = document.querySelector(".ant-tabs-tabpane-active .list_top_tab .ant-tabs-nav")) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.clientHeight) || 48 : 0;
15763
+ var h = realIframeClientHeight - summaryHeight - listTabHeight - (((_document$querySelect3 = document.querySelector(".ant-tabs-tabpane-active .ant-form ant-form-horizontal")) === null || _document$querySelect3 === void 0 ? void 0 : _document$querySelect3.clientHeight) || 0) - (isFullScreen ? 0 : ((_document$querySelect4 = document.querySelector(".ant-tabs-tabpane-active .ant-pro-page-container-warp")) === null || _document$querySelect4 === void 0 ? void 0 : _document$querySelect4.clientHeight) || 0) - cancelHeight + 'px';
15764
+ setHeight(h);
15787
15765
  }, 0);
15788
15766
  };
15789
15767
  //监测是否按下esc键
@@ -15884,7 +15862,7 @@ var BsSulaQueryTable = (function (props) {
15884
15862
  };
15885
15863
  //组件初始挂载
15886
15864
  React$1.useEffect(function () {
15887
- getTableHeight();
15865
+ // getTableHeight();
15888
15866
  setInitialTableInfo();
15889
15867
  setInitialSearchFieldsInfo();
15890
15868
  window.addEventListener('resize', function (e) {
@@ -16242,10 +16220,9 @@ var BsSulaQueryTable = (function (props) {
16242
16220
  });
16243
16221
  }, [
16244
16222
  // value,
16245
- checkedList, showColumn, props.statusMapping, showSearchFields, expandedRowKeys, height]);
16223
+ checkedList, showColumn, props.statusMapping, showSearchFields, expandedRowKeys]);
16246
16224
  return /*#__PURE__*/React__default['default'].createElement("div", {
16247
- id: "bs-sula-query-table",
16248
- className: randomKey
16225
+ id: "bs-sula-query-table"
16249
16226
  }, /*#__PURE__*/React__default['default'].createElement(MemoQueryTable, _objectSpread2({}, memoConfig)), /*#__PURE__*/React__default['default'].createElement(SortableTable$1, {
16250
16227
  ref: sortTableRef,
16251
16228
  setShowColumns: setShowColumns,
@@ -34980,6 +34957,21 @@ var RuleObjectComponent = /*#__PURE__*/function (_Component) {
34980
34957
  }) : pCode;
34981
34958
  }
34982
34959
  }
34960
+ if ((configItem === null || configItem === void 0 ? void 0 : configItem.inputType) === 30) {
34961
+ var _pCode$split;
34962
+ var _newPCode = Array.isArray(pCode) ? pCode === null || pCode === void 0 ? void 0 : pCode.map(function (s) {
34963
+ return isObj(s) ? s : {
34964
+ key: s,
34965
+ value: s
34966
+ };
34967
+ }) : pCode === null || pCode === void 0 ? void 0 : (_pCode$split = pCode.split(',')) === null || _pCode$split === void 0 ? void 0 : _pCode$split.map(function (s) {
34968
+ return {
34969
+ key: s,
34970
+ value: s
34971
+ };
34972
+ });
34973
+ return _newPCode || pCode || defaultValue;
34974
+ }
34983
34975
  return pCode || defaultValue;
34984
34976
  };
34985
34977
  var handleEdit = function handleEdit(code, val, functionItem) {
@@ -34990,7 +34982,7 @@ var RuleObjectComponent = /*#__PURE__*/function (_Component) {
34990
34982
  });
34991
34983
  return;
34992
34984
  }
34993
- if (Array.isArray(val)) {
34985
+ if (Array.isArray(val) && (val === null || val === void 0 ? void 0 : val.length)) {
34994
34986
  value = val.map(function (m) {
34995
34987
  return m.value || m;
34996
34988
  }).join(',');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bit-sun/business-component",
3
- "version": "3.2.0-alpha.4",
3
+ "version": "3.2.2",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -60,7 +60,6 @@ const ResizeableTitle = (props) => {
60
60
  };
61
61
 
62
62
  export default (props: any) => {
63
- const [randomKey, ] = useState('max-height' + uuid());
64
63
  const bsTableCode = props?.tableCode || window.location.hash; //设置列字段的唯一标识
65
64
 
66
65
  // 获取 table columns中所有的 key 防止有的地方是 dataindex
@@ -170,37 +169,35 @@ const getSettingFieldOrColumn = (savedConfig, originConfig, type: string) => {
170
169
  // 获取table高度
171
170
  const getTableHeight = () => {
172
171
  setTimeout(() => {
173
- const clientBodyTopHeight = document.querySelector(`.${randomKey} .ant-table-body`).getBoundingClientRect().top;
174
- setHeight("calc(100vh - " + (clientBodyTopHeight + 67) + "px)");
175
- // const cancelHeight = window.top == window ? 303 : 223;
176
- // const isFullScreen: any =
177
- // window.top.document.fullScreen ||
178
- // window.top.document.webkitIsFullScreen ||
179
- // window.top.document.mozFullScreen;
180
-
181
- // // wujie子应用iframe首次加载获取不到client以及dom元素高度兼容处理
182
- // let realIframeClientHeight = document.body.clientHeight ? document.body.clientHeight : window.top?.document.body.clientHeight - 76;
183
- // let summaryHeight = document.querySelector(`.ant-tabs-tabpane-active .table-bssula-summary`) ?
184
- // (document.querySelector(`.ant-tabs-tabpane-active .table-bssula-summary`)?.clientHeight || 22) : 0;
185
- // let listTabHeight = document.querySelector(`.ant-tabs-tabpane-active .list_top_tab .ant-tabs-nav`) ?
186
- // (document.querySelector(`.ant-tabs-tabpane-active .list_top_tab .ant-tabs-nav`)?.clientHeight || 48) : 0;
187
-
188
-
189
- // const h =
190
- // realIframeClientHeight -
191
- // summaryHeight -
192
- // listTabHeight -
193
- // (document.querySelector(
194
- // `.ant-tabs-tabpane-active .ant-form ant-form-horizontal`,
195
- // )?.clientHeight || 0) -
196
- // (isFullScreen
197
- // ? 0
198
- // : document.querySelector(
199
- // `.ant-tabs-tabpane-active .ant-pro-page-container-warp`,
200
- // )?.clientHeight || 0) -
201
- // cancelHeight +
202
- // 'px';
203
- // setHeight(h);
172
+ const cancelHeight = window.top == window ? 303 : 223;
173
+ const isFullScreen: any =
174
+ window.top.document.fullScreen ||
175
+ window.top.document.webkitIsFullScreen ||
176
+ window.top.document.mozFullScreen;
177
+
178
+ // wujie子应用iframe首次加载获取不到client以及dom元素高度兼容处理
179
+ let realIframeClientHeight = document.body.clientHeight ? document.body.clientHeight : window.top?.document.body.clientHeight - 76;
180
+ let summaryHeight = document.querySelector(`.ant-tabs-tabpane-active .table-bssula-summary`) ?
181
+ (document.querySelector(`.ant-tabs-tabpane-active .table-bssula-summary`)?.clientHeight || 22) : 0;
182
+ let listTabHeight = document.querySelector(`.ant-tabs-tabpane-active .list_top_tab .ant-tabs-nav`) ?
183
+ (document.querySelector(`.ant-tabs-tabpane-active .list_top_tab .ant-tabs-nav`)?.clientHeight || 48) : 0;
184
+
185
+
186
+ const h =
187
+ realIframeClientHeight -
188
+ summaryHeight -
189
+ listTabHeight -
190
+ (document.querySelector(
191
+ `.ant-tabs-tabpane-active .ant-form ant-form-horizontal`,
192
+ )?.clientHeight || 0) -
193
+ (isFullScreen
194
+ ? 0
195
+ : document.querySelector(
196
+ `.ant-tabs-tabpane-active .ant-pro-page-container-warp`,
197
+ )?.clientHeight || 0) -
198
+ cancelHeight +
199
+ 'px';
200
+ setHeight(h);
204
201
  }, 0);
205
202
  };
206
203
 
@@ -315,7 +312,7 @@ const getSettingFieldOrColumn = (savedConfig, originConfig, type: string) => {
315
312
 
316
313
  //组件初始挂载
317
314
  useEffect(() => {
318
- getTableHeight();
315
+ // getTableHeight();
319
316
  setInitialTableInfo();
320
317
  setInitialSearchFieldsInfo();
321
318
  window.addEventListener('resize', (e) => {
@@ -741,11 +738,10 @@ const getSettingFieldOrColumn = (savedConfig, originConfig, type: string) => {
741
738
  props.statusMapping,
742
739
  showSearchFields,
743
740
  expandedRowKeys,
744
- height
745
741
  ],
746
742
  );
747
743
  return (
748
- <div id="bs-sula-query-table" className={randomKey}>
744
+ <div id="bs-sula-query-table">
749
745
  <MemoQueryTable {...memoConfig} />
750
746
  <SortableTable
751
747
  ref={sortTableRef}
@@ -478,7 +478,7 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
478
478
 
479
479
  const formaData = (value: any, source: any) => {
480
480
  if (labelInValue) {
481
- const formatResult = value.map((i: any) => ({ key: i[mappingValueField], label: i[mappingTextField], value: i[mappingValueField] }))
481
+ const formatResult = value.map((i: any) => ({ key: i[mappingValueField] || i.key, label: i[mappingTextField] || i.label, value: i[mappingValueField] || i.value }))
482
482
  onChange(selectMode ? formatResult : formatResult[0], value,source)
483
483
  } else {
484
484
  const formatResult = selectMode ? value.map((i: any) => i.value) : _.get(value[0], 'value')
@@ -1021,6 +1021,10 @@ class RuleObjectComponent extends Component {
1021
1021
  return pCode ? newPCode?.map((i) => moment(i)) : pCode;
1022
1022
  }
1023
1023
  }
1024
+ if(configItem?.inputType === 30) {
1025
+ const newPCode = Array.isArray(pCode) ? pCode?.map(s => isObj(s) ? s : ({ key: s, value: s })) : pCode?.split(',')?.map(s => ({ key: s, value: s }));
1026
+ return newPCode || pCode || defaultValue;
1027
+ }
1024
1028
  return pCode || defaultValue;
1025
1029
  };
1026
1030
  const handleEdit = (code, val, functionItem) => {
@@ -1031,7 +1035,7 @@ class RuleObjectComponent extends Component {
1031
1035
  });
1032
1036
  return;
1033
1037
  }
1034
- if (Array.isArray(val)) {
1038
+ if (Array.isArray(val) && val?.length) {
1035
1039
  value = val.map((m) => m.value || m).join(',');
1036
1040
  }
1037
1041
  if (isObj(val)) {
@@ -1,121 +0,0 @@
1
- ---
2
- nav:
3
- title: '组件'
4
- order: 1
5
- group:
6
- title: 业务组件
7
- order: 0
8
- title: BsSulaQueryTable 查询表格
9
- order: 3
10
- ---
11
-
12
- # BsSulaQueryTable 查询表格
13
-
14
- ## 基础用法
15
-
16
- ```tsx
17
- import React from 'react';
18
- import BsSulaQueryTable from './index';
19
-
20
- export default () => {
21
- const config = {
22
- needPageHeader: false,
23
- summary: [{
24
- label: '总金额',
25
- count: 100
26
- },{
27
- label: '运费',
28
- count: 100
29
- }],
30
- statusMapping: [{
31
- label: '初始化',
32
- key: 'qp-status-eq',
33
- count: 100, // 该状态单据总数,业务代码侧计算
34
- },{
35
- label: '待审核',
36
- key: 'qp-status-eq',
37
- count: 200,
38
- }],
39
- remoteDataSource: {
40
- url: `/user/managementApplication`,
41
- method: 'GET',
42
- convertParams: {
43
- type: 'tableConvertParamsType',
44
- initialParams: {
45
- sorter: 'desc-createTime',
46
- },
47
- },
48
- converter: 'bs-tableConvertType',
49
- },
50
- rowSelection: {},
51
- actionsRender: [
52
- {
53
- type: 'button',
54
- props: {
55
- type: 'primary',
56
- children: '新增销售单',
57
- },
58
- code: 'DRP_Sale_Bill_add',
59
- action: [
60
- {
61
- type: 'route',
62
- path: '/sales-management/sales-slip/create',
63
- },
64
- ],
65
- },
66
- ],
67
- fields: [
68
- {
69
- name: 'qp-code-eq',
70
- label: '应用编码',
71
- field: {
72
- type: 'input',
73
- props: {
74
- allowClear: true,
75
- maxLength: 32,
76
- placeholder: '请输入应用编码',
77
- },
78
- },
79
- },
80
- ],
81
- columns: [
82
- {
83
- dataIndex: 'code',
84
- title: '应用编码',
85
- tableHeadFilterKey: 'qp-code-eq',
86
- },
87
- {
88
- dataIndex: 'operator',
89
- title: '操作',
90
- fixed: 'right',
91
- render: [
92
- {
93
- type: 'link',
94
- code: 'User_ApplicationList_edit',
95
- props: {
96
- type: 'primary',
97
- children: '编辑',
98
- },
99
- visible: '#{record.status === 1}',
100
- },
101
- ],
102
- },
103
- ],
104
- rowKey: 'id',
105
- tableProps: {
106
- initialPaging: {
107
- pagination: {
108
- pageSize: 10,
109
- }
110
- }
111
- }
112
- };
113
-
114
- return (
115
- <div>
116
- <BsSulaQueryTable {...config} />
117
- </div>
118
- )
119
- }
120
-
121
- ```