@indfnd/utils 0.0.39 → 0.1.0
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 +15 -0
- package/dist/ind-utils.es.js +32 -5
- package/dist/ind-utils.umd.cjs +9 -9
- package/package.json +2 -2
- package/src/api/item.ts +2 -2
- package/src/utils/blob.ts +16 -0
- package/src/utils/request/content-type.ts +8 -1
- package/src/utils/request/interceptors.ts +1 -1
- package/src/utils/table.ts +7 -1
- package/types/utils/blob.d.ts +1 -0
- package/types/utils/blob.d.ts.map +1 -1
- package/types/utils/request/content-type.d.ts +1 -0
- package/types/utils/request/content-type.d.ts.map +1 -1
- package/types/utils/table.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,21 @@
|
|
|
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.1.0](http://git.inspur.com/imp-ec/ind-front/ind-utils/compare/v0.0.40...v0.1.0) (2024-03-18)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **table:** 修改headerTooltip ([949db39](http://git.inspur.com/imp-ec/ind-front/ind-utils/commit/949db3940c4dd297a2b93cb5109428768ed417c2))
|
|
11
|
+
|
|
12
|
+
### [0.0.40](http://git.inspur.com/imp-ec/ind-front/ind-utils/compare/v0.0.39...v0.0.40) (2024-03-13)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* 更新依赖 ([8f9c236](http://git.inspur.com/imp-ec/ind-front/ind-utils/commit/8f9c236a120f50fdf63aeff7a447e3ecea23ca6c))
|
|
18
|
+
* 文档中心获取图片并转base64 ([13259ad](http://git.inspur.com/imp-ec/ind-front/ind-utils/commit/13259ad7630893cec8731203a6d3c340946d9349))
|
|
19
|
+
|
|
5
20
|
### [0.0.39](http://git.inspur.com/imp-ec/ind-front/ind-utils/compare/v0.0.38...v0.0.39) (2024-03-06)
|
|
6
21
|
|
|
7
22
|
|
package/dist/ind-utils.es.js
CHANGED
|
@@ -3167,7 +3167,12 @@ function getUrlParams() {
|
|
|
3167
3167
|
}
|
|
3168
3168
|
const contentTypeKey = "Content-Type";
|
|
3169
3169
|
function getContentType(config2) {
|
|
3170
|
-
|
|
3170
|
+
let type = (config2 == null ? void 0 : config2[contentTypeKey]) || (config2 == null ? void 0 : config2["content-type"]) || "";
|
|
3171
|
+
const suffixIdx = type.indexOf(";");
|
|
3172
|
+
if (suffixIdx !== -1) {
|
|
3173
|
+
type = type.substring(0, suffixIdx);
|
|
3174
|
+
}
|
|
3175
|
+
return type;
|
|
3171
3176
|
}
|
|
3172
3177
|
function setContentType(headers, type) {
|
|
3173
3178
|
headers[contentTypeKey] = type;
|
|
@@ -3176,7 +3181,8 @@ const CONTENT_TYPE = {
|
|
|
3176
3181
|
form: "application/x-www-form-urlencoded",
|
|
3177
3182
|
multiForm: "multipart/form-data",
|
|
3178
3183
|
body: "application/json",
|
|
3179
|
-
os: "application/octet-stream"
|
|
3184
|
+
os: "application/octet-stream",
|
|
3185
|
+
json: "application/json"
|
|
3180
3186
|
};
|
|
3181
3187
|
const TOKEN_KEY = "v8-token";
|
|
3182
3188
|
const TOKEN_KEY_IBP = "lambo-token";
|
|
@@ -3304,7 +3310,7 @@ function requestInterceptors(config2) {
|
|
|
3304
3310
|
function responseInterceptors(response) {
|
|
3305
3311
|
let data = response.data;
|
|
3306
3312
|
const contentType = getContentType(response.headers);
|
|
3307
|
-
if (contentType
|
|
3313
|
+
if (contentType !== CONTENT_TYPE.json) {
|
|
3308
3314
|
return data;
|
|
3309
3315
|
}
|
|
3310
3316
|
if (typeof response.data === "string") {
|
|
@@ -3844,6 +3850,21 @@ function base64ToBlob(base64Data, contentType) {
|
|
|
3844
3850
|
}
|
|
3845
3851
|
return new Blob(byteArrays, { type: contentType });
|
|
3846
3852
|
}
|
|
3853
|
+
function blobToBase64(blob, hasPrefix = true) {
|
|
3854
|
+
return new Promise((resolve) => {
|
|
3855
|
+
const reader = new FileReader();
|
|
3856
|
+
reader.onload = function() {
|
|
3857
|
+
const base64Data = (reader == null ? void 0 : reader.result) || "";
|
|
3858
|
+
if (hasPrefix) {
|
|
3859
|
+
resolve(base64Data);
|
|
3860
|
+
return;
|
|
3861
|
+
}
|
|
3862
|
+
const base64WithoutPrefix = base64Data.split(",")[1];
|
|
3863
|
+
resolve(base64WithoutPrefix);
|
|
3864
|
+
};
|
|
3865
|
+
reader.readAsDataURL(blob);
|
|
3866
|
+
});
|
|
3867
|
+
}
|
|
3847
3868
|
var dayjs_min = { exports: {} };
|
|
3848
3869
|
(function(module, exports) {
|
|
3849
3870
|
!function(t, e) {
|
|
@@ -10670,7 +10691,13 @@ function renderColumnTree(data, columnGroup, option = {}) {
|
|
|
10670
10691
|
const suffix = keyLastSuffix ? `${GROUP_SEP}${keyLastSuffix}` : "";
|
|
10671
10692
|
return __spreadProps(__spreadValues({}, args), {
|
|
10672
10693
|
[keyPropName]: `${keyPrefix}${keyProp}${VALUE_SEP}${item[keyProp]}${suffix}`,
|
|
10673
|
-
[titlePropName]: columnTitle
|
|
10694
|
+
[titlePropName]: columnTitle,
|
|
10695
|
+
headerTooltip: renderHeaderTooltip({
|
|
10696
|
+
tooltip: headerTooltip,
|
|
10697
|
+
item,
|
|
10698
|
+
parents,
|
|
10699
|
+
title: columnTitle
|
|
10700
|
+
})
|
|
10674
10701
|
});
|
|
10675
10702
|
});
|
|
10676
10703
|
}
|
|
@@ -11070,4 +11097,4 @@ const UC_CONTEXT = config.ucExtServerContext;
|
|
|
11070
11097
|
function listUserTreeApi(params) {
|
|
11071
11098
|
return instance.get(`${UC_CONTEXT}/tree/uc-user/listUserTree`, { params });
|
|
11072
11099
|
}
|
|
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 };
|
|
11100
|
+
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, blobToBase64, 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 };
|