kts-component-invoice-operate 2.0.15 → 2.0.16

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
@@ -12690,57 +12690,6 @@ var getItemNameOther = function getItemNameOther(record, editGood) {
12690
12690
  return record.itemName;
12691
12691
  };
12692
12692
 
12693
- /**
12694
- * 判断一个字符串得字节长度
12695
- * @param str
12696
- * @returns
12697
- */
12698
- function bytesLnegth(str) {
12699
- var count = str.length;
12700
-
12701
- for (var i = 0; i < str.length; i++) {
12702
- if (str.charCodeAt(i) > 255) {
12703
- count++;
12704
- }
12705
- }
12706
-
12707
- return count;
12708
- }
12709
- /*
12710
- * param str 要截取的字符串
12711
- * param L 要截取的字节长度,注意是字节不是字符,一个汉字两个字节
12712
- * return 截取后的字符串
12713
- */
12714
-
12715
- function cutStr(str, L) {
12716
- var result = '',
12717
- strlen = str.length,
12718
- // 字符串长度
12719
- chrlen = str.replace(/[^\x00-\xff]/g, '**').length; // 字节长度
12720
-
12721
- if (chrlen <= L) {
12722
- return str;
12723
- }
12724
-
12725
- for (var i = 0, j = 0; i < strlen; i++) {
12726
- var chr = str.charAt(i);
12727
-
12728
- if (/[\x00-\xff]/.test(chr)) {
12729
- j++; // ascii码为0-255,一个字符就是一个字节的长度
12730
- } else {
12731
- j += 2; // ascii码为0-255以外,一个字符就是两个字节的长度
12732
- }
12733
-
12734
- if (j <= L) {
12735
- // 当加上当前字符以后,如果总字节长度小于等于L,则将当前字符真实的+在result后
12736
- result += chr;
12737
- } else {
12738
- // 反之则说明result已经是不拆分字符的情况下最接近L的值了,直接返回
12739
- return result;
12740
- }
12741
- }
12742
- }
12743
-
12744
12693
  var css_248z$b = ".kts-invoice-operate-goods-endow-code-button-list {\n display: flex;\n flex-direction: column;\n}\n.kts-invoice-operate-goods-endow-code-button-list > button {\n margin-bottom: 10px;\n}\n";
12745
12694
  styleInject(css_248z$b);
12746
12695
 
@@ -13276,43 +13225,31 @@ var DrawerBody$3 = function DrawerBody(props) {
13276
13225
 
13277
13226
  good.taxAmount = countTaxAmount(good.lineAmountIncludeTax || 0, s.goodsListState.deduction, values.taxRate);
13278
13227
  }); //截取名称
13228
+ // if (endowCodeGood.some(e => bytesLnegth(e?.itemName || '') > 92)) {
13229
+ // await (() => new Promise<void>(resolve => {
13230
+ // confirm({
13231
+ // title: '温馨提示',
13232
+ // content: '商品名称长度过长,是否截取名称',
13233
+ // okText: '确定',
13234
+ // cancelText: '取消',
13235
+ // onOk() {
13236
+ // endowCodeGood.forEach(e => {
13237
+ // if (e && e.itemName) { e.itemName = cutStr(e.itemName, 91) }
13238
+ // })
13239
+ // message.success('商品名称截取成功!')
13240
+ // resolve()
13241
+ // },
13242
+ // onCancel() {
13243
+ // resolve()
13244
+ // },
13245
+ // });
13246
+ // }))()
13247
+ // }
13279
13248
 
