Schedule.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <template>
  2. <div>
  3. <a-tabs default-active-key="res-sync" @change="handleTabChange">
  4. <a-tab-pane v-for="item in tabs" :key="item.key" :tab="item.label" />
  5. </a-tabs>
  6. <div class="mt-2">
  7. <keep-alive>
  8. <component
  9. :is="currentTab"
  10. :id="id"
  11. :resId="resId"
  12. :data="data"
  13. :getParams="getParams"
  14. :accountData="data" />
  15. </keep-alive>
  16. </div>
  17. </div>
  18. </template>
  19. <script>
  20. import ResSync from './ResSync'
  21. import BillTask from '@Cloudenv/views/billtasks/components/List'
  22. import WindowsMixin from '@/mixins/windows'
  23. import ListMixin from '@/mixins/list'
  24. import { hasMeterService } from '@/utils/auth'
  25. export default {
  26. name: 'ScheduledtasksListForCloudaccountSidepage',
  27. components: {
  28. ResSync,
  29. BillTask,
  30. },
  31. mixins: [WindowsMixin, ListMixin],
  32. props: {
  33. id: String,
  34. resId: String,
  35. data: Object,
  36. getParams: [Function, Object],
  37. },
  38. data () {
  39. return {
  40. currentTab: 'res-sync',
  41. }
  42. },
  43. computed: {
  44. tabs () {
  45. const tabs = [
  46. { key: 'res-sync', label: this.$t('cloudenv.res_sync') },
  47. ]
  48. if (hasMeterService()) {
  49. tabs.push({ key: 'bill-task', label: this.$t('cloudenv.bill_tasks') })
  50. }
  51. return tabs
  52. },
  53. },
  54. methods: {
  55. handleTabChange (tab) {
  56. this.currentTab = tab
  57. },
  58. },
  59. }
  60. </script>