@indfnd/common 1.1.1 → 1.1.3

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/CHANGELOG.md CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [1.1.3](http://git.inspur.com/imp-ec/ind-front/ind-common-front/compare/v1.1.2...v1.1.3) (2025-09-04)
6
+
7
+
8
+ ### Features
9
+
10
+ * 增加percent的支持 ([ea15150](http://git.inspur.com/imp-ec/ind-front/ind-common-front/commit/ea1515017342832f5c9b852b6d59f0aae5f44350))
11
+
12
+ ### [1.1.2](http://git.inspur.com/imp-ec/ind-front/ind-common-front/compare/v1.1.1...v1.1.2) (2025-09-02)
13
+
5
14
  ### [1.1.1](http://git.inspur.com/imp-ec/ind-front/ind-common-front/compare/v1.1.0...v1.1.1) (2025-08-30)
6
15
 
7
16
 
@@ -5460,7 +5460,7 @@ var lodash = { exports: {} };
5460
5460
  })(lodash, lodash.exports);
5461
5461
  var _ = lodash.exports;
5462
5462
  const name$1 = "@indfnd/common";
5463
- const version = "1.1.0";
5463
+ const version = "1.1.2";
5464
5464
  const author = "huxuetong";
5465
5465
  const publishConfig = {
5466
5466
  registry: "https://registry.npmjs.org/"
@@ -43833,7 +43833,11 @@ function exportJsonToExcel(excelData) {
43833
43833
  const mergeEndCol = j + 1 + colSpan - 1;
43834
43834
  if (mergeEndRow < rowsNow + jsonData.length && mergeEndCol <= columnCount) {
43835
43835
  worksheet.mergeCells(rowsNow + i, j + 1, mergeEndRow, mergeEndCol);
43836
- if (columnType[j] === "s") {
43836
+ if (columnType[j] === "p" && lineData[j]) {
43837
+ const numericValue = typeof lineData[j].value === "string" ? parseFloat(lineData[j].value.replace(/,/g, "")) : lineData[j].value;
43838
+ worksheet.getCell(rowsNow + i, j + 1).value = isNaN(numericValue) ? 0 : parseFloat(numericValue / 100);
43839
+ worksheet.getCell(rowsNow + i, j + 1).numFmt = numberFormat[j];
43840
+ } else if (columnType[j] === "s") {
43837
43841
  if (lineData[j] === "0") {
43838
43842
  worksheet.getCell(rowsNow + i, j + 1).value = 0;
43839
43843
  } else if (lineData[j] !== void 0 && lineData[j] !== null) {
@@ -43842,11 +43846,11 @@ function exportJsonToExcel(excelData) {
43842
43846
  } else {
43843
43847
  worksheet.getCell(rowsNow + i, j + 1).value = "";
43844
43848
  }
43845
- dataCellStyle2.numFmt = "";
43849
+ worksheet.getCell(rowsNow + i, j + 1).numFmt = "";
43846
43850
  } else if (columnType[j] === "n" && lineData[j]) {
43847
43851
  const numericValue = typeof lineData[j].value === "string" ? parseFloat(lineData[j].value.replace(/,/g, "")) : lineData[j].value;
43848
43852
  worksheet.getCell(rowsNow + i, j + 1).value = isNaN(numericValue) ? 0 : numericValue;
43849
- dataCellStyle2.numFmt = numberFormat[j];
43853
+ worksheet.getCell(rowsNow + i, j + 1).numFmt = numberFormat[j];
43850
43854
  } else {
43851
43855
  worksheet.getCell(rowsNow + i, j + 1).value = "";
43852
43856
  }
@@ -43883,7 +43887,11 @@ function exportJsonToExcel(excelData) {
43883
43887
  }
43884
43888
  }
43885
43889
  if (!mergedCells.has(cellKey)) {
43886
- if (columnType[j] === "s") {
43890
+ if (columnType[j] === "p" && lineData[j]) {
43891
+ const numericValue = typeof lineData[j].value === "string" ? parseFloat(lineData[j].value.replace(/,/g, "")) : lineData[j].value;
43892
+ worksheet.getCell(rowsNow + i, j + 1).value = isNaN(numericValue) ? 0 : parseFloat(numericValue / 100);
43893
+ worksheet.getCell(rowsNow + i, j + 1).numFmt = numberFormat[j];
43894
+ } else if (columnType[j] === "s") {
43887
43895
  if (lineData[j] === "0") {
43888
43896
  worksheet.getCell(rowsNow + i, j + 1).value = 0;
43889
43897
  } else if (lineData[j] !== void 0 && lineData[j] !== null) {
@@ -43892,11 +43900,11 @@ function exportJsonToExcel(excelData) {
43892
43900
  } else {
43893
43901
  worksheet.getCell(rowsNow + i, j + 1).value = "";
43894
43902
  }
43895
- dataCellStyle2.numFmt = "";
43903
+ worksheet.getCell(rowsNow + i, j + 1).numFmt = "";
43896
43904
  } else if (columnType[j] === "n" && lineData[j]) {
43897
43905
  const numericValue = typeof lineData[j].value === "string" ? parseFloat(lineData[j].value.replace(/,/g, "")) : lineData[j].value;
43898
43906
  worksheet.getCell(rowsNow + i, j + 1).value = isNaN(numericValue) ? 0 : numericValue;
43899
- dataCellStyle2.numFmt = numberFormat[j];
43907
+ worksheet.getCell(rowsNow + i, j + 1).numFmt = numberFormat[j];
43900
43908
  } else {
43901
43909
  worksheet.getCell(rowsNow + i, j + 1).value = "";
43902
43910
  }
@@ -43915,7 +43923,9 @@ function exportJsonToExcel(excelData) {
43915
43923
  worksheet.getCell(rowsNow + i, j + 1).value = "#ERROR!";
43916
43924
  }
43917
43925
  }
43918
- worksheet.getCell(rowsNow + i, j + 1).border = dataCellStyle2.border;
43926
+ _.forEach(dataCellStyle2, (v, k) => {
43927
+ worksheet.getCell(rowsNow + i, j + 1)[k] = v;
43928
+ });
43919
43929
  }
43920
43930
  } catch (cellError) {
43921
43931
  console.error(`\u5904\u7406\u5355\u5143\u683C\u6570\u636E\u65F6\u51FA\u9519 (\u884C: ${i + 1}, \u5217: ${j + 1}):`, cellError);