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

Loading…
Cancel
Save