From a1d7e81859f554f3a53680cc35f0f49bf1f77098 Mon Sep 17 00:00:00 2001
From: wwf <1971391498@qq.com>
Date: 星期四, 14 五月 2026 14:37:02 +0800
Subject: [PATCH] 导入项目
---
src/views/bpm/task/done/index.vue | 282 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 282 insertions(+), 0 deletions(-)
diff --git a/src/views/bpm/task/done/index.vue b/src/views/bpm/task/done/index.vue
new file mode 100644
index 0000000..202cd0e
--- /dev/null
+++ b/src/views/bpm/task/done/index.vue
@@ -0,0 +1,282 @@
+<template>
+ <doc-alert title="瀹℃壒閫氳繃銆佷笉閫氳繃銆侀┏鍥�" url="https://doc.iocoder.cn/bpm/task-todo-done/" />
+ <doc-alert title="瀹℃壒鍔犵銆佸噺绛�" url="https://doc.iocoder.cn/bpm/sign/" />
+ <doc-alert
+ title="瀹℃壒杞姙銆佸娲俱�佹妱閫�"
+ url="https://doc.iocoder.cn/bpm/task-delegation-and-cc/"
+ />
+ <doc-alert title="瀹℃壒鍔犵銆佸噺绛�" url="https://doc.iocoder.cn/bpm/sign/" />
+
+ <ContentWrap>
+ <!-- 鎼滅储宸ヤ綔鏍� -->
+ <el-form
+ ref="queryFormRef"
+ :inline="true"
+ :model="queryParams"
+ class="-mb-15px"
+ label-width="68px"
+ >
+ <el-form-item label="" prop="name">
+ <el-input
+ v-model="queryParams.name"
+ class="!w-240px"
+ clearable
+ placeholder="璇疯緭鍏ヤ换鍔″悕绉�"
+ @keyup.enter="handleQuery"
+ />
+ </el-form-item>
+ <el-form-item>
+ <el-button @click="handleQuery">
+ <Icon class="mr-5px" icon="ep:search" />
+ 鎼滅储
+ </el-button>
+ </el-form-item>
+
+ <el-form-item label="" prop="category" :style="{ position: 'absolute', right: '300px' }">
+ <el-select
+ v-model="queryParams.category"
+ placeholder="璇烽�夋嫨娴佺▼鍒嗙被"
+ clearable
+ class="!w-155px"
+ @change="handleQuery"
+ >
+ <el-option
+ v-for="category in categoryList"
+ :key="category.code"
+ :label="category.name"
+ :value="category.code"
+ />
+ </el-select>
+ </el-form-item>
+
+ <el-form-item label="" prop="status" :style="{ position: 'absolute', right: '130px' }">
+ <el-select
+ v-model="queryParams.status"
+ placeholder="璇烽�夋嫨瀹℃壒鐘舵��"
+ clearable
+ class="!w-155px"
+ @change="handleQuery"
+ >
+ <el-option
+ v-for="dict in getIntDictOptions(DICT_TYPE.BPM_TASK_STATUS)"
+ :key="dict.value"
+ :label="dict.label"
+ :value="dict.value"
+ />
+ </el-select>
+ </el-form-item>
+
+ <!-- 楂樼骇绛涢�� -->
+ <el-form-item :style="{ position: 'absolute', right: '0px' }">
+ <el-popover
+ :visible="showPopover"
+ persistent
+ :width="400"
+ :show-arrow="false"
+ placement="bottom-end"
+ >
+ <template #reference>
+ <el-button @click="showPopover = !showPopover">
+ <Icon icon="ep:plus" class="mr-5px" />楂樼骇绛涢��
+ </el-button>
+ </template>
+ <el-form-item
+ label="鎵�灞炴祦绋�"
+ class="font-bold"
+ label-position="top"
+ prop="processDefinitionKey"
+ >
+ <el-select
+ v-model="queryParams.processDefinitionKey"
+ placeholder="璇烽�夋嫨娴佺▼瀹氫箟"
+ clearable
+ @change="handleQuery"
+ class="!w-390px"
+ >
+ <el-option
+ v-for="item in processDefinitionList"
+ :key="item.key"
+ :label="item.name"
+ :value="item.key"
+ />
+ </el-select>
+ </el-form-item>
+ <el-form-item label="鍙戣捣鏃堕棿" class="bold-label" label-position="top" prop="createTime">
+ <el-date-picker
+ v-model="queryParams.createTime"
+ value-format="YYYY-MM-DD HH:mm:ss"
+ type="daterange"
+ start-placeholder="寮�濮嬫棩鏈�"
+ end-placeholder="缁撴潫鏃ユ湡"
+ :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
+ class="!w-240px"
+ />
+ </el-form-item>
+ <el-form-item class="bold-label" label-position="top">
+ <el-button @click="handleQuery"> 纭</el-button>
+ <el-button @click="showPopover = false"> 鍙栨秷</el-button>
+ <el-button @click="resetQuery"> 娓呯┖</el-button>
+ </el-form-item>
+ </el-popover>
+ </el-form-item>
+ </el-form>
+ </ContentWrap>
+
+ <!-- 鍒楄〃 -->
+ <ContentWrap>
+ <el-table v-loading="loading" :data="list">
+ <el-table-column align="center" label="娴佺▼" prop="processInstance.name" width="180" />
+ <el-table-column label="鎽樿" prop="processInstance.summary" width="180">
+ <template #default="scope">
+ <div
+ class="flex flex-col"
+ v-if="scope.row.processInstance.summary && scope.row.processInstance.summary.length > 0"
+ >
+ <div v-for="(item, index) in scope.row.processInstance.summary" :key="index">
+ <el-text type="info"> {{ item.key }} : {{ item.value }} </el-text>
+ </div>
+ </div>
+ </template>
+ </el-table-column>
+ <el-table-column
+ align="center"
+ label="鍙戣捣浜�"
+ prop="processInstance.startUser.nickname"
+ width="100"
+ />
+ <el-table-column
+ :formatter="dateFormatter"
+ align="center"
+ label="鍙戣捣鏃堕棿"
+ prop="createTime"
+ width="180"
+ />
+ <el-table-column align="center" label="褰撳墠浠诲姟" prop="name" width="180" />
+ <el-table-column
+ :formatter="dateFormatter"
+ align="center"
+ label="浠诲姟寮�濮嬫椂闂�"
+ prop="createTime"
+ width="180"
+ />
+ <el-table-column
+ :formatter="dateFormatter"
+ align="center"
+ label="浠诲姟缁撴潫鏃堕棿"
+ prop="endTime"
+ width="180"
+ />
+ <el-table-column align="center" label="瀹℃壒鐘舵��" prop="status" width="120">
+ <template #default="scope">
+ <dict-tag :type="DICT_TYPE.BPM_TASK_STATUS" :value="scope.row.status" />
+ </template>
+ </el-table-column>
+ <el-table-column align="center" label="瀹℃壒寤鸿" prop="reason" min-width="180" />
+ <el-table-column align="center" label="鑰楁椂" prop="durationInMillis" width="160">
+ <template #default="scope">
+ {{ formatPast2(scope.row.durationInMillis) }}
+ </template>
+ </el-table-column>
+ <el-table-column
+ align="center"
+ label="娴佺▼缂栧彿"
+ prop="processInstanceId"
+ :show-overflow-tooltip="true"
+ />
+ <el-table-column align="center" label="浠诲姟缂栧彿" prop="id" :show-overflow-tooltip="true" />
+ <el-table-column align="center" label="鎿嶄綔" fixed="right" width="130">
+ <template #default="scope">
+ <el-button link type="warning" @click="handleWithdraw(scope.row)">鎾ゅ洖</el-button>
+ <el-button link type="primary" @click="handleAudit(scope.row)">鍘嗗彶</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ <!-- 鍒嗛〉 -->
+ <Pagination
+ v-model:limit="queryParams.pageSize"
+ v-model:page="queryParams.pageNo"
+ :total="total"
+ @pagination="getList"
+ />
+ </ContentWrap>
+</template>
+<script lang="ts" setup>
+import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
+import { dateFormatter, formatPast2 } from '@/utils/formatTime'
+import * as TaskApi from '@/api/bpm/task'
+import { CategoryApi, CategoryVO } from '@/api/bpm/category'
+import * as DefinitionApi from '@/api/bpm/definition'
+
+defineOptions({ name: 'BpmDoneTask' })
+
+const { push } = useRouter() // 璺敱
+const message = useMessage()
+
+const loading = ref(true) // 鍒楄〃鐨勫姞杞戒腑
+const total = ref(0) // 鍒楄〃鐨勬�婚〉鏁�
+const list = ref([]) // 鍒楄〃鐨勬暟鎹�
+const processDefinitionList = ref<any[]>([]) // 娴佺▼瀹氫箟鍒楄〃
+const queryParams = reactive({
+ pageNo: 1,
+ pageSize: 10,
+ name: '',
+ category: undefined,
+ status: undefined,
+ processDefinitionKey: '',
+ createTime: []
+})
+const queryFormRef = ref() // 鎼滅储鐨勮〃鍗�
+const categoryList = ref<CategoryVO[]>([]) // 娴佺▼鍒嗙被鍒楄〃
+const showPopover = ref(false) // 楂樼骇绛涢�夋槸鍚﹀睍绀�
+
+/** 鏌ヨ浠诲姟鍒楄〃 */
+const getList = async () => {
+ loading.value = true
+ try {
+ const data = await TaskApi.getTaskDonePage(queryParams)
+ list.value = data.list
+ total.value = data.total
+ } finally {
+ loading.value = false
+ }
+}
+
+/** 鎼滅储鎸夐挳鎿嶄綔 */
+const handleQuery = () => {
+ queryParams.pageNo = 1
+ getList()
+}
+
+/** 閲嶇疆鎸夐挳鎿嶄綔 */
+const resetQuery = () => {
+ queryFormRef.value.resetFields()
+ handleQuery()
+}
+
+/** 澶勭悊瀹℃壒鎸夐挳 */
+const handleAudit = (row: any) => {
+ push({
+ name: 'BpmProcessInstanceDetail',
+ query: {
+ id: row.processInstance.id,
+ taskId: row.id
+ }
+ })
+}
+
+/** 娴嬪洖鎸夐挳 */
+const handleWithdraw = (row: any) => {
+ TaskApi.withdrawTask(row.id).then(() => {
+ message.success('鎾ゅ洖鎴愬姛')
+ getList()
+ })
+}
+
+/** 鍒濆鍖� **/
+onMounted(async () => {
+ await getList()
+ categoryList.value = await CategoryApi.getCategorySimpleList()
+ // 鑾峰彇娴佺▼瀹氫箟鍒楄〃
+ processDefinitionList.value = await DefinitionApi.getSimpleProcessDefinitionList()
+})
+</script>
--
Gitblit v1.8.0