ztxkutils 2.8.13 → 2.8.16
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/dist/hooks/useHistory.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{tools-4de9d743.js → tools-439efebb.js} +13 -2
- package/dist/tools.d.ts +5 -0
- package/dist/tools.js +1 -1
- package/dist/useHistory.js +13 -4
- package/dist/workflow.js +1 -1
- package/package.json +1 -1
@@ -11,4 +11,4 @@ export declare function useDocumentTitle(title: string): void;
|
|
11
11
|
export declare function setFilterAuth(): void;
|
12
12
|
export declare function isFilterAuth(): boolean;
|
13
13
|
export declare function setSession(name: any, value: any): void;
|
14
|
-
export declare function getSession(name: any):
|
14
|
+
export declare function getSession(name: any): string;
|
package/dist/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
export { c as authority } from './authority-5bc06c1a.js';
|
2
2
|
export { d as dataModel } from './dataModel-1fbaff40.js';
|
3
|
-
export { t as tools } from './tools-
|
3
|
+
export { t as tools } from './tools-439efebb.js';
|
4
4
|
export { v as validate } from './validate-3e15dd74.js';
|
5
5
|
export { r as request } from './request-09b081d4.js';
|
6
6
|
export { r as reqUrl } from './reqUrl-88fcc5c5.js';
|
@@ -253,6 +253,16 @@ function copyContent(text) {
|
|
253
253
|
textarea.select();
|
254
254
|
document === null || document === void 0 ? void 0 : document.execCommand('copy');
|
255
255
|
document.body.removeChild(textarea);
|
256
|
+
}
|
257
|
+
/**
|
258
|
+
* @author 陈亚雄
|
259
|
+
* @description 处理转义字符
|
260
|
+
*/
|
261
|
+
function dangerouslySetXss(str) {
|
262
|
+
var arrEntities = { lt: '', gt: '', nbsp: ' ', amp: '&', quot: '"' };
|
263
|
+
return str.replace(/&(lt|gt|nbsp|amp|quot);/gi, function (all, t) {
|
264
|
+
return arrEntities[t];
|
265
|
+
});
|
256
266
|
}
|
257
267
|
|
258
268
|
var tools = /*#__PURE__*/Object.freeze({
|
@@ -271,7 +281,8 @@ var tools = /*#__PURE__*/Object.freeze({
|
|
271
281
|
SHOWFRAME_KEY: SHOWFRAME_KEY,
|
272
282
|
showFrame: showFrame,
|
273
283
|
getUrlSearch: getUrlSearch,
|
274
|
-
copyContent: copyContent
|
284
|
+
copyContent: copyContent,
|
285
|
+
dangerouslySetXss: dangerouslySetXss
|
275
286
|
});
|
276
287
|
|
277
|
-
export { SHOWFRAME_KEY as S, timeTransfrom as a, toThousand as b, clearAssignStr as c, divide as d, exactRound as e, transformFileSize as f, getUrlSearch as g, copyContent as h, isEqualByKey as i, loadFileRename as l, showFrame as s, tools as t };
|
288
|
+
export { SHOWFRAME_KEY as S, timeTransfrom as a, toThousand as b, clearAssignStr as c, divide as d, exactRound as e, transformFileSize as f, getUrlSearch as g, copyContent as h, isEqualByKey as i, dangerouslySetXss as j, loadFileRename as l, showFrame as s, tools as t };
|
package/dist/tools.d.ts
CHANGED
package/dist/tools.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
1
|
import './tslib.es6-f9459658.js';
|
2
2
|
import 'dayjs';
|
3
3
|
export { minus, plus, times } from 'number-precision';
|
4
|
-
export { S as SHOWFRAME_KEY, c as clearAssignStr, h as copyContent, d as divide, e as exactRound, g as getUrlSearch, i as isEqualByKey, l as loadFileRename, s as showFrame, a as timeTransfrom, b as toThousand, f as transformFileSize } from './tools-
|
4
|
+
export { S as SHOWFRAME_KEY, c as clearAssignStr, h as copyContent, j as dangerouslySetXss, d as divide, e as exactRound, g as getUrlSearch, i as isEqualByKey, l as loadFileRename, s as showFrame, a as timeTransfrom, b as toThousand, f as transformFileSize } from './tools-439efebb.js';
|
package/dist/useHistory.js
CHANGED
@@ -21,6 +21,7 @@ var _pushTarget = [
|
|
21
21
|
*/
|
22
22
|
function useHistory(routeBasename) {
|
23
23
|
var history = useHistory$1();
|
24
|
+
var historyPush = history.push;
|
24
25
|
history.push = function (path, state, target) {
|
25
26
|
var _a, _b;
|
26
27
|
// 代理react router dom 的push方法
|
@@ -29,14 +30,14 @@ function useHistory(routeBasename) {
|
|
29
30
|
}
|
30
31
|
// 如果没有传入target,那么还是使用原生的push方法
|
31
32
|
if (!target) {
|
32
|
-
|
33
|
+
historyPush(path, state);
|
33
34
|
}
|
34
35
|
else {
|
35
36
|
// 如果是需要在无框架下,外链打开
|
36
37
|
if (target === '_blank_noframe' &&
|
37
38
|
((_a = window.location.href) === null || _a === void 0 ? void 0 : _a.indexOf(WORKFLOW_HIDEFRAME_KEY)) !== -1) {
|
38
39
|
// 如果不是在隐藏框架内跳转,那么直接内部打开
|
39
|
-
|
40
|
+
historyPush(path, state);
|
40
41
|
return;
|
41
42
|
}
|
42
43
|
if (target === '_blank_close' &&
|
@@ -45,7 +46,7 @@ function useHistory(routeBasename) {
|
|
45
46
|
return;
|
46
47
|
}
|
47
48
|
if (target === '_blank_close') {
|
48
|
-
|
49
|
+
historyPush(path, state);
|
49
50
|
return;
|
50
51
|
}
|
51
52
|
if (target === '_blank' ||
|
@@ -112,7 +113,15 @@ function setSession(name, value) {
|
|
112
113
|
}
|
113
114
|
function getSession(name) {
|
114
115
|
if (window.opener && Object.getOwnPropertyNames(window.opener).length > 0) {
|
115
|
-
|
116
|
+
var v = ROUTER_FILTER_RULES_VALUE;
|
117
|
+
try {
|
118
|
+
v = window.opener.sessionStorage.getItem(name);
|
119
|
+
}
|
120
|
+
catch (err) {
|
121
|
+
console.log(err, '=========');
|
122
|
+
v = ROUTER_FILTER_RULES_VALUE;
|
123
|
+
}
|
124
|
+
return v;
|
116
125
|
}
|
117
126
|
else {
|
118
127
|
return sessionStorage.getItem(name);
|
package/dist/workflow.js
CHANGED