@bit-sun/business-component 2.4.31-alpha.9 → 2.4.31

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.
Files changed (28) hide show
  1. package/dist/index.d.ts +0 -1
  2. package/dist/index.esm.js +823 -862
  3. package/dist/index.js +822 -864
  4. package/dist/utils/auth.d.ts +0 -1
  5. package/dist/utils/utils.d.ts +1 -1
  6. package/package.json +5 -8
  7. package/src/components/Business/AddSelectBusiness/index.md +0 -236
  8. package/src/components/Business/AddSelectBusiness/index.tsx +296 -333
  9. package/src/components/Business/BsLayouts/Components/GlobalHeader/index.tsx +1 -0
  10. package/src/components/Business/BsLayouts/index.tsx +23 -111
  11. package/src/components/Business/BsLayouts/utils.tsx +0 -2
  12. package/src/components/Business/BsSulaQueryTable/index.tsx +90 -44
  13. package/src/components/Business/CommodityEntry/index.md +1 -15
  14. package/src/components/Business/CommodityEntry/index.tsx +0 -1
  15. package/src/components/Business/DetailPageWrapper/index.tsx +1 -2
  16. package/src/components/Business/SearchSelect/index.md +1 -10
  17. package/src/components/Functional/AddSelect/helps.ts +1 -1
  18. package/src/components/Functional/AddSelect/index.tsx +223 -63
  19. package/src/components/Functional/DataImport/index.tsx +30 -35
  20. package/src/components/Functional/DataValidation/index.md +2 -15
  21. package/src/components/Functional/DataValidation/index.tsx +26 -39
  22. package/src/components/Functional/SearchSelect/index.tsx +1 -1
  23. package/src/index.ts +0 -1
  24. package/src/utils/auth.ts +1 -7
  25. package/dist/components/Functional/AccessWrapper/index.d.ts +0 -5
  26. package/dist/components/Functional/AuthButton/index.d.ts +0 -3
  27. package/src/components/Functional/AccessWrapper/index.tsx +0 -34
  28. package/src/components/Functional/AuthButton/index.tsx +0 -15
package/dist/index.js CHANGED
@@ -6,9 +6,8 @@ var axios = require('axios');
6
6
  var cookie = require('js-cookie');
7
7
  var antd = require('antd');
8
8
  var _ = require('lodash');
9
- var memoizeOne = require('memoize-one');
10
9
  var umi = require('umi');
11
- var isEqual = require('lodash/isEqual');
10
+ var isEqual$1 = require('lodash/isEqual');
12
11
  var React$1 = require('react');
13
12
  var moment$1 = require('moment');
14
13
  var icons = require('@ant-design/icons');
@@ -36,8 +35,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
36
35
  var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
37
36
  var cookie__default = /*#__PURE__*/_interopDefaultLegacy(cookie);
38
37
  var ___default = /*#__PURE__*/_interopDefaultLegacy(_);
39
- var memoizeOne__default = /*#__PURE__*/_interopDefaultLegacy(memoizeOne);
40
- var isEqual__default = /*#__PURE__*/_interopDefaultLegacy(isEqual);
38
+ var isEqual__default = /*#__PURE__*/_interopDefaultLegacy(isEqual$1);
41
39
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React$1);
42
40
  var moment__default = /*#__PURE__*/_interopDefaultLegacy(moment$1);
43
41
  var ProLayout__default = /*#__PURE__*/_interopDefaultLegacy(ProLayout);
@@ -990,6 +988,56 @@ var precisionQuantity = function precisionQuantity(num, accuracy) {
990
988
  return '';
991
989
  };
992
990
 
991
+ var safeIsNaN = Number.isNaN ||
992
+ function ponyfill(value) {
993
+ return typeof value === 'number' && value !== value;
994
+ };
995
+ function isEqual(first, second) {
996
+ if (first === second) {
997
+ return true;
998
+ }
999
+ if (safeIsNaN(first) && safeIsNaN(second)) {
1000
+ return true;
1001
+ }
1002
+ return false;
1003
+ }
1004
+ function areInputsEqual(newInputs, lastInputs) {
1005
+ if (newInputs.length !== lastInputs.length) {
1006
+ return false;
1007
+ }
1008
+ for (var i = 0; i < newInputs.length; i++) {
1009
+ if (!isEqual(newInputs[i], lastInputs[i])) {
1010
+ return false;
1011
+ }
1012
+ }
1013
+ return true;
1014
+ }
1015
+
1016
+ function memoizeOne(resultFn, isEqual) {
1017
+ if (isEqual === void 0) { isEqual = areInputsEqual; }
1018
+ var cache = null;
1019
+ function memoized() {
1020
+ var newArgs = [];
1021
+ for (var _i = 0; _i < arguments.length; _i++) {
1022
+ newArgs[_i] = arguments[_i];
1023
+ }
1024
+ if (cache && cache.lastThis === this && isEqual(newArgs, cache.lastArgs)) {
1025
+ return cache.lastResult;
1026
+ }
1027
+ var lastResult = resultFn.apply(this, newArgs);
1028
+ cache = {
1029
+ lastResult: lastResult,
1030
+ lastArgs: newArgs,
1031
+ lastThis: this,
1032
+ };
1033
+ return lastResult;
1034
+ }
1035
+ memoized.clear = function clear() {
1036
+ cache = null;
1037
+ };
1038
+ return memoized;
1039
+ }
1040
+
993
1041
  function styleInject(css, ref) {
994
1042
  if ( ref === void 0 ) ref = {};
995
1043
  var insertAt = ref.insertAt;
@@ -1313,7 +1361,7 @@ var formatter = function formatter(data, parentAuthority, parentName) {
1313
1361
  return item;
1314
1362
  });
1315
1363
  };
1316
- var memoizeOneFormatter = memoizeOne__default['default'](formatter, isEqual__default['default']);
1364
+ var memoizeOneFormatter = memoizeOne(formatter, isEqual__default['default']);
1317
1365
  var go2BackAndClose = function go2BackAndClose(backHistoryPath) {
1318
1366
  localStorage.setItem(ENUM.BROWSER_CACHE.CHILD_APP_BACK, 1);
1319
1367
  if (backHistoryPath) {
@@ -1474,7 +1522,7 @@ var judgeIsEmpty = function judgeIsEmpty(value) {
1474
1522
  // 判断某个按钮/菜单 是否有权限,返回布尔值
1475
1523
  var authFunc = function authFunc(code) {
1476
1524
  var _JSON$parse;
1477
- return !shouldUseAuth() ? true : (_JSON$parse = JSON.parse(localStorage.getItem(getMenuAuthDataKey()) || '[]')) === null || _JSON$parse === void 0 ? void 0 : _JSON$parse.find(function (d) {
1525
+ return (_JSON$parse = JSON.parse(localStorage.getItem(getMenuAuthDataKey()) || '[]')) === null || _JSON$parse === void 0 ? void 0 : _JSON$parse.find(function (d) {
1478
1526
  return d === code;
1479
1527
  });
1480
1528
  };
@@ -1500,11 +1548,6 @@ var handleJudgeAuthButtons = function handleJudgeAuthButtons(buttonCodeArray) {
1500
1548
  });
1501
1549
  return result;
1502
1550
  };
1503
- // 判断何时菜单权限和表格权限生效
1504
- var shouldUseAuth = function shouldUseAuth() {
1505
- // @ts-ignore
1506
- return window.__POWERED_BY_WUJIE__ ? true : false;
1507
- };
1508
1551
 
1509
1552
  var css_248z$1 = ".luckysheet {\n overflow: hidden;\n}\n.luckysheet .luckysheet-work-area.luckysheet-noselected-text {\n display: none;\n}\n.sheet_table_top {\n height: 50px;\n background: #f2f2f2;\n width: 100%;\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 0 20px;\n border: 1px solid #d8d8d8;\n}\n.sheet_table_top .menu_item_text {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.sheet_table_footer {\n height: 50px;\n background: #f2f2f2;\n width: 100%;\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 0 20px;\n border: 1px solid #d8d8d8;\n}\n.sheet_table_text {\n color: #8f8f8f;\n}\n.sheet_table_dnd_text {\n background: #f2f2f2;\n border: 1px solid #d8d8d8;\n display: inline-block;\n width: 100px;\n height: 30px;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n";
1510
1553
  styleInject(css_248z$1);
@@ -1553,21 +1596,8 @@ var filterLetters = function filterLetters(i) {
1553
1596
  return undefined;
1554
1597
  }
1555
1598
  };
1556
- // 抽象出创建对象的共通逻辑
1557
- function createItem(idPrefix, index, title, name, format) {
1558
- return {
1559
- id: "".concat(idPrefix).concat(index),
1560
- content: title,
1561
- code: name,
1562
- "ct": format //单元格值格式
1563
- };
1564
- }
1565
- // 定义[单元格值]常量以避免魔术字符串
1566
- var FORMAT_NAME_GENERAL = "General"; //格式名称为自动格式
1567
- var FORMAT_TYPE_STRING = "s"; //格式类型为数字类型
1568
1599
  var DataValidation = /*#__PURE__*/function (_React$Component) {
1569
1600
  function DataValidation(props) {
1570
- var _props$customerColumn;
1571
1601
  var _this;
1572
1602
  _classCallCheck(this, DataValidation);
1573
1603
  _this = _callSuper(this, DataValidation, [props]);
@@ -1582,7 +1612,6 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
1582
1612
  };
1583
1613
  _this.setConfig = function (data) {
1584
1614
  var items = _this.state.items;
1585
- var notValid = _this.props.notValid;
1586
1615
  return {
1587
1616
  container: 'luckysheet',
1588
1617
  showtoolbar: false,
@@ -1591,7 +1620,7 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
1591
1620
  if (columnAbc.name) {
1592
1621
  var charCode = columnAbc.name.charCodeAt();
1593
1622
  if (charCode - 65 <= items.length) {
1594
- columnAbc.name = itemsTemp[charCode - 65] ? itemsTemp[charCode - 65].content : !notValid ? '校验结果' : '';
1623
+ columnAbc.name = itemsTemp[charCode - 65] ? itemsTemp[charCode - 65].content : '校验结果';
1595
1624
  } else {
1596
1625
  columnAbc.name = '';
1597
1626
  }
@@ -1944,7 +1973,7 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
1944
1973
  onClick: function onClick() {
1945
1974
  return _this.filterData('all');
1946
1975
  }
1947
- }, "\u6E05\u7A7A\u5168\u90E8\u6570\u636E")), /*#__PURE__*/React__default['default'].createElement(antd.Menu.Divider, null), !_this.props.notValid && /*#__PURE__*/React__default['default'].createElement(antd.Menu.Item, {
1976
+ }, "\u6E05\u7A7A\u5168\u90E8\u6570\u636E")), /*#__PURE__*/React__default['default'].createElement(antd.Menu.Divider, null), /*#__PURE__*/React__default['default'].createElement(antd.Menu.Item, {
1948
1977
  key: "2",
1949
1978
  className: "sheet_table-menu_item_text"
1950
1979
  }, /*#__PURE__*/React__default['default'].createElement("a", {
@@ -1987,22 +2016,18 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
1987
2016
  }), provided.placeholder);
1988
2017
  }))));
1989
2018
  _this.props.onRef(_this);
1990
- var format = {
1991
- fa: FORMAT_NAME_GENERAL,
1992
- t: FORMAT_TYPE_STRING
1993
- };
1994
- if (props === null || props === void 0 ? void 0 : (_props$customerColumn = props.customerColumnsMapping) === null || _props$customerColumn === void 0 ? void 0 : _props$customerColumn.length) {
1995
- var _props$customerColumn2;
1996
- itemsTemp = (props === null || props === void 0 ? void 0 : (_props$customerColumn2 = props.customerColumnsMapping) === null || _props$customerColumn2 === void 0 ? void 0 : _props$customerColumn2.map(function (item, index) {
1997
- return createItem('item-0', index, item.title, item.name, format);
1998
- })) || [];
1999
- } else {
2000
- var _props$columns;
2001
- itemsTemp = (props === null || props === void 0 ? void 0 : (_props$columns = props.columns) === null || _props$columns === void 0 ? void 0 : _props$columns.map(function (item, index) {
2002
- if (!mapping.get(item)) throw Error("".concat(item, " is not in DataValidation component, please fix this error"));
2003
- return createItem('item-0', index, mapping.get(item), item, format);
2004
- })) || [];
2005
- }
2019
+ itemsTemp = props.columns.map(function (item, index) {
2020
+ if (!mapping.get(item)) throw Error("".concat(item, " is not in DataValidation component, please fix this error"));
2021
+ return {
2022
+ id: "item-0".concat(index),
2023
+ content: mapping.get(item),
2024
+ code: item,
2025
+ "ct": {
2026
+ "fa": "General",
2027
+ "t": "s" //格式类型为数字类型
2028
+ }
2029
+ };
2030
+ });
2006
2031
  luckysheet = window.luckysheet || window.top.luckysheet;
