This commit is contained in:
那些花儿
2025-08-30 17:49:39 +08:00
parent cbc1956bc6
commit 5441b1d785
83 changed files with 3708 additions and 3186 deletions
@@ -8,13 +8,15 @@
<script src="/assets/platform/plugins/vue/vue.js"></script>
<script src="/assets/platform/plugins/jquery/jquery.js"></script>
<script src="/assets/platform/plugins/element-ui/lib/index.js"></script>
<link rel="stylesheet" href="https://cdn.staticfile.net/element-ui/2.15.14/theme-chalk/index.css" />
<link rel="stylesheet" href="${base!}/assets/platform/plugins/element-ui/lib/theme-chalk/index.css" />
<link rel="stylesheet" href="${base!}/assets/platform/plugins/element-ui/lib/theme-chalk/index_custom.css" />
<link rel="stylesheet" href="${base!}/assets/platform/plugins/element-ui/lib/theme-chalk/override.css" />
<link rel="stylesheet" href="${base!}/assets/platform/css/root.css" />
<!-- 引入 core 包和对应 css-->
<script src="https://cdn.jsdelivr.net/npm/@logicflow/core@1.2.12/dist/logic-flow.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@logicflow/core@1.2.12/dist/style/index.css" />
<script src="/assets/platform/plugins/logicflow/logic-flow.js"></script>
<link rel="stylesheet" href="/assets/platform/plugins/logicflow/index.css" />
<!-- <script src="https://cdn.jsdelivr.net/npm/@logicflow/core@1.2.12/dist/logic-flow.js"></script>-->
<!-- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@logicflow/core@1.2.12/dist/style/index.css" />-->
<script src="/assets/platform/plugins/snaker/SnakerflowDesigner.umd.js"></script>
<style>
#app {
@@ -252,13 +252,15 @@ layout("/layouts/v4/baseLayout.html"){
<!-- 搜索筛选区域 -->
<el-card shadow="never" class="filter-section">
<el-form :inline="true" :model="searchForm" class="search-form">
<el-form :inline="true" :model="pageForm" class="search-form">
<el-form-item>
<el-input v-model="searchForm.keyword" placeholder="请输入关键词搜索" prefix-icon="el-icon-search" clearable></el-input>
<el-input v-model="pageForm.searchKeyword" placeholder="请输入关键词搜索" prefix-icon="el-icon-search"
clearable></el-input>
</el-form-item>
<el-form-item>
<el-select v-model="searchForm.category" placeholder="所有流程分类" clearable>
<el-option v-for="type in categoryOptions" :key="type.id" :label="type.name" :value="type.id"></el-option>
<el-select v-model="pageForm.category" placeholder="所有流程分类" clearable>
<el-option v-for="type in categoryOptions" :key="type.id" :label="type.name"
:value="type.id"></el-option>
</el-select>
</el-form-item>
<el-form-item>
@@ -279,15 +281,18 @@ layout("/layouts/v4/baseLayout.html"){
</div>
<!-- 表格展示 -->
<el-table v-loading="loading" :data="tasks" style="width: 100%" :key="activeTab" :header-cell-style="{backgroundColor: '#f5f7fa'}">
<el-table v-loading="loading" :data="tasks" style="width: 100%" :key="activeTab"
:header-cell-style="{backgroundColor: '#f5f7fa'}">
<el-table-column prop="processInstanceName" label="流程名称" min-width="180" show-overflow-tooltip>
<template slot-scope="scope">
<span class="task-title">{{scope.row.variable?.instanceName}}</span>
</template>
</el-table-column>
<el-table-column prop="taskName" label="任务节点" min-width="150" show-overflow-tooltip></el-table-column>
<el-table-column prop="taskName" label="任务节点" min-width="150"
show-overflow-tooltip></el-table-column>
<el-table-column prop="categoryName" label="流程分类" min-width="150" show-overflow-tooltip>
<template slot-scope="{row}">{{categoryOptions.find(item => item.id === row.category)?.name}}</template>
<template slot-scope="{row}">{{categoryOptions.find(item => item.id === row.category)?.name}}
</template>
</el-table-column>
<el-table-column prop="initiatorName" label="申请人" min-width="120">
<template slot-scope="{row}">{{row.variable.initiatorName}}</template>
@@ -324,11 +329,11 @@ layout("/layouts/v4/baseLayout.html"){
<!-- 分页 -->
<div class="pagination-container" v-if="tasks.length > 0">
<el-pagination
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-size="pageSize"
layout="prev, pager, next, jumper"
:total="total"
@current-change="handleCurrentChange"
:current-page="pageForm.pageNumber"
:page-size="pageForm.pageSize"
layout="prev, pager, next, jumper"
:total="pageForm.totalCount"
></el-pagination>
</div>
</el-card>
@@ -345,12 +350,16 @@ layout("/layouts/v4/baseLayout.html"){
doneCount: 0,
startedCount: 0,
// 搜索表单
searchForm: {
// 查询表单
pageForm: {
pageNumber: 1,
pageSize: 10,
todoCount: 0,
keyword: "",
category: ""
},
// 流程类型选项
categoryOptions: [],
@@ -358,11 +367,6 @@ layout("/layouts/v4/baseLayout.html"){
tasks: [],
loading: false,
// 分页
currentPage: 1,
pageSize: 10,
total: 0,
// 标签页
activeTab: "todo",
@@ -371,13 +375,13 @@ layout("/layouts/v4/baseLayout.html"){
dialogVisible: false,
processStatusMap: {
10: { text: "进行中", class: "doing" },
20: { text: "已完成", class: "finished" },
30: { text: "已撤回", class: "withdraw" },
40: { text: "强行终止", class: "interrupt" },
45: { text: "已拒绝", class: "reject" },
50: { text: "挂起", class: "pending" },
99: { text: "已废弃", class: "abandon" }
10: {text: "进行中", class: "doing"},
20: {text: "已完成", class: "finished"},
30: {text: "已撤回", class: "withdraw"},
40: {text: "强行终止", class: "interrupt"},
45: {text: "已拒绝", class: "reject"},
50: {text: "挂起", class: "pending"},
99: {text: "已废弃", class: "abandon"}
},
// 任务状态枚举
@@ -392,20 +396,8 @@ layout("/layouts/v4/baseLayout.html"){
}
},
computed: {
totalPages() {
return Math.ceil(this.total / this.pageSize)
}
},
created() {
this.initData()
// 监听
window.GlobalBroadcastChannel.addEventListener("message", (event) => {
if (event.data.type === "task-complete") {
this.initData()
}
})
},
methods: {
@@ -419,7 +411,7 @@ layout("/layouts/v4/baseLayout.html"){
try {
const res = await $.post("/flow/todoCenter/statistics")
if (res.code === 0) {
const { todoCount, doneCount, startedCount } = res.data
const {todoCount, doneCount, startedCount} = res.data
this.todoCount = todoCount
this.doneCount = doneCount
this.startedCount = startedCount
@@ -443,18 +435,10 @@ layout("/layouts/v4/baseLayout.html"){
async getTasks() {
this.loading = true
try {
const params = {
page: this.currentPage,
pageSize: this.pageSize,
type: this.activeTab,
keyword: this.searchForm.keyword,
category: this.searchForm.category
}
const res = await $.post("/flow/todoCenter/" + this.activeTab, params)
const res = await $.post("/flow/todoCenter/" + this.activeTab, this.pageForm)
if (res.code === 0) {
this.tasks = res.data.list
this.total = res.data.totalCount
this.pageForm.totalCount = res.data.totalCount
this.dialogVisible = false
}
} catch (error) {
@@ -468,46 +452,39 @@ layout("/layouts/v4/baseLayout.html"){
// 处理标签页点击
handleTabClick(tab) {
this.activeTab = tab.name
this.currentPage = 1
this.pageForm.pageNumber = 1
this.getTasks()
},
// 搜索
search() {
this.currentPage = 1
this.pageForm.pageNumber = 1
this.getTasks()
this.getStatistics()
},
// 重置搜索
reset() {
this.searchForm = {
keyword: "",
category: ""
}
this.pageForm.searchKeyword = ""
this.pageForm.category = ""
this.search()
},
// 处理页码变化
handleCurrentChange(val) {
this.currentPage = val
this.pageForm.pageNumber = val
this.getTasks()
},
// 查看任务详情
viewTaskDetail(task) {
// this.currentTask = task
// this.dialogVisible = true
},
// 处理任务
async openView(task) {
const { taskId, taskState, instanceId, businessNo } = task
if (taskState === this.taskStateEnum.DOING) {
window.open("/flow/common/approval/form?instanceId=" + instanceId + "&taskId=" + taskId + "&businessId=" + businessNo)
} else {
window.open("/flow/common/approval/form?instanceId=" + instanceId + "&businessId=" + businessNo)
}
const {taskId, taskState, instanceId, businessNo} = task
// if (taskState === this.taskStateEnum.DOING) {
// window.open("/flow/common/approval/form?instanceId=" + instanceId + "&taskId=" + taskId + "&businessId=" + businessNo)
// } else {
// window.open("/flow/common/approval/form?instanceId=" + instanceId + "&businessId=" + businessNo)
// }
this.$message.error("功能开发中...")
},
// 获取空状态文本