@bit-sun/business-component 1.1.9 → 1.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -1265,14 +1265,6 @@ function injectCSS(css) {
1265
1265
  return styleNode;
1266
1266
  }
1267
1267
  var containerCache = new Map();
1268
-
1269
- function findExistNode(key) {
1270
- var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1271
- var container = getContainer(option);
1272
- return Array.from(containerCache.get(container).children).find(function (node) {
1273
- return node.tagName === 'STYLE' && node[MARK_KEY] === key;
1274
- });
1275
- }
1276
1268
  function updateCSS(css, key) {
1277
1269
  var option = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
1278
1270
  var container = getContainer(option); // Get real parent
@@ -1284,7 +1276,9 @@ function updateCSS(css, key) {
1284
1276
  parentNode.removeChild(placeholderStyle);
1285
1277
  }
1286
1278
 
1287
- var existNode = findExistNode(key, option);
1279
+ var existNode = Array.from(containerCache.get(container).children).find(function (node) {
1280
+ return node.tagName === 'STYLE' && node[MARK_KEY] === key;
1281
+ });
1288
1282
 
1289
1283
  if (existNode) {
1290
1284
  var _option$csp3, _option$csp4;
@@ -1738,10 +1732,14 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
1738
1732
  cell.m = cell.v = cell.m.trim();
1739
1733
  }
1740
1734
 
1741
- if (typeof cell.v === 'number') {
1735
+ if (cell && cell.m && cell.m.indexOf('E+') !== -1) {
1742
1736
  cell.v = cell.v.toString();
1743
1737
  cell.m = cell.v;
1744
1738
  }
1739
+
1740
+ if (typeof cell.v === 'number') {
1741
+ cell.v = cell.m;
1742
+ }
1745
1743
  } // console.log(postion);
1746
1744
 
1747
1745
  },
