|
@@ -1,65 +1,37 @@
|
|
|
-<script setup lang="ts" name="Done">
|
|
|
-import dayjs from 'dayjs'
|
|
|
-import duration from 'dayjs/plugin/duration'
|
|
|
-import { DICT_TYPE } from '@/utils/dict'
|
|
|
-import type { TaskDoneVO } from '@/api/bpm/task/types'
|
|
|
-import { allSchemas } from './done.data'
|
|
|
-import * as TaskDoneApi from '@/api/bpm/task'
|
|
|
-import { useTable } from '@/hooks/web/useTable'
|
|
|
-dayjs.extend(duration)
|
|
|
-const { t } = useI18n() // 国际化
|
|
|
-const { push } = useRouter()
|
|
|
-// ========== 列表相关 ==========
|
|
|
-const { register, tableObject, methods } = useTable<TaskDoneVO>({
|
|
|
- getListApi: TaskDoneApi.getDoneTaskPage
|
|
|
-})
|
|
|
-const { getList, setSearchParams } = methods
|
|
|
-
|
|
|
-// 审批操作
|
|
|
-const handleAudit = async (row: TaskDoneVO) => {
|
|
|
- push('/bpm/process-instance/detail?id=' + row.processInstance.id)
|
|
|
-}
|
|
|
-
|
|
|
-// ========== 初始化 ==========
|
|
|
-getList()
|
|
|
-</script>
|
|
|
-
|
|
|
<template>
|
|
|
- <!-- 搜索工作区 -->
|
|
|
<ContentWrap>
|
|
|
- <Search :schema="allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
|
|
|
- </ContentWrap>
|
|
|
- <ContentWrap>
|
|
|
- <!-- 列表 -->
|
|
|
- <Table
|
|
|
- :columns="allSchemas.tableColumns"
|
|
|
- :selection="false"
|
|
|
- :data="tableObject.tableList"
|
|
|
- :loading="tableObject.loading"
|
|
|
- :pagination="{
|
|
|
- total: tableObject.total
|
|
|
- }"
|
|
|
- v-model:pageSize="tableObject.pageSize"
|
|
|
- v-model:currentPage="tableObject.currentPage"
|
|
|
- @register="register"
|
|
|
- >
|
|
|
- <template #status="{ row }">
|
|
|
- <DictTag :type="DICT_TYPE.COMMON_STATUS" :value="row.status" />
|
|
|
- </template>
|
|
|
- <template #createTime="{ row }">
|
|
|
- <span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
|
|
|
+ <XTable @register="registerTable">
|
|
|
+ <template #suspensionState_default="{ row }">
|
|
|
+ <el-tag type="success" v-if="row.suspensionState === 1">激活</el-tag>
|
|
|
+ <el-tag type="warning" v-if="row.suspensionState === 2">挂起</el-tag>
|
|
|
</template>
|
|
|
- <template #endTime="{ row }">
|
|
|
- <span>{{ dayjs(row.endTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
|
|
|
+ <template #actionbtns_default="{ row }">
|
|
|
+ <!-- 操作: 审批进度 -->
|
|
|
+ <XTextButton preIcon="ep:view" title="详情" @click="handleAudit(row)" />
|
|
|
</template>
|
|
|
- <template #durationInMillis="{ row }">
|
|
|
- <span>{{ dayjs.duration(row.durationInMillis).asMilliseconds() }}</span>
|
|
|
- </template>
|
|
|
- <template #action="{ row }">
|
|
|
- <el-button link type="primary" v-hasPermi="['bpm:task:query']" @click="handleAudit(row)">
|
|
|
- <Icon icon="ep:view" class="mr-1px" /> {{ t('action.detail') }}
|
|
|
- </el-button>
|
|
|
- </template>
|
|
|
- </Table>
|
|
|
+ </XTable>
|
|
|
</ContentWrap>
|
|
|
</template>
|
|
|
+
|
|
|
+<script setup lang="ts">
|
|
|
+// 业务相关的 import
|
|
|
+import { allSchemas } from './done.data'
|
|
|
+import * as TaskApi from '@/api/bpm/task'
|
|
|
+
|
|
|
+const router = useRouter() // 路由
|
|
|
+
|
|
|
+const [registerTable] = useXTable({
|
|
|
+ allSchemas: allSchemas,
|
|
|
+ getListApi: TaskApi.getDoneTaskPage
|
|
|
+})
|
|
|
+
|
|
|
+// 处理审批按钮
|
|
|
+const handleAudit = (row) => {
|
|
|
+ router.push({
|
|
|
+ name: 'BpmProcessInstanceDetail',
|
|
|
+ query: {
|
|
|
+ id: row.processInstanceId
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+</script>
|