JobLog.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <template>
  2. <div class="job-log-container">
  3. <el-tabs v-model="activeTab" @tab-change="handleTabChange">
  4. <el-tab-pane label="定时任务日志" name="cron">
  5. <template #label>
  6. <el-icon><Timer /></el-icon>
  7. <span style="margin-left: 4px">定时任务日志</span>
  8. </template>
  9. <CronJobLog v-if="activeTab === 'cron'" />
  10. </el-tab-pane>
  11. <el-tab-pane label="队列任务日志" name="queue">
  12. <template #label>
  13. <el-icon><List /></el-icon>
  14. <span style="margin-left: 4px">队列任务日志</span>
  15. </template>
  16. <QueueJobLog v-if="activeTab === 'queue'" />
  17. </el-tab-pane>
  18. </el-tabs>
  19. </div>
  20. </template>
  21. <script setup>
  22. import { ref } from 'vue'
  23. import { Timer, List } from '@element-plus/icons-vue'
  24. import CronJobLog from './CronJobLog.vue'
  25. import QueueJobLog from './QueueJobLog.vue'
  26. const activeTab = ref('cron')
  27. const handleTabChange = (tab) => {
  28. // Tab changed - components will mount/unmount due to v-if
  29. }
  30. </script>
  31. <style scoped lang="scss">
  32. .job-log-container {
  33. padding: 0;
  34. :deep(.el-tabs__header) {
  35. margin-bottom: 16px;
  36. }
  37. :deep(.el-tabs__item) {
  38. font-size: 14px;
  39. }
  40. }
  41. </style>