@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.esm.js CHANGED
@@ -1,10 +1,9 @@
1
1
  import axios from 'axios';
2
2
  import cookie from 'js-cookie';
3
- import { message as message$1, Tooltip, Image, Popover, Card, Avatar, Space, Dropdown, Button, Checkbox, Menu, Input, Modal, Select, Form, Divider, Spin, Table, TreeSelect, Tag, InputNumber, Typography, Alert, Anchor, Breadcrumb, Drawer as Drawer$1, List, Tree, Row, Col, Result, Tabs, Affix, Cascader, DatePicker, TimePicker, Switch } from 'antd';
3
+ import { message as message$1, Tooltip, Image, Popover, Card, Avatar, Space, Dropdown, Button, Checkbox, Menu, Input, Modal, Select, Form, Divider, Spin, Table, TreeSelect, Tag, InputNumber, Typography, Alert, Anchor, Breadcrumb, Drawer as Drawer$1, List, Tree, Row, Col, Tabs, Affix, Cascader, DatePicker, TimePicker, Switch } from 'antd';
4
4
  import _, { omit, debounce, cloneDeep as cloneDeep$1, throttle, isEmpty } from 'lodash';
5
- import memoizeOne from 'memoize-one';
6
5
  import { formatMessage, history, useLocation, Link, useModel, useIntl } from 'umi';
7
- import isEqual from 'lodash/isEqual';
6
+ import isEqual$1 from 'lodash/isEqual';
8
7
  import React$1, { useState, useEffect, forwardRef, useImperativeHandle, useRef, useMemo, Component, useLayoutEffect, createRef } from 'react';
9
8
  import moment$1 from 'moment';
10
9
  import { ProfileTwoTone, ExclamationCircleOutlined, DownOutlined, UnorderedListOutlined, CopyOutlined, SearchOutlined, CaretLeftOutlined, CloseCircleOutlined, ArrowLeftOutlined, FolderOutlined, EllipsisOutlined, CaretDownOutlined, HomeOutlined, DoubleLeftOutlined, DoubleRightOutlined, MenuUnfoldOutlined, DashOutlined, SettingOutlined, BulbOutlined, PlayCircleOutlined, SaveOutlined, FullscreenExitOutlined, EditOutlined, MinusCircleOutlined, PlusCircleOutlined } from '@ant-design/icons';
@@ -969,6 +968,56 @@ var precisionQuantity = function precisionQuantity(num, accuracy) {
969
968
  return '';
970
969
  };
971
970
 
971
+ var safeIsNaN = Number.isNaN ||
972
+ function ponyfill(value) {
973
+ return typeof value === 'number' && value !== value;
974
+ };
975
+ function isEqual(first, second) {
976
+ if (first === second) {
977
+ return true;
978
+ }
979
+ if (safeIsNaN(first) && safeIsNaN(second)) {
980
+ return true;
981
+ }
982
+ return false;
983
+ }
984
+ function areInputsEqual(newInputs, lastInputs) {
985
+ if (newInputs.length !== lastInputs.length) {
986
+ return false;
987
+ }
988
+ for (var i = 0; i < newInputs.length; i++) {
989
+ if (!isEqual(newInputs[i], lastInputs[i])) {
990
+ return false;
991
+ }
992
+ }
993
+ return true;
994
+ }
995
+
996
+ function memoizeOne(resultFn, isEqual) {
997
+ if (isEqual === void 0) { isEqual = areInputsEqual; }
998
+ var cache = null;
999
+ function memoized() {
1000
+ var newArgs = [];
1001
+ for (var _i = 0; _i < arguments.length; _i++) {
1002
+ newArgs[_i] = arguments[_i];
1003
+ }
1004
+ if (cache && cache.lastThis === this && isEqual(newArgs, cache.lastArgs)) {
1005
+ return cache.lastResult;
1006
+ }
1007
+ var lastResult = resultFn.apply(this, newArgs);
1008
+ cache = {
1009
+ lastResult: lastResult,
1010
+ lastArgs: newArgs,
1011
+ lastThis: this,
1012
+ };
1013
+ return lastResult;
1014
+ }
1015
+ memoized.clear = function clear() {
1016
+ cache = null;
1017
+ };
1018
+ return memoized;
1019
+ }
1020
+
972
1021
  function styleInject(css, ref) {
973
1022
  if ( ref === void 0 ) ref = {};
974
1023
  var insertAt = ref.insertAt;
@@ -1292,7 +1341,7 @@ var formatter = function formatter(data, parentAuthority, parentName) {
1292
1341
  return item;
1293
1342
  });
1294
1343
  };
1295
- var memoizeOneFormatter = memoizeOne(formatter, isEqual);
1344
+ var memoizeOneFormatter = memoizeOne(formatter, isEqual$1);
1296
1345
  var go2BackAndClose = function go2BackAndClose(backHistoryPath) {
1297
1346
  localStorage.setItem(ENUM.BROWSER_CACHE.CHILD_APP_BACK, 1);
1298
1347
  if (backHistoryPath) {
@@ -1453,7 +1502,7 @@ var judgeIsEmpty = function judgeIsEmpty(value) {
1453
1502
  // 判断某个按钮/菜单 是否有权限,返回布尔值
1454
1503
  var authFunc = function authFunc(code) {
1455
1504
  var _JSON$parse;
1456
- return !shouldUseAuth() ? true : (_JSON$parse = JSON.parse(localStorage.getItem(getMenuAuthDataKey()) || '[]')) === null || _JSON$parse === void 0 ? void 0 : _JSON$parse.find(function (d) {
1505
+ return (_JSON$parse = JSON.parse(localStorage.getItem(getMenuAuthDataKey()) || '[]')) === null || _JSON$parse === void 0 ? void 0 : _JSON$parse.find(function (d) {
1457
1506
  return d === code;
1458
1507
  });
1459
1508
  };
@@ -1479,11 +1528,6 @@ var handleJudgeAuthButtons = function handleJudgeAuthButtons(buttonCodeArray) {
1479
1528
  });
1480
1529
  return result;
1481
1530
  };
1482
- // 判断何时菜单权限和表格权限生效
1483
- var shouldUseAuth = function shouldUseAuth() {
1484
- // @ts-ignore
1485
- return window.__POWERED_BY_WUJIE__ ? true : false;
1486
- };
1487
1531
 
1488
1532
  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";
1489
1533
  styleInject(css_248z$1);
@@ -1532,21 +1576,8 @@ var filterLetters = function filterLetters(i) {
1532
1576
  return undefined;
1533
1577
  }
1534
1578
  };
1535
- // 抽象出创建对象的共通逻辑
1536
- function createItem(idPrefix, index, title, name, format) {
1537
- return {
1538
- id: "".concat(idPrefix).concat(index),
1539
- content: title,
1540
- code: name,
1541
- "ct": format //单元格值格式
1542
- };
1543
- }
1544
- // 定义[单元格值]常量以避免魔术字符串
1545
- var FORMAT_NAME_GENERAL = "General"; //格式名称为自动格式
1546
- var FORMAT_TYPE_STRING = "s"; //格式类型为数字类型
1547
1579
  var DataValidation = /*#__PURE__*/function (_React$Component) {
1548
1580
  function DataValidation(props) {
1549
- var _props$customerColumn;
1550
1581
  var _this;
1551
1582
  _classCallCheck(this, DataValidation);
1552
1583
  _this = _callSuper(this, DataValidation, [props]);
@@ -1561,7 +1592,6 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
1561
1592
  };
1562
1593
  _this.setConfig = function (data) {
1563
1594
  var items = _this.state.items;
1564
- var notValid = _this.props.notValid;
1565
1595
  return {
1566
1596
  container: 'luckysheet',
1567
1597
  showtoolbar: false,
@@ -1570,7 +1600,7 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
1570
1600
  if (columnAbc.name) {
1571
1601
  var charCode = columnAbc.name.charCodeAt();
1572
1602
  if (charCode - 65 <= items.length) {
1573
- columnAbc.name = itemsTemp[charCode - 65] ? itemsTemp[charCode - 65].content : !notValid ? '校验结果' : '';
1603
+ columnAbc.name = itemsTemp[charCode - 65] ? itemsTemp[charCode - 65].content : '校验结果';
1574
1604
  } else {
1575
1605
  columnAbc.name = '';
1576
1606
  }
@@ -1923,7 +1953,7 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
1923
1953
  onClick: function onClick() {
1924
1954
  return _this.filterData('all');
1925
1955
  }
1926
- }, "\u6E05\u7A7A\u5168\u90E8\u6570\u636E")), /*#__PURE__*/React$1.createElement(Menu.Divider, null), !_this.props.notValid && /*#__PURE__*/React$1.createElement(Menu.Item, {
1956
+ }, "\u6E05\u7A7A\u5168\u90E8\u6570\u636E")), /*#__PURE__*/React$1.createElement(Menu.Divider, null), /*#__PURE__*/React$1.createElement(Menu.Item, {
1927
1957
  key: "2",
1928
1958
  className: "sheet_table-menu_item_text"
1929
1959
  }, /*#__PURE__*/React$1.createElement("a", {
@@ -1966,22 +1996,18 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
1966
1996
  }), provided.placeholder);
1967
1997
  }))));
1968
1998
  _this.props.onRef(_this);
1969
- var format = {
1970
- fa: FORMAT_NAME_GENERAL,
1971
- t: FORMAT_TYPE_STRING
1972
- };
1973
- if (props === null || props === void 0 ? void 0 : (_props$customerColumn = props.customerColumnsMapping) === null || _props$customerColumn === void 0 ? void 0 : _props$customerColumn.length) {
1974
- var _props$customerColumn2;
1975
- 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) {
1976
- return createItem('item-0', index, item.title, item.name, format);
1977
- })) || [];
1978
- } else {
1979
- var _props$columns;
1980
- 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) {
1981
- if (!mapping.get(item)) throw Error("".concat(item, " is not in DataValidation component, please fix this error"));
1982
- return createItem('item-0', index, mapping.get(item), item, format);
1983
- })) || [];
1984
- }
1999
+ itemsTemp = props.columns.map(function (item, index) {
2000
+ if (!mapping.get(item)) throw Error("".concat(item, " is not in DataValidation component, please fix this error"));
2001
+ return {
2002
+ id: "item-0".concat(index),
2003
+ content: mapping.get(item),
2004
+ code: item,
2005
+ "ct": {
2006
+ "fa": "General",
2007
+ "t": "s" //格式类型为数字类型
2008
+ }
2009
+ };
2010
+ });
1985
2011
  luckysheet = window.luckysheet || window.top.luckysheet;
1986
2012
  _this.state = {
1987
2013
  showErrorData: false,
@@ -2022,9 +2048,7 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
2022
2048
  key: "render",
2023
2049
  value: function render() {
2024
2050
  var errorListCheck = this.state.errorListCheck;
2025
- var _this$props2 = this.props,
2026
- title = _this$props2.title,
2027
- notValid = _this$props2.notValid;
2051
+ var title = this.props.title;
2028
2052
  var totalSummary = this.getCount();
2029
2053
  var luckyCss = {
2030
2054
  margin: '0px',
@@ -2047,7 +2071,7 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
2047
2071
  trigger: ['click'],
2048
2072
  overlay: this.menuList,
2049
2073
  placement: "bottomRight"
2050
- }, /*#__PURE__*/React$1.createElement(Button, null, "\u6E05\u7A7A", /*#__PURE__*/React$1.createElement(DownOutlined, null))), !notValid && /*#__PURE__*/React$1.createElement(Button, {
2074
+ }, /*#__PURE__*/React$1.createElement(Button, null, "\u6E05\u7A7A", /*#__PURE__*/React$1.createElement(DownOutlined, null))), /*#__PURE__*/React$1.createElement(Button, {
2051
2075
  type: "primary",
2052
2076
  onClick: this.resetData
2053
2077
  }, "\u8BC6\u522B"))), /*#__PURE__*/React$1.createElement("div", {
@@ -2058,11 +2082,11 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
2058
2082
  }, /*#__PURE__*/React$1.createElement("div", {
2059
2083
  id: "luckysheet",
2060
2084
  style: luckyCss
2061
- })), !this.props.notValid && /*#__PURE__*/React$1.createElement("div", {
2085
+ })), /*#__PURE__*/React$1.createElement("div", {
2062
2086
  className: "sheet_table_footer"
2063
2087
  }, /*#__PURE__*/React$1.createElement("span", {
2064
2088
  className: "sheet_table_footer_l"
2065
- }, "\u5171 ", totalSummary.total, " \u6761\u6570\u636E", !notValid && ", \u5176\u4E2D\u9519\u8BEF ".concat(totalSummary.error, " \u9879")), !notValid && /*#__PURE__*/React$1.createElement(Space, {
2089
+ }, "\u5171 ", totalSummary.total, " \u6761\u6570\u636E, \u5176\u4E2D\u9519\u8BEF ", totalSummary.error, " \u9879"), /*#__PURE__*/React$1.createElement(Space, {
2066
2090
  className: "sheet_table_footer_r"
2067
2091
  }, /*#__PURE__*/React$1.createElement(Checkbox, {
2068
2092
  checked: errorListCheck,
@@ -2119,21 +2143,8 @@ var filterLetters$1 = function filterLetters(i) {
2119
2143
  return undefined;
2120
2144
  }
2121
2145
  };
2122
- // 抽象出创建对象的共通逻辑
2123
- function createItem$1(idPrefix, index, title, name, format) {
2124
- return {
2125
- id: "".concat(idPrefix).concat(index),
2126
- content: title,
2127
- code: name,
2128
- "ct": format //单元格值格式
2129
- };
2130
- }
2131
- // 定义[单元格值]常量以避免魔术字符串
2132
- var FORMAT_NAME_GENERAL$1 = "General"; //格式名称为自动格式
2133
- var FORMAT_TYPE_STRING$1 = "s"; //格式类型为数字类型
2134
2146
  var DataImport = /*#__PURE__*/function (_React$Component) {
2135
2147
  function DataImport(props) {
2136
- var _props$customerColumn;
2137
2148
  var _this;
2138
2149
  _classCallCheck(this, DataImport);
2139
2150
  _this = _callSuper(this, DataImport, [props]);
@@ -2375,32 +2386,22 @@ var DataImport = /*#__PURE__*/function (_React$Component) {
2375
2386
  });
2376
2387
  return obj;
2377
2388
  });
2378
- return data;
2389
+ return data.filter(function (item) {
2390
+ return item[_this.props.customerColumnsMapping[0].name];
2391
+ });
2379
2392
  };
2380
2393
  _this.resetData = function () {
2381
2394
  var _this$props = _this.props,
2382
2395
  validDataUrl = _this$props.validDataUrl,
2383
- validDataParams = _this$props.validDataParams,
2384
2396
  updateData = _this$props.updateData,
2385
- columns = _this$props.columns,
2386
- isBrandAuth = _this$props.isBrandAuth,
2387
- _this$props$isCheckSt = _this$props.isCheckStockNum,
2388
- isCheckStockNum = _this$props$isCheckSt === void 0 ? true : _this$props$isCheckSt;
2397
+ columns = _this$props.columns;
2389
2398
  var resultData = _this.getData().filter(function (d) {
2390
2399
  return _.compact(Object.values(d)).length;
2391
2400
  });
2392
- // 处理业务参数
2393
- var otherParams = {};
2394
- if (isBrandAuth) {
2395
- otherParams = {
2396
- brandAuth: 'ctl-withAuth'
2397
- };
2398
- }
2399
- axios.post(validDataUrl, _objectSpread2(_objectSpread2(_objectSpread2({}, otherParams), validDataParams), {}, {
2401
+ axios.post(validDataUrl, {
2400
2402
  columns: columns,
2401
- data: resultData,
2402
- checkStockNum: isCheckStockNum
2403
- })).then(function (result) {
2403
+ data: resultData
2404
+ }).then(function (result) {
2404
2405
  result = result.data;
2405
2406
  if (judgeIsRequestError(result)) {
2406
2407
  message$1.error(result.msg);
@@ -2553,21 +2554,31 @@ var DataImport = /*#__PURE__*/function (_React$Component) {
2553
2554
  }), provided.placeholder);
2554
2555
  }))));
