@indfnd/utils 0.0.36 → 0.0.38

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,20 @@
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
+ ### [0.0.38](http://git.inspur.com/imp-ec/ind-front/ind-utils/compare/v0.0.37...v0.0.38) (2024-03-03)
6
+
7
+
8
+ ### Features
9
+
10
+ * 增加指标描述功能 ([268d147](http://git.inspur.com/imp-ec/ind-front/ind-utils/commit/268d14778072fdc975a7cf5741e37fb56d492bf7))
11
+
12
+ ### [0.0.37](http://git.inspur.com/imp-ec/ind-front/ind-utils/compare/v0.0.36...v0.0.37) (2024-03-02)
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * **table:** 行转列排序,上下层表头数据限制 ([24c8959](http://git.inspur.com/imp-ec/ind-front/ind-utils/commit/24c8959a34d0cb7e21646c49440bff9ee2b07862))
18
+
5
19
  ### [0.0.36](http://git.inspur.com/imp-ec/ind-front/ind-utils/compare/v0.0.35...v0.0.36) (2024-03-01)
6
20
 
7
21
 
@@ -92,6 +92,16 @@ const setLocalStorage = (key, value) => {
92
92
  const removeLocalStorage = (key) => {
93
93
  return localStorage.removeItem(key);
94
94
  };
95
+ const INDEX_DESC_KEY = "indexDesc";
96
+ function getIndexDescCache() {
97
+ return getLocalStorage(INDEX_DESC_KEY);
98
+ }
99
+ function setIndexDescCache(data) {
100
+ setLocalStorage(INDEX_DESC_KEY, data);
101
+ }
102
+ function clearIndexDescCache() {
103
+ removeLocalStorage(INDEX_DESC_KEY);
104
+ }
95
105
  const PERMISSION_KEY = "ibp-permission";
96
106
  function getPermissionCache() {
97
107
  return getSessionStorage(PERMISSION_KEY);
@@ -10504,9 +10514,10 @@ function renderColumnTree(data, columnGroup, option = {}) {
10504
10514
  title,
10505
10515
  titleProp,
10506
10516
  titleFormatter,
10507
- sortProp = keyProp,
10517
+ sortProp,
10508
10518
  sortOrder = "asc",
10509
10519
  keyLastSuffix,
10520
+ isLimitChildren,
10510
10521
  children
10511
10522
  } = _a, args = __objRest(_a, [
10512
10523
  "key",
@@ -10517,20 +10528,24 @@ function renderColumnTree(data, columnGroup, option = {}) {
10517
10528
  "sortProp",
10518
10529
  "sortOrder",
10519
10530
  "keyLastSuffix",
10531
+ "isLimitChildren",
10520
10532
  "children"
10521
10533
  ]);
10522
10534
  const { keyPropName = "key", titlePropName = "title", keyPrefix = "" } = option;
10523
10535
  if (keyProp) {
10524
- let columnGroupData = _.uniqBy(data, columnGroup.keyProp) || [];
10525
- const unSortData = columnGroupData.filter((item) => isNil(item[sortProp]));
10526
- const sortData = columnGroupData.filter((item) => !isNil(item[sortProp]));
10527
- const sortedData = _.orderBy(sortData, [sortProp], [sortOrder]).concat(unSortData);
10528
- return sortedData.map((item) => {
10536
+ let columnUniqData = _.uniqBy(data, columnGroup.keyProp) || [];
10537
+ if (sortProp) {
10538
+ const unSortData = columnUniqData.filter((item) => isNil(item[sortProp]));
10539
+ const sortData = columnUniqData.filter((item) => !isNil(item[sortProp]));
10540
+ columnUniqData = _.orderBy(sortData, [sortProp], [sortOrder]).concat(unSortData);
10541
+ }
10542
+ return columnUniqData.map((item) => {
10529
10543
  const columnTitle = titleFormatter ? titleFormatter(item[titleProp]) : item[titleProp];
10530
10544
  if (children && children.length) {
10531
10545
  const prefix = `${keyPrefix}${keyProp}${VALUE_SEP}${item[keyProp]}${GROUP_SEP}`;
10532
10546
  const columnChildren = children.map((child) => {
10533
- return renderColumnTree(data, child, __spreadProps(__spreadValues({}, option), { keyPrefix: prefix }));
10547
+ let nextData = isLimitChildren ? data.filter((temp) => temp[keyProp] === item[keyProp]) : data;
10548
+ return renderColumnTree(nextData, child, __spreadProps(__spreadValues({}, option), { keyPrefix: prefix }));
10534
10549
  });
10535
10550
  return __spreadProps(__spreadValues({}, args), {
10536
10551
  [titlePropName]: columnTitle,
@@ -10901,6 +10916,15 @@ const CONTEXT$1 = config.ismAmServerContext;
10901
10916
  function listComTreeApi(params) {
10902
10917
  return instance.get(`${CONTEXT$1}/tree/com/listComTree`, { params });
10903
10918
  }
10919
+ config.ucExtServerContext;
10920
+ function listIndexDescApi(params) {
10921
+ return Promise.resolve({
10922
+ data: [
10923
+ { indexCode: "comName", indexName: "\u5546\u4E1A\u516C\u53F8", indexDesc: "\u8FD9\u4E2A\u662F\u5546\u4E1A\u516C\u53F8\u7684\u63CF\u8FF0" },
10924
+ { indexCode: "comSname", indexName: "\u5546\u4E1A\u516C\u53F8\u7B80\u79F0", indexDesc: "\u8FD9\u4E2A\u662F\u5546\u4E1A\u516C\u53F8\u7B80\u79F0\u7684\u63CF\u8FF0" }
10925
+ ]
10926
+ });
10927
+ }
10904
10928
  const CONTEXT = config.ismAmServerContext;
10905
10929
  function listItemTreeApi(params) {
10906
10930
  return instance.get(`${CONTEXT}/tree/item/listItemTree`, { params });
@@ -10918,4 +10942,4 @@ const UC_CONTEXT = config.ucExtServerContext;
10918
10942
  function listUserTreeApi(params) {
10919
10943
  return instance.get(`${UC_CONTEXT}/tree/uc-user/listUserTree`, { params });
10920
10944
  }
10921
- export { CONTENT_TYPE, IS_OR_NOT_ENUM, IS_OR_NOT_ENUM_KEY, IS_OR_NOT_ENUM_LIST, MIME_TYPE, UC_ENUM, addMenuCollectApi, instance as axios, base64ToBlob, checkIdCard, checkPhone, checkTel, checkVehicleNo, clearPermissionCache, clearSessionStorage, clearUserInfoCache, config, cryptor, deleteMenuCollectApi, deleteMenuHistoryApi, exportJsonToExcel, flattenRow2ColumnData, formatDate, formatDateChinese, formatDecimal, formatHalfYear, formatQuarter, getAppListApi, getCaptchaURL, getContentType, getDictApi, getDictMapApi, getDictsMapApi, getExcelColumnIdx, getGlobalPolicyApi, getHalfYear, getHalfYearBeginMonth, getHalfYearEndMonth, getHalfYearNum, getItem, getLocalStorage, getMaxTabNumValueApi, getMenuCollectApi, getMenuHistoryApi, getOssFileApi, getOssFileUrl, getPermissionApi, getPermissionCache, getPriceCode, getPriceSeg, getQuarter, getQuarterBeginMonth, getQuarterEndMonth, getQuarterNum, getSessionStorage, getToken, getType, getUrlParams, getUserInfoApi, getUserInfoCache, guid, importJsonFromExcel, isArguments, isArray, isArrayLike, isBoolean, isDate, isDecimal, isElement, isEmpty, isEqual, isEqualWith, isError, isEven, isFinite$1 as isFinite, isFunction, isInteger, isNegative, isNil, isNull, isNumber, isNumberEqual, isObject, isObjectLike, isOdd, isPlainObject, isPositive, isPromise, isPrototype, isRegExp2 as isRegExp, isString, isType, isUndefined, listComTreeApi, listItemTreeApi, listUserTreeApi, loginApi, logoutApi, menuHistoryApi, numToChineseNumerals, numToDX, off, on, preventDefault, putOssFileApi, putOssFileUrl, quarter2Chinese, removeLocalStorage, removeMenuCollectApi, removeSessionStorage, renderColumnEnums, renderEnumData, renderEnumList, renderFieldEnums, responseInterceptors, round, row2column, setContentType, setLocalStorage, setPermissionCache, setSessionStorage, setToken, setUserInfoCache, stopPropagation, str2Date, toChies, toFixed, toThousands, updatePasswordApi, useConfig, uuid };
10945
+ export { CONTENT_TYPE, IS_OR_NOT_ENUM, IS_OR_NOT_ENUM_KEY, IS_OR_NOT_ENUM_LIST, MIME_TYPE, UC_ENUM, addMenuCollectApi, instance as axios, base64ToBlob, checkIdCard, checkPhone, checkTel, checkVehicleNo, clearIndexDescCache, clearPermissionCache, clearSessionStorage, clearUserInfoCache, config, cryptor, deleteMenuCollectApi, deleteMenuHistoryApi, exportJsonToExcel, flattenRow2ColumnData, formatDate, formatDateChinese, formatDecimal, formatHalfYear, formatQuarter, getAppListApi, getCaptchaURL, getContentType, getDictApi, getDictMapApi, getDictsMapApi, getExcelColumnIdx, getGlobalPolicyApi, getHalfYear, getHalfYearBeginMonth, getHalfYearEndMonth, getHalfYearNum, getIndexDescCache, getItem, getLocalStorage, getMaxTabNumValueApi, getMenuCollectApi, getMenuHistoryApi, getOssFileApi, getOssFileUrl, getPermissionApi, getPermissionCache, getPriceCode, getPriceSeg, getQuarter, getQuarterBeginMonth, getQuarterEndMonth, getQuarterNum, getSessionStorage, getToken, getType, getUrlParams, getUserInfoApi, getUserInfoCache, guid, importJsonFromExcel, isArguments, isArray, isArrayLike, isBoolean, isDate, isDecimal, isElement, isEmpty, isEqual, isEqualWith, isError, isEven, isFinite$1 as isFinite, isFunction, isInteger, isNegative, isNil, isNull, isNumber, isNumberEqual, isObject, isObjectLike, isOdd, isPlainObject, isPositive, isPromise, isPrototype, isRegExp2 as isRegExp, isString, isType, isUndefined, listComTreeApi, listIndexDescApi, listItemTreeApi, listUserTreeApi, loginApi, logoutApi, menuHistoryApi, numToChineseNumerals, numToDX, off, on, preventDefault, putOssFileApi, putOssFileUrl, quarter2Chinese, removeLocalStorage, removeMenuCollectApi, removeSessionStorage, renderColumnEnums, renderEnumData, renderEnumList, renderFieldEnums, responseInterceptors, round, row2column, setContentType, setIndexDescCache, setLocalStorage, setPermissionCache, setSessionStorage, setToken, setUserInfoCache, stopPropagation, str2Date, toChies, toFixed, toThousands, updatePasswordApi, useConfig, uuid };