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/todo/index.vue |  236 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 236 insertions(+), 0 deletions(-)

diff --git a/src/views/bpm/task/todo/index.vue b/src/views/bpm/task/todo/index.vue
new file mode 100644
index 0000000..2c72e82
--- /dev/null
+++ b/src/views/bpm/task/todo/index.vue
@@ -0,0 +1,236 @@
+<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" class="absolute right-130px">
+        <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 class="absolute right-0">
+        <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="font-bold" 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="font-bold" label-position="top">
+            <div class="flex justify-end w-full">
+              <el-button @click="resetQuery">娓呯┖</el-button>
+              <el-button @click="showPopover = false">鍙栨秷</el-button>
+              <el-button type="primary" @click="handleQuery">纭</el-button>
+            </div>
+          </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="processInstance.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
+        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="80">
+        <template #default="scope">
+          <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 { dateFormatter } 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: 'BpmTodoTask' })
+
+const { push } = useRouter() // 璺敱
+
+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,
+  processDefinitionKey: '',
+  createTime: []
+})
+const queryFormRef = ref() // 鎼滅储鐨勮〃鍗�
+const categoryList = ref<CategoryVO[]>([]) // 娴佺▼鍒嗙被鍒楄〃
+const showPopover = ref(false) // 楂樼骇绛涢�夋槸鍚﹀睍绀�
+
+/** 鏌ヨ浠诲姟鍒楄〃 */
+const getList = async () => {
+  loading.value = true
+  try {
+    const data = await TaskApi.getTaskTodoPage(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
+    }
+  })
+}
+
+/** 鍒濆鍖� **/
+onMounted(async () => {
+  await getList()
+  categoryList.value = await CategoryApi.getCategorySimpleList()
+  // 鑾峰彇娴佺▼瀹氫箟鍒楄〃
+  processDefinitionList.value = await DefinitionApi.getSimpleProcessDefinitionList()
+})
+</script>

--
Gitblit v1.8.0