@indfnd/common 1.1.54 → 1.1.55
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 +8 -0
- package/dist/ind-common.es.js +228 -91
- package/dist/ind-common.umd.cjs +88 -88
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
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.55](http://git.inspur.com/imp-ec/ind-front/ind-common-front/compare/v1.1.54...v1.1.55) (2026-02-27)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* 增加zerovalueformatter ([b59b4d5](http://git.inspur.com/imp-ec/ind-front/ind-common-front/commit/b59b4d53d938edf24c67fe1294e23c71ff14e31b))
|
|
11
|
+
* 增加zerovalueformatter ([ec438f8](http://git.inspur.com/imp-ec/ind-front/ind-common-front/commit/ec438f830b1db7dd583169f65ec8da34eb6d1b15))
|
|
12
|
+
|
|
5
13
|
### [1.1.54](http://git.inspur.com/imp-ec/ind-front/ind-common-front/compare/v1.1.53...v1.1.54) (2026-02-27)
|
|
6
14
|
|
|
7
15
|
|
package/dist/ind-common.es.js
CHANGED
|
@@ -32,7 +32,7 @@ var lodash = { exports: {} };
|
|
|
32
32
|
(function(module2, exports2) {
|
|
33
33
|
(function() {
|
|
34
34
|
var undefined$1;
|
|
35
|
-
var VERSION2 = "4.17.
|
|
35
|
+
var VERSION2 = "4.17.23";
|
|
36
36
|
var LARGE_ARRAY_SIZE = 200;
|
|
37
37
|
var CORE_ERROR_TEXT = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", FUNC_ERROR_TEXT = "Expected a function", INVALID_TEMPL_VAR_ERROR_TEXT = "Invalid `variable` option passed into `_.template`";
|
|
38
38
|
var HASH_UNDEFINED = "__lodash_hash_undefined__";
|
|
@@ -1918,8 +1918,28 @@ var lodash = { exports: {} };
|
|
|
1918
1918
|
}
|
|
1919
1919
|
function baseUnset(object, path) {
|
|
1920
1920
|
path = castPath(path, object);
|
|
1921
|
-
|
|
1922
|
-
|
|
1921
|
+
var index2 = -1, length = path.length;
|
|
1922
|
+
if (!length) {
|
|
1923
|
+
return true;
|
|
1924
|
+
}
|
|
1925
|
+
var isRootPrimitive = object == null || typeof object !== "object" && typeof object !== "function";
|
|
1926
|
+
while (++index2 < length) {
|
|
1927
|
+
var key = path[index2];
|
|
1928
|
+
if (typeof key !== "string") {
|
|
1929
|
+
continue;
|
|
1930
|
+
}
|
|
1931
|
+
if (key === "__proto__" && !hasOwnProperty.call(object, "__proto__")) {
|
|
1932
|
+
return false;
|
|
1933
|
+
}
|
|
1934
|
+
if (key === "constructor" && index2 + 1 < length && typeof path[index2 + 1] === "string" && path[index2 + 1] === "prototype") {
|
|
1935
|
+
if (isRootPrimitive && index2 === 0) {
|
|
1936
|
+
continue;
|
|
1937
|
+
}
|
|
1938
|
+
return false;
|
|
1939
|
+
}
|
|
1940
|
+
}
|
|
1941
|
+
var obj = parent(object, path);
|
|
1942
|
+
return obj == null || delete obj[toKey(last(path))];
|
|
1923
1943
|
}
|
|
1924
1944
|
function baseUpdate(object, path, updater, customizer) {
|
|
1925
1945
|
return baseSet(object, path, updater(baseGet(object, path)), customizer);
|
|
@@ -5460,7 +5480,7 @@ var lodash = { exports: {} };
|
|
|
5460
5480
|
})(lodash, lodash.exports);
|
|
5461
5481
|
var _ = lodash.exports;
|
|
5462
5482
|
const name$1 = "@indfnd/common";
|
|
5463
|
-
const version = "1.1.
|
|
5483
|
+
const version = "1.1.54";
|
|
5464
5484
|
const author = "huxuetong";
|
|
5465
5485
|
const publishConfig = {
|
|
5466
5486
|
registry: "https://registry.npmjs.org/"
|
|
@@ -43396,15 +43416,21 @@ const titleHeight = 27;
|
|
|
43396
43416
|
const paramHeight = 18;
|
|
43397
43417
|
const columnTitleHeight = 18;
|
|
43398
43418
|
const dataRowHeight = 18;
|
|
43399
|
-
function getAgColumnTitleAndData({
|
|
43419
|
+
function getAgColumnTitleAndData({
|
|
43420
|
+
columns,
|
|
43421
|
+
datas,
|
|
43422
|
+
remainAdditionZero = false
|
|
43423
|
+
}) {
|
|
43424
|
+
console.log(
|
|
43425
|
+
"--getAgColumnTitleAndData: remainAdditionZero",
|
|
43426
|
+
remainAdditionZero
|
|
43427
|
+
);
|
|
43400
43428
|
var columnsClo = _.cloneDeep(columns);
|
|
43401
43429
|
var datasClo = _.cloneDeep(datas);
|
|
43402
|
-
console.log("columnsClo \u662F\u5565\u5440", columnsClo);
|
|
43403
43430
|
_.remove(columnsClo, (d) => {
|
|
43404
|
-
return d.cellClass.indexOf("button") != -1 || d.cellClass.indexOf("radio") != -1 || d.cellClass.indexOf("checkbox") != -1 || d.hide;
|
|
43431
|
+
return d.cellClass.indexOf("button") != -1 || d.cellClass.indexOf("radio") != -1 || d.cellClass.indexOf("checkbox") != -1 || d.cellClass.indexOf("chart") != -1 || d.hide;
|
|
43405
43432
|
});
|
|
43406
43433
|
_.forEach(columnsClo, (d) => {
|
|
43407
|
-
var _a;
|
|
43408
43434
|
if (d.cellClass.indexOf("index") != -1) {
|
|
43409
43435
|
d.field = "__seq";
|
|
43410
43436
|
datasClo.forEach((dd, idx) => {
|
|
@@ -43412,32 +43438,28 @@ function getAgColumnTitleAndData({ columns, datas }) {
|
|
|
43412
43438
|
});
|
|
43413
43439
|
} else if (d.cellClass.indexOf("enum") != -1) {
|
|
43414
43440
|
datasClo.forEach((dd) => {
|
|
43415
|
-
|
|
43416
|
-
let
|
|
43417
|
-
let enumData = ((_b = d == null ? void 0 : d.cellRendererParams) == null ? void 0 : _b.enumData) || {};
|
|
43441
|
+
let enumList = d && d.cellRendererParams && d.cellRendererParams.enumList || [];
|
|
43442
|
+
let enumData = d && d.cellRendererParams && d.cellRendererParams.enumData || {};
|
|
43418
43443
|
if (enumList.length) {
|
|
43419
|
-
let v = (
|
|
43444
|
+
let v = (_.find(enumList, { K: dd[d.field] }) || {}).V || dd[d.field];
|
|
43420
43445
|
dd[d.field] = v;
|
|
43421
43446
|
} else {
|
|
43422
43447
|
dd[d.field] = enumData[dd[d.field]] || dd[d.field];
|
|
43423
43448
|
}
|
|
43424
43449
|
});
|
|
43425
|
-
} else if (
|
|
43450
|
+
} else if (d && d.cellRendererParams && d.cellRendererParams.dateFormat) {
|
|
43426
43451
|
datasClo.forEach((dd) => {
|
|
43427
43452
|
dd[d.field] = formatDate$1(dd[d.field]) || "";
|
|
43428
43453
|
});
|
|
43429
|
-
} else if (d.
|
|
43430
|
-
|
|
43454
|
+
} else if (d && typeof d.valueGetter === "function") {
|
|
43455
|
+
datasClo.forEach((dd) => {
|
|
43431
43456
|
try {
|
|
43432
|
-
|
|
43433
|
-
|
|
43434
|
-
});
|
|
43435
|
-
|
|
43436
|
-
console.error(error);
|
|
43457
|
+
dd[d.field] = d.valueGetter({ data: dd });
|
|
43458
|
+
} catch (e) {
|
|
43459
|
+
console.warn(`\u6267\u884C valueGetter \u51FD\u6570\u65F6\u51FA\u9519\uFF0C\u5B57\u6BB5: ${d.field}`, e);
|
|
43460
|
+
dd[d.field] = "";
|
|
43437
43461
|
}
|
|
43438
|
-
}
|
|
43439
|
-
throw new Error("\u65F6\u95F4\u7C7B\u578B\u4E0D\u6B63\u786E\uFF0C\u5E94\u8BE5\u4E3A\u51FD\u6570\u7C7B\u578B");
|
|
43440
|
-
}
|
|
43462
|
+
});
|
|
43441
43463
|
}
|
|
43442
43464
|
});
|
|
43443
43465
|
const getDeepthOfCol = (col) => {
|
|
@@ -43527,37 +43549,40 @@ function getAgColumnTitleAndData({ columns, datas }) {
|
|
|
43527
43549
|
calcColumns(columnsClo, columnsCalc);
|
|
43528
43550
|
var columnAlign = columnsCalc.map((d) => d.align || "left");
|
|
43529
43551
|
var columnType = columnsCalc.map(
|
|
43530
|
-
(d) => d.
|
|
43552
|
+
(d) => d.align == "right" || d.align == "rightNum" ? "n" : "s"
|
|
43531
43553
|
);
|
|
43532
43554
|
var columnWidth = columnsCalc.map(
|
|
43533
43555
|
(d) => d.excelWidth ? d.excelWidth : d.width ? Math.floor(d.width / 10) : 10
|
|
43534
43556
|
);
|
|
43535
43557
|
var numberFormat = columnsCalc.map((d) => {
|
|
43536
|
-
|
|
43537
|
-
|
|
43538
|
-
|
|
43539
|
-
|
|
43540
|
-
|
|
43541
|
-
|
|
43558
|
+
let scale = d && d.cellRendererParams && d.cellRendererParams.scale;
|
|
43559
|
+
if (scale !== void 0) {
|
|
43560
|
+
if (remainAdditionZero) {
|
|
43561
|
+
return scale === 0 ? "#,##0" : "#,##0." + _.range(scale).fill("0").join("");
|
|
43562
|
+
} else {
|
|
43563
|
+
return scale === 0 ? "#,##0" : "#,##0." + _.range(scale).fill("#").join("");
|
|
43564
|
+
}
|
|
43542
43565
|
} else {
|
|
43543
43566
|
return d.align == "rightNum" ? "#,##0.0000" : d.align == "right" ? "#,##0.00" : "";
|
|
43544
43567
|
}
|
|
43545
43568
|
});
|
|
43546
43569
|
columnsCalc.map((d, idx) => {
|
|
43547
43570
|
d.field = d.field ? d.field : d.key;
|
|
43571
|
+
let charSize = d.align == "right" || d.align == "rightNum" ? 0.5 : 2;
|
|
43548
43572
|
var t2 = d.excelName || d.headerName || d.title;
|
|
43549
|
-
t2 = t2
|
|
43550
|
-
if (t2 && columnWidth[idx] < t2.length *
|
|
43551
|
-
columnWidth[idx] = t2.length *
|
|
43573
|
+
t2 = t2 && t2.replace(/<br\/>/g, "");
|
|
43574
|
+
if (t2 && columnWidth[idx] < t2.length * charSize) {
|
|
43575
|
+
columnWidth[idx] = t2.length * charSize;
|
|
43552
43576
|
}
|
|
43553
43577
|
});
|
|
43554
43578
|
var exportData = datasClo.map((d) => {
|
|
43555
43579
|
return columnsCalc.map((dd, idx) => {
|
|
43580
|
+
let charSize = dd.align == "right" || dd.align == "rightNum" ? 0.5 : 2;
|
|
43556
43581
|
if (dd.columnWidth !== void 0) {
|
|
43557
43582
|
columnWidth[idx] = dd.columnWidth;
|
|
43558
43583
|
} else {
|
|
43559
|
-
if (d[dd.field] && columnWidth[idx] < ("" + d[dd.field]).length *
|
|
43560
|
-
columnWidth[idx] = ("" + d[dd.field]).length *
|
|
43584
|
+
if (d[dd.field] && columnWidth[idx] < ("" + d[dd.field]).length * charSize) {
|
|
43585
|
+
columnWidth[idx] = ("" + d[dd.field]).length * charSize;
|
|
43561
43586
|
}
|
|
43562
43587
|
}
|
|
43563
43588
|
let formula = null;
|
|
@@ -43590,6 +43615,10 @@ function initRowSpanInfos(options) {
|
|
|
43590
43615
|
if (!!options.rowSpanColumns) {
|
|
43591
43616
|
let calcRowSpan = function(colId, followCol) {
|
|
43592
43617
|
var colIdx = _.findIndex(options.columns, { field: colId });
|
|
43618
|
+
if (colIdx == -1) {
|
|
43619
|
+
console.log("\u8BA1\u7B97\u4E00\u4E2A\u4E0D\u5B58\u5728\u7684\u5217\u662F\u6CA1\u6709\u524D\u9014\u7684", colId);
|
|
43620
|
+
return;
|
|
43621
|
+
}
|
|
43593
43622
|
if (!!rowSpanRlt[colId]) {
|
|
43594
43623
|
return;
|
|
43595
43624
|
}
|
|
@@ -43719,7 +43748,10 @@ function initRowSpanInfosNew(options) {
|
|
|
43719
43748
|
var rowSpanRlt = {};
|
|
43720
43749
|
var rowTmpMappingByColId = {};
|
|
43721
43750
|
_.forEach(rowSpanDefs, function(col) {
|
|
43722
|
-
calcRowSpan(
|
|
43751
|
+
calcRowSpan(
|
|
43752
|
+
col.field,
|
|
43753
|
+
col.field !== col.followCol ? col.followCol : null
|
|
43754
|
+
);
|
|
43723
43755
|
});
|
|
43724
43756
|
}
|
|
43725
43757
|
}
|
|
@@ -43740,8 +43772,9 @@ function exportJsonToExcel(excelData, isPerMille) {
|
|
|
43740
43772
|
var paramRight = excelData.paramRight;
|
|
43741
43773
|
var jsonData = calcExportDatas.exportData;
|
|
43742
43774
|
var numberFormat = excelData.numberFormat || calcExportDatas.numberFormat;
|
|
43775
|
+
var remainAdditionZero = (excelData == null ? void 0 : excelData.remainAdditionZero) || false;
|
|
43743
43776
|
const workbook = new ExcelJS.Workbook();
|
|
43744
|
-
const worksheet = workbook.addWorksheet("Sheet1");
|
|
43777
|
+
const worksheet = excelData.worksheet || workbook.addWorksheet("Sheet1");
|
|
43745
43778
|
for (var i = 0; i < columnCount; i++) {
|
|
43746
43779
|
worksheet.getColumn(i + 1).width = columnWidth[i] == 0 ? 10 : columnWidth[i];
|
|
43747
43780
|
}
|
|
@@ -43812,7 +43845,14 @@ function exportJsonToExcel(excelData, isPerMille) {
|
|
|
43812
43845
|
const cell = worksheet.getCell(srow, scol);
|
|
43813
43846
|
cell.value = d.text && d.text.replace(/<br\/>/g, "");
|
|
43814
43847
|
cell.style = columnTitleStyle2;
|
|
43815
|
-
applyBorderToMergedCell(
|
|
43848
|
+
applyBorderToMergedCell(
|
|
43849
|
+
worksheet,
|
|
43850
|
+
srow,
|
|
43851
|
+
scol,
|
|
43852
|
+
erow,
|
|
43853
|
+
ecol,
|
|
43854
|
+
columnTitleStyle2.border
|
|
43855
|
+
);
|
|
43816
43856
|
});
|
|
43817
43857
|
for (let i2 = 0; i2 < titleDeepth; i2++) {
|
|
43818
43858
|
worksheet.getRow(rowsNow + i2).height = columnTitleHeight2;
|
|
@@ -43832,32 +43872,41 @@ function exportJsonToExcel(excelData, isPerMille) {
|
|
|
43832
43872
|
const mergeEndRow = rowsNow + i + rowSpan - 1;
|
|
43833
43873
|
const mergeEndCol = j + 1 + colSpan - 1;
|
|
43834
43874
|
if (mergeEndRow < rowsNow + jsonData.length && mergeEndCol <= columnCount) {
|
|
43835
|
-
worksheet.mergeCells(
|
|
43836
|
-
|
|
43837
|
-
|
|
43838
|
-
|
|
43839
|
-
|
|
43840
|
-
|
|
43841
|
-
|
|
43842
|
-
|
|
43843
|
-
|
|
43875
|
+
worksheet.mergeCells(
|
|
43876
|
+
rowsNow + i,
|
|
43877
|
+
j + 1,
|
|
43878
|
+
mergeEndRow,
|
|
43879
|
+
mergeEndCol
|
|
43880
|
+
);
|
|
43881
|
+
if (columnType[j] === "s") {
|
|
43882
|
+
if (lineData[j].value === "0") {
|
|
43883
|
+
worksheet.getCell(rowsNow + i, j + 1).value = excelData.zeroValueFormat === void 0 ? 0 : excelData.zeroValueFormat;
|
|
43884
|
+
} else if (lineData[j].value !== void 0 && lineData[j].value !== null) {
|
|
43844
43885
|
const safeValue = typeof lineData[j].value === "string" ? lineData[j].value.replace(/[\u2028\u2029]/g, " ") : lineData[j].value;
|
|
43845
43886
|
worksheet.getCell(rowsNow + i, j + 1).value = safeValue;
|
|
43846
43887
|
} else {
|
|
43847
43888
|
worksheet.getCell(rowsNow + i, j + 1).value = "";
|
|
43848
43889
|
}
|
|
43849
|
-
|
|
43850
|
-
} else if (columnType[j] === "n" && lineData[j]) {
|
|
43890
|
+
dataCellStyle2.numFmt = "";
|
|
43891
|
+
} else if (columnType[j] === "n" && lineData[j].value) {
|
|
43851
43892
|
const numericValue = typeof lineData[j].value === "string" ? parseFloat(lineData[j].value.replace(/,/g, "")) : lineData[j].value;
|
|
43852
|
-
|
|
43853
|
-
|
|
43893
|
+
if (numericValue === 0) {
|
|
43894
|
+
worksheet.getCell(rowsNow + i, j + 1).value = excelData.zeroValueFormat === void 0 ? "0" : excelData.zeroValueFormat;
|
|
43895
|
+
} else {
|
|
43896
|
+
worksheet.getCell(rowsNow + i, j + 1).value = isNaN(
|
|
43897
|
+
numericValue
|
|
43898
|
+
) ? excelData.zeroValueFormat === void 0 ? 0 : excelData.zeroValueFormat : numericValue;
|
|
43899
|
+
}
|
|
43900
|
+
dataCellStyle2.numFmt = numberFormat[j];
|
|
43854
43901
|
} else {
|
|
43855
43902
|
worksheet.getCell(rowsNow + i, j + 1).value = "";
|
|
43856
43903
|
}
|
|
43857
43904
|
if (lineData[j] && lineData[j].formula) {
|
|
43858
43905
|
try {
|
|
43859
|
-
if (
|
|
43860
|
-
worksheet.getCell(rowsNow + i, j + 1).value = {
|
|
43906
|
+
if (/^=?[A-Za-z]+\(.*\)$/.test(lineData[j].formula)) {
|
|
43907
|
+
worksheet.getCell(rowsNow + i, j + 1).value = {
|
|
43908
|
+
formula: lineData[j].formula
|
|
43909
|
+
};
|
|
43861
43910
|
} else {
|
|
43862
43911
|
console.warn(
|
|
43863
43912
|
`\u65E0\u6548\u516C\u5F0F: ${lineData[j].formula}\uFF0C\u4F4D\u4E8E\u7B2C ${i + 1} \u884C\uFF0C\u7B2C ${j + 1} \u5217`
|
|
@@ -43865,12 +43914,18 @@ function exportJsonToExcel(excelData, isPerMille) {
|
|
|
43865
43914
|
worksheet.getCell(rowsNow + i, j + 1).value = "#FORMULA_ERROR";
|
|
43866
43915
|
}
|
|
43867
43916
|
} catch (e) {
|
|
43868
|
-
console.error(
|
|
43917
|
+
console.error(
|
|
43918
|
+
`\u8BBE\u7F6E\u516C\u5F0F\u65F6\u51FA\u9519: ${e.message}\uFF0C\u516C\u5F0F\u5185\u5BB9: ${lineData[j].formula}`
|
|
43919
|
+
);
|
|
43869
43920
|
worksheet.getCell(rowsNow + i, j + 1).value = "#ERROR!";
|
|
43870
43921
|
}
|
|
43871
43922
|
}
|
|
43872
43923
|
dataCellStyle2.alignment.horizontal = columnAlign[j];
|
|
43873
|
-
|
|
43924
|
+
if (remainAdditionZero) {
|
|
43925
|
+
worksheet.getCell(rowsNow + i, j + 1).style = _.cloneDeep(dataCellStyle2);
|
|
43926
|
+
} else {
|
|
43927
|
+
worksheet.getCell(rowsNow + i, j + 1).style = dataCellStyle2;
|
|
43928
|
+
}
|
|
43874
43929
|
for (let r = 0; r < rowSpan; r++) {
|
|
43875
43930
|
for (let c = 0; c < colSpan; c++) {
|
|
43876
43931
|
mergedCells.add(`${rowsNow + i + r}-${j + 1 + c}`);
|
|
@@ -43887,21 +43942,17 @@ function exportJsonToExcel(excelData, isPerMille) {
|
|
|
43887
43942
|
}
|
|
43888
43943
|
}
|
|
43889
43944
|
if (!mergedCells.has(cellKey)) {
|
|
43890
|
-
if (columnType[j] === "
|
|
43891
|
-
|
|
43892
|
-
|
|
43893
|
-
|
|
43894
|
-
} else if (columnType[j] === "s") {
|
|
43895
|
-
if (lineData[j] === "0") {
|
|
43896
|
-
worksheet.getCell(rowsNow + i, j + 1).value = 0;
|
|
43897
|
-
} else if (lineData[j] !== void 0 && lineData[j] !== null) {
|
|
43945
|
+
if (columnType[j] === "s") {
|
|
43946
|
+
if (lineData[j].value === "0") {
|
|
43947
|
+
worksheet.getCell(rowsNow + i, j + 1).value = excelData.zeroValueFormat === void 0 ? 0 : excelData.zeroValueFormat;
|
|
43948
|
+
} else if (lineData[j] !== void 0 && lineData[j].value !== null) {
|
|
43898
43949
|
const safeValue = typeof lineData[j].value === "string" ? lineData[j].value.replace(/[\u2028\u2029]/g, " ") : lineData[j].value;
|
|
43899
43950
|
worksheet.getCell(rowsNow + i, j + 1).value = safeValue;
|
|
43900
43951
|
} else {
|
|
43901
43952
|
worksheet.getCell(rowsNow + i, j + 1).value = "";
|
|
43902
43953
|
}
|
|
43903
|
-
|
|
43904
|
-
} else if (columnType[j] === "n" && lineData[j]) {
|
|
43954
|
+
dataCellStyle2.numFmt = "";
|
|
43955
|
+
} else if (columnType[j] === "n" && lineData[j].value) {
|
|
43905
43956
|
const numericValue = typeof lineData[j].value === "string" ? parseFloat(lineData[j].value.replace(/,/g, "")) : lineData[j].value;
|
|
43906
43957
|
worksheet.getCell(rowsNow + i, j + 1).value = isNaN(numericValue) ? 0 : numericValue;
|
|
43907
43958
|
if (isPerMille) {
|
|
@@ -43914,8 +43965,10 @@ function exportJsonToExcel(excelData, isPerMille) {
|
|
|
43914
43965
|
}
|
|
43915
43966
|
if (lineData[j] && lineData[j].formula) {
|
|
43916
43967
|
try {
|
|
43917
|
-
if (
|
|
43918
|
-
worksheet.getCell(rowsNow + i, j + 1).value = {
|
|
43968
|
+
if (/^=?[A-Za-z]+\(.*\)$/.test(lineData[j].formula)) {
|
|
43969
|
+
worksheet.getCell(rowsNow + i, j + 1).value = {
|
|
43970
|
+
formula: lineData[j].formula
|
|
43971
|
+
};
|
|
43919
43972
|
} else {
|
|
43920
43973
|
console.warn(
|
|
43921
43974
|
`\u65E0\u6548\u516C\u5F0F: ${lineData[j].formula}\uFF0C\u4F4D\u4E8E\u7B2C ${i + 1} \u884C\uFF0C\u7B2C ${j + 1} \u5217`
|
|
@@ -43923,7 +43976,9 @@ function exportJsonToExcel(excelData, isPerMille) {
|
|
|
43923
43976
|
worksheet.getCell(rowsNow + i, j + 1).value = "#FORMULA_ERROR";
|
|
43924
43977
|
}
|
|
43925
43978
|
} catch (e) {
|
|
43926
|
-
console.error(
|
|
43979
|
+
console.error(
|
|
43980
|
+
`\u8BBE\u7F6E\u516C\u5F0F\u65F6\u51FA\u9519: ${e.message}\uFF0C\u516C\u5F0F\u5185\u5BB9: ${lineData[j].formula}`
|
|
43981
|
+
);
|
|
43927
43982
|
worksheet.getCell(rowsNow + i, j + 1).value = "#ERROR!";
|
|
43928
43983
|
}
|
|
43929
43984
|
}
|
|
@@ -43932,7 +43987,10 @@ function exportJsonToExcel(excelData, isPerMille) {
|
|
|
43932
43987
|
});
|
|
43933
43988
|
}
|
|
43934
43989
|
} catch (cellError) {
|
|
43935
|
-
console.error(
|
|
43990
|
+
console.error(
|
|
43991
|
+
`\u5904\u7406\u5355\u5143\u683C\u6570\u636E\u65F6\u51FA\u9519 (\u884C: ${i + 1}, \u5217: ${j + 1}):`,
|
|
43992
|
+
cellError
|
|
43993
|
+
);
|
|
43936
43994
|
worksheet.getCell(rowsNow + i, j + 1).value = "#CELL_ERROR";
|
|
43937
43995
|
}
|
|
43938
43996
|
}
|
|
@@ -43949,30 +44007,54 @@ function exportJsonToExcel(excelData, isPerMille) {
|
|
|
43949
44007
|
}
|
|
43950
44008
|
if (!!excelData.rowSpanDefs) {
|
|
43951
44009
|
try {
|
|
43952
|
-
initRowSpanInfosNew({
|
|
44010
|
+
initRowSpanInfosNew({
|
|
44011
|
+
...excelData,
|
|
44012
|
+
columns: calcExportDatas.columnsCalc
|
|
44013
|
+
});
|
|
43953
44014
|
_.forEach(rowSpanExcelInfos, function(rowSpanInfo) {
|
|
43954
44015
|
const srow = rowSpanInfo.mergeRowS + rowsNow;
|
|
43955
44016
|
const scol = rowSpanInfo.megerColS + 1;
|
|
43956
44017
|
const erow = rowSpanInfo.mergeRowE + rowsNow;
|
|
43957
44018
|
const ecol = rowSpanInfo.megerColE + 1;
|
|
43958
44019
|
worksheet.mergeCells(srow, scol, erow, ecol);
|
|
43959
|
-
applyBorderToMergedCell(
|
|
44020
|
+
applyBorderToMergedCell(
|
|
44021
|
+
worksheet,
|
|
44022
|
+
srow,
|
|
44023
|
+
scol,
|
|
44024
|
+
erow,
|
|
44025
|
+
ecol,
|
|
44026
|
+
dataCellStyle2.border
|
|
44027
|
+
);
|
|
43960
44028
|
});
|
|
44029
|
+
rowSpanExcelInfos = [];
|
|
43961
44030
|
} catch (spanError) {
|
|
44031
|
+
rowSpanExcelInfos = [];
|
|
43962
44032
|
console.error("\u5408\u5E76\u5355\u5143\u683C\u65F6\u51FA\u9519:", spanError);
|
|
43963
44033
|
}
|
|
43964
44034
|
} else if (!!excelData.rowSpanColumns) {
|
|
43965
44035
|
try {
|
|
43966
|
-
initRowSpanInfos({
|
|
44036
|
+
initRowSpanInfos({
|
|
44037
|
+
...excelData,
|
|
44038
|
+
columns: calcExportDatas.columnsCalc
|
|
44039
|
+
});
|
|
43967
44040
|
_.forEach(rowSpanExcelInfos, function(rowSpanInfo) {
|
|
43968
44041
|
const srow = rowSpanInfo.mergeRowS + rowsNow;
|
|
43969
44042
|
const scol = rowSpanInfo.megerColS + 1;
|
|
43970
44043
|
const erow = rowSpanInfo.mergeRowE + rowsNow;
|
|
43971
44044
|
const ecol = rowSpanInfo.megerColE + 1;
|
|
43972
44045
|
worksheet.mergeCells(srow, scol, erow, ecol);
|
|
43973
|
-
applyBorderToMergedCell(
|
|
44046
|
+
applyBorderToMergedCell(
|
|
44047
|
+
worksheet,
|
|
44048
|
+
srow,
|
|
44049
|
+
scol,
|
|
44050
|
+
erow,
|
|
44051
|
+
ecol,
|
|
44052
|
+
dataCellStyle2.border
|
|
44053
|
+
);
|
|
43974
44054
|
});
|
|
44055
|
+
rowSpanExcelInfos = [];
|
|
43975
44056
|
} catch (spanError) {
|
|
44057
|
+
rowSpanExcelInfos = [];
|
|
43976
44058
|
console.error("\u5408\u5E76\u5355\u5143\u683C\u65F6\u51FA\u9519:", spanError);
|
|
43977
44059
|
}
|
|
43978
44060
|
}
|
|
@@ -43995,18 +44077,9 @@ function exportJsonToExcel(excelData, isPerMille) {
|
|
|
43995
44077
|
extension: "png"
|
|
43996
44078
|
});
|
|
43997
44079
|
worksheet.addBackgroundImage(imageId);
|
|
43998
|
-
|
|
43999
|
-
|
|
44000
|
-
|
|
44001
|
-
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
44002
|
-
}),
|
|
44003
|
-
sanitizeFilename(title) + ".xlsx"
|
|
44004
|
-
);
|
|
44005
|
-
return true;
|
|
44006
|
-
}).catch((err) => {
|
|
44007
|
-
console.error("\u5199\u5165Excel\u6587\u4EF6\u65F6\u51FA\u9519:", err);
|
|
44008
|
-
throw new Error("\u5BFC\u51FAExcel\u5931\u8D25: " + err.message);
|
|
44009
|
-
});
|
|
44080
|
+
if (!excelData.worksheet) {
|
|
44081
|
+
return doExportExcel(workbook, title);
|
|
44082
|
+
}
|
|
44010
44083
|
});
|
|
44011
44084
|
} catch (error) {
|
|
44012
44085
|
console.error("\u5BFC\u51FAExcel\u8FC7\u7A0B\u4E2D\u53D1\u751F\u610F\u5916\u9519\u8BEF:", error);
|
|
@@ -44195,6 +44268,20 @@ function previewJsonToExcel(excelData) {
|
|
|
44195
44268
|
});
|
|
44196
44269
|
});
|
|
44197
44270
|
}
|
|
44271
|
+
function doExportExcel(workbook, title = "\u4E0B\u8F7D\u62A5\u8868") {
|
|
44272
|
+
workbook.xlsx.writeBuffer().then((buffer) => {
|
|
44273
|
+
FileSaver_min.exports.saveAs(
|
|
44274
|
+
new Blob([buffer], {
|
|
44275
|
+
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
44276
|
+
}),
|
|
44277
|
+
sanitizeFilename(title) + ".xlsx"
|
|
44278
|
+
);
|
|
44279
|
+
return true;
|
|
44280
|
+
}).catch((err) => {
|
|
44281
|
+
console.error("\u5199\u5165Excel\u6587\u4EF6\u65F6\u51FA\u9519:", err);
|
|
44282
|
+
throw new Error("\u5BFC\u51FAExcel\u5931\u8D25: " + err.message);
|
|
44283
|
+
});
|
|
44284
|
+
}
|
|
44198
44285
|
const isDev = false;
|
|
44199
44286
|
var config = useConfig(isDev);
|
|
44200
44287
|
_.isObject;
|
|
@@ -53244,7 +53331,7 @@ var render$14 = function() {
|
|
|
53244
53331
|
return _vm.$emit("revertColumnRow");
|
|
53245
53332
|
} } }, [_vm._v(" \u8F6C\u7F6E ")]) : _vm._e(), !_vm.isIndexManageTable && _vm.$config.indexManage ? _c("IndexManage", { attrs: { "tableRef": _vm.tableRef, "funId": (_vm.funId || "") + "-" + _vm.$route.meta.permissionId }, on: { "resetColumns": _vm.resetColumns } }) : _vm._e(), _c("IndButton", { attrs: { "bizType": "reset" }, on: { "click": function($event) {
|
|
53246
53333
|
return _vm.tableSettingToggle("3");
|
|
53247
|
-
} } }, [_vm._v(" \u5BFC\u51FA ")])], 1), _c("DropdownMenu", { style: { width: _vm.btnSel != "1" ? "400px" : "200px", padding: "5px 10px" }, attrs: { "slot": "list" }, slot: "list" }, [_c("ExportData", { directives: [{ name: "show", rawName: "v-show", value: _vm.btnSel == "3", expression: "btnSel == '3'" }], ref: "exportData", attrs: { "rowSpanDefs": _vm.rowSpanDefs, "exportFileName": _vm.exportFileName, "paramLeft": _vm.paramLeft, "paramRight": _vm.paramRight || _vm.paramRightUnit, "rowSpanColumns": _vm.rowSpanColumns || _vm.mergeColumns, "rowSpanIndexCol": _vm.rowSpanIndexCol || _vm.mergeIndexCol, "pinnedTopRowData": _vm.topRows, "tableColumns": _vm.tableColumns, "data": _vm.tableData, "dataApi": _vm.dataApi, "renderDataFn": _vm.renderDataFn, "searchParams": _vm.searchParams, "sortParams": _vm.sortParams, "paginationParams": _vm.paginationParams, "show-summary": _vm.tableShowSummary, "summary-method": _vm.tableSummaryMethod, "parsedColumns": _vm.parsedColumns, "exportEnum": _vm.exportEnum, "data-children": _vm.dataChildren, "defaultUnitType": _vm.defaultUnitType, "unitType": _vm.unitType, "switchCols": _vm.switchCols, "watermark": _vm.watermark, "disablePage": _vm.disablePage, "isPerMille": _vm.isPerMille }, on: { "doExport": function($event) {
|
|
53334
|
+
} } }, [_vm._v(" \u5BFC\u51FA ")])], 1), _c("DropdownMenu", { style: { width: _vm.btnSel != "1" ? "400px" : "200px", padding: "5px 10px" }, attrs: { "slot": "list" }, slot: "list" }, [_c("ExportData", { directives: [{ name: "show", rawName: "v-show", value: _vm.btnSel == "3", expression: "btnSel == '3'" }], ref: "exportData", attrs: { "rowSpanDefs": _vm.rowSpanDefs, "exportFileName": _vm.exportFileName, "zeroValueFormat": _vm.zeroValueFormat, "paramLeft": _vm.paramLeft, "paramRight": _vm.paramRight || _vm.paramRightUnit, "rowSpanColumns": _vm.rowSpanColumns || _vm.mergeColumns, "rowSpanIndexCol": _vm.rowSpanIndexCol || _vm.mergeIndexCol, "pinnedTopRowData": _vm.topRows, "tableColumns": _vm.tableColumns, "data": _vm.tableData, "dataApi": _vm.dataApi, "renderDataFn": _vm.renderDataFn, "searchParams": _vm.searchParams, "sortParams": _vm.sortParams, "paginationParams": _vm.paginationParams, "show-summary": _vm.tableShowSummary, "summary-method": _vm.tableSummaryMethod, "parsedColumns": _vm.parsedColumns, "exportEnum": _vm.exportEnum, "data-children": _vm.dataChildren, "defaultUnitType": _vm.defaultUnitType, "unitType": _vm.unitType, "switchCols": _vm.switchCols, "watermark": _vm.watermark, "disablePage": _vm.disablePage, "isPerMille": _vm.isPerMille }, on: { "doExport": function($event) {
|
|
53248
53335
|
_vm.optionDropdownVisible = false;
|
|
53249
53336
|
}, "doPreview": function($event) {
|
|
53250
53337
|
_vm.optionDropdownVisible = false;
|
|
@@ -53537,7 +53624,36 @@ const __vue2_script$15 = {
|
|
|
53537
53624
|
default: "Y"
|
|
53538
53625
|
},
|
|
53539
53626
|
noRowsTemplate: String,
|
|
53540
|
-
watermark: String
|
|
53627
|
+
watermark: String,
|
|
53628
|
+
nullValueFormat: {
|
|
53629
|
+
type: String,
|
|
53630
|
+
default() {
|
|
53631
|
+
var _a;
|
|
53632
|
+
return ((_a = this.$config) == null ? void 0 : _a.nullValueFormat) || "";
|
|
53633
|
+
}
|
|
53634
|
+
},
|
|
53635
|
+
zeroValueFormat: {
|
|
53636
|
+
type: String,
|
|
53637
|
+
default() {
|
|
53638
|
+
var _a;
|
|
53639
|
+
const configValue = (_a = this.$config) == null ? void 0 : _a.zeroValueFormat;
|
|
53640
|
+
return configValue !== void 0 && configValue !== null ? configValue : "0";
|
|
53641
|
+
}
|
|
53642
|
+
},
|
|
53643
|
+
limitNumber: {
|
|
53644
|
+
type: Number,
|
|
53645
|
+
default() {
|
|
53646
|
+
var _a;
|
|
53647
|
+
return ((_a = this.$config) == null ? void 0 : _a.pageSize) || 20;
|
|
53648
|
+
}
|
|
53649
|
+
},
|
|
53650
|
+
pageSizeOpts: {
|
|
53651
|
+
type: Array,
|
|
53652
|
+
default() {
|
|
53653
|
+
var _a;
|
|
53654
|
+
return ((_a = this.$config) == null ? void 0 : _a.pageSizeOpts) || [10, 20, 30, 40];
|
|
53655
|
+
}
|
|
53656
|
+
}
|
|
53541
53657
|
},
|
|
53542
53658
|
data() {
|
|
53543
53659
|
var _a, _b;
|
|
@@ -54564,7 +54680,27 @@ const __vue2_script$15 = {
|
|
|
54564
54680
|
};
|
|
54565
54681
|
}
|
|
54566
54682
|
if (column.valueFormatter) {
|
|
54567
|
-
|
|
54683
|
+
let self2 = this;
|
|
54684
|
+
const originalValueFormatter = column.valueFormatter;
|
|
54685
|
+
agColumn.valueFormatter = (params) => {
|
|
54686
|
+
let formattedValue = originalValueFormatter(params);
|
|
54687
|
+
if (formattedValue === void 0 || formattedValue === "" || formattedValue === null) {
|
|
54688
|
+
formattedValue = self2.nullValueFormat;
|
|
54689
|
+
} else if (formattedValue === "0" || formattedValue === 0) {
|
|
54690
|
+
formattedValue = self2.zeroValueFormat;
|
|
54691
|
+
}
|
|
54692
|
+
return formattedValue;
|
|
54693
|
+
};
|
|
54694
|
+
} else {
|
|
54695
|
+
agColumn.valueFormatter = (params) => {
|
|
54696
|
+
let value = params.value;
|
|
54697
|
+
if (value === void 0 || value === null || value === "") {
|
|
54698
|
+
value = this.nullValueFormat;
|
|
54699
|
+
} else if (value === "0" || value === 0) {
|
|
54700
|
+
value = this.zeroValueFormat;
|
|
54701
|
+
}
|
|
54702
|
+
return value;
|
|
54703
|
+
};
|
|
54568
54704
|
}
|
|
54569
54705
|
if (column.align) {
|
|
54570
54706
|
agColumn.cellClass = agColumn.cellClass + (column.align == "right" ? " ag-right-aligned-cell" : column.align == "center" ? " ag-center-aligned-cell" : "");
|
|
@@ -64080,8 +64216,8 @@ var ConditionPanel = /* @__PURE__ */ function() {
|
|
|
64080
64216
|
return __component__$n.exports;
|
|
64081
64217
|
}();
|
|
64082
64218
|
/*!
|
|
64083
|
-
* Signature Pad v4.
|
|
64084
|
-
* (c)
|
|
64219
|
+
* Signature Pad v4.2.0 | https://github.com/szimek/signature_pad
|
|
64220
|
+
* (c) 2024 Szymon Nowak | Released under the MIT license
|
|
64085
64221
|
*/
|
|
64086
64222
|
class Point {
|
|
64087
64223
|
constructor(x, y, pressure, time) {
|
|
@@ -64286,8 +64422,9 @@ class SignaturePad extends SignatureEventTarget {
|
|
|
64286
64422
|
this.penColor = options.penColor || "black";
|
|
64287
64423
|
this.backgroundColor = options.backgroundColor || "rgba(0,0,0,0)";
|
|
64288
64424
|
this.compositeOperation = options.compositeOperation || "source-over";
|
|
64425
|
+
this.canvasContextOptions = "canvasContextOptions" in options ? options.canvasContextOptions : {};
|
|
64289
64426
|
this._strokeMoveUpdate = this.throttle ? throttle(SignaturePad.prototype._strokeUpdate, this.throttle) : SignaturePad.prototype._strokeUpdate;
|
|
64290
|
-
this._ctx = canvas.getContext("2d");
|
|
64427
|
+
this._ctx = canvas.getContext("2d", this.canvasContextOptions);
|
|
64291
64428
|
this.clear();
|
|
64292
64429
|
this.on();
|
|
64293
64430
|
}
|