yh-hiprint 2.6.4 → 2.6.5
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/HiprintDesigner.vue +15 -5
- package/index.js +16 -15
- package/package.json +1 -1
package/HiprintDesigner.vue
CHANGED
|
@@ -37,13 +37,13 @@
|
|
|
37
37
|
v-model="paperWidth"
|
|
38
38
|
type="number">
|
|
39
39
|
<template #prepend>宽</template>
|
|
40
|
-
<template #append>
|
|
40
|
+
<template #append>mm</template>
|
|
41
41
|
</el-input>
|
|
42
42
|
<el-input
|
|
43
43
|
v-model="paperHeight"
|
|
44
44
|
type="number">
|
|
45
45
|
<template #prepend>高</template>
|
|
46
|
-
<template #append>
|
|
46
|
+
<template #append>mm</template>
|
|
47
47
|
</el-input>
|
|
48
48
|
<el-button
|
|
49
49
|
type="primary"
|
|
@@ -766,7 +766,6 @@ function tableColumnCancel() {
|
|
|
766
766
|
function init() {
|
|
767
767
|
try {
|
|
768
768
|
hiprint.init({
|
|
769
|
-
host: 'http://localhost:17521',
|
|
770
769
|
providers: [new defaultElementTypeProvider()],
|
|
771
770
|
});
|
|
772
771
|
hiprint.setConfig();
|
|
@@ -917,7 +916,7 @@ async function updateTemplate(code) {
|
|
|
917
916
|
let {width, height} = jsonObj.panels[0];
|
|
918
917
|
paperWidth.value = width;
|
|
919
918
|
paperHeight.value = height;
|
|
920
|
-
|
|
919
|
+
setPaperHandler('other');
|
|
921
920
|
scaleValue.value = 1;
|
|
922
921
|
} else {
|
|
923
922
|
hiprintTemplate.value?.update({
|
|
@@ -938,11 +937,22 @@ async function updateTemplate(code) {
|
|
|
938
937
|
});
|
|
939
938
|
paperWidth.value = 210;
|
|
940
939
|
paperHeight.value = 297;
|
|
941
|
-
|
|
940
|
+
setPaperHandler('other');
|
|
942
941
|
scaleValue.value = 1;
|
|
943
942
|
}
|
|
944
943
|
} else {
|
|
945
944
|
await getDetail(code);
|
|
945
|
+
if (detailData.value && detailData.value.json) {
|
|
946
|
+
let jsonObj = JSON.parse(detailData.value.json);
|
|
947
|
+
let {width, height} = jsonObj.panels[0];
|
|
948
|
+
paperWidth.value = width;
|
|
949
|
+
paperHeight.value = height;
|
|
950
|
+
setPaperHandler('other');
|
|
951
|
+
} else {
|
|
952
|
+
paperWidth.value = 210;
|
|
953
|
+
paperHeight.value = 297;
|
|
954
|
+
setPaperHandler('other');
|
|
955
|
+
}
|
|
946
956
|
init();
|
|
947
957
|
}
|
|
948
958
|
updateing = false;
|
package/index.js
CHANGED
|
@@ -309,7 +309,7 @@ const showPrinterSelectionDialog = (printerList, templateJson, templateData, tem
|
|
|
309
309
|
// window.silentHiprint = silentHiprint;
|
|
310
310
|
|
|
311
311
|
export default {
|
|
312
|
-
install (app, { router, pinia, isAdmin, clientPrint = false, clientUrl = 'http://localhost:17521', clientApp = "https://gitee.com/CcSimple/electron-hiprint/releases" }) {
|
|
312
|
+
install (app, { router, pinia, isAdmin, clientPrint = false, clientUrl = 'http://localhost:17521', clientApp = "https://gitee.com/CcSimple/electron-hiprint/releases", clinetTip = false }) {
|
|
313
313
|
app.provide('$hiprint', hiprintFun);
|
|
314
314
|
app.provide('$silentHiprint', silentHiprint);
|
|
315
315
|
|
|
@@ -320,20 +320,21 @@ export default {
|
|
|
320
320
|
if (hiprint.hiwebSocket && !hiprint.hiwebSocket.opened) {
|
|
321
321
|
window.hiwebSocket.host = clientUrl;
|
|
322
322
|
hiprint.hiwebSocket.start();
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
323
|
+
if (clinetTip) {
|
|
324
|
+
// 添加连接状态检查和提示逻辑
|
|
325
|
+
setTimeout(() => {
|
|
326
|
+
if (!hiprint.hiwebSocket.opened) {
|
|
327
|
+
ElMessageBox.alert(
|
|
328
|
+
`连接【${clientUrl}】失败!<br>请确保已<a href="${clientApp}" target="_blank">下载</a>并<a href="hiprint://" target="_blank">运行</a>打印客户端!`,
|
|
329
|
+
'客户端未连接',
|
|
330
|
+
{
|
|
331
|
+
dangerouslyUseHTMLString: true,
|
|
332
|
+
confirmButtonText: '确定'
|
|
333
|
+
}
|
|
334
|
+
);
|
|
335
|
+
}
|
|
336
|
+
}, 3000);
|
|
337
|
+
}
|
|
337
338
|
}
|
|
338
339
|
};
|
|
339
340
|
|