Index.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <template>
  2. <div id="app-base-system-launch">
  3. <div class="one-block-2">
  4. <a-list class="set-auto" itemLayout="horizontal">
  5. <a-list-item style="text-align: left;">
  6. <a-list-item-meta>
  7. <template v-slot:title>
  8. <a>启动</a>
  9. </template>
  10. <template v-slot:description>
  11. <span>
  12. 开机自动启动
  13. </span>
  14. </template>
  15. </a-list-item-meta>
  16. <template v-slot:actions>
  17. <a-switch v-model="autoLaunchChecked" checkedChildren="开" unCheckedChildren="关" @change="autoLaunchChange()" />
  18. </template>
  19. </a-list-item>
  20. </a-list>
  21. </div>
  22. </div>
  23. </template>
  24. <script>
  25. import { ipcApiRoute } from '@/api/main'
  26. export default {
  27. data () {
  28. return {
  29. autoLaunchChecked: false
  30. }
  31. },
  32. mounted () {
  33. this.init();
  34. },
  35. methods: {
  36. init () {
  37. // todo .....
  38. this.$ipc.invoke(ipcApiRoute.autoLaunch, 'check').then(result => {
  39. console.log('[ipcRenderer] [autoLaunch] result:', result)
  40. this.autoLaunchChecked = result.status;
  41. })
  42. },
  43. autoLaunchChange (checkStatus) {
  44. console.log('[ipcRenderer] [autoLaunch] self.autoLaunchChecked:', this.autoLaunchChecked)
  45. },
  46. }
  47. }
  48. </script>
  49. <style lang="less" scoped>
  50. #app-base-system-launch {
  51. padding: 0px 10px;
  52. text-align: left;
  53. width: 100%;
  54. .one-block-1 {
  55. font-size: 16px;
  56. padding-top: 10px;
  57. }
  58. .one-block-2 {
  59. padding-top: 10px;
  60. }
  61. .set-auto {
  62. .ant-list-item:last-child {
  63. border-bottom: 1px solid #e8e8e8;
  64. }
  65. }
  66. }
  67. </style>