13280
- if (!endowCodeGood.some(function (e) {
13281
- return bytesLnegth((e === null || e === void 0 ? void 0 : e.itemName) || '') > 92;
13282
- })) {
13283
- _context11.next = 5;
13284
- break;
13285
- }
13286
-
13287
- _context11.next = 5;
13288
- return function () {
13289
- return new Promise(function (resolve) {
13290
- confirm({
13291
- title: '温馨提示',
13292
- content: '商品名称长度过长,是否截取名称',
13293
- okText: '确定',
13294
- cancelText: '取消',
13295
- onOk: function onOk() {
13296
- endowCodeGood.forEach(function (e) {
13297
- if (e && e.itemName) {
13298
- e.itemName = cutStr(e.itemName, 91);
13299
- }
13300
- });
13301
- message.success('商品名称截取成功!');
13302
- resolve();
13303
- },
13304
- onCancel: function onCancel() {
13305
- resolve();
13306
- }
13307
- });
13308
- });
13309
- }();
13310
-
13311
- case 5:
13312
13249
  s.goodsListState.goodsList = s.goodsListState.goodsList.slice();
13313
13250
  s.goodsListState.endowCode.endowcodeGoodIndex = [];
13314
13251
 
13315
- case 7:
13252
+ case 4:
13316
13253
  case "end":
13317
13254
  return _context11.stop();
13318
13255
  }
package/dist/index.js CHANGED
@@ -12700,57 +12700,6 @@ var getItemNameOther = function getItemNameOther(record, editGood) {
12700
12700
  return record.itemName;
12701
12701
  };
12702
12702
 
12703
- /**
12704
- * 判断一个字符串得字节长度
12705
- * @param str
12706
- * @returns
12707
- */
12708
- function bytesLnegth(str) {
12709
- var count = str.length;
12710
-
12711
- for (var i = 0; i < str.length; i++) {
12712
- if (str.charCodeAt(i) > 255) {
12713
- count++;
12714
- }
12715
- }
12716
-
12717
- return count;
12718
- }
12719
- /*
12720
- * param str 要截取的字符串
12721
- * param L 要截取的字节长度,注意是字节不是字符,一个汉字两个字节
12722
- * return 截取后的字符串
12723
- */
12724
-
12725
- function cutStr(str, L) {
12726
- var result = '',
12727
- strlen = str.length,
12728
- // 字符串长度
12729
- chrlen = str.replace(/[^\x00-\xff]/g, '**').length; // 字节长度
12730
-
12731
- if (chrlen <= L) {
12732
- return str;
12733
- }
12734
-
12735
- for (var i = 0, j = 0; i < strlen; i++) {
12736
- var chr = str.charAt(i);
12737
-
12738
- if (/[\x00-\xff]/.test(chr)) {
12739
- j++; // ascii码为0-255,一个字符就是一个字节的长度
12740
- } else {
12741
- j += 2; // ascii码为0-255以外,一个字符就是两个字节的长度
12742
- }
12743
-
12744
- if (j <= L) {
12745
- // 当加上当前字符以后,如果总字节长度小于等于L,则将当前字符真实的+在result后
12746
- result += chr;
12747
- } else {
12748
- // 反之则说明result已经是不拆分字符的情况下最接近L的值了,直接返回
12749
- return result;
12750
- }
12751
- }
12752
- }
12753
-
12754
12703
  var css_248z$b = ".kts-invoice-operate-goods-endow-code-button-list {\n display: flex;\n flex-direction: column;\n}\n.kts-invoice-operate-goods-endow-code-button-list > button {\n margin-bottom: 10px;\n}\n";
12755
12704
  styleInject(css_248z$b);
12756
12705
 
@@ -13286,43 +13235,31 @@ var DrawerBody$3 = function DrawerBody(props) {
13286
13235
 
13287
13236
  good.taxAmount = countTaxAmount(good.lineAmountIncludeTax || 0, s.goodsListState.deduction, values.taxRate);
13288
13237
  }); //截取名称
