kts-component-invoice-operate 3.2.12 → 3.2.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
@@ -18143,7 +18143,7 @@ function AddDiscountRowDrawer(props) {
18143
18143
  while (1) {
18144
18144
  switch (_context7.prev = _context7.next) {
18145
18145
  case 0:
18146
- if (value) {
18146
+ if (!isNaN(parseFloat(value))) {
18147
18147
  _context7.next = 2;
18148
18148
  break;
18149
18149
  }
@@ -18151,14 +18151,22 @@ function AddDiscountRowDrawer(props) {
18151
18151
  return _context7.abrupt("return");
18152
18152
 
18153
18153
  case 2:
18154
- if (!(value > totalAmount)) {
18154
+ if (!(value <= 0)) {
18155
18155
  _context7.next = 4;
18156
18156
  break;
18157
18157
  }
18158
18158
 
18159
- throw new Error('不可以大于商品金额');
18159
+ throw new Error('需大于0');
18160
18160
 
18161
18161
  case 4:
18162
+ if (!(value > totalAmount)) {
18163
+ _context7.next = 6;
18164
+ break;
18165
+ }
18166
+
18167
+ throw new Error('不可以大于商品金额');
18168
+
18169
+ case 6:
18162
18170
  case "end":
18163
18171
  return _context7.stop();
18164
18172
  }
@@ -18190,7 +18198,7 @@ function AddDiscountRowDrawer(props) {
18190
18198
  while (1) {
18191
18199
  switch (_context8.prev = _context8.next) {
18192
18200
  case 0:
18193
- if (value) {
18201
+ if (!isNaN(parseFloat(value))) {
18194
18202
  _context8.next = 2;
18195
18203
  break;
18196
18204
  }
@@ -18198,14 +18206,22 @@ function AddDiscountRowDrawer(props) {
18198
18206
  return _context8.abrupt("return");
18199
18207
 
18200
18208
  case 2:
18201
- if (!(value > 100)) {
18209
+ if (!(value <= 0)) {
18202
18210
  _context8.next = 4;
18203
18211
  break;
18204
18212
  }
18205
18213
 
18206
- throw new Error('不可以大于100');
18214
+ throw new Error('需大于0');
18207
18215
 
18208
18216
  case 4:
18217
+ if (!(value > 100)) {
18218
+ _context8.next = 6;
18219
+ break;
18220
+ }
18221
+
18222
+ throw new Error('不可以大于100');
18223
+
18224
+ case 6:
18209
18225
  case "end":
18210
18226
  return _context8.stop();
18211
18227
  }
package/dist/index.js CHANGED
@@ -18153,7 +18153,7 @@ function AddDiscountRowDrawer(props) {
18153
18153
  while (1) {
18154
18154
  switch (_context7.prev = _context7.next) {
18155
18155
  case 0:
18156
- if (value) {
18156
+ if (!isNaN(parseFloat(value))) {
18157
18157
  _context7.next = 2;
18158
18158
  break;
18159
18159
  }
@@ -18161,14 +18161,22 @@ function AddDiscountRowDrawer(props) {
18161
18161
  return _context7.abrupt("return");
18162
18162
 
18163
18163
  case 2:
18164
- if (!(value > totalAmount)) {
18164
+ if (!(value <= 0)) {
18165
18165
  _context7.next = 4;
18166
18166
  break;
18167
18167
  }
18168
18168
 
18169
- throw new Error('不可以大于商品金额');
18169
+ throw new Error('需大于0');
18170
18170
 
18171
18171
  case 4:
18172
+ if (!(value > totalAmount)) {
18173
+ _context7.next = 6;
18174
+ break;
18175
+ }
18176
+
18177
+ throw new Error('不可以大于商品金额');
18178
+
18179
+ case 6:
18172
18180
  case "end":
18173
18181
  return _context7.stop();
18174
18182
  }
@@ -18200,7 +18208,7 @@ function AddDiscountRowDrawer(props) {
18200
18208
  while (1) {
18201
18209
  switch (_context8.prev = _context8.next) {
18202
18210
  case 0:
18203
- if (value) {
18211
+ if (!isNaN(parseFloat(value))) {
18204
18212
  _context8.next = 2;
18205
18213
  break;
18206
18214
  }
@@ -18208,14 +18216,22 @@ function AddDiscountRowDrawer(props) {
18208
18216
  return _context8.abrupt("return");
18209
18217
 
18210
18218
  case 2:
18211
- if (!(value > 100)) {
18219
+ if (!(value <= 0)) {
18212
18220
  _context8.next = 4;
18213
18221
  break;
18214
18222
  }
18215
18223
 
18216
- throw new Error('不可以大于100');
18224
+ throw new Error('需大于0');
18217
18225
 
18218
18226
  case 4:
18227
+ if (!(value > 100)) {
18228
+ _context8.next = 6;
18229
+ break;
18230
+ }
18231
+
18232
+ throw new Error('不可以大于100');
18233
+
18234
+ case 6:
18219
18235
  case "end":
18220
18236
  return _context8.stop();
18221
18237
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kts-component-invoice-operate",
3
- "version": "3.2.12",
3
+ "version": "3.2.13",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -284,7 +284,8 @@ function AddDiscountRowDrawer(props: {
284
284
  { required: true, message: '必填' },
285
285
  {
286
286
  validator: async (_, value) => {
287
- if (!value) return;
287
+ if (isNaN(parseFloat(value))) return;
288
+ if (value <= 0) throw new Error('需大于0');
288
289
  if (value > totalAmount) throw new Error('不可以大于商品金额');
289
290
  }
290
291
  }
@@ -300,7 +301,8 @@ function AddDiscountRowDrawer(props: {
300
301
  { required: true, message: '必填' },
301
302
  {
302
303
  validator: async (_, value) => {
303
- if (!value) return;
304
+ if (isNaN(parseFloat(value))) return;
305
+ if (value <= 0) throw new Error('需大于0');
304
306
  if (value > 100) throw new Error('不可以大于100');
305
307
  }
306
308
  }