@indfnd/utils 0.0.38 → 0.0.39

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,22 @@
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.39](http://git.inspur.com/imp-ec/ind-front/ind-utils/compare/v0.0.38...v0.0.39) (2024-03-06)
6
+
7
+
8
+ ### Features
9
+
10
+ * 登录加密参考云庭 ([c9c6649](http://git.inspur.com/imp-ec/ind-front/ind-utils/commit/c9c6649089b67720310fa69f580678fbafe1f7c9))
11
+ * 增加卷烟筛选条件接口 ([85ae986](http://git.inspur.com/imp-ec/ind-front/ind-utils/commit/85ae986e6abf95eb3f8ee1a849a5e7e16f7e27da))
12
+ * 增加卷烟筛选条件接口 ([445756b](http://git.inspur.com/imp-ec/ind-front/ind-utils/commit/445756bad5c92f77409262869c3152133ac36580))
13
+ * **table:** 行转列时可以设置headerTooltip ([28d17cd](http://git.inspur.com/imp-ec/ind-front/ind-utils/commit/28d17cd9c7d851576e72aea0da70255bcb7b488c))
14
+
15
+
16
+ ### Bug Fixes
17
+
18
+ * 更新依赖 ([6044adf](http://git.inspur.com/imp-ec/ind-front/ind-utils/commit/6044adfb0236e379af6173d5150b3c48f4a55fb9))
19
+ * 接口url修改 ([fb0abd2](http://git.inspur.com/imp-ec/ind-front/ind-utils/commit/fb0abd242f0057ec4a895b655712d07432303d0d))
20
+
5
21
  ### [0.0.38](http://git.inspur.com/imp-ec/ind-front/ind-utils/compare/v0.0.37...v0.0.38) (2024-03-03)
6
22
 
7
23
 
@@ -3740,6 +3740,92 @@ const cryptor = {
3740
3740
  return s + "{1#2$3%4(5)6@7!poeeww$3%4(5)djjkkldss}";
3741
3741
  }
3742
3742
  };
3743
+ let Base64ForLogin = {
3744
+ Base64Chars: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@*-",
3745
+ encode: function(s) {
3746
+ if (!s || s.length == 0)
3747
+ return s;
3748
+ var d = "";
3749
+ var b = this.ucs2_utf8(s);
3750
+ var b0, b1, b2, b3;
3751
+ var len = b.length;
3752
+ var i = 0;
3753
+ while (i < len) {
3754
+ var tmp = b[i++];
3755
+ b0 = (tmp & 252) >> 2;
3756
+ b1 = (tmp & 3) << 4;
3757
+ if (i < len) {
3758
+ tmp = b[i++];
3759
+ b1 |= (tmp & 240) >> 4;
3760
+ b2 = (tmp & 15) << 2;
3761
+ if (i < len) {
3762
+ tmp = b[i++];
3763
+ b2 |= (tmp & 192) >> 6;
3764
+ b3 = tmp & 63;
3765
+ } else {
3766
+ b3 = 64;
3767
+ }
3768
+ } else {
3769
+ b2 = b3 = 64;
3770
+ }
3771
+ d += this.Base64Chars.charAt(b0);
3772
+ d += this.Base64Chars.charAt(b1);
3773
+ d += this.Base64Chars.charAt(b2);
3774
+ d += this.Base64Chars.charAt(b3);
3775
+ }
3776
+ return d;
3777
+ },
3778
+ ucs2_utf8: function(s) {
3779
+ if (!s)
3780
+ return null;
3781
+ var d = new Array();
3782
+ if (s == "")
3783
+ return d;
3784
+ var c = 0, i = 0, j = 0;
3785
+ var len = s.length;
3786
+ while (i < len) {
3787
+ c = s.charCodeAt(i++);
3788
+ if (c <= 127) {
3789
+ d[j++] = c;
3790
+ } else if (c >= 128 && c <= 2047) {
3791
+ d[j++] = c >> 6 & 31 | 192;
3792
+ d[j++] = c & 63 | 128;
3793
+ } else {
3794
+ d[j++] = c >> 12 | 224;
3795
+ d[j++] = c >> 6 & 63 | 128;
3796
+ d[j++] = c & 63 | 128;
3797
+ }
3798
+ }
3799
+ return d;
3800
+ },
3801
+ utf8_ucs2: function(s) {
3802
+ if (!s)
3803
+ return null;
3804
+ var len = s.length;
3805
+ if (len == 0)
3806
+ return "";
3807
+ var d = "";
3808
+ var c = 0, i = 0, tmp = 0;
3809
+ while (i < len) {
3810
+ c = s[i++];
3811
+ if ((c & 224) == 224) {
3812
+ tmp = (c & 15) << 12;
3813
+ c = s[i++];
3814
+ tmp |= (c & 63) << 6;
3815
+ c = s[i++];
3816
+ tmp |= c & 63;
3817
+ } else if ((c & 192) == 192) {
3818
+ tmp = (c & 31) << 6;
3819
+ c = s[i++];
3820
+ tmp |= c & 63;
3821
+ } else {
3822
+ tmp = c;
3823
+ }
3824
+ d += String.fromCharCode(tmp);
3825
+ }
3826
+ return d;
3827
+ }
3828
+ };
3743
3829
  function base64ToBlob(base64Data, contentType) {
3744
3830
  contentType = contentType || "";
3745
3831
  const sliceSize = 1024;
@@ -10507,6 +10593,24 @@ function getQuarterEndMonth(quarter) {
10507
10593
  }
10508
10594
  const GROUP_SEP = "__";
10509
10595
  const VALUE_SEP = "--";
10596
+ function renderHeaderTooltip({
10597
+ tooltip,
10598
+ item,
10599
+ parents,
10600
+ title
10601
+ }) {
10602
+ let text = null;
10603
+ if (tooltip) {
10604
+ if (isFunction(tooltip)) {
10605
+ text = tooltip(item, parents);
10606
+ } else if (tooltip === true) {
10607
+ text = title;
10608
+ } else {
10609
+ text = tooltip;
10610
+ }
10611
+ }
10612
+ return text;
10613
+ }
10510
10614
  function renderColumnTree(data, columnGroup, option = {}) {
10511
10615
  const _a = columnGroup, {
10512
10616
  key,
@@ -10518,6 +10622,7 @@ function renderColumnTree(data, columnGroup, option = {}) {
10518
10622
  sortOrder = "asc",
10519
10623
  keyLastSuffix,
10520
10624
  isLimitChildren,
10625
+ headerTooltip,
10521
10626
  children
10522
10627
  } = _a, args = __objRest(_a, [
10523
10628
  "key",
@@ -10529,9 +10634,10 @@ function renderColumnTree(data, columnGroup, option = {}) {
10529
10634
  "sortOrder",
10530
10635
  "keyLastSuffix",
10531
10636
  "isLimitChildren",
10637
+ "headerTooltip",
10532
10638
  "children"
10533
10639
  ]);
10534
- const { keyPropName = "key", titlePropName = "title", keyPrefix = "" } = option;
10640
+ const { keyPropName = "key", titlePropName = "title", keyPrefix = "", parents = [] } = option;
10535
10641
  if (keyProp) {
10536
10642
  let columnUniqData = _.uniqBy(data, columnGroup.keyProp) || [];
10537
10643
  if (sortProp) {
@@ -10545,10 +10651,19 @@ function renderColumnTree(data, columnGroup, option = {}) {
10545
10651
  const prefix = `${keyPrefix}${keyProp}${VALUE_SEP}${item[keyProp]}${GROUP_SEP}`;
10546
10652
  const columnChildren = children.map((child) => {
10547
10653
  let nextData = isLimitChildren ? data.filter((temp) => temp[keyProp] === item[keyProp]) : data;
10548
- return renderColumnTree(nextData, child, __spreadProps(__spreadValues({}, option), { keyPrefix: prefix }));
10654
+ return renderColumnTree(nextData, child, __spreadProps(__spreadValues({}, option), {
10655
+ keyPrefix: prefix,
10656
+ parents: [...parents, item]
10657
+ }));
10549
10658
  });
10550
10659
  return __spreadProps(__spreadValues({}, args), {
10551
10660
  [titlePropName]: columnTitle,
10661
+ headerTooltip: renderHeaderTooltip({
10662
+ tooltip: headerTooltip,
10663
+ item,
10664
+ parents,
10665
+ title: columnTitle
10666
+ }),
10552
10667
  children: _.flatten(columnChildren)
10553
10668
  });
10554
10669
  }
@@ -10559,14 +10674,28 @@ function renderColumnTree(data, columnGroup, option = {}) {
10559
10674
  });
10560
10675
  });
10561
10676
  }
10677
+ const headerTooltipText = renderHeaderTooltip({
10678
+ tooltip: headerTooltip,
10679
+ item: {},
10680
+ parents,
10681
+ title
10682
+ });
10562
10683
  if (children && children.length) {
10563
10684
  const prefix = `${keyPrefix}${key}`;
10564
10685
  const columnChildren = children.map((child) => {
10565
10686
  return renderColumnTree(data, child, __spreadProps(__spreadValues({}, option), { keyPrefix: prefix }));
10566
10687
  });
10567
- return __spreadProps(__spreadValues({}, args), { [titlePropName]: title, children: _.flatten(columnChildren) });
10688
+ return __spreadProps(__spreadValues({}, args), {
10689
+ [titlePropName]: title,
10690
+ headerTooltip: headerTooltipText,
10691
+ children: _.flatten(columnChildren)
10692
+ });
10568
10693
  }
10569
- return __spreadProps(__spreadValues({}, args), { [keyPropName]: `${keyPrefix}${key}`, [titlePropName]: title });
10694
+ return __spreadProps(__spreadValues({}, args), {
10695
+ [keyPropName]: `${keyPrefix}${key}`,
10696
+ [titlePropName]: title,
10697
+ headerTooltip: headerTooltipText
10698
+ });
10570
10699
  }
10571
10700
  function getLeafColumns(columns = []) {
10572
10701
  if (!columns || !columns.length)
@@ -10894,8 +11023,10 @@ function putOssFileApi(filename, blob) {
10894
11023
  }
10895
11024
  const CONTEXT$2 = config.authServerContext;
10896
11025
  function loginApi({ userName, password, validCodeId, validCodeInput }) {
10897
- const data = { username: userName, password, validCodeId, validCodeInput };
10898
- return instance.formPost(CONTEXT$2 + "/sso/login", data);
11026
+ let upw = encodeURIComponent(password);
11027
+ upw = Base64ForLogin.encode(upw);
11028
+ const data = { usn: userName, upw, validCodeId, validCodeInput };
11029
+ return instance.formPost(CONTEXT$2 + "/sso/auth/login", data);
10899
11030
  }
10900
11031
  function getUserInfoApi() {
10901
11032
  return instance.get(`${CONTEXT$2}/manage/user/getCurrentInfo`);
@@ -10929,17 +11060,14 @@ const CONTEXT = config.ismAmServerContext;
10929
11060
  function listItemTreeApi(params) {
10930
11061
  return instance.get(`${CONTEXT}/tree/item/listItemTree`, { params });
10931
11062
  }
10932
- function getPriceCode(params) {
10933
- return instance.get(`${CONTEXT}/tree/item/listComTree`, { params });
10934
- }
10935
- function getPriceSeg(params) {
10936
- return instance.get(`${CONTEXT}/tree/item/listComTree`, { params });
11063
+ function getPriceInfo() {
11064
+ return instance.get(`${CONTEXT}/basic/getPriceInfo`, {});
10937
11065
  }
10938
11066
  function getItem(params) {
10939
- return instance.get(`${CONTEXT}/tree/item/listComTree`, { params });
11067
+ return instance.get(`${CONTEXT}/basic/getItem`, { params });
10940
11068
  }
10941
11069
  const UC_CONTEXT = config.ucExtServerContext;
10942
11070
  function listUserTreeApi(params) {
10943
11071
  return instance.get(`${UC_CONTEXT}/tree/uc-user/listUserTree`, { params });
10944
11072
  }
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 };
11073
+ export { Base64ForLogin, 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, getPriceInfo, 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 };