diff --git a/electron/electron.js b/electron/electron.js index 1aacbc3..7cf00e0 100644 --- a/electron/electron.js +++ b/electron/electron.js @@ -1,6 +1,10 @@ // electron/electron.js const path = require('path'); -const { app, BrowserWindow, ipcMain } = require('electron'); +const { + app, + BrowserWindow, + ipcMain +} = require('electron'); const isDev = process.env.IS_DEV == 'true' ? true : false; @@ -50,7 +54,8 @@ ipcMain.on('openRtsp', (event, rtsp) => { name: `socket-${addPort}`, streamUrl: rtsp, wsPort: addPort, - ffmpegPath: app.isPackaged ? ffmpegPath.replace('app.asar', 'app.asar.unpacked') : ffmpegPath, + ffmpegPath: app.isPackaged ? ffmpegPath.replace('app.asar', 'app.asar.unpacked') : + ffmpegPath, ffmpegOptions: { '-stats': '', '-r': 30, @@ -97,6 +102,44 @@ ipcMain.on('closeRtsp', (event, rtsp) => { } }); +/** + * 跳转程序 url + */ +ipcMain.on('jumpTo', (event, url) => { + console.log("jumpTo",event, url); + // if (newWin) { + // newWin.focus() // 存在 则聚焦 + // return + // } + const newWin = new BrowserWindow({ + width: 900, + height: 620, + minWidth: 900, + minHeight: 620, + frame: true, //是否显示边缘框 + fullscreen: false, //是否全屏显示 + title: "项目名", + autoHideMenuBar: false, + webPreferences: { + javascript: true, + plugins: true, + allowRunningInsecureContent: true, + // 允许web端使用node + nodeIntegration: true, + contextIsolation: false, + // 同源策略关闭 + webSecurity: false, + } + }) + // newWin.loadURL(winURL + '#/路由地址') // 此处写 你要打开的路由地址 + newWin.loadURL(url) // 此处写 你要打开的路由地址 + // newWin.on('close', () => { + // newWin = null + // }) +}); + + + /////////////////////////////////////////// function createWindow() { @@ -120,9 +163,10 @@ function createWindow() { // and load the index.html of the app. // win.loadFile("index.html"); - mainWindow.loadURL(isDev ? 'http://localhost:3200' : `file://${path.join(__dirname, '../dist/index.html')}`); + // mainWindow.loadURL(isDev ? 'http://localhost:3200' : + // `file://${path.join(__dirname, '../dist/index.html')}`); - // mainWindow.loadURL('http://127.0.0.1:5500'); + mainWindow.loadURL('http://localhost:3200'); // Open the DevTools. // if (isDev) { mainWindow.webContents.openDevTools(); diff --git a/package.json b/package.json index f0507c0..332b830 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "output": "dist_electron" }, "electronDownload": { - "mirror": "https://npm.taobao.org/mirrors/electron/" + "mirror": "https://npmmirror.com/mirrors/electron/" } }, "scripts": { diff --git a/src/views/military/modules/Home.vue b/src/views/military/modules/Home.vue index d9bfe6a..1e5dfde 100644 --- a/src/views/military/modules/Home.vue +++ b/src/views/military/modules/Home.vue @@ -5,25 +5,25 @@
- - + + 视频监控 - + - - + + 电子地图 - + example - 场景配置 + 区域配置 @@ -76,8 +76,6 @@