yh-hiprint 2.2.5 → 2.2.6

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.
@@ -1,157 +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
- }
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
+ }
File without changes