|
@@ -6,21 +6,15 @@
|
|
|
<el-tab-pane label="流程模板" name="1"></el-tab-pane>
|
|
|
<!-- <el-tab-pane label="流程实例" name="2"></el-tab-pane>-->
|
|
|
<div class="flex-column">
|
|
|
- <el-form
|
|
|
- :model="state.queryParams"
|
|
|
- ref="ruleFormRef"
|
|
|
- inline
|
|
|
- @submit.native.prevent
|
|
|
- v-if="['1', '2'].includes(state.activeName)"
|
|
|
- >
|
|
|
+ <el-form :model="state.queryParams" ref="ruleFormRef" inline @submit.native.prevent v-if="['1', '2'].includes(state.activeName)">
|
|
|
<el-form-item label="关键字查询" prop="Keyword">
|
|
|
<el-input
|
|
|
v-model="state.queryParams.Keyword"
|
|
|
:placeholder="state.activeName === '1' ? '模板名称/模板编码' : '流程标题/流程ID'"
|
|
|
clearable
|
|
|
@keyup.enter="queryList"
|
|
|
- class="keyword-input"
|
|
|
- />
|
|
|
+ class="keyword-input"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="模板状态" prop="Status" v-show="state.activeName === '1'">
|
|
|
<el-select v-model="state.queryParams.Status" placeholder="请选择模板状态" v-show="state.activeName === '1'">
|
|
@@ -41,133 +35,77 @@
|
|
|
</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
- <div class="mb15" v-if="state.activeName === '1'">
|
|
|
- <el-button type="primary" @click="onAddTemp" v-auth="'system:workflow:template:add'">
|
|
|
- <SvgIcon name="ele-Plus" class="mr5" />新增
|
|
|
- </el-button>
|
|
|
- </div>
|
|
|
- <!-- 表格 -->
|
|
|
- <el-table :data="state.tableList" v-loading="state.loading" row-key="id">
|
|
|
- <!-- 配置 -->
|
|
|
- <template v-if="state.activeName === '0'">
|
|
|
- <el-table-column prop="name" label="业务模块" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column prop="code" label="编码" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column prop="remark" label="备注" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column prop="definition.name" label="模板名称" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column prop="definition.code" label="模板编码" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column prop="definition.version" label="模板版本" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column label="操作" width="160" fixed="right" align="center">
|
|
|
- <template #default="{ row }">
|
|
|
- <el-button link type="primary" @click="onConfig(row)" title="配置模板" v-auth="'system:workflow:template:config'">
|
|
|
- 配置模板</el-button
|
|
|
- >
|
|
|
- <el-button
|
|
|
- link
|
|
|
- type="danger"
|
|
|
- @click="configClear(row)"
|
|
|
- title="清除配置"
|
|
|
- v-if="row.definition"
|
|
|
- v-auth="'system:workflow:template:clear'"
|
|
|
- >
|
|
|
- 清除配置
|
|
|
- </el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </template>
|
|
|
- <!-- 模板 -->
|
|
|
- <template v-if="state.activeName === '1'">
|
|
|
- <el-table-column prop="name" label="模板名称" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column prop="code" label="模板编码" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column prop="version" label="版本号" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column prop="creationTime" label="更新时间" show-overflow-tooltip>
|
|
|
- <template #default="{ row }">
|
|
|
- <span>{{ formatDate(row.creationTime, 'YYYY-mm-dd HH:MM:SS') }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="statusText" label="状态" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column label="操作" width="150" fixed="right" align="center">
|
|
|
- <!-- 草稿0 启用1 禁用2 -->
|
|
|
- <template #default="{ row }">
|
|
|
- <el-button link type="primary" @click="onEditTemp(row)" title="修改" v-auth="'system:workflow:template:edit'"> 修改 </el-button>
|
|
|
- <el-button
|
|
|
- link
|
|
|
- type="success"
|
|
|
- v-if="row.status === 0"
|
|
|
- @click="onReleaseTemp(row)"
|
|
|
- title="发布"
|
|
|
- v-auth="'system:workflow:template:publish'"
|
|
|
- >
|
|
|
- 发布
|
|
|
- </el-button>
|
|
|
- <!-- 发布之后不能修改 -->
|
|
|
- <el-button
|
|
|
- link
|
|
|
- v-if="row.status === 0"
|
|
|
- type="danger"
|
|
|
- @click="onDeleteTemp(row)"
|
|
|
- title="删除"
|
|
|
- v-auth="'system:workflow:template:delete'"
|
|
|
- >
|
|
|
- 删除
|
|
|
- </el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
+ <!-- 流程业务 -->
|
|
|
+ <ProTable
|
|
|
+ ref="proTableProcessRef"
|
|
|
+ :columns="columnsProcess"
|
|
|
+ :data="state.tableData"
|
|
|
+ @updateTable="queryList"
|
|
|
+ :loading="state.loading"
|
|
|
+ v-if="state.activeName === '0'"
|
|
|
+ :pagination="false"
|
|
|
+ >
|
|
|
+ <!-- 表格 header 按钮 -->
|
|
|
+ <!-- 表格操作 -->
|
|
|
+ <template #operation="{ row }">
|
|
|
+ <el-button link type="primary" @click="onConfig(row)" title="配置模板" v-auth="'system:workflow:template:config'"> 配置模板</el-button>
|
|
|
+ <el-button
|
|
|
+ link
|
|
|
+ type="danger"
|
|
|
+ @click="configClear(row)"
|
|
|
+ title="清除配置"
|
|
|
+ v-if="row.definition"
|
|
|
+ v-auth="'system:workflow:template:clear'"
|
|
|
+ >
|
|
|
+ 清除配置
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
- <!-- 实例 -->
|
|
|
- <template v-else-if="state.activeName === '2'">
|
|
|
- <el-table-column prop="title" label="流程标题" show-overflow-tooltip width="300"></el-table-column>
|
|
|
- <el-table-column prop="statusText" label="流程状态" show-overflow-tooltip width="100"></el-table-column>
|
|
|
- <el-table-column prop="id" label="流程ID" show-overflow-tooltip width="300"></el-table-column>
|
|
|
- <el-table-column prop="moduleName" label="业务模块" show-overflow-tooltip width="170"></el-table-column>
|
|
|
- <el-table-column prop="moduleCode" label="流程模板" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column prop="assignTime" label="创建时间" show-overflow-tooltip width="170">
|
|
|
- <template #default="{ row }">
|
|
|
- <span>{{ formatDate(row.assignTime, 'YYYY-mm-dd HH:MM:SS') }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="completeTime" label="当前环节到达" show-overflow-tooltip width="170">
|
|
|
- <template #default="{ row }">
|
|
|
- <span>{{ formatDate(row.completeTime, 'YYYY-mm-dd HH:MM:SS') }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="actualHandleStepName" label="当前环节" show-overflow-tooltip width="170"></el-table-column>
|
|
|
- <el-table-column label="操作" width="140" fixed="right" align="center">
|
|
|
- <template #default="{ row }">
|
|
|
- <el-button
|
|
|
- link
|
|
|
- type="primary"
|
|
|
- @click="onLink(row)"
|
|
|
- title="跳转"
|
|
|
- v-if="![20, 30].includes(row.status)"
|
|
|
- v-auth="'system:workflow:jump'"
|
|
|
- >
|
|
|
- 跳转
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- link
|
|
|
- type="danger"
|
|
|
- @click="onStopProcess(row)"
|
|
|
- title="终止流程"
|
|
|
- v-if="![20, 30].includes(row.status)"
|
|
|
- v-auth="'system:workflow:stop'"
|
|
|
- >
|
|
|
- 终止流程
|
|
|
- </el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
+ </ProTable>
|
|
|
+ <!-- 流程模板 -->
|
|
|
+ <ProTable
|
|
|
+ ref="proTableTemplateRef"
|
|
|
+ :columns="columnsTemplate"
|
|
|
+ :data="state.tableData"
|
|
|
+ @updateTable="queryList"
|
|
|
+ :loading="state.loading"
|
|
|
+ :total="state.total"
|
|
|
+ v-model:page-index="state.queryParams.PageIndex"
|
|
|
+ v-model:page-size="state.queryParams.PageSize"
|
|
|
+ v-if="state.activeName === '1'"
|
|
|
+ >
|
|
|
+ <!-- 表格 header 按钮 -->
|
|
|
+ <template #tableHeader="scope">
|
|
|
+ <el-button type="primary" @click="onAddTemp" v-auth="'system:workflow:template:add'">
|
|
|
+ <SvgIcon name="ele-Plus" class="mr5" />新增
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
- <template #empty>
|
|
|
- <Empty />
|
|
|
+ <!-- 表格操作 -->
|
|
|
+ <template #operation="{ row }">
|
|
|
+ <!-- 草稿0 启用1 禁用2 -->
|
|
|
+ <el-button link type="primary" @click="onEditTemp(row)" title="修改" v-auth="'system:workflow:template:edit'"> 修改 </el-button>
|
|
|
+ <el-button
|
|
|
+ link
|
|
|
+ type="success"
|
|
|
+ v-if="row.status === 0"
|
|
|
+ @click="onReleaseTemp(row)"
|
|
|
+ title="发布"
|
|
|
+ v-auth="'system:workflow:template:publish'"
|
|
|
+ >
|
|
|
+ 发布
|
|
|
+ </el-button>
|
|
|
+ <!-- 发布之后不能修改 -->
|
|
|
+ <el-button
|
|
|
+ link
|
|
|
+ v-if="row.status === 0"
|
|
|
+ type="danger"
|
|
|
+ @click="onDeleteTemp(row)"
|
|
|
+ title="删除"
|
|
|
+ v-auth="'system:workflow:template:delete'"
|
|
|
+ >
|
|
|
+ 删除
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
- </el-table>
|
|
|
- <!-- 分页 -->
|
|
|
- <pagination
|
|
|
- :total="state.total"
|
|
|
- v-model:page="state.queryParams.PageIndex"
|
|
|
- v-model:limit="state.queryParams.PageSize"
|
|
|
- @pagination="queryList"
|
|
|
- v-if="state.activeName !== '0'"
|
|
|
- />
|
|
|
+ </ProTable>
|
|
|
</div>
|
|
|
</el-tabs>
|
|
|
</el-card>
|
|
@@ -179,11 +117,11 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
-<script lang="ts" setup name="systemWorkflow">
|
|
|
+<script lang="tsx" setup name="systemWorkflow">
|
|
|
import { defineAsyncComponent, onMounted, reactive, ref } from 'vue';
|
|
|
import { useRoute, useRouter } from 'vue-router';
|
|
|
import type { FormInstance } from 'element-plus';
|
|
|
-import { ElMessage, ElMessageBox } from 'element-plus';
|
|
|
+import { ElButton, ElMessage, ElMessageBox } from 'element-plus';
|
|
|
import { formatDate } from '@/utils/formatTime';
|
|
|
import { throttle } from '@/utils/tools';
|
|
|
import {
|
|
@@ -201,8 +139,28 @@ import {
|
|
|
const WorkflowJump = defineAsyncComponent(() => import('@/views/system/config/workflow/component/Workflow-jump.vue')); // 流程跳转
|
|
|
const WorkflowConfig = defineAsyncComponent(() => import('@/views/system/config/workflow/component/Workflow-config.vue')); // 流程配置
|
|
|
|
|
|
+const proTableProcessRef = ref<RefType>(); // 表格ref
|
|
|
+// 表格配置项
|
|
|
+const columnsProcess = ref<any[]>([
|
|
|
+ { prop: 'name', label: '业务模块' },
|
|
|
+ { prop: 'code', label: '编码' },
|
|
|
+ { prop: 'remark', label: '备注' },
|
|
|
+ { prop: 'definition.name', label: '模板名称' },
|
|
|
+ { prop: 'definition.code', label: '模板编码' },
|
|
|
+ { prop: 'definition.version', label: '模板版本' },
|
|
|
+ { prop: 'operation', label: '操作', fixed: 'right', width: 160, align: 'center' },
|
|
|
+]);
|
|
|
+const proTableTemplateRef = ref<RefType>(); // 表格ref
|
|
|
+const columnsTemplate = ref<any[]>([
|
|
|
+ { prop: 'name', label: '模板名称' },
|
|
|
+ { prop: 'code', label: '模板编码' },
|
|
|
+ { prop: 'version', label: '版本号' },
|
|
|
+ { prop: 'creationTime', label: '更新时间', render: (scope: any) => formatDate(scope.row.creationTime, 'YYYY-mm-dd HH:MM:SS') },
|
|
|
+ { prop: 'statusText', label: '状态' },
|
|
|
+ { prop: 'operation', label: '操作', fixed: 'right', width: 150, align: 'center' },
|
|
|
+]);
|
|
|
// 定义变量内容
|
|
|
-const state = reactive(<any>{
|
|
|
+const state = reactive({
|
|
|
activeName: '0', // 0:模板 1:实例 2:历史
|
|
|
queryParams: {
|
|
|
// 查询参数
|
|
@@ -212,7 +170,7 @@ const state = reactive(<any>{
|
|
|
Status: null,
|
|
|
ModuleCode: null, // 模块编码
|
|
|
},
|
|
|
- tableList: [], // 表格数据
|
|
|
+ tableData: [], // 表格数据
|
|
|
loading: false, // 加载状态
|
|
|
total: 0, // 总条数
|
|
|
multipleSelection: [], // 多选
|
|
@@ -241,7 +199,7 @@ const queryList = () => {
|
|
|
case '0':
|
|
|
wfmodules()
|
|
|
.then((response: any) => {
|
|
|
- state.tableList = response.result ?? [];
|
|
|
+ state.tableData = response.result ?? [];
|
|
|
state.loading = false;
|
|
|
})
|
|
|
.catch(() => {
|
|
@@ -255,7 +213,7 @@ const queryList = () => {
|
|
|
};
|
|
|
workflowList(req)
|
|
|
.then((response: any) => {
|
|
|
- state.tableList = response.result.items ?? [];
|
|
|
+ state.tableData = response.result.items ?? [];
|
|
|
state.total = response.result.total;
|
|
|
state.loading = false;
|
|
|
})
|
|
@@ -270,7 +228,7 @@ const queryList = () => {
|
|
|
};
|
|
|
workflowPaged(req)
|
|
|
.then((response: any) => {
|
|
|
- state.tableList = response.result?.items ?? [];
|
|
|
+ state.tableData = response.result?.items ?? [];
|
|
|
state.total = response.result?.total ?? 0;
|
|
|
state.loading = false;
|
|
|
})
|