This commit is contained in:
哆啦好梦
2023-05-11 15:49:25 +08:00
parent f7b82b488e
commit 465ea1e851
9 changed files with 634 additions and 486 deletions

View File

@@ -1,5 +1,6 @@
'use strict'; 'use strict';
const { Controller } = require('ee-core');
/** /**
* 特效 - 功能demo * 特效 - 功能demo

View File

@@ -1,5 +1,7 @@
'use strict'; 'use strict';
const { Controller } = require('ee-core');
/** /**
* 硬件设备 - 功能demo * 硬件设备 - 功能demo
* @class * @class

View File

@@ -9,7 +9,6 @@ const {
powerMonitor, screen, nativeTheme powerMonitor, screen, nativeTheme
} = require('electron'); } = require('electron');
let myTimer = null;
let browserViewObj = null; let browserViewObj = null;
let notificationObj = null; let notificationObj = null;

File diff suppressed because it is too large Load Diff

View File

@@ -16,7 +16,8 @@
"vue": "^2.6.11", "vue": "^2.6.11",
"vue-quill-editor": "^3.0.6", "vue-quill-editor": "^3.0.6",
"vue-router": "^3.4.9", "vue-router": "^3.4.9",
"vuex": "^3.6.0" "vuex": "^3.6.0",
"xgplayer": "^2.31.6"
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0", "@vue/cli-plugin-babel": "~4.5.0",

View File

@@ -65,43 +65,43 @@ export default {
}, },
}, },
os: { os: {
'menu_200' : { 'menu_100' : {
icon: 'profile', icon: 'profile',
title: '文件', title: '文件',
pageName: 'OsFileIndex', pageName: 'OsFileIndex',
params: {} params: {}
}, },
'menu_201' : { 'menu_101' : {
icon: 'profile', icon: 'profile',
title: '视图', title: '视图',
pageName: 'OsWindowViewIndex', pageName: 'OsWindowViewIndex',
params: {} params: {}
}, },
'menu_202' : { 'menu_102' : {
icon: 'profile', icon: 'profile',
title: '窗口', title: '窗口',
pageName: 'OsWindowIndex', pageName: 'OsWindowIndex',
params: {} params: {}
}, },
'menu_203' : { 'menu_103' : {
icon: 'profile', icon: 'profile',
title: '桌面通知', title: '桌面通知',
pageName: 'OsNotificationIndex', pageName: 'OsNotificationIndex',
params: {} params: {}
}, },
'menu_204' : { 'menu_104' : {
icon: 'profile', icon: 'profile',
title: '电源监控', title: '电源监控',
pageName: 'OsPowerMonitorIndex', pageName: 'OsPowerMonitorIndex',
params: {} params: {}
}, },
'menu_205' : { 'menu_105' : {
icon: 'profile', icon: 'profile',
title: '屏幕信息', title: '屏幕信息',
pageName: 'OsScreenIndex', pageName: 'OsScreenIndex',
params: {} params: {}
}, },
'menu_206' : { 'menu_106' : {
icon: 'profile', icon: 'profile',
title: '系统主题', title: '系统主题',
pageName: 'OsThemeIndex', pageName: 'OsThemeIndex',
@@ -109,15 +109,15 @@ export default {
}, },
}, },
hardware: { hardware: {
'menu_300' : { 'menu_100' : {
icon: 'profile', icon: 'profile',
title: '打印机', title: '打印机',
pageName: 'HardwarePrinterIndex', pageName: 'HardwarePrinterIndex',
params: {} params: {}
} }
}, },
effect: { effect: {
'menu_400' : { 'menu_100' : {
icon: 'profile', icon: 'profile',
title: '视频播放器', title: '视频播放器',
pageName: 'EffectVideoIndex', pageName: 'EffectVideoIndex',

View File

@@ -62,16 +62,14 @@ export default {
this.p = new Player(this.op); this.p = new Player(this.op);
}, },
selectFile () { selectFile () {
// todo
const self = this;
const params = {} const params = {}
this.$ipcInvoke(ipcApiRoute.effect.selectFile, params).then(res => { this.$ipc.invoke(ipcApiRoute.selectFile, params).then(res => {
console.log('res:', res) console.log('res:', res)
if (res) { if (res) {
self.fileUrl = res; this.fileUrl = res;
this.p.start(self.fileUrl); this.p.start(self.fileUrl);
} else { } else {
self.$message.warning('请选择视频'); this.$message.warning('请选择视频');
} }
}) })
}, },

View File

@@ -49,16 +49,15 @@ export default {
}, },
methods: { methods: {
init () { init () {
const self = this;
// 避免重复监听,或者将 on 功能写到一个统一的地方,只加载一次 // 避免重复监听,或者将 on 功能写到一个统一的地方,只加载一次
this.$ipc.removeAllListeners(ipcApiRoute.hardware.printStatus); this.$ipc.removeAllListeners(ipcApiRoute.printStatus);
this.$ipc.on(ipcApiRoute.hardware.printStatus, (event, result) => { this.$ipc.on(ipcApiRoute.printStatus, (event, result) => {
console.log('result', result); console.log('result', result);
self.$message.info('打印中...'); this.$message.info('打印中...');
}) })
}, },
getPrinter () { getPrinter () {
this.$ipcInvoke(ipcApiRoute.hardware.getPrinterList, {}).then(res => { this.$ipc.invoke(ipcApiRoute.getPrinterList, {}).then(res => {
this.printerList = res; this.printerList = res;
}) })
}, },
@@ -68,8 +67,7 @@ export default {
view: this.views[index], view: this.views[index],
deviceName: this.defaultDeviceName deviceName: this.defaultDeviceName
}; };
this.$ipc.send(ipcApiRoute.hardware.print, params) this.$ipc.send(ipcApiRoute.print, params)
}, },
defaultDevice (item) { defaultDevice (item) {
let desc = ""; let desc = "";

18
package-lock.json generated
View File

@@ -295,9 +295,9 @@
} }
}, },
"@types/formidable": { "@types/formidable": {
"version": "2.0.5", "version": "2.0.6",
"resolved": "https://registry.npmmirror.com/@types/formidable/-/formidable-2.0.5.tgz", "resolved": "https://registry.npmmirror.com/@types/formidable/-/formidable-2.0.6.tgz",
"integrity": "sha512-uvMcdn/KK3maPOaVUAc3HEYbCEhjaGFwww4EsX6IJfWIJ1tzHtDHczuImH3GKdusPnAAmzB07St90uabZeCKPA==", "integrity": "sha512-L4HcrA05IgQyNYJj6kItuIkXrInJvsXTPC5B1i64FggWKKqSL+4hgt7asiSNva75AoLQjq29oPxFfU4GAQ6Z2w==",
"requires": { "requires": {
"@types/node": "*" "@types/node": "*"
} }
@@ -347,9 +347,9 @@
"dev": true "dev": true
}, },
"@types/node": { "@types/node": {
"version": "20.1.1", "version": "20.1.2",
"resolved": "https://registry.npmmirror.com/@types/node/-/node-20.1.1.tgz", "resolved": "https://registry.npmmirror.com/@types/node/-/node-20.1.2.tgz",
"integrity": "sha512-uKBEevTNb+l6/aCQaKVnUModfEMjAl98lw2Si9P5y4hLu9tm6AlX2ZIoXZX6Wh9lJueYPrGPKk5WMCNHg/u6/A==" "integrity": "sha512-CTO/wa8x+rZU626cL2BlbCDzydgnFNgc19h4YvizpTO88MFQxab8wqisxaofQJ/9bLGugRdWIuX/TbIs6VVF6g=="
}, },
"@types/plist": { "@types/plist": {
"version": "3.0.2", "version": "3.0.2",
@@ -377,9 +377,9 @@
"integrity": "sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw==" "integrity": "sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw=="
}, },
"@types/validator": { "@types/validator": {
"version": "13.7.16", "version": "13.7.17",
"resolved": "https://registry.npmmirror.com/@types/validator/-/validator-13.7.16.tgz", "resolved": "https://registry.npmmirror.com/@types/validator/-/validator-13.7.17.tgz",
"integrity": "sha512-VyKmLktUHYLbrSbsRi241MSUlGYomQgK/tfCNpej3Gt5qDOM10AZ3nU2aR2s5JritClXuOBu4K7MkywVW/Y6Ow==" "integrity": "sha512-aqayTNmeWrZcvnG2MG9eGYI6b7S5fl+yKgPs6bAjOTwPS316R5SxBGKvtSExfyoJU7pIeHJfsHI0Ji41RVMkvQ=="
}, },
"@types/verror": { "@types/verror": {
"version": "1.10.6", "version": "1.10.6",