yh-hiprint 2.6.21 → 2.6.23

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.
@@ -457,6 +457,7 @@
457
457
 
458
458
  function setPaperHandler(type) {
459
459
  setPaper(type, () => {
460
+ if (!hiprintTemplate.value) return;
460
461
  hiprintTemplate.value.setPaper(paperWidth.value, paperHeight.value);
461
462
  });
462
463
  }
@@ -969,6 +970,9 @@
969
970
 
970
971
  onMounted(async () => {
971
972
  await getDataSourceList();
973
+ if (route.query.code) {
974
+ updateTemplate(route.query.code);
975
+ }
972
976
  });
973
977
  </script>
974
978
  <style lang="scss">
package/index.ts CHANGED
@@ -198,8 +198,6 @@ interface InstallOptions {
198
198
  router?: Router | undefined;
199
199
  pinia?: any;
200
200
  isAdmin?: boolean;
201
- isNew?: boolean;
202
- addInitTask: (cl:any) => void
203
201
  }
204
202
 
205
203
  // 客户端打印处理函数
@@ -495,12 +493,13 @@ const serverPrint = (code, params) => {
495
493
  export default {
496
494
  install(
497
495
  app: any,
498
- {router, pinia, clientPrint = false,isNew = false, addInitTask}: InstallOptions & {clientPrint?: boolean}
496
+ config: InstallOptions & {clientPrint?: boolean}
499
497
  ): void {
500
498
  app.provide('$hiprint', hiprintFun);
501
499
  app.provide('$silentHiprint', silentHiprint);
502
-
500
+ const isNew = app.config.globalProperties.$isNew;
503
501
  if(isNew) {
502
+ const {$addInitTask:addInitTask,$router:router} = app.config.globalProperties
504
503
  app.provide("$serverPrint",serverPrint)
505
504
  addInitTask(async () => {
506
505
  if (!router || !router.hasRoute('Index')) return;
@@ -524,6 +523,7 @@ export default {
524
523
  });
525
524
  })
526
525
  } else {
526
+ const {router} = config
527
527
  if (router) {
528
528
  router.addRoute('Index', {
529
529
  path: 'hiprint/designer',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yh-hiprint",
3
- "version": "2.6.21",
3
+ "version": "2.6.23",
4
4
  "description": "Hiprint for Vue3 by NoahLiu in ForceCon in Hunan Changesha",
5
5
  "type": "module",
6
6
  "exports": {