Browse Source

chore: compose

master
wangxiang 2 years ago
parent
commit
4178ed1826
No known key found for this signature in database
GPG Key ID: 1BA7946AB6B232E4
  1. 10
      src/enums/workflowEnum.ts
  2. 53
      src/views/workflow/task/TaskForm.vue

10
src/enums/workflowEnum.ts

@ -0,0 +1,10 @@
/**
* @program: kicc-ui
* @description:
* @author: wangxiang4
* @create: 2023/10/21
*/
export enum PageEnum {
TODO_TASK_PAGE = '/workflow/task/index',
}

53
src/views/workflow/task/TaskForm.vue

@ -153,6 +153,8 @@
@register="registerModal" @register="registerModal"
@ccEmit="handleCCEmit" @ccEmit="handleCCEmit"
@assignEmit="handleAssignEmit" @assignEmit="handleAssignEmit"
@transferTask="handleTransferTask"
@delegateTask="handleDelegateTask"
/> />
<RollBackTaskModal @register="registerRollBackTask" @success="handleRollBackTask"/> <RollBackTaskModal @register="registerRollBackTask" @success="handleRollBackTask"/>
</div> </div>
@ -191,6 +193,7 @@
import { listUser } from '/@/api/platform/system/controller/user'; import { listUser } from '/@/api/platform/system/controller/user';
import { ActivityCommentInfo } from '/@/api/platform/workflow/entity/activityCommentInfo'; import { ActivityCommentInfo } from '/@/api/platform/workflow/entity/activityCommentInfo';
import RollBackTaskModal from './popups/RollBackTaskModal.vue'; import RollBackTaskModal from './popups/RollBackTaskModal.vue';
import { PageEnum } from '/@/enums/workflowEnum';
/** 类型规范统一声明定义区域 */ /** 类型规范统一声明定义区域 */
interface WindowState { interface WindowState {
@ -240,7 +243,9 @@
// ID // ID
assignee: string; assignee: string;
}; };
//
rulesRef: Recordable; rulesRef: Recordable;
// prop
userPickerProps: { userPickerProps: {
title: string; title: string;
limit: number; limit: number;
@ -296,7 +301,7 @@
assignee: [{ required: true, whitespace: true, message: '处理用户不能为空', validateTrigger: 'blur' }] assignee: [{ required: true, whitespace: true, message: '处理用户不能为空', validateTrigger: 'blur' }]
}, },
userPickerProps: { userPickerProps: {
title: '任务表单用户选择器', title: '',
limit: 0, limit: 0,
} }
}); });
@ -368,7 +373,7 @@
state.auditForm.assignee = ''; state.auditForm.assignee = '';
state.auditForm.userIds = []; state.auditForm.userIds = [];
state.auditForm.message = ''; state.auditForm.message = '';
state.userPickerProps.title = '任务表单用户选择器'; state.userPickerProps.title = '';
state.userPickerProps.limit = 0; state.userPickerProps.limit = 0;
} }
@ -405,16 +410,16 @@
businessId: businessId, businessId: businessId,
...vars ...vars
}); });
await cc({ processInsId });
await close(); await close();
await push({path: '/workflow/task/index'}); await push({ path: PageEnum.TODO_TASK_PAGE });
cc({ processInsId });
}); });
// //
} else { } else {
formPreview.value.startFormProcessDefinition({ processDefId: state.processDefId, ...vars }, (processInsId: string) => { formPreview.value.startFormProcessDefinition({ processDefId: state.processDefId, ...vars }, async (processInsId: string) => {
close(); await cc({ processInsId });
push({ path: '/workflow/task/index' }); await close();
cc({ processInsId }); await push({ path: PageEnum.TODO_TASK_PAGE });
}); });
} }
} }
@ -472,12 +477,12 @@
/** 转办 */ /** 转办 */
function handleTransferUserPicker() { function handleTransferUserPicker() {
openModal(true,{ _tag: 'transfer' }); openModal(true,{ _tag: 'transferTask' });
} }
/** 委托 */ /** 委托 */
function handleDelegateUserPicker() { function handleDelegateUserPicker() {
openModal(true,{ _tag: 'delegate' }); openModal(true,{ _tag: 'delegateTask' });
} }
/** 终止 */ /** 终止 */
@ -488,9 +493,9 @@
content: '确定终止流程吗?', content: '确定终止流程吗?',
onOk: async () => { onOk: async () => {
await stopProcessInstance(state.processInsId, state.auditForm.message); await stopProcessInstance(state.processInsId, state.auditForm.message);
await cc({processInsId: state.processInsId});
await close(); await close();
await push({path: '/workflow/task/index'}); await push({ path: PageEnum.TODO_TASK_PAGE });
cc({processInsId: state.processInsId});
} }
}); });
} }
@ -536,9 +541,9 @@
assignee: state.auditForm.assignee, assignee: state.auditForm.assignee,
vars, vars,
}); });
await cc({ processInsId: state.processInsId });
await close(); await close();
await push({ path: '/workflow/task/index' }); await push({ path: PageEnum.TODO_TASK_PAGE });
cc({ processInsId: state.processInsId });
}); });
// //
} else { } else {
@ -549,10 +554,10 @@
activityCommentInfo: state.auditForm, activityCommentInfo: state.auditForm,
assignee: state.auditForm.assignee, assignee: state.auditForm.assignee,
vars vars
}, () => { }, async () => {
close(); await cc({ processInsId: state.processInsId });
push({ path: '/workflow/task/index' }); await close();
cc({ processInsId: state.processInsId }); await push({ path: PageEnum.TODO_TASK_PAGE });
}); });
} }
} }
@ -564,25 +569,25 @@
rollBackTaskDefKey: backTaskDefKey, rollBackTaskDefKey: backTaskDefKey,
comment: state.auditForm comment: state.auditForm
}); });
await cc({ processInsId: state.processInsId });
await close(); await close();
await push({ path: '/workflow/task/index' }); await push({ path: PageEnum.TODO_TASK_PAGE });
cc({ processInsId: state.processInsId });
} }
/** 处理转派任务 */ /** 处理转派任务 */
async function handleTransferTask(userList: KiccUser[]) { async function handleTransferTask(userList: KiccUser[]) {
await transferTask( state.taskId, userList[0].id); await transferTask( state.taskId, userList[0].id);
await cc({ processInsId: state.processInsId });
await close(); await close();
await push({ path: '/workflow/task/index' }); await push({ path: PageEnum.TODO_TASK_PAGE });
cc({ processInsId: state.processInsId });
} }
/** 处理任务委派 */ /** 处理任务委派 */
async function handleDelegateTask(userList: KiccUser[]) { async function handleDelegateTask(userList: KiccUser[]) {
await delegateTask(state.taskId, userList[0].id); await delegateTask(state.taskId, userList[0].id);
await cc({ processInsId: state.processInsId });
await close(); await close();
await push({ path: '/workflow/task/index' }); await push({ path: PageEnum.TODO_TASK_PAGE });
cc({ processInsId: state.processInsId });
} }
function submit(button: Partial<WorkflowButton>) { function submit(button: Partial<WorkflowButton>) {

Loading…
Cancel
Save