Index.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. const self = this;
  39. self.$ipcCall(ipcApiRoute.autoLaunch, 'check').then(result => {
  40. console.log('[ipcRenderer] [autoLaunch] result:', result)
  41. this.autoLaunchChecked = result.status;
  42. })
  43. },
  44. autoLaunchChange (checkStatus) {
  45. console.log('[ipcRenderer] [autoLaunch] self.autoLaunchChecked:', this.autoLaunchChecked)
  46. },
  47. }
  48. }
  49. </script>
  50. <style lang="less" scoped>
  51. #app-base-system-launch {
  52. padding: 0px 10px;
  53. text-align: left;
  54. width: 100%;
  55. .one-block-1 {
  56. font-size: 16px;
  57. padding-top: 10px;
  58. }
  59. .one-block-2 {
  60. padding-top: 10px;
  61. }
  62. .set-auto {
  63. .ant-list-item:last-child {
  64. border-bottom: 1px solid #e8e8e8;
  65. }
  66. }
  67. }
  68. </style>