ztxkutils 2.10.14 → 2.10.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.
@@ -51,6 +51,14 @@ export declare function createPublicDownloadUrl(apiUrl: string, fileId: string):
51
51
  * @param {string} fileName 文件名
52
52
  */
53
53
  export declare function previewFile(fileUrl: string, fileId: string, otherOption?: any): void;
54
+ /**
55
+ * @description 批量文件预览方法,只针对图片类型
56
+ * @param {string} fileUrl 文件服务器ip端口
57
+ * @param {string} fileId 文件id
58
+ * @param {string} fileType 文件类型
59
+ * @param {string} fileName 文件名
60
+ */
61
+ export declare function batchPreviewFile(fileUrl: string, fileId: string, otherOption?: any): void;
54
62
  /**
55
63
  * @description 生成原始图片路径
56
64
  * @param {string} fileUrl 文件服务器ip端口
@@ -212,6 +212,38 @@ function previewFile(fileUrl, fileId, otherOption) {
212
212
  window.open(fileUrl + "/attchPreview?attachId=" + fileId + "&Zmdms-Auth=bearer " + token + "&officePreviewType=pdf");
213
213
  }
214
214
  }
215
+ /**
216
+ * @description 批量文件预览方法,只针对图片类型
217
+ * @param {string} fileUrl 文件服务器ip端口
218
+ * @param {string} fileId 文件id
219
+ * @param {string} fileType 文件类型
220
+ * @param {string} fileName 文件名
221
+ */
222
+ function batchPreviewFile(fileUrl, fileId, otherOption) {
223
+ var token = '';
224
+ if (typeof otherOption === 'object') {
225
+ token = getToken() || (otherOption === null || otherOption === void 0 ? void 0 : otherOption.authToken);
226
+ }
227
+ else {
228
+ token = getToken() || otherOption;
229
+ }
230
+ var titleName = dangerouslySetXss(otherOption === null || otherOption === void 0 ? void 0 : otherOption.titleName);
231
+ try {
232
+ titleName = titleName.replaceAll('%', '');
233
+ }
234
+ catch (err) {
235
+ console.log(err);
236
+ }
237
+ var _fileUrl = fileUrl.endsWith('/')
238
+ ? fileUrl.slice(0, fileUrl.length - 1)
239
+ : fileUrl;
240
+ if (titleName) {
241
+ window.open(_fileUrl + "/picturesAttchPreview?attachIds=" + fileId + "&Zmdms-Auth=bearer " + token + "&titleName=" + encodeURIComponent(titleName));
242
+ }
243
+ else {
244
+ window.open(fileUrl + "/picturesAttchPreview?attachIds=" + fileId + "&Zmdms-Auth=bearer " + token);
245
+ }
246
+ }
215
247
  /**
216
248
  * @description 生成原始图片路径
217
249
  * @param {string} fileUrl 文件服务器ip端口
@@ -251,4 +283,4 @@ function createThumbnailUrl(apiUrl, fileId, scale, otherOption) {
251
283
  return _apiUrl + "/api/zmdms-resource/oss/endpoint/thumbnail/" + fileId + "?scale=" + scale + "&Zmdms-Auth=bearer " + token;
252
284
  }
253
285
 
254
- export { batchDownloadFileCallBack, createDownloadUrl, createDownloadUrlNoBase, createOriginalUrl, createPublicDownloadUrl, createThumbnailUrl, downloadFile, downloadFileCallBack, downloadPublicFile, previewFile };
286
+ export { batchDownloadFileCallBack, batchPreviewFile, createDownloadUrl, createDownloadUrlNoBase, createOriginalUrl, createPublicDownloadUrl, createThumbnailUrl, downloadFile, downloadFileCallBack, downloadPublicFile, previewFile };
package/dist/print.js CHANGED
@@ -204,7 +204,7 @@ function htmlToPdfNoCanvas(_a) {
204
204
  allDom = dom.querySelectorAll(pageClassName ? pageClassName : '.html2canvas-container-page');
205
205
  pageFormat = (pdfOption === null || pdfOption === void 0 ? void 0 : pdfOption.pageFormat) ? pdfOption.pageFormat : 'a4';
206
206
  pageOrient = (pdfOption === null || pdfOption === void 0 ? void 0 : pdfOption.pageOrient) ? pdfOption.pageOrient : 'p';
207
- pageMarginX = (_b = pdfOption === null || pdfOption === void 0 ? void 0 : pdfOption.pageMarginX) !== null && _b !== void 0 ? _b : 10;
207
+ pageMarginX = (_b = pdfOption === null || pdfOption === void 0 ? void 0 : pdfOption.pageMarginX) !== null && _b !== void 0 ? _b : 20;
208
208
  pageMarginY = (_c = pdfOption === null || pdfOption === void 0 ? void 0 : pdfOption.pageMarginY) !== null && _c !== void 0 ? _c : 10;
209
209
  pdfOptions = {
210
210
  // 是否压缩生成的PDF
@@ -215,7 +215,8 @@ function htmlToPdfNoCanvas(_a) {
215
215
  // 方向 纵向 'p' 横向 'l'
216
216
  orientation: pageOrient,
217
217
  // 指定坐标时要使用的测量单位
218
- unit: 'px',
218
+ // unit: 'px',
219
+ unit: 'pt',
219
220
  };
220
221
  // 如果需要分页
221
222
  if (allDom.length > 0 && isShowPage) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ztxkutils",
3
- "version": "2.10.14",
3
+ "version": "2.10.16",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",