add 添加流程实例,流程定义分类查询
This commit is contained in:
parent
8c5abadddc
commit
89b5bf66dd
@ -1,8 +0,0 @@
|
||||
export interface processDefinitionForm {
|
||||
businessKey: string;
|
||||
processKey: string;
|
||||
}
|
||||
export interface processDefinitionQuery extends PageQuery {
|
||||
name: string;
|
||||
key: string;
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="p-2">
|
||||
<el-row :gutter="20">
|
||||
<!-- 部门树 -->
|
||||
<!-- 流程分类树 -->
|
||||
<el-col :lg="4" :xs="24" style="">
|
||||
<el-card shadow="hover">
|
||||
<el-input placeholder="请输入流程分类名" v-model="categoryName" prefix-icon="Search" clearable />
|
||||
@ -198,7 +198,6 @@ onMounted(() => {
|
||||
/** 节点单击事件 */
|
||||
const handleNodeClick = (data: ModelForm) => {
|
||||
queryParams.value.categoryCode = data.categoryCode;
|
||||
console.log(data.categoryCode)
|
||||
if(data.categoryCode === 'ALL'){
|
||||
queryParams.value.categoryCode =''
|
||||
}
|
||||
@ -225,6 +224,7 @@ const handleQuery = () => {
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value.resetFields();
|
||||
queryParams.value.categoryCode = '';
|
||||
queryParams.value.pageNum = 1;
|
||||
queryParams.value.pageSize = 10;
|
||||
handleQuery();
|
||||
|
@ -1,5 +1,25 @@
|
||||
<template>
|
||||
<div class="p-2">
|
||||
<el-row :gutter="20">
|
||||
<!-- 流程分类树 -->
|
||||
<el-col :lg="4" :xs="24" style="">
|
||||
<el-card shadow="hover">
|
||||
<el-input placeholder="请输入流程分类名" v-model="categoryName" prefix-icon="Search" clearable />
|
||||
<el-tree
|
||||
class="mt-2"
|
||||
ref="categoryTreeRef"
|
||||
node-key="id"
|
||||
:data="categoryOptions"
|
||||
:props="{ label: 'categoryName', children: 'children' }"
|
||||
:expand-on-click-node="false"
|
||||
:filter-node-method="filterNode"
|
||||
highlight-current
|
||||
default-expand-all
|
||||
@node-click="handleNodeClick"
|
||||
></el-tree>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :lg="20" :xs="24">
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<div class="mb-[10px]" v-show="showSearch">
|
||||
<el-card shadow="hover">
|
||||
@ -74,9 +94,16 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-card>
|
||||
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- 预览图片或xml -->
|
||||
<process-preview ref="previewRef" :url="url" :type="type" />
|
||||
|
||||
@ -101,15 +128,23 @@ import {
|
||||
convertToModel
|
||||
} from '@/api/workflow/processDefinition';
|
||||
import { startWorkFlow, completeTask } from '@/api/workflow/task';
|
||||
import { processDefinitionQuery, processDefinitionForm } from '@/api/workflow/processDefinition/types';
|
||||
import { ComponentInternalInstance } from 'vue';
|
||||
import ProcessPreview from './components/processPreview.vue';
|
||||
import { listCategory } from '@/api/workflow/category';
|
||||
import { CategoryVO } from '@/api/workflow/category/types';
|
||||
import { ElTree } from 'element-plus';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
|
||||
const previewRef = ref<InstanceType<typeof ProcessPreview>>();
|
||||
const queryFormRef = ref(ElForm);
|
||||
|
||||
type CategoryOption = {
|
||||
categoryCode: string;
|
||||
categoryName: string;
|
||||
children?: CategoryOption[];
|
||||
};
|
||||
|
||||
const loading = ref(true);
|
||||
const ids = ref<Array<string | number>>([]);
|
||||
const single = ref(true);
|
||||
@ -119,32 +154,61 @@ const total = ref(0);
|
||||
const processDefinitionList = ref<Record<string, any>>([]);
|
||||
const url = ref<Array<string>>([]);
|
||||
const type = ref<string>('');
|
||||
const variables = ref<string>('');
|
||||
const categoryOptions = ref<CategoryOption[]>([]);
|
||||
const categoryName = ref('');
|
||||
const categoryTreeRef = ref(ElTree);
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: '启动'
|
||||
});
|
||||
|
||||
const submitFormData: processDefinitionForm = {
|
||||
businessKey: '',
|
||||
processKey: ''
|
||||
};
|
||||
|
||||
const data = reactive<PageData<processDefinitionQuery, processDefinitionForm>>({
|
||||
form: { ...submitFormData },
|
||||
queryParams: {
|
||||
// 查询参数
|
||||
const queryParams = ref<Record<string, any>>({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: '',
|
||||
key: ''
|
||||
}
|
||||
name: undefined,
|
||||
key: undefined,
|
||||
categoryCode: undefined
|
||||
});
|
||||
const { queryParams, form } = toRefs(data);
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
getTreeselect();
|
||||
});
|
||||
|
||||
/** 节点单击事件 */
|
||||
const handleNodeClick = (data: CategoryVO) => {
|
||||
queryParams.value.categoryCode = data.categoryCode;
|
||||
if (data.categoryCode === 'ALL') {
|
||||
queryParams.value.categoryCode = '';
|
||||
}
|
||||
handleQuery();
|
||||
};
|
||||
/** 通过条件过滤节点 */
|
||||
const filterNode = (value: string, data: any) => {
|
||||
if (!value) return true;
|
||||
return data.categoryName.indexOf(value) !== -1;
|
||||
};
|
||||
/** 根据名称筛选部门树 */
|
||||
watchEffect(
|
||||
() => {
|
||||
categoryTreeRef.value.filter(categoryName.value);
|
||||
},
|
||||
{
|
||||
flush: 'post' // watchEffect会在DOM挂载或者更新之前就会触发,此属性控制在DOM元素更新后运行
|
||||
}
|
||||
);
|
||||
|
||||
/** 查询流程分类下拉树结构 */
|
||||
const getTreeselect = async () => {
|
||||
const res = await listCategory();
|
||||
categoryOptions.value = [];
|
||||
const data: CategoryOption = { categoryCode: 'ALL', categoryName: '顶级节点', children: [] };
|
||||
data.children = proxy?.handleTree<CategoryOption>(res.data, 'id', 'parentId');
|
||||
categoryOptions.value.push(data);
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
@ -153,6 +217,7 @@ const handleQuery = () => {
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value.resetFields();
|
||||
queryParams.value.categoryCode = '';
|
||||
queryParams.value.pageNum = 1;
|
||||
queryParams.value.pageSize = 10;
|
||||
handleQuery();
|
||||
|
@ -1,5 +1,25 @@
|
||||
<template>
|
||||
<div class="p-2">
|
||||
<el-row :gutter="20">
|
||||
<!-- 流程分类树 -->
|
||||
<el-col :lg="4" :xs="24" style="">
|
||||
<el-card shadow="hover">
|
||||
<el-input placeholder="请输入流程分类名" v-model="categoryName" prefix-icon="Search" clearable />
|
||||
<el-tree
|
||||
class="mt-2"
|
||||
ref="categoryTreeRef"
|
||||
node-key="id"
|
||||
:data="categoryOptions"
|
||||
:props="{ label: 'categoryName', children: 'children' }"
|
||||
:expand-on-click-node="false"
|
||||
:filter-node-method="filterNode"
|
||||
highlight-current
|
||||
default-expand-all
|
||||
@node-click="handleNodeClick"
|
||||
></el-tree>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :lg="20" :xs="24">
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<div class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
@ -40,7 +60,7 @@
|
||||
<el-table v-loading="loading" :data="processInstanceList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column fixed align="center" type="index" label="序号" width="50"></el-table-column>
|
||||
<el-table-column fixed align="center" prop="id" label="id"></el-table-column>
|
||||
<el-table-column fixed align="center" prop="id" label="id" v-if="false"></el-table-column>
|
||||
<el-table-column fixed align="center" prop="processDefinitionName" label="流程定义名称"></el-table-column>
|
||||
<el-table-column fixed align="center" prop="processDefinitionKey" label="流程定义KEY"></el-table-column>
|
||||
<el-table-column align="center" prop="processDefinitionVersion" label="版本号" width="90">
|
||||
@ -94,6 +114,8 @@
|
||||
@pagination="getProcessInstanceRunningList"
|
||||
/>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- 审批记录 -->
|
||||
<approvalRecord ref="approvalRecordRef" />
|
||||
</div>
|
||||
@ -109,9 +131,14 @@ import {
|
||||
} from '@/api/workflow/processInstance';
|
||||
import { ComponentInternalInstance } from 'vue';
|
||||
import ApprovalRecord from '@/components/Process/approvalRecord.vue';
|
||||
import { listCategory } from "@/api/workflow/category";
|
||||
import { ElTree } from 'element-plus';
|
||||
import { CategoryVO } from '@/api/workflow/category/types';
|
||||
//审批记录组件
|
||||
const approvalRecordRef = ref<InstanceType<typeof ApprovalRecord>>();
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const queryFormRef = ref(ElForm);
|
||||
|
||||
// 遮罩层
|
||||
const loading = ref(true);
|
||||
// 选中数组
|
||||
@ -126,7 +153,17 @@ const showSearch = ref(true);
|
||||
const total = ref(0);
|
||||
// 模型定义表格数据
|
||||
const processInstanceList = ref([]);
|
||||
const queryFormRef = ref(ElForm);
|
||||
|
||||
const categoryOptions = ref<CategoryOption[]>([]);
|
||||
const categoryName = ref('');
|
||||
const categoryTreeRef = ref(ElTree);
|
||||
|
||||
type CategoryOption = {
|
||||
categoryCode: string;
|
||||
categoryName: string;
|
||||
children?: CategoryOption[];
|
||||
}
|
||||
|
||||
const tab = ref('running');
|
||||
// 作废原因
|
||||
const deleteReason = ref('');
|
||||
@ -134,12 +171,46 @@ const deleteReason = ref('');
|
||||
const queryParams = ref<Record<string, any>>({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: undefined
|
||||
name: undefined,
|
||||
categoryCode: undefined
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
getProcessInstanceRunningList();
|
||||
getTreeselect();
|
||||
});
|
||||
|
||||
|
||||
/** 节点单击事件 */
|
||||
const handleNodeClick = (data: CategoryVO) => {
|
||||
queryParams.value.categoryCode = data.categoryCode;
|
||||
if(data.categoryCode === 'ALL'){
|
||||
queryParams.value.categoryCode =''
|
||||
}
|
||||
handleQuery()
|
||||
}
|
||||
/** 通过条件过滤节点 */
|
||||
const filterNode = (value: string, data: any) => {
|
||||
if (!value) return true
|
||||
return data.categoryName.indexOf(value) !== -1
|
||||
}
|
||||
/** 根据名称筛选部门树 */
|
||||
watchEffect(
|
||||
() => {categoryTreeRef.value.filter(categoryName.value);},
|
||||
{
|
||||
flush: 'post' // watchEffect会在DOM挂载或者更新之前就会触发,此属性控制在DOM元素更新后运行
|
||||
}
|
||||
);
|
||||
|
||||
/** 查询流程分类下拉树结构 */
|
||||
const getTreeselect = async () => {
|
||||
const res = await listCategory();
|
||||
categoryOptions.value = [];
|
||||
const data: CategoryOption = { categoryCode: 'ALL', categoryName: '顶级节点', children: [] };
|
||||
data.children = proxy?.handleTree<CategoryOption>(res.data, "id", "parentId");
|
||||
categoryOptions.value.push(data);
|
||||
}
|
||||
|
||||
//审批记录
|
||||
const handleApprovalRecord = (row: any) => {
|
||||
if (approvalRecordRef.value) {
|
||||
@ -158,6 +229,7 @@ const handleQuery = () => {
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value.resetFields();
|
||||
queryParams.value.categoryCode = '';
|
||||
queryParams.value.pageNum = 1;
|
||||
queryParams.value.pageSize = 10;
|
||||
handleQuery();
|
||||
|
Loading…
x
Reference in New Issue
Block a user