ztxkutils 4.0.0 → 4.0.1

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.
@@ -202,7 +202,7 @@ function previewFile(fileUrl, fileId, otherOption) {
202
202
  catch (err) {
203
203
  console.log(err);
204
204
  }
205
- var _fileUrl = fileUrl.endsWith('/')
205
+ fileUrl.endsWith('/')
206
206
  ? fileUrl.slice(0, fileUrl.length - 1)
207
207
  : fileUrl;
208
208
  if (titleName) {
@@ -212,10 +212,20 @@ function previewFile(fileUrl, fileId, otherOption) {
212
212
  titleName = suffixTitleName
213
213
  ? preTitleName + "." + suffixTitleName
214
214
  : preTitleName;
215
- window.open(_fileUrl + "/attchPreview?attachId=" + fileId + "&" + TOKEN_KEY + "=bearer " + token + "&titleName=" + encodeURIComponent(titleName) + "&officePreviewType=pdf");
215
+ // 2023-12-30 修改成数字中心预览
216
+ window.open("/api/cicoms-cicohr-org/cicomscicohr/v1/common/filePreview?attachId=" + fileId + "&" + TOKEN_KEY + "=" + token);
217
+ // window.open(
218
+ // `${_fileUrl}/attchPreview?attachId=${fileId}&${TOKEN_KEY}=bearer ${token}&titleName=${encodeURIComponent(
219
+ // titleName
220
+ // )}&officePreviewType=pdf`
221
+ // );
216
222
  }
217
223
  else {
218
- window.open(fileUrl + "/attchPreview?attachId=" + fileId + "&" + TOKEN_KEY + "=bearer " + token + "&officePreviewType=pdf");
224
+ // 2023-12-30 修改成数字中心预览
225
+ window.open("/api/cicoms-cicohr-org/cicomscicohr/v1/common/filePreview?attachId=" + fileId + "&" + TOKEN_KEY + "=" + token);
226
+ // window.open(
227
+ // `${fileUrl}/attchPreview?attachId=${fileId}&${TOKEN_KEY}=bearer ${token}&officePreviewType=pdf`
228
+ // );
219
229
  }
220
230
  }
221
231
  /**
@@ -240,15 +250,22 @@ function batchPreviewFile(fileUrl, fileId, otherOption) {
240
250
  catch (err) {
241
251
  console.log(err);
242
252
  }
243
- var _fileUrl = fileUrl.endsWith('/')
253
+ fileUrl.endsWith('/')
244
254
  ? fileUrl.slice(0, fileUrl.length - 1)
245
255
  : fileUrl;
246
- if (titleName) {
247
- window.open(_fileUrl + "/picturesAttchPreview?attachIds=" + fileId + "&" + TOKEN_KEY + "=bearer " + token + "&titleName=" + encodeURIComponent(titleName));
248
- }
249
- else {
250
- window.open(fileUrl + "/picturesAttchPreview?attachIds=" + fileId + "&" + TOKEN_KEY + "=bearer " + token);
251
- }
256
+ // 2023-12-30 修改成数字中心预览
257
+ window.open("/api/cicoms-cicohr-org/cicomscicohr/v1/common/filePreview?attachId=" + fileId + "&" + TOKEN_KEY + "=" + token);
258
+ // if (titleName) {
259
+ // window.open(
260
+ // `${_fileUrl}/picturesAttchPreview?attachIds=${fileId}&${TOKEN_KEY}=bearer ${token}&titleName=${encodeURIComponent(
261
+ // titleName
262
+ // )}`
263
+ // );
264
+ // } else {
265
+ // window.open(
266
+ // `${fileUrl}/picturesAttchPreview?attachIds=${fileId}&${TOKEN_KEY}=bearer ${token}`
267
+ // );
268
+ // }
252
269
  }
253
270
  /**
254
271
  * @description 生成原始图片路径
@@ -265,7 +282,7 @@ function createOriginalUrl(fileUrl, fileId, otherOption) {
265
282
  catch (err) {
266
283
  console.log(err);
267
284
  }
268
- var _fileUrl = fileUrl.endsWith('/')
285
+ fileUrl.endsWith('/')
269
286
  ? fileUrl.slice(0, fileUrl.length - 1)
270
287
  : fileUrl;
271
288
  if (titleName) {
@@ -275,10 +292,14 @@ function createOriginalUrl(fileUrl, fileId, otherOption) {
275
292
  titleName = suffixTitleName
276
293
  ? preTitleName + "." + suffixTitleName
277
294
  : preTitleName;
278
- return _fileUrl + "/attchPreview?attachId=" + fileId + "&" + TOKEN_KEY + "=bearer " + token + "&titleName=" + encodeURIComponent(titleName) + "&officePreviewType=pdf";
295
+ return "/api/cicoms-cicohr-org/cicomscicohr/v1/common/filePreview?attachId=" + fileId + "&" + TOKEN_KEY + "=" + token;
296
+ // return `${_fileUrl}/attchPreview?attachId=${fileId}&${TOKEN_KEY}=bearer ${token}&titleName=${encodeURIComponent(
297
+ // titleName
298
+ // )}&officePreviewType=pdf`;
279
299
  }
280
300
  else {
281
- return _fileUrl + "/attchPreview?attachId=" + fileId + "&" + TOKEN_KEY + "=bearer " + token + "&officePreviewType=pdf";
301
+ return "/api/cicoms-cicohr-org/cicomscicohr/v1/common/filePreview?attachId=" + fileId + "&" + TOKEN_KEY + "=" + token;
302
+ // return `${_fileUrl}/attchPreview?attachId=${fileId}&${TOKEN_KEY}=bearer ${token}&officePreviewType=pdf`;
282
303
  }
283
304
  }
284
305
  /**