优化样式

This commit is contained in:
gyq
2024-03-08 15:04:11 +08:00
parent 6e3a4c5ce3
commit 11290d1505
15 changed files with 114 additions and 96 deletions

View File

@@ -1,10 +1,6 @@
"use strict";
const path = require("path");
const electron = require("electron");
const { SerialPort } = require("serialport");
SerialPort.list().then((res) => {
console.log(res);
});
let win;
electron.app.whenReady().then(() => {
win = new electron.BrowserWindow({
@@ -36,7 +32,6 @@ electron.app.whenReady().then(() => {
});
const printWin = new electron.BrowserWindow({
show: false,
width: 580,
webPreferences: {
// 集成网页和 Node.js也就是在渲染进程中可以调用 Node.js 方法
nodeIntegration: true,
@@ -51,6 +46,9 @@ electron.app.whenReady().then(() => {
electron.ipcMain.on("printerInfoSync", (event, params) => {
printWin.webContents.send("getParams", params);
});
electron.ipcMain.on("printStart", () => {
console.log("开始打印");
});
});
electron.app.on("window-all-closed", () => {
if (process.platform !== "darwin")