@@ -2445,7 +2443,9 @@ var SearchSelect = function SearchSelect(props) {
2445
2443
  _ref$mappingTextField = _ref.mappingTextField,
2446
2444
  mappingTextField = _ref$mappingTextField === void 0 ? 'name' : _ref$mappingTextField,
2447
2445
  _ref$mappingValueFiel = _ref.mappingValueField,
2448
- mappingValueField = _ref$mappingValueFiel === void 0 ? 'code' : _ref$mappingValueFiel;
2446
+ mappingValueField = _ref$mappingValueFiel === void 0 ? 'code' : _ref$mappingValueFiel,
2447
+ _ref$sourceName = _ref.sourceName,
2448
+ sourceName = _ref$sourceName === void 0 ? 'supplierCode' : _ref$sourceName;
2449
2449
 
2450
2450
  var selectMode = selectProps === null || selectProps === void 0 ? void 0 : selectProps.mode; // 设定当前选择器 为单选或者多选模式 无设定为单选模式(默认)
2451
2451
 
@@ -2643,7 +2643,8 @@ var SearchSelect = function SearchSelect(props) {
2643
2643
  if (type === 1) {
2644
2644
  var _ctx$form;
2645
2645
 
2646
- ctx === null || ctx === void 0 ? void 0 : (_ctx$form = ctx.form) === null || _ctx$form === void 0 ? void 0 : _ctx$form.setFieldSource('supplierCode', source);
2646
+ console.log(sourceName, 'sourceName');
2647
+ ctx === null || ctx === void 0 ? void 0 : (_ctx$form = ctx.form) === null || _ctx$form === void 0 ? void 0 : _ctx$form.setFieldSource(sourceName, source);
2647
2648
  setItems(source);
2648
2649
  setItemsTotal(Number(res === null || res === void 0 ? void 0 : res.total));
2649
2650
  } else {
@@ -3387,10 +3388,13 @@ function commonFun(type, prefixUrl) {
3387
3388
  requestConfig = {
3388
3389
  url: "".concat(prefixUrl.selectPrefix, "/sku"),
3389
3390
  filter: 'qp-nameAndCode-like',
3391
+ mappingTextField: 'name',
3392
+ mappingValueField: 'skuCode',
3390
3393
  otherParams: {
3394
+ 'qp-approveStatus-eq': 2,
3391
3395
  sorter: 'desc-id'
3392
- } // 默认参数
3393
-
3396
+ },
3397
+ sourceName: 'skuCode'
3394
3398
  };
3395
3399
  tableSearchForm = [{
3396
3400
  name: 'qp-name-like',
@@ -3517,6 +3521,7 @@ function commonFun(type, prefixUrl) {
3517
3521
  };
3518
3522
  } // 仓库选择器
3519
3523
 
3524
+ console.log(requestConfig, 'requestConfig');
3520
3525
  return {
3521
3526
  modalTableProps: modalTableProps,
3522
3527
  requestConfig: requestConfig
package/dist/index.js CHANGED
@@ -1276,14 +1276,6 @@ function injectCSS(css) {
1276
1276
  return styleNode;
1277
1277
  }
1278
1278
  var containerCache = new Map();
1279
-
1280
- function findExistNode(key) {
1281
- var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1282
- var container = getContainer(option);
1283
- return Array.from(containerCache.get(container).children).find(function (node) {
1284
- return node.tagName === 'STYLE' && node[MARK_KEY] === key;
1285
- });
1286
- }
1287
1279
  function updateCSS(css, key) {
1288
1280
  var option = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
1289
1281
  var container = getContainer(option); // Get real parent
@@ -1295,7 +1287,9 @@ function updateCSS(css, key) {
1295
1287
  parentNode.removeChild(placeholderStyle);
1296
1288
  }
1297
1289
 
1298
- var existNode = findExistNode(key, option);
1290
+ var existNode = Array.from(containerCache.get(container).children).find(function (node) {
1291
+ return node.tagName === 'STYLE' && node[MARK_KEY] === key;
1292
+ });
1299
1293
 
1300
1294
  if (existNode) {
1301
1295
  var _option$csp3, _option$csp4;
@@ -1749,10 +1743,14 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
1749
1743
  cell.m = cell.v = cell.m.trim();
1750
1744
  }
1751
1745
 
1752
- if (typeof cell.v === 'number') {
1746
+ if (cell && cell.m && cell.m.indexOf('E+') !== -1) {
1753
1747
  cell.v = cell.v.toString();
1754
1748
  cell.m = cell.v;
1755
1749
  }
1750
+
1751
+ if (typeof cell.v === 'number') {
1752
+ cell.v = cell.m;
1753
+ }
1756
1754
  } // console.log(postion);
1757
1755
 
1758
1756
  },
@@ -2456,7 +2454,9 @@ var SearchSelect = function SearchSelect(props) {
2456
2454
  _ref$mappingTextField = _ref.mappingTextField,
2457
2455
  mappingTextField = _ref$mappingTextField === void 0 ? 'name' : _ref$mappingTextField,
2458
2456
  _ref$mappingValueFiel = _ref.mappingValueField,
2459
- mappingValueField = _ref$mappingValueFiel === void 0 ? 'code' : _ref$mappingValueFiel;
2457
+ mappingValueField = _ref$mappingValueFiel === void 0 ? 'code' : _ref$mappingValueFiel,
2458
+ _ref$sourceName = _ref.sourceName,
2459
+ sourceName = _ref$sourceName === void 0 ? 'supplierCode' : _ref$sourceName;
2460
2460
 
2461
2461
  var selectMode = selectProps === null || selectProps === void 0 ? void 0 : selectProps.mode; // 设定当前选择器 为单选或者多选模式 无设定为单选模式(默认)
2462
2462
 
@@ -2654,7 +2654,8 @@ var SearchSelect = function SearchSelect(props) {
2654
2654
  if (type === 1) {
2655
2655
  var _ctx$form;
2656
2656
 
2657
- ctx === null || ctx === void 0 ? void 0 : (_ctx$form = ctx.form) === null || _ctx$form === void 0 ? void 0 : _ctx$form.setFieldSource('supplierCode', source);
2657
+ console.log(sourceName, 'sourceName');
2658
+ ctx === null || ctx === void 0 ? void 0 : (_ctx$form = ctx.form) === null || _ctx$form === void 0 ? void 0 : _ctx$form.setFieldSource(sourceName, source);
2658
2659
  setItems(source);
2659
2660
  setItemsTotal(Number(res === null || res === void 0 ? void 0 : res.total));
2660
2661
  } else {
@@ -3398,10 +3399,13 @@ function commonFun(type, prefixUrl) {
3398
3399
  requestConfig = {
3399
3400
  url: "".concat(prefixUrl.selectPrefix, "/sku"),
3400
3401
  filter: 'qp-nameAndCode-like',
3402
+ mappingTextField: 'name',
3403
+ mappingValueField: 'skuCode',
3401
3404
  otherParams: {
3405
+ 'qp-approveStatus-eq': 2,
3402
3406
  sorter: 'desc-id'
3403
- } // 默认参数
3404
-
3407
+ },
3408
+ sourceName: 'skuCode'
3405
3409
  };
3406
3410
  tableSearchForm = [{
3407
3411
  name: 'qp-name-like',
@@ -3528,6 +3532,7 @@ function commonFun(type, prefixUrl) {
3528
3532
  };
3529
3533
  } // 仓库选择器
3530
3534
 
3535
+ console.log(requestConfig, 'requestConfig');
3531
3536
  return {
3532
3537
  modalTableProps: modalTableProps,
3533
3538
  requestConfig: requestConfig
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bit-sun/business-component",
3
- "version": "1.1.9",
3
+ "version": "1.1.13",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -47,4 +47,4 @@
47
47
  "publishConfig": {
48
48
  "access": "public"
49
49
  }
50
- }
50
+ }
@@ -174,13 +174,17 @@ class DataValidation extends React.Component {
174
174
  if (cell) {
175
175
  cell.fs = 10;
176
176
 
177
+
177
178
  if (typeof cell.v === 'string') {
178
179
  cell.m = cell.v = cell.m.trim();
179
180
  }
180
- if (typeof cell.v === 'number') {
181
+ if (cell && cell.m && cell.m.indexOf('E+') !== -1) {
181
182
  cell.v = cell.v.toString()
182
183
  cell.m = cell.v
183
184
  }
185
+ if (typeof cell.v === 'number') {
186
+ cell.v = cell.m
187
+ }
184
188
  }
185
189
  // console.log(postion);
186
190
  },
@@ -226,9 +226,13 @@ export function commonFun (type?: string, prefixUrl: any) {
226
226
  requestConfig = {
227
227
  url: `${prefixUrl.selectPrefix}/sku`,
228
228
  filter: 'qp-nameAndCode-like', // 过滤参数
229
+ mappingTextField: 'name',
230
+ mappingValueField: 'skuCode',
229
231
  otherParams: {
232
+ 'qp-approveStatus-eq':2,
230
233
  sorter: 'desc-id'
231
234
  }, // 默认参数
235
+ sourceName: 'skuCode',
232
236
  }
233
237
  tableSearchForm = [
234
238
  { name: 'qp-name-like', label: 'SKU名称' },
@@ -346,5 +350,6 @@ export function commonFun (type?: string, prefixUrl: any) {
346
350
 
347
351
  }
348
352
 
353
+ console.log(requestConfig, 'requestConfig')
349
354
  return { modalTableProps, requestConfig };
350
355
  }
@@ -76,7 +76,11 @@ export default () => {
76
76
  requestConfig: {
77
77
  url: `/bop/api/sku`,
78
78
  filter: 'qp-nameAndCode-like',
79
- mappingValueField: 'skuCode'
79
+ mappingValueField: 'skuCode',
80
+ otherParams: {
81
+ sorter: 'desc-id'
82
+ }, // 默认参数
83
+ sourceName: 'skuCode',
80
84
  },
81
85
  selectProps,
82
86
  selectBusinessType: 'skuCommodity',
@@ -20,7 +20,7 @@ const SearchSelect = (props: any) => {
20
20
  requestConfig,
21
21
  ctx,
22
22
  } = props;
23
- const { url, otherParams, isMap, fixedparameter, fieldValToParam, mappingTextField='name', mappingValueField='code' } = requestConfig || {};
23
+ const { url, otherParams, isMap, fixedparameter, fieldValToParam, mappingTextField='name', mappingValueField='code', sourceName='supplierCode' } = requestConfig || {};
24
24
 
25
25
  const selectMode = selectProps?.mode // 设定当前选择器 为单选或者多选模式 无设定为单选模式(默认)
26
26
  const initVal = value || (selectMode ? [] : null);
@@ -143,7 +143,8 @@ const SearchSelect = (props: any) => {
143
143
  }
144
144
  source = Array.isArray(source) ? source : []
145
145
  if(type === 1) {
146
- ctx?.form?.setFieldSource('supplierCode', source)
146
+ console.log(sourceName, 'sourceName')
147
+ ctx?.form?.setFieldSource(sourceName, source)
147
148
  setItems(source)
148
149
  setItemsTotal(Number(res?.total))
149
150
  } else {