ol-base-components 2.9.4 → 3.0.0

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.
@@ -0,0 +1,215 @@
1
+ import { hiprint } from "vue-plugin-hiprint";
2
+
3
+ export const provider1 = function () {
4
+ const addElementTypes = context => {
5
+ context.removePrintElementTypes("providerModule1");
6
+ context.addPrintElementTypes("providerModule1", [
7
+ new hiprint.PrintElementTypeGroup("常规", [
8
+ {
9
+ tid: "providerModule2.customText",
10
+ title: "文本",
11
+ customText: "自定义文本",
12
+ custom: true,
13
+ type: "text",
14
+ options: {
15
+ field: "name",
16
+ testData: "内容",
17
+ },
18
+ },
19
+ {
20
+ tid: "providerModule2.longText",
21
+ title: "长文本",
22
+ type: "longText",
23
+ options: {
24
+ field: "test.longText",
25
+ width: 200,
26
+ testData: "长文本分页/不分页测试",
27
+ },
28
+ },
29
+ {
30
+ tid: "providerModule1.type",
31
+ title: "纯文本",
32
+ data: "纯文本",
33
+ type: "text",
34
+ options: {
35
+ testData: "纯文本",
36
+ height: 16,
37
+ fontSize: 15,
38
+ fontWeight: "700",
39
+ textAlign: "center",
40
+ hideTitle: true,
41
+ },
42
+ },
43
+ {
44
+ tid: "providerModule1.platform",
45
+ title: "标题",
46
+ data: "标题",
47
+ type: "text",
48
+ options: {
49
+ field: "platform",
50
+ testData: "平台名称",
51
+ height: 17,
52
+ fontSize: 16.5,
53
+ fontWeight: "700",
54
+ textAlign: "center",
55
+ hideTitle: true,
56
+ },
57
+ },
58
+ {
59
+ tid: "providerModule2.table",
60
+ title: "表格",
61
+ type: "table",
62
+ options: {
63
+ field: "table",
64
+ fields: [
65
+ // { text: "名称", field: "name1" },
66
+ // { text: "性别", field: "gender" },
67
+ // { text: "数量", field: "count" },
68
+ // { text: "金额", field: "amount" },
69
+ ],
70
+ },
71
+ columns: [
72
+ [
73
+ { title: "名称", align: "center", field: "name" },
74
+ { title: "性别", align: "center", field: "gender" },
75
+ { title: "数量", align: "center", field: "count" },
76
+ { title: "金额", align: "center", field: "amount" },
77
+ ],
78
+ ],
79
+ // footerFormatter: function (options, rows, data, currentPageGridRowsData) {
80
+ // console.log(currentPageGridRowsData);
81
+ // if (data && data["totalCap"]) {
82
+ // return `<td style="padding:0 10px" colspan="100">${
83
+ // "应收金额大写: " + data["totalCap"]
84
+ // }</td>`;
85
+ // }
86
+ // return '<td style="padding:0 10px" colspan="100">应收金额大写: </td>';
87
+ // },
88
+ },
89
+ {
90
+ tid: "providerModule1.barcode",
91
+ title: "条形码",
92
+ data: "XS888888888",
93
+ type: "text",
94
+ options: {
95
+ field: "barcode",
96
+ testData: "XS888888888",
97
+ height: 32,
98
+ fontSize: 12,
99
+ lineHeight: 18,
100
+ textAlign: "left",
101
+ textType: "barcode",
102
+ },
103
+ },
104
+ {
105
+ tid: "providerModule1.qrcode",
106
+ title: "二维码",
107
+ data: "XS888888888",
108
+ type: "text",
109
+ options: {
110
+ field: "qrcode",
111
+ testData: "XS888888888",
112
+ height: 32,
113
+ fontSize: 12,
114
+ lineHeight: 18,
115
+ textType: "qrcode",
116
+ },
117
+ },
118
+
119
+ {
120
+ tid: "providerModule1.image",
121
+ title: "图片",
122
+ data: "",
123
+ type: "image",
124
+ },
125
+ ]),
126
+ new hiprint.PrintElementTypeGroup("定制", [
127
+ {
128
+ tid: "providerModule1.khname",
129
+ title: "客户名称",
130
+ data: "高级客户",
131
+ type: "text",
132
+ options: {
133
+ field: "name",
134
+ testData: "高级客户",
135
+ height: 16,
136
+ fontSize: 6.75,
137
+ fontWeight: "700",
138
+ textAlign: "left",
139
+ textContentVerticalAlign: "middle",
140
+ },
141
+ },
142
+ {
143
+ tid: "providerModule1.tel",
144
+ title: "客户电话",
145
+ data: "18888888888",
146
+ type: "text",
147
+ options: {
148
+ field: "tel",
149
+ testData: "18888888888",
150
+ height: 16,
151
+ fontSize: 6.75,
152
+ fontWeight: "700",
153
+ textAlign: "left",
154
+ textContentVerticalAlign: "middle",
155
+ },
156
+ },
157
+ {
158
+ tid: "providerModule1.order",
159
+ title: "订单编号",
160
+ data: "XS888888888",
161
+ type: "text",
162
+ options: {
163
+ field: "order",
164
+ testData: "XS888888888",
165
+ height: 16,
166
+ fontSize: 6.75,
167
+ fontWeight: "700",
168
+ textAlign: "left",
169
+ textContentVerticalAlign: "middle",
170
+ },
171
+ },
172
+ {
173
+ tid: "providerModule1.date",
174
+ title: "业务日期",
175
+ data: "2020-01-01",
176
+ type: "text",
177
+ options: {
178
+ field: "date",
179
+ testData: "2020-01-01",
180
+ height: 16,
181
+ fontSize: 6.75,
182
+ fontWeight: "700",
183
+ textAlign: "left",
184
+ textContentVerticalAlign: "middle",
185
+ },
186
+ },
187
+ ]),
188
+ new hiprint.PrintElementTypeGroup("辅助", [
189
+ {
190
+ tid: "providerModule2.hline",
191
+ title: "横线",
192
+ type: "hline",
193
+ },
194
+ {
195
+ tid: "providerModule2.vline",
196
+ title: "竖线",
197
+ type: "vline",
198
+ },
199
+ {
200
+ tid: "providerModule2.rect",
201
+ title: "矩形",
202
+ type: "rect",
203
+ },
204
+ {
205
+ tid: "providerModule2.oval",
206
+ title: "椭圆",
207
+ type: "oval",
208
+ },
209
+ ]),
210
+ ]);
211
+ };
212
+ return {
213
+ addElementTypes,
214
+ };
215
+ };
@@ -242,6 +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" />
247
+ </el-dialog>
245
248
  </div>