2007
2032
  _this.state = {
2008
2033
  showErrorData: false,
@@ -2043,9 +2068,7 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
2043
2068
  key: "render",
2044
2069
  value: function render() {
2045
2070
  var errorListCheck = this.state.errorListCheck;
2046
- var _this$props2 = this.props,
2047
- title = _this$props2.title,
2048
- notValid = _this$props2.notValid;
2071
+ var title = this.props.title;
2049
2072
  var totalSummary = this.getCount();
2050
2073
  var luckyCss = {
2051
2074
  margin: '0px',
@@ -2068,7 +2091,7 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
2068
2091
  trigger: ['click'],
2069
2092
  overlay: this.menuList,
2070
2093
  placement: "bottomRight"
2071
- }, /*#__PURE__*/React__default['default'].createElement(antd.Button, null, "\u6E05\u7A7A", /*#__PURE__*/React__default['default'].createElement(icons.DownOutlined, null))), !notValid && /*#__PURE__*/React__default['default'].createElement(antd.Button, {
2094
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Button, null, "\u6E05\u7A7A", /*#__PURE__*/React__default['default'].createElement(icons.DownOutlined, null))), /*#__PURE__*/React__default['default'].createElement(antd.Button, {
2072
2095
  type: "primary",
2073
2096
  onClick: this.resetData
2074
2097
  }, "\u8BC6\u522B"))), /*#__PURE__*/React__default['default'].createElement("div", {
@@ -2079,11 +2102,11 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
2079
2102
  }, /*#__PURE__*/React__default['default'].createElement("div", {
2080
2103
  id: "luckysheet",
2081
2104
  style: luckyCss
2082
- })), !this.props.notValid && /*#__PURE__*/React__default['default'].createElement("div", {
2105
+ })), /*#__PURE__*/React__default['default'].createElement("div", {
2083
2106
  className: "sheet_table_footer"
2084
2107
  }, /*#__PURE__*/React__default['default'].createElement("span", {
2085
2108
  className: "sheet_table_footer_l"
2086
- }, "\u5171 ", totalSummary.total, " \u6761\u6570\u636E", !notValid && ", \u5176\u4E2D\u9519\u8BEF ".concat(totalSummary.error, " \u9879")), !notValid && /*#__PURE__*/React__default['default'].createElement(antd.Space, {
2109
+ }, "\u5171 ", totalSummary.total, " \u6761\u6570\u636E, \u5176\u4E2D\u9519\u8BEF ", totalSummary.error, " \u9879"), /*#__PURE__*/React__default['default'].createElement(antd.Space, {
2087
2110
  className: "sheet_table_footer_r"
2088
2111
  }, /*#__PURE__*/React__default['default'].createElement(antd.Checkbox, {
2089
2112
  checked: errorListCheck,
@@ -2140,21 +2163,8 @@ var filterLetters$1 = function filterLetters(i) {
2140
2163
  return undefined;
2141
2164
  }
2142
2165
  };
2143
- // 抽象出创建对象的共通逻辑
2144
- function createItem$1(idPrefix, index, title, name, format) {
2145
- return {
2146
- id: "".concat(idPrefix).concat(index),
2147
- content: title,
2148
- code: name,
2149
- "ct": format //单元格值格式
2150
- };
2151
- }
2152
- // 定义[单元格值]常量以避免魔术字符串
2153
- var FORMAT_NAME_GENERAL$1 = "General"; //格式名称为自动格式
2154
- var FORMAT_TYPE_STRING$1 = "s"; //格式类型为数字类型
2155
2166
  var DataImport = /*#__PURE__*/function (_React$Component) {
2156
2167
  function DataImport(props) {
2157
- var _props$customerColumn;
2158
2168
  var _this;
2159
2169
  _classCallCheck(this, DataImport);
2160
2170
  _this = _callSuper(this, DataImport, [props]);
@@ -2396,32 +2406,22 @@ var DataImport = /*#__PURE__*/function (_React$Component) {
2396
2406
  });
2397
2407
  return obj;
2398
2408
  });
2399
- return data;
2409
+ return data.filter(function (item) {
2410
+ return item[_this.props.customerColumnsMapping[0].name];
2411
+ });
2400
2412
  };
2401
2413
  _this.resetData = function () {
2402
2414
  var _this$props = _this.props,
2403
2415
  validDataUrl = _this$props.validDataUrl,
2404
- validDataParams = _this$props.validDataParams,
2405
2416
  updateData = _this$props.updateData,
2406
- columns = _this$props.columns,
2407
- isBrandAuth = _this$props.isBrandAuth,
2408
- _this$props$isCheckSt = _this$props.isCheckStockNum,
2409
- isCheckStockNum = _this$props$isCheckSt === void 0 ? true : _this$props$isCheckSt;
2417
+ columns = _this$props.columns;
2410
2418
  var resultData = _this.getData().filter(function (d) {
2411
2419
  return ___default['default'].compact(Object.values(d)).length;
2412
2420
  });
2413
- // 处理业务参数
2414
- var otherParams = {};
2415
- if (isBrandAuth) {
2416
- otherParams = {
2417
- brandAuth: 'ctl-withAuth'
2418
- };
2419
- }
2420
- axios__default['default'].post(validDataUrl, _objectSpread2(_objectSpread2(_objectSpread2({}, otherParams), validDataParams), {}, {
2421
+ axios__default['default'].post(validDataUrl, {
2421
2422
  columns: columns,
2422
- data: resultData,
2423
- checkStockNum: isCheckStockNum
2424
- })).then(function (result) {
2423
+ data: resultData
2424
+ }).then(function (result) {
2425
2425
  result = result.data;
2426
2426
  if (judgeIsRequestError(result)) {
2427
2427
  antd.message.error(result.msg);
@@ -2574,21 +2574,31 @@ var DataImport = /*#__PURE__*/function (_React$Component) {
2574
2574
  }), provided.placeholder);
2575
2575
  }))));
2576
2576
  _this.props.onRef(_this);
