TaskDetail.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <template>
  2. <Dialog title="详情" v-model="dialogVisible" :scroll="true" :max-height="500">
  3. <el-descriptions border :column="1">
  4. <el-descriptions-item label="任务编号" min-width="120">
  5. {{ detailData.id }}
  6. </el-descriptions-item>
  7. <el-descriptions-item label="任务名称">
  8. {{ detailData.name }}
  9. </el-descriptions-item>
  10. <el-descriptions-item label="所属流程">
  11. {{ detailData.processInstance.name }}
  12. </el-descriptions-item>
  13. <el-descriptions-item label="流程发起人">
  14. {{ detailData.processInstance.startUserNickname }}
  15. </el-descriptions-item>
  16. <el-descriptions-item label="状态">
  17. <dict-tag :type="DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT" :value="detailData.result" />
  18. </el-descriptions-item>
  19. <el-descriptions-item label="原因">
  20. {{ detailData.reason }}
  21. </el-descriptions-item>
  22. <el-descriptions-item label="创建时间">
  23. {{ formatDate(detailData.createTime) }}
  24. </el-descriptions-item>
  25. </el-descriptions>
  26. </Dialog>
  27. </template>
  28. <script setup lang="ts">
  29. import { DICT_TYPE } from '@/utils/dict'
  30. import { formatDate } from '@/utils/formatTime'
  31. import * as TaskApi from '@/api/bpm/task'
  32. const dialogVisible = ref(false) // 弹窗的是否展示
  33. const detailLoading = ref(false) // 表单的加载中
  34. const detailData = ref() // 详情数据
  35. /** 打开弹窗 */
  36. const open = async (data: TaskApi.TaskVO) => {
  37. dialogVisible.value = true
  38. // 设置数据
  39. detailLoading.value = true
  40. try {
  41. detailData.value = data
  42. } finally {
  43. detailLoading.value = false
  44. }
  45. }
  46. defineExpose({ open }) // 提供 open 方法,用于打开弹窗
  47. </script>