初始提交:实习工作日志系统(设计方案 + Vue3 应用 + Electron 打包)

This commit is contained in:
root
2026-10-15 23:55:27 +08:00
commit cfb984627d
50 changed files with 9223 additions and 0 deletions
+43
View File
@@ -0,0 +1,43 @@
const { app, BrowserWindow, Menu, shell } = require('electron')
const path = require('path')
const DEV_URL = process.env.VITE_DEV_SERVER_URL || ''
function createWindow() {
const win = new BrowserWindow({
width: 1240,
height: 820,
minWidth: 940,
minHeight: 620,
title: '实习工作日志',
icon: path.join(__dirname, '..', 'build', 'icon.png'),
autoHideMenuBar: true,
backgroundColor: '#FFFFFF',
webPreferences: {
contextIsolation: true,
nodeIntegration: false,
spellcheck: false
}
})
Menu.setApplicationMenu(null)
win.webContents.setWindowOpenHandler(({ url }) => {
if (/^https?:/i.test(url)) shell.openExternal(url)
return { action: 'deny' }
})
if (DEV_URL) {
win.loadURL(DEV_URL)
} else {
win.loadFile(path.join(__dirname, '..', 'dist', 'index.html'))
}
}
app.whenReady().then(() => {
createWindow()
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) createWindow()
})
})
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') app.quit()
})