|
|
|
|
@ -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)";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|