ztxkutils 10.0.10 → 10.0.12

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.
@@ -187,6 +187,8 @@ function createPublicDownloadUrl(apiUrl, fileId) {
187
187
  * @param {string} fileName 文件名
188
188
  */
189
189
  function previewFile(fileUrl, fileId, otherOption) {
190
+ var _a;
191
+ var officePreviewType = (_a = window.PREVIEW_FILE_PARAMS) === null || _a === void 0 ? void 0 : _a.officePreviewType;
190
192
  var token = '';
191
193
  if (typeof otherOption === 'object') {
192
194
  token = getToken() || (otherOption === null || otherOption === void 0 ? void 0 : otherOption.authToken);
@@ -211,10 +213,10 @@ function previewFile(fileUrl, fileId, otherOption) {
211
213
  titleName = suffixTitleName
212
214
  ? preTitleName + "." + suffixTitleName
213
215
  : preTitleName;
214
- window.open(_fileUrl + "/attchPreview?attachId=" + fileId + "&Zmdms-Auth=bearer " + token + "&titleName=" + encodeURIComponent(titleName));
216
+ window.open(_fileUrl + "/attchPreview?attachId=" + fileId + "&Zmdms-Auth=bearer " + token + "&titleName=" + encodeURIComponent(titleName) + officePreviewType ? "&officePreviewType=" + officePreviewType : '');
215
217
  }
216
218
  else {
217
- window.open(fileUrl + "/attchPreview?attachId=" + fileId + "&Zmdms-Auth=bearer " + token);
219
+ window.open(fileUrl + "/attchPreview?attachId=" + fileId + "&Zmdms-Auth=bearer " + token + officePreviewType ? "&officePreviewType=" + officePreviewType : '');
218
220
  }
219
221
  }
220
222
  /**
@@ -256,6 +258,8 @@ function batchPreviewFile(fileUrl, fileId, otherOption) {
256
258
  * @param {string} fileType 文件类型
257
259
  */
258
260
  function createOriginalUrl(fileUrl, fileId, otherOption) {
261
+ var _a;
262
+ var officePreviewType = (_a = window.PREVIEW_FILE_PARAMS) === null || _a === void 0 ? void 0 : _a.officePreviewType;
259
263
  var token = getToken() || (otherOption === null || otherOption === void 0 ? void 0 : otherOption.authTOken);
260
264
  var titleName = dangerouslySetXss(otherOption === null || otherOption === void 0 ? void 0 : otherOption.titleName);
261
265
  try {
@@ -274,10 +278,10 @@ function createOriginalUrl(fileUrl, fileId, otherOption) {
274
278
  titleName = suffixTitleName
275
279
  ? preTitleName + "." + suffixTitleName
276
280
  : preTitleName;
277
- return _fileUrl + "/attchPreview?attachId=" + fileId + "&Zmdms-Auth=bearer " + token + "&titleName=" + encodeURIComponent(titleName);
281
+ return _fileUrl + "/attchPreview?attachId=" + fileId + "&Zmdms-Auth=bearer " + token + "&titleName=" + encodeURIComponent(titleName) + officePreviewType ? "&officePreviewType=" + officePreviewType : '';
278
282
  }
279
283
  else {
280
- return _fileUrl + "/attchPreview?attachId=" + fileId + "&Zmdms-Auth=bearer " + token;
284
+ return _fileUrl + "/attchPreview?attachId=" + fileId + "&Zmdms-Auth=bearer " + token + officePreviewType ? "&officePreviewType=" + officePreviewType : '';
281
285
  }
282
286
  }
283
287
  /**
package/dist/print.js CHANGED
@@ -501,9 +501,13 @@ function htmlToPdfNoCanvas(_a) {
501
501
  windowWidth: pageWidth_1,
502
502
  callback: function (res) {
503
503
  // 添加呈现的HTML所需的页面(从第2页开始)
504
- for (var i = 2, j = res.internal.getNumberOfPages(); i <= j; i++) {
505
- pdf_3.addPage(pageFormat, pageOrient);
506
- }
504
+ // for (
505
+ // let i = 2, j = (res as any).internal.getNumberOfPages();
506
+ // i <= j;
507
+ // i++
508
+ // ) {
509
+ // pdf.addPage(pageFormat, pageOrient);
510
+ // }
507
511
  for (var i = 1, j = res.internal.getNumberOfPages(); i <= j; i++) {
508
512
  pdf_3.setPage(i);
509
513
  // 添加水印
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ztxkutils",
3
- "version": "10.0.10",
3
+ "version": "10.0.12",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -1,26 +0,0 @@
1
- import instance from './i18next.js';
2
-
3
- /**
4
- * @description 数据模型创建
5
- */
6
- function createSuccessModel(data, message) {
7
- return {
8
- data: data,
9
- message: message || instance.t('数据请求成功'),
10
- success: true,
11
- };
12
- }
13
- function createErrorModel(message) {
14
- return {
15
- message: message || instance.t('数据请求失败'),
16
- success: false,
17
- };
18
- }
19
-
20
- var dataModel = /*#__PURE__*/Object.freeze({
21
- __proto__: null,
22
- createSuccessModel: createSuccessModel,
23
- createErrorModel: createErrorModel
24
- });
25
-
26
- export { createErrorModel as a, createSuccessModel as c, dataModel as d };
@@ -1,26 +0,0 @@
1
- import instance from './i18next.js';
2
-
3
- /**
4
- * @description 数据模型创建
5
- */
6
- function createSuccessModel(data, message) {
7
- return {
8
- data: data,
9
- message: message || instance.t('数据请求成功'),
10
- success: true,
11
- };
12
- }
13
- function createErrorModel(message) {
14
- return {
15
- message: message || instance.t('数据请求失败'),
16
- success: false,
17
- };
18
- }
19
-
20
- var dataModel = /*#__PURE__*/Object.freeze({
21
- __proto__: null,
22
- createSuccessModel: createSuccessModel,
23
- createErrorModel: createErrorModel
24
- });
25
-
26
- export { createErrorModel as a, createSuccessModel as c, dataModel as d };
package/dist/i18next.d.ts DELETED
@@ -1,2 +0,0 @@
1
- import i18next from 'i18next';
2
- export default i18next;