fix: [BPM 工作流] bug 修复
parent
e1b639640d
commit
65206b413c
|
@ -62,9 +62,15 @@ const [Modal, modalApi] = useVbenModal({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
// TODO xingyu 暴露 modalApi 给父组件是否合适? trigger-node-config.vue 会有多个 conditionDialog 实例
|
/**
|
||||||
// TODO @jason:回复 from xingyu:不用暴露啊,用 useVbenModal 就可以了
|
* 打开条件配置弹窗,不暴露 modalApi 给父组件
|
||||||
defineExpose({ modalApi });
|
*/
|
||||||
|
function openModal(conditionObj: any) {
|
||||||
|
modalApi.setData(conditionObj).open();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 暴露方法给父组件
|
||||||
|
defineExpose({ openModal });
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<Modal class="w-1/2">
|
<Modal class="w-1/2">
|
||||||
|
|
|
@ -200,8 +200,8 @@ function addFormSettingCondition(
|
||||||
formSetting: FormTriggerSetting,
|
formSetting: FormTriggerSetting,
|
||||||
) {
|
) {
|
||||||
const conditionDialog = proxy.$refs[`condition-${index}`][0];
|
const conditionDialog = proxy.$refs[`condition-${index}`][0];
|
||||||
// 使用modalApi来打开模态框并传递数据
|
// 打开模态框并传递数据
|
||||||
conditionDialog.modalApi.setData(formSetting).open();
|
conditionDialog.openModal(formSetting);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 删除条件配置 */
|
/** 删除条件配置 */
|
||||||
|
@ -215,8 +215,8 @@ function openFormSettingCondition(
|
||||||
formSetting: FormTriggerSetting,
|
formSetting: FormTriggerSetting,
|
||||||
) {
|
) {
|
||||||
const conditionDialog = proxy.$refs[`condition-${index}`][0];
|
const conditionDialog = proxy.$refs[`condition-${index}`][0];
|
||||||
// 使用 modalApi 来打开模态框并传递数据
|
// 打开模态框并传递数据
|
||||||
conditionDialog.modalApi.setData(formSetting).open();
|
conditionDialog.openModal(formSetting);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 处理条件配置保存 */
|
/** 处理条件配置保存 */
|
||||||
|
|
|
@ -335,7 +335,7 @@ defineExpose({ validate });
|
||||||
<div
|
<div
|
||||||
v-for="user in selectedStartUsers"
|
v-for="user in selectedStartUsers"
|
||||||
:key="user.id"
|
:key="user.id"
|
||||||
class="relative flex h-9 items-center rounded-full pr-2 hover:bg-gray-200"
|
class="relative flex h-9 items-center rounded-full bg-gray-100 pr-2 hover:bg-gray-200 dark:border dark:border-gray-500 dark:bg-gray-700 dark:hover:bg-gray-600"
|
||||||
>
|
>
|
||||||
<Avatar
|
<Avatar
|
||||||
class="m-1"
|
class="m-1"
|
||||||
|
@ -346,7 +346,9 @@ defineExpose({ validate });
|
||||||
<Avatar class="m-1" :size="28" v-else>
|
<Avatar class="m-1" :size="28" v-else>
|
||||||
{{ user.nickname?.substring(0, 1) }}
|
{{ user.nickname?.substring(0, 1) }}
|
||||||
</Avatar>
|
</Avatar>
|
||||||
{{ user.nickname }}
|
<span class="text-gray-700 dark:text-gray-200">
|
||||||
|
{{ user.nickname }}
|
||||||
|
</span>
|
||||||
<IconifyIcon
|
<IconifyIcon
|
||||||
icon="lucide:x"
|
icon="lucide:x"
|
||||||
class="ml-2 size-4 cursor-pointer text-gray-400 hover:text-red-500"
|
class="ml-2 size-4 cursor-pointer text-gray-400 hover:text-red-500"
|
||||||
|
@ -371,10 +373,12 @@ defineExpose({ validate });
|
||||||
<div
|
<div
|
||||||
v-for="dept in selectedStartDepts"
|
v-for="dept in selectedStartDepts"
|
||||||
:key="dept.id"
|
:key="dept.id"
|
||||||
class="relative flex h-9 items-center rounded-full pr-2 shadow-sm hover:bg-gray-200"
|
class="relative flex h-9 items-center rounded-full bg-gray-100 pr-2 shadow-sm hover:bg-gray-200 dark:border dark:border-gray-500 dark:bg-gray-700 dark:hover:bg-gray-600"
|
||||||
>
|
>
|
||||||
<IconifyIcon icon="lucide:building" class="size-6 px-1" />
|
<IconifyIcon icon="lucide:building" class="size-6 px-1" />
|
||||||
{{ dept.name }}
|
<span class="text-gray-700 dark:text-gray-200">
|
||||||
|
{{ dept.name }}
|
||||||
|
</span>
|
||||||
<IconifyIcon
|
<IconifyIcon
|
||||||
icon="lucide:x"
|
icon="lucide:x"
|
||||||
class="ml-2 size-4 cursor-pointer text-gray-400 hover:text-red-500"
|
class="ml-2 size-4 cursor-pointer text-gray-400 hover:text-red-500"
|
||||||
|
@ -398,7 +402,7 @@ defineExpose({ validate });
|
||||||
<div
|
<div
|
||||||
v-for="user in selectedManagerUsers"
|
v-for="user in selectedManagerUsers"
|
||||||
:key="user.id"
|
:key="user.id"
|
||||||
class="hover:bg-primary-500 relative flex h-9 items-center rounded-full pr-2"
|
class="relative flex h-9 items-center rounded-full bg-gray-100 pr-2 hover:bg-gray-200 dark:border dark:border-gray-500 dark:bg-gray-700 dark:hover:bg-gray-600"
|
||||||
>
|
>
|
||||||
<Avatar
|
<Avatar
|
||||||
class="m-1"
|
class="m-1"
|
||||||
|
@ -409,7 +413,9 @@ defineExpose({ validate });
|
||||||
<Avatar class="m-1" :size="28" v-else>
|
<Avatar class="m-1" :size="28" v-else>
|
||||||
{{ user.nickname?.substring(0, 1) }}
|
{{ user.nickname?.substring(0, 1) }}
|
||||||
</Avatar>
|
</Avatar>
|
||||||
{{ user.nickname }}
|
<span class="text-gray-700 dark:text-gray-200">
|
||||||
|
{{ user.nickname }}
|
||||||
|
</span>
|
||||||
<IconifyIcon
|
<IconifyIcon
|
||||||
icon="lucide:x"
|
icon="lucide:x"
|
||||||
class="ml-2 size-4 cursor-pointer text-gray-400 hover:text-red-500"
|
class="ml-2 size-4 cursor-pointer text-gray-400 hover:text-red-500"
|
||||||
|
@ -432,6 +438,7 @@ defineExpose({ validate });
|
||||||
|
|
||||||
<!-- 用户选择弹窗 -->
|
<!-- 用户选择弹窗 -->
|
||||||
<UserSelectModalComp
|
<UserSelectModalComp
|
||||||
|
class="w-3/5"
|
||||||
v-model:value="selectedUsers"
|
v-model:value="selectedUsers"
|
||||||
:multiple="true"
|
:multiple="true"
|
||||||
title="选择用户"
|
title="选择用户"
|
||||||
|
@ -441,6 +448,7 @@ defineExpose({ validate });
|
||||||
/>
|
/>
|
||||||
<!-- 部门选择对话框 -->
|
<!-- 部门选择对话框 -->
|
||||||
<DeptSelectModalComp
|
<DeptSelectModalComp
|
||||||
|
class="w-3/5"
|
||||||
title="发起人部门选择"
|
title="发起人部门选择"
|
||||||
:check-strictly="true"
|
:check-strictly="true"
|
||||||
@confirm="handleDeptSelectConfirm"
|
@confirm="handleDeptSelectConfirm"
|
||||||
|
|
|
@ -72,7 +72,6 @@ const timelineRef = ref<any>();
|
||||||
const activeTab = ref('form');
|
const activeTab = ref('form');
|
||||||
const activityNodes = ref<BpmProcessInstanceApi.ApprovalNodeInfo[]>([]);
|
const activityNodes = ref<BpmProcessInstanceApi.ApprovalNodeInfo[]>([]);
|
||||||
const processInstanceStartLoading = ref(false);
|
const processInstanceStartLoading = ref(false);
|
||||||
|
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
async function submitForm() {
|
async function submitForm() {
|
||||||
if (!fApi.value || !props.selectProcessDefinition) {
|
if (!fApi.value || !props.selectProcessDefinition) {
|
||||||
|
@ -109,7 +108,6 @@ async function submitForm() {
|
||||||
|
|
||||||
await router.push({ path: '/bpm/task/my' });
|
await router.push({ path: '/bpm/task/my' });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
message.error('发起流程失败');
|
|
||||||
console.error('发起流程失败:', error);
|
console.error('发起流程失败:', error);
|
||||||
} finally {
|
} finally {
|
||||||
processInstanceStartLoading.value = false;
|
processInstanceStartLoading.value = false;
|
||||||
|
@ -330,7 +328,12 @@ defineExpose({ initProcessInfo });
|
||||||
<template #actions>
|
<template #actions>
|
||||||
<template v-if="activeTab === 'form'">
|
<template v-if="activeTab === 'form'">
|
||||||
<Space wrap class="flex w-full justify-center">
|
<Space wrap class="flex w-full justify-center">
|
||||||
<Button plain type="primary" @click="submitForm">
|
<Button
|
||||||
|
plain
|
||||||
|
type="primary"
|
||||||
|
@click="submitForm"
|
||||||
|
:loading="processInstanceStartLoading"
|
||||||
|
>
|
||||||
<IconifyIcon icon="lucide:check" />
|
<IconifyIcon icon="lucide:check" />
|
||||||
发起
|
发起
|
||||||
</Button>
|
</Button>
|
||||||
|
|
|
@ -735,6 +735,7 @@ defineExpose({ loadTodoTask });
|
||||||
<ProcessInstanceTimeline
|
<ProcessInstanceTimeline
|
||||||
:activity-nodes="nextAssigneesActivityNode"
|
:activity-nodes="nextAssigneesActivityNode"
|
||||||
:show-status-icon="false"
|
:show-status-icon="false"
|
||||||
|
:use-next-assignees="true"
|
||||||
@select-user-confirm="selectNextAssigneesConfirm"
|
@select-user-confirm="selectNextAssigneesConfirm"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -20,13 +20,15 @@ import {
|
||||||
|
|
||||||
defineOptions({ name: 'BpmProcessInstanceTimeline' });
|
defineOptions({ name: 'BpmProcessInstanceTimeline' });
|
||||||
|
|
||||||
withDefaults(
|
const props = withDefaults(
|
||||||
defineProps<{
|
defineProps<{
|
||||||
activityNodes: BpmProcessInstanceApi.ApprovalNodeInfo[]; // 审批节点信息
|
activityNodes: BpmProcessInstanceApi.ApprovalNodeInfo[]; // 审批节点信息
|
||||||
showStatusIcon?: boolean; // 是否显示头像右下角状态图标
|
showStatusIcon?: boolean; // 是否显示头像右下角状态图标
|
||||||
|
useNextAssignees?: boolean; // 是否用于下一个节点审批人选择
|
||||||
}>(),
|
}>(),
|
||||||
{
|
{
|
||||||
showStatusIcon: true, // 默认值为 true
|
showStatusIcon: true, // 默认值为 true
|
||||||
|
useNextAssignees: false, // 默认值为 false
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -196,8 +198,9 @@ function shouldShowCustomUserSelect(
|
||||||
isEmpty(activity.candidateUsers) &&
|
isEmpty(activity.candidateUsers) &&
|
||||||
(BpmCandidateStrategyEnum.START_USER_SELECT ===
|
(BpmCandidateStrategyEnum.START_USER_SELECT ===
|
||||||
activity.candidateStrategy ||
|
activity.candidateStrategy ||
|
||||||
BpmCandidateStrategyEnum.APPROVE_USER_SELECT ===
|
(BpmCandidateStrategyEnum.APPROVE_USER_SELECT ===
|
||||||
activity.candidateStrategy)
|
activity.candidateStrategy &&
|
||||||
|
props.useNextAssignees))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -457,6 +460,7 @@ function handleUserSelectCancel() {
|
||||||
|
|
||||||
<!-- 用户选择弹窗 -->
|
<!-- 用户选择弹窗 -->
|
||||||
<UserSelectModalComp
|
<UserSelectModalComp
|
||||||
|
class="w-3/5"
|
||||||
v-model:value="selectedUsers"
|
v-model:value="selectedUsers"
|
||||||
:multiple="true"
|
:multiple="true"
|
||||||
title="选择用户"
|
title="选择用户"
|
||||||
|
|
Loading…
Reference in New Issue