提交 77f061e6 authored 作者: whydesc's avatar whydesc

--流程发起统计

上级 9ffbfa63
...@@ -195,6 +195,9 @@ ...@@ -195,6 +195,9 @@
const taskDataObj = ref(); const taskDataObj = ref();
const iniData = async (data) => { const iniData = async (data) => {
console.log('-----why data:', data);
taskDataObj.value = data; taskDataObj.value = data;
taskName.value = data.taskName as string; taskName.value = data.taskName as string;
startUser.value = data.startUserName as string; startUser.value = data.startUserName as string;
......
...@@ -21,23 +21,25 @@ export const columns: BasicColumn[] = [ ...@@ -21,23 +21,25 @@ export const columns: BasicColumn[] = [
dataIndex: 'taskName' dataIndex: 'taskName'
}, },
{
title: '节点类型',
align:"center",
dataIndex: 'taskType'
},
{ {
title: '操作时间', title: '操作时间',
align:"center", align:"center",
dataIndex: 'optionTime' dataIndex: 'optionTime'
}, },
/**
{
title: '节点类型',
align:"center",
dataIndex: 'taskType'
},
{ {
title: '操作人', title: '操作人',
align:"center", align:"center",
dataIndex: 'optionId' dataIndex: 'optionId'
}, },
/**
* { * {
title: '操作类型', title: '操作类型',
align:"center", align:"center",
......
...@@ -27,22 +27,33 @@ ...@@ -27,22 +27,33 @@
<!-- 高级查询 --> <!-- 高级查询 -->
<super-query :config="superQueryConfig" @search="handleSuperQuery" /> <super-query :config="superQueryConfig" @search="handleSuperQuery" />
</template> </template>
<!--操作栏 <!--操作栏 -->
<template #action="{ record }"> <template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/> <TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
</template> </template>
-->
<!--字段回显插槽--> <!--字段回显插槽-->
<template v-slot:bodyCell="{ column, record, index, text }"> <template v-slot:bodyCell="{ column, record, index, text }">
</template> </template>
</BasicTable> </BasicTable>
<!-- 表单区域 --> <!-- 表单区域 -->
<MyTaskFlowHisModal @register="registerModal" @success="handleSuccess"></MyTaskFlowHisModal> <MyTaskFlowHisModal @register="registerModal" @success="handleSuccess"></MyTaskFlowHisModal>
<!-- 流程详情抽屉 -->
<div v-if="isShowDetailDrawer">
<a-drawer destroyOnClose v-model:open="isShowDetailDrawer" class="flat-drawer" title="流程详情" placement="right" width="90%">
<template #extra>
<a-button type="text" @click="handleDetailDrawerClose">关闭</a-button>
</template>
<Detail ref="refDetail" />
</a-drawer>
</div>
</div> </div>
</template> </template>
<script lang="ts" name="my-myTaskFlowHis" setup> <script lang="ts" name="my-myTaskFlowHis" setup>
import {ref, reactive, computed, unref} from 'vue'; import {ref,nextTick, reactive, computed, toRaw,unref} from 'vue';
import {BasicTable, useTable, TableAction} from '/@/components/Table'; import {BasicTable, useTable, TableAction} from '/@/components/Table';
import {useModal} from '/@/components/Modal'; import {useModal} from '/@/components/Modal';
import { useListPage } from '/@/hooks/system/useListPage' import { useListPage } from '/@/hooks/system/useListPage'
...@@ -53,6 +64,11 @@ ...@@ -53,6 +64,11 @@
import { useUserStore } from '/@/store/modules/user'; import { useUserStore } from '/@/store/modules/user';
import { useMessage } from '/@/hooks/web/useMessage'; import { useMessage } from '/@/hooks/web/useMessage';
import { getDateByPicker } from '/@/utils'; import { getDateByPicker } from '/@/utils';
import { todoList, getMyTaskFlow } from '/@/components/Process/api/todo';
// 引入详情组件
import Detail from '../flowable/task/myProcess/components/Detail.vue';
const taskCache = new Map<string, any>();
//日期个性化选择 //日期个性化选择
const fieldPickers = reactive({ const fieldPickers = reactive({
}); });
...@@ -62,6 +78,7 @@ ...@@ -62,6 +78,7 @@
const { createMessage } = useMessage(); const { createMessage } = useMessage();
//注册model //注册model
const [registerModal, {openModal}] = useModal(); const [registerModal, {openModal}] = useModal();
//注册table数据 //注册table数据
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({ const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
tableProps:{ tableProps:{
...@@ -110,6 +127,10 @@ ...@@ -110,6 +127,10 @@
// 高级查询配置 // 高级查询配置
const superQueryConfig = reactive(superQuerySchema); const superQueryConfig = reactive(superQuerySchema);
// 流程详情抽屉相关
const refDetail = ref();
const isShowDetailDrawer = ref(false);
/** /**
* 高级查询事件 * 高级查询事件
*/ */
...@@ -171,17 +192,24 @@ ...@@ -171,17 +192,24 @@
*/ */
function getTableAction(record){ function getTableAction(record){
return [ return [
{
label: '流转记录',
onClick: handleProgressDetail.bind(null, record),
},
/**
{ {
label: '编辑', label: '编辑',
onClick: handleEdit.bind(null, record), onClick: handleEdit.bind(null, record),
auth: 'my:my_task_flow_his:edit' auth: 'my:my_task_flow_his:edit'
} }*/
] ]
} }
/** /**
* 下拉操作栏 * 下拉操作栏
*/ */
function getDropDownAction(record){ function getDropDownAction(record){
return [];
/**
return [ return [
{ {
label: '详情', label: '详情',
...@@ -195,9 +223,62 @@ ...@@ -195,9 +223,62 @@
}, },
auth: 'my:my_task_flow_his:delete' auth: 'my:my_task_flow_his:delete'
} }
]
]*/
} }
function pickStartResult(res: any) {
const base = res?.data ?? res?.result ?? res;
return base || {};
}
/**
* 流转记录
*/
async function handleProgressDetail(record: Recordable) {
const dataId = record.targetId;
const deployId = record.deployId;
//alert(dataId);
if (!dataId || !deployId) {
message.error('未找到业务数据标识');
return;
}
try {
const myTaskFlow = await getMyTaskFlow({ deploymentId: record.deployId, dataId: record.targetId });
const taskData = pickStartResult(myTaskFlow);
if (!taskData || !taskData.taskId) {
message.error('未获取到待办任务信息');
return;
}
if (taskData.nodeisApprove == null) {
taskData.nodeisApprove = true;
}
taskCache.set(String(dataId), taskData);
// alert(taskData);
isShowDetailDrawer.value = true;
await nextTick();
if (refDetail.value) {
refDetail.value.iniData({
...record,
...taskData,
procInsId: taskData.procInsId,
});
} else {
isShowDetailDrawer.value = false;
}
} catch (e) {
console.error('获取流程任务信息失败:', e);
message.error('获取任务信息失败,请重试');
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论