yh-hiprint 2.6.14 → 2.6.15
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.ts +48 -22
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -194,6 +194,8 @@ interface InstallOptions {
|
|
|
194
194
|
router?: any;
|
|
195
195
|
pinia?: any;
|
|
196
196
|
isAdmin?: boolean;
|
|
197
|
+
isNew?: boolean;
|
|
198
|
+
addInitTask: (any) => {}
|
|
197
199
|
}
|
|
198
200
|
|
|
199
201
|
// 客户端打印处理函数
|
|
@@ -480,33 +482,57 @@ import printCss from './libs/css/hiprint.css?inline';
|
|
|
480
482
|
export default {
|
|
481
483
|
install(
|
|
482
484
|
app: any,
|
|
483
|
-
{router, pinia,
|
|
485
|
+
{router, pinia, clientPrint = false,isNew = false, addInitTask}: InstallOptions & {clientPrint?: boolean}
|
|
484
486
|
): void {
|
|
485
487
|
app.provide('$hiprint', hiprintFun);
|
|
486
488
|
app.provide('$silentHiprint', silentHiprint);
|
|
487
489
|
|
|
488
|
-
if
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
490
|
+
if(isNew) {
|
|
491
|
+
addInitTask(async () => {
|
|
492
|
+
if (!router || router.hasRoute('Index')) return;
|
|
493
|
+
router.addRoute('Index', {
|
|
494
|
+
path: 'hiprint/designer',
|
|
495
|
+
name: '打印设计器',
|
|
496
|
+
meta: {
|
|
497
|
+
icon: 'md-planet',
|
|
498
|
+
title: '打印设计器',
|
|
499
|
+
},
|
|
500
|
+
component: () => import('./HiprintDesigner.vue'),
|
|
501
|
+
});
|
|
502
|
+
router.addRoute({
|
|
503
|
+
path: '/preview',
|
|
504
|
+
name: 'printView',
|
|
505
|
+
meta: {
|
|
506
|
+
icon: 'md-planet',
|
|
507
|
+
title: 'printView',
|
|
508
|
+
},
|
|
509
|
+
component: () => import('./hiprintPreview.vue'),
|
|
510
|
+
});
|
|
511
|
+
})
|
|
507
512
|
} else {
|
|
508
|
-
if (
|
|
509
|
-
|
|
513
|
+
if (router) {
|
|
514
|
+
router.addRoute('Index', {
|
|
515
|
+
path: 'hiprint/designer',
|
|
516
|
+
name: '打印设计器',
|
|
517
|
+
meta: {
|
|
518
|
+
icon: 'md-planet',
|
|
519
|
+
title: '打印设计器',
|
|
520
|
+
},
|
|
521
|
+
component: () => import('./HiprintDesigner.vue'),
|
|
522
|
+
});
|
|
523
|
+
router.addRoute({
|
|
524
|
+
path: '/preview',
|
|
525
|
+
name: 'printView',
|
|
526
|
+
meta: {
|
|
527
|
+
icon: 'md-planet',
|
|
528
|
+
title: 'printView',
|
|
529
|
+
},
|
|
530
|
+
component: () => import('./hiprintPreview.vue'),
|
|
531
|
+
});
|
|
532
|
+
} else {
|
|
533
|
+
if (!router) {
|
|
534
|
+
cLog('没有传递 router 对象,所以无法将路由添加到应用中', true);
|
|
535
|
+
}
|
|
510
536
|
}
|
|
511
537
|
}
|
|
512
538
|
},
|