ocpview-pro 0.1.12 → 0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ocpview-pro",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "title": "ocpviewPlus",
5
5
  "description": "A high quality Service UI components Library with Vue.js",
6
6
  "homepage": "",
@@ -739,6 +739,8 @@ export default {
739
739
  format,
740
740
  notzero
741
741
  );
742
+ // 修复 -0.00 显示问题
743
+ if (formatSumData === '-0.00' || formatSumData === '-0') return '0.00';
742
744
  return formatSumData;
743
745
  }
744
746
  return null;
@@ -432,11 +432,13 @@ export default {
432
432
  const notzero = columnConfig?.notzero;
433
433
  // 修复 -0 显示为 -0.00 的问题
434
434
  const rawValue = (serverValue === 0) ? 0 : serverValue;
435
- return this.$Method.formatNumber(
435
+ const result = this.$Method.formatNumber(
436
436
  rawValue,
437
437
  format,
438
438
  notzero
439
439
  );
440
+ if (result === '-0.00' || result === '-0') return '0.00';
441
+ return result;
440
442
  }
441
443
  // 服务端无合计时从当前页数据计算
442
444
  const sumData = this.handleSumField({
@@ -448,11 +450,14 @@ export default {
448
450
  );
449
451
  const format = columnConfig?.format;
450
452
  const notzero = columnConfig?.notzero;
451
- return this.$Method.formatNumber(
453
+ const result2 = this.$Method.formatNumber(
452
454
  sumData,
453
455
  format,
454
456
  notzero
455
457
  );
458
+ // 修复 -0.00 显示问题
459
+ if (result2 === '-0.00' || result2 === '-0') return '0.00';
460
+ return result2;
456
461
  }
457
462
  return null;
458
463
  }),
@@ -197,6 +197,8 @@ commom.formatNumber= function (value,style, notzero) {
197
197
  if (style.startsWith('p')) {
198
198
  result = result + '%';
199
199
  }
200
+ // 修复 -0.00 显示问题:Number("-0.0001").toFixed(2) = "-0.00"
201
+ if (Number(result) === 0) result = result.replace('-', '');
200
202
  return result;
201
203
  };
202
204