2577
- var format = {
2578
- fa: FORMAT_NAME_GENERAL$1,
2579
- t: FORMAT_TYPE_STRING$1
2580
- };
2581
- if (props === null || props === void 0 ? void 0 : (_props$customerColumn = props.customerColumnsMapping) === null || _props$customerColumn === void 0 ? void 0 : _props$customerColumn.length) {
2582
- var _props$customerColumn2;
2583
- itemsTemp$1 = (props === null || props === void 0 ? void 0 : (_props$customerColumn2 = props.customerColumnsMapping) === null || _props$customerColumn2 === void 0 ? void 0 : _props$customerColumn2.map(function (item, index) {
2584
- return createItem$1('item-0', index, item.title, item.name, format);
2585
- })) || [];
2577
+ if (props.customerColumnsMapping) {
2578
+ itemsTemp$1 = props.customerColumnsMapping.map(function (item, index) {
2579
+ return {
2580
+ id: "item-0".concat(index),
2581
+ content: item.title,
2582
+ code: item.name,
2583
+ "ct": {
2584
+ "fa": "General",
2585
+ "t": "s" //格式类型为数字类型
2586
+ }
2587
+ };
2588
+ });
2586
2589
  } else {
2587
- var _props$columns;
2588
- itemsTemp$1 = (props === null || props === void 0 ? void 0 : (_props$columns = props.columns) === null || _props$columns === void 0 ? void 0 : _props$columns.map(function (item, index) {
2589
- if (!mapping$1.get(item)) throw Error("".concat(item, " is not in DataValidation component, please fix this error"));
2590
- return createItem$1('item-0', index, mapping$1.get(item), item, format);
2591
- })) || [];
2590
+ itemsTemp$1 = props.columns.map(function (item, index) {
2591
+ if (!mapping$1.get(item)) throw Error("".concat(item, " is not in DataImport component, please fix this error"));
2592
+ return {
2593
+ id: "item-0".concat(index),
2594
+ content: mapping$1.get(item),
2595
+ code: item,
2596
+ "ct": {
2597
+ "fa": "General",
2598
+ "t": "s" //格式类型为数字类型
2599
+ }
2600
+ };
2601
+ });
2592
2602
  }
2593
2603
  luckysheet$1 = window.luckysheet || window.top.luckysheet;
2594
2604
  _this.state = {
@@ -2632,7 +2642,8 @@ var DataImport = /*#__PURE__*/function (_React$Component) {
2632
2642
  var errorListCheck = this.state.errorListCheck;
2633
2643
  var _this$props2 = this.props,
2634
2644
  title = _this$props2.title,
2635
- notValid = _this$props2.notValid;
2645
+ notValid = _this$props2.notValid,
2646
+ customerColumnsMapping = _this$props2.customerColumnsMapping;
2636
2647
  var totalSummary = this.getCount();
2637
2648
  var luckyCss = {
2638
2649
  margin: '0px',
@@ -2845,7 +2856,7 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
2845
2856
  specialBracket = _ref$specialBracket === void 0 ? false : _ref$specialBracket,
2846
2857
  _ref$noNeedSplit = _ref.noNeedSplit,
2847
2858
  noNeedSplit = _ref$noNeedSplit === void 0 ? false : _ref$noNeedSplit;
2848
- var resultSourceKey = handleSourceName(sourceName || (requestConfig === null || requestConfig === void 0 ? void 0 : requestConfig.sourceName) || (ctx === null || ctx === void 0 ? void 0 : ctx.name) || 'supplierCode');
2859
+ var resultSourceKey = handleSourceName(sourceName || (requestConfig === null || requestConfig === void 0 ? void 0 : requestConfig.sourceName) || 'supplierCode');
2849
2860
  var selectMode = selectProps === null || selectProps === void 0 ? void 0 : selectProps.mode; // 设定当前选择器 为单选或者多选模式 无设定为单选模式(默认)
2850
2861
  var initVal = value || (selectMode ? [] : null);
2851
2862
  var pageSize = 100; // 下拉框默认分页 条数
@@ -4509,7 +4520,7 @@ var getSelectDataList = function getSelectDataList(record, item, selectKey) {
4509
4520
  var _item$dataSource;
4510
4521
  var result = [];
4511
4522
  if (item === null || item === void 0 ? void 0 : item.dataSourceCode) {
4512
- result = (record === null || record === void 0 ? void 0 : record[item === null || item === void 0 ? void 0 : item.dataSourceCode]) || [];
4523
+ result = record === null || record === void 0 ? void 0 : record[item === null || item === void 0 ? void 0 : item.dataSourceCode];
4513
4524
  }
4514
4525
  if (item === null || item === void 0 ? void 0 : (_item$dataSource = item.dataSource) === null || _item$dataSource === void 0 ? void 0 : _item$dataSource.length) {
4515
4526
  result = (item === null || item === void 0 ? void 0 : item.filterDataSourceCode) ? item.dataSource.filter(function (i) {
@@ -4623,11 +4634,12 @@ var ResizeableTitle = function ResizeableTitle(props) {
4623
4634
  var initTableCode = {
4624
4635
  'sku': ['skuSelect-tableOptionsToChoosePartCode', 'skuSelect-tableSelectedItemPartCode'],
4625
4636
  'skc': ['skcSelect-tableOptionsToChoosePartCode', 'skcSelect-tableSelectedItemPartCode'],
4626
- 'spu': ['spuSelect-tableOptionsToChoosePartCode', 'spuSelect-tableSelectedItemPartCode']
4637
+ 'spu': [['spuSelect-tableOptionsToChoosePartCode', 'spuSelect-tableSelectedItemPartCode']]
4627
4638
  };
4628
4639
  var Option$2 = antd.Select.Option;
4629
4640
  var AddSelect = function AddSelect(props) {
4630
4641
  var value = props.value,
4642
+ onChange = props.onChange,
4631
4643
  _props$selectProps = props.selectProps,
4632
4644
  selectProps = _props$selectProps === void 0 ? {} : _props$selectProps,
4633
4645
  _props$modalTableProp = props.modalTableProps,
@@ -4635,7 +4647,11 @@ var AddSelect = function AddSelect(props) {
4635
4647
  _props$labelInValue = props.labelInValue,
4636
4648
  labelInValue = _props$labelInValue === void 0 ? false : _props$labelInValue,
4637
4649
  requestConfig = props.requestConfig,
4650
+ ctx = props.ctx,
4638
4651
  sourceName = props.sourceName,
4652
+ _props$needModalTable = props.needModalTable,
4653
+ needModalTable = _props$needModalTable === void 0 ? true : _props$needModalTable,
4654
+ _props$getPopupContai = props.getPopupContainer,
4639
4655
  onSaveCallback = props.onSaveCallback,
4640
4656
  _props$buttonText = props.buttonText,
4641
4657
  buttonText = _props$buttonText === void 0 ? '添加' : _props$buttonText,
@@ -4652,8 +4668,15 @@ var AddSelect = function AddSelect(props) {
4652
4668
  url = _ref.url,
4653
4669
  otherParams = _ref.otherParams,
4654
4670
  isMap = _ref.isMap,
4671
+ fixedparameter = _ref.fixedparameter,
4672
+ fieldValToParam = _ref.fieldValToParam,
4673
+ _ref$mappingTextField = _ref.mappingTextField,
4674
+ mappingTextField = _ref$mappingTextField === void 0 ? 'name' : _ref$mappingTextField,
4675
+ mappingTextShowKeyField = _ref.mappingTextShowKeyField,
4655
4676
  _ref$mappingValueFiel = _ref.mappingValueField,
4656
- mappingValueField = _ref$mappingValueFiel === void 0 ? 'code' : _ref$mappingValueFiel;
4677
+ mappingValueField = _ref$mappingValueFiel === void 0 ? 'code' : _ref$mappingValueFiel,
4678
+ mappingTextShowTextField = _ref.mappingTextShowTextField;
4679
+ var resultSourceKey = sourceName || (requestConfig === null || requestConfig === void 0 ? void 0 : requestConfig.sourceName) || 'supplierCode';
4657
4680
  var realButtonProps = _objectSpread2({
4658
4681
  type: "primary"
4659
4682
  }, buttonProps);
@@ -4663,82 +4686,138 @@ var AddSelect = function AddSelect(props) {
4663
4686
  var pageSize = 100; // 下拉框默认分页 条数
4664
4687
  var tableInitPageSize = 10; // 弹框默认分页 条数
4665
4688
  var currentPage = 1;
4666
- var _useState = React$1.useState(false),
4689
+ var selectParamsKey = (requestConfig === null || requestConfig === void 0 ? void 0 : requestConfig.filter) || 'qp-codeAndName-like';
4690
+ var selectParamsInitKey = (requestConfig === null || requestConfig === void 0 ? void 0 : requestConfig.filterInit) || selectParamsKey;
4691
+ var currentSelectProps = _objectSpread2(_objectSpread2({}, selectProps), {}, {
4692
+ // 以下属性不可更改----设计配置项
4693
+ showSearch: false,
4694
+ filterOption: false,
4695
+ allowClear: true,
4696
+ listHeight: 160,
4697
+ optionLabelProp: "label",
4698
+ autoClearSearchValue: false
4699
+ });
4700
+ var _useState = React$1.useState([]),
4667
4701
  _useState2 = _slicedToArray(_useState, 2),
4668
- fetching = _useState2[0],
4669
- setFetching = _useState2[1];
4670
- var _useState3 = React$1.useState(false),
4702
+ items = _useState2[0],
4703
+ setItems = _useState2[1];
4704
+ var _useState3 = React$1.useState(1),
4671
4705
  _useState4 = _slicedToArray(_useState3, 2),
4672
- isModalVisible = _useState4[0],
4673
- setIsModalVisible = _useState4[1];
4674
- var _useState5 = React$1.useState(initVal),
4706
+ scrollPage = _useState4[0],
4707
+ setScrollPage = _useState4[1];
4708
+ var _useState5 = React$1.useState(0),
4675
4709
  _useState6 = _slicedToArray(_useState5, 2),
4676
- popvalue = _useState6[0],
4677
- setPopValue = _useState6[1];
4678
- var _useState7 = React$1.useState(sourceName),
4710
+ itemsTotal = _useState6[0],
4711
+ setItemsTotal = _useState6[1];
4712
+ var _useState7 = React$1.useState(false),
4679
4713
  _useState8 = _slicedToArray(_useState7, 2),
4680
- uniqueValue = _useState8[0],
4681
- setUniqueValue = _useState8[1];
4682
- var _Form$useForm = antd.Form.useForm(),
4683
- _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
4684
- form = _Form$useForm2[0];
4685
- var _useState9 = React$1.useState(modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.tableSearchForm),
4714
+ fetching = _useState8[0],
4715
+ setFetching = _useState8[1];
4716
+ var _useState9 = React$1.useState(''),
4686
4717
  _useState10 = _slicedToArray(_useState9, 2),
4687
- tableSearchForm = _useState10[0],
4688
- setTableSearchForm = _useState10[1];
4689
- var _useState11 = React$1.useState(true),
4718
+ searchValue = _useState10[0],
4719
+ setSearchValue = _useState10[1];
4720
+ var _useState11 = React$1.useState(false),
4690
4721
  _useState12 = _slicedToArray(_useState11, 2),
4691
- caretLeftFlag = _useState12[0],
4692
- setCaretLeftFlag = _useState12[1];
4693
- var _useState13 = React$1.useState([]),
4722
+ isModalVisible = _useState12[0],
4723
+ setIsModalVisible = _useState12[1];
4724
+ var _useState13 = React$1.useState(initVal),
4694
4725
  _useState14 = _slicedToArray(_useState13, 2),
4695
- tableData = _useState14[0],
4696
- setTableData = _useState14[1];
4697
- var _useState15 = React$1.useState({
4726
+ popvalue = _useState14[0],
4727
+ setPopValue = _useState14[1];
4728
+ var _useState15 = React$1.useState(sourceName),
4729
+ _useState16 = _slicedToArray(_useState15, 2),
4730
+ uniqueValue = _useState16[0],
4731
+ setUniqueValue = _useState16[1];
4732
+ var _useDebounceFn = ahooks.useDebounceFn(function (v) {
4733
+ // 优化搜索参数 支持传多个
4734
+ var searchParams = {};
4735
+ if (typeof selectParamsKey === 'string') {
4736
+ searchParams = v ? _defineProperty({}, selectParamsInitKey, initVal) : _defineProperty({}, selectParamsKey, searchValue);
4737
+ }
4738
+ if (Array.isArray(selectParamsKey)) {
4739
+ selectParamsKey.forEach(function (i) {
4740
+ searchParams = _objectSpread2(_objectSpread2({}, searchParams), {}, _defineProperty({}, i, searchValue));
4741
+ });
4742
+ }
4743
+ // 防抖函数 待定
4744
+ getData(searchParams);
4745
+ }, {
4746
+ wait: 1000
4747
+ }),
4748
+ run = _useDebounceFn.run;
4749
+ var _Form$useForm = antd.Form.useForm(),
4750
+ _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
4751
+ form = _Form$useForm2[0];
4752
+ var _useState17 = React$1.useState(modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.tableSearchForm),
4753
+ _useState18 = _slicedToArray(_useState17, 2),
4754
+ tableSearchForm = _useState18[0],
4755
+ setTableSearchForm = _useState18[1];
4756
+ var _useState19 = React$1.useState(true),
4757
+ _useState20 = _slicedToArray(_useState19, 2),
4758
+ caretLeftFlag = _useState20[0],
4759
+ setCaretLeftFlag = _useState20[1];
4760
+ var _useState21 = React$1.useState([]),
4761
+ _useState22 = _slicedToArray(_useState21, 2),
4762
+ tableData = _useState22[0],
4763
+ setTableData = _useState22[1];
4764
+ var _useState23 = React$1.useState({
4698
4765
  total: 0,
4699
4766
  size: "small",
4700
4767
  current: 1,
4701
4768
  pageSize: tableInitPageSize
4702
4769
  }),
4703
- _useState16 = _slicedToArray(_useState15, 2),
4704
- tablePagination = _useState16[0],
4705
- setTablePagination = _useState16[1];
4706
- var _useState17 = React$1.useState([]),
4707
- _useState18 = _slicedToArray(_useState17, 2),
4708
- selectedRowKeys = _useState18[0],
4709
- setSelectedRowKeys = _useState18[1];
4710
- var _useState19 = React$1.useState({}),
4711
- _useState20 = _slicedToArray(_useState19, 2),
4712
- tableFormParams = _useState20[0],
4713
- setTableFormParams = _useState20[1];
4714
- var _useState21 = React$1.useState(false),
4715
- _useState22 = _slicedToArray(_useState21, 2),
4716
- confirmLoading = _useState22[0],
4717
- setConfirmLoading = _useState22[1];
4718
- var _useState23 = React$1.useState(false),
4719
4770
  _useState24 = _slicedToArray(_useState23, 2),
4720
- confirmContinueLoading = _useState24[0],
4721
- setConfirmContinueLoading = _useState24[1];
4771
+ tablePagination = _useState24[0],
4772
+ setTablePagination = _useState24[1];
4722
4773
  var _useState25 = React$1.useState([]),
4723
4774
  _useState26 = _slicedToArray(_useState25, 2),
4724
- selectColumns = _useState26[0],
4725
- setSelectColumns = _useState26[1];
4775
+ selectedRowKeys = _useState26[0],
4776
+ setSelectedRowKeys = _useState26[1];
4726
4777
  var _useState27 = React$1.useState([]),
4727
4778
  _useState28 = _slicedToArray(_useState27, 2),
4728
- showColumns = _useState28[0],
4729
- setShowColumns = _useState28[1];
4730
- var _useState29 = React$1.useState([]),
4779
+ doubleArr = _useState28[0],
4780
+ setDoubleArr = _useState28[1]; // 存放双数组的数组
4781
+ var _useState29 = React$1.useState(false),
4731
4782
  _useState30 = _slicedToArray(_useState29, 2),
4732
- tableColumns = _useState30[0],
4733
- setTableColumns = _useState30[1];
4734
- var _useState31 = React$1.useState([]),
4783
+ checkedAll = _useState30[0],
4784
+ setCheckedAll = _useState30[1];
4785
+ var _useState31 = React$1.useState(false),
4735
4786
  _useState32 = _slicedToArray(_useState31, 2),
4736
- showToChooseColumns = _useState32[0],
4737
- setShowToChooseColumns = _useState32[1];
4787
+ indeterminate = _useState32[0],
4788
+ setIndeterminate = _useState32[1];
4789
+ var _useState33 = React$1.useState({}),
4790
+ _useState34 = _slicedToArray(_useState33, 2),
4791
+ tableFormParams = _useState34[0],
4792
+ setTableFormParams = _useState34[1];
4793
+ var _useState35 = React$1.useState(false),
4794
+ _useState36 = _slicedToArray(_useState35, 2),
4795
+ confirmLoading = _useState36[0],
4796
+ setConfirmLoading = _useState36[1];
4797
+ var _useState37 = React$1.useState(false),
4798
+ _useState38 = _slicedToArray(_useState37, 2),
4799
+ confirmContinueLoading = _useState38[0],
4800
+ setConfirmContinueLoading = _useState38[1];
4801
+ var _useState39 = React$1.useState([]),
4802
+ _useState40 = _slicedToArray(_useState39, 2),
4803
+ selectColumns = _useState40[0],
4804
+ setSelectColumns = _useState40[1];
4805
+ var _useState41 = React$1.useState([]),
4806
+ _useState42 = _slicedToArray(_useState41, 2),
4807
+ showColumns = _useState42[0],
4808
+ setShowColumns = _useState42[1];
4809
+ var _useState43 = React$1.useState([]),
4810
+ _useState44 = _slicedToArray(_useState43, 2),
4811
+ tableColumns = _useState44[0],
4812
+ setTableColumns = _useState44[1];
4813
+ var _useState45 = React$1.useState([]),
4814
+ _useState46 = _slicedToArray(_useState45, 2),
4815
+ showToChooseColumns = _useState46[0],
4816
+ setShowToChooseColumns = _useState46[1];
4738
4817
  var codeToChoose = tableCodeList[0] || initTableCode[businessType][0];
4739
4818
  var codeSelected = tableCodeList[1] || initTableCode[businessType][1];
4740
4819
  var checkSelectChange = /*#__PURE__*/function () {
4741
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(bType, tList, recordKey, recordItem, selectItem, changeValue) {
4820
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(bType, tList, recordKey, recordItem, selectItem, changeValue) {
4742
4821
  var result;
4743
4822
  return _regeneratorRuntime().wrap(function _callee$(_context) {
4744
4823
  while (1) switch (_context.prev = _context.next) {
@@ -4813,7 +4892,7 @@ var AddSelect = function AddSelect(props) {
4813
4892
  }, _callee, null, [[15, 22]]);
4814
4893
  }));
4815
4894
  return function checkSelectChange(_x, _x2, _x3, _x4, _x5, _x6) {
4816
- return _ref2.apply(this, arguments);
4895
+ return _ref4.apply(this, arguments);
4817
4896
  };
4818
4897
  }();
4819
4898
  var setBusinessDefaultValue = function setBusinessDefaultValue(list, recordList) {
@@ -4879,7 +4958,7 @@ var AddSelect = function AddSelect(props) {
4879
4958
  // precision: unitAccuracy
4880
4959
  };
4881
4960
  }
4882
- return /*#__PURE__*/React__default['default'].createElement(antd.InputNumber, _objectSpread2(_objectSpread2(_objectSpread2({}, item.inputProps), {}, {
4961
+ return /*#__PURE__*/React__default['default'].createElement(antd.InputNumber, _objectSpread2(_objectSpread2({
4883
4962
  value: text || '',
4884
4963
  min: 0,
4885
4964
  autoFocus: record.needFocus,
@@ -4887,7 +4966,13 @@ var AddSelect = function AddSelect(props) {
4887
4966
  }, precisionObj), {}, {
4888
4967
  onChange: function onChange(value) {
4889
4968
  record[item.dataIndex] = value;
4890
- editRecord(record);
4969
+ var newPopValue = popvalue.map(function (i, innerIndex) {
4970
+ if (innerIndex == index) {
4971
+ i[item.dataIndex] = record[item.dataIndex];
4972
+ }
4973
+ return i;
4974
+ });
4975
+ setPopValue(newPopValue);
4891
4976
  },
4892
4977
  // onFocus={(e)=> {
4893
4978
  // let dom1 = e.currentTarget;
@@ -4986,90 +5071,35 @@ var AddSelect = function AddSelect(props) {
4986
5071
  var selectKey = (item === null || item === void 0 ? void 0 : (_item$dataSourceMappi = item.dataSourceMapping) === null || _item$dataSourceMappi === void 0 ? void 0 : _item$dataSourceMappi[0]) || 'code';
4987
5072
  var selectText = (item === null || item === void 0 ? void 0 : (_item$dataSourceMappi2 = item.dataSourceMapping) === null || _item$dataSourceMappi2 === void 0 ? void 0 : _item$dataSourceMappi2[1]) || 'name';
4988
5073
  var dataSourceList = getSelectDataList(record, item, selectKey);
4989
- return /*#__PURE__*/React__default['default'].createElement(antd.Select, _objectSpread2(_objectSpread2({}, item.selectProps), {}, {
5074
+ return /*#__PURE__*/React__default['default'].createElement(antd.Select, {
4990
5075
  value: text || null,
4991
5076
  onChange: function () {
4992
5077
  var _onChange = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(value) {
4993
- var dataSourceSelectItem, _item$selectChangeCal, changeValue, isCheckPass, isConformToTheRules;
5078
+ var isConformToTheRules, newPopValue;
4994
5079
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
4995
5080
  while (1) switch (_context2.prev = _context2.next) {
4996
5081
  case 0:
4997
- dataSourceSelectItem = (dataSourceList === null || dataSourceList === void 0 ? void 0 : dataSourceList.find(function (d) {
4998
- return d[selectKey] == value;
4999
- })) || {};
5000
- if (!(item === null || item === void 0 ? void 0 : item.selectChangeCallback)) {
5001
- _context2.next = 6;
5002
- break;
5003
- }
5004
- _context2.next = 4;
5005
- return item === null || item === void 0 ? void 0 : (_item$selectChangeCal = item.selectChangeCallback) === null || _item$selectChangeCal === void 0 ? void 0 : _item$selectChangeCal.call(item, popvalue, setPopValue, {
5006
- record: record,
5007
- index: index,
5008
- item: item,
5009
- oldValue: text,
5010
- changeValue: value,
5011
- dataSourceSelectItem: dataSourceSelectItem,
5012
- editRecord: editRecord
5013
- });
5014
- case 4:
5015
- _context2.next = 25;
5016
- break;
5017
- case 6:
5018
- // 更新当前行数据函数
5019
- changeValue = function changeValue(v, dSSItem) {
5020
- var _item$dataSourceSelec;
5021
- record[item.dataIndex] = v;
5022
- // 下拉框带出需要回填的数据
5023
- if (item === null || item === void 0 ? void 0 : (_item$dataSourceSelec = item.dataSourceSelectBackData) === null || _item$dataSourceSelec === void 0 ? void 0 : _item$dataSourceSelec.length) {
5024
- item === null || item === void 0 ? void 0 : item.dataSourceSelectBackData.forEach(function (s) {
5025
- record[s] = dSSItem ? dSSItem[s] : null;
5026
- });
5027
- }
5028
- }; // 处理校验,默认不校验
5029
- isCheckPass = true;
5030
- _context2.prev = 8;
5031
- if (!(item === null || item === void 0 ? void 0 : item.selectCheckCallback)) {
5032
- _context2.next = 15;
5033
- break;
5034
- }
5035
- _context2.next = 12;
5036
- return item === null || item === void 0 ? void 0 : item.selectCheckCallback(popvalue, {
5037
- record: record,
5038
- index: index,
5039
- item: item,
5040
- oldValue: text,
5041
- changeValue: value,
5042
- dataSourceSelectItem: dataSourceSelectItem
5043
- });
5044
- case 12:
5045
- isCheckPass = _context2.sent;
5046
- _context2.next = 19;
5047
- break;
5048
- case 15:
5049
- _context2.next = 17;
5082
+ _context2.next = 2;
5050
5083
  return checkSelectChange(businessType, popvalue, mappingValueField, record, item, value);
5051
- case 17:
5084
+ case 2:
5052
5085
  isConformToTheRules = _context2.sent;
5053
- isCheckPass = !isConformToTheRules;
5054
- case 19:
5055
- _context2.next = 23;
5056
- break;
5057
- case 21:
5058
- _context2.prev = 21;
5059
- _context2.t0 = _context2["catch"](8);
5060
- case 23:
5061
- if (isCheckPass) {
5062
- changeValue(value, dataSourceSelectItem);
5086
+ if (isConformToTheRules) {
5087
+ record[item.dataIndex] = value;
5063
5088
  } else {
5064
- changeValue(null);
5089
+ record[item.dataIndex] = null;
5065
5090
  }
5066
- // 更新已选表格函数
5067
- editRecord(record);
5068
- case 25:
5091
+ newPopValue = popvalue.map(function (i, innerIndex) {
5092
+ if (innerIndex == index) {
5093
+ i[item.dataIndex] = record[item.dataIndex];
5094
+ }
5095
+ return i;
5096
+ });
5097
+ setPopValue(newPopValue);
5098
+ case 6:
5069
5099
  case "end":
5070
5100
  return _context2.stop();
5071
5101
  }
5072
- }, _callee2, null, [[8, 21]]);
5102
+ }, _callee2);
5073
5103
  }));
5074
5104
  function onChange(_x7) {
5075
5105
  return _onChange.apply(this, arguments);
@@ -5077,9 +5107,9 @@ var AddSelect = function AddSelect(props) {
5077
5107
  return onChange;
5078
5108
  }(),
5079
5109
  style: {
5080
- width: "".concat((item === null || item === void 0 ? void 0 : item.width) && (item === null || item === void 0 ? void 0 : item.width) - 20 || '160', "px")
5110
+ width: '160px'
5081
5111
  }
5082
- }), dataSourceList === null || dataSourceList === void 0 ? void 0 : dataSourceList.map(function (item) {
5112
+ }, dataSourceList.map(function (item) {
5083
5113
  return /*#__PURE__*/React__default['default'].createElement(antd.Select.Option, {
5084
5114
  value: item[selectKey]
5085
5115
  }, item[selectText]);
@@ -5112,10 +5142,20 @@ var AddSelect = function AddSelect(props) {
5112
5142
  // 获取数据源 (type: 1下拉框 2弹框 不传值默认为下拉框)
5113
5143
  var getData = function getData() {
5114
5144
  var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
5145
+ var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
5115
5146
  if (!requestConfig) return;
5116
5147
  setFetching(true);
5117
5148
  // 处理dependence参数
5118
5149
  var fixedParam = {};
5150
+ if (fixedparameter && fieldValToParam && ctx) {
5151
+ fixedparameter.forEach(function (item, index) {
5152
+ var fixedParamVal = ctx.form.getFieldValue(fieldValToParam[index]);
5153
+ if (fixedParamVal) {
5154
+ fixedParam[item] = fixedParamVal;
5155
+ form.setFieldsValue(_objectSpread2(_objectSpread2({}, form === null || form === void 0 ? void 0 : form.getFieldsValue()), {}, _defineProperty({}, item, fixedParamVal)));
5156
+ }
5157
+ });
5158
+ }
5119
5159
  // 数组对象处理,对带有特殊标记的name进行处理
5120
5160
  var _loop = function _loop() {
5121
5161
  if (Object.prototype.hasOwnProperty.call(params, key)) {
@@ -5221,7 +5261,21 @@ var AddSelect = function AddSelect(props) {
5221
5261
  var keys = res.list ? 'list' : 'items';
5222
5262
  source = res ? res[keys] ? res[keys].map(function (item) {
5223
5263
  var _item$packingUnitList, _item$packingUnitList2;
5264
+ var textShowText = item[mappingTextField];
5265
+ if (mappingTextShowTextField) {
5266
+ textShowText = [];
5267
+ if (Array.isArray(mappingTextShowTextField)) {
5268
+ mappingTextShowTextField.forEach(function (r) {
5269
+ textShowText.push(item[r]);
5270
+ });
5271
+ } else {
5272
+ textShowText = item[mappingTextShowTextField];
5273
+ }
5274
+ }
5224
5275
  return _objectSpread2(_objectSpread2({}, item), {}, {
5276
+ text: item[mappingTextField],
5277
+ textShowText: textShowText,
5278
+ textShowKey: item[mappingTextShowKeyField || mappingValueField],
5225
5279
  value: item[mappingValueField],
5226
5280
  baseUnitCode: item === null || item === void 0 ? void 0 : (_item$packingUnitList = item.packingUnitList) === null || _item$packingUnitList === void 0 ? void 0 : (_item$packingUnitList2 = _item$packingUnitList.find(function (item) {
5227
5281
  return item.baseUnit === true;
@@ -5229,7 +5283,21 @@ var AddSelect = function AddSelect(props) {
5229
5283
  });
5230
5284
  }) : Array.isArray(res) && (res === null || res === void 0 ? void 0 : res.map(function (item) {
5231
5285
  var _item$packingUnitList3, _item$packingUnitList4;
5286
+ var textShowText = item[mappingTextField];
5287
+ if (mappingTextShowTextField) {
5288
+ textShowText = [];
5289
+ if (Array.isArray(mappingTextShowTextField)) {
5290
+ mappingTextShowTextField.forEach(function (r) {
5291
+ textShowText.push(item[r]);
5292
+ });
5293
+ } else {
5294
+ textShowText = item[mappingTextShowTextField];
5295
+ }
5296
+ }
5232
5297
  return _objectSpread2(_objectSpread2({}, item), {}, {
5298
+ text: item[mappingTextField],
5299
+ textShowText: textShowText,
5300
+ textShowKey: item[mappingTextShowKeyField || mappingValueField],
5233
5301
  value: item[mappingValueField],
5234
5302
  baseUnitCode: item === null || item === void 0 ? void 0 : (_item$packingUnitList3 = item.packingUnitList) === null || _item$packingUnitList3 === void 0 ? void 0 : (_item$packingUnitList4 = _item$packingUnitList3.find(function (item) {
5235
5303
  return item.baseUnit === true;
@@ -5238,12 +5306,19 @@ var AddSelect = function AddSelect(props) {
5238
5306
  })) : [];
5239
5307
  }
5240
5308
  source = Array.isArray(source) ? source : [];
5241
- setTableData(source);
5242
- setTablePagination(_objectSpread2(_objectSpread2({}, tablePagination), {}, {
5243
- total: Number((res === null || res === void 0 ? void 0 : res.total) || (res === null || res === void 0 ? void 0 : res.totalCount) || source.length),
5244
- pageSize: Number((res === null || res === void 0 ? void 0 : res.size) || (res === null || res === void 0 ? void 0 : res.pageSize) || (params === null || params === void 0 ? void 0 : params.pageSize) || pageSize),
5245
- current: Number((res === null || res === void 0 ? void 0 : res.page) || (res === null || res === void 0 ? void 0 : res.currentPage) || (params === null || params === void 0 ? void 0 : params.currentPage) || currentPage)
5246
- }));
5309
+ if (type === 1) {
5310
+ var _ctx$form;
5311
+ ctx === null || ctx === void 0 ? void 0 : (_ctx$form = ctx.form) === null || _ctx$form === void 0 ? void 0 : _ctx$form.setFieldSource(resultSourceKey, source);
5312
+ setItems(source);
5313
+ setItemsTotal(Number((res === null || res === void 0 ? void 0 : res.total) || (res === null || res === void 0 ? void 0 : res.totalCount) || source.length));
5314
+ } else {
5315
+ setTableData(source);
5316
+ setTablePagination(_objectSpread2(_objectSpread2({}, tablePagination), {}, {
5317
+ total: Number((res === null || res === void 0 ? void 0 : res.total) || (res === null || res === void 0 ? void 0 : res.totalCount) || source.length),
5318
+ pageSize: Number((res === null || res === void 0 ? void 0 : res.size) || (res === null || res === void 0 ? void 0 : res.pageSize) || (params === null || params === void 0 ? void 0 : params.pageSize) || pageSize),
5319
+ current: Number((res === null || res === void 0 ? void 0 : res.page) || (res === null || res === void 0 ? void 0 : res.currentPage) || (params === null || params === void 0 ? void 0 : params.currentPage) || currentPage)
5320
+ }));
5321
+ }
5247
5322
  }).catch(function (err) {
5248
5323
  setFetching(false);
5249
5324
  });
@@ -5285,6 +5360,12 @@ var AddSelect = function AddSelect(props) {
5285
5360
  value: i
5286
5361
  };
5287
5362
  }));
5363
+ setIndeterminate(!!value.length && value.length < itemsTotal);
5364
+ setCheckedAll(itemsTotal && value.length === itemsTotal);
5365
+ // 需清空数据
5366
+ if (!value.length) {
5367
+ setDoubleArr([]);
5368
+ }
5288
5369
  } else {
5289
5370
  setSelectedRowKeys(labelInValue ? [value.key] : [value]);
5290
5371
  setPopValue(labelInValue ? [{
@@ -5319,6 +5400,7 @@ var AddSelect = function AddSelect(props) {
5319
5400
  antd.message.warning('至少选中一条数据');
5320
5401
  return;
5321
5402
  }
5403
+ // handleSelectOver(popvalue)
5322
5404
  if (onSaveCallback) {
5323
5405
  handleLoading(isContinue, true);
5324
5406
  onSaveCallback(popvalue).then(function (res) {
@@ -5354,6 +5436,9 @@ var AddSelect = function AddSelect(props) {
5354
5436
  setTableFormParams({});
5355
5437
  setIsModalVisible(false);
5356
5438
  setTableData([]);
5439
+ // if (selectMode) {
5440
+ // run();
5441
+ // }
5357
5442
  };
5358
5443
  var onSearchTable = function onSearchTable() {
5359
5444
  var params = form.getFieldsValue();
@@ -5361,6 +5446,9 @@ var AddSelect = function AddSelect(props) {
5361
5446
  getData(_objectSpread2(_objectSpread2({}, params), {}, {
5362
5447
  pageSize: tableInitPageSize
5363
5448
  }), 2);
5449
+ // if (selectMode) {
5450
+ // getData(params)
5451
+ // }
5364
5452
  };
5365
5453
  var onResetTable = function onResetTable() {
5366
5454
  form.resetFields();
@@ -5399,6 +5487,8 @@ var AddSelect = function AddSelect(props) {
5399
5487
  setPopValue(selectRows);
5400
5488
  setSelectedRowKeys(selectKeys);
5401
5489
  }
5490
+ // setIndeterminate(!!filterRows.length && filterRows.length < tablePagination?.total);
5491
+ // setCheckedAll(filterRows.length === tablePagination?.total);
5402
5492
  };
5403
5493
  // 生成唯一值
5404
5494
  var makeUniqueValue = function makeUniqueValue() {
@@ -5527,15 +5617,6 @@ var AddSelect = function AddSelect(props) {
5527
5617
  })));
5528
5618
  }
5529
5619
  };
5530
- var editRecord = function editRecord(record) {
5531
- var newPopValue = _toConsumableArray(popvalue);
5532
- var index = newPopValue.findIndex(function (item) {
5533
- return record[selectRowKey] == item[selectRowKey];
5534
- });
5535
- var item = newPopValue[index];
5536
- newPopValue.splice(index, 1, _objectSpread2(_objectSpread2({}, item), record));
5537
- setPopValue(_toConsumableArray(newPopValue));
5538
- };
5539
5620
  var inputIndex = 0;
5540
5621
  React$1.useEffect(function () {
5541
5622
  setInitialShowColumn(codeSelected, selectColumns, function (res) {
@@ -5548,8 +5629,8 @@ var AddSelect = function AddSelect(props) {
5548
5629
  });
5549
5630
  }, [tableColumns]);
5550
5631
  var handleResize = function handleResize(arr, index, callback) {
5551
- return function (_, _ref3) {
5552
- var size = _ref3.size;
5632
+ return function (_, _ref5) {
5633
+ var size = _ref5.size;
5553
5634
  var newColumns = arr.map(function (col) {
5554
5635
  return _objectSpread2({}, col);
5555
5636
  });
@@ -5614,7 +5695,7 @@ var AddSelect = function AddSelect(props) {
5614
5695
  id: "add_select_div_".concat(uniqueValue)
5615
5696
  }, /*#__PURE__*/React__default['default'].createElement(antd.Button, _objectSpread2({
5616
5697
  onClick: handleShowModal
5617
- }, realButtonProps), buttonText)), isModalVisible && ( /*#__PURE__*/React__default['default'].createElement(antd.Modal, {
5698
+ }, realButtonProps), buttonText)), needModalTable && isModalVisible && ( /*#__PURE__*/React__default['default'].createElement(antd.Modal, {
5618
5699
  width: '1200px',
5619
5700
  style: {
5620
5701
  top: 20
@@ -5622,6 +5703,7 @@ var AddSelect = function AddSelect(props) {
5622
5703
  bodyStyle: {
5623
5704
  padding: '0px'
5624
5705
  },
5706
+ // title={modalTableProps?.modalTableTitle}
5625
5707
  visible: isModalVisible,
5626
5708
  closable: false,
5627
5709
  onCancel: handleCancel,
@@ -5767,6 +5849,7 @@ var AddSelect = function AddSelect(props) {
5767
5849
  columns: showSelectedCol,
5768
5850
  dataSource: popvalue,
5769
5851
  pagination: false,
5852
+ // onChange={handleTableChange}
5770
5853
  rowKey: selectRowKey,
5771
5854
  rowClassName: 'row-class',
5772
5855
  scroll: {
@@ -9253,40 +9336,10 @@ var BusinessSearchSelect$1 = /*#__PURE__*/React__default['default'].memo(Busines
9253
9336
  // import { getCurrentTargetBgId } from '@/utils/LocalstorageUtils';
9254
9337
  function handleSelectColumn(c, parentProps) {
9255
9338
  var result = c;
9256
- var showColumns = (parentProps === null || parentProps === void 0 ? void 0 : parentProps.showColumns) || (parentProps === null || parentProps === void 0 ? void 0 : parentProps.showSelectColumns) || [];
9257
- var exceptColumns = (parentProps === null || parentProps === void 0 ? void 0 : parentProps.exceptColumns) || (parentProps === null || parentProps === void 0 ? void 0 : parentProps.exceptSelectColumns) || [];
9258
- var coverColumns = (parentProps === null || parentProps === void 0 ? void 0 : parentProps.coverColumns) || (parentProps === null || parentProps === void 0 ? void 0 : parentProps.coverSelectColumns) || [];
9259
- var additionColumns = (parentProps === null || parentProps === void 0 ? void 0 : parentProps.additionColumns) || (parentProps === null || parentProps === void 0 ? void 0 : parentProps.additionSelectColumns) || [];
9260
- // 仅展示内容
9261
- if (showColumns === null || showColumns === void 0 ? void 0 : showColumns.length) {
9262
- result = result.filter(function (i) {
9263
- return showColumns.includes(i.dataIndex);
9264
- });
9265
- }
9266
- // 过滤不需要展示内容
9267
- if (exceptColumns === null || exceptColumns === void 0 ? void 0 : exceptColumns.length) {
9268
- result = result.filter(function (i) {
9269
- return !exceptColumns.includes(i.dataIndex);
9270
- });
9271
- }
9272
- // 追加(最好不用这个,当组件不固定时候会有影响)
9273
- if (additionColumns === null || additionColumns === void 0 ? void 0 : additionColumns.length) {
9274
- additionColumns.forEach(function (i) {
9275
- result.splice(i.position, 0, i.column);
9276
- });
9277
- }
9278
- // 覆盖内容
9279
- if (coverColumns === null || coverColumns === void 0 ? void 0 : coverColumns.length) {
9280
- result = coverColumns;
9281
- }
9282
- return result;
9283
- }
9284
- function handleTableColumn(c, parentProps) {
9285
- var result = c;
9286
- var showColumns = (parentProps === null || parentProps === void 0 ? void 0 : parentProps.showColumns) || (parentProps === null || parentProps === void 0 ? void 0 : parentProps.showTableColumns) || [];
9287
- var exceptColumns = (parentProps === null || parentProps === void 0 ? void 0 : parentProps.exceptColumns) || (parentProps === null || parentProps === void 0 ? void 0 : parentProps.exceptTableColumns) || [];
9288
- var coverColumns = (parentProps === null || parentProps === void 0 ? void 0 : parentProps.coverColumns) || (parentProps === null || parentProps === void 0 ? void 0 : parentProps.coverTableColumns) || [];
9289
- var additionColumns = (parentProps === null || parentProps === void 0 ? void 0 : parentProps.additionColumns) || (parentProps === null || parentProps === void 0 ? void 0 : parentProps.additionTableColumns) || [];
9339
+ var showColumns = (parentProps === null || parentProps === void 0 ? void 0 : parentProps.showColumns) || [];
9340
+ var exceptColumns = (parentProps === null || parentProps === void 0 ? void 0 : parentProps.exceptColumns) || [];
9341
+ var coverColumns = (parentProps === null || parentProps === void 0 ? void 0 : parentProps.coverColumns) || [];
9342
+ var additionColumns = (parentProps === null || parentProps === void 0 ? void 0 : parentProps.additionColumns) || [];
9290
9343
  // 仅展示内容
9291
9344
  if (showColumns === null || showColumns === void 0 ? void 0 : showColumns.length) {
9292
9345
  result = result.filter(function (i) {
@@ -9606,7 +9659,7 @@ var AddSkuSelect = function AddSkuSelect(parProps) {
9606
9659
  },
9607
9660
  dataIndex: 'brandName'
9608
9661
  }]);
9609
- var mTpTableColumn = handleTableColumn(initialTableColumn, parProps);
9662
+ var mTpTableColumn = handleSelectColumn(initialTableColumn, parProps);
9610
9663
  var initialTableSearchForm = [{
9611
9664
  name: 'qp-skuCode-like',
9612
9665
  label: 'SKU编码'
@@ -9718,7 +9771,7 @@ var AddSkuSelect = function AddSkuSelect(parProps) {
9718
9771
  isAllowRepeatedSelect: !!(parProps === null || parProps === void 0 ? void 0 : parProps.isAllowRepeatedSelect)
9719
9772
  };
9720
9773
  var modalTableProps = {
9721
- modalTableTitle: parProps.modalTableTitle || '选择商品',
9774
+ modalTableTitle: '选择商品',
9722
9775
  tableSearchForm: mTpTableSearchForm,
9723
9776
  tableColumns: mTpTableColumn,
9724
9777
  selectColumn: mTpSelectColumn,
@@ -9797,190 +9850,12 @@ var AddSkcSelect = function AddSkcSelect(parProps) {
9797
9850
  dataIndex: 'count'
9798
9851
  }];
9799
9852
  var mTpSelectColumn = handleSelectColumn(initialSelectColumn, parProps);
9800
- var initialTableColumn = [{
9801
- title: 'SKC编码',
9802
- width: 150,
9803
- dataIndex: 'code'
9804
- }, {
9805
- title: 'SKC名称',
9806
- width: 200,
9807
- ellipsis: {
9808
- showTitle: false
9809
- },
9810
- render: function render(text) {
9811
- return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
9812
- placement: "topLeft",
9813
- title: text
9814
- }, text);
9815
- },
9816
- dataIndex: 'name'
9817
- }, {
9818
- title: '商品名称',
9819
- width: 100,
9820
- ellipsis: {
9821
- showTitle: false
9822
- },
9823
- dataIndex: 'itemName',
9824
- render: function render(text) {
9825
- return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
9826
- placement: "topLeft",
9827
- title: text
9828
- }, text);
9829
- }
9830
- }, {
9831
- title: '颜色',
9832
- width: 100,
9833
- ellipsis: {
9834
- showTitle: false
9835
- },
9836
- render: function render(text) {
9837
- return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
9838
- placement: "topLeft",
9839
- title: text
9840
- }, text);
9841
- },
9842
- dataIndex: 'colorName'
9843
- }, {
9844
- title: '类目',
9845
- width: 100,
9846
- ellipsis: {
9847
- showTitle: false
9848
- },
9849
- render: function render(text) {
9850
- return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
9851
- placement: "topLeft",
9852
- title: text
9853
- }, text);
9854
- },
9855
- dataIndex: 'categoryName'
9856
- }, {
9857
- title: '品类',
9858
- width: 100,
9859
- ellipsis: {
9860
- showTitle: false
9861
- },
9862
- render: function render(text) {
9863
- return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
9864
- placement: "topLeft",
9865
- title: text
9866
- }, text);
9867
- },
9868
- dataIndex: 'className'
9869
- }, {
9870
- title: '品牌',
9871
- width: 100,
9872
- ellipsis: {
9873
- showTitle: false
9874
- },
9875
- render: function render(text) {
9876
- return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
9877
- placement: "topLeft",
9878
- title: text
9879
- }, text);
9880
- },
9881
- dataIndex: 'brandName'
9882
- }];
9883
- var mTpTableColumn = handleTableColumn(initialTableColumn, parProps);
9884
- var initialTableSearchForm = [{
9885
- name: 'qp-code-like',
9886
- label: 'SKC编码'
9887
- }, {
9888
- name: 'qp-skcName-like',
9889
- label: 'SKC名称'
9890
- }, {
9891
- name: 'qp-itemName-like',
9892
- label: '商品名称'
9893
- }, {
9894
- name: 'qp-colorName-in',
9895
- type: 'select',
9896
- label: '颜色',
9897
- field: {
9898
- type: 'select',
9899
- props: {
9900
- mode: 'multiple',
9901
- notFoundContent: '暂无数据',
9902
- allowClear: true,
9903
- showSearch: true,
9904
- showArrow: true,
9905
- maxTagCount: 1,
9906
- optionFilterProp: 'children',
9907
- filterOption: function filterOption(input, option) {
9908
- return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
9909
- }
9910
- }
9911
- }
9912
- }, {
9913
- name: 'qp-categoryId-in',
9914
- type: 'treeSelect',
9915
- label: '类目',
9916
- field: {
9917
- type: 'treeSelect',
9918
- props: {
9919
- treeData: [],
9920
- treeCheckable: true,
9921
- showSearch: true,
9922
- allowClear: true,
9923
- showArrow: true,
9924
- treeNodeFilterProp: 'title',
9925
- treeDefaultExpandAll: true,
9926
- maxTagCount: 1,
9927
- placeholder: '请选择',
9928
- style: {
9929
- width: '100%'
9930
- },
9931
- dropdownStyle: {
9932
- maxHeight: 400,
9933
- maxWidth: 100,
9934
- overflow: 'auto'
9935
- }
9936
- }
9937
- }
9938
- }, {
9939
- name: 'qp-classId-in',
9940
- type: 'select',
9941
- label: '品类',
9942
- field: {
9943
- type: 'select',
9944
- props: {
9945
- mode: 'multiple',
9946
- notFoundContent: '暂无数据',
9947
- allowClear: true,
9948
- showSearch: true,
9949
- showArrow: true,
9950
- maxTagCount: 1,
9951
- optionFilterProp: 'children',
9952
- filterOption: function filterOption(input, option) {
9953
- return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
9954
- }
9955
- }
9956
- }
9957
- }, {
9958
- name: 'qp-brandId-in',
9959
- type: 'select',
9960
- label: '品牌',
9961
- field: {
9962
- type: 'select',
9963
- props: {
9964
- mode: 'multiple',
9965
- notFoundContent: '暂无数据',
9966
- allowClear: true,
9967
- showSearch: true,
9968
- showArrow: true,
9969
- maxTagCount: 1,
9970
- optionFilterProp: 'children',
9971
- filterOption: function filterOption(input, option) {
9972
- return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
9973
- }
9974
- }
9975
- }
9976
- }];
9977
- var mTpTableSearchForm = handleSearchForm(initialTableSearchForm, parProps);
9978
- var initialPromiseLoadList = [{
9979
- url: "/items/item/propertyValue/sizeBySkcConfig",
9980
- params: {
9981
- pageSize: 10000,
9982
- currentPage: 1,
9983
- type: 2 // 类型:1尺码;2颜色
9853
+ var initialPromiseLoadList = [{
9854
+ url: "/items/item/propertyValue/sizeBySkcConfig",
9855
+ params: {
9856
+ pageSize: 10000,
9857
+ currentPage: 1,
9858
+ type: 2 // 类型:1尺码;2颜色
9984
9859
  },
9985
9860
  resType: 'list',
9986
9861
  resPosition: 3,
@@ -10013,7 +9888,6 @@ var AddSkcSelect = function AddSkcSelect(parProps) {
10013
9888
  resPosition: 6,
10014
9889
  resKeyValue: ['id', 'name']
10015
9890
  }];
10016
- var mTpPromiseLoadList = handleFormSearchSourceLoad(initialPromiseLoadList, parProps);
10017
9891
  var props = {
10018
9892
  buttonText: parProps.buttonText || '新增',
10019
9893
  buttonProps: parProps.buttonProps || {},
@@ -10040,11 +9914,185 @@ var AddSkcSelect = function AddSkcSelect(parProps) {
10040
9914
  isAllowRepeatedSelect: (parProps === null || parProps === void 0 ? void 0 : parProps.isAllowRepeatedSelect) !== undefined ? !!(parProps === null || parProps === void 0 ? void 0 : parProps.isAllowRepeatedSelect) : true // 默认开启一行选多次
10041
9915
  };
10042
9916
  var modalTableProps = {
10043
- modalTableTitle: parProps.modalTableTitle || '选择商品',
10044
- tableSearchForm: mTpTableSearchForm,
10045
- tableColumns: mTpTableColumn,
9917
+ modalTableTitle: '选择商品',
9918
+ tableSearchForm: [{
9919
+ name: 'qp-code-like',
9920
+ label: 'SKC编码'
9921
+ }, {
9922
+ name: 'qp-skcName-like',
9923
+ label: 'SKC名称'
9924
+ }, {
9925
+ name: 'qp-itemName-like',
9926
+ label: '商品名称'
9927
+ }, {
9928
+ name: 'qp-colorName-in',
9929
+ type: 'select',
9930
+ label: '颜色',
9931
+ field: {
9932
+ type: 'select',
9933
+ props: {
9934
+ mode: 'multiple',
9935
+ notFoundContent: '暂无数据',
9936
+ allowClear: true,
9937
+ showSearch: true,
9938
+ showArrow: true,
9939
+ maxTagCount: 1,
9940
+ optionFilterProp: 'children',
9941
+ filterOption: function filterOption(input, option) {
9942
+ return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
9943
+ }
9944
+ }
9945
+ }
9946
+ }, {
9947
+ name: 'qp-categoryId-in',
9948
+ type: 'treeSelect',
9949
+ label: '类目',
9950
+ field: {
9951
+ type: 'treeSelect',
9952
+ props: {
9953
+ treeData: [],
9954
+ treeCheckable: true,
9955
+ showSearch: true,
9956
+ allowClear: true,
9957
+ showArrow: true,
9958
+ treeNodeFilterProp: 'title',
9959
+ treeDefaultExpandAll: true,
9960
+ maxTagCount: 1,
9961
+ placeholder: '请选择',
9962
+ style: {
9963
+ width: '100%'
9964
+ },
9965
+ dropdownStyle: {
9966
+ maxHeight: 400,
9967
+ maxWidth: 100,
9968
+ overflow: 'auto'
9969
+ }
9970
+ }
9971
+ }
9972
+ }, {
9973
+ name: 'qp-classId-in',
9974
+ type: 'select',
9975
+ label: '品类',
9976
+ field: {
9977
+ type: 'select',
9978
+ props: {
9979
+ mode: 'multiple',
9980
+ notFoundContent: '暂无数据',
9981
+ allowClear: true,
9982
+ showSearch: true,
9983
+ showArrow: true,
9984
+ maxTagCount: 1,
9985
+ optionFilterProp: 'children',
9986
+ filterOption: function filterOption(input, option) {
9987
+ return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
9988
+ }
9989
+ }
9990
+ }
9991
+ }, {
9992
+ name: 'qp-brandId-in',
9993
+ type: 'select',
9994
+ label: '品牌',
9995
+ field: {
9996
+ type: 'select',
9997
+ props: {
9998
+ mode: 'multiple',
9999
+ notFoundContent: '暂无数据',
10000
+ allowClear: true,
10001
+ showSearch: true,
10002
+ showArrow: true,
10003
+ maxTagCount: 1,
10004
+ optionFilterProp: 'children',
10005
+ filterOption: function filterOption(input, option) {
10006
+ return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
10007
+ }
10008
+ }
10009
+ }
10010
+ }],
10011
+ tableColumns: [{
10012
+ title: 'SKC编码',
10013
+ width: 150,
10014
+ dataIndex: 'code'
10015
+ }, {
10016
+ title: 'SKC名称',
10017
+ width: 200,
10018
+ ellipsis: {
10019
+ showTitle: false
10020
+ },
10021
+ render: function render(text) {
10022
+ return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
10023
+ placement: "topLeft",
10024
+ title: text
10025
+ }, text);
10026
+ },
10027
+ dataIndex: 'name'
10028
+ }, {
10029
+ title: '商品名称',
10030
+ width: 100,
10031
+ ellipsis: {
10032
+ showTitle: false
10033
+ },
10034
+ dataIndex: 'itemName',
10035
+ render: function render(text) {
10036
+ return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
10037
+ placement: "topLeft",
10038
+ title: text
10039
+ }, text);
10040
+ }
10041
+ }, {
10042
+ title: '颜色',
10043
+ width: 100,
10044
+ ellipsis: {
10045
+ showTitle: false
10046
+ },
10047
+ render: function render(text) {
10048
+ return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
10049
+ placement: "topLeft",
10050
+ title: text
10051
+ }, text);
10052
+ },
10053
+ dataIndex: 'colorName'
10054
+ }, {
10055
+ title: '类目',
10056
+ width: 100,
10057
+ ellipsis: {
10058
+ showTitle: false
10059
+ },
10060
+ render: function render(text) {
10061
+ return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
10062
+ placement: "topLeft",
10063
+ title: text
10064
+ }, text);
10065
+ },
10066
+ dataIndex: 'categoryName'
10067
+ }, {
10068
+ title: '品类',
10069
+ width: 100,
10070
+ ellipsis: {
10071
+ showTitle: false
10072
+ },
10073
+ render: function render(text) {
10074
+ return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
10075
+ placement: "topLeft",
10076
+ title: text
10077
+ }, text);
10078
+ },
10079
+ dataIndex: 'className'
10080
+ }, {
10081
+ title: '品牌',
10082
+ width: 100,
10083
+ ellipsis: {
10084
+ showTitle: false
10085
+ },
10086
+ render: function render(text) {
10087
+ return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
10088
+ placement: "topLeft",
10089
+ title: text
10090
+ }, text);
10091
+ },
10092
+ dataIndex: 'brandName'
10093
+ }],
10046
10094
  selectColumn: mTpSelectColumn,
10047
- promiseLoadList: mTpPromiseLoadList
10095
+ promiseLoadList: initialPromiseLoadList
10048
10096
  };
10049
10097
  return /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(AddSelect, _objectSpread2(_objectSpread2({}, props), {}, {
10050
10098
  modalTableProps: modalTableProps
@@ -10097,199 +10145,37 @@ var AddSpuSelect = function AddSpuSelect(parProps) {
10097
10145
  dataIndex: 'name'
10098
10146
  }, {
10099
10147
  title: '颜色',
10100
- dataIndex: 'colorName',
10101
- width: 200,
10102
- isSelectItem: true,
10103
- dataSourceCode: 'colorValues',
10104
- dataSourceMapping: ['value', 'value']
10105
- }, {
10106
- title: '配码',
10107
- dataIndex: 'selectPropertyGroupCode',
10108
- width: 160,
10109
- isSelectItem: true,
10110
- dataSource: propertyList,
10111
- filterDataSourceCode: 'matchingCodes'
10112
- }, {
10113
- title: '数量',
10114
- width: 100,
10115
- isInputItem: true,
10116
- dataIndex: 'count'
10117
- }, {
10118
- title: '所属组织',
10119
- dataIndex: 'ownOrgSignName'
10120
- }, {
10121
- title: '品牌',
10122
- dataIndex: 'brandName'
10123
- }, {
10124
- title: '类目',
10125
- dataIndex: 'categoryText'
10126
- }, {
10127
- title: '品类',
10128
- dataIndex: 'className'
10129
- }];
10130
- var mTpSelectColumn = handleSelectColumn(initialSelectColumn, parProps);
10131
- var initialTableColumn = [{
10132
- title: '商品编码',
10133
- width: 150,
10134
- dataIndex: 'itemCode'
10135
- }, {
10136
- title: '商品名称',
10137
- width: 200,
10138
- ellipsis: {
10139
- showTitle: false
10140
- },
10141
- render: function render(text) {
10142
- return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
10143
- placement: "topLeft",
10144
- title: text
10145
- }, text);
10146
- },
10147
- dataIndex: 'name'
10148
- }, {
10149
- title: '所属组织',
10150
- width: 100,
10151
- ellipsis: {
10152
- showTitle: false
10153
- },
10154
- render: function render(text) {
10155
- return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
10156
- placement: "topLeft",
10157
- title: text
10158
- }, text);
10159
- },
10160
- dataIndex: 'ownOrgSignName'
10161
- }, {
10162
- title: '品牌',
10163
- width: 100,
10164
- ellipsis: {
10165
- showTitle: false
10166
- },
10167
- render: function render(text) {
10168
- return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
10169
- placement: "topLeft",
10170
- title: text
10171
- }, text);
10172
- },
10173
- dataIndex: 'brandName'
10174
- }, {
10175
- title: '类目',
10176
- width: 100,
10177
- ellipsis: {
10178
- showTitle: false
10179
- },
10180
- render: function render(text) {
10181
- return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
10182
- placement: "topLeft",
10183
- title: text
10184
- }, text);
10185
- },
10186
- dataIndex: 'categoryName'
10187
- }, {
10188
- title: '品类',
10189
- width: 100,
10190
- ellipsis: {
10191
- showTitle: false
10192
- },
10193
- render: function render(text) {
10194
- return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
10195
- placement: "topLeft",
10196
- title: text
10197
- }, text);
10198
- },
10199
- dataIndex: 'className'
10200
- }];
10201
- var mTpTableColumn = handleTableColumn(initialTableColumn, parProps);
10202
- var initialTableSearchForm = [{
10203
- name: 'qp-itemCode-like',
10204
- label: '商品编码'
10205
- }, {
10206
- name: 'qp-name-like',
10207
- label: '商品名称'
10208
- }, {
10209
- name: 'qp-ownOrgSign-in',
10210
- type: 'select',
10211
- label: '所属组织',
10212
- field: {
10213
- type: 'select',
10214
- props: {
10215
- mode: 'multiple',
10216
- notFoundContent: '暂无数据',
10217
- allowClear: true,
10218
- showSearch: true,
10219
- showArrow: true,
10220
- maxTagCount: 1,
10221
- optionFilterProp: 'children',
10222
- filterOption: function filterOption(input, option) {
10223
- return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
10224
- }
10225
- }
10226
- }
10227
- }, {
10228
- name: 'qp-brandId-in',
10229
- type: 'select',
10230
- label: '品牌',
10231
- field: {
10232
- type: 'select',
10233
- props: {
10234
- mode: 'multiple',
10235
- notFoundContent: '暂无数据',
10236
- allowClear: true,
10237
- showSearch: true,
10238
- showArrow: true,
10239
- maxTagCount: 1,
10240
- optionFilterProp: 'children',
10241
- filterOption: function filterOption(input, option) {
10242
- return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
10243
- }
10244
- }
10245
- }
10246
- }, {
10247
- name: 'qp-categoryId-in',
10248
- type: 'treeSelect',
10249
- label: '类目',
10250
- field: {
10251
- type: 'treeSelect',
10252
- props: {
10253
- treeData: [],
10254
- treeCheckable: true,
10255
- showSearch: true,
10256
- allowClear: true,
10257
- showArrow: true,
10258
- treeNodeFilterProp: 'title',
10259
- treeDefaultExpandAll: true,
10260
- maxTagCount: 1,
10261
- placeholder: '请选择',
10262
- style: {
10263
- width: '100%'
10264
- },
10265
- dropdownStyle: {
10266
- maxHeight: 400,
10267
- maxWidth: 100,
10268
- overflow: 'auto'
10269
- }
10270
- }
10271
- }
10148
+ dataIndex: 'colorName',
10149
+ width: 200,
10150
+ isSelectItem: true,
10151
+ dataSourceCode: 'colorValues',
10152
+ dataSourceMapping: ['value', 'value']
10272
10153
  }, {
10273
- name: 'qp-classId-in',
10274
- type: 'select',
10275
- label: '品类',
10276
- field: {
10277
- type: 'select',
10278
- props: {
10279
- mode: 'multiple',
10280
- notFoundContent: '暂无数据',
10281
- allowClear: true,
10282
- showSearch: true,
10283
- showArrow: true,
10284
- maxTagCount: 1,
10285
- optionFilterProp: 'children',
10286
- filterOption: function filterOption(input, option) {
10287
- return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
10288
- }
10289
- }
10290
- }
10154
+ title: '配码',
10155
+ dataIndex: 'selectPropertyGroupCode',
10156
+ width: 160,
10157
+ isSelectItem: true,
10158
+ dataSource: propertyList,
10159
+ filterDataSourceCode: 'matchingCodes'
10160
+ }, {
10161
+ title: '数量',
10162
+ width: 100,
10163
+ isInputItem: true,
10164
+ dataIndex: 'count'
10165
+ }, {
10166
+ title: '所属组织',
10167
+ dataIndex: 'ownOrgSignName'
10168
+ }, {
10169
+ title: '品牌',
10170
+ dataIndex: 'brandName'
10171
+ }, {
10172
+ title: '类目',
10173
+ dataIndex: 'categoryText'
10174
+ }, {
10175
+ title: '品类',
10176
+ dataIndex: 'className'
10291
10177
  }];
10292
- var mTpTableSearchForm = handleSearchForm(initialTableSearchForm, parProps);
10178
+ var mTpSelectColumn = handleSelectColumn(initialSelectColumn, parProps);
10293
10179
  var initialPromiseLoadList = [{
10294
10180
  url: "/user/orgViewNode/listNoPage",
10295
10181
  params: {
@@ -10328,7 +10214,6 @@ var AddSpuSelect = function AddSpuSelect(parProps) {
10328
10214
  resPosition: 5,
10329
10215
  resKeyValue: ['id', 'name']
10330
10216
  }];
10331
- var mTpPromiseLoadList = handleFormSearchSourceLoad(initialPromiseLoadList, parProps);
10332
10217
  var props = {
10333
10218
  buttonText: parProps.buttonText || '新增',
10334
10219
  buttonProps: parProps.buttonProps || {},
@@ -10357,11 +10242,169 @@ var AddSpuSelect = function AddSpuSelect(parProps) {
10357
10242
  isAllowRepeatedSelect: !!(parProps === null || parProps === void 0 ? void 0 : parProps.isAllowRepeatedSelect)
10358
10243
  };
10359
10244
  var modalTableProps = {
10360
- modalTableTitle: parProps.modalTableTitle || '选择商品',
10361
- tableSearchForm: mTpTableSearchForm,
10362
- tableColumns: mTpTableColumn,
10245
+ modalTableTitle: '选择商品',
10246
+ tableSearchForm: [{
10247
+ name: 'qp-itemCode-like',
10248
+ label: '商品编码'
10249
+ }, {
10250
+ name: 'qp-name-like',
10251
+ label: '商品名称'
10252
+ }, {
10253
+ name: 'qp-ownOrgSign-in',
10254
+ type: 'select',
10255
+ label: '所属组织',
10256
+ field: {
10257
+ type: 'select',
10258
+ props: {
10259
+ mode: 'multiple',
10260
+ notFoundContent: '暂无数据',
10261
+ allowClear: true,
10262
+ showSearch: true,
10263
+ showArrow: true,
10264
+ maxTagCount: 1,
10265
+ optionFilterProp: 'children',
10266
+ filterOption: function filterOption(input, option) {
10267
+ return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
10268
+ }
10269
+ }
10270
+ }
10271
+ }, {
10272
+ name: 'qp-brandId-in',
10273
+ type: 'select',
10274
+ label: '品牌',
10275
+ field: {
10276
+ type: 'select',
10277
+ props: {
10278
+ mode: 'multiple',
10279
+ notFoundContent: '暂无数据',
10280
+ allowClear: true,
10281
+ showSearch: true,
10282
+ showArrow: true,
10283
+ maxTagCount: 1,
10284
+ optionFilterProp: 'children',
10285
+ filterOption: function filterOption(input, option) {
10286
+ return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
10287
+ }
10288
+ }
10289
+ }
10290
+ }, {
10291
+ name: 'qp-categoryId-in',
10292
+ type: 'treeSelect',
10293
+ label: '类目',
10294
+ field: {
10295
+ type: 'treeSelect',
10296
+ props: {
10297
+ treeData: [],
10298
+ treeCheckable: true,
10299
+ showSearch: true,
10300
+ allowClear: true,
10301
+ showArrow: true,
10302
+ treeNodeFilterProp: 'title',
10303
+ treeDefaultExpandAll: true,
10304
+ maxTagCount: 1,
10305
+ placeholder: '请选择',
10306
+ style: {
10307
+ width: '100%'
10308
+ },
10309
+ dropdownStyle: {
10310
+ maxHeight: 400,
10311
+ maxWidth: 100,
10312
+ overflow: 'auto'
10313
+ }
10314
+ }
10315
+ }
10316
+ }, {
10317
+ name: 'qp-classId-in',
10318
+ type: 'select',
10319
+ label: '品类',
10320
+ field: {
10321
+ type: 'select',
10322
+ props: {
10323
+ mode: 'multiple',
10324
+ notFoundContent: '暂无数据',
10325
+ allowClear: true,
10326
+ showSearch: true,
10327
+ showArrow: true,
10328
+ maxTagCount: 1,
10329
+ optionFilterProp: 'children',
10330
+ filterOption: function filterOption(input, option) {
10331
+ return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
10332
+ }
10333
+ }
10334
+ }
10335
+ }],
10336
+ tableColumns: [{
10337
+ title: '商品编码',
10338
+ width: 150,
10339
+ dataIndex: 'itemCode'
10340
+ }, {
10341
+ title: '商品名称',
10342
+ width: 200,
10343
+ ellipsis: {
10344
+ showTitle: false
10345
+ },
10346
+ render: function render(text) {
10347
+ return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
10348
+ placement: "topLeft",
10349
+ title: text
10350
+ }, text);
10351
+ },
10352
+ dataIndex: 'name'
10353
+ }, {
10354
+ title: '所属组织',
10355
+ width: 100,
10356
+ ellipsis: {
10357
+ showTitle: false
10358
+ },
10359
+ render: function render(text) {
10360
+ return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
10361
+ placement: "topLeft",
10362
+ title: text
10363
+ }, text);
10364
+ },
10365
+ dataIndex: 'ownOrgSignName'
10366
+ }, {
10367
+ title: '品牌',
10368
+ width: 100,
10369
+ ellipsis: {
10370
+ showTitle: false
10371
+ },
10372
+ render: function render(text) {
10373
+ return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
10374
+ placement: "topLeft",
10375
+ title: text
10376
+ }, text);
10377
+ },
10378
+ dataIndex: 'brandName'
10379
+ }, {
10380
+ title: '类目',
10381
+ width: 100,
10382
+ ellipsis: {
10383
+ showTitle: false
10384
+ },
10385
+ render: function render(text) {
10386
+ return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
10387
+ placement: "topLeft",
10388
+ title: text
10389
+ }, text);
10390
+ },
10391
+ dataIndex: 'categoryName'
10392
+ }, {
10393
+ title: '品类',
10394
+ width: 100,
10395
+ ellipsis: {
10396
+ showTitle: false
10397
+ },
10398
+ render: function render(text) {
10399
+ return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
10400
+ placement: "topLeft",
10401
+ title: text
10402
+ }, text);
10403
+ },
10404
+ dataIndex: 'className'
10405
+ }],
10363
10406
  selectColumn: mTpSelectColumn,
10364
- promiseLoadList: mTpPromiseLoadList
10407
+ promiseLoadList: initialPromiseLoadList
10365
10408
  };
10366
10409
  return /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(AddSelect, _objectSpread2(_objectSpread2({}, props), {}, {
10367
10410
  modalTableProps: modalTableProps
@@ -10437,7 +10480,7 @@ var CommodityEntry = function CommodityEntry(props) {
10437
10480
  onCancel: handleCancel,
10438
10481
  destroyOnClose: true,
10439
10482
  zIndex: 15
10440
- }, otherModalProps), /*#__PURE__*/React__default['default'].createElement(DataValidation, _objectSpread2(_objectSpread2({}, props), {}, {
10483
+ }, otherModalProps), /*#__PURE__*/React__default['default'].createElement(DataValidation, {
10441
10484
  onRef: function onRef(ref) {
10442
10485
  dataValidationRef = ref;
10443
10486
  },
@@ -10445,7 +10488,7 @@ var CommodityEntry = function CommodityEntry(props) {
10445
10488
  validDataUrl: validDataUrl,
10446
10489
  isBrandAuth: isBrandAuth,
10447
10490
  isCheckStockNum: isCheckStockNum
10448
- })))) || '');
10491
+ }))) || '');
10449
10492
  };
10450
10493
 
10451
10494
  /*
@@ -12469,7 +12512,7 @@ var DetailWrapper = /*#__PURE__*/React__default['default'].memo(function (_ref)
12469
12512
  var renderPageActionList = function renderPageActionList(actionLists) {
12470
12513
  var authButton = localStorage.getItem(getMenuAuthDataKey()) ? JSON.parse(localStorage.getItem(getMenuAuthDataKey())) : [];
12471
12514
  var visibleActions = actionLists.filter(function (action) {
12472
- return (action.visible && action.visible !== 'false' || judgeIsEmpty$1(action.visible)) && (!shouldUseAuth() || judgeIsEmpty$1(action.code) || authButton.filter(function (item) {
12515
+ return (action.visible && action.visible !== 'false' || judgeIsEmpty$1(action.visible)) && (judgeIsEmpty$1(action.code) || authButton.filter(function (item) {
12473
12516
  return item === action.code;
12474
12517
  }));
12475
12518
  });
@@ -13980,6 +14023,14 @@ var ResizeableTitle$2 = function ResizeableTitle(props) {
13980
14023
  };
13981
14024
  var BsSulaQueryTable = (function (props) {
13982
14025
  var bsTableCode = (props === null || props === void 0 ? void 0 : props.tableCode) || window.location.hash; //设置列字段的唯一标识
14026
+ // 获取 table columns中所有的 key 防止有的地方是 dataindex
14027
+ var checkedList = React$1.useMemo(function () {
14028
+ return props.columns.filter(function (col) {
14029
+ return !col.hidden;
14030
+ }).map(function (d) {
14031
+ return Array.isArray(d.key || d.dataIndex) ? JSON.stringify(d.key || d.dataIndex) : d.key || d.dataIndex;
14032
+ });
14033
+ }, [props.columns]);
13983
14034
  var getConfigFromlocalstorage = function getConfigFromlocalstorage(type) {
13984
14035
  var config = localStorage.getItem(type) || '[]';
13985
14036
  var configArray = JSON.parse(config);
@@ -13991,66 +14042,97 @@ var BsSulaQueryTable = (function (props) {
13991
14042
  }
13992
14043
  return [];
13993
14044
  };
13994
- var getInitialSearchFieldsInfo = function getInitialSearchFieldsInfo() {
13995
- //获取搜索字段的缓存配置
13996
- var _props$fields = props.fields,
13997
- fields = _props$fields === void 0 ? [] : _props$fields;
13998
- var searchFieldsConfig = getConfigFromlocalstorage(ENUM.BROWSER_CACHE.SEARCH_FIELDS_CONDITION);
13999
- var showSearchFields = searchFieldsConfig.length ? searchFieldsConfig.map(function (item) {
14000
- var inner = fields.filter(function (inneritem) {
14001
- var innerKey = Array.isArray(inneritem.name) ? JSON.stringify(inneritem.name) : inneritem.name;
14002
- var itemKey = Array.isArray(item.name) ? JSON.stringify(item.name) : item.name;
14003
- return innerKey && innerKey === itemKey;
14004
- })[0];
14005
- return _objectSpread2(_objectSpread2({}, inner), item);
14006
- }) : fields;
14007
- return _toConsumableArray(showSearchFields);
14045
+ /**
14046
+ * 根据保存的配置和原始配置,获取设置的字段或列。
14047
+ * @param savedConfig 保存的配置数组,可能包含字段或列的配置。
14048
+ * @param originConfig 原始配置数组,包含完整的字段或列信息。
14049
+ * @param type 字段或列的类型,用于确定配置的属性。
14050
+ * @returns 返回根据保存的配置处理后的字段或列数组,如果未保存任何配置,则返回原始配置。
14051
+ */
14052
+ var getSettingFieldOrColumn = function getSettingFieldOrColumn(savedConfig, originConfig, type) {
14053
+ /**
14054
+ * 判断值是否为字符串数组。
14055
+ * @param value 待判断的值。
14056
+ * @returns 如果值是字符串数组,则返回true,否则返回false。
14057
+ */
14058
+ var isStringArray = function isStringArray(value) {
14059
+ return Array.isArray(value) && value.every(function (v) {
14060
+ return typeof v === 'string';
14061
+ });
14062
+ };
14063
+ /**
14064
+ * 根据配置项和类型,获取配置项的键。
14065
+ * @param config 配置项,可以是字段或列。
14066
+ * @param type 配置项的类型。
14067
+ * @returns 返回配置项的键,如果无法获取,则返回空字符串。
14068
+ */
14069
+ var getItemKey = function getItemKey(config, type) {
14070
+ try {
14071
+ if (type === 'columns') {
14072
+ return isStringArray(config.key) ? JSON.stringify(config.key) : isStringArray(config.dataIndex) ? JSON.stringify(config.dataIndex) : config.key || config.dataIndex || '';
14073
+ }
14074
+ return isStringArray(config.name) ? JSON.stringify(config.name) : config.name || '';
14075
+ } catch (e) {}
14076
+ return '';
14077
+ };
14078
+ var newConfig = [];
14079
+ if (savedConfig.length) {
14080
+ var hash = originConfig.reduce(function (prev, inneritem) {
14081
+ prev[getItemKey(inneritem, type)] = inneritem;
14082
+ return prev;
14083
+ }, {});
14084
+ savedConfig.forEach(function (config, index) {
14085
+ var inner = hash[getItemKey(config, type)];
14086
+ inner && newConfig.push(_objectSpread2(_objectSpread2({}, inner), config));
14087
+ });
14088
+ }
14089
+ if (newConfig.length) return newConfig;
14090
+ if (type === 'columns') {
14091
+ return originConfig.filter(function (column) {
14092
+ var columnKey = getItemKey(column, type);
14093
+ return column.notRegularCheckList || checkedList.indexOf(columnKey) > -1;
14094
+ });
14095
+ }
14096
+ return _toConsumableArray(originConfig);
14008
14097
  };
14009
14098
  var refs = React$1.useRef(null);
14010
14099
  var _useState = React$1.useState(''),
14011
14100
  _useState2 = _slicedToArray(_useState, 2),
14012
14101
  pagePath = _useState2[0],
14013
14102
  setPagePath = _useState2[1];
14014
- // 获取 table columns中所有的 key 防止有的地方是 dataindex
14015
- var _useState3 = React$1.useState(props.columns.filter(function (col) {
14016
- return !col.hidden;
14017
- }).map(function (d) {
14018
- return Array.isArray(d.key || d.dataIndex) ? JSON.stringify(d.key || d.dataIndex) : d.key || d.dataIndex;
14019
- })),
14020
- _useState4 = _slicedToArray(_useState3, 2),
14021
- checkedList = _useState4[0],
14022
- setCheckedList = _useState4[1];
14023
14103
  var _useLocation = umi.useLocation(),
14024
14104
  pathname = _useLocation.pathname;
14025
- var _useState5 = React$1.useState(Number(Math.random().toString().substr(2, 0) + Date.now()).toString(36)),
14026
- _useState6 = _slicedToArray(_useState5, 1),
14027
- id = _useState6[0];
14028
- var _useState7 = React$1.useState(false),
14029
- _useState8 = _slicedToArray(_useState7, 2),
14030
- isFullScreen = _useState8[0],
14031
- setIsFnllScreen = _useState8[1];
14105
+ var _useState3 = React$1.useState(Number(Math.random().toString().substr(2, 0) + Date.now()).toString(36)),
14106
+ _useState4 = _slicedToArray(_useState3, 1),
14107
+ id = _useState4[0];
14108
+ var _useState5 = React$1.useState(false),
14109
+ _useState6 = _slicedToArray(_useState5, 2),
14110
+ isFullScreen = _useState6[0],
14111
+ setIsFnllScreen = _useState6[1];
14032
14112
  // @ts-nocheck
14033
- var _useState9 = React$1.useState(props),
14113
+ var _useState7 = React$1.useState(props),
14114
+ _useState8 = _slicedToArray(_useState7, 2),
14115
+ value = _useState8[0],
14116
+ setValue = _useState8[1];
14117
+ var _props$fields = props.fields,
14118
+ fields = _props$fields === void 0 ? [] : _props$fields;
14119
+ var _useState9 = React$1.useState([]),
14034
14120
  _useState10 = _slicedToArray(_useState9, 2),
14035
- value = _useState10[0],
14036
- setValue = _useState10[1];
14037
- var _useState11 = React$1.useState([]),
14121
+ showColumn = _useState10[0],
14122
+ setShowColumns = _useState10[1]; // 列字段
14123
+ var originSearchFields = getSettingFieldOrColumn(getConfigFromlocalstorage(ENUM.BROWSER_CACHE.SEARCH_FIELDS_CONDITION), fields, 'searchFields');
14124
+ var _useState11 = React$1.useState(originSearchFields),
14038
14125
  _useState12 = _slicedToArray(_useState11, 2),
14039
- showColumn = _useState12[0],
14040
- setShowColumns = _useState12[1]; // 列字段
14041
- var originSearchFields = getInitialSearchFieldsInfo();
14042
- var _useState13 = React$1.useState(originSearchFields),
14043
- _useState14 = _slicedToArray(_useState13, 2),
14044
- showSearchFields = _useState14[0],
14045
- setShowSearchFields = _useState14[1]; //搜索项字段
14126
+ showSearchFields = _useState12[0],
14127
+ setShowSearchFields = _useState12[1]; //搜索项字段
14046
14128
  var _props$isPage = props.isPage,
14047
14129
  pagination = props.pagination,
14048
14130
  tableCode = props.tableCode,
14049
14131
  appRequestConfig = props.appRequestConfig;
14050
- var _useState15 = React$1.useState('100vh'),
14051
- _useState16 = _slicedToArray(_useState15, 2),
14052
- height = _useState16[0],
14053
- setHeight = _useState16[1];
14132
+ var _useState13 = React$1.useState('100vh'),
14133
+ _useState14 = _slicedToArray(_useState13, 2),
14134
+ height = _useState14[0],
14135
+ setHeight = _useState14[1];
14054
14136
  var sortTableRef = React$1.useRef(null);
14055
14137
  var searchTableRef = React$1.useRef(null);
14056
14138
  // 获取table高度
@@ -14111,7 +14193,7 @@ var BsSulaQueryTable = (function (props) {
14111
14193
  if (Number(item.slice(-1)) >= 1) {
14112
14194
  Item = item.substr(0, item.length - 1);
14113
14195
  }
14114
- if (shouldUseAuth() && !authButton.filter(function (itemInner) {
14196
+ if (!authButton.filter(function (itemInner) {
14115
14197
  return Item === itemInner;
14116
14198
  }).length) {
14117
14199
  resourceCodeArray[item].visible = false;
@@ -14123,17 +14205,7 @@ var BsSulaQueryTable = (function (props) {
14123
14205
  }));
14124
14206
  var columns = props.columns;
14125
14207
  var columnConfig = getConfigFromlocalstorage(ENUM.BROWSER_CACHE.COLUMN_CONDITION);
14126
- var showColumns = columnConfig.length ? columnConfig.map(function (item) {
14127
- var inner = columns.filter(function (inneritem) {
14128
- var innerKey = Array.isArray(inneritem.key || inneritem.dataIndex) ? JSON.stringify(inneritem.key || inneritem.dataIndex) : inneritem.key || inneritem.dataIndex;
14129
- var itemKey = Array.isArray(item.key || item.dataIndex) ? JSON.stringify(item.key || item.dataIndex) : item.key || item.dataIndex;
14130
- return innerKey && innerKey === itemKey;
14131
- })[0];
14132
- return _objectSpread2(_objectSpread2({}, inner), item);
14133
- }) : columns.filter(function (column) {
14134
- var columnKey = Array.isArray(column.key || column.dataIndex) ? JSON.stringify(column.key || column.dataIndex) : column.key || column.dataIndex;
14135
- return column.notRegularCheckList || checkedList.indexOf(columnKey) > -1;
14136
- });
14208
+ var showColumns = getSettingFieldOrColumn(columnConfig, columns, 'columns');
14137
14209
  showColumns.forEach(function (item, index) {
14138
14210
  item.width = item.width || getItemDefaultWidth(item);
14139
14211
  handleBssulaColumnsSpecialParams(item);
@@ -14547,7 +14619,7 @@ var setMenuTreeData = function setMenuTreeData(routesData) {
14547
14619
  routesData.splice(i, 1);
14548
14620
  return 0; // continue
14549
14621
  }
14550
- if (shouldUseAuth() && routesData[i].code && authButton.every(function (item) {
14622
+ if (routesData[i].code && authButton.every(function (item) {
14551
14623
  return routesData[i].code != item;
14552
14624
  })) {
14553
14625
  routesData.splice(i, 1);
@@ -15190,7 +15262,9 @@ var GlobalHeaderCom = function GlobalHeaderCom(props) {
15190
15262
  deep(item.routes);
15191
15263
  } else if (!item.hideInMenu && (name ? umi.formatMessage({
15192
15264
  id: "menu.".concat(item.name)
15193
- }).indexOf(name) !== -1 : true)) {
15265
+ }).indexOf(name) !== -1 : true) && btnAuth.find(function (d) {
15266
+ return d === item.code;
15267
+ })) {
15194
15268
  resultList.push(_objectSpread2(_objectSpread2({}, item), {}, {
15195
15269
  fullPathName: getFullPathName(item.name)
15196
15270
  }));
@@ -16477,70 +16551,10 @@ var CustomerMenuHeader = function CustomerMenuHeader(_ref) {
16477
16551
  var css_248z$m = ".customer_menu_content {\n color: #b1bad4;\n background: #141620;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 18px;\n height: 40px;\n border-bottom: 1px solid #3d4047;\n}\n.customer_menu_content .ant-btn-link {\n color: #b1bad4 !important;\n font-size: 16px;\n height: 36px;\n}\n.menu_item {\n line-height: 30px;\n height: 30px;\n color: rgba(44, 47, 46);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.link_style:hover {\n background-color: #e4e7ed;\n cursor: pointer;\n color: #1890ff;\n}\n.sub_menu_content {\n box-shadow: 2px 0px 4px 0px rgba(185, 185, 185, 0.5);\n position: fixed;\n top: 50px;\n left: 140px;\n width: 200px;\n height: 100%;\n background-color: #fff;\n padding-top: 10px;\n z-index: 9999;\n}\n.tab_left_operate {\n display: flex;\n height: 28px;\n align-items: center;\n}\n.tab_left_operate > div {\n width: 28px;\n font-size: 12px;\n color: #2C2F2ECC;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n border-right: 1px solid #E4E4E4;\n background-color: #fff;\n cursor: pointer;\n}\n.tab_left_operate > div:last-child {\n box-shadow: 2px -2px 4px 0px rgba(185, 185, 185, 0.9);\n z-index: 99;\n}\n.tab_right_operate {\n height: 28px;\n width: 28px;\n font-size: 12px;\n color: #2C2F2ECC;\n display: flex;\n align-items: center;\n justify-content: center;\n border-right: 1px solid #E4E4E4;\n background-color: #fff;\n box-shadow: -2px -2px 4px 0px rgba(185, 185, 185, 0.9);\n z-index: 99;\n cursor: pointer;\n position: relative;\n}\n";
16478
16552
  styleInject(css_248z$m);
16479
16553
 
16480
- /*
16481
- * @Date: 2022-04-01 15:42:51
16482
- * @LastEditors: 追随
16483
- * @LastEditTime: 2022-09-16 20:53:23
16484
- */
16485
- var NoFoundPage = function NoFoundPage(props) {
16486
- return /*#__PURE__*/React__default['default'].createElement("div", {
16487
- style: {
16488
- height: 'calc(100vh - 88px)',
16489
- background: '#fff',
16490
- display: 'flex',
16491
- justifyContent: 'center',
16492
- alignItems: 'center'
16493
- }
16494
- }, /*#__PURE__*/React__default['default'].createElement(antd.Result, {
16495
- status: "404",
16496
- title: "404",
16497
- subTitle: /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement("div", null, "\u62B1\u6B49\uFF0C\u65E0\u6CD5\u8BBF\u95EE\u8BE5\u9875\u9762\uFF01"), /*#__PURE__*/React__default['default'].createElement("div", null, "\u8BF7\u5173\u95ED\u5F53\u524D\u9875\u7B7E"))
16498
- }));
16499
- };
16500
-
16501
16554
  var _excluded$g = ["route"];
16502
16555
  var TabPane = antd.Tabs.TabPane;
16503
- var getId = function getId(str) {
16504
- // 找到最后一个 / 的位置
16505
- var lastSlashIndex = str.lastIndexOf("/");
16506
- // 如果找到了 /,则返回它后面的部分
16507
- if (lastSlashIndex !== -1) {
16508
- return str.substring(lastSlashIndex + 1);
16509
- } else {
16510
- // 如果没有找到 /,则返回整个字符串
16511
- return null;
16512
- }
16513
- };
16514
- // 获取权限菜单path&通用单据id
16515
- var getAuthMenuPathAndDocsId = function getAuthMenuPathAndDocsId(pathToRegexp) {
16516
- var limitedMenuData = localStorage.getItem(getLimitMenuDataKey()) ? JSON.parse(localStorage.getItem(getLimitMenuDataKey())) : [];
16517
- var menuKeys = [];
16518
- var docsId = [];
16519
- var getLimitedMenuKeys = function getLimitedMenuKeys(data) {
16520
- data.forEach(function (item) {
16521
- if (item.children && item.children.length > 0) {
16522
- getLimitedMenuKeys(item.children);
16523
- } else {
16524
- var originPath = item.path.replace(/^\/\w+\//, '/');
16525
- menuKeys.push(originPath);
16526
- if (pathToRegexp('/operation-and-maintenance-center/configuration-management/all-general-documents-specific/:id').test(originPath)) {
16527
- getId(originPath) && docsId.push(getId(originPath));
16528
- }
16529
- }
16530
- });
16531
- };
16532
- try {
16533
- getLimitedMenuKeys(limitedMenuData);
16534
- } catch (e) {}
16535
- return {
16536
- menuKeys: menuKeys,
16537
- docsId: docsId
16538
- };
16539
- };
16540
16556
  var UN_LISTTEN_DRP;
16541
16557
  var routerArray = [];
16542
- var authMenuPathList = [];
16543
- var docsId = [];
16544
16558
  var lastTwoRouterArray = [1, 2];
16545
16559
  var type = 'DraggableTabNode';
16546
16560
  var DraggableTabNode = function DraggableTabNode(_ref) {
@@ -16733,7 +16747,6 @@ var ItemMenu = function ItemMenu(props) {
16733
16747
  };
16734
16748
  var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16735
16749
  function BasicLayout(props) {
16736
- var _getAuthMenuPathAndDo, _getAuthMenuPathAndDo2;
16737
16750
  var _this;
16738
16751
  _classCallCheck(this, BasicLayout);
16739
16752
  _this = _callSuper(this, BasicLayout, [props]);
@@ -16750,41 +16763,14 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16750
16763
  return queryString;
16751
16764
  };
16752
16765
  _this.updateTree = function (Tree) {
16753
- var authMenuKeys = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
16754
16766
  var treeData = Tree;
16755
16767
  var treeList = [];
16756
- // 是否为权限菜单路径
16757
- var getLimitedMenuPath = function getLimitedMenuPath(node) {
16758
- return authMenuKeys.some(function (item) {
16759
- return (node.path || '').includes(item);
16760
- });
16761
- };
16762
- // 是否为通用单据菜单路径
16763
- var getGenerateDocs = function getGenerateDocs(node) {
16764
- return (node.path || '').includes('all-general-documents');
16765
- };
16766
16768
  // 递归获取树列表
16767
16769
  var getTreeList = function getTreeList(data) {
16768
16770
  data.forEach(function (node) {
16769
16771
  if (node.routes && node.routes.length > 0) {
16770
16772
  getTreeList(node.routes);
16771
- return;
16772
- }
16773
- // todo:暂时处理非wujie环境不做404管控
16774
- if (!window.__POWERED_BY_WUJIE__) {
16775
- treeList.push({
16776
- tab: node.locale,
16777
- key: node.path,
16778
- locale: node.locale,
16779
- closable: true,
16780
- content: node.component,
16781
- name: node.name,
16782
- hideInMenu: node.hideInMenu,
16783
- isOnlyOnePage: node.isOnlyOnePage
16784
- });
16785
- return;
16786
- }
16787
- if (node.path === '/' || getLimitedMenuPath(node) || getGenerateDocs(node)) {
16773
+ } else {
16788
16774
  treeList.push({
16789
16775
  tab: node.locale,
16790
16776
  key: node.path,
@@ -16851,6 +16837,7 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16851
16837
  return moment__default['default'](timeStr).add(8, 'hours').format(format) || '- -';
16852
16838
  };
16853
16839
  _this.onChange = function (key) {
16840
+ // console.log('onChange');
16854
16841
  if (key !== _this.state.activeKey) {
16855
16842
  _this.setState({
16856
16843
  activeKey: key
@@ -17136,9 +17123,7 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
17136
17123
  });
17137
17124
  }
17138
17125
  };
17139
- authMenuPathList = ((_getAuthMenuPathAndDo = getAuthMenuPathAndDocsId(props.pathToRegexp)) === null || _getAuthMenuPathAndDo === void 0 ? void 0 : _getAuthMenuPathAndDo.menuKeys) || [];
17140
- docsId = ((_getAuthMenuPathAndDo2 = getAuthMenuPathAndDocsId(props.pathToRegexp)) === null || _getAuthMenuPathAndDo2 === void 0 ? void 0 : _getAuthMenuPathAndDo2.docsId) || [];
17141
- routerArray = _this.updateTree(props.route.routes, authMenuPathList);
17126
+ routerArray = _this.updateTree(props.route.routes);
17142
17127
  var homeRouter = routerArray.filter(function (itemroute) {
17143
17128
  return itemroute.key === '/';
17144
17129
  })[0];
@@ -17238,28 +17223,7 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
17238
17223
  hideMenuArray = _this2$state.hideMenuArray;
17239
17224
  var newListenRouterState = _toConsumableArray(listenRouterState);
17240
17225
  var newListenRouterKey = _toConsumableArray(listenRouterKey);
17241
- /**
17242
- * 根据给定的路由数组和当前路由信息,筛选出与当前路由匹配的路由项。
17243
- *
17244
- * @param routerArray 路由数组,包含多个路由项,每个路由项有一个键(key)。
17245
- * @param route 当前的路由信息,包含路径(pathname)等信息。
17246
- * @param docsId 通用单据ID的数组,用于进一步筛选路由。
17247
- * @returns 返回与当前路由匹配的第一个路由项,如果没有匹配项则返回undefined。
17248
- */
17249
17226
  var replaceRouter = routerArray.filter(function (itemRoute) {
17250
- var _route$pathname, _route$pathname2;
17251
- // 单独处理通用单据预览
17252
- if (window.top !== window && !window.__POWERED_BY_WUJIE__ && ((_route$pathname = route.pathname) === null || _route$pathname === void 0 ? void 0 : _route$pathname.includes('all-general-documents'))) {
17253
- return pathToRegexp(itemRoute.key || '').test(route.pathname);
17254
- }
17255
- // 当路由路径包含'all-general-documents'时,按通用单据处理
17256
- if (((_route$pathname2 = route.pathname) === null || _route$pathname2 === void 0 ? void 0 : _route$pathname2.includes('all-general-documents')) && shouldUseAuth()) {
17257
- // 检查路由路径是否匹配路由项的键,并且路径中包含至少一个通用单据ID
17258
- return pathToRegexp(itemRoute.key || '').test(route.pathname) && docsId.some(function (item) {
17259
- return route.pathname.includes(item);
17260
- });
17261
- }
17262
- // 对于不包含'all-general-documents'的路径,只检查路由路径是否匹配路由项的键
17263
17227
  return pathToRegexp(itemRoute.key || '').test(route.pathname);
17264
17228
  })[0];
17265
17229
  var currentKey = '';
@@ -17283,15 +17247,20 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
17283
17247
  }
17284
17248
  if (!listenRouterKey.includes(currentKey)) {
17285
17249
  if (!replaceRouter) {
17286
- replaceRouter = {
17287
- content: currentKey,
17288
- key: currentKey,
17289
- name: '404',
17290
- tab: '404',
17291
- isNotFound: true
17292
- };
17293
- newListenRouterState = [].concat(_toConsumableArray(newListenRouterState), [_objectSpread2({}, replaceRouter)]);
17294
- newListenRouterKey = [].concat(_toConsumableArray(listenRouterKey), [currentKey]);
17250
+ var _routerArray$filter;
17251
+ replaceRouter = (_routerArray$filter = routerArray.filter(function (itemroute) {
17252
+ return itemroute.key === '/404';
17253
+ })) === null || _routerArray$filter === void 0 ? void 0 : _routerArray$filter[0];
17254
+ _this2.setState({
17255
+ listenRouterState: [].concat(_toConsumableArray(listenRouterState), [_objectSpread2(_objectSpread2({}, replaceRouter), {}, {
17256
+ key: currentKey,
17257
+ tab: '404'
17258
+ })]),
17259
+ activeKey: currentKey,
17260
+ listenRouterKey: [].concat(_toConsumableArray(listenRouterKey), [currentKey])
17261
+ }, function () {
17262
+ _this2.checkisNavSlide();
17263
+ });
17295
17264
  } else {
17296
17265
  var match = matchPath(route.pathname, {
17297
17266
  path: replaceRouter.key
@@ -17809,7 +17778,8 @@ var WrapperComponent = /*#__PURE__*/function (_React$Component) {
17809
17778
  getDictionaryTextByValue = _this$props4.getDictionaryTextByValue,
17810
17779
  timeFormat = _this$props4.timeFormat,
17811
17780
  transparentProps = _this$props4.transparentProps;
17812
- return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, item.isNotFound ? ( /*#__PURE__*/React__default['default'].createElement(NoFoundPage, null)) : /*#__PURE__*/React__default['default'].createElement(item.content, _objectSpread2(_objectSpread2(_objectSpread2({
17781
+ console.log('child wrapper conpent', this.props);
17782
+ return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(item.content, _objectSpread2(_objectSpread2(_objectSpread2({
17813
17783
  getDictionarySource: getDictionarySource,
17814
17784
  getDictionaryTextByValue: getDictionaryTextByValue,
17815
17785
  timeFormat: timeFormat
@@ -27080,16 +27050,6 @@ var JsonQueryTable = /*#__PURE__*/React__default['default'].memo(function (props
27080
27050
  }, "setting"));
27081
27051
  });
27082
27052
 
27083
- var AuthButton = function AuthButton(props) {
27084
- var code = props.code,
27085
- children = props.children;
27086
- return /*#__PURE__*/React__default['default'].createElement("span", {
27087
- style: {
27088
- display: authFunc(code) ? 'inline-block' : 'none'
27089
- }
27090
- }, children);
27091
- };
27092
-
27093
27053
  var EllipsisTooltip = /*#__PURE__*/function (_React$Component) {
27094
27054
  function EllipsisTooltip() {
27095
27055
  var _this;
@@ -32788,7 +32748,6 @@ exports.AddSelect = AddSelect;
32788
32748
  exports.AddSkcSelect = AddSkcSelect;
32789
32749
  exports.AddSkuSelect = AddSkuSelect;
32790
32750
  exports.AddSpuSelect = AddSpuSelect;
32791
- exports.AuthButton = AuthButton;
32792
32751
  exports.BillEntry = BillEntry;
32793
32752
  exports.BsCascader = BsCascader;
32794
32753
  exports.BsLayout = index$5;
@@ -32853,5 +32812,4 @@ exports.removeTenantList = removeTenantList;
32853
32812
  exports.saveCurrentTenantId = saveCurrentTenantId;
32854
32813
  exports.saveTenantList = saveTenantList;
32855
32814
  exports.setConfigTableColumns = setConfigTableColumns;
32856
- exports.shouldUseAuth = shouldUseAuth;
32857
32815
  exports.uuid = uuid;