13238
+ // if (endowCodeGood.some(e => bytesLnegth(e?.itemName || '') > 92)) {
13239
+ // await (() => new Promise<void>(resolve => {
13240
+ // confirm({
13241
+ // title: '温馨提示',
13242
+ // content: '商品名称长度过长,是否截取名称',
13243
+ // okText: '确定',
13244
+ // cancelText: '取消',
13245
+ // onOk() {
13246
+ // endowCodeGood.forEach(e => {
13247
+ // if (e && e.itemName) { e.itemName = cutStr(e.itemName, 91) }
13248
+ // })
13249
+ // message.success('商品名称截取成功!')
13250
+ // resolve()
13251
+ // },
13252
+ // onCancel() {
13253
+ // resolve()
13254
+ // },
13255
+ // });
13256
+ // }))()
13257
+ // }
13289
13258
 
13290
- if (!endowCodeGood.some(function (e) {
13291
- return bytesLnegth((e === null || e === void 0 ? void 0 : e.itemName) || '') > 92;
13292
- })) {
13293
- _context11.next = 5;
13294
- break;
13295
- }
13296
-
13297
- _context11.next = 5;
13298
- return function () {
13299
- return new Promise(function (resolve) {
13300
- confirm({
13301
- title: '温馨提示',
13302
- content: '商品名称长度过长,是否截取名称',
13303
- okText: '确定',
13304
- cancelText: '取消',
13305
- onOk: function onOk() {
13306
- endowCodeGood.forEach(function (e) {
13307
- if (e && e.itemName) {
13308
- e.itemName = cutStr(e.itemName, 91);
13309
- }
13310
- });
13311
- ktsComponentsAntdX3.message.success('商品名称截取成功!');
13312
- resolve();
13313
- },
13314
- onCancel: function onCancel() {
13315
- resolve();
13316
- }
13317
- });
13318
- });
13319
- }();
13320
-
13321
- case 5:
13322
13259
  s.goodsListState.goodsList = s.goodsListState.goodsList.slice();
13323
13260
  s.goodsListState.endowCode.endowcodeGoodIndex = [];
13324
13261
 
13325
- case 7:
13262
+ case 4:
13326
13263
  case "end":
13327
13264
  return _context11.stop();
13328
13265
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kts-component-invoice-operate",
3
- "version": "2.0.15",
3
+ "version": "2.0.16",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -329,26 +329,26 @@ const DrawerBody = (props: { defaultValue: IGood }) => {
329
329
  });
330
330
 
331
331
  //截取名称
332
- if (endowCodeGood.some(e => bytesLnegth(e?.itemName || '') > 92)) {
333
- await (() => new Promise<void>(resolve => {
334
- confirm({
335
- title: '温馨提示',
336
- content: '商品名称长度过长,是否截取名称',
337
- okText: '确定',
338
- cancelText: '取消',
339
- onOk() {
340
- endowCodeGood.forEach(e => {
341
- if (e && e.itemName) { e.itemName = cutStr(e.itemName, 91) }
342
- })
343
- message.success('商品名称截取成功!')
344
- resolve()
345
- },
346
- onCancel() {
347
- resolve()
348
- },
349
- });
350
- }))()
351
- }
332
+ // if (endowCodeGood.some(e => bytesLnegth(e?.itemName || '') > 92)) {
333
+ // await (() => new Promise<void>(resolve => {
334
+ // confirm({
335
+ // title: '温馨提示',
336
+ // content: '商品名称长度过长,是否截取名称',
337
+ // okText: '确定',
338
+ // cancelText: '取消',
339
+ // onOk() {
340
+ // endowCodeGood.forEach(e => {
341
+ // if (e && e.itemName) { e.itemName = cutStr(e.itemName, 91) }
342
+ // })
343
+ // message.success('商品名称截取成功!')
344
+ // resolve()
345
+ // },
346
+ // onCancel() {
347
+ // resolve()
348
+ // },
349
+ // });
350
+ // }))()
351
+ // }
352
352
 
353
353
  s.goodsListState.goodsList = s.goodsListState.goodsList.slice();
354
354
  s.goodsListState.endowCode.endowcodeGoodIndex = [];