ol-base-components 3.1.0 → 3.1.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ol-base-components",
3
- "version": "3.1.0",
3
+ "version": "3.1.2",
4
4
  "private": false,
5
5
  "main": "src/package/index.js",
6
6
  "bin": {
package/src/App.vue CHANGED
@@ -502,141 +502,8 @@ export default {
502
502
  }
503
503
  },
504
504
  aaa() {
505
- // const printEnpty = this.$hiprint({
506
- // printData: {
507
- // name: "CcSimple",
508
- // barcode: "33321323",
509
- // table: [
510
- // { id: "1", name: "王小可123", gender: "男", count: "120", amount: "9089元" },
511
- // { id: "2", name: "梦之遥", gender: "女", count: "20", amount: "89元" },
512
- // ],
513
- // table1: [
514
- // { id: "1", name: "王小可11", gender: "男", count: "120", amount: "9089元" },
515
- // { id: "2", name: "梦之遥", gender: "女", count: "20", amount: "89元" },
516
- // ],
517
- // },
518
- // onPrintData: data => {
519
- // return data;
520
- // },
521
- // onTemplate: data => {
522
- // return data;
523
- // },
524
- // defaultTemplate: {
525
- // panels: [
526
- // {
527
- // index: 0,
528
- // name: 1,
529
- // paperType: "A4",
530
- // height: 297,
531
- // width: 210,
532
- // paperHeader: 0,
533
- // paperFooter: 841.8897637795277,
534
- // printElements: [
535
- // {
536
- // options: {
537
- // left: 117,
538
- // top: 94.5,
539
- // height: 9.75,
540
- // width: 120,
541
- // field: "name",
542
- // testData: "内容",
543
- // title: "文本",
544
- // qid: "name",
545
- // },
546
- // printElementType: {
547
- // title: "文本",
548
- // type: "text",
549
- // },
550
- // },
551
- // {
552
- // options: {
553
- // left: 160.5,
554
- // top: 174,
555
- // height: 36,
556
- // width: 550,
557
- // fields: [],
558
- // field: "table",
559
- // qid: "table",
560
- // columns: [
561
- // [
562
- // {
563
- // width: 137.5,
564
- // title: "名称",
565
- // field: "name",
566
- // checked: true,
567
- // columnId: "name",
568
- // fixed: false,
569
- // rowspan: 1,
570
- // colspan: 1,
571
- // align: "center",
572
- // },
573
- // {
574
- // width: 137.5,
575
- // title: "性别",
576
- // field: "gender",
577
- // checked: true,
578
- // columnId: "gender",
579
- // fixed: false,
580
- // rowspan: 1,
581
- // colspan: 1,
582
- // align: "center",
583
- // },
584
- // {
585
- // width: 137.5,
586
- // title: "数量",
587
- // field: "count",
588
- // checked: true,
589
- // columnId: "count",
590
- // fixed: false,
591
- // rowspan: 1,
592
- // colspan: 1,
593
- // align: "center",
594
- // },
595
- // {
596
- // width: 137.5,
597
- // title: "金额",
598
- // field: "amount",
599
- // checked: true,
600
- // columnId: "amount",
601
- // fixed: false,
602
- // rowspan: 1,
603
- // colspan: 1,
604
- // align: "center",
605
- // },
606
- // ],
607
- // ],
608
- // },
609
- // printElementType: {
610
- // title: "表格",
611
- // type: "table",
612
- // editable: true,
613
- // columnDisplayEditable: true,
614
- // columnDisplayIndexEditable: true,
615
- // columnTitleEditable: true,
616
- // columnResizable: true,
617
- // columnAlignEditable: true,
618
- // isEnableEditField: true,
619
- // isEnableContextMenu: true,
620
- // isEnableInsertRow: true,
621
- // isEnableDeleteRow: true,
622
- // isEnableInsertColumn: true,
623
- // isEnableDeleteColumn: true,
624
- // isEnableMergeCell: true,
625
- // },
626
- // },
627
- // ],
628
- // paperNumberContinue: true,
629
- // watermarkOptions: {},
630
- // panelLayoutOptions: {},
631
- // },
632
- // ],
633
- // },
634
- // onSubmit: data => {
635
- // console.log(6666, data);
636
- // },
637
- // });
638
-
639
- this.$hiprint.print({
505
+ const printEnpty = this.$hiprint({
506
+ grid: true,
640
507
  printData: {
641
508
  name: "CcSimple",
642
509
  barcode: "33321323",
@@ -769,6 +636,140 @@ export default {
769
636
  console.log(6666, data);
770
637
  },
771
638
  });
639
+
640
+ // this.$hiprint.print({
641
+ // printData: {
642
+ // name: "CcSimple",
643
+ // barcode: "33321323",
644
+ // table: [
645
+ // { id: "1", name: "王小可123", gender: "男", count: "120", amount: "9089元" },
646
+ // { id: "2", name: "梦之遥", gender: "女", count: "20", amount: "89元" },
647
+ // ],
648
+ // table1: [
649
+ // { id: "1", name: "王小可11", gender: "男", count: "120", amount: "9089元" },
650
+ // { id: "2", name: "梦之遥", gender: "女", count: "20", amount: "89元" },
651
+ // ],
652
+ // },
653
+ // onPrintData: data => {
654
+ // return data;
655
+ // },
656
+ // onTemplate: data => {
657
+ // return data;
658
+ // },
659
+ // defaultTemplate: {
660
+ // panels: [
661
+ // {
662
+ // index: 0,
663
+ // name: 1,
664
+ // paperType: "A4",
665
+ // height: 297,
666
+ // width: 210,
667
+ // paperHeader: 0,
668
+ // paperFooter: 841.8897637795277,
669
+ // printElements: [
670
+ // {
671
+ // options: {
672
+ // left: 117,
673
+ // top: 94.5,
674
+ // height: 9.75,
675
+ // width: 120,
676
+ // field: "name",
677
+ // testData: "内容",
678
+ // title: "文本",
679
+ // qid: "name",
680
+ // },
681
+ // printElementType: {
682
+ // title: "文本",
683
+ // type: "text",
684
+ // },
685
+ // },
686
+ // {
687
+ // options: {
688
+ // left: 160.5,
689
+ // top: 174,
690
+ // height: 36,
691
+ // width: 550,
692
+ // fields: [],
693
+ // field: "table",
694
+ // qid: "table",
695
+ // columns: [
696
+ // [
697
+ // {
698
+ // width: 137.5,
699
+ // title: "名称",
700
+ // field: "name",
701
+ // checked: true,
702
+ // columnId: "name",
703
+ // fixed: false,
704
+ // rowspan: 1,
705
+ // colspan: 1,
706
+ // align: "center",
707
+ // },
708
+ // {
709
+ // width: 137.5,
710
+ // title: "性别",
711
+ // field: "gender",
712
+ // checked: true,
713
+ // columnId: "gender",
714
+ // fixed: false,
715
+ // rowspan: 1,
716
+ // colspan: 1,
717
+ // align: "center",
718
+ // },
719
+ // {
720
+ // width: 137.5,
721
+ // title: "数量",
722
+ // field: "count",
723
+ // checked: true,
724
+ // columnId: "count",
725
+ // fixed: false,
726
+ // rowspan: 1,
727
+ // colspan: 1,
728
+ // align: "center",
729
+ // },
730
+ // {
731
+ // width: 137.5,
732
+ // title: "金额",
733
+ // field: "amount",
734
+ // checked: true,
735
+ // columnId: "amount",
736
+ // fixed: false,
737
+ // rowspan: 1,
738
+ // colspan: 1,
739
+ // align: "center",
740
+ // },
741
+ // ],
742
+ // ],
743
+ // },
744
+ // printElementType: {
745
+ // title: "表格",
746
+ // type: "table",
747
+ // editable: true,
748
+ // columnDisplayEditable: true,
749
+ // columnDisplayIndexEditable: true,
750
+ // columnTitleEditable: true,
751
+ // columnResizable: true,
752
+ // columnAlignEditable: true,
753
+ // isEnableEditField: true,
754
+ // isEnableContextMenu: true,
755
+ // isEnableInsertRow: true,
756
+ // isEnableDeleteRow: true,
757
+ // isEnableInsertColumn: true,
758
+ // isEnableDeleteColumn: true,
759
+ // isEnableMergeCell: true,
760
+ // },
761
+ // },
762
+ // ],
763
+ // paperNumberContinue: true,
764
+ // watermarkOptions: {},
765
+ // panelLayoutOptions: {},
766
+ // },
767
+ // ],
768
+ // },
769
+ // onSubmit: data => {
770
+ // console.log(6666, data);
771
+ // },
772
+ // });
772
773
  },
773
774
  },
774
775
  };
@@ -12,7 +12,7 @@ let container = null;
12
12
  const Hiprint = {
13
13
  install(Vue) {
14
14
  const hiprint = function (options) {
15
- const { printData, onPrintData, defaultTemplate, onTemplate, onSubmit } = options;
15
+ const { printData, onPrintData, defaultTemplate, onTemplate, onSubmit, grid } = options;
16
16
  // 销毁旧实例
17
17
  if (printInstance) {
18
18
  printInstance.$destroy();
@@ -28,7 +28,9 @@ const Hiprint = {
28
28
  document.body.appendChild(container);
29
29
 
30
30
  const PrintComponent = Vue.extend(OlPrint);
31
- const propsData = {};
31
+ const propsData = {
32
+ grid,
33
+ };
32
34
  if (printData) {
33
35
  propsData.printData = printData;
34
36
  }
@@ -24,6 +24,7 @@
24
24
  :visible.sync="paperPopVisible"
25
25
  width="400px"
26
26
  :append-to-body="true"
27
+ :z-index="3001"
27
28
  >
28
29
  <el-form label-width="80px">
29
30
  <el-form-item label="纸张宽度">
@@ -161,6 +161,7 @@ export default {
161
161
  this.hiprintTemplate.design("#hiprint-printTemplate", {
162
162
  grid: this.grid,
163
163
  });
164
+ console.log(6666, this.hiprintTemplate);
164
165
  },
165
166
  async print() {
166
167
  // 使用外部传入的打印数据
@@ -213,12 +214,13 @@ export default {
213
214
  close() {
214
215
  this.$destroy();
215
216
  this.$el.remove();
217
+ this.$emit("close");
216
218
  },
217
219
  },
218
220
  };
219
221
  </script>
220
222
 
221
- <style>
223
+ <style scoped>
222
224
  /* flex */
223
225
  .flex-row {
224
226
  display: flex;
@@ -441,6 +443,16 @@ button i {
441
443
  border-radius: 4px;
442
444
  box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.15);
443
445
  }
446
+ /* 隐藏 hiprint 打印 iframe,避免影响页面布局 */
447
+ #hiwprint_iframe {
448
+ position: fixed !important;
449
+ top: -9999px !important;
450
+ left: -9999px !important;
451
+ width: 0 !important;
452
+ height: 0 !important;
453
+ visibility: hidden !important;
454
+ opacity: 0 !important;
455
+ }
444
456
  </style>
445
457
  <style scoped>
446
458
  /* api按钮 */
@@ -566,7 +578,7 @@ button i {
566
578
  display: flex;
567
579
  align-items: center;
568
580
  justify-content: center;
569
- z-index: 2000;
581
+ z-index: 3000;
570
582
  }
571
583
 
572
584
  .print-dialog {
@@ -242,8 +242,9 @@
242
242
  </el-row>
243
243
  </div>
244
244
  <printTemplate v-show="false" class="printTemplate" :print-list-obj="printListObj" />
245
- <el-dialog title="打印" :visible.sync="showPrint" fullscreen>
246
- <ol-print v-if="showPrint" />
245
+ <el-dialog title="打印" :visible.sync="showPrint">
246
+ <div>123</div>
247
+ <!-- <ol-print v-if="showPrint" /> -->
247
248
  </el-dialog>
248
249
  </div>
249
250
  </template>
@@ -435,6 +436,10 @@ export default {
435
436
  type: Function,
436
437
  default: null,
437
438
  },
439
+ printUrl: {
440
+ type: String,
441
+ default: "",
442
+ },
438
443
  },
439
444
 
440
445
  data() {
@@ -627,6 +632,8 @@ export default {
627
632
  this.$emit("refreshTable");
628
633
  },
629
634
  printTable() {
635
+ // 获取当前带单路由
636
+ const url = this.printUrl;
630
637
  this.showPrint = true;
631
638
  // console.log("printTable");
632
639
  // if (this.tableData.rows.length <= 0) return;