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/processInstance/detail/ProcessInstanceTaskList.vue |  103 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 103 insertions(+), 0 deletions(-)

diff --git a/src/views/bpm/processInstance/detail/ProcessInstanceTaskList.vue b/src/views/bpm/processInstance/detail/ProcessInstanceTaskList.vue
new file mode 100644
index 0000000..8690e58
--- /dev/null
+++ b/src/views/bpm/processInstance/detail/ProcessInstanceTaskList.vue
@@ -0,0 +1,103 @@
+<template>
+  <el-table :data="tasks" border header-cell-class-name="table-header-gray">
+    <el-table-column label="瀹℃壒鑺傜偣" prop="name" min-width="120" align="center" />
+    <el-table-column label="瀹℃壒浜�" min-width="100" align="center">
+      <template #default="scope">
+        {{ scope.row.assigneeUser?.nickname || scope.row.ownerUser?.nickname }}
+      </template>
+    </el-table-column>
+    <el-table-column
+      :formatter="dateFormatter"
+      align="center"
+      label="寮�濮嬫椂闂�"
+      prop="createTime"
+      min-width="140"
+    />
+    <el-table-column
+      :formatter="dateFormatter"
+      align="center"
+      label="缁撴潫鏃堕棿"
+      prop="endTime"
+      min-width="140"
+    />
+    <el-table-column align="center" label="瀹℃壒鐘舵��" prop="status" min-width="90">
+      <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="200">
+      <template #default="scope">
+        {{ scope.row.reason }}
+        <el-button
+          class="ml-10px"
+          size="small"
+          v-if="scope.row.formId > 0"
+          @click="handleFormDetail(scope.row)"
+        >
+          <Icon icon="ep:document" /> 鏌ョ湅琛ㄥ崟
+        </el-button>
+      </template>
+    </el-table-column>
+    <el-table-column align="center" label="鑰楁椂" prop="durationInMillis" min-width="100">
+      <template #default="scope">
+        {{ formatPast2(scope.row.durationInMillis) }}
+      </template>
+    </el-table-column>
+  </el-table>
+
+  <!-- 寮圭獥锛氳〃鍗� -->
+  <Dialog title="琛ㄥ崟璇︽儏" v-model="taskFormVisible" width="600">
+    <form-create
+      ref="fApi"
+      v-model="taskForm.value"
+      :option="taskForm.option"
+      :rule="taskForm.rule"
+    />
+  </Dialog>
+</template>
+<script lang="ts" setup>
+import { dateFormatter, formatPast2 } from '@/utils/formatTime'
+import { propTypes } from '@/utils/propTypes'
+import { DICT_TYPE } from '@/utils/dict'
+import type { ApiAttrs } from '@form-create/element-ui/types/config'
+import { setConfAndFields2 } from '@/utils/formCreate'
+import * as TaskApi from '@/api/bpm/task'
+
+defineOptions({ name: 'BpmProcessInstanceTaskList' })
+
+const props = defineProps({
+  loading: propTypes.bool.def(false), // 鏄惁鍔犺浇涓�
+  id: propTypes.string // 娴佺▼瀹炰緥鐨勭紪鍙�
+})
+const tasks = ref([]) // 娴佺▼浠诲姟鐨勬暟缁�
+
+/** 鏌ョ湅琛ㄥ崟 */
+const fApi = ref<ApiAttrs>() // form-create 鐨� API 鎿嶄綔绫�
+const taskForm = ref({
+  rule: [],
+  option: {},
+  value: {}
+}) // 娴佺▼浠诲姟鐨勮〃鍗曡鎯�
+const taskFormVisible = ref(false)
+const handleFormDetail = async (row: any) => {
+  // 璁剧疆琛ㄥ崟
+  setConfAndFields2(taskForm, row.formConf, row.formFields, row.formVariables)
+  // 寮圭獥鎵撳紑
+  taskFormVisible.value = true
+  // 闅愯棌鎻愪氦銆侀噸缃寜閽紝璁剧疆绂佺敤鍙
+  await nextTick()
+  fApi.value.fapi.btn.show(false)
+  fApi.value?.fapi?.resetBtn.show(false)
+  fApi.value?.fapi?.disabled(true)
+}
+
+/** 鍙湁 loading 瀹屾垚鏃讹紝鎵嶅幓鍔犺浇娴佺▼鍒楄〃 */
+watch(
+  () => props.loading,
+  async (value) => {
+    if (value) {
+      tasks.value = await TaskApi.getTaskListByProcessInstanceId(props.id)
+    }
+  }
+)
+</script>

--
Gitblit v1.8.0