This commit is contained in:
gaoshuaixing
2023-05-15 17:15:52 +08:00
parent a914951cb8
commit 2efb7d7928
4 changed files with 14 additions and 24 deletions

View File

@@ -7,8 +7,8 @@
</div>
<div class="one-block-2">
<a-space>
<a-button @click="messageShow('ipc')">消息提示(ipc)</a-button>
<a-button @click="messageShowConfirm('ipc')">消息提示与确认(ipc)</a-button>
<a-button @click="messageShow()">消息提示(ipc)</a-button>
<a-button @click="messageShowConfirm()">消息提示与确认(ipc)</a-button>
</a-space>
</div>
<div class="one-block-1">
@@ -110,10 +110,9 @@ export default {
},
methods: {
getHost () {
const self = this;
this.$ipc.invoke(ipcApiRoute.checkHttpServer, {}).then(r => {
if (r.enable) {
self.servicAddress = r.server;
this.servicAddress = r.server;
storage.set('httpServiceConfig', r);
// url转换
@@ -130,24 +129,19 @@ export default {
})
},
selectDir() {
const self = this;
this.$ipc.invoke(ipcApiRoute.selectFolder, '').then(r => {
self.dir_path = r;
self.$message.info(r);
this.dir_path = r;
this.$message.info(r);
})
},
messageShow(type) {
const self = this;
console.log('[messageShow] type:', type)
messageShow() {
this.$ipc.invoke(ipcApiRoute.messageShow, '').then(r => {
self.$message.info(r);
this.$message.info(r);
})
},
messageShowConfirm(type) {
const self = this;
console.log('[messageShowConfirm] type:', type)
messageShowConfirm() {
this.$ipc.invoke(ipcApiRoute.messageShowConfirm, '').then(r => {
self.$message.info(r);
this.$message.info(r);
})
},
handleFileChange(info) {

View File

@@ -30,12 +30,11 @@ export default {
},
methods: {
init () {
const self = this;
this.$ipc.removeAllListeners(ipcApiRoute.initPowerMonitor);
this.$ipc.on(ipcApiRoute.initPowerMonitor, (event, result) => {
if (Object.prototype.toString.call(result) == '[object Object]') {
self.currentStatus = result.msg;
self.$message.info(result.msg);
this.currentStatus = result.msg;
this.$message.info(result.msg);
}
})
this.$ipc.send(ipcApiRoute.initPowerMonitor, '');

View File

@@ -39,9 +39,8 @@ export default {
},
methods: {
getScreen (index) {
const self = this;
this.$ipc.invoke(ipcApiRoute.getScreen, index).then(result => {
self.data = result;
this.data = result;
})
},
}

View File

@@ -49,20 +49,18 @@ export default {
},
methods: {
setTheme (e) {
const self = this;
this.currentThemeMode = e.target.value;
console.log('setTheme currentThemeMode:', this.currentThemeMode)
this.$ipc.invoke(ipcApiRoute.setTheme, this.currentThemeMode).then(result => {
console.log('result:', result)
self.currentThemeMode = result;
this.currentThemeMode = result;
})
},
getTheme () {
const self = this;
this.$ipc.invoke(ipcApiRoute.getTheme).then(result => {
console.log('result:', result)
self.currentThemeMode = result;
this.currentThemeMode = result;
})
},
}