2555
2556
  _this.props.onRef(_this);
2556
- var format = {
2557
- fa: FORMAT_NAME_GENERAL$1,
2558
- t: FORMAT_TYPE_STRING$1
2559
- };
2560
- if (props === null || props === void 0 ? void 0 : (_props$customerColumn = props.customerColumnsMapping) === null || _props$customerColumn === void 0 ? void 0 : _props$customerColumn.length) {
2561
- var _props$customerColumn2;
2562
- 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) {
2563
- return createItem$1('item-0', index, item.title, item.name, format);
2564
- })) || [];
2557
+ if (props.customerColumnsMapping) {
2558
+ itemsTemp$1 = props.customerColumnsMapping.map(function (item, index) {
2559
+ return {
2560
+ id: "item-0".concat(index),
2561
+ content: item.title,
2562
+ code: item.name,
2563
+ "ct": {
2564
+ "fa": "General",
2565
+ "t": "s" //格式类型为数字类型
2566
+ }
2567
+ };
2568
+ });
2565
2569
  } else {
2566
- var _props$columns;
2567
- 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) {
2568
- if (!mapping$1.get(item)) throw Error("".concat(item, " is not in DataValidation component, please fix this error"));
2569
- return createItem$1('item-0', index, mapping$1.get(item), item, format);
2570
- })) || [];
2570
+ itemsTemp$1 = props.columns.map(function (item, index) {
2571
+ if (!mapping$1.get(item)) throw Error("".concat(item, " is not in DataImport component, please fix this error"));
2572
+ return {
2573
+ id: "item-0".concat(index),
2574
+ content: mapping$1.get(item),
2575
+ code: item,
2576
+ "ct": {
2577
+ "fa": "General",
2578
+ "t": "s" //格式类型为数字类型
2579
+ }
2580
+ };
2581
+ });
2571
2582
  }
2572
2583
  luckysheet$1 = window.luckysheet || window.top.luckysheet;
