Compare commits

...

2 Commits

Author SHA1 Message Date
qubiaobiao 9325ec4bbe 修复关闭软件时的bug 2024-04-07 17:17:15 +08:00
qubiaobiao 9a3ccef9a0 沙河客户定制版本 2024-02-22 11:37:51 +08:00
33 changed files with 45 additions and 50 deletions

View File

@ -17,6 +17,7 @@
"echarts": "^5.1.0", "echarts": "^5.1.0",
"electron-store": "^8.0.0", "electron-store": "^8.0.0",
"nmea": "http://git.hwasmart.com/bd_group/node-nmea.git", "nmea": "http://git.hwasmart.com/bd_group/node-nmea.git",
"postcss": "^8.4.38",
"serialport": "10.0.0", "serialport": "10.0.0",
"vue": "^3.2.26", "vue": "^3.2.26",
"vue-cesium": "3.0.2-beta.13", "vue-cesium": "3.0.2-beta.13",
@ -30,7 +31,6 @@
"electron": "^13.6.3", "electron": "^13.6.3",
"electron-builder": "^22.10.5", "electron-builder": "^22.10.5",
"electron-rebuild": "2.3.5", "electron-rebuild": "2.3.5",
"postcss": "^8.2.10",
"rimraf": "^3.0.2", "rimraf": "^3.0.2",
"rollup-plugin-copy": "^3.4.0", "rollup-plugin-copy": "^3.4.0",
"tailwindcss": "^2.1.1", "tailwindcss": "^2.1.1",

View File

Before

Width:  |  Height:  |  Size: 72 KiB

After

Width:  |  Height:  |  Size: 72 KiB

View File

