yh-hiprint 2.6.7 → 2.6.9

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/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import './libs/jquery';
2
- import { ElDialog, ElSelect, ElOption, ElButton, ElMessageBox,ElLoading } from 'element-plus';
3
- import { createApp,createVNode } from 'vue';
2
+ import { ElDialog, ElSelect, ElOption, ElButton, ElMessageBox, ElLoading } from 'element-plus';
3
+ import { createApp, createVNode } from 'vue';
4
4
  export { hiprint, defaultElementTypeProvider, print, print2, usePaper, useScale, useDataSource } from './hooks/useHiprint';
5
5
  export { default as fontSize } from './font-size';
6
6
  export { default as scale } from './scale';
@@ -25,7 +25,7 @@ export function cLog (string, isError = false) {
25
25
  }
26
26
 
27
27
  const hiprintFun = async ({ code, params, data, isCustom, returnHtml }) => {
28
- if (electronBrowserAPI && electronBrowserAPI.print) {
28
+ if (window.electronBrowserAPI && window.electronBrowserAPI.print) {
29
29
  clientPrintHandler(code, params, data);
30
30
  } else {
31
31
  let height = document.documentElement.clientHeight;
@@ -251,15 +251,15 @@ const showPrinterSelectionDialog = (printerList, templateJson, templateData, tem
251
251
 
252
252
  // 添加事件监听器
253
253
  window.addEventListener('message', handlePrintResult);
254
-
254
+
255
255
  // 添加超时机制,防止监听器泄漏
256
256
  const timeoutId = setTimeout(() => {
257
257
  window.removeEventListener('message', handlePrintResult);
258
258
  loading.close();
259
259
  ElMessageBox.alert("打印超时", '提示');
260
260
  this.handleClose(false);
261
- }, 60*1000); // 30秒超时
262
-
261
+ }, 60 * 1000); // 30秒超时
262
+
263
263
  // 发送到客户端打印
264
264
  try {
265
265
  electronBrowserAPI.print(printOption);
@@ -8618,7 +8618,7 @@ var hiprint = (function (t) {
8618
8618
  return !0;
8619
8619
  },
8620
8620
  hasIo: function hasIo (t) {
8621
- return io;
8621
+ return false;
8622
8622
  },
8623
8623
  send: function send (t) {
8624
8624
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yh-hiprint",
3
- "version": "2.6.7",
3
+ "version": "2.6.9",
4
4
  "description": "Hiprint for Vue3 by NoahLiu in ForceCon in Hunan Changesha",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",