task.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <template>
  2. <div>
  3. <div style="height: 50px; line-height: 50px; border-bottom: 1px solid #4f4f4f; font-weight: 450;">
  4. <a-row>
  5. <a-col :span="1"></a-col>
  6. <a-col :span="20">Task Plan Library</a-col>
  7. <a-col :span="2">
  8. <span v-if="taskRoute">
  9. <router-link :to="{ name: ERouterName.CREATE_PLAN }">
  10. <PlusOutlined class="route-icon" />
  11. </router-link>
  12. </span>
  13. <span v-else>
  14. <router-link :to="{ name: ERouterName.TASK }">
  15. <MinusOutlined class="route-icon" />
  16. </router-link>
  17. </span>
  18. </a-col>
  19. <a-col :span="1"></a-col>
  20. </a-row>
  21. </div>
  22. <div v-if="!taskRoute">
  23. <router-view />
  24. </div>
  25. </div>
  26. </template>
  27. <script lang="ts" setup>
  28. import { PlusOutlined, MinusOutlined } from '@ant-design/icons-vue'
  29. import { computed, ref } from 'vue'
  30. import { useRoute } from 'vue-router'
  31. import { ERouterName } from '/@/types/enums'
  32. const route = useRoute()
  33. const taskRoute = computed(() => {
  34. return route.name === ERouterName.TASK
  35. })
  36. </script>
  37. <style lang="scss">
  38. .route-icon {
  39. color: #fff;
  40. font-size: 16px;
  41. }
  42. </style>