@ -121,44 +121,18 @@ const getDisplayOrigin = (display: any) => {
return origin return origin
} }
var windows:Array<BrowserWindow> = [];
function createWindow(option: any, url: any) { function createWindow(option: any, url: any) {
const win = new BrowserWindow(option) const win = new BrowserWindow(option)
if (URl_REGEX.test(url)) { if (URl_REGEX.test(url)) {
win.loadURL(url) win.loadURL(url)
} else { } else {
win.loadFile(url) win.loadFile(url)
} }
const isWindows = process.platform === 'win32';
let needsFocusFix = false;
let triggeringProgrammaticBlur = false;
//弹出警报窗口后 input获取不到焦点
win.on('blur', (event: any) => {
if(!triggeringProgrammaticBlur) {
needsFocusFix = true;
}
})
win.on('focus', (event: any) => {
if(isWindows && needsFocusFix) {
needsFocusFix = false;
triggeringProgrammaticBlur = true;
//弹出弹窗后重新聚焦导致windows任务栏显示重新隐藏底部windows任务栏
win.minimize(); //最小化函数
win.restore(); //取消最小化函数(从最小化窗口还原函数)
setTimeout(function () {
win.blur(); //失去焦点函数
win.focus(); //获取焦点函数
setTimeout(function () {
triggeringProgrammaticBlur = false;
}, 100);
}, 100);
}
})
if(process.env.NODE_ENV === 'development') win.webContents.openDevTools() if(process.env.NODE_ENV === 'development') win.webContents.openDevTools()
windows.push(win);
}
ipcMain.on('CLOSE', (event) => { ipcMain.on('CLOSE', (event) => {
const res = dialog.showMessageBox({ const res = dialog.showMessageBox({
@ -173,13 +147,15 @@ function createWindow(option: any, url: any) {
res.then((data)=>{ res.then((data)=>{
if(data.response == 0){ if(data.response == 0){
win.close() windows.forEach((key:BrowserWindow) => {
key.close();
});
windows = [];
}else{ }else{
console.log('not close software') console.log('not close software')
} }
}) })
}) })
}
app.whenReady().then(() => { app.whenReady().then(() => {
launch() launch()

View File

Before

Width:  |  Height:  |  Size: 1.3 MiB

After

Width:  |  Height:  |  Size: 1.3 MiB

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -2577,6 +2577,11 @@ nanoid@^3.1.30:
resolved "https://registry.npmmirror.com/nanoid/download/nanoid-3.1.30.tgz#63f93cc548d2a113dc5dfbc63bfa09e2b9b64362" resolved "https://registry.npmmirror.com/nanoid/download/nanoid-3.1.30.tgz#63f93cc548d2a113dc5dfbc63bfa09e2b9b64362"
integrity sha512-zJpuPDwOv8D2zq2WRoMe1HsfZthVewpel9CAvTfc/2mBD1uUT/agc5f7GHGWXlYkFvi1mVxe4IjvP2HNrop7nQ== integrity sha512-zJpuPDwOv8D2zq2WRoMe1HsfZthVewpel9CAvTfc/2mBD1uUT/agc5f7GHGWXlYkFvi1mVxe4IjvP2HNrop7nQ==
nanoid@^3.3.7:
version "3.3.7"
resolved "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.7.tgz#d0c301a691bc8d54efa0a2226ccf3fe2fd656bd8"
integrity sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==
napi-build-utils@^1.0.1: napi-build-utils@^1.0.1:
version "1.0.2" version "1.0.2"
resolved "https://registry.npm.taobao.org/napi-build-utils/download/napi-build-utils-1.0.2.tgz#b1fddc0b2c46e380a0b7a76f984dd47c41a13806" resolved "https://registry.npm.taobao.org/napi-build-utils/download/napi-build-utils-1.0.2.tgz#b1fddc0b2c46e380a0b7a76f984dd47c41a13806"
@ -3000,7 +3005,7 @@ postcss@^8.1.10:
picocolors "^1.0.0" picocolors "^1.0.0"
source-map-js "^1.0.1" source-map-js "^1.0.1"
postcss@^8.1.6, postcss@^8.2.10: postcss@^8.1.6:
version "8.2.10" version "8.2.10"
resolved "https://registry.npm.taobao.org/postcss/download/postcss-8.2.10.tgz#ca7a042aa8aff494b334d0ff3e9e77079f6f702b" resolved "https://registry.npm.taobao.org/postcss/download/postcss-8.2.10.tgz#ca7a042aa8aff494b334d0ff3e9e77079f6f702b"
integrity sha1-ynoEKqiv9JSzNND/Pp53B59vcCs= integrity sha1-ynoEKqiv9JSzNND/Pp53B59vcCs=
@ -3018,6 +3023,15 @@ postcss@^8.2.1:
nanoid "^3.1.20" nanoid "^3.1.20"
source-map "^0.6.1" source-map "^0.6.1"
postcss@^8.4.38:
version "8.4.38"
resolved "https://registry.npmmirror.com/postcss/-/postcss-8.4.38.tgz#b387d533baf2054288e337066d81c6bee9db9e0e"
integrity sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==
dependencies:
nanoid "^3.3.7"
picocolors "^1.0.0"
source-map-js "^1.2.0"
prebuild-install@^7.0.0: prebuild-install@^7.0.0:
version "7.1.1" version "7.1.1"
resolved "https://registry.npmmirror.com/prebuild-install/-/prebuild-install-7.1.1.tgz#de97d5b34a70a0c81334fd24641f2a1702352e45" resolved "https://registry.npmmirror.com/prebuild-install/-/prebuild-install-7.1.1.tgz#de97d5b34a70a0c81334fd24641f2a1702352e45"
@ -3480,6 +3494,11 @@ source-map-js@^1.0.1:
resolved "https://registry.npmmirror.com/source-map-js/download/source-map-js-1.0.1.tgz?cache=0&sync_timestamp=1636402309628&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fsource-map-js%2Fdownload%2Fsource-map-js-1.0.1.tgz#a1741c131e3c77d048252adfa24e23b908670caf" resolved "https://registry.npmmirror.com/source-map-js/download/source-map-js-1.0.1.tgz?cache=0&sync_timestamp=1636402309628&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fsource-map-js%2Fdownload%2Fsource-map-js-1.0.1.tgz#a1741c131e3c77d048252adfa24e23b908670caf"
integrity sha512-4+TN2b3tqOCd/kaGRJ/sTYA0tR0mdXx26ipdolxcwtJVqEnqNYvlCAt1q3ypy4QMlYus+Zh34RNtYLoq2oQ4IA== integrity sha512-4+TN2b3tqOCd/kaGRJ/sTYA0tR0mdXx26ipdolxcwtJVqEnqNYvlCAt1q3ypy4QMlYus+Zh34RNtYLoq2oQ4IA==
source-map-js@^1.2.0:
version "1.2.0"
resolved "https://registry.npmmirror.com/source-map-js/-/source-map-js-1.2.0.tgz#16b809c162517b5b8c3e7dcd315a2a5c2612b2af"
integrity sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==
source-map-support@^0.5.17, source-map-support@^0.5.19: source-map-support@^0.5.17, source-map-support@^0.5.19:
version "0.5.19" version "0.5.19"
resolved "https://registry.npm.taobao.org/source-map-support/download/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" resolved "https://registry.npm.taobao.org/source-map-support/download/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61"