@bit-sun/business-component 1.1.9 → 1.1.11

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
@@ -2445,7 +2445,9 @@ var SearchSelect = function SearchSelect(props) {
2445
2445
  _ref$mappingTextField = _ref.mappingTextField,
2446
2446
  mappingTextField = _ref$mappingTextField === void 0 ? 'name' : _ref$mappingTextField,
2447
2447
  _ref$mappingValueFiel = _ref.mappingValueField,
2448
- mappingValueField = _ref$mappingValueFiel === void 0 ? 'code' : _ref$mappingValueFiel;
2448
+ mappingValueField = _ref$mappingValueFiel === void 0 ? 'code' : _ref$mappingValueFiel,
2449
+ _ref$sourceName = _ref.sourceName,
2450
+ sourceName = _ref$sourceName === void 0 ? 'supplierCode' : _ref$sourceName;
2449
2451
 
2450
2452
  var selectMode = selectProps === null || selectProps === void 0 ? void 0 : selectProps.mode; // 设定当前选择器 为单选或者多选模式 无设定为单选模式(默认)
2451
2453
 
@@ -2643,7 +2645,7 @@ var SearchSelect = function SearchSelect(props) {
2643
2645
  if (type === 1) {
2644
2646
  var _ctx$form;
2645
2647
 
2646
- ctx === null || ctx === void 0 ? void 0 : (_ctx$form = ctx.form) === null || _ctx$form === void 0 ? void 0 : _ctx$form.setFieldSource('supplierCode', source);
2648
+ ctx === null || ctx === void 0 ? void 0 : (_ctx$form = ctx.form) === null || _ctx$form === void 0 ? void 0 : _ctx$form.setFieldSource(sourceName, source);
2647
2649
  setItems(source);
2648
2650
  setItemsTotal(Number(res === null || res === void 0 ? void 0 : res.total));
2649
2651
  } else {
@@ -3387,10 +3389,13 @@ function commonFun(type, prefixUrl) {
3387
3389
  requestConfig = {
3388
3390
  url: "".concat(prefixUrl.selectPrefix, "/sku"),
3389
3391
  filter: 'qp-nameAndCode-like',
3392
+ mappingTextField: 'name',
3393
+ mappingValueField: 'skuCode',
3390
3394
  otherParams: {
3395
+ 'qp-approveStatus-eq': 2,
3391
3396
  sorter: 'desc-id'
3392
- } // 默认参数
3393
-
3397
+ },
3398
+ sourceName: 'skuCode'
3394
3399
  };
3395
3400
  tableSearchForm = [{
3396
3401
  name: 'qp-name-like',
package/dist/index.js CHANGED
@@ -2456,7 +2456,9 @@ var SearchSelect = function SearchSelect(props) {
2456
2456
  _ref$mappingTextField = _ref.mappingTextField,
2457
2457
  mappingTextField = _ref$mappingTextField === void 0 ? 'name' : _ref$mappingTextField,
2458
2458
  _ref$mappingValueFiel = _ref.mappingValueField,
2459
- mappingValueField = _ref$mappingValueFiel === void 0 ? 'code' : _ref$mappingValueFiel;
2459
+ mappingValueField = _ref$mappingValueFiel === void 0 ? 'code' : _ref$mappingValueFiel,
2460
+ _ref$sourceName = _ref.sourceName,
2461
+ sourceName = _ref$sourceName === void 0 ? 'supplierCode' : _ref$sourceName;
2460
2462
 
2461
2463
  var selectMode = selectProps === null || selectProps === void 0 ? void 0 : selectProps.mode; // 设定当前选择器 为单选或者多选模式 无设定为单选模式(默认)
2462
2464
 
@@ -2654,7 +2656,7 @@ var SearchSelect = function SearchSelect(props) {
2654
2656
  if (type === 1) {
2655
2657
  var _ctx$form;
2656
2658
 
2657
- ctx === null || ctx === void 0 ? void 0 : (_ctx$form = ctx.form) === null || _ctx$form === void 0 ? void 0 : _ctx$form.setFieldSource('supplierCode', source);
2659
+ ctx === null || ctx === void 0 ? void 0 : (_ctx$form = ctx.form) === null || _ctx$form === void 0 ? void 0 : _ctx$form.setFieldSource(sourceName, source);
2658
2660
  setItems(source);
2659
2661
  setItemsTotal(Number(res === null || res === void 0 ? void 0 : res.total));
2660
2662
  } else {
@@ -3398,10 +3400,13 @@ function commonFun(type, prefixUrl) {
3398
3400
  requestConfig = {
3399
3401
  url: "".concat(prefixUrl.selectPrefix, "/sku"),
3400
3402
  filter: 'qp-nameAndCode-like',
3403
+ mappingTextField: 'name',
3404
+ mappingValueField: 'skuCode',
3401
3405
  otherParams: {
3406
+ 'qp-approveStatus-eq': 2,
3402
3407
  sorter: 'desc-id'
3403
- } // 默认参数
3404
-
3408
+ },
3409
+ sourceName: 'skuCode'
3405
3410
  };
3406
3411
  tableSearchForm = [{
3407
3412
  name: 'qp-name-like',
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.11",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -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 {