ztxkutils 2.6.1 → 2.6.4

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/index.js CHANGED
@@ -3,7 +3,7 @@ export { d as dataModel } from './dataModel-1fbaff40.js';
3
3
  export { t as tools } from './tools-d8a41730.js';
4
4
  export { v as validate } from './validate-e43b3240.js';
5
5
  export { r as request } from './request-af3b5774.js';
6
- export { r as reqUrl } from './reqUrl-eb6532ce.js';
6
+ export { r as reqUrl } from './reqUrl-b17264f9.js';
7
7
  import './tslib.es6-f9459658.js';
8
8
  import 'dayjs';
9
9
  import 'number-precision';
package/dist/print.d.ts CHANGED
@@ -16,9 +16,10 @@ interface IParams {
16
16
  hiddenClassNames?: string[];
17
17
  }
18
18
  export declare function printCurrentDom({ hiddenClassNames }?: IParams): void;
19
- export declare function htmlToPdf({ pageClassName, dom, pdfName, }: {
19
+ export declare function htmlToPdf({ pageClassName, dom, pdfName, isShowPage, }: {
20
20
  pageClassName?: string;
21
21
  dom: HTMLElement;
22
22
  pdfName: string;
23
+ isShowPage?: boolean;
23
24
  }): Promise<void>;
24
25
  export {};
package/dist/print.js CHANGED
@@ -102,10 +102,10 @@ function createPdf(canvas, pdf) {
102
102
  }
103
103
  }
104
104
  function htmlToPdf(_a) {
105
- var pageClassName = _a.pageClassName, dom = _a.dom, pdfName = _a.pdfName;
105
+ var pageClassName = _a.pageClassName, dom = _a.dom, pdfName = _a.pdfName, isShowPage = _a.isShowPage;
106
106
  var pdf = new jsPDF(undefined, 'pt', 'a4');
107
107
  var allDom = document.querySelectorAll(pageClassName ? pageClassName : '.html2canvas-container-page');
108
- if (allDom.length > 0) {
108
+ if (allDom.length > 0 && isShowPage) {
109
109
  var allDomArray = Array.prototype.slice.call(allDom);
110
110
  var promiseAllDomArray_1 = allDomArray.map(function (dom) { return html2canvas(dom); });
111
111
  return (function () {
@@ -0,0 +1,55 @@
1
+ /**
2
+ * @file 项目基本配置,包括各个环境的请求地址
3
+ */
4
+ // 环境变量
5
+ function getReqUrl(processObj) {
6
+ var ENV = processObj.REACT_APP_ENV;
7
+ // api服务器各个环境地址
8
+ var ZT_API_DEV = processObj.REACT_APP_ZT_API_DEV || 'http://192.168.0.83:8000'; // 开发环境
9
+ var ZT_API_TEST = processObj.REACT_APP_ZT_API_TEST || window.location.origin; // 测试环境 https://192.168.0.135:8000
10
+ var ZT_API_STAGE = processObj.REACT_APP_ZT_API_STAGE || window.location.origin; // 阶段性环境 http://192.168.0.134:8000
11
+ var ZT_API_PRODUCT = processObj.REACT_APP_ZT_API_PRODUCT || window.location.origin; // 生产环境 http://dz.zmd.com.cn
12
+ var ZT_API_PUBLIC_PRODUCT = processObj.REACT_APP_ZT_API_PUBLIC_PRODUCT || 'https://dz.zmd.com.cn:48000'; // 生产环境外网api地址 http://dz.zmd.com.cn:8000
13
+ // 文件服务器
14
+ var ZT_FILE_PREVIEW_DEV = processObj.REACT_APP_ZT_FILE_PREVIEW_DEV || 'http://192.168.0.83:88'; // 开发环境
15
+ var ZT_FILE_PREVIEW_TEST = processObj.REACT_APP_ZT_FILE_PREVIEW_TEST || 'https://192.168.0.135:18012'; // 测试环境
16
+ var ZT_FILE_PREVIEW_STAGE = processObj.REACT_APP_ZT_FILE_PREVIEW_STAGE || 'http://192.168.0.134:8012'; // 阶段性环境
17
+ var ZT_FILE_PREVIEW_PRODUCT = processObj.REACT_APP_ZT_FILE_PREVIEW_PRODUCT ||
18
+ 'https://dzfile.zmd.com.cn:8012'; // 生产环境
19
+ // 实际api请求地址
20
+ var ZT_API_BASEURL = ZT_API_DEV;
21
+ var ZT_API_PUBLICURL = ZT_API_PUBLIC_PRODUCT;
22
+ var ZT_FILE_BASEURL = ZT_FILE_PREVIEW_DEV;
23
+ if (ENV) {
24
+ switch (ENV.toLowerCase()) {
25
+ case 'zt-dev':
26
+ ZT_API_BASEURL = ZT_API_DEV;
27
+ ZT_API_PUBLICURL = ZT_API_DEV;
28
+ ZT_FILE_BASEURL = ZT_FILE_PREVIEW_DEV;
29
+ break;
30
+ case 'zt-test':
31
+ ZT_API_BASEURL = ZT_API_TEST;
32
+ ZT_API_PUBLICURL = ZT_API_TEST;
33
+ ZT_FILE_BASEURL = ZT_FILE_PREVIEW_TEST;
34
+ break;
35
+ case 'zt-stage':
36
+ ZT_API_BASEURL = ZT_API_STAGE;
37
+ ZT_API_PUBLICURL = ZT_API_STAGE;
38
+ ZT_FILE_BASEURL = ZT_FILE_PREVIEW_STAGE;
39
+ break;
40
+ case 'zt-product':
41
+ ZT_API_BASEURL = ZT_API_PRODUCT;
42
+ ZT_API_PUBLICURL = ZT_API_PUBLICURL;
43
+ ZT_FILE_BASEURL = ZT_FILE_PREVIEW_PRODUCT;
44
+ break;
45
+ }
46
+ }
47
+ return { ZT_API_BASEURL: ZT_API_BASEURL, ZT_FILE_BASEURL: ZT_FILE_BASEURL, ZT_API_PUBLICURL: ZT_API_PUBLICURL };
48
+ }
49
+
50
+ var reqUrl = /*#__PURE__*/Object.freeze({
51
+ __proto__: null,
52
+ getReqUrl: getReqUrl
53
+ });
54
+
55
+ export { getReqUrl as g, reqUrl as r };
package/dist/reqUrl.js CHANGED
@@ -1 +1 @@
1
- export { g as getReqUrl } from './reqUrl-eb6532ce.js';
1
+ export { g as getReqUrl } from './reqUrl-b17264f9.js';
@@ -1,4 +1,4 @@
1
- import Stomp from 'stompjs';
1
+ import Stomp from 'zt-stompjs';
2
2
  import SockJS from 'zt-sockjs-client';
3
3
  import { g as getToken } from './authority-fad2028d.js';
4
4
 
@@ -108,7 +108,7 @@ var StompClient = /** @class */ (function () {
108
108
  ((_a = _this.connectWsConfig.reconnectionTime) !== null && _a !== void 0 ? _a : 3000);
109
109
  setTimeout(function () {
110
110
  _this.init();
111
- }, timeInterval > 30000 ? 30000 : timeInterval);
111
+ }, timeInterval > 10000 ? 10000 : timeInterval);
112
112
  });
113
113
  });
114
114
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ztxkutils",
3
- "version": "2.6.1",
3
+ "version": "2.6.4",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -30,6 +30,8 @@
30
30
  "eslint-config-prettier": "^8.1.0",
31
31
  "eslint-plugin-prettier": "^3.3.1",
32
32
  "eslint-webpack-plugin": "^2.5.4",
33
+ "html2canvas": "^1.4.1",
34
+ "jspdf": "^2.5.1",
33
35
  "lodash": "^4.17.21",
34
36
  "number-precision": "^1.5.0",
35
37
  "prettier": "^2.2.1",
@@ -49,17 +51,18 @@
49
51
  "screenfull": "^5.1.0",
50
52
  "sockjs-client": "^1.5.1",
51
53
  "stompjs": "^2.3.3",
52
- "zt-sockjs-client": "^0.0.1"
54
+ "zt-sockjs-client": "^0.0.1",
55
+ "zt-stompjs": "^1.0.3"
53
56
  },
54
57
  "peerDependencies": {
55
58
  "axios": ">=0.21.1",
56
59
  "dayjs": ">=1.10.4",
60
+ "html2canvas": ">=1.4.1",
61
+ "jspdf": ">=2.5.1",
57
62
  "lodash": ">=4.17.21",
58
63
  "number-precision": ">=1.5.0",
59
64
  "react": ">=17.0.1",
60
65
  "react-dom": ">=17.0.1",
61
- "ztxkui": ">=0.4.1",
62
- "jspdf": ">=2.5.1",
63
- "html2canvas": ">=1.4.1"
66
+ "ztxkui": ">=0.4.1"
64
67
  }
65
68
  }
@@ -1,7 +0,0 @@
1
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
2
-
3
- function commonjsRequire (path) {
4
- throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
5
- }
6
-
7
- export { commonjsRequire as a, commonjsGlobal as c };