relatedTasks.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <template>
  2. <div class="flex flex-col h-full overflow-y-auto">
  3. <div class="info h-full cellnormall" v-if="infoList.length">
  4. <div v-for="(item, index) in infoList">
  5. <FoldingPanel :title="`相关任务(${item.taskName})`">
  6. <template #foldContainer>
  7. <div class="p-5 bg-white ">
  8. <van-cell title="任务名称" :value="item.taskName" />
  9. <van-cell title="优先级" :value="retPriorityStr(item.priority)" />
  10. <van-cell title="状态" :value="retStatueStr(item.status)" />
  11. <van-cell title="执行人">
  12. <template #default>
  13. <TranslationComponent :openId="item.executorNames" />
  14. </template>
  15. </van-cell>
  16. <van-cell title="开始时间" :value="item.startDate" />
  17. <van-cell title="截至时间" :value="item.endDate" />
  18. <van-cell title="备注" :value="item.taskDesc" />
  19. </div>
  20. </template>
  21. </FoldingPanel>
  22. </div>
  23. </div>
  24. <div v-else class="items-justify-center h-2/3">
  25. <van-empty description="暂无任务" />
  26. </div>
  27. </div>
  28. </template>
  29. <script setup>
  30. import { ref } from 'vue';
  31. import { useLifecycle } from '@hooks/useCommon.js';
  32. import { fixedFieldPriority, fixedFieldTaskStatus } from "@utility/defaultData.js"
  33. import FoldingPanel from '@components/common/foldingPanel.vue';
  34. const props = defineProps({
  35. infoList: {
  36. type: Array,
  37. required: true,
  38. default: () => ([])
  39. }
  40. })
  41. function retPriorityStr(value) {
  42. return fixedFieldPriority.find(item => item.value == value)?.label
  43. }
  44. function retStatueStr(value) {
  45. return fixedFieldTaskStatus.find(item => item.value == value)?.label
  46. }
  47. useLifecycle({
  48. load: () => {
  49. // 添加加载逻辑
  50. }
  51. });
  52. </script>
  53. <style lang='scss' scoped>
  54. .info {
  55. margin: 8px 14px 30px 14px;
  56. }
  57. </style>