|  | @@ -1,4 +1,7 @@
 | 
	
		
			
				|  |  | -import { app, BrowserWindow } from 'electron'
 | 
	
		
			
				|  |  | +import { app, BrowserWindow,screen } from 'electron'
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +const electron = require('electron')
 | 
	
		
			
				|  |  | +const ipc = electron.ipcMain
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  /**
 | 
	
		
			
				|  |  |   * Set `__static` path to static files in production
 | 
	
	
		
			
				|  | @@ -12,16 +15,21 @@ let mainWindow
 | 
	
		
			
				|  |  |  const winURL = process.env.NODE_ENV === 'development' ? `http://localhost:9080` : `file://${__dirname}/index.html`
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  function createWindow () {
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +  let size = screen.getPrimaryDisplay().workAreaSize
 | 
	
		
			
				|  |  | +  let width = parseInt(size.width)
 | 
	
		
			
				|  |  | +  let height = parseInt(size.height)
 | 
	
		
			
				|  |  | +  console.log(width,height)
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |    /**
 | 
	
		
			
				|  |  |     * Initial window options
 | 
	
		
			
				|  |  |     */
 | 
	
		
			
				|  |  |    mainWindow = new BrowserWindow({
 | 
	
		
			
				|  |  | -    width: 1000,
 | 
	
		
			
				|  |  | -    height: 563,
 | 
	
		
			
				|  |  | +    width: width,
 | 
	
		
			
				|  |  | +    height: height,
 | 
	
		
			
				|  |  |      show:false,
 | 
	
		
			
				|  |  | -    /*fullscreenable: true,
 | 
	
		
			
				|  |  | -    fullscreen: true,
 | 
	
		
			
				|  |  | -    simpleFullscreen:true,*/
 | 
	
		
			
				|  |  | +    titleBarStyle:'hiddenInset',
 | 
	
		
			
				|  |  | +    autoHideMenuBar: true,
 | 
	
		
			
				|  |  |      webPreferences: {
 | 
	
		
			
				|  |  |        // 允许跨域
 | 
	
		
			
				|  |  |        webSecurity: false,
 | 
	
	
		
			
				|  | @@ -30,10 +38,15 @@ function createWindow () {
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |    })
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +  // 配置ESC键退出全屏
 | 
	
		
			
				|  |  | +  // globalShortcut.register('ESC', () => {
 | 
	
		
			
				|  |  | +  //   mainWindow.setFullScreen(false)
 | 
	
		
			
				|  |  | +  // })
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |    mainWindow.loadURL(winURL)
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | - /* mainWindow.setFullScreen(true);
 | 
	
		
			
				|  |  | -  mainWindow.setSimpleFullScreen(true);*/
 | 
	
		
			
				|  |  | +  //进入软件即开启全屏
 | 
	
		
			
				|  |  | +  mainWindow.setFullScreen(true)
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    // mainWindow.webContents.openDevTools();
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -59,3 +72,13 @@ app.on('activate', () => {
 | 
	
		
			
				|  |  |      createWindow()
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  |  })
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +// 最小化窗口
 | 
	
		
			
				|  |  | +ipc.on('window-min',function(){
 | 
	
		
			
				|  |  | +  mainWindow.minimize()
 | 
	
		
			
				|  |  | +})
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +// 关闭窗口
 | 
	
		
			
				|  |  | +ipc.on('window-close',function() {
 | 
	
		
			
				|  |  | +  mainWindow.close()
 | 
	
		
			
				|  |  | +})
 |