master
吴普建 11 months ago
parent f06095d72d
commit 4e5eae40e0

@ -36,19 +36,22 @@ const livePrint = ref(null);
function print(printData, title) {
if (window.hiwebSocket.opened && window.hiwebSocket.printerList.length) {
let mylivePrint = null;
let mylivePrint = localStorage.getItem("live-print");
let printerList = window.hiwebSocket.printerList.map(item => {
return {
label: item.name,
value: item.name
};
});
console.log("mylivePrint", mylivePrint)
console.log("printerList", printerList)
if (printerList && printerList.length) {
mylivePrint = printerList.find(item => item.label.indexOf("ZDesigner ZD888-203dpi ZPL") > -1).value;
console.log("livePrint2==>",mylivePrint);
if(!mylivePrint){
if (printerList && printerList.length) {
mylivePrint = printerList.find(item => item.label.indexOf("ZDesigner ZD888-203dpi ZPL") > -1).value;
console.log("livePrint2==>",mylivePrint);
}
}
if(!livePrint){
if(!mylivePrint){
mylivePrint = "ZDesigner ZD888-203dpi ZPL (副本 2)";
}

@ -287,7 +287,15 @@ export default defineComponent({
this.getPrintList();
}
}
}
},
livePrint: {
handler(v){
if(v){
console.log(v)
localStorage.setItem("live-print", v)
}
}
}
},
created() {

Loading…
Cancel
Save