mirror of
https://gitee.com/dromara/electron-egg.git
synced 2026-05-14 03:52:07 +08:00
demo frontend
This commit is contained in:
@@ -5,41 +5,52 @@ import request from '@/utils/request'
|
||||
* 路由定义(主进程与渲染进程通信频道定义)
|
||||
*/
|
||||
const ipcApiRoute = {
|
||||
test: 'controller.example.test',
|
||||
messageShow: 'controller.example.messageShow',
|
||||
messageShowConfirm: 'controller.example.messageShowConfirm',
|
||||
selectFolder: 'controller.example.selectFolder',
|
||||
openDirectory: 'controller.example.openDirectory',
|
||||
loadViewContent: 'controller.example.loadViewContent',
|
||||
removeViewContent: 'controller.example.removeViewContent',
|
||||
createWindow: 'controller.example.createWindow',
|
||||
sendNotification: 'controller.example.sendNotification',
|
||||
initPowerMonitor: 'controller.example.initPowerMonitor',
|
||||
getScreen: 'controller.example.getScreen',
|
||||
openSoftware: 'controller.example.openSoftware',
|
||||
autoLaunch: 'controller.example.autoLaunch',
|
||||
setTheme: 'controller.example.setTheme',
|
||||
getTheme: 'controller.example.getTheme',
|
||||
checkForUpdater: 'controller.example.checkForUpdater',
|
||||
downloadApp: 'controller.example.downloadApp',
|
||||
dbOperation: 'controller.example.dbOperation',
|
||||
sqlitedbOperation: 'controller.example.sqlitedbOperation',
|
||||
uploadFile: 'controller.example.uploadFile',
|
||||
checkHttpServer: 'controller.example.checkHttpServer',
|
||||
doHttpRequest: 'controller.example.doHttpRequest',
|
||||
doSocketRequest: 'controller.example.doSocketRequest',
|
||||
ipcInvokeMsg: 'controller.example.ipcInvokeMsg',
|
||||
ipcSendSyncMsg: 'controller.example.ipcSendSyncMsg',
|
||||
ipcSendMsg: 'controller.example.ipcSendMsg',
|
||||
getWCid: 'controller.example.getWCid',
|
||||
startJavaServer: 'controller.example.startJavaServer',
|
||||
closeJavaServer: 'controller.example.closeJavaServer',
|
||||
someJob: 'controller.example.someJob',
|
||||
timerJobProgress: 'controller.example.timerJobProgress',
|
||||
createPool: 'controller.example.createPool',
|
||||
createPoolNotice: 'controller.example.createPoolNotice',
|
||||
someJobByPool: 'controller.example.someJobByPool',
|
||||
hello: 'controller.example.hello',
|
||||
// framework
|
||||
test: 'controller.framework.test',
|
||||
checkForUpdater: 'controller.framework.checkForUpdater',
|
||||
downloadApp: 'controller.framework.downloadApp',
|
||||
dbOperation: 'controller.framework.dbOperation',
|
||||
sqlitedbOperation: 'controller.framework.sqlitedbOperation',
|
||||
uploadFile: 'controller.framework.uploadFile',
|
||||
checkHttpServer: 'controller.framework.checkHttpServer',
|
||||
doHttpRequest: 'controller.framework.doHttpRequest',
|
||||
doSocketRequest: 'controller.framework.doSocketRequest',
|
||||
ipcInvokeMsg: 'controller.framework.ipcInvokeMsg',
|
||||
ipcSendSyncMsg: 'controller.framework.ipcSendSyncMsg',
|
||||
ipcSendMsg: 'controller.framework.ipcSendMsg',
|
||||
getWCid: 'controller.framework.getWCid',
|
||||
startJavaServer: 'controller.framework.startJavaServer',
|
||||
closeJavaServer: 'controller.framework.closeJavaServer',
|
||||
someJob: 'controller.framework.someJob',
|
||||
timerJobProgress: 'controller.framework.timerJobProgress',
|
||||
createPool: 'controller.framework.createPool',
|
||||
createPoolNotice: 'controller.framework.createPoolNotice',
|
||||
someJobByPool: 'controller.framework.someJobByPool',
|
||||
hello: 'controller.framework.hello',
|
||||
openSoftware: 'controller.framework.openSoftware',
|
||||
|
||||
// os
|
||||
messageShow: 'controller.os.messageShow',
|
||||
messageShowConfirm: 'controller.os.messageShowConfirm',
|
||||
selectFolder: 'controller.os.selectFolder',
|
||||
openDirectory: 'controller.os.openDirectory',
|
||||
loadViewContent: 'controller.os.loadViewContent',
|
||||
removeViewContent: 'controller.os.removeViewContent',
|
||||
createWindow: 'controller.os.createWindow',
|
||||
sendNotification: 'controller.os.sendNotification',
|
||||
initPowerMonitor: 'controller.os.initPowerMonitor',
|
||||
getScreen: 'controller.os.getScreen',
|
||||
autoLaunch: 'controller.os.autoLaunch',
|
||||
setTheme: 'controller.os.setTheme',
|
||||
getTheme: 'controller.os.getTheme',
|
||||
|
||||
// hardware
|
||||
getPrinterList: 'controller.hardware.getPrinterList',
|
||||
print: 'controller.hardware.print',
|
||||
printStatus: 'controller.hardware.printStatus',
|
||||
|
||||
// effect
|
||||
selectFile: 'controller.effect.selectFile',
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,141 +4,147 @@
|
||||
*/
|
||||
import {AppSider, Menu} from '@/layouts'
|
||||
|
||||
const RouteView = {
|
||||
name: 'RouteView',
|
||||
render: h => h('router-view')
|
||||
}
|
||||
|
||||
export const constantRouterMap = [
|
||||
{
|
||||
path: '/',
|
||||
component: AppSider,
|
||||
children: [
|
||||
{
|
||||
path: '/base',
|
||||
name: 'Base',
|
||||
path: '/framework',
|
||||
name: 'Framework',
|
||||
component: Menu,
|
||||
props: { id: 'base' },
|
||||
redirect: { name: 'BaseFileIndex' },
|
||||
props: { id: 'framework' },
|
||||
redirect: { name: 'FrameworkSocketIpc' },
|
||||
children: [
|
||||
{
|
||||
path: '/base/file/index',
|
||||
name: 'BaseFileIndex',
|
||||
component: () => import('@/views/base/file/Index')
|
||||
path: '/framework/socket/ipc',
|
||||
name: 'FrameworkSocketIpc',
|
||||
component: () => import('@/views/framework/socket/Ipc')
|
||||
},
|
||||
{
|
||||
path: '/base/socket/ipc',
|
||||
name: 'BaseSocketIpc',
|
||||
component: () => import('@/views/base/socket/Ipc')
|
||||
path: '/framework/socket/httpserver',
|
||||
name: 'FrameworkSocketHttpServer',
|
||||
component: () => import('@/views/framework/socket/HttpServer')
|
||||
},
|
||||
{
|
||||
path: '/base/db/index',
|
||||
name: 'BaseDBIndex',
|
||||
component: () => import('@/views/base/db/Index')
|
||||
path: '/framework/socket/socketserver',
|
||||
name: 'FrameworkSocketSocketServer',
|
||||
component: () => import('@/views/framework/socket/SocketServer')
|
||||
},
|
||||
{
|
||||
path: '/framework/db/index',
|
||||
name: 'FrameworkDBIndex',
|
||||
component: () => import('@/views/framework/db/Index')
|
||||
},
|
||||
{
|
||||
path: '/base/sqlitedb/index',
|
||||
name: 'BaseSqliteDBIndex',
|
||||
component: () => import('@/views/base/sqlitedb/Index')
|
||||
path: '/framework/sqlitedb/index',
|
||||
name: 'FrameworkSqliteDBIndex',
|
||||
component: () => import('@/views/framework/sqlitedb/Index')
|
||||
},
|
||||
{
|
||||
path: '/base/windowview/index',
|
||||
name: 'BaseWindowViewIndex',
|
||||
component: () => import('@/views/base/windowview/Index')
|
||||
path: '/framework/jobs/index',
|
||||
name: 'FrameworkJobsIndex',
|
||||
component: () => import('@/views/framework/jobs/Index')
|
||||
},
|
||||
{
|
||||
path: '/base/window/index',
|
||||
name: 'BaseWindowIndex',
|
||||
component: () => import('@/views/base/window/Index')
|
||||
path: '/framework/updater/index',
|
||||
name: 'FrameworkUpdaterIndex',
|
||||
component: () => import('@/views/framework/updater/Index')
|
||||
},
|
||||
{
|
||||
path: '/framework/software/index',
|
||||
name: 'FrameworkSoftwareIndex',
|
||||
component: () => import('@/views/framework/software/Index')
|
||||
},
|
||||
{
|
||||
path: '/base/jobs/index',
|
||||
name: 'BaseJobsIndex',
|
||||
component: () => import('@/views/base/jobs/Index')
|
||||
path: '/framework/java/index',
|
||||
name: 'FrameworkJavaIndex',
|
||||
component: () => import('@/views/framework/java/Index')
|
||||
},
|
||||
{
|
||||
path: '/base/notification/index',
|
||||
name: 'BaseNotificationIndex',
|
||||
component: () => import('@/views/base/notification/Index')
|
||||
path: '/framework/testapi/index',
|
||||
name: 'FrameworkTestApiIndex',
|
||||
component: () => import('@/views/framework/testapi/Index')
|
||||
},
|
||||
{
|
||||
path: '/base/powermonitor/index',
|
||||
name: 'BasePowerMonitorIndex',
|
||||
component: () => import('@/views/base/powermonitor/Index')
|
||||
},
|
||||
{
|
||||
path: '/base/screen/index',
|
||||
name: 'BaseScreenIndex',
|
||||
component: () => import('@/views/base/screen/Index')
|
||||
},
|
||||
{
|
||||
path: '/base/theme/index',
|
||||
name: 'BaseThemeIndex',
|
||||
component: () => import('@/views/base/theme/Index')
|
||||
},
|
||||
{
|
||||
path: '/base/software/index',
|
||||
name: 'BaseSoftwareIndex',
|
||||
component: () => import('@/views/base/software/Index')
|
||||
},
|
||||
{
|
||||
path: '/base/socket/httpserver',
|
||||
name: 'BaseSocketHttpServer',
|
||||
component: () => import('@/views/base/socket/HttpServer')
|
||||
},
|
||||
{
|
||||
path: '/base/socket/socketserver',
|
||||
name: 'BaseSocketSocketServer',
|
||||
component: () => import('@/views/base/socket/SocketServer')
|
||||
},
|
||||
{
|
||||
path: '/base/system/index',
|
||||
name: 'BaseSystemIndex',
|
||||
component: () => import('@/views/base/system/Index')
|
||||
},
|
||||
{
|
||||
path: '/base/testapi/index',
|
||||
name: 'BaseTestApiIndex',
|
||||
component: () => import('@/views/base/testapi/Index')
|
||||
},
|
||||
{
|
||||
path: '/base/updater/index',
|
||||
name: 'BaseUpdaterIndex',
|
||||
component: () => import('@/views/base/updater/Index')
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/other',
|
||||
name: 'Other',
|
||||
path: '/os',
|
||||
name: 'Os',
|
||||
component: Menu,
|
||||
props: { id: 'other' },
|
||||
redirect: { name: 'OtherTestIndex' },
|
||||
props: { id: 'os' },
|
||||
redirect: { name: 'OsFileIndex' },
|
||||
children: [
|
||||
{
|
||||
path: '/other/test/index',
|
||||
name: 'OtherTestIndex',
|
||||
component: () => import('@/views/other/test/Index')
|
||||
path: '/os/file/index',
|
||||
name: 'OsFileIndex',
|
||||
component: () => import('@/views/os/file/Index')
|
||||
},
|
||||
{
|
||||
path: '/other/java/index',
|
||||
name: 'OtherJavaIndex',
|
||||
component: () => import('@/views/other/java/Index')
|
||||
}
|
||||
]
|
||||
}
|
||||
path: '/os/windowview/index',
|
||||
name: 'OsWindowViewIndex',
|
||||
component: () => import('@/views/os/windowview/Index')
|
||||
},
|
||||
{
|
||||
path: '/os/window/index',
|
||||
name: 'OsWindowIndex',
|
||||
component: () => import('@/views/os/window/Index')
|
||||
},
|
||||
{
|
||||
path: '/os/notification/index',
|
||||
name: 'OsNotificationIndex',
|
||||
component: () => import('@/views/os/notification/Index')
|
||||
},
|
||||
{
|
||||
path: '/os/powermonitor/index',
|
||||
name: 'OsPowerMonitorIndex',
|
||||
component: () => import('@/views/os/powermonitor/Index')
|
||||
},
|
||||
{
|
||||
path: '/os/screen/index',
|
||||
name: 'OsScreenIndex',
|
||||
component: () => import('@/views/os/screen/Index')
|
||||
},
|
||||
{
|
||||
path: '/os/theme/index',
|
||||
name: 'OsThemeIndex',
|
||||
component: () => import('@/views/os/theme/Index')
|
||||
},
|
||||
{
|
||||
path: '/os/system/index',
|
||||
name: 'OsSystemIndex',
|
||||
component: () => import('@/views/os/system/Index')
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/hardware',
|
||||
name: 'Hardware',
|
||||
component: Menu,
|
||||
props: { id: 'hardware' },
|
||||
redirect: { name: 'HardwarePrinterIndex' },
|
||||
children: [
|
||||
{
|
||||
path: '/hardware/printer/index',
|
||||
name: 'HardwarePrinterIndex',
|
||||
component: () => import('@/views/hardware/printer/Index')
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/effect',
|
||||
name: 'Effect',
|
||||
component: Menu,
|
||||
props: { id: 'effect' },
|
||||
redirect: { name: 'EffectVideoIndex' },
|
||||
children: [
|
||||
{
|
||||
path: '/effect/video/index',
|
||||
name: 'EffectVideoIndex',
|
||||
component: () => import('@/views/effect/video/Index')
|
||||
},
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
// {
|
||||
// path: '/special',
|
||||
// component: RouteView,
|
||||
// //redirect: '/special/subwindow',
|
||||
// children: [
|
||||
// {
|
||||
// path: 'subwindow',
|
||||
// name: 'SpecialSubwindowIpc',
|
||||
// component: () => import('@/views/base/subwindow/Ipc')
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
]
|
||||
|
||||
@@ -2,172 +2,59 @@
|
||||
* 子菜单
|
||||
*/
|
||||
export default {
|
||||
// base: {
|
||||
// 'menu_100' : {
|
||||
// icon: 'profile',
|
||||
// title: '文件',
|
||||
// pageName: 'BaseFileIndex',
|
||||
// params: {}
|
||||
// },
|
||||
// 'menu_300' : {
|
||||
// icon: 'profile',
|
||||
// title: '通信',
|
||||
// pageName: 'BaseSocketIpc',
|
||||
// params: {}
|
||||
// },
|
||||
// 'menu_301' : {
|
||||
// icon: 'profile',
|
||||
// title: 'http服务',
|
||||
// pageName: 'BaseSocketHttpServer',
|
||||
// params: {}
|
||||
// },
|
||||
// 'menu_302' : {
|
||||
// icon: 'profile',
|
||||
// title: 'socket服务',
|
||||
// pageName: 'BaseSocketSocketServer',
|
||||
// params: {}
|
||||
// },
|
||||
// 'menu_310' : {
|
||||
// icon: 'profile',
|
||||
// title: 'json数据库',
|
||||
// pageName: 'BaseDBIndex',
|
||||
// params: {}
|
||||
// },
|
||||
// 'menu_320' : {
|
||||
// icon: 'profile',
|
||||
// title: 'sqlite数据库',
|
||||
// pageName: 'BaseSqliteDBIndex',
|
||||
// params: {}
|
||||
// },
|
||||
// 'menu_330' : {
|
||||
// icon: 'profile',
|
||||
// title: '任务',
|
||||
// pageName: 'BaseJobsIndex',
|
||||
// params: {}
|
||||
// },
|
||||
// 'menu_400' : {
|
||||
// icon: 'profile',
|
||||
// title: '视图',
|
||||
// pageName: 'BaseWindowViewIndex',
|
||||
// params: {}
|
||||
// },
|
||||
// 'menu_401' : {
|
||||
// icon: 'profile',
|
||||
// title: '窗口',
|
||||
// pageName: 'BaseWindowIndex',
|
||||
// params: {}
|
||||
// },
|
||||
// 'menu_405' : {
|
||||
// icon: 'profile',
|
||||
// title: '桌面通知',
|
||||
// pageName: 'BaseNotificationIndex',
|
||||
// params: {}
|
||||
// },
|
||||
// 'menu_407' : {
|
||||
// icon: 'profile',
|
||||
// title: '电源监控',
|
||||
// pageName: 'BasePowerMonitorIndex',
|
||||
// params: {}
|
||||
// },
|
||||
// 'menu_409' : {
|
||||
// icon: 'profile',
|
||||
// title: '屏幕信息',
|
||||
// pageName: 'BaseScreenIndex',
|
||||
// params: {}
|
||||
// },
|
||||
// 'menu_411' : {
|
||||
// icon: 'profile',
|
||||
// title: '系统主题',
|
||||
// pageName: 'BaseThemeIndex',
|
||||
// params: {}
|
||||
// },
|
||||
// 'menu_412' : {
|
||||
// icon: 'profile',
|
||||
// title: '自动更新',
|
||||
// pageName: 'BaseUpdaterIndex',
|
||||
// params: {}
|
||||
// },
|
||||
// 'menu_500' : {
|
||||
// icon: 'profile',
|
||||
// title: '软件调用',
|
||||
// pageName: 'BaseSoftwareIndex',
|
||||
// params: {}
|
||||
// },
|
||||
// 'menu_900' : {
|
||||
// icon: 'profile',
|
||||
// title: '测试',
|
||||
// pageName: 'BaseTestApiIndex',
|
||||
// params: {}
|
||||
// }
|
||||
// },
|
||||
// other: {
|
||||
// 'menu_100' : {
|
||||
// icon: 'profile',
|
||||
// title: '测试',
|
||||
// pageName: 'OtherTestIndex',
|
||||
// params: {}
|
||||
// },
|
||||
// 'menu_200' : {
|
||||
// icon: 'profile',
|
||||
// title: 'java',
|
||||
// pageName: 'OtherJavaIndex',
|
||||
// params: {}
|
||||
// },
|
||||
// },
|
||||
framework: {
|
||||
'menu_100' : {
|
||||
icon: 'profile',
|
||||
title: '通信',
|
||||
pageName: 'BaseSocketIpc',
|
||||
pageName: 'FrameworkSocketIpc',
|
||||
params: {}
|
||||
},
|
||||
'menu_101' : {
|
||||
icon: 'profile',
|
||||
title: 'http服务',
|
||||
pageName: 'BaseSocketHttpServer',
|
||||
pageName: 'FrameworkSocketHttpServer',
|
||||
params: {}
|
||||
},
|
||||
'menu_102' : {
|
||||
icon: 'profile',
|
||||
title: 'socket服务',
|
||||
pageName: 'BaseSocketSocketServer',
|
||||
pageName: 'FrameworkSocketSocketServer',
|
||||
params: {}
|
||||
},
|
||||
'menu_103' : {
|
||||
icon: 'profile',
|
||||
title: 'json数据库',
|
||||
pageName: 'BaseDBIndex',
|
||||
pageName: 'FrameworkDBIndex',
|
||||
params: {}
|
||||
},
|
||||
'menu_104' : {
|
||||
icon: 'profile',
|
||||
title: 'sqlite数据库',
|
||||
pageName: 'BaseSqliteDBIndex',
|
||||
pageName: 'FrameworkSqliteDBIndex',
|
||||
params: {}
|
||||
},
|
||||
'menu_105' : {
|
||||
icon: 'profile',
|
||||
title: '任务',
|
||||
pageName: 'BaseJobsIndex',
|
||||
pageName: 'FrameworkJobsIndex',
|
||||
params: {}
|
||||
},
|
||||
|
||||
'menu_106' : {
|
||||
icon: 'profile',
|
||||
title: '自动更新',
|
||||
pageName: 'BaseUpdaterIndex',
|
||||
pageName: 'FrameworkUpdaterIndex',
|
||||
params: {}
|
||||
},
|
||||
'menu_107' : {
|
||||
icon: 'profile',
|
||||
title: '软件调用',
|
||||
pageName: 'BaseSoftwareIndex',
|
||||
pageName: 'FrameworkSoftwareIndex',
|
||||
params: {}
|
||||
},
|
||||
'menu_108' : {
|
||||
icon: 'profile',
|
||||
title: 'java',
|
||||
pageName: 'OtherJavaIndex',
|
||||
pageName: 'FrameworkJavaIndex',
|
||||
params: {}
|
||||
},
|
||||
'menu_109' : {
|
||||
@@ -181,43 +68,43 @@ export default {
|
||||
'menu_200' : {
|
||||
icon: 'profile',
|
||||
title: '文件',
|
||||
pageName: 'BaseFileIndex',
|
||||
pageName: 'OsFileIndex',
|
||||
params: {}
|
||||
},
|
||||
'menu_201' : {
|
||||
icon: 'profile',
|
||||
title: '视图',
|
||||
pageName: 'BaseWindowViewIndex',
|
||||
pageName: 'OsWindowViewIndex',
|
||||
params: {}
|
||||
},
|
||||
'menu_202' : {
|
||||
icon: 'profile',
|
||||
title: '窗口',
|
||||
pageName: 'BaseWindowIndex',
|
||||
pageName: 'OsWindowIndex',
|
||||
params: {}
|
||||
},
|
||||
'menu_203' : {
|
||||
icon: 'profile',
|
||||
title: '桌面通知',
|
||||
pageName: 'BaseNotificationIndex',
|
||||
pageName: 'OsNotificationIndex',
|
||||
params: {}
|
||||
},
|
||||
'menu_204' : {
|
||||
icon: 'profile',
|
||||
title: '电源监控',
|
||||
pageName: 'BasePowerMonitorIndex',
|
||||
pageName: 'OsPowerMonitorIndex',
|
||||
params: {}
|
||||
},
|
||||
'menu_205' : {
|
||||
icon: 'profile',
|
||||
title: '屏幕信息',
|
||||
pageName: 'BaseScreenIndex',
|
||||
pageName: 'OsScreenIndex',
|
||||
params: {}
|
||||
},
|
||||
'menu_206' : {
|
||||
icon: 'profile',
|
||||
title: '系统主题',
|
||||
pageName: 'BaseThemeIndex',
|
||||
pageName: 'OsThemeIndex',
|
||||
params: {}
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user