yxk-20260424-新增通用查询流程组件v2,传入businessid查询所有相关流程

This commit is contained in:
ye1023
2026-04-24 15:49:19 +08:00
parent 1307f4e4f9
commit b312b33d27
3 changed files with 273 additions and 7 deletions
@@ -19,28 +19,30 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from 'vue'; import { nextTick, ref } from 'vue';
import { BasicTable, TableAction, useTable } from '/@/components/Table'; import { BasicColumn, BasicTable, TableAction, useTable } from '/@/components/Table';
import JModal from '/@/components/Modal/src/JModal/JModal.vue'; import JModal from '/@/components/Modal/src/JModal/JModal.vue';
import { useModal } from '/@/components/Modal'; import { useModal } from '/@/components/Modal';
import { columns } from '/@/views/taskProcess/TaskTask.data'; import { columns } from './QueryProcessList.data';
import { queryByBusinessId } from '/@/api/common/api'; import { queryByBusinessId } from '/@/api/common/api';
import { useMessage } from '/@/hooks/web/useMessage'; import { useMessage } from '/@/hooks/web/useMessage';
interface OpenParams { interface OpenParams {
businessId?: string; businessId?: string;
title?: string; title?: string;
columns?: BasicColumn[];
} }
const title = ref('流程列表'); const title = ref('流程列表');
const visible = ref(false); const visible = ref(false);
const currentBusinessId = ref(''); const currentBusinessId = ref('');
const defaultColumns = columns;
const { createMessage } = useMessage(); const { createMessage } = useMessage();
const [registerBpmModal, { openModal: bpmPicModal }] = useModal(); const [registerBpmModal, { openModal: bpmPicModal }] = useModal();
const [registerTable, { setTableData, setLoading, clearSelectedRowKeys }] = useTable({ const [registerTable, { setColumns, setTableData, setLoading, clearSelectedRowKeys }] = useTable({
rowKey: 'id', rowKey: 'id',
columns, columns: columns,
useSearchForm: false, useSearchForm: false,
canResize: false, canResize: false,
pagination: false, pagination: false,
@@ -80,16 +82,19 @@
} }
} }
function open(params: OpenParams = {}) { async function open(params: OpenParams = {}) {
currentBusinessId.value = params.businessId || ''; currentBusinessId.value = params.businessId || '';
title.value = params.title || '流程列表'; title.value = params.title || '流程列表';
visible.value = true; visible.value = true;
loadData(); await nextTick();
setColumns(params.columns?.length ? params.columns : defaultColumns);
await loadData();
} }
function handleCancel() { function handleCancel() {
visible.value = false; visible.value = false;
currentBusinessId.value = ''; currentBusinessId.value = '';
setColumns(defaultColumns);
setTableData([]); setTableData([]);
clearSelectedRowKeys(); clearSelectedRowKeys();
} }
@@ -0,0 +1,257 @@
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
// {
// title: '流程编码',
// align: "center",
// dataIndex: 'flowCode'
// },
{
title: '流程名称',
align: "center",
dataIndex: 'flowName'
},
{
title: '流程实例ID',
align: "center",
dataIndex: 'processInstId'
},
{
title: '流程类型',
align: "center",
dataIndex: 'processType'
},
{
title: '流程状态',
align: "center",
dataIndex: 'bpmStatus'
},
{
title: '关联台账事项ID',
align: "center",
dataIndex: 'businessId'
},
{
title: '关联台账根节点id',
align: "center",
dataIndex: 'parentBusinessId'
},
{
title: '关联台账表名',
align: "center",
dataIndex: 'businessTablename'
},
{
title: '外部来源 ID',
align: "center",
dataIndex: 'sourceId'
},
{
title: '任务标题',
align: "center",
dataIndex: 'title'
},
{
title: '任务内容',
align: "center",
dataIndex: 'content'
},
{
title: '紧急程度(一般/紧急/特急)',
align: "center",
dataIndex: 'urgencyLevel_dictText'
},
{
title: '自定义分组',
align: "center",
dataIndex: 'customGroup'
},
{
title: '所属任务清单 ID',
align: "center",
dataIndex: 'taskListId'
},
{
title: '所属任务清单名称',
align: "center",
dataIndex: 'taskListName'
},
{
title: '是否为里程碑节点',
align: "center",
dataIndex: 'milestone'
},
{
title: '任务完成方式',
align: "center",
dataIndex: 'finishMethod'
},
{
title: '被督办部门id',
align: "center",
dataIndex: 'deptId'
},
{
title: '被督办部门名称(冗余)',
align: "center",
dataIndex: 'deptName'
},
{
title: '部门负责人id',
align: "center",
dataIndex: 'deptLeaderId_dictText'
},
{
title: '部门负责人姓名(冗余)',
align: "center",
dataIndex: 'deptLeaderName'
},
{
title: '部门经办人id(负责人指派后填入)',
align: "center",
dataIndex: 'deptHandlerId_dictText'
},
{
title: '部门经办人姓名(冗余)',
align: "center",
dataIndex: 'deptHandlerName'
},
{
title: '关注人 ID 列表',
align: "center",
dataIndex: 'followerIds'
},
{
title: '关注人姓名列表,冗余',
align: "center",
dataIndex: 'followerNames'
},
{
title: '要求完成日期(业务层面的硬性要求)',
align: "center",
dataIndex: 'requireFinishDate',
customRender:({text}) =>{
text = !text ? "" : (text.length > 10 ? text.substr(0,10) : text);
return text;
},
},
{
title: '督办开始时间',
align: "center",
dataIndex: 'startTime'
},
{
title: '截止时间(精确到时分,与 require_finish_date 互补)',
align: "center",
sorter: true,
dataIndex: 'deadline'
},
{
title: '实际完成时间',
align: "center",
dataIndex: 'actualFinishTime'
},
{
title: '是否已逾期',
align: "center",
dataIndex: 'isOverdue'
},
{
title: '逾期时长',
align: "center",
dataIndex: 'overdueDuration'
},
{
title: '持续时长',
align: "center",
dataIndex: 'duration'
},
{
title: '子任务完成进度(0.00~100.00,参考飞书子任务进度)',
align: "center",
dataIndex: 'subTaskProgress'
},
{
title: '父任务 ID',
align: "center",
dataIndex: 'parentTaskId'
},
{
title: '前置任务 ID 列表,逗号分隔',
align: "center",
dataIndex: 'preTaskIds'
},
{
title: '后置任务 ID 列表,逗号分隔',
align: "center",
dataIndex: 'nextTaskIds'
},
{
title: '子任务数',
align: "center",
dataIndex: 'subTaskCount'
},
{
title: '流程序列号',
align: "center",
dataIndex: 'processCodenumber'
},
{
title: '表单组件路径',
align: "center",
dataIndex: 'formUrl'
},
{
title: '流程变量',
align: "center",
dataIndex: 'jsonDataString'
},
];
// 高级查询数据
// export const superQuerySchema = {
// flowCode: {title: '流程编码',order: 0,view: 'text', type: 'string',},
// flowName: {title: '流程名称',order: 1,view: 'text', type: 'string',},
// processInstId: {title: '流程实例ID',order: 2,view: 'text', type: 'string',},
// processType: {title: '流程类型',order: 3,view: 'text', type: 'string',},
// bpmStatus: {title: '流程状态',order: 4,view: 'text', type: 'string',},
// businessId: {title: '关联台账事项ID',order: 5,view: 'text', type: 'string',},
// parentBusinessId: {title: '关联台账根节点id',order: 6,view: 'text', type: 'string',},
// businessTablename: {title: '关联台账表名',order: 7,view: 'text', type: 'string',},
// sourceId: {title: '外部来源 ID',order: 8,view: 'text', type: 'string',},
// title: {title: '任务标题',order: 9,view: 'text', type: 'string',},
// content: {title: '任务内容',order: 10,view: 'text', type: 'string',},
// urgencyLevel: {title: '紧急程度(一般/紧急/特急)',order: 11,view: 'list', type: 'string',dictCode: 'urgency_level',},
// customGroup: {title: '自定义分组',order: 12,view: 'text', type: 'string',},
// taskListId: {title: '所属任务清单 ID',order: 13,view: 'text', type: 'string',},
// taskListName: {title: '所属任务清单名称',order: 14,view: 'text', type: 'string',},
// milestone: {title: '是否为里程碑节点',order: 15,view: 'text', type: 'string',},
// finishMethod: {title: '任务完成方式',order: 16,view: 'text', type: 'string',},
// deptId: {title: '被督办部门id',order: 17,view: 'text', type: 'string',},
// deptName: {title: '被督办部门名称(冗余)',order: 18,view: 'text', type: 'string',},
// deptLeaderId: {title: '部门负责人id',order: 19,view: 'sel_user', type: 'string',},
// deptLeaderName: {title: '部门负责人姓名(冗余)',order: 20,view: 'text', type: 'string',},
// deptHandlerId: {title: '部门经办人id(负责人指派后填入)',order: 21,view: 'sel_depart', type: 'string',},
// deptHandlerName: {title: '部门经办人姓名(冗余)',order: 22,view: 'text', type: 'string',},
// followerIds: {title: '关注人 ID 列表',order: 23,view: 'text', type: 'string',},
// followerNames: {title: '关注人姓名列表,冗余',order: 24,view: 'text', type: 'string',},
// requireFinishDate: {title: '要求完成日期(业务层面的硬性要求)',order: 25,view: 'date', type: 'string',},
// startTime: {title: '督办开始时间',order: 26,view: 'datetime', type: 'string',},
// deadline: {title: '截止时间(精确到时分,与 require_finish_date 互补)',order: 27,view: 'datetime', type: 'string',},
// actualFinishTime: {title: '实际完成时间',order: 28,view: 'datetime', type: 'string',},
// isOverdue: {title: '是否已逾期',order: 29,view: 'text', type: 'string',},
// overdueDuration: {title: '逾期时长',order: 30,view: 'number', type: 'number',},
// duration: {title: '持续时长',order: 31,view: 'number', type: 'number',},
// subTaskProgress: {title: '子任务完成进度(0.00~100.00,参考飞书子任务进度)',order: 32,view: 'number', type: 'number',},
// parentTaskId: {title: '父任务 ID',order: 33,view: 'text', type: 'string',},
// preTaskIds: {title: '前置任务 ID 列表,逗号分隔',order: 34,view: 'text', type: 'string',},
// nextTaskIds: {title: '后置任务 ID 列表,逗号分隔',order: 35,view: 'text', type: 'string',},
// subTaskCount: {title: '子任务数',order: 36,view: 'number', type: 'number',},
// processCodenumber: {title: '流程序列号',order: 37,view: 'text', type: 'string',},
// formUrl: {title: '表单组件路径',order: 38,view: 'text', type: 'string',},
// jsonData: {title: '流程变量',order: 39,view: 'text', type: 'string',},
// };
@@ -68,6 +68,7 @@
import BgPartymatterFeedbackList from './BgPartymatterFeedbackList.vue'; import BgPartymatterFeedbackList from './BgPartymatterFeedbackList.vue';
import BusinessProcessListModal from '/src/components/semri/process/BusinessProcessListModal.vue'; import BusinessProcessListModal from '/src/components/semri/process/BusinessProcessListModal.vue';
import FlowScheduleStartModal from '/src/components/semri/process/FlowScheduleStartModal.vue'; import FlowScheduleStartModal from '/src/components/semri/process/FlowScheduleStartModal.vue';
import { columns as taskTaskColumns } from '/@/views/taskProcess/TaskTask.data';
import { columns, superQuerySchema } from './BgPartymatter.data'; import { columns, superQuerySchema } from './BgPartymatter.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './BgPartymatter.api'; import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './BgPartymatter.api';
@@ -82,6 +83,7 @@
const flowScheduleModalRef = ref(); const flowScheduleModalRef = ref();
const businessProcessListModalRef = ref(); const businessProcessListModalRef = ref();
const queryParam = reactive<any>({}); const queryParam = reactive<any>({});
const processColumns = taskTaskColumns;
//注册table数据 //注册table数据
const { tableContext, onExportXls, onImportXls } = useListPage({ const { tableContext, onExportXls, onImportXls } = useListPage({
tableProps:{ tableProps:{
@@ -241,6 +243,8 @@
businessProcessListModalRef.value?.open({ businessProcessListModalRef.value?.open({
title: '流程列表', title: '流程列表',
businessId: record.id, businessId: record.id,
columns:''
// columns: processColumns,默认值
}); });
} }