@indfnd/common 1.0.14 → 1.0.15
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 +7 -0
- package/dist/ind-common.es.js +40 -53
- package/dist/ind-common.umd.cjs +46 -46
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
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.0.15](http://git.inspur.com/imp-ec/ind-front/ind-common-front/compare/v1.0.14...v1.0.15) (2024-07-08)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* 表格计算逻辑修改`` ([21a6a95](http://git.inspur.com/imp-ec/ind-front/ind-common-front/commit/21a6a958528a6cb3c678bfa1b898aa8b1b8d6485))
|
|
11
|
+
|
|
5
12
|
### [1.0.14](http://git.inspur.com/imp-ec/ind-front/ind-common-front/compare/v1.0.13...v1.0.14) (2024-06-29)
|
|
6
13
|
|
|
7
14
|
|
package/dist/ind-common.es.js
CHANGED
|
@@ -2,7 +2,7 @@ import { Button as Button$1, ButtonGroup as ButtonGroup$1, Input, Drawer as Draw
|
|
|
2
2
|
import { isNil, formatDate as formatDate$1, useConfig, getQuarterNum, formatQuarter, str2Date, isDate, isArray, checkIdCard, checkVehicleNo, checkPhone, getDictMapApi, axios, isFunction, isString, uuid, exportJsonToExcel as exportJsonToExcel$1, importJsonFromExcel, on, off, deleteMenuHistoryApi, deleteMenuCollectApi, getMenuHistoryApi, getMenuCollectApi, getPermissionCache, listItemTreeApi, getPriceInfo, MIME_TYPE, base64ToBlob, putOssFileApi, isEqual, getCaptchaURL, getLocalStorage, guid, setLocalStorage, removeLocalStorage, clearSessionStorage, cryptor, getToken, putOssFileUrl, getOssFileUrl, responseInterceptors, config as config$1, setToken, loginApi, clearUserInfoCache, clearPermissionCache, logoutApi, getUserInfoCache, getUserInfoApi, setUserInfoCache, getSessionStorage, setSessionStorage, getAppListApi, getPermissionApi, setPermissionCache, menuHistoryApi, addMenuCollectApi, removeMenuCollectApi, getIndexDescCache, listIndexDescApi, setIndexDescCache } from "@indfnd/utils";
|
|
3
3
|
import Vue$1 from "vue";
|
|
4
4
|
const name$1 = "@indfnd/common";
|
|
5
|
-
const version = "1.0.
|
|
5
|
+
const version = "1.0.14";
|
|
6
6
|
const author = "huxuetong";
|
|
7
7
|
const publishConfig = {
|
|
8
8
|
registry: "https://registry.npmjs.org/"
|
|
@@ -53551,70 +53551,57 @@ const __vue2_script$_ = {
|
|
|
53551
53551
|
},
|
|
53552
53552
|
renderSumRow: _.debounce(async function() {
|
|
53553
53553
|
var _a;
|
|
53554
|
-
let hasSumRow =
|
|
53554
|
+
let hasSumRow = this.flatColumns.some((item2) => item2.isSum);
|
|
53555
53555
|
if (hasSumRow) {
|
|
53556
53556
|
console.time("calcSum");
|
|
53557
|
-
let sumCols = _.filter(this.flatColumns, (item2) => item2.isSum);
|
|
53558
|
-
let sumCalcCols = _.remove(sumCols, (item2) => isString(item2.isSum));
|
|
53559
|
-
let sumFuncCols = _.remove(sumCols, (item2) => item2.isSum instanceof Function);
|
|
53560
|
-
const sumCalcRuleMap = {};
|
|
53561
|
-
_.forEach(sumCalcCols, (col) => {
|
|
53562
|
-
addCalcRuleMap(sumCalcRuleMap, col.isSum, col.field || col.key);
|
|
53563
|
-
});
|
|
53564
53557
|
let sumData = {};
|
|
53565
|
-
for (let
|
|
53566
|
-
if (!["checkbox", "radios", "index"].includes(
|
|
53567
|
-
|
|
53568
|
-
sumData[colTmp.field || colTmp.key] = "\u5408\u8BA1";
|
|
53558
|
+
for (let col of this.flatColumns) {
|
|
53559
|
+
if (!["checkbox", "radios", "index"].includes(col.type)) {
|
|
53560
|
+
sumData[col.field || col.key] = "\u5408\u8BA1";
|
|
53569
53561
|
break;
|
|
53570
53562
|
}
|
|
53571
53563
|
}
|
|
53572
|
-
sumCols.
|
|
53573
|
-
|
|
53574
|
-
|
|
53575
|
-
(
|
|
53576
|
-
|
|
53577
|
-
|
|
53578
|
-
|
|
53579
|
-
let field = dd.field || dd.key;
|
|
53580
|
-
let rowMergeInfo = this.tableRowSpanMergeIndexMap[field];
|
|
53581
|
-
let mergedRows = [];
|
|
53582
|
-
_.forEach(rowMergeInfo, (v, k) => {
|
|
53583
|
-
let rows2 = _.range(k, parseInt(k) + v);
|
|
53584
|
-
mergedRows.push(...rows2.slice(1));
|
|
53585
|
-
});
|
|
53586
|
-
if (!mergedRows.includes(idx)) {
|
|
53587
|
-
sumData[field] = _.round(
|
|
53588
|
-
sumData[field] + (!d[field] || isNaN(d[field]) ? 0 : parseFloat(d[field])),
|
|
53589
|
-
6
|
|
53590
|
-
);
|
|
53591
|
-
}
|
|
53592
|
-
});
|
|
53593
|
-
return s;
|
|
53594
|
-
},
|
|
53595
|
-
sumData
|
|
53596
|
-
);
|
|
53597
|
-
_.forEach(sumFuncCols, (d) => {
|
|
53598
|
-
sumData[d.field || d.key] = d.isSum(this.rowDataFiltered, d);
|
|
53564
|
+
let sumCols = this.flatColumns.filter((item2) => item2.isSum);
|
|
53565
|
+
let sumCalcCols = [], sumFuncCols = [];
|
|
53566
|
+
sumCols.forEach((col) => {
|
|
53567
|
+
if (typeof col.isSum === "string")
|
|
53568
|
+
sumCalcCols.push(col);
|
|
53569
|
+
else if (col.isSum instanceof Function)
|
|
53570
|
+
sumFuncCols.push(col);
|
|
53599
53571
|
});
|
|
53600
|
-
|
|
53601
|
-
|
|
53602
|
-
|
|
53603
|
-
_.merge(calcRules, v);
|
|
53572
|
+
const sumCalcRuleMap = {};
|
|
53573
|
+
sumCalcCols.forEach((col) => {
|
|
53574
|
+
addCalcRuleMap(sumCalcRuleMap, col.isSum, col.field || col.key);
|
|
53604
53575
|
});
|
|
53605
|
-
|
|
53606
|
-
|
|
53607
|
-
|
|
53608
|
-
|
|
53609
|
-
|
|
53576
|
+
sumCols.forEach((col) => {
|
|
53577
|
+
if (!(col.field || col.key) in sumData)
|
|
53578
|
+
sumData[col.field || col.key] = 0;
|
|
53579
|
+
});
|
|
53580
|
+
this.rowDataFiltered.forEach((d) => {
|
|
53581
|
+
sumCols.forEach((dd) => {
|
|
53582
|
+
if (typeof dd.isSum === "string")
|
|
53583
|
+
return;
|
|
53584
|
+
let field = dd.field || dd.key;
|
|
53585
|
+
let value = d[field];
|
|
53586
|
+
if (typeof value === "number" && !isNaN(value)) {
|
|
53587
|
+
sumData[field] = (sumData[field] || 0) + value;
|
|
53588
|
+
}
|
|
53610
53589
|
});
|
|
53590
|
+
});
|
|
53591
|
+
sumFuncCols.forEach((col) => {
|
|
53592
|
+
sumData[col.field || col.key] = col.isSum(this.rowDataFiltered, col);
|
|
53593
|
+
});
|
|
53594
|
+
let sumRows = [sumData];
|
|
53595
|
+
let rules = [];
|
|
53596
|
+
for (let key in sumCalcRuleMap) {
|
|
53597
|
+
let column = sumCalcCols.find((col) => col.field === key || col.key === key);
|
|
53611
53598
|
rules.push({
|
|
53612
|
-
rltKey:
|
|
53613
|
-
ast:
|
|
53614
|
-
precision: ((
|
|
53599
|
+
rltKey: key,
|
|
53600
|
+
ast: sumCalcRuleMap[key],
|
|
53601
|
+
precision: ((_a = column == null ? void 0 : column.cellRendererParams) == null ? void 0 : _a.scale) || 2,
|
|
53615
53602
|
errRtn: 0
|
|
53616
53603
|
});
|
|
53617
|
-
}
|
|
53604
|
+
}
|
|
53618
53605
|
let options = { calcRules: rules };
|
|
53619
53606
|
calcDatas(sumRows, options);
|
|
53620
53607
|
this.topRows = this.pinnedTopRowDataWithUnit ? _.concat(this.pinnedTopRowDataWithUnit, sumRows) : sumRows;
|