@kmkf-fe-packages/basic-components 2.0.54-beta.0 → 2.0.54-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -14127,15 +14127,20 @@ var getColumns$2 = function getColumns(_ref) {
14127
14127
  WDT_REISSUE_GOODS: [{
14128
14128
  dataIndex: 'goodId',
14129
14129
  title: "\u5546\u54C1ID",
14130
- width: 120
14130
+ width: 120,
14131
+ align: 'center',
14132
+ ellipsis: true
14131
14133
  }, {
14132
14134
  dataIndex: 'goodNo',
14133
14135
  title: "\u5546\u54C1\u7F16\u7801",
14134
- width: 200
14136
+ align: 'center',
14137
+ ellipsis: true,
14138
+ width: 180
14135
14139
  }, {
14136
14140
  dataIndex: 'goodName',
14137
14141
  title: "\u5546\u54C1\u540D\u79F0",
14138
14142
  width: 200,
14143
+ align: 'center',
14139
14144
  render: function render(text) {
14140
14145
  return /*#__PURE__*/React.createElement(CopyTextIcon, {
14141
14146
  val: text
@@ -14144,14 +14149,19 @@ var getColumns$2 = function getColumns(_ref) {
14144
14149
  }, {
14145
14150
  dataIndex: 'specId',
14146
14151
  title: "SKUID",
14152
+ align: 'center',
14153
+ ellipsis: true,
14147
14154
  width: 150
14148
14155
  }, {
14149
14156
  dataIndex: 'specNo',
14150
14157
  title: "\u5546\u54C1SKU\u7F16\u7801",
14151
- width: 200
14158
+ align: 'center',
14159
+ ellipsis: true,
14160
+ width: 180
14152
14161
  }, {
14153
14162
  dataIndex: 'specName',
14154
14163
  title: "\u5546\u54C1SKU\u540D\u79F0",
14164
+ align: 'center',
14155
14165
  width: 250,
14156
14166
  render: function render(text) {
14157
14167
  return /*#__PURE__*/React.createElement(CopyTextIcon, {
@@ -14264,18 +14274,7 @@ var getColumns$2 = function getColumns(_ref) {
14264
14274
  align: 'center',
14265
14275
  ellipsis: true,
14266
14276
  width: 100,
14267
- render: function render(val) {
14268
- var giftTypeMap = {
14269
- 0: '非赠品',
14270
- 1: '自动赠送',
14271
- 2: '手工赠送',
14272
- 3: '回购自动送赠品',
14273
- 4: '前N有礼送赠品',
14274
- 6: '天猫优仓赠品',
14275
- 7: '淘宝CRM会员送赠'
14276
- };
14277
- return /*#__PURE__*/React.createElement("span", null, giftTypeMap[val]);
14278
- }
14277
+ render: renderGiftType
14279
14278
  }],
14280
14279
  //旺店通退货商品信息
14281
14280
  WDT_RETURN_GOODS: [{
@@ -14371,18 +14370,7 @@ var getColumns$2 = function getColumns(_ref) {
14371
14370
  align: 'center',
14372
14371
  ellipsis: true,
14373
14372
  width: 100,
14374
- render: function render(val) {
14375
- var giftTypeMap = {
14376
- 0: '非赠品',
14377
- 1: '自动赠送',
14378
- 2: '手工赠送',
14379
- 3: '回购自动送赠品',
14380
- 4: '前N有礼送赠品',
14381
- 6: '天猫优仓赠品',
14382
- 7: '淘宝CRM会员送赠'
14383
- };
14384
- return /*#__PURE__*/React.createElement("span", null, giftTypeMap[val]);
14385
- }
14373
+ render: renderGiftType
14386
14374
  }, {
14387
14375
  dataIndex: 'type',
14388
14376
  title: "".concat(text, "\u5546\u54C1\u7C7B\u578B"),
@@ -14503,18 +14491,7 @@ var getColumns$2 = function getColumns(_ref) {
14503
14491
  align: 'center',
14504
14492
  ellipsis: true,
14505
14493
  width: 100,
14506
- render: function render(val) {
14507
- var giftTypeMap = {
14508
- 0: '非赠品',
14509
- 1: '自动赠送',
14510
- 2: '手工赠送',
14511
- 3: '回购自动送赠品',
14512
- 4: '前N有礼送赠品',
14513
- 6: '天猫优仓赠品',
14514
- 7: '淘宝CRM会员送赠'
14515
- };
14516
- return /*#__PURE__*/React.createElement("span", null, giftTypeMap[val]);
14517
- }
14494
+ render: renderGiftType
14518
14495
  }, {
14519
14496
  dataIndex: 'type',
14520
14497
  title: "".concat(text, "\u5546\u54C1\u7C7B\u578B"),
@@ -14698,6 +14675,15 @@ var getYesOrNo$1 = function getYesOrNo(val) {
14698
14675
  if (isNull(val)) return null;
14699
14676
  return val ? '是' : '否';
14700
14677
  };
14678
+ function toNum(value) {
14679
+ if (typeof value === 'string') {
14680
+ return value ? +value : void 0;
14681
+ }
14682
+ if (typeof value === 'number') {
14683
+ return value;
14684
+ }
14685
+ return void 0;
14686
+ }
14701
14687
  var getColumns$4 = function getColumns(_ref) {
14702
14688
  var _ref$text = _ref.text,
14703
14689
  disabled = _ref.disabled,
@@ -14855,6 +14841,19 @@ var getColumns$4 = function getColumns(_ref) {
14855
14841
  dataIndex: 'qty',
14856
14842
  title: "\u6570\u91CF",
14857
14843
  width: 100,
14844
+ validator: function validator(_rule, value) {
14845
+ var goodsName = '';
14846
+ if (((value === null || value === void 0 ? void 0 : value.gyReissueGoods) || []).some(function (goods) {
14847
+ var qty = toNum(goods === null || goods === void 0 ? void 0 : goods.qty);
14848
+ var res = typeof qty === 'number' ? qty < 1 : true;
14849
+ if (res) {
14850
+ goodsName = (goods === null || goods === void 0 ? void 0 : goods.goodName) ? "[".concat(goods === null || goods === void 0 ? void 0 : goods.goodName, "]") : '';
14851
+ }
14852
+ return res;
14853
+ })) {
14854
+ return Promise.reject("".concat(goodsName, "\u6570\u91CF\u5FC5\u987B\u5927\u4E8E0"));
14855
+ }
14856
+ },
14858
14857
  render: function render(val, record, index) {
14859
14858
  return !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
14860
14859
  style: {
@@ -14958,6 +14957,19 @@ var getColumns$4 = function getColumns(_ref) {
14958
14957
  dataIndex: 'qty',
14959
14958
  title: "\u6570\u91CF",
14960
14959
  width: 100,
14960
+ validator: function validator(_rule, value) {
14961
+ var goodsName = '';
14962
+ if (((value === null || value === void 0 ? void 0 : value.gyReturnGoods) || []).some(function (goods) {
14963
+ var qty = toNum(goods === null || goods === void 0 ? void 0 : goods.qty);
14964
+ var res = typeof qty === 'number' ? qty < 1 : true;
14965
+ if (res) {
14966
+ goodsName = (goods === null || goods === void 0 ? void 0 : goods.goodName) ? "[".concat(goods === null || goods === void 0 ? void 0 : goods.goodName, "]") : '';
14967
+ }
14968
+ return res;
14969
+ })) {
14970
+ return Promise.reject("".concat(goodsName, "\u6570\u91CF\u5FC5\u987B\u5927\u4E8E0"));
14971
+ }
14972
+ },
14961
14973
  render: function render(val, record, index) {
14962
14974
  return !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
14963
14975
  style: {
@@ -15049,6 +15061,15 @@ var fillAttrs = function fillAttrs(item) {
15049
15061
  if (!item.align) item.align = 'center';
15050
15062
  return item;
15051
15063
  };
15064
+ function toNum$1(value) {
15065
+ if (typeof value === 'string') {
15066
+ return value ? +value : void 0;
15067
+ }
15068
+ if (typeof value === 'number') {
15069
+ return value;
15070
+ }
15071
+ return void 0;
15072
+ }
15052
15073
  var getColumns$5 = function getColumns() {
15053
15074
  var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
15054
15075
  _ref$text = _ref.text,
@@ -15232,6 +15253,19 @@ var getColumns$5 = function getColumns() {
15232
15253
  ellipsis: true,
15233
15254
  align: 'center',
15234
15255
  width: 120,
15256
+ validator: function validator(_rule, value) {
15257
+ var goodsName = '';
15258
+ if (((value === null || value === void 0 ? void 0 : value.jstReissueGoods) || []).some(function (goods) {
15259
+ var v = toNum$1(goods === null || goods === void 0 ? void 0 : goods.salePrice);
15260
+ var res = typeof v === 'number' ? v < 0 : true;
15261
+ if (res) {
15262
+ goodsName = (goods === null || goods === void 0 ? void 0 : goods.name) ? "[".concat(goods === null || goods === void 0 ? void 0 : goods.name, "]") : '';
15263
+ }
15264
+ return res;
15265
+ })) {
15266
+ return Promise.reject("".concat(goodsName, "\u5355\u4EF7\u4E3A\u5927\u4E8E\u7B49\u4E8E0\u7684\u6570"));
15267
+ }
15268
+ },
15235
15269
  render: function render(val, record, index) {
15236
15270
  return record.canEdit && !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
15237
15271
  style: {
@@ -15251,6 +15285,19 @@ var getColumns$5 = function getColumns() {
15251
15285
  ellipsis: true,
15252
15286
  align: 'center',
15253
15287
  width: 100,
15288
+ validator: function validator(_rule, value) {
15289
+ var goodsName = '';
15290
+ if (((value === null || value === void 0 ? void 0 : value.jstReissueGoods) || []).some(function (goods) {
15291
+ var qty = toNum$1(goods === null || goods === void 0 ? void 0 : goods.qty);
15292
+ var res = typeof qty === 'number' ? qty < 1 : true;
15293
+ if (res) {
15294
+ goodsName = (goods === null || goods === void 0 ? void 0 : goods.name) ? "[".concat(goods === null || goods === void 0 ? void 0 : goods.name, "]") : '';
15295
+ }
15296
+ return res;
15297
+ })) {
15298
+ return Promise.reject("".concat(goodsName, "\u6570\u91CF\u5FC5\u987B\u5927\u4E8E0"));
15299
+ }
15300
+ },
15254
15301
  render: function render(val, record, index) {
15255
15302
  return record.canEdit && !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
15256
15303
  style: {
@@ -15335,6 +15382,19 @@ var getColumns$5 = function getColumns() {
15335
15382
  dataIndex: 'salePrice',
15336
15383
  title: '单价',
15337
15384
  width: 120,
15385
+ validator: function validator(_rule, value) {
15386
+ var goodsName = '';
15387
+ if (((value === null || value === void 0 ? void 0 : value.jstReturnGoods) || []).some(function (goods) {
15388
+ var v = toNum$1(goods === null || goods === void 0 ? void 0 : goods.salePrice);
15389
+ var res = typeof v === 'number' ? v < 0 : true;
15390
+ if (res) {
15391
+ goodsName = (goods === null || goods === void 0 ? void 0 : goods.name) ? "[".concat(goods === null || goods === void 0 ? void 0 : goods.name, "]") : '';
15392
+ }
15393
+ return res;
15394
+ })) {
15395
+ return Promise.reject("".concat(goodsName, "\u5355\u4EF7\u4E3A\u5927\u4E8E\u7B49\u4E8E0\u7684\u6570"));
15396
+ }
15397
+ },
15338
15398
  render: function render(val, record, index) {
15339
15399
  return !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
15340
15400
  style: {
@@ -15352,6 +15412,19 @@ var getColumns$5 = function getColumns() {
15352
15412
  dataIndex: 'qty',
15353
15413
  title: '数量',
15354
15414
  width: 100,
15415
+ validator: function validator(_rule, value) {
15416
+ var goodsName = '';
15417
+ if (((value === null || value === void 0 ? void 0 : value.jstReturnGoods) || []).some(function (goods) {
15418
+ var qty = toNum$1(goods === null || goods === void 0 ? void 0 : goods.qty);
15419
+ var res = typeof qty === 'number' ? qty < 1 : true;
15420
+ if (res) {
15421
+ goodsName = (goods === null || goods === void 0 ? void 0 : goods.name) ? "[".concat(goods === null || goods === void 0 ? void 0 : goods.name, "]") : '';
15422
+ }
15423
+ return res;
15424
+ })) {
15425
+ return Promise.reject("".concat(goodsName, "\u6570\u91CF\u5FC5\u987B\u5927\u4E8E0"));
15426
+ }
15427
+ },
15355
15428
  render: function render(val, record, index) {
15356
15429
  return !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
15357
15430
  style: {
@@ -15663,6 +15736,7 @@ var getColumnsMap$1 = function getColumnsMap(args) {
15663
15736
  })['default']
15664
15737
  });
15665
15738
  };
15739
+ var erpColumnsMap = getColumnsMap$1();
15666
15740
  var getColumnsBaseInfo$1 = function getColumnsBaseInfo() {
15667
15741
  var clone_columnsMap = cloneDeep(getColumnsMap$1());
15668
15742
  var newColumns = {};
@@ -15670,7 +15744,8 @@ var getColumnsBaseInfo$1 = function getColumnsBaseInfo() {
15670
15744
  newColumns[key] = clone_columnsMap[key].map(function (col) {
15671
15745
  return {
15672
15746
  title: col.title,
15673
- dataIndex: col.dataIndex
15747
+ dataIndex: col.dataIndex,
15748
+ disabled: !!col.validator
15674
15749
  };
15675
15750
  });
15676
15751
  });
@@ -16052,16 +16127,18 @@ var GoodItem$1 = function GoodItem(props) {
16052
16127
  var isObjectArray = Array.isArray(showHeader) && Object.prototype.toString.call(showHeader[0]) === '[object Object]';
16053
16128
  if (isStringArray) {
16054
16129
  baseInfoColumns = initBaseInfoColumns.filter(function (col) {
16055
- return showHeader.includes(col.dataIndex);
16130
+ return showHeader.includes(col.dataIndex) || (col === null || col === void 0 ? void 0 : col.validator);
16056
16131
  });
16057
16132
  } else if (isObjectArray) {
16058
- baseInfoColumns = showHeader.filter(function (col) {
16059
- return col.show !== false;
16060
- }).map(function (col) {
16133
+ baseInfoColumns = showHeader.map(function (col) {
16061
16134
  var currentCol = initBaseInfoColumns.find(function (item) {
16062
16135
  return item.dataIndex === col.dataIndex;
16063
16136
  });
16064
- return currentCol ? currentCol : undefined;
16137
+ // 如果列应该显示(show不为false)或者有验证器,则返回对应的列配置
16138
+ if (currentCol && (col.show !== false || (currentCol === null || currentCol === void 0 ? void 0 : currentCol.validator))) {
16139
+ return currentCol;
16140
+ }
16141
+ return undefined;
16065
16142
  }).filter(Boolean);
16066
16143
  }
16067
16144
  var columnList = [{
@@ -20269,4 +20346,4 @@ var GyReturnGoods = function GyReturnGoods(props) {
20269
20346
  })));
20270
20347
  };
20271
20348
 
20272
- export { ApaasAddress as Address, AliPay, Province as ApaasAddress, ApaasCascader, ApaasCheckbox, ApaasDate, withFormItem as ApaasHoc, ApaasInput, ApaasInputNumber, ApaasLogistics, ApaasMultipleSelect, ApaasPosting, ApaasRadio, ApaasRate, ApaasSelect, ApaasSlider, ApaasTextArea, ApaasUpload, index as ApaasUploadAsync, ApaasUploadFile, index$1 as ApaasUploadProAsync, bsE3Reissue as BsE3Reissue, BsExchange, BsGoods, BsReissue, BsReturnGoods as BsReturn, index$3 as BsSystemOrder, BuyerNick, CalculationInput, ChooseBaby, CommonExchangeGoods, CommonGoods, CommonSystemOrder$1 as CommonMultiStatus, CommonReturnGoods, CommonStatus, CommonSystemOrder, CopyTextIcon, ExpressLogistics, Goods, index$4 as GoodsTable, GyReissue, GyReturnGoods as GyReturn, IdentifyAddress, Invoice, jstGoods as JstGoods, ItemList as JstItemList, LogisticsInterception, LogisticsMoreInterception, LogisticsMoreTrajectory, LogisticsTrajectory, MsgStatus, ParseLogistics, Payment, PublicReissue, RemarkInput as Remark, ExpressLogistics as ReturnLogistics, ShopNameSelect as ShopName, Status, SubForm, Supplier, TBGoodId, TBGoodSerial, TradeId, WdtGoodList, wdtReissue as WdtReissue, WlnGoods, columnsBaseInfoMap, index$2 as erpModalColumnsMap, getColumns$5 as getJstColumns, getColumns$3 as getWlnColumns };
20349
+ export { ApaasAddress as Address, AliPay, Province as ApaasAddress, ApaasCascader, ApaasCheckbox, ApaasDate, withFormItem as ApaasHoc, ApaasInput, ApaasInputNumber, ApaasLogistics, ApaasMultipleSelect, ApaasPosting, ApaasRadio, ApaasRate, ApaasSelect, ApaasSlider, ApaasTextArea, ApaasUpload, index as ApaasUploadAsync, ApaasUploadFile, index$1 as ApaasUploadProAsync, bsE3Reissue as BsE3Reissue, BsExchange, BsGoods, BsReissue, BsReturnGoods as BsReturn, index$3 as BsSystemOrder, BuyerNick, CalculationInput, ChooseBaby, CommonExchangeGoods, CommonGoods, CommonSystemOrder$1 as CommonMultiStatus, CommonReturnGoods, CommonStatus, CommonSystemOrder, CopyTextIcon, ExpressLogistics, Goods, index$4 as GoodsTable, GyReissue, GyReturnGoods as GyReturn, IdentifyAddress, Invoice, jstGoods as JstGoods, ItemList as JstItemList, LogisticsInterception, LogisticsMoreInterception, LogisticsMoreTrajectory, LogisticsTrajectory, MsgStatus, ParseLogistics, Payment, PublicReissue, RemarkInput as Remark, ExpressLogistics as ReturnLogistics, ShopNameSelect as ShopName, Status, SubForm, Supplier, TBGoodId, TBGoodSerial, TradeId, WdtGoodList, wdtReissue as WdtReissue, WlnGoods, columnsBaseInfoMap, erpColumnsMap, index$2 as erpModalColumnsMap, getColumns$4 as getGyColumns, getColumns$5 as getJstColumns, getColumns$2 as getWdtColumns, getColumns$3 as getWlnColumns };
package/dist/index.js CHANGED
@@ -14139,15 +14139,20 @@ var getColumns$2 = function getColumns(_ref) {
14139
14139
  WDT_REISSUE_GOODS: [{
14140
14140
  dataIndex: 'goodId',
14141
14141
  title: "\u5546\u54C1ID",
14142
- width: 120
14142
+ width: 120,
14143
+ align: 'center',
14144
+ ellipsis: true
14143
14145
  }, {
14144
14146
  dataIndex: 'goodNo',
14145
14147
  title: "\u5546\u54C1\u7F16\u7801",
14146
- width: 200
14148
+ align: 'center',
14149
+ ellipsis: true,
14150
+ width: 180
14147
14151
  }, {
14148
14152
  dataIndex: 'goodName',
14149
14153
  title: "\u5546\u54C1\u540D\u79F0",
14150
14154
  width: 200,
14155
+ align: 'center',
14151
14156
  render: function render(text) {
14152
14157
  return /*#__PURE__*/React__default['default'].createElement(CopyTextIcon, {
14153
14158
  val: text
@@ -14156,14 +14161,19 @@ var getColumns$2 = function getColumns(_ref) {
14156
14161
  }, {
14157
14162
  dataIndex: 'specId',
14158
14163
  title: "SKUID",
14164
+ align: 'center',
14165
+ ellipsis: true,
14159
14166
  width: 150
14160
14167
  }, {
14161
14168
  dataIndex: 'specNo',
14162
14169
  title: "\u5546\u54C1SKU\u7F16\u7801",
14163
- width: 200
14170
+ align: 'center',
14171
+ ellipsis: true,
14172
+ width: 180
14164
14173
  }, {
14165
14174
  dataIndex: 'specName',
14166
14175
  title: "\u5546\u54C1SKU\u540D\u79F0",
14176
+ align: 'center',
14167
14177
  width: 250,
14168
14178
  render: function render(text) {
14169
14179
  return /*#__PURE__*/React__default['default'].createElement(CopyTextIcon, {
@@ -14276,18 +14286,7 @@ var getColumns$2 = function getColumns(_ref) {
14276
14286
  align: 'center',
14277
14287
  ellipsis: true,
14278
14288
  width: 100,
14279
- render: function render(val) {
14280
- var giftTypeMap = {
14281
- 0: '非赠品',
14282
- 1: '自动赠送',
14283
- 2: '手工赠送',
14284
- 3: '回购自动送赠品',
14285
- 4: '前N有礼送赠品',
14286
- 6: '天猫优仓赠品',
14287
- 7: '淘宝CRM会员送赠'
14288
- };
14289
- return /*#__PURE__*/React__default['default'].createElement("span", null, giftTypeMap[val]);
14290
- }
14289
+ render: renderGiftType
14291
14290
  }],
14292
14291
  //旺店通退货商品信息
14293
14292
  WDT_RETURN_GOODS: [{
@@ -14383,18 +14382,7 @@ var getColumns$2 = function getColumns(_ref) {
14383
14382
  align: 'center',
14384
14383
  ellipsis: true,
14385
14384
  width: 100,
14386
- render: function render(val) {
14387
- var giftTypeMap = {
14388
- 0: '非赠品',
14389
- 1: '自动赠送',
14390
- 2: '手工赠送',
14391
- 3: '回购自动送赠品',
14392
- 4: '前N有礼送赠品',
14393
- 6: '天猫优仓赠品',
14394
- 7: '淘宝CRM会员送赠'
14395
- };
14396
- return /*#__PURE__*/React__default['default'].createElement("span", null, giftTypeMap[val]);
14397
- }
14385
+ render: renderGiftType
14398
14386
  }, {
14399
14387
  dataIndex: 'type',
14400
14388
  title: "".concat(text, "\u5546\u54C1\u7C7B\u578B"),
@@ -14515,18 +14503,7 @@ var getColumns$2 = function getColumns(_ref) {
14515
14503
  align: 'center',
14516
14504
  ellipsis: true,
14517
14505
  width: 100,
14518
- render: function render(val) {
14519
- var giftTypeMap = {
14520
- 0: '非赠品',
14521
- 1: '自动赠送',
14522
- 2: '手工赠送',
14523
- 3: '回购自动送赠品',
14524
- 4: '前N有礼送赠品',
14525
- 6: '天猫优仓赠品',
14526
- 7: '淘宝CRM会员送赠'
14527
- };
14528
- return /*#__PURE__*/React__default['default'].createElement("span", null, giftTypeMap[val]);
14529
- }
14506
+ render: renderGiftType
14530
14507
  }, {
14531
14508
  dataIndex: 'type',
14532
14509
  title: "".concat(text, "\u5546\u54C1\u7C7B\u578B"),
@@ -14710,6 +14687,15 @@ var getYesOrNo$1 = function getYesOrNo(val) {
14710
14687
  if (kmkfUtils.isNull(val)) return null;
14711
14688
  return val ? '是' : '否';
14712
14689
  };
14690
+ function toNum(value) {
14691
+ if (typeof value === 'string') {
14692
+ return value ? +value : void 0;
14693
+ }
14694
+ if (typeof value === 'number') {
14695
+ return value;
14696
+ }
14697
+ return void 0;
14698
+ }
14713
14699
  var getColumns$4 = function getColumns(_ref) {
14714
14700
  var _ref$text = _ref.text,
14715
14701
  disabled = _ref.disabled,
@@ -14867,6 +14853,19 @@ var getColumns$4 = function getColumns(_ref) {
14867
14853
  dataIndex: 'qty',
14868
14854
  title: "\u6570\u91CF",
14869
14855
  width: 100,
14856
+ validator: function validator(_rule, value) {
14857
+ var goodsName = '';
14858
+ if (((value === null || value === void 0 ? void 0 : value.gyReissueGoods) || []).some(function (goods) {
14859
+ var qty = toNum(goods === null || goods === void 0 ? void 0 : goods.qty);
14860
+ var res = typeof qty === 'number' ? qty < 1 : true;
14861
+ if (res) {
14862
+ goodsName = (goods === null || goods === void 0 ? void 0 : goods.goodName) ? "[".concat(goods === null || goods === void 0 ? void 0 : goods.goodName, "]") : '';
14863
+ }
14864
+ return res;
14865
+ })) {
14866
+ return Promise.reject("".concat(goodsName, "\u6570\u91CF\u5FC5\u987B\u5927\u4E8E0"));
14867
+ }
14868
+ },
14870
14869
  render: function render(val, record, index) {
14871
14870
  return !disabled ? /*#__PURE__*/React__default['default'].createElement(antd.InputNumber, {
14872
14871
  style: {
@@ -14970,6 +14969,19 @@ var getColumns$4 = function getColumns(_ref) {
14970
14969
  dataIndex: 'qty',
14971
14970
  title: "\u6570\u91CF",
14972
14971
  width: 100,
14972
+ validator: function validator(_rule, value) {
14973
+ var goodsName = '';
14974
+ if (((value === null || value === void 0 ? void 0 : value.gyReturnGoods) || []).some(function (goods) {
14975
+ var qty = toNum(goods === null || goods === void 0 ? void 0 : goods.qty);
14976
+ var res = typeof qty === 'number' ? qty < 1 : true;
14977
+ if (res) {
14978
+ goodsName = (goods === null || goods === void 0 ? void 0 : goods.goodName) ? "[".concat(goods === null || goods === void 0 ? void 0 : goods.goodName, "]") : '';
14979
+ }
14980
+ return res;
14981
+ })) {
14982
+ return Promise.reject("".concat(goodsName, "\u6570\u91CF\u5FC5\u987B\u5927\u4E8E0"));
14983
+ }
14984
+ },
14973
14985
  render: function render(val, record, index) {
14974
14986
  return !disabled ? /*#__PURE__*/React__default['default'].createElement(antd.InputNumber, {
14975
14987
  style: {
@@ -15061,6 +15073,15 @@ var fillAttrs = function fillAttrs(item) {
15061
15073
  if (!item.align) item.align = 'center';
15062
15074
  return item;
15063
15075
  };
15076
+ function toNum$1(value) {
15077
+ if (typeof value === 'string') {
15078
+ return value ? +value : void 0;
15079
+ }
15080
+ if (typeof value === 'number') {
15081
+ return value;
15082
+ }
15083
+ return void 0;
15084
+ }
15064
15085
  var getColumns$5 = function getColumns() {
15065
15086
  var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
15066
15087
  _ref$text = _ref.text,
@@ -15244,6 +15265,19 @@ var getColumns$5 = function getColumns() {
15244
15265
  ellipsis: true,
15245
15266
  align: 'center',
15246
15267
  width: 120,
15268
+ validator: function validator(_rule, value) {
15269
+ var goodsName = '';
15270
+ if (((value === null || value === void 0 ? void 0 : value.jstReissueGoods) || []).some(function (goods) {
15271
+ var v = toNum$1(goods === null || goods === void 0 ? void 0 : goods.salePrice);
15272
+ var res = typeof v === 'number' ? v < 0 : true;
15273
+ if (res) {
15274
+ goodsName = (goods === null || goods === void 0 ? void 0 : goods.name) ? "[".concat(goods === null || goods === void 0 ? void 0 : goods.name, "]") : '';
15275
+ }
15276
+ return res;
15277
+ })) {
15278
+ return Promise.reject("".concat(goodsName, "\u5355\u4EF7\u4E3A\u5927\u4E8E\u7B49\u4E8E0\u7684\u6570"));
15279
+ }
15280
+ },
15247
15281
  render: function render(val, record, index) {
15248
15282
  return record.canEdit && !disabled ? /*#__PURE__*/React__default['default'].createElement(antd.InputNumber, {
15249
15283
  style: {
@@ -15263,6 +15297,19 @@ var getColumns$5 = function getColumns() {
15263
15297
  ellipsis: true,
15264
15298
  align: 'center',
15265
15299
  width: 100,
15300
+ validator: function validator(_rule, value) {
15301
+ var goodsName = '';
15302
+ if (((value === null || value === void 0 ? void 0 : value.jstReissueGoods) || []).some(function (goods) {
15303
+ var qty = toNum$1(goods === null || goods === void 0 ? void 0 : goods.qty);
15304
+ var res = typeof qty === 'number' ? qty < 1 : true;
15305
+ if (res) {
15306
+ goodsName = (goods === null || goods === void 0 ? void 0 : goods.name) ? "[".concat(goods === null || goods === void 0 ? void 0 : goods.name, "]") : '';
15307
+ }
15308
+ return res;
15309
+ })) {
15310
+ return Promise.reject("".concat(goodsName, "\u6570\u91CF\u5FC5\u987B\u5927\u4E8E0"));
15311
+ }
15312
+ },
15266
15313
  render: function render(val, record, index) {
15267
15314
  return record.canEdit && !disabled ? /*#__PURE__*/React__default['default'].createElement(antd.InputNumber, {
15268
15315
  style: {
@@ -15347,6 +15394,19 @@ var getColumns$5 = function getColumns() {
15347
15394
  dataIndex: 'salePrice',
15348
15395
  title: '单价',
15349
15396
  width: 120,
15397
+ validator: function validator(_rule, value) {
15398
+ var goodsName = '';
15399
+ if (((value === null || value === void 0 ? void 0 : value.jstReturnGoods) || []).some(function (goods) {
15400
+ var v = toNum$1(goods === null || goods === void 0 ? void 0 : goods.salePrice);
15401
+ var res = typeof v === 'number' ? v < 0 : true;
15402
+ if (res) {
15403
+ goodsName = (goods === null || goods === void 0 ? void 0 : goods.name) ? "[".concat(goods === null || goods === void 0 ? void 0 : goods.name, "]") : '';
15404
+ }
15405
+ return res;
15406
+ })) {
15407
+ return Promise.reject("".concat(goodsName, "\u5355\u4EF7\u4E3A\u5927\u4E8E\u7B49\u4E8E0\u7684\u6570"));
15408
+ }
15409
+ },
15350
15410
  render: function render(val, record, index) {
15351
15411
  return !disabled ? /*#__PURE__*/React__default['default'].createElement(antd.InputNumber, {
15352
15412
  style: {
@@ -15364,6 +15424,19 @@ var getColumns$5 = function getColumns() {
15364
15424
  dataIndex: 'qty',
15365
15425
  title: '数量',
15366
15426
  width: 100,
15427
+ validator: function validator(_rule, value) {
15428
+ var goodsName = '';
15429
+ if (((value === null || value === void 0 ? void 0 : value.jstReturnGoods) || []).some(function (goods) {
15430
+ var qty = toNum$1(goods === null || goods === void 0 ? void 0 : goods.qty);
15431
+ var res = typeof qty === 'number' ? qty < 1 : true;
15432
+ if (res) {
15433
+ goodsName = (goods === null || goods === void 0 ? void 0 : goods.name) ? "[".concat(goods === null || goods === void 0 ? void 0 : goods.name, "]") : '';
15434
+ }
15435
+ return res;
15436
+ })) {
15437
+ return Promise.reject("".concat(goodsName, "\u6570\u91CF\u5FC5\u987B\u5927\u4E8E0"));
15438
+ }
15439
+ },
15367
15440
  render: function render(val, record, index) {
15368
15441
  return !disabled ? /*#__PURE__*/React__default['default'].createElement(antd.InputNumber, {
15369
15442
  style: {
@@ -15675,6 +15748,7 @@ var getColumnsMap$1 = function getColumnsMap(args) {
15675
15748
  })['default']
15676
15749
  });
15677
15750
  };
15751
+ var erpColumnsMap = getColumnsMap$1();
15678
15752
  var getColumnsBaseInfo$1 = function getColumnsBaseInfo() {
15679
15753
  var clone_columnsMap = lodash.cloneDeep(getColumnsMap$1());
15680
15754
  var newColumns = {};
@@ -15682,7 +15756,8 @@ var getColumnsBaseInfo$1 = function getColumnsBaseInfo() {
15682
15756
  newColumns[key] = clone_columnsMap[key].map(function (col) {
15683
15757
  return {
15684
15758
  title: col.title,
15685
- dataIndex: col.dataIndex
15759
+ dataIndex: col.dataIndex,
15760
+ disabled: !!col.validator
15686
15761
  };
15687
15762
  });
15688
15763
  });
@@ -16064,16 +16139,18 @@ var GoodItem$1 = function GoodItem(props) {
16064
16139
  var isObjectArray = Array.isArray(showHeader) && Object.prototype.toString.call(showHeader[0]) === '[object Object]';
16065
16140
  if (isStringArray) {
16066
16141
  baseInfoColumns = initBaseInfoColumns.filter(function (col) {
16067
- return showHeader.includes(col.dataIndex);
16142
+ return showHeader.includes(col.dataIndex) || (col === null || col === void 0 ? void 0 : col.validator);
16068
16143
  });
16069
16144
  } else if (isObjectArray) {
16070
- baseInfoColumns = showHeader.filter(function (col) {
16071
- return col.show !== false;
16072
- }).map(function (col) {
16145
+ baseInfoColumns = showHeader.map(function (col) {
16073
16146
  var currentCol = initBaseInfoColumns.find(function (item) {
16074
16147
  return item.dataIndex === col.dataIndex;
16075
16148
  });
16076
- return currentCol ? currentCol : undefined;
16149
+ // 如果列应该显示(show不为false)或者有验证器,则返回对应的列配置
16150
+ if (currentCol && (col.show !== false || (currentCol === null || currentCol === void 0 ? void 0 : currentCol.validator))) {
16151
+ return currentCol;
16152
+ }
16153
+ return undefined;
16077
16154
  }).filter(Boolean);
16078
16155
  }
16079
16156
  var columnList = [{
@@ -20348,6 +20425,9 @@ exports.WdtGoodList = WdtGoodList;
20348
20425
  exports.WdtReissue = wdtReissue;
20349
20426
  exports.WlnGoods = WlnGoods;
20350
20427
  exports.columnsBaseInfoMap = columnsBaseInfoMap;
20428
+ exports.erpColumnsMap = erpColumnsMap;
20351
20429
  exports.erpModalColumnsMap = index$2;
20430
+ exports.getGyColumns = getColumns$4;
20352
20431
  exports.getJstColumns = getColumns$5;
20432
+ exports.getWdtColumns = getColumns$2;
20353
20433
  exports.getWlnColumns = getColumns$3;
@@ -3,5 +3,13 @@ type P = {
3
3
  updateHandle: (v: any, index: number, key: string) => void;
4
4
  operate?: boolean;
5
5
  };
6
- export declare const getBsE3ReissueGoodColumns: ({ disabled, updateHandle, operate, }: P) => any[];
6
+ export declare const getBsE3ReissueGoodColumns: ({ disabled, updateHandle, operate, }: P) => {
7
+ dataIndex: string;
8
+ title: string;
9
+ width?: number | undefined;
10
+ align: string;
11
+ ellipsis: boolean;
12
+ render?: ((val: any, record: any, index: number) => any) | undefined;
13
+ validator?: ((rule: any, value: any, callback: any) => any) | undefined;
14
+ }[];
7
15
  export {};
@@ -5,5 +5,21 @@ type P = {
5
5
  updateHandle: (v: any, index: number, key: string) => void;
6
6
  operate?: boolean;
7
7
  };
8
- export declare const getWdtReissueGoodColumns: ({ disabled, updateHandle, operate, }: P) => any[];
8
+ export declare const getWdtReissueGoodColumns: ({ disabled, updateHandle, operate, }: P) => ({
9
+ dataIndex: string;
10
+ title: string;
11
+ width?: number | undefined;
12
+ align: string;
13
+ ellipsis: boolean;
14
+ render?: ((val: any, record: any, index: number) => any) | undefined;
15
+ validator?: ((rule: any, value: any, callback: any) => any) | undefined;
16
+ } | {
17
+ render: ((val: number) => React.JSX.Element) | ((val: any, record: any, index: number) => React.JSX.Element);
18
+ dataIndex: string;
19
+ title: string;
20
+ width?: number | undefined;
21
+ align: string;
22
+ ellipsis: boolean;
23
+ validator?: ((rule: any, value: any, callback: any) => any) | undefined;
24
+ })[];
9
25
  export {};
@@ -1,7 +1,15 @@
1
- type ColumnsMapType = {
2
- [key: string]: any[];
1
+ type ColumnsItemType = {
2
+ dataIndex: string;
3
+ title: string;
4
+ width?: number;
5
+ align?: 'left' | 'center' | 'right';
6
+ ellipsis?: boolean;
7
+ render?: (val: any, record: any, index: number) => any;
8
+ validator?: (rule: any, value: any, callback: any) => any;
3
9
  };
10
+ type ColumnsMapType = Record<string, ColumnsItemType[]>;
4
11
  export type GetColumnsBaseInfoMapFnType = (...args: any[]) => ColumnsMapType;
5
12
  export declare const getColumnsMap: GetColumnsBaseInfoMapFnType;
13
+ export declare const erpColumnsMap: ColumnsMapType;
6
14
  declare const _default: ColumnsMapType;
7
15
  export default _default;
@@ -1,2 +1,4 @@
1
1
  export { default as getJstColumns } from './jst';
2
2
  export { default as getWlnColumns } from './wln';
3
+ export { default as getGyColumns } from './gy';
4
+ export { default as getWdtColumns } from './wdt';
@@ -66,5 +66,5 @@ export type { WdtGoods } from './bs/component/model/WdtGoodList';
66
66
  export { default as GyReissue } from './gy/Reissue';
67
67
  export * from './constants/index';
68
68
  export { default as GyReturn } from './gy/Return';
69
- export { default as columnsBaseInfoMap } from './constants/columnsBaseInfoMap';
69
+ export { default as columnsBaseInfoMap, erpColumnsMap, } from './constants/columnsBaseInfoMap';
70
70
  export { default as erpModalColumnsMap } from './bs/component/model/Columns';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/basic-components",
3
- "version": "2.0.54-beta.0",
3
+ "version": "2.0.54-beta.2",
4
4
  "description": "> TODO: description",
5
5
  "homepage": "",
6
6
  "license": "ISC",
@@ -20,7 +20,7 @@
20
20
  "watch": "nodemon --ignore dist/ --ignore node_modules/ --watch src/ -C -e ts,tsx,less --debug -x 'yarn async'"
21
21
  },
22
22
  "dependencies": {
23
- "@kmkf-fe-packages/kmkf-utils": "2.0.54-beta.0",
23
+ "@kmkf-fe-packages/kmkf-utils": "2.0.54-beta.2",
24
24
  "ahooks": "^3.7.4",
25
25
  "bignumber.js": "^9.1.2",
26
26
  "kmkf-monitor": "^0.8.9",
@@ -65,5 +65,5 @@
65
65
  "publishConfig": {
66
66
  "access": "public"
67
67
  },
68
- "gitHead": "5c5a9341478c1a70321e3095479993d4649709da"
68
+ "gitHead": "b55971e660354da35d280c9894c498c607c26594"
69
69
  }