246
249
  </template>
247
250
  <script>
@@ -446,6 +449,7 @@ export default {
446
449
  twinPage: 1,
447
450
  columnsWatcher: null,
448
451
  key: 0,
452
+ showPrint: false,
449
453
  };
450
454
  },
451
455
  computed: {
@@ -623,17 +627,18 @@ export default {
623
627
  this.$emit("refreshTable");
624
628
  },
625
629
  printTable() {
626
- console.log("printTable");
627
- if (this.tableData.rows.length <= 0) return;
628
- this.printListObj.title = this.$router.history.current.name;
629
- this.printListObj.tableHeader = this.tableData.columns;
630
- this.printListObj.tableData = this.tableData.rows;
631
- console.log(this.printListObj);
632
- setTimeout(() => {
633
- $(".printTemplate").show();
634
- $(".printTemplate").jqprint();
635
- $(".printTemplate").hide();
636
- }, 50);
630
+ this.showPrint = true;
631
+ // console.log("printTable");
632
+ // if (this.tableData.rows.length <= 0) return;
633
+ // this.printListObj.title = this.$router.history.current.name;
634
+ // this.printListObj.tableHeader = this.tableData.columns;
635
+ // this.printListObj.tableData = this.tableData.rows;
636
+ // console.log(this.printListObj);
637
+ // setTimeout(() => {
638
+ // $(".printTemplate").show();
639
+ // $(".printTemplate").jqprint();
640
+ // $(".printTemplate").hide();
641
+ // }, 50);
637
642
  this.$emit("printTable");
638
643
  },
639
644
  selectAll(val) {