gaoshuaixing 2 سال پیش
والد
کامیت
2efb7d7928

+ 9 - 15
frontend/src/views/os/file/Index.vue

@@ -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) {

+ 2 - 3
frontend/src/views/os/powermonitor/Index.vue

@@ -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, '');

+ 1 - 2
frontend/src/views/os/screen/Index.vue

@@ -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;
       })
     },
   }

+ 2 - 4
frontend/src/views/os/theme/Index.vue

@@ -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;
       })  
     },
   }