ztxkutils 10.0.11 → 10.0.13

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,11 @@ 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 +
220
+ (officePreviewType ? "&officePreviewType=" + officePreviewType : ''));
218
221
  }
219
222
  }
220
223
  /**
@@ -256,6 +259,8 @@ function batchPreviewFile(fileUrl, fileId, otherOption) {
256
259
  * @param {string} fileType 文件类型
257
260
  */
258
261
  function createOriginalUrl(fileUrl, fileId, otherOption) {
262
+ var _a;
263
+ var officePreviewType = (_a = window.PREVIEW_FILE_PARAMS) === null || _a === void 0 ? void 0 : _a.officePreviewType;
259
264
  var token = getToken() || (otherOption === null || otherOption === void 0 ? void 0 : otherOption.authTOken);
260
265
  var titleName = dangerouslySetXss(otherOption === null || otherOption === void 0 ? void 0 : otherOption.titleName);
261
266
  try {
@@ -274,10 +279,11 @@ function createOriginalUrl(fileUrl, fileId, otherOption) {
274
279
  titleName = suffixTitleName
275
280
  ? preTitleName + "." + suffixTitleName
276
281
  : preTitleName;
277
- return _fileUrl + "/attchPreview?attachId=" + fileId + "&Zmdms-Auth=bearer " + token + "&titleName=" + encodeURIComponent(titleName);
282
+ return (_fileUrl + "/attchPreview?attachId=" + fileId + "&Zmdms-Auth=bearer " + token + "&titleName=" + encodeURIComponent(titleName) + (officePreviewType ? "&officePreviewType=" + officePreviewType : ''));
278
283
  }
279
284
  else {
280
- return _fileUrl + "/attchPreview?attachId=" + fileId + "&Zmdms-Auth=bearer " + token;
285
+ return (_fileUrl + "/attchPreview?attachId=" + fileId + "&Zmdms-Auth=bearer " + token +
286
+ (officePreviewType ? "&officePreviewType=" + officePreviewType : ''));
281
287
  }
282
288
  }
283
289
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ztxkutils",
3
- "version": "10.0.11",
3
+ "version": "10.0.13",
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;