2573
2584
  _this.state = {
@@ -2611,7 +2622,8 @@ var DataImport = /*#__PURE__*/function (_React$Component) {
2611
2622
  var errorListCheck = this.state.errorListCheck;
2612
2623
  var _this$props2 = this.props,
2613
2624
  title = _this$props2.title,
2614
- notValid = _this$props2.notValid;
2625
+ notValid = _this$props2.notValid,
2626
+ customerColumnsMapping = _this$props2.customerColumnsMapping;
2615
2627
  var totalSummary = this.getCount();
2616
2628
  var luckyCss = {
2617
2629
  margin: '0px',
@@ -2824,7 +2836,7 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
2824
2836
  specialBracket = _ref$specialBracket === void 0 ? false : _ref$specialBracket,
2825
2837
  _ref$noNeedSplit = _ref.noNeedSplit,
2826
2838
  noNeedSplit = _ref$noNeedSplit === void 0 ? false : _ref$noNeedSplit;
2827
- var resultSourceKey = handleSourceName(sourceName || (requestConfig === null || requestConfig === void 0 ? void 0 : requestConfig.sourceName) || (ctx === null || ctx === void 0 ? void 0 : ctx.name) || 'supplierCode');
2839
+ var resultSourceKey = handleSourceName(sourceName || (requestConfig === null || requestConfig === void 0 ? void 0 : requestConfig.sourceName) || 'supplierCode');
2828
2840
  var selectMode = selectProps === null || selectProps === void 0 ? void 0 : selectProps.mode; // 设定当前选择器 为单选或者多选模式 无设定为单选模式(默认)
2829
2841
  var initVal = value || (selectMode ? [] : null);
2830
2842
  var pageSize = 100; // 下拉框默认分页 条数
@@ -4488,7 +4500,7 @@ var getSelectDataList = function getSelectDataList(record, item, selectKey) {
4488
4500
  var _item$dataSource;
4489
4501
  var result = [];
4490
4502
  if (item === null || item === void 0 ? void 0 : item.dataSourceCode) {
4491
- result = (record === null || record === void 0 ? void 0 : record[item === null || item === void 0 ? void 0 : item.dataSourceCode]) || [];
4503
+ result = record === null || record === void 0 ? void 0 : record[item === null || item === void 0 ? void 0 : item.dataSourceCode];
4492
4504
  }
4493
4505
  if (item === null || item === void 0 ? void 0 : (_item$dataSource = item.dataSource) === null || _item$dataSource === void 0 ? void 0 : _item$dataSource.length) {
4494
4506
  result = (item === null || item === void 0 ? void 0 : item.filterDataSourceCode) ? item.dataSource.filter(function (i) {
@@ -4602,11 +4614,12 @@ var ResizeableTitle = function ResizeableTitle(props) {
4602
4614
  var initTableCode = {
4603
4615
  'sku': ['skuSelect-tableOptionsToChoosePartCode', 'skuSelect-tableSelectedItemPartCode'],
4604
4616
  'skc': ['skcSelect-tableOptionsToChoosePartCode', 'skcSelect-tableSelectedItemPartCode'],
4605
- 'spu': ['spuSelect-tableOptionsToChoosePartCode', 'spuSelect-tableSelectedItemPartCode']
4617
+ 'spu': [['spuSelect-tableOptionsToChoosePartCode', 'spuSelect-tableSelectedItemPartCode']]
4606
4618
  };
4607
4619
  var Option$2 = Select.Option;
4608
4620
  var AddSelect = function AddSelect(props) {
4609
4621
  var value = props.value,
4622
+ onChange = props.onChange,
4610
4623
  _props$selectProps = props.selectProps,
4611
4624
  selectProps = _props$selectProps === void 0 ? {} : _props$selectProps,
4612
4625
  _props$modalTableProp = props.modalTableProps,
@@ -4614,7 +4627,11 @@ var AddSelect = function AddSelect(props) {
4614
4627
  _props$labelInValue = props.labelInValue,
4615
4628
  labelInValue = _props$labelInValue === void 0 ? false : _props$labelInValue,
4616
4629
  requestConfig = props.requestConfig,
4630
+ ctx = props.ctx,
4617
4631
  sourceName = props.sourceName,
4632
+ _props$needModalTable = props.needModalTable,
4633
+ needModalTable = _props$needModalTable === void 0 ? true : _props$needModalTable,
4634
+ _props$getPopupContai = props.getPopupContainer,
4618
4635
  onSaveCallback = props.onSaveCallback,
4619
4636
  _props$buttonText = props.buttonText,
4620
4637
  buttonText = _props$buttonText === void 0 ? '添加' : _props$buttonText,
@@ -4631,8 +4648,15 @@ var AddSelect = function AddSelect(props) {
4631
4648
  url = _ref.url,
4632
4649
  otherParams = _ref.otherParams,
4633
4650
  isMap = _ref.isMap,
4651
+ fixedparameter = _ref.fixedparameter,
4652
+ fieldValToParam = _ref.fieldValToParam,
4653
+ _ref$mappingTextField = _ref.mappingTextField,
4654
+ mappingTextField = _ref$mappingTextField === void 0 ? 'name' : _ref$mappingTextField,
4655
+ mappingTextShowKeyField = _ref.mappingTextShowKeyField,
4634
4656
  _ref$mappingValueFiel = _ref.mappingValueField,
4635
- mappingValueField = _ref$mappingValueFiel === void 0 ? 'code' : _ref$mappingValueFiel;
4657
+ mappingValueField = _ref$mappingValueFiel === void 0 ? 'code' : _ref$mappingValueFiel,
4658
+ mappingTextShowTextField = _ref.mappingTextShowTextField;
4659
+ var resultSourceKey = sourceName || (requestConfig === null || requestConfig === void 0 ? void 0 : requestConfig.sourceName) || 'supplierCode';
4636
4660
  var realButtonProps = _objectSpread2({
4637
4661
  type: "primary"
4638
4662
  }, buttonProps);
@@ -4642,82 +4666,138 @@ var AddSelect = function AddSelect(props) {
4642
4666
  var pageSize = 100; // 下拉框默认分页 条数
4643
4667
  var tableInitPageSize = 10; // 弹框默认分页 条数
4644
4668
  var currentPage = 1;
4645
- var _useState = useState(false),
4669
+ var selectParamsKey = (requestConfig === null || requestConfig === void 0 ? void 0 : requestConfig.filter) || 'qp-codeAndName-like';
4670
+ var selectParamsInitKey = (requestConfig === null || requestConfig === void 0 ? void 0 : requestConfig.filterInit) || selectParamsKey;
4671
+ var currentSelectProps = _objectSpread2(_objectSpread2({}, selectProps), {}, {
4672
+ // 以下属性不可更改----设计配置项
4673
+ showSearch: false,
4674
+ filterOption: false,
4675
+ allowClear: true,
4676
+ listHeight: 160,
4677
+ optionLabelProp: "label",
4678
+ autoClearSearchValue: false
4679
+ });
4680
+ var _useState = useState([]),
4646
4681
  _useState2 = _slicedToArray(_useState, 2),
4647
- fetching = _useState2[0],
4648
- setFetching = _useState2[1];
4649
- var _useState3 = useState(false),
4682
+ items = _useState2[0],
4683
+ setItems = _useState2[1];
4684
+ var _useState3 = useState(1),
4650
4685
  _useState4 = _slicedToArray(_useState3, 2),
4651
- isModalVisible = _useState4[0],
4652
- setIsModalVisible = _useState4[1];
4653
- var _useState5 = useState(initVal),
4686
+ scrollPage = _useState4[0],
4687
+ setScrollPage = _useState4[1];
4688
+ var _useState5 = useState(0),
4654
4689
  _useState6 = _slicedToArray(_useState5, 2),
4655
- popvalue = _useState6[0],
4656
- setPopValue = _useState6[1];
4657
- var _useState7 = useState(sourceName),
4690
+ itemsTotal = _useState6[0],
4691
+ setItemsTotal = _useState6[1];
4692
+ var _useState7 = useState(false),
4658
4693
  _useState8 = _slicedToArray(_useState7, 2),
4659
- uniqueValue = _useState8[0],
4660
- setUniqueValue = _useState8[1];
4661
- var _Form$useForm = Form.useForm(),
4662
- _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
4663
- form = _Form$useForm2[0];
4664
- var _useState9 = useState(modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.tableSearchForm),
4694
+ fetching = _useState8[0],
4695
+ setFetching = _useState8[1];
4696
+ var _useState9 = useState(''),
4665
4697
  _useState10 = _slicedToArray(_useState9, 2),
4666
- tableSearchForm = _useState10[0],
4667
- setTableSearchForm = _useState10[1];
4668
- var _useState11 = useState(true),
4698
+ searchValue = _useState10[0],
4699
+ setSearchValue = _useState10[1];
4700
+ var _useState11 = useState(false),
4669
4701
  _useState12 = _slicedToArray(_useState11, 2),
4670
- caretLeftFlag = _useState12[0],
4671
- setCaretLeftFlag = _useState12[1];
4672
- var _useState13 = useState([]),
4702
+ isModalVisible = _useState12[0],
4703
+ setIsModalVisible = _useState12[1];
4704
+ var _useState13 = useState(initVal),
4673
4705
  _useState14 = _slicedToArray(_useState13, 2),
4674
- tableData = _useState14[0],
4675
- setTableData = _useState14[1];
4676
- var _useState15 = useState({
4706
+ popvalue = _useState14[0],
4707
+ setPopValue = _useState14[1];
4708
+ var _useState15 = useState(sourceName),
4709
+ _useState16 = _slicedToArray(_useState15, 2),
4710
+ uniqueValue = _useState16[0],
4711
+ setUniqueValue = _useState16[1];
4712
+ var _useDebounceFn = useDebounceFn(function (v) {
4713
+ // 优化搜索参数 支持传多个
4714
+ var searchParams = {};
4715
+ if (typeof selectParamsKey === 'string') {
4716
+ searchParams = v ? _defineProperty({}, selectParamsInitKey, initVal) : _defineProperty({}, selectParamsKey, searchValue);
4717
+ }
4718
+ if (Array.isArray(selectParamsKey)) {
4719
+ selectParamsKey.forEach(function (i) {
4720
+ searchParams = _objectSpread2(_objectSpread2({}, searchParams), {}, _defineProperty({}, i, searchValue));
4721
+ });
4722
+ }
4723
+ // 防抖函数 待定
4724
+ getData(searchParams);
4725
+ }, {
4726
+ wait: 1000
4727
+ }),
4728
+ run = _useDebounceFn.run;
4729
+ var _Form$useForm = Form.useForm(),
4730
+ _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
4731
+ form = _Form$useForm2[0];
4732
+ var _useState17 = useState(modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.tableSearchForm),
4733
+ _useState18 = _slicedToArray(_useState17, 2),
4734
+ tableSearchForm = _useState18[0],
4735
+ setTableSearchForm = _useState18[1];
4736
+ var _useState19 = useState(true),
4737
+ _useState20 = _slicedToArray(_useState19, 2),
4738
+ caretLeftFlag = _useState20[0],
4739
+ setCaretLeftFlag = _useState20[1];
4740
+ var _useState21 = useState([]),
4741
+ _useState22 = _slicedToArray(_useState21, 2),
4742
+ tableData = _useState22[0],
4743
+ setTableData = _useState22[1];
4744
+ var _useState23 = useState({
4677
4745
  total: 0,
4678
4746
  size: "small",
4679
4747
  current: 1,
4680
4748
  pageSize: tableInitPageSize
4681
4749
  }),
4682
- _useState16 = _slicedToArray(_useState15, 2),
4683
- tablePagination = _useState16[0],
4684
- setTablePagination = _useState16[1];
4685
- var _useState17 = useState([]),
4686
- _useState18 = _slicedToArray(_useState17, 2),
4687
- selectedRowKeys = _useState18[0],
4688
- setSelectedRowKeys = _useState18[1];
4689
- var _useState19 = useState({}),
4690
- _useState20 = _slicedToArray(_useState19, 2),
4691
- tableFormParams = _useState20[0],
4692
- setTableFormParams = _useState20[1];
4693
- var _useState21 = useState(false),
4694
- _useState22 = _slicedToArray(_useState21, 2),
4695
- confirmLoading = _useState22[0],
4696
- setConfirmLoading = _useState22[1];
4697
- var _useState23 = useState(false),
4698
4750
  _useState24 = _slicedToArray(_useState23, 2),
4699
- confirmContinueLoading = _useState24[0],
4700
- setConfirmContinueLoading = _useState24[1];
4751
+ tablePagination = _useState24[0],
4752
+ setTablePagination = _useState24[1];
4701
4753
  var _useState25 = useState([]),
4702
4754
  _useState26 = _slicedToArray(_useState25, 2),
4703
- selectColumns = _useState26[0],
4704
- setSelectColumns = _useState26[1];
4755
+ selectedRowKeys = _useState26[0],
4756
+ setSelectedRowKeys = _useState26[1];
4705
4757
  var _useState27 = useState([]),
4706
4758
  _useState28 = _slicedToArray(_useState27, 2),
4707
- showColumns = _useState28[0],
4708
- setShowColumns = _useState28[1];
4709
- var _useState29 = useState([]),
4759
+ doubleArr = _useState28[0],
4760
+ setDoubleArr = _useState28[1]; // 存放双数组的数组
4761
+ var _useState29 = useState(false),
4710
4762
  _useState30 = _slicedToArray(_useState29, 2),
4711
- tableColumns = _useState30[0],
4712
- setTableColumns = _useState30[1];
4713
- var _useState31 = useState([]),
4763
+ checkedAll = _useState30[0],
4764
+ setCheckedAll = _useState30[1];
4765
+ var _useState31 = useState(false),
4714
4766
  _useState32 = _slicedToArray(_useState31, 2),
4715
- showToChooseColumns = _useState32[0],
4716
- setShowToChooseColumns = _useState32[1];
4767
+ indeterminate = _useState32[0],
4768
+ setIndeterminate = _useState32[1];
4769
+ var _useState33 = useState({}),
4770
+ _useState34 = _slicedToArray(_useState33, 2),
4771
+ tableFormParams = _useState34[0],
4772
+ setTableFormParams = _useState34[1];
4773
+ var _useState35 = useState(false),
4774
+ _useState36 = _slicedToArray(_useState35, 2),
4775
+ confirmLoading = _useState36[0],
4776
+ setConfirmLoading = _useState36[1];
4777
+ var _useState37 = useState(false),
4778
+ _useState38 = _slicedToArray(_useState37, 2),
4779
+ confirmContinueLoading = _useState38[0],
4780
+ setConfirmContinueLoading = _useState38[1];
4781
+ var _useState39 = useState([]),
4782
+ _useState40 = _slicedToArray(_useState39, 2),
4783
+ selectColumns = _useState40[0],
4784
+ setSelectColumns = _useState40[1];
4785
+ var _useState41 = useState([]),
4786
+ _useState42 = _slicedToArray(_useState41, 2),
4787
+ showColumns = _useState42[0],
4788
+ setShowColumns = _useState42[1];
4789
+ var _useState43 = useState([]),
4790
+ _useState44 = _slicedToArray(_useState43, 2),
4791
+ tableColumns = _useState44[0],
4792
+ setTableColumns = _useState44[1];
4793
+ var _useState45 = useState([]),
4794
+ _useState46 = _slicedToArray(_useState45, 2),
4795
+ showToChooseColumns = _useState46[0],
4796
+ setShowToChooseColumns = _useState46[1];
4717
4797
  var codeToChoose = tableCodeList[0] || initTableCode[businessType][0];
4718
4798
  var codeSelected = tableCodeList[1] || initTableCode[businessType][1];
4719
4799
  var checkSelectChange = /*#__PURE__*/function () {
4720
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(bType, tList, recordKey, recordItem, selectItem, changeValue) {
4800
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(bType, tList, recordKey, recordItem, selectItem, changeValue) {
4721
4801
  var result;
4722
4802
  return _regeneratorRuntime().wrap(function _callee$(_context) {
4723
4803
  while (1) switch (_context.prev = _context.next) {
@@ -4792,7 +4872,7 @@ var AddSelect = function AddSelect(props) {
4792
4872
  }, _callee, null, [[15, 22]]);
4793
4873
  }));
4794
4874
  return function checkSelectChange(_x, _x2, _x3, _x4, _x5, _x6) {
4795
- return _ref2.apply(this, arguments);
4875
+ return _ref4.apply(this, arguments);
4796
4876
  };
4797
4877
  }();
4798
4878
  var setBusinessDefaultValue = function setBusinessDefaultValue(list, recordList) {
@@ -4858,7 +4938,7 @@ var AddSelect = function AddSelect(props) {
4858
4938
  // precision: unitAccuracy
4859
4939
  };
4860
4940
  }
4861
- return /*#__PURE__*/React$1.createElement(InputNumber, _objectSpread2(_objectSpread2(_objectSpread2({}, item.inputProps), {}, {
4941
+ return /*#__PURE__*/React$1.createElement(InputNumber, _objectSpread2(_objectSpread2({
4862
4942
  value: text || '',
4863
4943
  min: 0,
4864
4944
  autoFocus: record.needFocus,
@@ -4866,7 +4946,13 @@ var AddSelect = function AddSelect(props) {
4866
4946
  }, precisionObj), {}, {
4867
4947
  onChange: function onChange(value) {
4868
4948
  record[item.dataIndex] = value;
4869
- editRecord(record);
4949
+ var newPopValue = popvalue.map(function (i, innerIndex) {
4950
+ if (innerIndex == index) {
4951
+ i[item.dataIndex] = record[item.dataIndex];
4952
+ }
4953
+ return i;
4954
+ });
4955
+ setPopValue(newPopValue);
4870
4956
  },
4871
4957
  // onFocus={(e)=> {
4872
4958
  // let dom1 = e.currentTarget;
@@ -4965,90 +5051,35 @@ var AddSelect = function AddSelect(props) {
4965
5051
  var selectKey = (item === null || item === void 0 ? void 0 : (_item$dataSourceMappi = item.dataSourceMapping) === null || _item$dataSourceMappi === void 0 ? void 0 : _item$dataSourceMappi[0]) || 'code';
4966
5052
  var selectText = (item === null || item === void 0 ? void 0 : (_item$dataSourceMappi2 = item.dataSourceMapping) === null || _item$dataSourceMappi2 === void 0 ? void 0 : _item$dataSourceMappi2[1]) || 'name';
4967
5053
  var dataSourceList = getSelectDataList(record, item, selectKey);
4968
- return /*#__PURE__*/React$1.createElement(Select, _objectSpread2(_objectSpread2({}, item.selectProps), {}, {
5054
+ return /*#__PURE__*/React$1.createElement(Select, {
4969
5055
  value: text || null,
4970
5056
  onChange: function () {
4971
5057
  var _onChange = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(value) {
4972
- var dataSourceSelectItem, _item$selectChangeCal, changeValue, isCheckPass, isConformToTheRules;
5058
+ var isConformToTheRules, newPopValue;
4973
5059
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
4974
5060
  while (1) switch (_context2.prev = _context2.next) {
4975
5061
  case 0:
4976
- dataSourceSelectItem = (dataSourceList === null || dataSourceList === void 0 ? void 0 : dataSourceList.find(function (d) {
4977
- return d[selectKey] == value;
4978
- })) || {};
4979
- if (!(item === null || item === void 0 ? void 0 : item.selectChangeCallback)) {
4980
- _context2.next = 6;
4981
- break;
4982
- }
4983
- _context2.next = 4;
4984
- 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, {
4985
- record: record,
4986
- index: index,
4987
- item: item,
4988
- oldValue: text,
4989
- changeValue: value,
4990
- dataSourceSelectItem: dataSourceSelectItem,
4991
- editRecord: editRecord
4992
- });
4993
- case 4:
4994
- _context2.next = 25;
4995
- break;
4996
- case 6:
4997
- // 更新当前行数据函数
4998
- changeValue = function changeValue(v, dSSItem) {
4999
- var _item$dataSourceSelec;
5000
- record[item.dataIndex] = v;
5001
- // 下拉框带出需要回填的数据
5002
- if (item === null || item === void 0 ? void 0 : (_item$dataSourceSelec = item.dataSourceSelectBackData) === null || _item$dataSourceSelec === void 0 ? void 0 : _item$dataSourceSelec.length) {
5003
- item === null || item === void 0 ? void 0 : item.dataSourceSelectBackData.forEach(function (s) {
5004
- record[s] = dSSItem ? dSSItem[s] : null;
5005
- });
5006
- }
5007
- }; // 处理校验,默认不校验
5008
- isCheckPass = true;
5009
- _context2.prev = 8;
5010
- if (!(item === null || item === void 0 ? void 0 : item.selectCheckCallback)) {
5011
- _context2.next = 15;
5012
- break;
5013
- }
5014
- _context2.next = 12;
5015
- return item === null || item === void 0 ? void 0 : item.selectCheckCallback(popvalue, {
5016
- record: record,
5017
- index: index,
5018
- item: item,
5019
- oldValue: text,
5020
- changeValue: value,
5021
- dataSourceSelectItem: dataSourceSelectItem
5022
- });
5023
- case 12:
5024
- isCheckPass = _context2.sent;
5025
- _context2.next = 19;
5026
- break;
5027
- case 15:
5028
- _context2.next = 17;
5062
+ _context2.next = 2;
5029
5063
  return checkSelectChange(businessType, popvalue, mappingValueField, record, item, value);
5030
- case 17:
5064
+ case 2:
5031
5065
  isConformToTheRules = _context2.sent;
5032
- isCheckPass = !isConformToTheRules;
5033
- case 19:
5034
- _context2.next = 23;
5035
- break;
5036
- case 21:
5037
- _context2.prev = 21;
5038
- _context2.t0 = _context2["catch"](8);
5039
- case 23:
5040
- if (isCheckPass) {
5041
- changeValue(value, dataSourceSelectItem);
5066
+ if (isConformToTheRules) {
5067
+ record[item.dataIndex] = value;
5042
5068
  } else {
5043
- changeValue(null);
5069
+ record[item.dataIndex] = null;
5044
5070
  }
5045
- // 更新已选表格函数
5046
- editRecord(record);
5047
- case 25:
5071
+ newPopValue = popvalue.map(function (i, innerIndex) {
5072
+ if (innerIndex == index) {
5073
+ i[item.dataIndex] = record[item.dataIndex];
5074
+ }
5075
+ return i;
5076
+ });
5077
+ setPopValue(newPopValue);
5078
+ case 6:
5048
5079
  case "end":
5049
5080
  return _context2.stop();
5050
5081
  }
5051
- }, _callee2, null, [[8, 21]]);
5082
+ }, _callee2);
5052
5083
  }));
5053
5084
  function onChange(_x7) {
5054
5085
  return _onChange.apply(this, arguments);
@@ -5056,9 +5087,9 @@ var AddSelect = function AddSelect(props) {
5056
5087
  return onChange;
5057
5088
  }(),
5058
5089
  style: {
5059
- width: "".concat((item === null || item === void 0 ? void 0 : item.width) && (item === null || item === void 0 ? void 0 : item.width) - 20 || '160', "px")
5090
+ width: '160px'
5060
5091
  }
5061
- }), dataSourceList === null || dataSourceList === void 0 ? void 0 : dataSourceList.map(function (item) {
5092
+ }, dataSourceList.map(function (item) {
5062
5093
  return /*#__PURE__*/React$1.createElement(Select.Option, {
5063
5094
  value: item[selectKey]
5064
5095
  }, item[selectText]);
@@ -5091,10 +5122,20 @@ var AddSelect = function AddSelect(props) {
5091
5122
  // 获取数据源 (type: 1下拉框 2弹框 不传值默认为下拉框)
5092
5123
  var getData = function getData() {
5093
5124
  var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
5125
+ var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
5094
5126
  if (!requestConfig) return;
5095
5127
  setFetching(true);
5096
5128
  // 处理dependence参数
5097
5129
  var fixedParam = {};
5130
+ if (fixedparameter && fieldValToParam && ctx) {
5131
+ fixedparameter.forEach(function (item, index) {
5132
+ var fixedParamVal = ctx.form.getFieldValue(fieldValToParam[index]);
5133
+ if (fixedParamVal) {
5134
+ fixedParam[item] = fixedParamVal;
5135
+ form.setFieldsValue(_objectSpread2(_objectSpread2({}, form === null || form === void 0 ? void 0 : form.getFieldsValue()), {}, _defineProperty({}, item, fixedParamVal)));
5136
+ }
5137
+ });
5138
+ }
5098
5139
  // 数组对象处理,对带有特殊标记的name进行处理
5099
5140
  var _loop = function _loop() {
5100
5141
  if (Object.prototype.hasOwnProperty.call(params, key)) {
@@ -5200,7 +5241,21 @@ var AddSelect = function AddSelect(props) {
5200
5241
  var keys = res.list ? 'list' : 'items';
5201
5242
  source = res ? res[keys] ? res[keys].map(function (item) {
5202
5243
  var _item$packingUnitList, _item$packingUnitList2;
5244
+ var textShowText = item[mappingTextField];
5245
+ if (mappingTextShowTextField) {
5246
+ textShowText = [];
5247
+ if (Array.isArray(mappingTextShowTextField)) {
5248
+ mappingTextShowTextField.forEach(function (r) {
5249
+ textShowText.push(item[r]);
5250
+ });
5251
+ } else {
5252
+ textShowText = item[mappingTextShowTextField];
5253
+ }
5254
+ }
5203
5255
  return _objectSpread2(_objectSpread2({}, item), {}, {
5256
+ text: item[mappingTextField],
5257
+ textShowText: textShowText,
5258
+ textShowKey: item[mappingTextShowKeyField || mappingValueField],
5204
5259
  value: item[mappingValueField],
5205
5260
  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) {
5206
5261
  return item.baseUnit === true;
@@ -5208,7 +5263,21 @@ var AddSelect = function AddSelect(props) {
5208
5263
  });
5209
5264
  }) : Array.isArray(res) && (res === null || res === void 0 ? void 0 : res.map(function (item) {
5210
5265
  var _item$packingUnitList3, _item$packingUnitList4;
5266
+ var textShowText = item[mappingTextField];
5267
+ if (mappingTextShowTextField) {
5268
+ textShowText = [];
5269
+ if (Array.isArray(mappingTextShowTextField)) {
5270
+ mappingTextShowTextField.forEach(function (r) {
5271
+ textShowText.push(item[r]);
5272
+ });
5273
+ } else {
5274
+ textShowText = item[mappingTextShowTextField];
5275
+ }
5276
+ }
5211
5277
  return _objectSpread2(_objectSpread2({}, item), {}, {
5278
+ text: item[mappingTextField],
5279
+ textShowText: textShowText,
5280
+ textShowKey: item[mappingTextShowKeyField || mappingValueField],
5212
5281
  value: item[mappingValueField],
5213
5282
  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) {
5214
5283
  return item.baseUnit === true;
@@ -5217,12 +5286,19 @@ var AddSelect = function AddSelect(props) {
5217
5286
  })) : [];
5218
5287
  }
5219
5288
  source = Array.isArray(source) ? source : [];
5220
- setTableData(source);
5221
- setTablePagination(_objectSpread2(_objectSpread2({}, tablePagination), {}, {
5222
- total: Number((res === null || res === void 0 ? void 0 : res.total) || (res === null || res === void 0 ? void 0 : res.totalCount) || source.length),
5223
- 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),
5224
- 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)
5225
- }));
5289
+ if (type === 1) {
5290
+ var _ctx$form;
5291
+ ctx === null || ctx === void 0 ? void 0 : (_ctx$form = ctx.form) === null || _ctx$form === void 0 ? void 0 : _ctx$form.setFieldSource(resultSourceKey, source);
5292
+ setItems(source);
5293
+ setItemsTotal(Number((res === null || res === void 0 ? void 0 : res.total) || (res === null || res === void 0 ? void 0 : res.totalCount) || source.length));
5294
+ } else {
5295
+ setTableData(source);
5296
+ setTablePagination(_objectSpread2(_objectSpread2({}, tablePagination), {}, {
5297
+ total: Number((res === null || res === void 0 ? void 0 : res.total) || (res === null || res === void 0 ? void 0 : res.totalCount) || source.length),
5298
+ 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),
5299
+ 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)
5300
+ }));
5301
+ }
5226
5302
  }).catch(function (err) {
5227
5303
  setFetching(false);
5228
5304
  });
@@ -5264,6 +5340,12 @@ var AddSelect = function AddSelect(props) {
5264
5340
  value: i
5265
5341
  };
5266
5342
  }));
5343
+ setIndeterminate(!!value.length && value.length < itemsTotal);
5344
+ setCheckedAll(itemsTotal && value.length === itemsTotal);
5345
+ // 需清空数据
5346
+ if (!value.length) {
5347
+ setDoubleArr([]);
5348
+ }
5267
5349
  } else {
5268
5350
  setSelectedRowKeys(labelInValue ? [value.key] : [value]);
5269
5351
  setPopValue(labelInValue ? [{
@@ -5298,6 +5380,7 @@ var AddSelect = function AddSelect(props) {
5298
5380
  message$1.warning('至少选中一条数据');
5299
5381
  return;
5300
5382
  }
5383
+ // handleSelectOver(popvalue)
5301
5384
  if (onSaveCallback) {
5302
5385
  handleLoading(isContinue, true);
5303
5386
  onSaveCallback(popvalue).then(function (res) {
@@ -5333,6 +5416,9 @@ var AddSelect = function AddSelect(props) {
5333
5416
  setTableFormParams({});
5334
5417
  setIsModalVisible(false);
5335
5418
  setTableData([]);
5419
+ // if (selectMode) {
5420
+ // run();
5421
+ // }
5336
5422
  };
5337
5423
  var onSearchTable = function onSearchTable() {
5338
5424
  var params = form.getFieldsValue();
@@ -5340,6 +5426,9 @@ var AddSelect = function AddSelect(props) {
5340
5426
  getData(_objectSpread2(_objectSpread2({}, params), {}, {
5341
5427
  pageSize: tableInitPageSize
5342
5428
  }), 2);
5429
+ // if (selectMode) {
5430
+ // getData(params)
5431
+ // }
5343
5432
  };
5344
5433
  var onResetTable = function onResetTable() {
5345
5434
  form.resetFields();
@@ -5378,6 +5467,8 @@ var AddSelect = function AddSelect(props) {
5378
5467
  setPopValue(selectRows);
5379
5468
  setSelectedRowKeys(selectKeys);
5380
5469
  }
5470
+ // setIndeterminate(!!filterRows.length && filterRows.length < tablePagination?.total);
5471
+ // setCheckedAll(filterRows.length === tablePagination?.total);
5381
5472
  };
5382
5473
  // 生成唯一值
5383
5474
  var makeUniqueValue = function makeUniqueValue() {
@@ -5506,15 +5597,6 @@ var AddSelect = function AddSelect(props) {
5506
5597
  })));
5507
5598
  }
5508
5599
  };
5509
- var editRecord = function editRecord(record) {
5510
- var newPopValue = _toConsumableArray(popvalue);
5511
- var index = newPopValue.findIndex(function (item) {
5512
- return record[selectRowKey] == item[selectRowKey];
5513
- });
5514
- var item = newPopValue[index];
5515
- newPopValue.splice(index, 1, _objectSpread2(_objectSpread2({}, item), record));
5516
- setPopValue(_toConsumableArray(newPopValue));
5517
- };
5518
5600
  var inputIndex = 0;
5519
5601
  useEffect(function () {
5520
5602
  setInitialShowColumn(codeSelected, selectColumns, function (res) {
@@ -5527,8 +5609,8 @@ var AddSelect = function AddSelect(props) {
5527
5609
  });
5528
5610
  }, [tableColumns]);
5529
5611
  var handleResize = function handleResize(arr, index, callback) {
5530
- return function (_, _ref3) {
5531
- var size = _ref3.size;
5612
+ return function (_, _ref5) {
5613
+ var size = _ref5.size;
5532
5614
  var newColumns = arr.map(function (col) {
5533
5615
  return _objectSpread2({}, col);
5534
5616
  });
@@ -5593,7 +5675,7 @@ var AddSelect = function AddSelect(props) {
5593
5675
  id: "add_select_div_".concat(uniqueValue)
5594
5676
  }, /*#__PURE__*/React$1.createElement(Button, _objectSpread2({
5595
5677
  onClick: handleShowModal
5596
- }, realButtonProps), buttonText)), isModalVisible && ( /*#__PURE__*/React$1.createElement(Modal, {
5678
+ }, realButtonProps), buttonText)), needModalTable && isModalVisible && ( /*#__PURE__*/React$1.createElement(Modal, {
5597
5679
  width: '1200px',
5598
5680
  style: {
5599
5681
  top: 20
@@ -5601,6 +5683,7 @@ var AddSelect = function AddSelect(props) {
5601
5683
  bodyStyle: {
5602
5684
  padding: '0px'
5603
5685
  },
5686
+ // title={modalTableProps?.modalTableTitle}
5604
5687
  visible: isModalVisible,
5605
5688
  closable: false,
5606
5689
  onCancel: handleCancel,
@@ -5746,6 +5829,7 @@ var AddSelect = function AddSelect(props) {
5746
5829
  columns: showSelectedCol,
5747
5830
  dataSource: popvalue,
5748
5831
  pagination: false,
5832
+ // onChange={handleTableChange}
5749
5833
  rowKey: selectRowKey,
5750
5834
  rowClassName: 'row-class',
5751
5835
  scroll: {
@@ -9232,40 +9316,10 @@ var BusinessSearchSelect$1 = /*#__PURE__*/React$1.memo(BusinessSearchSelect, fun
9232
9316
  // import { getCurrentTargetBgId } from '@/utils/LocalstorageUtils';
9233
9317
  function handleSelectColumn(c, parentProps) {
9234
9318
  var result = c;
9235
- var showColumns = (parentProps === null || parentProps === void 0 ? void 0 : parentProps.showColumns) || (parentProps === null || parentProps === void 0 ? void 0 : parentProps.showSelectColumns) || [];
9236
- var exceptColumns = (parentProps === null || parentProps === void 0 ? void 0 : parentProps.exceptColumns) || (parentProps === null || parentProps === void 0 ? void 0 : parentProps.exceptSelectColumns) || [];
9237
- var coverColumns = (parentProps === null || parentProps === void 0 ? void 0 : parentProps.coverColumns) || (parentProps === null || parentProps === void 0 ? void 0 : parentProps.coverSelectColumns) || [];
9238
- var additionColumns = (parentProps === null || parentProps === void 0 ? void 0 : parentProps.additionColumns) || (parentProps === null || parentProps === void 0 ? void 0 : parentProps.additionSelectColumns) || [];
9239
- // 仅展示内容
9240
- if (showColumns === null || showColumns === void 0 ? void 0 : showColumns.length) {
9241
- result = result.filter(function (i) {
9242
- return showColumns.includes(i.dataIndex);
9243
- });
9244
- }
9245
- // 过滤不需要展示内容
9246
- if (exceptColumns === null || exceptColumns === void 0 ? void 0 : exceptColumns.length) {
9247
- result = result.filter(function (i) {
9248
- return !exceptColumns.includes(i.dataIndex);
9249
- });
9250
- }
9251
- // 追加(最好不用这个,当组件不固定时候会有影响)
9252
- if (additionColumns === null || additionColumns === void 0 ? void 0 : additionColumns.length) {
9253
- additionColumns.forEach(function (i) {
9254
- result.splice(i.position, 0, i.column);
9255
- });
9256
- }
9257
- // 覆盖内容
9258
- if (coverColumns === null || coverColumns === void 0 ? void 0 : coverColumns.length) {
9259
- result = coverColumns;
9260
- }
9261
- return result;
9262
- }
9263
- function handleTableColumn(c, parentProps) {
9264
- var result = c;
9265
- var showColumns = (parentProps === null || parentProps === void 0 ? void 0 : parentProps.showColumns) || (parentProps === null || parentProps === void 0 ? void 0 : parentProps.showTableColumns) || [];
9266
- var exceptColumns = (parentProps === null || parentProps === void 0 ? void 0 : parentProps.exceptColumns) || (parentProps === null || parentProps === void 0 ? void 0 : parentProps.exceptTableColumns) || [];
9267
- var coverColumns = (parentProps === null || parentProps === void 0 ? void 0 : parentProps.coverColumns) || (parentProps === null || parentProps === void 0 ? void 0 : parentProps.coverTableColumns) || [];
9268
- var additionColumns = (parentProps === null || parentProps === void 0 ? void 0 : parentProps.additionColumns) || (parentProps === null || parentProps === void 0 ? void 0 : parentProps.additionTableColumns) || [];
9319
+ var showColumns = (parentProps === null || parentProps === void 0 ? void 0 : parentProps.showColumns) || [];
9320
+ var exceptColumns = (parentProps === null || parentProps === void 0 ? void 0 : parentProps.exceptColumns) || [];
9321
+ var coverColumns = (parentProps === null || parentProps === void 0 ? void 0 : parentProps.coverColumns) || [];
9322
+ var additionColumns = (parentProps === null || parentProps === void 0 ? void 0 : parentProps.additionColumns) || [];
9269
9323
  // 仅展示内容
9270
9324
  if (showColumns === null || showColumns === void 0 ? void 0 : showColumns.length) {
9271
9325
  result = result.filter(function (i) {
@@ -9585,7 +9639,7 @@ var AddSkuSelect = function AddSkuSelect(parProps) {
9585
9639
  },
9586
9640
  dataIndex: 'brandName'
9587
9641
  }]);
9588
- var mTpTableColumn = handleTableColumn(initialTableColumn, parProps);
9642
+ var mTpTableColumn = handleSelectColumn(initialTableColumn, parProps);
9589
9643
  var initialTableSearchForm = [{
9590
9644
  name: 'qp-skuCode-like',
9591
9645
  label: 'SKU编码'
@@ -9697,7 +9751,7 @@ var AddSkuSelect = function AddSkuSelect(parProps) {
9697
9751
  isAllowRepeatedSelect: !!(parProps === null || parProps === void 0 ? void 0 : parProps.isAllowRepeatedSelect)
9698
9752
  };
9699
9753
  var modalTableProps = {
9700
- modalTableTitle: parProps.modalTableTitle || '选择商品',
9754
+ modalTableTitle: '选择商品',
9701
9755
  tableSearchForm: mTpTableSearchForm,
9702
9756
  tableColumns: mTpTableColumn,
9703
9757
  selectColumn: mTpSelectColumn,
@@ -9776,190 +9830,12 @@ var AddSkcSelect = function AddSkcSelect(parProps) {
9776
9830
  dataIndex: 'count'
9777
9831
  }];
9778
9832
  var mTpSelectColumn = handleSelectColumn(initialSelectColumn, parProps);
9779
- var initialTableColumn = [{
9780
- title: 'SKC编码',
9781
- width: 150,
9782
- dataIndex: 'code'
9783
- }, {
9784
- title: 'SKC名称',
9785
- width: 200,
9786
- ellipsis: {
9787
- showTitle: false
9788
- },
9789
- render: function render(text) {
9790
- return /*#__PURE__*/React$1.createElement(Tooltip, {
9791
- placement: "topLeft",
9792
- title: text
9793
- }, text);
9794
- },
9795
- dataIndex: 'name'
9796
- }, {
9797
- title: '商品名称',
9798
- width: 100,
9799
- ellipsis: {
9800
- showTitle: false
9801
- },
9802
- dataIndex: 'itemName',
9803
- render: function render(text) {
9804
- return /*#__PURE__*/React$1.createElement(Tooltip, {
9805
- placement: "topLeft",
9806
- title: text
9807
- }, text);
9808
- }
9809
- }, {
9810
- title: '颜色',
9811
- width: 100,
9812
- ellipsis: {
9813
- showTitle: false
9814
- },
9815
- render: function render(text) {
9816
- return /*#__PURE__*/React$1.createElement(Tooltip, {
9817
- placement: "topLeft",
9818
- title: text
9819
- }, text);
9820
- },
9821
- dataIndex: 'colorName'
9822
- }, {
9823
- title: '类目',
9824
- width: 100,
9825
- ellipsis: {
9826
- showTitle: false
9827
- },
9828
- render: function render(text) {
9829
- return /*#__PURE__*/React$1.createElement(Tooltip, {
9830
- placement: "topLeft",
9831
- title: text
9832
- }, text);
9833
- },
9834
- dataIndex: 'categoryName'
9835
- }, {
9836
- title: '品类',
9837
- width: 100,
9838
- ellipsis: {
9839
- showTitle: false
9840
- },
9841
- render: function render(text) {
9842
- return /*#__PURE__*/React$1.createElement(Tooltip, {
9843
- placement: "topLeft",
9844
- title: text
9845
- }, text);
9846
- },
9847
- dataIndex: 'className'
9848
- }, {
9849
- title: '品牌',
9850
- width: 100,
9851
- ellipsis: {
9852
- showTitle: false
9853
- },
9854
- render: function render(text) {
9855
- return /*#__PURE__*/React$1.createElement(Tooltip, {
9856
- placement: "topLeft",
9857
- title: text
9858
- }, text);
9859
- },
9860
- dataIndex: 'brandName'
9861
- }];
9862
- var mTpTableColumn = handleTableColumn(initialTableColumn, parProps);
9863
- var initialTableSearchForm = [{
9864
- name: 'qp-code-like',
9865
- label: 'SKC编码'
9866
- }, {
9867
- name: 'qp-skcName-like',
9868
- label: 'SKC名称'
9869
- }, {
9870
- name: 'qp-itemName-like',
9871
- label: '商品名称'
9872
- }, {
9873
- name: 'qp-colorName-in',
9874
- type: 'select',
9875
- label: '颜色',
9876
- field: {
9877
- type: 'select',
9878
- props: {
9879
- mode: 'multiple',
9880
- notFoundContent: '暂无数据',
9881
- allowClear: true,
9882
- showSearch: true,
9883
- showArrow: true,
9884
- maxTagCount: 1,
9885
- optionFilterProp: 'children',
9886
- filterOption: function filterOption(input, option) {
9887
- return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
9888
- }
9889
- }
9890
- }
9891
- }, {
9892
- name: 'qp-categoryId-in',
9893
- type: 'treeSelect',
9894
- label: '类目',
9895
- field: {
9896
- type: 'treeSelect',
9897
- props: {
9898
- treeData: [],
9899
- treeCheckable: true,
9900
- showSearch: true,
9901
- allowClear: true,
9902
- showArrow: true,
9903
- treeNodeFilterProp: 'title',
9904
- treeDefaultExpandAll: true,
9905
- maxTagCount: 1,
9906
- placeholder: '请选择',
9907
- style: {
9908
- width: '100%'
9909
- },
9910
- dropdownStyle: {
9911
- maxHeight: 400,
9912
- maxWidth: 100,
9913
- overflow: 'auto'
9914
- }
9915
- }
9916
- }
9917
- }, {
9918
- name: 'qp-classId-in',
9919
- type: 'select',
9920
- label: '品类',
9921
- field: {
9922
- type: 'select',
9923
- props: {
9924
- mode: 'multiple',
9925
- notFoundContent: '暂无数据',
9926
- allowClear: true,
9927
- showSearch: true,
9928
- showArrow: true,
9929
- maxTagCount: 1,
9930
- optionFilterProp: 'children',
9931
- filterOption: function filterOption(input, option) {
9932
- return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
9933
- }
9934
- }
9935
- }
9936
- }, {
9937
- name: 'qp-brandId-in',
9938
- type: 'select',
9939
- label: '品牌',
9940
- field: {
9941
- type: 'select',
9942
- props: {
9943
- mode: 'multiple',
9944
- notFoundContent: '暂无数据',
9945
- allowClear: true,
9946
- showSearch: true,
9947
- showArrow: true,
9948
- maxTagCount: 1,
9949
- optionFilterProp: 'children',
9950
- filterOption: function filterOption(input, option) {
9951
- return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
9952
- }
9953
- }
9954
- }
9955
- }];
9956
- var mTpTableSearchForm = handleSearchForm(initialTableSearchForm, parProps);
9957
- var initialPromiseLoadList = [{
9958
- url: "/items/item/propertyValue/sizeBySkcConfig",
9959
- params: {
9960
- pageSize: 10000,
9961
- currentPage: 1,
9962
- type: 2 // 类型:1尺码;2颜色
9833
+ var initialPromiseLoadList = [{
9834
+ url: "/items/item/propertyValue/sizeBySkcConfig",
9835
+ params: {
9836
+ pageSize: 10000,
9837
+ currentPage: 1,
9838
+ type: 2 // 类型:1尺码;2颜色
9963
9839
  },
9964
9840
  resType: 'list',
9965
9841
  resPosition: 3,
@@ -9992,7 +9868,6 @@ var AddSkcSelect = function AddSkcSelect(parProps) {
9992
9868
  resPosition: 6,
9993
9869
  resKeyValue: ['id', 'name']
9994
9870
  }];
9995
- var mTpPromiseLoadList = handleFormSearchSourceLoad(initialPromiseLoadList, parProps);
9996
9871
  var props = {
9997
9872
  buttonText: parProps.buttonText || '新增',
9998
9873
  buttonProps: parProps.buttonProps || {},
@@ -10019,11 +9894,185 @@ var AddSkcSelect = function AddSkcSelect(parProps) {
10019
9894
  isAllowRepeatedSelect: (parProps === null || parProps === void 0 ? void 0 : parProps.isAllowRepeatedSelect) !== undefined ? !!(parProps === null || parProps === void 0 ? void 0 : parProps.isAllowRepeatedSelect) : true // 默认开启一行选多次
10020
9895
  };
10021
9896
  var modalTableProps = {
10022
- modalTableTitle: parProps.modalTableTitle || '选择商品',
10023
- tableSearchForm: mTpTableSearchForm,
10024
- tableColumns: mTpTableColumn,
9897
+ modalTableTitle: '选择商品',
9898
+ tableSearchForm: [{
9899
+ name: 'qp-code-like',
9900
+ label: 'SKC编码'
9901
+ }, {
9902
+ name: 'qp-skcName-like',
9903
+ label: 'SKC名称'
9904
+ }, {
9905
+ name: 'qp-itemName-like',
9906
+ label: '商品名称'
9907
+ }, {
9908
+ name: 'qp-colorName-in',
9909
+ type: 'select',
9910
+ label: '颜色',
9911
+ field: {
9912
+ type: 'select',
9913
+ props: {
9914
+ mode: 'multiple',
9915
+ notFoundContent: '暂无数据',
9916
+ allowClear: true,
9917
+ showSearch: true,
9918
+ showArrow: true,
9919
+ maxTagCount: 1,
9920
+ optionFilterProp: 'children',
9921
+ filterOption: function filterOption(input, option) {
9922
+ return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
9923
+ }
9924
+ }
9925
+ }
9926
+ }, {
9927
+ name: 'qp-categoryId-in',
9928
+ type: 'treeSelect',
9929
+ label: '类目',
9930
+ field: {
9931
+ type: 'treeSelect',
9932
+ props: {
9933
+ treeData: [],
9934
+ treeCheckable: true,
9935
+ showSearch: true,
9936
+ allowClear: true,
9937
+ showArrow: true,
9938
+ treeNodeFilterProp: 'title',
9939
+ treeDefaultExpandAll: true,
9940
+ maxTagCount: 1,
9941
+ placeholder: '请选择',
9942
+ style: {
9943
+ width: '100%'
9944
+ },
9945
+ dropdownStyle: {
9946
+ maxHeight: 400,
9947
+ maxWidth: 100,
9948
+ overflow: 'auto'
9949
+ }
9950
+ }
9951
+ }
9952
+ }, {
9953
+ name: 'qp-classId-in',
9954
+ type: 'select',
9955
+ label: '品类',
9956
+ field: {
9957
+ type: 'select',
9958
+ props: {
9959
+ mode: 'multiple',
9960
+ notFoundContent: '暂无数据',
9961
+ allowClear: true,
9962
+ showSearch: true,
9963
+ showArrow: true,
9964
+ maxTagCount: 1,
9965
+ optionFilterProp: 'children',
9966
+ filterOption: function filterOption(input, option) {
9967
+ return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
9968
+ }
9969
+ }
9970
+ }
9971
+ }, {
9972
+ name: 'qp-brandId-in',
9973
+ type: 'select',
9974
+ label: '品牌',
9975
+ field: {
9976
+ type: 'select',
9977
+ props: {
9978
+ mode: 'multiple',
9979
+ notFoundContent: '暂无数据',
9980
+ allowClear: true,
9981
+ showSearch: true,
9982
+ showArrow: true,
9983
+ maxTagCount: 1,
9984
+ optionFilterProp: 'children',
9985
+ filterOption: function filterOption(input, option) {
9986
+ return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
9987
+ }
9988
+ }
9989
+ }
9990
+ }],
9991
+ tableColumns: [{
9992
+ title: 'SKC编码',
9993
+ width: 150,
9994
+ dataIndex: 'code'
9995
+ }, {
9996
+ title: 'SKC名称',
9997
+ width: 200,
9998
+ ellipsis: {
9999
+ showTitle: false
10000
+ },
10001
+ render: function render(text) {
10002
+ return /*#__PURE__*/React$1.createElement(Tooltip, {
10003
+ placement: "topLeft",
10004
+ title: text
10005
+ }, text);
10006
+ },
10007
+ dataIndex: 'name'
10008
+ }, {
10009
+ title: '商品名称',
10010
+ width: 100,
10011
+ ellipsis: {
10012
+ showTitle: false
10013
+ },
10014
+ dataIndex: 'itemName',
10015
+ render: function render(text) {
10016
+ return /*#__PURE__*/React$1.createElement(Tooltip, {
10017
+ placement: "topLeft",
10018
+ title: text
10019
+ }, text);
10020
+ }
10021
+ }, {
10022
+ title: '颜色',
10023
+ width: 100,
10024
+ ellipsis: {
10025
+ showTitle: false
10026
+ },
10027
+ render: function render(text) {
10028
+ return /*#__PURE__*/React$1.createElement(Tooltip, {
10029
+ placement: "topLeft",
10030
+ title: text
10031
+ }, text);
10032
+ },
10033
+ dataIndex: 'colorName'
10034
+ }, {
10035
+ title: '类目',
10036
+ width: 100,
10037
+ ellipsis: {
10038
+ showTitle: false
10039
+ },
10040
+ render: function render(text) {
10041
+ return /*#__PURE__*/React$1.createElement(Tooltip, {
10042
+ placement: "topLeft",
10043
+ title: text
10044
+ }, text);
10045
+ },
10046
+ dataIndex: 'categoryName'
10047
+ }, {
10048
+ title: '品类',
10049
+ width: 100,
10050
+ ellipsis: {
10051
+ showTitle: false
10052
+ },
10053
+ render: function render(text) {
10054
+ return /*#__PURE__*/React$1.createElement(Tooltip, {
10055
+ placement: "topLeft",
10056
+ title: text
10057
+ }, text);
10058
+ },
10059
+ dataIndex: 'className'
10060
+ }, {
10061
+ title: '品牌',
10062
+ width: 100,
10063
+ ellipsis: {
10064
+ showTitle: false
10065
+ },
10066
+ render: function render(text) {
10067
+ return /*#__PURE__*/React$1.createElement(Tooltip, {
10068
+ placement: "topLeft",
10069
+ title: text
10070
+ }, text);
10071
+ },
10072
+ dataIndex: 'brandName'
10073
+ }],
10025
10074
  selectColumn: mTpSelectColumn,
10026
- promiseLoadList: mTpPromiseLoadList
10075
+ promiseLoadList: initialPromiseLoadList
10027
10076
  };
10028
10077
  return /*#__PURE__*/React$1.createElement("div", null, /*#__PURE__*/React$1.createElement(AddSelect, _objectSpread2(_objectSpread2({}, props), {}, {
10029
10078
  modalTableProps: modalTableProps
@@ -10076,199 +10125,37 @@ var AddSpuSelect = function AddSpuSelect(parProps) {
10076
10125
  dataIndex: 'name'
10077
10126
  }, {
10078
10127
  title: '颜色',
10079
- dataIndex: 'colorName',
10080
- width: 200,
10081
- isSelectItem: true,
10082
- dataSourceCode: 'colorValues',
10083
- dataSourceMapping: ['value', 'value']
10084
- }, {
10085
- title: '配码',
10086
- dataIndex: 'selectPropertyGroupCode',
10087
- width: 160,
10088
- isSelectItem: true,
10089
- dataSource: propertyList,
10090
- filterDataSourceCode: 'matchingCodes'
10091
- }, {
10092
- title: '数量',
10093
- width: 100,
10094
- isInputItem: true,
10095
- dataIndex: 'count'
10096
- }, {
10097
- title: '所属组织',
10098
- dataIndex: 'ownOrgSignName'
10099
- }, {
10100
- title: '品牌',
10101
- dataIndex: 'brandName'
10102
- }, {
10103
- title: '类目',
10104
- dataIndex: 'categoryText'
10105
- }, {
10106
- title: '品类',
10107
- dataIndex: 'className'
10108
- }];
10109
- var mTpSelectColumn = handleSelectColumn(initialSelectColumn, parProps);
10110
- var initialTableColumn = [{
10111
- title: '商品编码',
10112
- width: 150,
10113
- dataIndex: 'itemCode'
10114
- }, {
10115
- title: '商品名称',
10116
- width: 200,
10117
- ellipsis: {
10118
- showTitle: false
10119
- },
10120
- render: function render(text) {
10121
- return /*#__PURE__*/React$1.createElement(Tooltip, {
10122
- placement: "topLeft",
10123
- title: text
10124
- }, text);
10125
- },
10126
- dataIndex: 'name'
10127
- }, {
10128
- title: '所属组织',
10129
- width: 100,
10130
- ellipsis: {
10131
- showTitle: false
10132
- },
10133
- render: function render(text) {
10134
- return /*#__PURE__*/React$1.createElement(Tooltip, {
10135
- placement: "topLeft",
10136
- title: text
10137
- }, text);
10138
- },
10139
- dataIndex: 'ownOrgSignName'
10140
- }, {
10141
- title: '品牌',
10142
- width: 100,
10143
- ellipsis: {
10144
- showTitle: false
10145
- },
10146
- render: function render(text) {
10147
- return /*#__PURE__*/React$1.createElement(Tooltip, {
10148
- placement: "topLeft",
10149
- title: text
10150
- }, text);
10151
- },
10152
- dataIndex: 'brandName'
10153
- }, {
10154
- title: '类目',
10155
- width: 100,
10156
- ellipsis: {
10157
- showTitle: false
10158
- },
10159
- render: function render(text) {
10160
- return /*#__PURE__*/React$1.createElement(Tooltip, {
10161
- placement: "topLeft",
10162
- title: text
10163
- }, text);
10164
- },
10165
- dataIndex: 'categoryName'
10166
- }, {
10167
- title: '品类',
10168
- width: 100,
10169
- ellipsis: {
10170
- showTitle: false
10171
- },
10172
- render: function render(text) {
10173
- return /*#__PURE__*/React$1.createElement(Tooltip, {
10174
- placement: "topLeft",
10175
- title: text
10176
- }, text);
10177
- },
10178
- dataIndex: 'className'
10179
- }];
10180
- var mTpTableColumn = handleTableColumn(initialTableColumn, parProps);
10181
- var initialTableSearchForm = [{
10182
- name: 'qp-itemCode-like',
10183
- label: '商品编码'
10184
- }, {
10185
- name: 'qp-name-like',
10186
- label: '商品名称'
10187
- }, {
10188
- name: 'qp-ownOrgSign-in',
10189
- type: 'select',
10190
- label: '所属组织',
10191
- field: {
10192
- type: 'select',
10193
- props: {
10194
- mode: 'multiple',
10195
- notFoundContent: '暂无数据',
10196
- allowClear: true,
10197
- showSearch: true,
10198
- showArrow: true,
10199
- maxTagCount: 1,
10200
- optionFilterProp: 'children',
10201
- filterOption: function filterOption(input, option) {
10202
- return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
10203
- }
10204
- }
10205
- }
10206
- }, {
10207
- name: 'qp-brandId-in',
10208
- type: 'select',
10209
- label: '品牌',
10210
- field: {
10211
- type: 'select',
10212
- props: {
10213
- mode: 'multiple',
10214
- notFoundContent: '暂无数据',
10215
- allowClear: true,
10216
- showSearch: true,
10217
- showArrow: true,
10218
- maxTagCount: 1,
10219
- optionFilterProp: 'children',
10220
- filterOption: function filterOption(input, option) {
10221
- return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
10222
- }
10223
- }
10224
- }
10225
- }, {
10226
- name: 'qp-categoryId-in',
10227
- type: 'treeSelect',
10228
- label: '类目',
10229
- field: {
10230
- type: 'treeSelect',
10231
- props: {
10232
- treeData: [],
10233
- treeCheckable: true,
10234
- showSearch: true,
10235
- allowClear: true,
10236
- showArrow: true,
10237
- treeNodeFilterProp: 'title',
10238
- treeDefaultExpandAll: true,
10239
- maxTagCount: 1,
10240
- placeholder: '请选择',
10241
- style: {
10242
- width: '100%'
10243
- },
10244
- dropdownStyle: {
10245
- maxHeight: 400,
10246
- maxWidth: 100,
10247
- overflow: 'auto'
10248
- }
10249
- }
10250
- }
10128
+ dataIndex: 'colorName',
10129
+ width: 200,
10130
+ isSelectItem: true,
10131
+ dataSourceCode: 'colorValues',
10132
+ dataSourceMapping: ['value', 'value']
10251
10133
  }, {
10252
- name: 'qp-classId-in',
10253
- type: 'select',
10254
- label: '品类',
10255
- field: {
10256
- type: 'select',
10257
- props: {
10258
- mode: 'multiple',
10259
- notFoundContent: '暂无数据',
10260
- allowClear: true,
10261
- showSearch: true,
10262
- showArrow: true,
10263
- maxTagCount: 1,
10264
- optionFilterProp: 'children',
10265
- filterOption: function filterOption(input, option) {
10266
- return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
10267
- }
10268
- }
10269
- }
10134
+ title: '配码',
10135
+ dataIndex: 'selectPropertyGroupCode',
10136
+ width: 160,
10137
+ isSelectItem: true,
10138
+ dataSource: propertyList,
10139
+ filterDataSourceCode: 'matchingCodes'
10140
+ }, {
10141
+ title: '数量',
10142
+ width: 100,
10143
+ isInputItem: true,
10144
+ dataIndex: 'count'
10145
+ }, {
10146
+ title: '所属组织',
10147
+ dataIndex: 'ownOrgSignName'
10148
+ }, {
10149
+ title: '品牌',
10150
+ dataIndex: 'brandName'
10151
+ }, {
10152
+ title: '类目',
10153
+ dataIndex: 'categoryText'
10154
+ }, {
10155
+ title: '品类',
10156
+ dataIndex: 'className'
10270
10157
  }];
10271
- var mTpTableSearchForm = handleSearchForm(initialTableSearchForm, parProps);
10158
+ var mTpSelectColumn = handleSelectColumn(initialSelectColumn, parProps);
10272
10159
  var initialPromiseLoadList = [{
10273
10160
  url: "/user/orgViewNode/listNoPage",
10274
10161
  params: {
@@ -10307,7 +10194,6 @@ var AddSpuSelect = function AddSpuSelect(parProps) {
10307
10194
  resPosition: 5,
10308
10195
  resKeyValue: ['id', 'name']
10309
10196
  }];
10310
- var mTpPromiseLoadList = handleFormSearchSourceLoad(initialPromiseLoadList, parProps);
10311
10197
  var props = {
10312
10198
  buttonText: parProps.buttonText || '新增',
10313
10199
  buttonProps: parProps.buttonProps || {},
@@ -10336,11 +10222,169 @@ var AddSpuSelect = function AddSpuSelect(parProps) {
10336
10222
  isAllowRepeatedSelect: !!(parProps === null || parProps === void 0 ? void 0 : parProps.isAllowRepeatedSelect)
10337
10223
  };
10338
10224
  var modalTableProps = {
10339
- modalTableTitle: parProps.modalTableTitle || '选择商品',
10340
- tableSearchForm: mTpTableSearchForm,
10341
- tableColumns: mTpTableColumn,
10225
+ modalTableTitle: '选择商品',
10226
+ tableSearchForm: [{
10227
+ name: 'qp-itemCode-like',
10228
+ label: '商品编码'
10229
+ }, {
10230
+ name: 'qp-name-like',
10231
+ label: '商品名称'
10232
+ }, {
10233
+ name: 'qp-ownOrgSign-in',
10234
+ type: 'select',
10235
+ label: '所属组织',
10236
+ field: {
10237
+ type: 'select',
10238
+ props: {
10239
+ mode: 'multiple',
10240
+ notFoundContent: '暂无数据',
10241
+ allowClear: true,
10242
+ showSearch: true,
10243
+ showArrow: true,
10244
+ maxTagCount: 1,
10245
+ optionFilterProp: 'children',
10246
+ filterOption: function filterOption(input, option) {
10247
+ return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
10248
+ }
10249
+ }
10250
+ }
10251
+ }, {
10252
+ name: 'qp-brandId-in',
10253
+ type: 'select',
10254
+ label: '品牌',
10255
+ field: {
10256
+ type: 'select',
10257
+ props: {
10258
+ mode: 'multiple',
10259
+ notFoundContent: '暂无数据',
10260
+ allowClear: true,
10261
+ showSearch: true,
10262
+ showArrow: true,
10263
+ maxTagCount: 1,
10264
+ optionFilterProp: 'children',
10265
+ filterOption: function filterOption(input, option) {
10266
+ return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
10267
+ }
10268
+ }
10269
+ }
10270
+ }, {
10271
+ name: 'qp-categoryId-in',
10272
+ type: 'treeSelect',
10273
+ label: '类目',
10274
+ field: {
10275
+ type: 'treeSelect',
10276
+ props: {
10277
+ treeData: [],
10278
+ treeCheckable: true,
10279
+ showSearch: true,
10280
+ allowClear: true,
10281
+ showArrow: true,
10282
+ treeNodeFilterProp: 'title',
10283
+ treeDefaultExpandAll: true,
10284
+ maxTagCount: 1,
10285
+ placeholder: '请选择',
10286
+ style: {
10287
+ width: '100%'
10288
+ },
10289
+ dropdownStyle: {
10290
+ maxHeight: 400,
10291
+ maxWidth: 100,
10292
+ overflow: 'auto'
10293
+ }
10294
+ }
10295
+ }
10296
+ }, {
10297
+ name: 'qp-classId-in',
10298
+ type: 'select',
10299
+ label: '品类',
10300
+ field: {
10301
+ type: 'select',
10302
+ props: {
10303
+ mode: 'multiple',
10304
+ notFoundContent: '暂无数据',
10305
+ allowClear: true,
10306
+ showSearch: true,
10307
+ showArrow: true,
10308
+ maxTagCount: 1,
10309
+ optionFilterProp: 'children',
10310
+ filterOption: function filterOption(input, option) {
10311
+ return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
10312
+ }
10313
+ }
10314
+ }
10315
+ }],
10316
+ tableColumns: [{
10317
+ title: '商品编码',
10318
+ width: 150,
10319
+ dataIndex: 'itemCode'
10320
+ }, {
10321
+ title: '商品名称',
10322
+ width: 200,
10323
+ ellipsis: {
10324
+ showTitle: false
10325
+ },
10326
+ render: function render(text) {
10327
+ return /*#__PURE__*/React$1.createElement(Tooltip, {
10328
+ placement: "topLeft",
10329
+ title: text
10330
+ }, text);
10331
+ },
10332
+ dataIndex: 'name'
10333
+ }, {
10334
+ title: '所属组织',
10335
+ width: 100,
10336
+ ellipsis: {
10337
+ showTitle: false
10338
+ },
10339
+ render: function render(text) {
10340
+ return /*#__PURE__*/React$1.createElement(Tooltip, {
10341
+ placement: "topLeft",
10342
+ title: text
10343
+ }, text);
10344
+ },
10345
+ dataIndex: 'ownOrgSignName'
10346
+ }, {
10347
+ title: '品牌',
10348
+ width: 100,
10349
+ ellipsis: {
10350
+ showTitle: false
10351
+ },
10352
+ render: function render(text) {
10353
+ return /*#__PURE__*/React$1.createElement(Tooltip, {
10354
+ placement: "topLeft",
10355
+ title: text
10356
+ }, text);
10357
+ },
10358
+ dataIndex: 'brandName'
10359
+ }, {
10360
+ title: '类目',
10361
+ width: 100,
10362
+ ellipsis: {
10363
+ showTitle: false
10364
+ },
10365
+ render: function render(text) {
10366
+ return /*#__PURE__*/React$1.createElement(Tooltip, {
10367
+ placement: "topLeft",
10368
+ title: text
10369
+ }, text);
10370
+ },
10371
+ dataIndex: 'categoryName'
10372
+ }, {
10373
+ title: '品类',
10374
+ width: 100,
10375
+ ellipsis: {
10376
+ showTitle: false
10377
+ },
10378
+ render: function render(text) {
10379
+ return /*#__PURE__*/React$1.createElement(Tooltip, {
10380
+ placement: "topLeft",
10381
+ title: text
10382
+ }, text);
10383
+ },
10384
+ dataIndex: 'className'
10385
+ }],
10342
10386
  selectColumn: mTpSelectColumn,
10343
- promiseLoadList: mTpPromiseLoadList
10387
+ promiseLoadList: initialPromiseLoadList
10344
10388
  };
10345
10389
  return /*#__PURE__*/React$1.createElement("div", null, /*#__PURE__*/React$1.createElement(AddSelect, _objectSpread2(_objectSpread2({}, props), {}, {
10346
10390
  modalTableProps: modalTableProps
@@ -10416,7 +10460,7 @@ var CommodityEntry = function CommodityEntry(props) {
10416
10460
  onCancel: handleCancel,
10417
10461
  destroyOnClose: true,
10418
10462
  zIndex: 15
10419
- }, otherModalProps), /*#__PURE__*/React$1.createElement(DataValidation, _objectSpread2(_objectSpread2({}, props), {}, {
10463
+ }, otherModalProps), /*#__PURE__*/React$1.createElement(DataValidation, {
10420
10464
  onRef: function onRef(ref) {
10421
10465
  dataValidationRef = ref;
10422
10466
  },
@@ -10424,7 +10468,7 @@ var CommodityEntry = function CommodityEntry(props) {
10424
10468
  validDataUrl: validDataUrl,
10425
10469
  isBrandAuth: isBrandAuth,
10426
10470
  isCheckStockNum: isCheckStockNum
10427
- })))) || '');
10471
+ }))) || '');
10428
10472
  };
10429
10473
 
10430
10474
  /*
@@ -12448,7 +12492,7 @@ var DetailWrapper = /*#__PURE__*/React$1.memo(function (_ref) {
12448
12492
  var renderPageActionList = function renderPageActionList(actionLists) {
12449
12493
  var authButton = localStorage.getItem(getMenuAuthDataKey()) ? JSON.parse(localStorage.getItem(getMenuAuthDataKey())) : [];
12450
12494
  var visibleActions = actionLists.filter(function (action) {
12451
- return (action.visible && action.visible !== 'false' || judgeIsEmpty$1(action.visible)) && (!shouldUseAuth() || judgeIsEmpty$1(action.code) || authButton.filter(function (item) {
12495
+ return (action.visible && action.visible !== 'false' || judgeIsEmpty$1(action.visible)) && (judgeIsEmpty$1(action.code) || authButton.filter(function (item) {
12452
12496
  return item === action.code;
12453
12497
  }));
12454
12498
  });
@@ -13959,6 +14003,14 @@ var ResizeableTitle$2 = function ResizeableTitle(props) {
13959
14003
  };
13960
14004
  var BsSulaQueryTable = (function (props) {
13961
14005
  var bsTableCode = (props === null || props === void 0 ? void 0 : props.tableCode) || window.location.hash; //设置列字段的唯一标识
14006
+ // 获取 table columns中所有的 key 防止有的地方是 dataindex
14007
+ var checkedList = useMemo(function () {
14008
+ return props.columns.filter(function (col) {
14009
+ return !col.hidden;
14010
+ }).map(function (d) {
14011
+ return Array.isArray(d.key || d.dataIndex) ? JSON.stringify(d.key || d.dataIndex) : d.key || d.dataIndex;
14012
+ });
14013
+ }, [props.columns]);
13962
14014
  var getConfigFromlocalstorage = function getConfigFromlocalstorage(type) {
13963
14015
  var config = localStorage.getItem(type) || '[]';
13964
14016
  var configArray = JSON.parse(config);
@@ -13970,66 +14022,97 @@ var BsSulaQueryTable = (function (props) {
13970
14022
  }
13971
14023
  return [];
13972
14024
  };
13973
- var getInitialSearchFieldsInfo = function getInitialSearchFieldsInfo() {
13974
- //获取搜索字段的缓存配置
13975
- var _props$fields = props.fields,
13976
- fields = _props$fields === void 0 ? [] : _props$fields;
13977
- var searchFieldsConfig = getConfigFromlocalstorage(ENUM.BROWSER_CACHE.SEARCH_FIELDS_CONDITION);
13978
- var showSearchFields = searchFieldsConfig.length ? searchFieldsConfig.map(function (item) {
13979
- var inner = fields.filter(function (inneritem) {
13980
- var innerKey = Array.isArray(inneritem.name) ? JSON.stringify(inneritem.name) : inneritem.name;
13981
- var itemKey = Array.isArray(item.name) ? JSON.stringify(item.name) : item.name;
13982
- return innerKey && innerKey === itemKey;
13983
- })[0];
13984
- return _objectSpread2(_objectSpread2({}, inner), item);
13985
- }) : fields;
13986
- return _toConsumableArray(showSearchFields);
14025
+ /**
14026
+ * 根据保存的配置和原始配置,获取设置的字段或列。
14027
+ * @param savedConfig 保存的配置数组,可能包含字段或列的配置。
14028
+ * @param originConfig 原始配置数组,包含完整的字段或列信息。
14029
+ * @param type 字段或列的类型,用于确定配置的属性。
14030
+ * @returns 返回根据保存的配置处理后的字段或列数组,如果未保存任何配置,则返回原始配置。
14031
+ */
14032
+ var getSettingFieldOrColumn = function getSettingFieldOrColumn(savedConfig, originConfig, type) {
14033
+ /**
14034
+ * 判断值是否为字符串数组。
14035
+ * @param value 待判断的值。
14036
+ * @returns 如果值是字符串数组,则返回true,否则返回false。
14037
+ */
14038
+ var isStringArray = function isStringArray(value) {
14039
+ return Array.isArray(value) && value.every(function (v) {
14040
+ return typeof v === 'string';
14041
+ });
14042
+ };
14043
+ /**
14044
+ * 根据配置项和类型,获取配置项的键。
14045
+ * @param config 配置项,可以是字段或列。
14046
+ * @param type 配置项的类型。
14047
+ * @returns 返回配置项的键,如果无法获取,则返回空字符串。
14048
+ */
14049
+ var getItemKey = function getItemKey(config, type) {
14050
+ try {
14051
+ if (type === 'columns') {
14052
+ return isStringArray(config.key) ? JSON.stringify(config.key) : isStringArray(config.dataIndex) ? JSON.stringify(config.dataIndex) : config.key || config.dataIndex || '';
14053
+ }
14054
+ return isStringArray(config.name) ? JSON.stringify(config.name) : config.name || '';
14055
+ } catch (e) {}
14056
+ return '';
14057
+ };
14058
+ var newConfig = [];
14059
+ if (savedConfig.length) {
14060
+ var hash = originConfig.reduce(function (prev, inneritem) {
14061
+ prev[getItemKey(inneritem, type)] = inneritem;
14062
+ return prev;
14063
+ }, {});
14064
+ savedConfig.forEach(function (config, index) {
14065
+ var inner = hash[getItemKey(config, type)];
14066
+ inner && newConfig.push(_objectSpread2(_objectSpread2({}, inner), config));
14067
+ });
14068
+ }
14069
+ if (newConfig.length) return newConfig;
14070
+ if (type === 'columns') {
14071
+ return originConfig.filter(function (column) {
14072
+ var columnKey = getItemKey(column, type);
14073
+ return column.notRegularCheckList || checkedList.indexOf(columnKey) > -1;
14074
+ });
14075
+ }
14076
+ return _toConsumableArray(originConfig);
13987
14077
  };
13988
14078
  var refs = useRef(null);
13989
14079
  var _useState = useState(''),
13990
14080
  _useState2 = _slicedToArray(_useState, 2),
13991
14081
  pagePath = _useState2[0],
13992
14082
  setPagePath = _useState2[1];
13993
- // 获取 table columns中所有的 key 防止有的地方是 dataindex
13994
- var _useState3 = useState(props.columns.filter(function (col) {
13995
- return !col.hidden;
13996
- }).map(function (d) {
13997
- return Array.isArray(d.key || d.dataIndex) ? JSON.stringify(d.key || d.dataIndex) : d.key || d.dataIndex;
13998
- })),
13999
- _useState4 = _slicedToArray(_useState3, 2),
14000
- checkedList = _useState4[0],
14001
- setCheckedList = _useState4[1];
14002
14083
  var _useLocation = useLocation(),
14003
14084
  pathname = _useLocation.pathname;
14004
- var _useState5 = useState(Number(Math.random().toString().substr(2, 0) + Date.now()).toString(36)),
14005
- _useState6 = _slicedToArray(_useState5, 1),
14006
- id = _useState6[0];
14007
- var _useState7 = useState(false),
14008
- _useState8 = _slicedToArray(_useState7, 2),
14009
- isFullScreen = _useState8[0],
14010
- setIsFnllScreen = _useState8[1];
14085
+ var _useState3 = useState(Number(Math.random().toString().substr(2, 0) + Date.now()).toString(36)),
14086
+ _useState4 = _slicedToArray(_useState3, 1),
14087
+ id = _useState4[0];
14088
+ var _useState5 = useState(false),
14089
+ _useState6 = _slicedToArray(_useState5, 2),
14090
+ isFullScreen = _useState6[0],
14091
+ setIsFnllScreen = _useState6[1];
14011
14092
  // @ts-nocheck
14012
- var _useState9 = useState(props),
14093
+ var _useState7 = useState(props),
14094
+ _useState8 = _slicedToArray(_useState7, 2),
14095
+ value = _useState8[0],
14096
+ setValue = _useState8[1];
14097
+ var _props$fields = props.fields,
14098
+ fields = _props$fields === void 0 ? [] : _props$fields;
14099
+ var _useState9 = useState([]),
14013
14100
  _useState10 = _slicedToArray(_useState9, 2),
14014
- value = _useState10[0],
14015
- setValue = _useState10[1];
14016
- var _useState11 = useState([]),
14101
+ showColumn = _useState10[0],
14102
+ setShowColumns = _useState10[1]; // 列字段
14103
+ var originSearchFields = getSettingFieldOrColumn(getConfigFromlocalstorage(ENUM.BROWSER_CACHE.SEARCH_FIELDS_CONDITION), fields, 'searchFields');
14104
+ var _useState11 = useState(originSearchFields),
14017
14105
  _useState12 = _slicedToArray(_useState11, 2),
14018
- showColumn = _useState12[0],
14019
- setShowColumns = _useState12[1]; // 列字段
14020
- var originSearchFields = getInitialSearchFieldsInfo();
14021
- var _useState13 = useState(originSearchFields),
14022
- _useState14 = _slicedToArray(_useState13, 2),
14023
- showSearchFields = _useState14[0],
14024
- setShowSearchFields = _useState14[1]; //搜索项字段
14106
+ showSearchFields = _useState12[0],
14107
+ setShowSearchFields = _useState12[1]; //搜索项字段
14025
14108
  var _props$isPage = props.isPage,
14026
14109
  pagination = props.pagination,
14027
14110
  tableCode = props.tableCode,
14028
14111
  appRequestConfig = props.appRequestConfig;
14029
- var _useState15 = useState('100vh'),
14030
- _useState16 = _slicedToArray(_useState15, 2),
14031
- height = _useState16[0],
14032
- setHeight = _useState16[1];
14112
+ var _useState13 = useState('100vh'),
14113
+ _useState14 = _slicedToArray(_useState13, 2),
14114
+ height = _useState14[0],
14115
+ setHeight = _useState14[1];
14033
14116
  var sortTableRef = useRef(null);
14034
14117
  var searchTableRef = useRef(null);
14035
14118
  // 获取table高度
@@ -14090,7 +14173,7 @@ var BsSulaQueryTable = (function (props) {
14090
14173
  if (Number(item.slice(-1)) >= 1) {
14091
14174
  Item = item.substr(0, item.length - 1);
14092
14175
  }
14093
- if (shouldUseAuth() && !authButton.filter(function (itemInner) {
14176
+ if (!authButton.filter(function (itemInner) {
14094
14177
  return Item === itemInner;
14095
14178
  }).length) {
14096
14179
  resourceCodeArray[item].visible = false;
@@ -14102,17 +14185,7 @@ var BsSulaQueryTable = (function (props) {
14102
14185
  }));
14103
14186
  var columns = props.columns;
14104
14187
  var columnConfig = getConfigFromlocalstorage(ENUM.BROWSER_CACHE.COLUMN_CONDITION);
14105
- var showColumns = columnConfig.length ? columnConfig.map(function (item) {
14106
- var inner = columns.filter(function (inneritem) {
14107
- var innerKey = Array.isArray(inneritem.key || inneritem.dataIndex) ? JSON.stringify(inneritem.key || inneritem.dataIndex) : inneritem.key || inneritem.dataIndex;
14108
- var itemKey = Array.isArray(item.key || item.dataIndex) ? JSON.stringify(item.key || item.dataIndex) : item.key || item.dataIndex;
14109
- return innerKey && innerKey === itemKey;
14110
- })[0];
14111
- return _objectSpread2(_objectSpread2({}, inner), item);
14112
- }) : columns.filter(function (column) {
14113
- var columnKey = Array.isArray(column.key || column.dataIndex) ? JSON.stringify(column.key || column.dataIndex) : column.key || column.dataIndex;
14114
- return column.notRegularCheckList || checkedList.indexOf(columnKey) > -1;
14115
- });
14188
+ var showColumns = getSettingFieldOrColumn(columnConfig, columns, 'columns');
14116
14189
  showColumns.forEach(function (item, index) {
14117
14190
  item.width = item.width || getItemDefaultWidth(item);
14118
14191
  handleBssulaColumnsSpecialParams(item);
@@ -14526,7 +14599,7 @@ var setMenuTreeData = function setMenuTreeData(routesData) {
14526
14599
  routesData.splice(i, 1);
14527
14600
  return 0; // continue
14528
14601
  }
14529
- if (shouldUseAuth() && routesData[i].code && authButton.every(function (item) {
14602
+ if (routesData[i].code && authButton.every(function (item) {
14530
14603
  return routesData[i].code != item;
14531
14604
  })) {
14532
14605
  routesData.splice(i, 1);
@@ -15169,7 +15242,9 @@ var GlobalHeaderCom = function GlobalHeaderCom(props) {
15169
15242
  deep(item.routes);
15170
15243
  } else if (!item.hideInMenu && (name ? formatMessage({
15171
15244
  id: "menu.".concat(item.name)
15172
- }).indexOf(name) !== -1 : true)) {
15245
+ }).indexOf(name) !== -1 : true) && btnAuth.find(function (d) {
15246
+ return d === item.code;
15247
+ })) {
15173
15248
  resultList.push(_objectSpread2(_objectSpread2({}, item), {}, {
15174
15249
  fullPathName: getFullPathName(item.name)
15175
15250
  }));
@@ -16456,70 +16531,10 @@ var CustomerMenuHeader = function CustomerMenuHeader(_ref) {
16456
16531
  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";
16457
16532
  styleInject(css_248z$m);
16458
16533
 
16459
- /*
16460
- * @Date: 2022-04-01 15:42:51
16461
- * @LastEditors: 追随
16462
- * @LastEditTime: 2022-09-16 20:53:23
16463
- */
16464
- var NoFoundPage = function NoFoundPage(props) {
16465
- return /*#__PURE__*/React$1.createElement("div", {
16466
- style: {
16467
- height: 'calc(100vh - 88px)',
16468
- background: '#fff',
16469
- display: 'flex',
16470
- justifyContent: 'center',
16471
- alignItems: 'center'
16472
- }
16473
- }, /*#__PURE__*/React$1.createElement(Result, {
16474
- status: "404",
16475
- title: "404",
16476
- subTitle: /*#__PURE__*/React$1.createElement("div", null, /*#__PURE__*/React$1.createElement("div", null, "\u62B1\u6B49\uFF0C\u65E0\u6CD5\u8BBF\u95EE\u8BE5\u9875\u9762\uFF01"), /*#__PURE__*/React$1.createElement("div", null, "\u8BF7\u5173\u95ED\u5F53\u524D\u9875\u7B7E"))
16477
- }));
16478
- };
16479
-
16480
16534
  var _excluded$g = ["route"];
16481
16535
  var TabPane = Tabs.TabPane;
16482
- var getId = function getId(str) {
16483
- // 找到最后一个 / 的位置
16484
- var lastSlashIndex = str.lastIndexOf("/");
16485
- // 如果找到了 /,则返回它后面的部分
16486
- if (lastSlashIndex !== -1) {
16487
- return str.substring(lastSlashIndex + 1);
16488
- } else {
16489
- // 如果没有找到 /,则返回整个字符串
16490
- return null;
16491
- }
16492
- };
16493
- // 获取权限菜单path&通用单据id
16494
- var getAuthMenuPathAndDocsId = function getAuthMenuPathAndDocsId(pathToRegexp) {
16495
- var limitedMenuData = localStorage.getItem(getLimitMenuDataKey()) ? JSON.parse(localStorage.getItem(getLimitMenuDataKey())) : [];
16496
- var menuKeys = [];
16497
- var docsId = [];
16498
- var getLimitedMenuKeys = function getLimitedMenuKeys(data) {
16499
- data.forEach(function (item) {
16500
- if (item.children && item.children.length > 0) {
16501
- getLimitedMenuKeys(item.children);
16502
- } else {
16503
- var originPath = item.path.replace(/^\/\w+\//, '/');
16504
- menuKeys.push(originPath);
16505
- if (pathToRegexp('/operation-and-maintenance-center/configuration-management/all-general-documents-specific/:id').test(originPath)) {
16506
- getId(originPath) && docsId.push(getId(originPath));
16507
- }
16508
- }
16509
- });
16510
- };
16511
- try {
16512
- getLimitedMenuKeys(limitedMenuData);
16513
- } catch (e) {}
16514
- return {
16515
- menuKeys: menuKeys,
16516
- docsId: docsId
16517
- };
16518
- };
16519
16536
  var UN_LISTTEN_DRP;
16520
16537
  var routerArray = [];
16521
- var authMenuPathList = [];
16522
- var docsId = [];
16523
16538
  var lastTwoRouterArray = [1, 2];
16524
16539
  var type = 'DraggableTabNode';
16525
16540
  var DraggableTabNode = function DraggableTabNode(_ref) {
@@ -16712,7 +16727,6 @@ var ItemMenu = function ItemMenu(props) {
16712
16727
  };
16713
16728
  var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16714
16729
  function BasicLayout(props) {
16715
- var _getAuthMenuPathAndDo, _getAuthMenuPathAndDo2;
16716
16730
  var _this;
16717
16731
  _classCallCheck(this, BasicLayout);
16718
16732
  _this = _callSuper(this, BasicLayout, [props]);
@@ -16729,41 +16743,14 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16729
16743
  return queryString;
16730
16744
  };
16731
16745
  _this.updateTree = function (Tree) {
16732
- var authMenuKeys = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
16733
16746
  var treeData = Tree;
16734
16747
  var treeList = [];
16735
- // 是否为权限菜单路径
16736
- var getLimitedMenuPath = function getLimitedMenuPath(node) {
16737
- return authMenuKeys.some(function (item) {
16738
- return (node.path || '').includes(item);
16739
- });
16740
- };
16741
- // 是否为通用单据菜单路径
16742
- var getGenerateDocs = function getGenerateDocs(node) {
16743
- return (node.path || '').includes('all-general-documents');
16744
- };
16745
16748
  // 递归获取树列表
16746
16749
  var getTreeList = function getTreeList(data) {
16747
16750
  data.forEach(function (node) {
16748
16751
  if (node.routes && node.routes.length > 0) {
16749
16752
  getTreeList(node.routes);
16750
- return;
16751
- }
16752
- // todo:暂时处理非wujie环境不做404管控
16753
- if (!window.__POWERED_BY_WUJIE__) {
16754
- treeList.push({
16755
- tab: node.locale,
16756
- key: node.path,
16757
- locale: node.locale,
16758
- closable: true,
16759
- content: node.component,
16760
- name: node.name,
16761
- hideInMenu: node.hideInMenu,
16762
- isOnlyOnePage: node.isOnlyOnePage
16763
- });
16764
- return;
16765
- }
16766
- if (node.path === '/' || getLimitedMenuPath(node) || getGenerateDocs(node)) {
16753
+ } else {
16767
16754
  treeList.push({
16768
16755
  tab: node.locale,
16769
16756
  key: node.path,
@@ -16830,6 +16817,7 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16830
16817
  return moment$1(timeStr).add(8, 'hours').format(format) || '- -';
16831
16818
  };
16832
16819
  _this.onChange = function (key) {
16820
+ // console.log('onChange');
16833
16821
  if (key !== _this.state.activeKey) {
16834
16822
  _this.setState({
16835
16823
  activeKey: key
@@ -17115,9 +17103,7 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
17115
17103
  });
17116
17104
  }
17117
17105
  };
17118
- authMenuPathList = ((_getAuthMenuPathAndDo = getAuthMenuPathAndDocsId(props.pathToRegexp)) === null || _getAuthMenuPathAndDo === void 0 ? void 0 : _getAuthMenuPathAndDo.menuKeys) || [];
17119
- docsId = ((_getAuthMenuPathAndDo2 = getAuthMenuPathAndDocsId(props.pathToRegexp)) === null || _getAuthMenuPathAndDo2 === void 0 ? void 0 : _getAuthMenuPathAndDo2.docsId) || [];
17120
- routerArray = _this.updateTree(props.route.routes, authMenuPathList);
17106
+ routerArray = _this.updateTree(props.route.routes);
17121
17107
  var homeRouter = routerArray.filter(function (itemroute) {
17122
17108
  return itemroute.key === '/';
17123
17109
  })[0];
@@ -17217,28 +17203,7 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
17217
17203
  hideMenuArray = _this2$state.hideMenuArray;
17218
17204
  var newListenRouterState = _toConsumableArray(listenRouterState);
17219
17205
  var newListenRouterKey = _toConsumableArray(listenRouterKey);
17220
- /**
17221
- * 根据给定的路由数组和当前路由信息,筛选出与当前路由匹配的路由项。
17222
- *
17223
- * @param routerArray 路由数组,包含多个路由项,每个路由项有一个键(key)。
17224
- * @param route 当前的路由信息,包含路径(pathname)等信息。
17225
- * @param docsId 通用单据ID的数组,用于进一步筛选路由。
17226
- * @returns 返回与当前路由匹配的第一个路由项,如果没有匹配项则返回undefined。
17227
- */
17228
17206
  var replaceRouter = routerArray.filter(function (itemRoute) {
17229
- var _route$pathname, _route$pathname2;
17230
- // 单独处理通用单据预览
17231
- 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'))) {
17232
- return pathToRegexp(itemRoute.key || '').test(route.pathname);
17233
- }
17234
- // 当路由路径包含'all-general-documents'时,按通用单据处理
17235
- if (((_route$pathname2 = route.pathname) === null || _route$pathname2 === void 0 ? void 0 : _route$pathname2.includes('all-general-documents')) && shouldUseAuth()) {
17236
- // 检查路由路径是否匹配路由项的键,并且路径中包含至少一个通用单据ID
17237
- return pathToRegexp(itemRoute.key || '').test(route.pathname) && docsId.some(function (item) {
17238
- return route.pathname.includes(item);
17239
- });
17240
- }
17241
- // 对于不包含'all-general-documents'的路径,只检查路由路径是否匹配路由项的键
17242
17207
  return pathToRegexp(itemRoute.key || '').test(route.pathname);
17243
17208
  })[0];
17244
17209
  var currentKey = '';
@@ -17262,15 +17227,20 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
17262
17227
  }
17263
17228
  if (!listenRouterKey.includes(currentKey)) {
17264
17229
  if (!replaceRouter) {
17265
- replaceRouter = {
17266
- content: currentKey,
17267
- key: currentKey,
17268
- name: '404',
17269
- tab: '404',
17270
- isNotFound: true
17271
- };
17272
- newListenRouterState = [].concat(_toConsumableArray(newListenRouterState), [_objectSpread2({}, replaceRouter)]);
17273
- newListenRouterKey = [].concat(_toConsumableArray(listenRouterKey), [currentKey]);
17230
+ var _routerArray$filter;
17231
+ replaceRouter = (_routerArray$filter = routerArray.filter(function (itemroute) {
17232
+ return itemroute.key === '/404';
17233
+ })) === null || _routerArray$filter === void 0 ? void 0 : _routerArray$filter[0];
17234
+ _this2.setState({
17235
+ listenRouterState: [].concat(_toConsumableArray(listenRouterState), [_objectSpread2(_objectSpread2({}, replaceRouter), {}, {
17236
+ key: currentKey,
17237
+ tab: '404'
17238
+ })]),
17239
+ activeKey: currentKey,
17240
+ listenRouterKey: [].concat(_toConsumableArray(listenRouterKey), [currentKey])
17241
+ }, function () {
17242
+ _this2.checkisNavSlide();
17243
+ });
17274
17244
  } else {
17275
17245
  var match = matchPath(route.pathname, {
17276
17246
  path: replaceRouter.key
@@ -17788,7 +17758,8 @@ var WrapperComponent = /*#__PURE__*/function (_React$Component) {
17788
17758
  getDictionaryTextByValue = _this$props4.getDictionaryTextByValue,
17789
17759
  timeFormat = _this$props4.timeFormat,
17790
17760
  transparentProps = _this$props4.transparentProps;
17791
- return /*#__PURE__*/React$1.createElement(React$1.Fragment, null, item.isNotFound ? ( /*#__PURE__*/React$1.createElement(NoFoundPage, null)) : /*#__PURE__*/React$1.createElement(item.content, _objectSpread2(_objectSpread2(_objectSpread2({
17761
+ console.log('child wrapper conpent', this.props);
17762
+ return /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement(item.content, _objectSpread2(_objectSpread2(_objectSpread2({
17792
17763
  getDictionarySource: getDictionarySource,
17793
17764
  getDictionaryTextByValue: getDictionaryTextByValue,
17794
17765
  timeFormat: timeFormat
@@ -27059,16 +27030,6 @@ var JsonQueryTable = /*#__PURE__*/React$1.memo(function (props) {
27059
27030
  }, "setting"));
27060
27031
  });
27061
27032
 
27062
- var AuthButton = function AuthButton(props) {
27063
- var code = props.code,
27064
- children = props.children;
27065
- return /*#__PURE__*/React$1.createElement("span", {
27066
- style: {
27067
- display: authFunc(code) ? 'inline-block' : 'none'
27068
- }
27069
- }, children);
27070
- };
27071
-
27072
27033
  var EllipsisTooltip = /*#__PURE__*/function (_React$Component) {
27073
27034
  function EllipsisTooltip() {
27074
27035
  var _this;
@@ -32763,4 +32724,4 @@ var index$7 = /*#__PURE__*/forwardRef(function (props, ref) {
32763
32724
  })));
32764
32725
  });
32765
32726
 
32766
- export { AddSelect, AddSkcSelect, AddSkuSelect, AddSpuSelect, AuthButton, BillEntry, BsCascader, index$5 as BsLayout, BsSulaQueryTable, BusinessSearchSelect$1 as BusinessSearchSelect, BusinessTreeSearchSelect$1 as BusinessTreeSearchSelect, index$1 as CheckOneUser, ColumnSettingTable, CommodityEntry, DataImport, DataValidation, index$3 as DetailPageWrapper, EllipsisTooltip, ExportIcon, GuideWrapper, index$4 as HomePageWrapper, JsonQueryTable, index$6 as MoreTreeTable, QueryMutipleInput, RuleObjectComponent as RuleComponent, index$7 as RuleSetter, SearchSelect, index$2 as StateFlow, ColumnSettingSulaTable as SulaColumnSettingTable, TableColumnSetting, TreeSearchSelect, authFunc, checkQuantityAccuracy, downloadExcel, formatter, getAccountID, getAccountId, getConfigTableColumns, getCurrentTargetBgId, getCurrentTenantId, getDictionarySource, getEmployeeCode, getEmployeeId, getLastKey, getLimitMenuDataKey, getLocalStorageSaveKey, getMenuAuthDataKey, getSessionId, getTenantList, getUserId, getUserName, go2BackAndClose, handleAntdColumnsSpecialParams, handleBssulaColumnsSpecialParams, handleError, handleJudgeAuthButtons, handleRequestAuthHeader, handleRequestUrl, handleUserPhone, judgeIsEmpty, judgeIsRequestError, judgeIsRequestSuccess, memoizeOneFormatter, precisionQuantity, removeCurrentTenantId, removeTenantList, saveCurrentTenantId, saveTenantList, setConfigTableColumns, shouldUseAuth, uuid };
32727
+ export { AddSelect, AddSkcSelect, AddSkuSelect, AddSpuSelect, BillEntry, BsCascader, index$5 as BsLayout, BsSulaQueryTable, BusinessSearchSelect$1 as BusinessSearchSelect, BusinessTreeSearchSelect$1 as BusinessTreeSearchSelect, index$1 as CheckOneUser, ColumnSettingTable, CommodityEntry, DataImport, DataValidation, index$3 as DetailPageWrapper, EllipsisTooltip, ExportIcon, GuideWrapper, index$4 as HomePageWrapper, JsonQueryTable, index$6 as MoreTreeTable, QueryMutipleInput, RuleObjectComponent as RuleComponent, index$7 as RuleSetter, SearchSelect, index$2 as StateFlow, ColumnSettingSulaTable as SulaColumnSettingTable, TableColumnSetting, TreeSearchSelect, authFunc, checkQuantityAccuracy, downloadExcel, formatter, getAccountID, getAccountId, getConfigTableColumns, getCurrentTargetBgId, getCurrentTenantId, getDictionarySource, getEmployeeCode, getEmployeeId, getLastKey, getLimitMenuDataKey, getLocalStorageSaveKey, getMenuAuthDataKey, getSessionId, getTenantList, getUserId, getUserName, go2BackAndClose, handleAntdColumnsSpecialParams, handleBssulaColumnsSpecialParams, handleError, handleJudgeAuthButtons, handleRequestAuthHeader, handleRequestUrl, handleUserPhone, judgeIsEmpty, judgeIsRequestError, judgeIsRequestSuccess, memoizeOneFormatter, precisionQuantity, removeCurrentTenantId, removeTenantList, saveCurrentTenantId, saveTenantList, setConfigTableColumns, uuid };