yh-hiprint 2.2.9 → 2.2.10
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/CHANGE.md +2 -2
- package/HiprintDesigner.vue +766 -766
- package/README.md +145 -145
- package/column-field.js +40 -40
- package/designer.vue +742 -742
- package/hiprint.js +35 -35
- package/hiprint.vue +13 -13
- package/hiprintPreview.vue +161 -161
- package/hooks/useHiprint.js +216 -216
- package/index.d.ts +67 -67
- package/index.js +65 -65
- package/libs/hiprint.bundle.js +12645 -12645
- package/package.json +23 -23
- package/z-index.js +35 -35
package/hooks/useHiprint.js
CHANGED
|
@@ -1,216 +1,216 @@
|
|
|
1
|
-
import { hiprint as h, defaultElementTypeProvider as p } from "../libs/hiprint.bundle.js";
|
|
2
|
-
// 调用浏览器打印js
|
|
3
|
-
import "../libs/plugins/jquery.hiwprint.js";
|
|
4
|
-
// 默认配置
|
|
5
|
-
import "../libs/hiprint.config.js";
|
|
6
|
-
// 样式
|
|
7
|
-
import "../libs/css/hiprint.css";
|
|
8
|
-
import "../libs/css/print-lock.css";
|
|
9
|
-
import { ref, computed, watch } from "vue";
|
|
10
|
-
|
|
11
|
-
export const hiprint = h;
|
|
12
|
-
export const defaultElementTypeProvider = p;
|
|
13
|
-
|
|
14
|
-
export function print(provider = defaultElementTypeProvider, template, ...args) {
|
|
15
|
-
hiprint.init({
|
|
16
|
-
providers: [new provider()],
|
|
17
|
-
});
|
|
18
|
-
const hiprintTemplate = new hiprint.PrintTemplate({
|
|
19
|
-
template: template,
|
|
20
|
-
});
|
|
21
|
-
hiprintTemplate.print(...args);
|
|
22
|
-
return hiprintTemplate;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export function print2(provider = defaultElementTypeProvider, template, ...args) {
|
|
26
|
-
hiprint.init({
|
|
27
|
-
providers: [new provider()],
|
|
28
|
-
});
|
|
29
|
-
const hiprintTemplate = new hiprint.PrintTemplate({
|
|
30
|
-
template: template,
|
|
31
|
-
});
|
|
32
|
-
hiprintTemplate.print2(...args);
|
|
33
|
-
return hiprintTemplate;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export function usePaper() {
|
|
37
|
-
const paperType = ref("A4");
|
|
38
|
-
const paperWidth = ref(210);
|
|
39
|
-
const paperHeight = ref(296.6);
|
|
40
|
-
|
|
41
|
-
const paperTypes = {
|
|
42
|
-
A3: {
|
|
43
|
-
width: 420,
|
|
44
|
-
height: 297,
|
|
45
|
-
},
|
|
46
|
-
A4: {
|
|
47
|
-
width: 210,
|
|
48
|
-
height: 297,
|
|
49
|
-
},
|
|
50
|
-
A5: {
|
|
51
|
-
width: 210,
|
|
52
|
-
height: 148,
|
|
53
|
-
},
|
|
54
|
-
B3: {
|
|
55
|
-
width: 500,
|
|
56
|
-
height: 353,
|
|
57
|
-
},
|
|
58
|
-
B4: {
|
|
59
|
-
width: 250,
|
|
60
|
-
height: 353,
|
|
61
|
-
},
|
|
62
|
-
B5: {
|
|
63
|
-
width: 250,
|
|
64
|
-
height: 176,
|
|
65
|
-
},
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
function setPaper(type, callback) {
|
|
69
|
-
if (type !== "other") {
|
|
70
|
-
let { width, height } = paperTypes[type];
|
|
71
|
-
paperWidth.value = width;
|
|
72
|
-
paperHeight.value = height;
|
|
73
|
-
}
|
|
74
|
-
callback();
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
watch([paperWidth, paperHeight], (width, height) => {
|
|
78
|
-
if (width === 420 && height === 297) {
|
|
79
|
-
paperType.value = "A3";
|
|
80
|
-
} else if (width === 210 && height === 297) {
|
|
81
|
-
paperType.value = "A4";
|
|
82
|
-
} else if (width === 210 && height === 148) {
|
|
83
|
-
paperType.value = "A5";
|
|
84
|
-
} else if (width === 500 && height === 353) {
|
|
85
|
-
paperType.value = "B3";
|
|
86
|
-
} else if (width === 250 && height === 353) {
|
|
87
|
-
paperType.value = "B4";
|
|
88
|
-
} else if (width === 250 && height === 176) {
|
|
89
|
-
paperType.value = "B5";
|
|
90
|
-
} else {
|
|
91
|
-
paperType.value = "other";
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
return {
|
|
96
|
-
paperType,
|
|
97
|
-
paperWidth,
|
|
98
|
-
paperHeight,
|
|
99
|
-
setPaper,
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
export function useScale(callback) {
|
|
104
|
-
const scaleValue = ref(1);
|
|
105
|
-
const scalePercentage = computed(() => {
|
|
106
|
-
return `${(scaleValue.value * 100).toFixed(0)}%`;
|
|
107
|
-
});
|
|
108
|
-
const canZoomIn = computed(() => {
|
|
109
|
-
return scaleValue.value > 0.5;
|
|
110
|
-
});
|
|
111
|
-
const canZoomOut = computed(() => {
|
|
112
|
-
return scaleValue.value < 4;
|
|
113
|
-
});
|
|
114
|
-
function zoomIn() {
|
|
115
|
-
scaleValue.value = scaleValue.value - 0.1;
|
|
116
|
-
callback();
|
|
117
|
-
}
|
|
118
|
-
function zoomOut() {
|
|
119
|
-
scaleValue.value = scaleValue.value + 0.1;
|
|
120
|
-
callback();
|
|
121
|
-
}
|
|
122
|
-
return {
|
|
123
|
-
scaleValue,
|
|
124
|
-
scalePercentage,
|
|
125
|
-
canZoomIn,
|
|
126
|
-
canZoomOut,
|
|
127
|
-
zoomIn,
|
|
128
|
-
zoomOut,
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
export function useDataSource(axios) {
|
|
133
|
-
const detailData = ref();
|
|
134
|
-
function getDetail(id) {
|
|
135
|
-
return axios
|
|
136
|
-
.request({
|
|
137
|
-
url: `/printTemplate/get/${id}`,
|
|
138
|
-
method: "post",
|
|
139
|
-
})
|
|
140
|
-
.then((res) => {
|
|
141
|
-
if (res.data.data && res.data.data.sourceCodes) {
|
|
142
|
-
let codes = res.data.data.sourceCodes.split(",");
|
|
143
|
-
let formListCode = dataSourceForm.value.map((item) => item.value);
|
|
144
|
-
codes = codes.filter((item) => formListCode.includes(item));
|
|
145
|
-
formCode.value = codes;
|
|
146
|
-
} else {
|
|
147
|
-
formCode.value = "";
|
|
148
|
-
}
|
|
149
|
-
detailData.value = res.data.data;
|
|
150
|
-
return Promise.resolve(res.data.data);
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
const listCode = ref([]);
|
|
154
|
-
const dataSourceList = ref([]);
|
|
155
|
-
const listColumns = computed(() => {
|
|
156
|
-
return codeMapDataSource.value[listCode.value].map((item) => {
|
|
157
|
-
let index = item.indexOf("[");
|
|
158
|
-
return item.substring(index + 1, item.length - 1);
|
|
159
|
-
});
|
|
160
|
-
});
|
|
161
|
-
|
|
162
|
-
const formCode = ref([]);
|
|
163
|
-
const formColumns = computed(() => {
|
|
164
|
-
let arr = [];
|
|
165
|
-
if (formCode.value && formCode.value.length) {
|
|
166
|
-
formCode.value.forEach((item) => {
|
|
167
|
-
arr = arr.concat(codeMapDataSource.value[item]);
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
return arr;
|
|
171
|
-
});
|
|
172
|
-
const dataSourceForm = ref([]);
|
|
173
|
-
const codeMapDataSource = ref({});
|
|
174
|
-
function getDataSourceList() {
|
|
175
|
-
return axios
|
|
176
|
-
.request({
|
|
177
|
-
url: "/printTemplate/getDsList",
|
|
178
|
-
method: "post",
|
|
179
|
-
})
|
|
180
|
-
.then((res) => {
|
|
181
|
-
res.data.list.forEach((item) => {
|
|
182
|
-
if (item.columns) {
|
|
183
|
-
codeMapDataSource.value[item.code] = item?.columns?.split(",")?.map((col) => `$${item.code}[${col.toUpperCase()}]`) || [];
|
|
184
|
-
}
|
|
185
|
-
if (item.type === "LIST") {
|
|
186
|
-
dataSourceList.value.push({
|
|
187
|
-
label: item.name,
|
|
188
|
-
value: item.code,
|
|
189
|
-
});
|
|
190
|
-
} else {
|
|
191
|
-
dataSourceForm.value.push({
|
|
192
|
-
label: item.name,
|
|
193
|
-
value: item.code,
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
});
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
const dataSource = ref([]);
|
|
201
|
-
return {
|
|
202
|
-
detailData,
|
|
203
|
-
getDetail,
|
|
204
|
-
listCode,
|
|
205
|
-
dataSourceList,
|
|
206
|
-
listColumns,
|
|
207
|
-
formCode,
|
|
208
|
-
formColumns,
|
|
209
|
-
dataSourceForm,
|
|
210
|
-
codeMapDataSource,
|
|
211
|
-
getDataSourceList,
|
|
212
|
-
dataSource,
|
|
213
|
-
};
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
window.hiprint = hiprint;
|
|
1
|
+
import { hiprint as h, defaultElementTypeProvider as p } from "../libs/hiprint.bundle.js";
|
|
2
|
+
// 调用浏览器打印js
|
|
3
|
+
import "../libs/plugins/jquery.hiwprint.js";
|
|
4
|
+
// 默认配置
|
|
5
|
+
import "../libs/hiprint.config.js";
|
|
6
|
+
// 样式
|
|
7
|
+
import "../libs/css/hiprint.css";
|
|
8
|
+
import "../libs/css/print-lock.css";
|
|
9
|
+
import { ref, computed, watch } from "vue";
|
|
10
|
+
|
|
11
|
+
export const hiprint = h;
|
|
12
|
+
export const defaultElementTypeProvider = p;
|
|
13
|
+
|
|
14
|
+
export function print(provider = defaultElementTypeProvider, template, ...args) {
|
|
15
|
+
hiprint.init({
|
|
16
|
+
providers: [new provider()],
|
|
17
|
+
});
|
|
18
|
+
const hiprintTemplate = new hiprint.PrintTemplate({
|
|
19
|
+
template: template,
|
|
20
|
+
});
|
|
21
|
+
hiprintTemplate.print(...args);
|
|
22
|
+
return hiprintTemplate;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function print2(provider = defaultElementTypeProvider, template, ...args) {
|
|
26
|
+
hiprint.init({
|
|
27
|
+
providers: [new provider()],
|
|
28
|
+
});
|
|
29
|
+
const hiprintTemplate = new hiprint.PrintTemplate({
|
|
30
|
+
template: template,
|
|
31
|
+
});
|
|
32
|
+
hiprintTemplate.print2(...args);
|
|
33
|
+
return hiprintTemplate;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function usePaper() {
|
|
37
|
+
const paperType = ref("A4");
|
|
38
|
+
const paperWidth = ref(210);
|
|
39
|
+
const paperHeight = ref(296.6);
|
|
40
|
+
|
|
41
|
+
const paperTypes = {
|
|
42
|
+
A3: {
|
|
43
|
+
width: 420,
|
|
44
|
+
height: 297,
|
|
45
|
+
},
|
|
46
|
+
A4: {
|
|
47
|
+
width: 210,
|
|
48
|
+
height: 297,
|
|
49
|
+
},
|
|
50
|
+
A5: {
|
|
51
|
+
width: 210,
|
|
52
|
+
height: 148,
|
|
53
|
+
},
|
|
54
|
+
B3: {
|
|
55
|
+
width: 500,
|
|
56
|
+
height: 353,
|
|
57
|
+
},
|
|
58
|
+
B4: {
|
|
59
|
+
width: 250,
|
|
60
|
+
height: 353,
|
|
61
|
+
},
|
|
62
|
+
B5: {
|
|
63
|
+
width: 250,
|
|
64
|
+
height: 176,
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
function setPaper(type, callback) {
|
|
69
|
+
if (type !== "other") {
|
|
70
|
+
let { width, height } = paperTypes[type];
|
|
71
|
+
paperWidth.value = width;
|
|
72
|
+
paperHeight.value = height;
|
|
73
|
+
}
|
|
74
|
+
callback();
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
watch([paperWidth, paperHeight], (width, height) => {
|
|
78
|
+
if (width === 420 && height === 297) {
|
|
79
|
+
paperType.value = "A3";
|
|
80
|
+
} else if (width === 210 && height === 297) {
|
|
81
|
+
paperType.value = "A4";
|
|
82
|
+
} else if (width === 210 && height === 148) {
|
|
83
|
+
paperType.value = "A5";
|
|
84
|
+
} else if (width === 500 && height === 353) {
|
|
85
|
+
paperType.value = "B3";
|
|
86
|
+
} else if (width === 250 && height === 353) {
|
|
87
|
+
paperType.value = "B4";
|
|
88
|
+
} else if (width === 250 && height === 176) {
|
|
89
|
+
paperType.value = "B5";
|
|
90
|
+
} else {
|
|
91
|
+
paperType.value = "other";
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
return {
|
|
96
|
+
paperType,
|
|
97
|
+
paperWidth,
|
|
98
|
+
paperHeight,
|
|
99
|
+
setPaper,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export function useScale(callback) {
|
|
104
|
+
const scaleValue = ref(1);
|
|
105
|
+
const scalePercentage = computed(() => {
|
|
106
|
+
return `${(scaleValue.value * 100).toFixed(0)}%`;
|
|
107
|
+
});
|
|
108
|
+
const canZoomIn = computed(() => {
|
|
109
|
+
return scaleValue.value > 0.5;
|
|
110
|
+
});
|
|
111
|
+
const canZoomOut = computed(() => {
|
|
112
|
+
return scaleValue.value < 4;
|
|
113
|
+
});
|
|
114
|
+
function zoomIn() {
|
|
115
|
+
scaleValue.value = scaleValue.value - 0.1;
|
|
116
|
+
callback();
|
|
117
|
+
}
|
|
118
|
+
function zoomOut() {
|
|
119
|
+
scaleValue.value = scaleValue.value + 0.1;
|
|
120
|
+
callback();
|
|
121
|
+
}
|
|
122
|
+
return {
|
|
123
|
+
scaleValue,
|
|
124
|
+
scalePercentage,
|
|
125
|
+
canZoomIn,
|
|
126
|
+
canZoomOut,
|
|
127
|
+
zoomIn,
|
|
128
|
+
zoomOut,
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export function useDataSource(axios) {
|
|
133
|
+
const detailData = ref();
|
|
134
|
+
function getDetail(id) {
|
|
135
|
+
return axios
|
|
136
|
+
.request({
|
|
137
|
+
url: `/printTemplate/get/${id}`,
|
|
138
|
+
method: "post",
|
|
139
|
+
})
|
|
140
|
+
.then((res) => {
|
|
141
|
+
if (res.data.data && res.data.data.sourceCodes) {
|
|
142
|
+
let codes = res.data.data.sourceCodes.split(",");
|
|
143
|
+
let formListCode = dataSourceForm.value.map((item) => item.value);
|
|
144
|
+
codes = codes.filter((item) => formListCode.includes(item));
|
|
145
|
+
formCode.value = codes;
|
|
146
|
+
} else {
|
|
147
|
+
formCode.value = "";
|
|
148
|
+
}
|
|
149
|
+
detailData.value = res.data.data;
|
|
150
|
+
return Promise.resolve(res.data.data);
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
const listCode = ref([]);
|
|
154
|
+
const dataSourceList = ref([]);
|
|
155
|
+
const listColumns = computed(() => {
|
|
156
|
+
return codeMapDataSource.value[listCode.value].map((item) => {
|
|
157
|
+
let index = item.indexOf("[");
|
|
158
|
+
return item.substring(index + 1, item.length - 1);
|
|
159
|
+
});
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
const formCode = ref([]);
|
|
163
|
+
const formColumns = computed(() => {
|
|
164
|
+
let arr = [];
|
|
165
|
+
if (formCode.value && formCode.value.length) {
|
|
166
|
+
formCode.value.forEach((item) => {
|
|
167
|
+
arr = arr.concat(codeMapDataSource.value[item]);
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
return arr;
|
|
171
|
+
});
|
|
172
|
+
const dataSourceForm = ref([]);
|
|
173
|
+
const codeMapDataSource = ref({});
|
|
174
|
+
function getDataSourceList() {
|
|
175
|
+
return axios
|
|
176
|
+
.request({
|
|
177
|
+
url: "/printTemplate/getDsList",
|
|
178
|
+
method: "post",
|
|
179
|
+
})
|
|
180
|
+
.then((res) => {
|
|
181
|
+
res.data.list.forEach((item) => {
|
|
182
|
+
if (item.columns) {
|
|
183
|
+
codeMapDataSource.value[item.code] = item?.columns?.split(",")?.map((col) => `$${item.code}[${col.toUpperCase()}]`) || [];
|
|
184
|
+
}
|
|
185
|
+
if (item.type === "LIST") {
|
|
186
|
+
dataSourceList.value.push({
|
|
187
|
+
label: item.name,
|
|
188
|
+
value: item.code,
|
|
189
|
+
});
|
|
190
|
+
} else {
|
|
191
|
+
dataSourceForm.value.push({
|
|
192
|
+
label: item.name,
|
|
193
|
+
value: item.code,
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
const dataSource = ref([]);
|
|
201
|
+
return {
|
|
202
|
+
detailData,
|
|
203
|
+
getDetail,
|
|
204
|
+
listCode,
|
|
205
|
+
dataSourceList,
|
|
206
|
+
listColumns,
|
|
207
|
+
formCode,
|
|
208
|
+
formColumns,
|
|
209
|
+
dataSourceForm,
|
|
210
|
+
codeMapDataSource,
|
|
211
|
+
getDataSourceList,
|
|
212
|
+
dataSource,
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
window.hiprint = hiprint;
|
package/index.d.ts
CHANGED
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
declare module "yh-hiprint";
|
|
2
|
-
|
|
3
|
-
/** JQuery 简化dom操作的库 */
|
|
4
|
-
export declare const jquery: JQuery;
|
|
5
|
-
|
|
6
|
-
/** hiprint 字体大小配置 */
|
|
7
|
-
export declare const fontSize;
|
|
8
|
-
/** hiprint 缩放配置 */
|
|
9
|
-
export declare const scale;
|
|
10
|
-
/** hiprint 层级配置 */
|
|
11
|
-
export declare const zIndex;
|
|
12
|
-
/** hiprint 侧边栏配置 */
|
|
13
|
-
export declare const panel;
|
|
14
|
-
|
|
15
|
-
export declare const hiprint;
|
|
16
|
-
export declare const defaultElementTypeProvider: (options: any) => {
|
|
17
|
-
addElementTypes: (context) => void;
|
|
18
|
-
};
|
|
19
|
-
export declare const print;
|
|
20
|
-
export declare const print2;
|
|
21
|
-
export declare const usePaper;
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* 打印组件的缩放
|
|
25
|
-
* @param callback 每次缩放后都会执行的回调函数
|
|
26
|
-
*/
|
|
27
|
-
export declare const useScale: (callback: () => void) => {
|
|
28
|
-
/** 当前缩放值 */
|
|
29
|
-
scaleValue: Ref<number>;
|
|
30
|
-
/** 当前百分比展示字符串 */
|
|
31
|
-
scalePercentage: ComputedRef<string>;
|
|
32
|
-
/** 当前是否能缩小 */
|
|
33
|
-
canZoomIn: ComputedRef<boolean>;
|
|
34
|
-
/** 当前是否能放大 */
|
|
35
|
-
canZoomOut: ComputedRef<boolean>;
|
|
36
|
-
/** 缩小 */
|
|
37
|
-
zoomIn: () => void;
|
|
38
|
-
/** 放大 */
|
|
39
|
-
zoomOut: () => void;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* 打印组件数据源
|
|
44
|
-
* @param axios 系统中的请求实体 `src/libs/api.request.js`
|
|
45
|
-
*/
|
|
46
|
-
export declare const useDataSource: (axios) => {
|
|
47
|
-
detailData: Ref<any>;
|
|
48
|
-
getDetail: (id) => void;
|
|
49
|
-
listCode: Ref<any[]>;
|
|
50
|
-
dataSourceList: Ref<any[]>;
|
|
51
|
-
listColumns: ComputedRef<string[]>;
|
|
52
|
-
formCode: Ref<any[]>;
|
|
53
|
-
formColumns: ComputedRef<string[]>;
|
|
54
|
-
dataSourceForm: Ref<any[]>;
|
|
55
|
-
codeMapDataSource: Ref<any>;
|
|
56
|
-
getDataSourceList: () => void;
|
|
57
|
-
dataSource: Ref<string[]>;
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
export declare interface HiprintOption {
|
|
61
|
-
code: string;
|
|
62
|
-
params: Object;
|
|
63
|
-
data: Record<string, any> | Record<string, any>[];
|
|
64
|
-
isCustom: boolean;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export declare const hiprint: (HiprintOption) => void;
|
|
1
|
+
declare module "yh-hiprint";
|
|
2
|
+
|
|
3
|
+
/** JQuery 简化dom操作的库 */
|
|
4
|
+
export declare const jquery: JQuery;
|
|
5
|
+
|
|
6
|
+
/** hiprint 字体大小配置 */
|
|
7
|
+
export declare const fontSize;
|
|
8
|
+
/** hiprint 缩放配置 */
|
|
9
|
+
export declare const scale;
|
|
10
|
+
/** hiprint 层级配置 */
|
|
11
|
+
export declare const zIndex;
|
|
12
|
+
/** hiprint 侧边栏配置 */
|
|
13
|
+
export declare const panel;
|
|
14
|
+
|
|
15
|
+
export declare const hiprint;
|
|
16
|
+
export declare const defaultElementTypeProvider: (options: any) => {
|
|
17
|
+
addElementTypes: (context) => void;
|
|
18
|
+
};
|
|
19
|
+
export declare const print;
|
|
20
|
+
export declare const print2;
|
|
21
|
+
export declare const usePaper;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* 打印组件的缩放
|
|
25
|
+
* @param callback 每次缩放后都会执行的回调函数
|
|
26
|
+
*/
|
|
27
|
+
export declare const useScale: (callback: () => void) => {
|
|
28
|
+
/** 当前缩放值 */
|
|
29
|
+
scaleValue: Ref<number>;
|
|
30
|
+
/** 当前百分比展示字符串 */
|
|
31
|
+
scalePercentage: ComputedRef<string>;
|
|
32
|
+
/** 当前是否能缩小 */
|
|
33
|
+
canZoomIn: ComputedRef<boolean>;
|
|
34
|
+
/** 当前是否能放大 */
|
|
35
|
+
canZoomOut: ComputedRef<boolean>;
|
|
36
|
+
/** 缩小 */
|
|
37
|
+
zoomIn: () => void;
|
|
38
|
+
/** 放大 */
|
|
39
|
+
zoomOut: () => void;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* 打印组件数据源
|
|
44
|
+
* @param axios 系统中的请求实体 `src/libs/api.request.js`
|
|
45
|
+
*/
|
|
46
|
+
export declare const useDataSource: (axios) => {
|
|
47
|
+
detailData: Ref<any>;
|
|
48
|
+
getDetail: (id) => void;
|
|
49
|
+
listCode: Ref<any[]>;
|
|
50
|
+
dataSourceList: Ref<any[]>;
|
|
51
|
+
listColumns: ComputedRef<string[]>;
|
|
52
|
+
formCode: Ref<any[]>;
|
|
53
|
+
formColumns: ComputedRef<string[]>;
|
|
54
|
+
dataSourceForm: Ref<any[]>;
|
|
55
|
+
codeMapDataSource: Ref<any>;
|
|
56
|
+
getDataSourceList: () => void;
|
|
57
|
+
dataSource: Ref<string[]>;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export declare interface HiprintOption {
|
|
61
|
+
code: string;
|
|
62
|
+
params: Object;
|
|
63
|
+
data: Record<string, any> | Record<string, any>[];
|
|
64
|
+
isCustom: boolean;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export declare const hiprint: (HiprintOption) => void;
|