index.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <script setup lang="ts">
  2. import dayjs from 'dayjs'
  3. import { DICT_TYPE } from '@/utils/dict'
  4. import { useTable } from '@/hooks/web/useTable'
  5. import type { TaskTodoVO } from '@/api/bpm/task/types'
  6. import { allSchemas } from './done.data'
  7. import * as TaskTodoApi from '@/api/bpm/task'
  8. import { useRouter } from 'vue-router'
  9. const { push } = useRouter()
  10. // ========== 列表相关 ==========
  11. const { register, tableObject, methods } = useTable<TaskTodoVO>({
  12. getListApi: TaskTodoApi.getTodoTaskPage
  13. })
  14. const { getList, setSearchParams } = methods
  15. // 审批操作
  16. const handleAudit = async (row: TaskTodoVO) => {
  17. push('/bpm/process-instance/detail?id=' + row.processInstance.id)
  18. }
  19. // ========== 初始化 ==========
  20. getList()
  21. </script>
  22. <template>
  23. <!-- 搜索工作区 -->
  24. <ContentWrap>
  25. <Search :schema="allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
  26. </ContentWrap>
  27. <ContentWrap>
  28. <!-- 列表 -->
  29. <Table
  30. :columns="allSchemas.tableColumns"
  31. :selection="false"
  32. :data="tableObject.tableList"
  33. :loading="tableObject.loading"
  34. :pagination="{
  35. total: tableObject.total
  36. }"
  37. v-model:pageSize="tableObject.pageSize"
  38. v-model:currentPage="tableObject.currentPage"
  39. @register="register"
  40. >
  41. <template #status="{ row }">
  42. <DictTag :type="DICT_TYPE.COMMON_STATUS" :value="row.status" />
  43. </template>
  44. <template #createTime="{ row }">
  45. <span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
  46. </template>
  47. <template #action="{ row }">
  48. <el-button link type="primary" v-hasPermi="['bpm:task:update']" @click="handleAudit(row)">
  49. <Icon icon="ep:edit" class="mr-1px" /> 审批
  50. </el-button>
  51. </template>
  52. </Table>
  53. </ContentWrap>
  54. </template>