|
|
@ -2,9 +2,10 @@ |
|
|
|
<div :class="prefixCls"> |
|
|
|
<div :class="prefixCls"> |
|
|
|
<ALayoutContent class="m-10"> |
|
|
|
<ALayoutContent class="m-10"> |
|
|
|
<h4 class="text-center text-lg pb-2">{{ state.formTitle }}</h4> |
|
|
|
<h4 class="text-center text-lg pb-2">{{ state.formTitle }}</h4> |
|
|
|
<ATable v-model:activeKey="state.taskSelectedTab" |
|
|
|
<ATables v-model:activeKey="state.taskSelectedTab" |
|
|
|
class="bg-white" |
|
|
|
class="bg-white" |
|
|
|
:tab-bar-style="{ 'padding-left': '13px' }" |
|
|
|
:tab-bar-style="{ 'padding-left': '13px' }" |
|
|
|
|
|
|
|
@tabClick="handleTabsClick" |
|
|
|
> |
|
|
|
> |
|
|
|
<ATabPane key="formInfo"> |
|
|
|
<ATabPane key="formInfo"> |
|
|
|
<template #tab> |
|
|
|
<template #tab> |
|
|
@ -12,9 +13,9 @@ |
|
|
|
<Icon icon="fa6-solid:file-lines"/>表单信息 |
|
|
|
<Icon icon="fa6-solid:file-lines"/>表单信息 |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<!-- 动态表单:内置使用枇杷表单设计器 --> |
|
|
|
<!-- 动态表单:内置使用枇杷表单设计器(待更新为海豚表单设计器) --> |
|
|
|
<workflow-preview-form v-if="state.formType !== '2'" |
|
|
|
<workflow-preview-form v-if="state.formType !== '2'" |
|
|
|
ref="form" |
|
|
|
ref="formPreview" |
|
|
|
:taskFormData="state.taskFormData" |
|
|
|
:taskFormData="state.taskFormData" |
|
|
|
/> |
|
|
|
/> |
|
|
|
<!-- 外置表单:内置使用用户自定义的vue页面,手动填写页面路径即可 --> |
|
|
|
<!-- 外置表单:内置使用用户自定义的vue页面,手动填写页面路径即可 --> |
|
|
@ -25,14 +26,31 @@ |
|
|
|
:businessId="state.businessId" |
|
|
|
:businessId="state.businessId" |
|
|
|
/> |
|
|
|
/> |
|
|
|
</ATabPane> |
|
|
|
</ATabPane> |
|
|
|
|
|
|
|
<ATabPane key="processInfo"> |
|
|
|
|
|
|
|
<template #tab> |
|
|
|
|
|
|
|
<span> |
|
|
|
|
|
|
|
<Icon icon="fa6-solid:money-bill-wheat"/>流程信息 |
|
|
|
|
|
|
|
</span> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
<WorkflowTimeLine/> |
|
|
|
|
|
|
|
</ATabPane> |
|
|
|
<ATabPane key="processChart"> |
|
|
|
<ATabPane key="processChart"> |
|
|
|
<template #tab> |
|
|
|
<template #tab> |
|
|
|
<span> |
|
|
|
<span> |
|
|
|
<Icon icon="fa-solid:image"/>流程图 |
|
|
|
<Icon icon="fa-solid:image"/>流程图 |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
<WorkflowChartModel ref="workflowChart"/> |
|
|
|
|
|
|
|
</ATabPane> |
|
|
|
|
|
|
|
<ATabPane key="flowRecord"> |
|
|
|
|
|
|
|
<template #tab> |
|
|
|
|
|
|
|
<span> |
|
|
|
|
|
|
|
<Icon icon="fa6-solid:bars-progress"/>流转记录 |
|
|
|
|
|
|
|
</span> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
<WorkflowStep/> |
|
|
|
</ATabPane> |
|
|
|
</ATabPane> |
|
|
|
</ATable> |
|
|
|
</ATables> |
|
|
|
<a-card v-if="!state.processInsId || state.taskId || state.status === 'reStart'" style="margin-top:10px;margin-bottom:66px;"> |
|
|
|
<a-card v-if="!state.processInsId || state.taskId || state.status === 'reStart'" style="margin-top:10px;margin-bottom:66px;"> |
|
|
|
<AForm |
|
|
|
<AForm |
|
|
|
ref="auditForm" |
|
|
|
ref="auditForm" |
|
|
@ -114,6 +132,9 @@ |
|
|
|
import { useModal } from '/@/components/Modal'; |
|
|
|
import { useModal } from '/@/components/Modal'; |
|
|
|
import type { KiccUser } from '/@/api/common/base/entity'; |
|
|
|
import type { KiccUser } from '/@/api/common/base/entity'; |
|
|
|
import WorkflowPreviewForm from './WorkflowPreviewForm.vue'; |
|
|
|
import WorkflowPreviewForm from './WorkflowPreviewForm.vue'; |
|
|
|
|
|
|
|
import WorkflowChartModel from './WorkflowChartModel.vue'; |
|
|
|
|
|
|
|
import WorkflowTimeLine from './WorkflowTimeLine.vue'; |
|
|
|
|
|
|
|
import WorkflowStep from './workflowStep/index.vue'; |
|
|
|
import { getProcessStartEventFormData, getTaskFormData } from '/@/api/platform/workflow/controller/form'; |
|
|
|
import { getProcessStartEventFormData, getTaskFormData } from '/@/api/platform/workflow/controller/form'; |
|
|
|
import { findByDefIdAndTaskId } from '/@/api/platform/workflow/extension/controller/activityExtensionData'; |
|
|
|
import { findByDefIdAndTaskId } from '/@/api/platform/workflow/extension/controller/activityExtensionData'; |
|
|
|
import { useDesign } from '/@/hooks/web/useDesign'; |
|
|
|
import { useDesign } from '/@/hooks/web/useDesign'; |
|
|
@ -175,7 +196,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
/** 通用变量统一声明区域 */ |
|
|
|
/** 通用变量统一声明区域 */ |
|
|
|
const ALayoutContent = LayoutContent; |
|
|
|
const ALayoutContent = LayoutContent; |
|
|
|
const ATable = Tabs; |
|
|
|
const ATables = Tabs; |
|
|
|
const ATabPane = Tabs.TabPane; |
|
|
|
const ATabPane = Tabs.TabPane; |
|
|
|
const AForm = Form; |
|
|
|
const AForm = Form; |
|
|
|
const AFormItem = Form.Item; |
|
|
|
const AFormItem = Form.Item; |
|
|
@ -220,21 +241,13 @@ |
|
|
|
const { params, query } = unref(currentRoute); |
|
|
|
const { params, query } = unref(currentRoute); |
|
|
|
const { notification, createMessage, createConfirm } = useMessage(); |
|
|
|
const { notification, createMessage, createConfirm } = useMessage(); |
|
|
|
const { close } = useTabs(); |
|
|
|
const { close } = useTabs(); |
|
|
|
const form = ref(); |
|
|
|
const formPreview = ref(); |
|
|
|
|
|
|
|
const workflowChart = ref(); |
|
|
|
const [registerUser , { openModal: openUser }] = useModal(); |
|
|
|
const [registerUser , { openModal: openUser }] = useModal(); |
|
|
|
const [registerRollBackTask , { openModal: openRollBackTask }] = useModal(); |
|
|
|
const [registerRollBackTask , { openModal: openRollBackTask }] = useModal(); |
|
|
|
onActivated(() => { |
|
|
|
onActivated(() => { |
|
|
|
handleInit(); |
|
|
|
handleInit(); |
|
|
|
nextTick(async () => { |
|
|
|
nextTick(async () => { |
|
|
|
// 获取流程图数据 |
|
|
|
|
|
|
|
if (state.processInsId) { |
|
|
|
|
|
|
|
const data = await getFlowChart(state.processInsId); |
|
|
|
|
|
|
|
//this.$refs.flowableChart.setHighlightImportDiagram(response) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
const data = getProcessDefFlowChart(state.processDefId); |
|
|
|
|
|
|
|
//this.$refs.flowableChart.setHighlightImportDiagram({ bpmnXml: data }) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 初始化外置表单 |
|
|
|
// 初始化外置表单 |
|
|
|
if (state.formType === '2') { |
|
|
|
if (state.formType === '2') { |
|
|
|
if (state.formKey === '/404') { |
|
|
|
if (state.formKey === '/404') { |
|
|
@ -246,9 +259,9 @@ |
|
|
|
// 初始化动态表单 |
|
|
|
// 初始化动态表单 |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
if (state.formKey === '/404') { |
|
|
|
if (state.formKey === '/404') { |
|
|
|
form.value.init(''); |
|
|
|
formPreview.value.init(''); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
form.value.init(state.formKey); |
|
|
|
formPreview.value.init(state.formKey); |
|
|
|
} |
|
|
|
} |
|
|
|
// 获取启动事件表单数据 |
|
|
|
// 获取启动事件表单数据 |
|
|
|
if (state.status === 'start' || state.status === 'reStart') { |
|
|
|
if (state.status === 'start' || state.status === 'reStart') { |
|
|
@ -258,7 +271,6 @@ |
|
|
|
state.taskFormData = await getTaskFormData(state.taskId); |
|
|
|
state.taskFormData = await getTaskFormData(state.taskId); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 设置启动按钮配置 |
|
|
|
// 设置启动按钮配置 |
|
|
|
if (state.status === 'start' || state.status === 'reStart') { |
|
|
|
if (state.status === 'start' || state.status === 'reStart') { |
|
|
|
state.buttons = [{ code: '_workflow_activity_start', name: '启动', isHide: '0' }]; |
|
|
|
state.buttons = [{ code: '_workflow_activity_start', name: '启动', isHide: '0' }]; |
|
|
@ -323,7 +335,7 @@ |
|
|
|
function start(vars: Recordable) { |
|
|
|
function start(vars: Recordable) { |
|
|
|
// 外置表单 |
|
|
|
// 外置表单 |
|
|
|
if (state.formType === '2') { |
|
|
|
if (state.formType === '2') { |
|
|
|
form.value.startProcessDefinition(async (businessTable: string, businessId: string) => { |
|
|
|
formPreview.value.startProcessDefinition(async (businessTable: string, businessId: string) => { |
|
|
|
const processInsId = await startProcessDefinition({ |
|
|
|
const processInsId = await startProcessDefinition({ |
|
|
|
processDefKey: this.processDefKey, |
|
|
|
processDefKey: this.processDefKey, |
|
|
|
businessTable: businessTable, |
|
|
|
businessTable: businessTable, |
|
|
@ -336,7 +348,7 @@ |
|
|
|
}); |
|
|
|
}); |
|
|
|
// 动态表单 |
|
|
|
// 动态表单 |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
form.value.startFormProcessDefinition({ processDefId: this.processDefId, ...vars }, (processInsId: string) => { |
|
|
|
formPreview.value.startFormProcessDefinition({ processDefId: this.processDefId, ...vars }, (processInsId: string) => { |
|
|
|
close(); |
|
|
|
close(); |
|
|
|
push({ path: '/workflow/task/index' }); |
|
|
|
push({ path: '/workflow/task/index' }); |
|
|
|
cc({ processInsId }); |
|
|
|
cc({ processInsId }); |
|
|
@ -421,7 +433,7 @@ |
|
|
|
function commit(vars?: Recordable) { |
|
|
|
function commit(vars?: Recordable) { |
|
|
|
// 外置表单审批 |
|
|
|
// 外置表单审批 |
|
|
|
if (state.formType === '2') { |
|
|
|
if (state.formType === '2') { |
|
|
|
form.value.auditTask(async () => { |
|
|
|
formPreview.value.auditTask(async () => { |
|
|
|
await auditTask({ |
|
|
|
await auditTask({ |
|
|
|
taskId: this.taskId, |
|
|
|
taskId: this.taskId, |
|
|
|
taskDefKey: this.taskDefKey, |
|
|
|
taskDefKey: this.taskDefKey, |
|
|
@ -437,7 +449,7 @@ |
|
|
|
}); |
|
|
|
}); |
|
|
|
// 动态表单审批 |
|
|
|
// 动态表单审批 |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
form.value.auditFormTask({ |
|
|
|
formPreview.value.auditFormTask({ |
|
|
|
taskId: this.taskId, |
|
|
|
taskId: this.taskId, |
|
|
|
processInsId: this.processInsId, |
|
|
|
processInsId: this.processInsId, |
|
|
|
activityCommentInfo: this.auditForm, |
|
|
|
activityCommentInfo: this.auditForm, |
|
|
@ -547,6 +559,16 @@ |
|
|
|
}; |
|
|
|
}; |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function handleTabsClick(activeKey: string, event: MouseEvent) { |
|
|
|
|
|
|
|
// fixme: tabs组件首次加载不能初始化未激活的tab中的组件 |
|
|
|
|
|
|
|
if (activeKey === 'processChart' && !workflowChart.value) { |
|
|
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
|
|
// 获取流程图数据 |
|
|
|
|
|
|
|
workflowChart.value.init(state.processInsId, state.processDefId); |
|
|
|
|
|
|
|
}, 100); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
</script> |
|
|
|
</script> |
|
|
|
<style lang="less" scoped> |
|
|
|
<style lang="less" scoped> |
|
|
|
@prefix-cls: ~'@{namespace}-task-form'; |
|
|
|
@prefix-cls: ~'@{namespace}-task-form'; |
|
|
|