yh-hiprint 1.0.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.
@@ -0,0 +1,339 @@
1
+ @media print {
2
+ body {
3
+ margin: 0px;
4
+ padding: 0px;
5
+ }
6
+ }
7
+
8
+ @page {
9
+ margin: 0;
10
+ }
11
+
12
+ .hiprint-printPaper * {
13
+ box-sizing: border-box;
14
+ -moz-box-sizing: border-box; /* Firefox */
15
+ -webkit-box-sizing: border-box; /* Safari */
16
+ }
17
+
18
+ .hiprint-printPaper *:focus {
19
+ outline: -webkit-focus-ring-color auto 0px;
20
+ }
21
+
22
+ .hiprint-printPaper {
23
+ position: relative;
24
+ padding: 0 0 0 0;
25
+ page-break-after: always;
26
+ -webkit-user-select: none; /* Chrome/Safari/Opera */
27
+ -moz-user-select: none; /* Firefox */
28
+ user-select: none;
29
+ overflow-x: hidden;
30
+ overflow: hidden;
31
+ }
32
+
33
+ .hiprint-printPaper .hiprint-printPaper-content {
34
+ position: relative;
35
+ }
36
+
37
+ /* 火狐浏览器打印 第一页过后 重叠问题 */
38
+ @-moz-document url-prefix() {
39
+ .hiprint-printPaper .hiprint-printPaper-content {
40
+ position: relative;
41
+ margin-top: 20px;
42
+ top: -20px
43
+ }
44
+ }
45
+
46
+ .hiprint-printPaper.design {
47
+ overflow: visible;
48
+ }
49
+
50
+
51
+ .hiprint-printTemplate .hiprint-printPanel {
52
+ page-break-after: always;
53
+ }
54
+
55
+ .hiprint-printPaper, hiprint-printPanel {
56
+ box-sizing: border-box;
57
+ border: 0px;
58
+ }
59
+
60
+ .hiprint-printPanel .hiprint-printPaper:last-child {
61
+ page-break-after: avoid;
62
+ }
63
+
64
+ .hiprint-printTemplate .hiprint-printPanel:last-child {
65
+ page-break-after: avoid;
66
+ }
67
+
68
+ .hiprint-printPaper .hideheaderLinetarget {
69
+ border-top: 0px dashed rgb(201, 190, 190) !important;
70
+ }
71
+
72
+ .hiprint-printPaper .hidefooterLinetarget {
73
+ border-top: 0px dashed rgb(201, 190, 190) !important;
74
+ }
75
+
76
+ .hiprint-printPaper.design {
77
+ border: 1px dashed rgba(170, 170, 170, 0.7);
78
+ }
79
+
80
+ .design .hiprint-printElement-table-content, .design .hiprint-printElement-longText-content {
81
+ overflow: hidden;
82
+ box-sizing: border-box;
83
+ }
84
+
85
+ .design .resize-panel {
86
+ box-sizing: border-box;
87
+ border: 1px dotted;
88
+ }
89
+
90
+ .hiprint-printElement-text {
91
+ background-color: transparent;
92
+ background-repeat: repeat;
93
+ padding: 0 0 0 0;
94
+ border: 0.75pt none rgb(0, 0, 0);
95
+ direction: ltr;
96
+ font-family: 'SimSun';
97
+ font-size: 9pt;
98
+ font-style: normal;
99
+ font-weight: normal;
100
+ padding-bottom: 0pt;
101
+ padding-left: 0pt;
102
+ padding-right: 0pt;
103
+ padding-top: 0pt;
104
+ text-align: left;
105
+ text-decoration: none;
106
+ line-height: 9.75pt;
107
+ box-sizing: border-box;
108
+ word-wrap: break-word;
109
+ word-break: break-all;
110
+ }
111
+
112
+ .design .hiprint-printElement-text-content {
113
+ border: 1px dashed rgb(206, 188, 188);
114
+ box-sizing: border-box;
115
+ }
116
+
117
+ .hiprint-printElement-longText {
118
+ background-color: transparent;
119
+ background-repeat: repeat;
120
+ border: 0.75pt none rgb(0, 0, 0);
121
+ direction: ltr;
122
+ font-family: 'SimSun';
123
+ font-size: 9pt;
124
+ font-style: normal;
125
+ font-weight: normal;
126
+ padding-bottom: 0pt;
127
+ padding-left: 0pt;
128
+ padding-right: 0pt;
129
+ padding-top: 0pt;
130
+ text-align: left;
131
+ text-decoration: none;
132
+ line-height: 9.75pt;
133
+ box-sizing: border-box;
134
+ word-wrap: break-word;
135
+ word-break: break-all;
136
+ /*white-space: pre-wrap*/
137
+ }
138
+
139
+
140
+ .hiprint-printElement-table {
141
+ background-color: transparent;
142
+ background-repeat: repeat;
143
+ color: rgb(0, 0, 0);
144
+ border-color: rgb(0, 0, 0);
145
+ border-style: none;
146
+ direction: ltr;
147
+ font-family: 'SimSun';
148
+ font-size: 9pt;
149
+ font-style: normal;
150
+ font-weight: normal;
151
+ padding-bottom: 0pt;
152
+ padding-left: 0pt;
153
+ padding-right: 0pt;
154
+ padding-top: 0pt;
155
+ text-align: left;
156
+ text-decoration: none;
157
+ padding: 0 0 0 0;
158
+ box-sizing: border-box;
159
+ line-height: 9.75pt;
160
+ }
161
+
162
+ .hiprint-printElement-table thead {
163
+ background: #e8e8e8;
164
+ font-weight: 700;
165
+ }
166
+
167
+ .hiprint-printElement-tableTarget, .hiprint-printElement-tableTarget tr, .hiprint-printElement-tableTarget td {
168
+ border-color: rgb(0, 0, 0);
169
+ /*border-style: none;*/
170
+ /*border: 1px solid rgb(0, 0, 0);*/
171
+ font-weight: normal;
172
+ direction: ltr;
173
+ padding-bottom: 0pt;
174
+ padding-left: 4pt;
175
+ padding-right: 4pt;
176
+ padding-top: 0pt;
177
+ text-decoration: none;
178
+ vertical-align: middle;
179
+ box-sizing: border-box;
180
+ word-wrap: break-word;
181
+ word-break: break-all;
182
+ /*line-height: 9.75pt;
183
+ font-size: 9pt;*/
184
+ }
185
+
186
+ .hiprint-printElement-tableTarget-border-all {
187
+ border: 1px solid;
188
+ }
189
+ .hiprint-printElement-tableTarget-border-none {
190
+ border: 0px solid;
191
+ }
192
+ .hiprint-printElement-tableTarget-border-lr {
193
+ border-left: 1px solid;
194
+ border-right: 1px solid;
195
+ }
196
+ .hiprint-printElement-tableTarget-border-left {
197
+ border-left: 1px solid;
198
+ }
199
+ .hiprint-printElement-tableTarget-border-right {
200
+ border-right: 1px solid;
201
+ }
202
+ .hiprint-printElement-tableTarget-border-tb {
203
+ border-top: 1px solid;
204
+ border-bottom: 1px solid;
205
+ }
206
+ .hiprint-printElement-tableTarget-border-top {
207
+ border-top: 1px solid;
208
+ }
209
+ .hiprint-printElement-tableTarget-border-bottom {
210
+ border-bottom: 1px solid;
211
+ }
212
+
213
+ .hiprint-printElement-tableTarget-border-td-none td {
214
+ border: 0px solid;
215
+ }
216
+ .hiprint-printElement-tableTarget-border-td-all td:not(:last-child) {
217
+ border-right: 1px solid;
218
+ }
219
+
220
+ /*.hiprint-printElement-tableTarget tr,*/
221
+ .hiprint-printElement-tableTarget td {
222
+ height: 18pt;
223
+ }
224
+
225
+ .hiprint-printPaper .hiprint-paperNumber {
226
+ font-size: 9pt;
227
+ }
228
+
229
+ .design .hiprint-printElement-table-handle {
230
+ position: absolute;
231
+ height: 21pt;
232
+ width: 21pt;
233
+ background: red;
234
+ z-index: 1;
235
+ }
236
+
237
+ .hiprint-printPaper .hiprint-paperNumber-disabled {
238
+ float: right !important;
239
+ right: 0 !important;
240
+ color: gainsboro !important;
241
+ }
242
+
243
+ .hiprint-printElement-vline, .hiprint-printElement-hline {
244
+ border: 0px none rgb(0, 0, 0);
245
+
246
+ }
247
+
248
+ .hiprint-printElement-vline {
249
+ border-left: 0.75pt solid #000;
250
+ border-right: 0px none rgb(0, 0, 0) !important;
251
+ border-bottom: 0px none rgb(0, 0, 0) !important;
252
+ border-top: 0px none rgb(0, 0, 0) !important;
253
+ }
254
+
255
+ .hiprint-printElement-hline {
256
+ border-top: 0.75pt solid #000;
257
+ border-right: 0px none rgb(0, 0, 0) !important;
258
+ border-bottom: 0px none rgb(0, 0, 0) !important;
259
+ border-left: 0px none rgb(0, 0, 0) !important;
260
+ }
261
+
262
+ .hiprint-printElement-oval, .hiprint-printElement-rect {
263
+ border: 0.75pt solid #000;
264
+ }
265
+
266
+ .hiprint-text-content-middle {
267
+ }
268
+
269
+ .hiprint-text-content-middle > div {
270
+ display: grid;
271
+ align-items: center;
272
+ }
273
+
274
+ .hiprint-text-content-bottom {
275
+ }
276
+
277
+ .hiprint-text-content-bottom > div {
278
+ display: grid;
279
+ align-items: flex-end;
280
+ }
281
+
282
+ .hiprint-text-content-wrap {
283
+ }
284
+
285
+ .hiprint-text-content-wrap .hiprint-text-content-wrap-nowrap {
286
+ white-space: nowrap;
287
+ }
288
+
289
+ .hiprint-text-content-wrap .hiprint-text-content-wrap-clip {
290
+ white-space: nowrap;
291
+ overflow: hidden;
292
+ text-overflow: clip;
293
+ }
294
+
295
+ .hiprint-text-content-wrap .hiprint-text-content-wrap-ellipsis {
296
+ white-space: nowrap;
297
+ overflow: hidden;
298
+ text-overflow: ellipsis;
299
+ }
300
+
301
+ /*hi-grid-row */
302
+ .hi-grid-row {
303
+ position: relative;
304
+ height: auto;
305
+ margin-right: 0;
306
+ margin-left: 0;
307
+ zoom: 1;
308
+ display: block;
309
+ box-sizing: border-box;
310
+ }
311
+
312
+ .hi-grid-row::after, .hi-grid-row::before {
313
+ display: table;
314
+ content: '';
315
+ box-sizing: border-box;
316
+ }
317
+
318
+ .hi-grid-col {
319
+ display: block;
320
+ box-sizing: border-box;
321
+ position: relative;
322
+ float: left;
323
+ flex: 0 0 auto;
324
+ }
325
+
326
+ .table-grid-row {
327
+ margin-left: -0pt;
328
+ margin-right: -0pt;
329
+ }
330
+
331
+ .tableGridColumnsGutterRow {
332
+ padding-left: 0pt;
333
+ padding-right: 0pt;
334
+ }
335
+
336
+ .hiprint-gridColumnsFooter {
337
+ text-align: left;
338
+ clear: both;
339
+ }
@@ -0,0 +1,157 @@
1
+ export default function (hiprint) {
2
+ return function (options) {
3
+ var addElementTypes = function (context) {
4
+ context.removePrintElementTypes("defaultModule");
5
+ context.addPrintElementTypes("defaultModule", [
6
+ new hiprint.PrintElementTypeGroup("常规", [
7
+ {
8
+ tid: "defaultModule.text",
9
+ title: "文本",
10
+ data: "",
11
+ type: "text",
12
+ },
13
+ {
14
+ tid: "defaultModule.textVal",
15
+ title: "值(文本)",
16
+ data: "",
17
+ type: "text",
18
+ options: {
19
+ hideTitle: true,
20
+ },
21
+ },
22
+ {
23
+ tid: "defaultModule.barcode",
24
+ title: "条形码",
25
+ data: "",
26
+ type: "text",
27
+ options: {
28
+ field: "barcode",
29
+ testData: "lkforntend",
30
+ height: 32,
31
+ fontSize: 12,
32
+ lineHeight: 18,
33
+ textType: "barcode",
34
+ },
35
+ },
36
+ {
37
+ tid: "defaultModule.qrcode",
38
+ title: "二维码",
39
+ data: "",
40
+ type: "text",
41
+ options: {
42
+ testData: "力控远海-技术中心-前端",
43
+ field: "qrcode",
44
+ width: 50,
45
+ height: 50,
46
+ textType: "qrcode",
47
+ },
48
+ },
49
+ {
50
+ tid: "defaultModule.image",
51
+ title: "图片",
52
+ data: "",
53
+ type: "image",
54
+ },
55
+ {
56
+ tid: "defaultModule.longText",
57
+ title: "长文",
58
+ data: "155123456789",
59
+ type: "longText",
60
+ },
61
+ {
62
+ tid: "defaultModule.table",
63
+ field: "table",
64
+ title: "表格",
65
+ type: "table",
66
+ columns: [
67
+ [
68
+ {
69
+ title: "",
70
+ width: 100,
71
+ },
72
+ {
73
+ title: "",
74
+ width: 100,
75
+ },
76
+ ],
77
+ ],
78
+ editable: true,
79
+ tableBorder: "border",
80
+ columnDisplayEditable: true, //列显示是否能编辑
81
+ columnDisplayIndexEditable: true, //列顺序显示是否能编辑
82
+ columnTitleEditable: true, //列标题是否能编辑
83
+ columnResizable: true, //列宽是否能调整
84
+ columnAlignEditable: true, //列对齐是否调整
85
+ isEnableEditField: true, //编辑字段
86
+ isEnableContextMenu: true, //开启右键菜单 默认true
87
+ isEnableInsertRow: true, //插入行
88
+ isEnableDeleteRow: true, //删除行
89
+ isEnableInsertColumn: true, //插入列
90
+ isEnableDeleteColumn: true, //删除列
91
+ isEnableMergeCell: true, //合并单元格
92
+ },
93
+ {
94
+ tid: "defaultModule.emptyTable",
95
+ field: "table",
96
+ title: "空白表格",
97
+ type: "table",
98
+ columns: [
99
+ [
100
+ {
101
+ title: "",
102
+ field: "",
103
+ width: 100,
104
+ },
105
+ {
106
+ title: "",
107
+ field: "",
108
+ width: 100,
109
+ },
110
+ ],
111
+ ],
112
+ },
113
+ {
114
+ tid: "defaultModule.html",
115
+ title: "html",
116
+ formatter: function (data, options) {
117
+ return "<div></div>";
118
+ },
119
+ type: "html",
120
+ },
121
+ {
122
+ tid: "defaultModule.customText",
123
+ title: "自定义文本",
124
+ customText: "自定义文本",
125
+ custom: true,
126
+ type: "text",
127
+ },
128
+ ]),
129
+ new hiprint.PrintElementTypeGroup("辅助", [
130
+ {
131
+ tid: "defaultModule.hline",
132
+ title: "横线",
133
+ type: "hline",
134
+ },
135
+ {
136
+ tid: "defaultModule.vline",
137
+ title: "竖线",
138
+ type: "vline",
139
+ },
140
+ {
141
+ tid: "defaultModule.rect",
142
+ title: "矩形",
143
+ type: "rect",
144
+ },
145
+ {
146
+ tid: "defaultModule.oval",
147
+ title: "椭圆",
148
+ type: "oval",
149
+ },
150
+ ]),
151
+ ]);
152
+ };
153
+ return {
154
+ addElementTypes: addElementTypes,
155
+ };
156
+ };
157
+ }