review:【antd/ele】【bpm】流程模型的迁移
This commit is contained in:
@@ -32,7 +32,7 @@ const [Modal, modalApi] = useVbenModal({
|
|||||||
try {
|
try {
|
||||||
await formRef.value?.validate();
|
await formRef.value?.validate();
|
||||||
emit('confirm', { ...form.value });
|
emit('confirm', { ...form.value });
|
||||||
modalApi.close();
|
await modalApi.close();
|
||||||
} catch {
|
} catch {
|
||||||
// validate failed
|
// validate failed
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -193,7 +193,6 @@ const childFormFieldOptions = ref<any[]>([]);
|
|||||||
const saveConfig = async () => {
|
const saveConfig = async () => {
|
||||||
activeTabName.value = 'child';
|
activeTabName.value = 'child';
|
||||||
if (!formRef.value) return false;
|
if (!formRef.value) return false;
|
||||||
|
|
||||||
const valid = await formRef.value.validate().catch(() => false);
|
const valid = await formRef.value.validate().catch(() => false);
|
||||||
if (!valid) return false;
|
if (!valid) return false;
|
||||||
|
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ const {
|
|||||||
} = useNodeForm(BpmNodeTypeEnum.COPY_TASK_NODE);
|
} = useNodeForm(BpmNodeTypeEnum.COPY_TASK_NODE);
|
||||||
|
|
||||||
const configForm = tempConfigForm as Ref<CopyTaskFormType>;
|
const configForm = tempConfigForm as Ref<CopyTaskFormType>;
|
||||||
// 抄送人策略, 去掉发起人自选 和 发起人自己
|
// 抄送人策略,去掉发起人自选 和 发起人自己
|
||||||
const copyUserStrategies = computed(() => {
|
const copyUserStrategies = computed(() => {
|
||||||
return CANDIDATE_STRATEGY.filter(
|
return CANDIDATE_STRATEGY.filter(
|
||||||
(item) => item.value !== CandidateStrategy.START_USER,
|
(item) => item.value !== CandidateStrategy.START_USER,
|
||||||
|
|||||||
@@ -348,7 +348,7 @@ function getShowText(): string {
|
|||||||
return showText;
|
return showText;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 显示触发器节点配置, 由父组件传过来 */
|
/** 显示触发器节点配置,由父组件传过来 */
|
||||||
function showTriggerNodeConfig(node: SimpleFlowNode) {
|
function showTriggerNodeConfig(node: SimpleFlowNode) {
|
||||||
nodeName.value = node.name;
|
nodeName.value = node.name;
|
||||||
originalSetting = node.triggerSetting
|
originalSetting = node.triggerSetting
|
||||||
|
|||||||
@@ -532,7 +532,7 @@ function useTimeoutHandler() {
|
|||||||
if (timeUnit.value === TimeUnitType.HOUR) {
|
if (timeUnit.value === TimeUnitType.HOUR) {
|
||||||
configForm.value.timeDuration = 6;
|
configForm.value.timeDuration = 6;
|
||||||
}
|
}
|
||||||
// 天, 默认 1天
|
// 天, 默认 1 天
|
||||||
if (timeUnit.value === TimeUnitType.DAY) {
|
if (timeUnit.value === TimeUnitType.DAY) {
|
||||||
configForm.value.timeDuration = 1;
|
configForm.value.timeDuration = 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ const props = defineProps<{
|
|||||||
flowNode: SimpleFlowNode;
|
flowNode: SimpleFlowNode;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
/** 定义事件,更新父组件。 */
|
/** 定义事件,更新父组件 */
|
||||||
const emits = defineEmits<{
|
const emits = defineEmits<{
|
||||||
'update:flowNode': [node: SimpleFlowNode | undefined];
|
'update:flowNode': [node: SimpleFlowNode | undefined];
|
||||||
}>();
|
}>();
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ const props = defineProps({
|
|||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
// 定义事件,更新父组件。
|
// 定义事件,更新父组件
|
||||||
const emits = defineEmits<{
|
const emits = defineEmits<{
|
||||||
'update:flowNode': [node: SimpleFlowNode | undefined];
|
'update:flowNode': [node: SimpleFlowNode | undefined];
|
||||||
}>();
|
}>();
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ const props = defineProps({
|
|||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
// 定义事件,更新父组件。
|
// 定义事件,更新父组件
|
||||||
const emits = defineEmits<{
|
const emits = defineEmits<{
|
||||||
'update:flowNode': [node: SimpleFlowNode | undefined];
|
'update:flowNode': [node: SimpleFlowNode | undefined];
|
||||||
}>();
|
}>();
|
||||||
|
|||||||
@@ -289,7 +289,7 @@ function recursiveFindParentNode(
|
|||||||
:condition-node="item"
|
:condition-node="item"
|
||||||
:ref="item.id"
|
:ref="item.id"
|
||||||
/>
|
/>
|
||||||
<!-- 递归显示子节点 -->
|
<!-- 递归显示子节点 -->
|
||||||
<ProcessNodeTree
|
<ProcessNodeTree
|
||||||
v-if="item && item.childNode"
|
v-if="item && item.childNode"
|
||||||
:parent-node="item"
|
:parent-node="item"
|
||||||
|
|||||||
@@ -291,7 +291,7 @@ function recursiveFindParentNode(
|
|||||||
:condition-node="item"
|
:condition-node="item"
|
||||||
:ref="item.id"
|
:ref="item.id"
|
||||||
/>
|
/>
|
||||||
<!-- 递归显示子节点 -->
|
<!-- 递归显示子节点 -->
|
||||||
<ProcessNodeTree
|
<ProcessNodeTree
|
||||||
v-if="item && item.childNode"
|
v-if="item && item.childNode"
|
||||||
:parent-node="item"
|
:parent-node="item"
|
||||||
|
|||||||
@@ -53,10 +53,10 @@ const showInputs = ref<boolean[]>([]);
|
|||||||
watch(
|
watch(
|
||||||
showInputs,
|
showInputs,
|
||||||
(newValues) => {
|
(newValues) => {
|
||||||
// 当输入框显示时, 自动聚焦
|
// 当输入框显示时 自动聚焦
|
||||||
newValues.forEach((value, index) => {
|
newValues.forEach((value, index) => {
|
||||||
if (value) {
|
if (value) {
|
||||||
// 当显示状态从 false 变为 true 时, 自动聚焦
|
// 当显示状态从 false 变为 true 时 自动聚焦
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
inputRefs.value[index]?.focus();
|
inputRefs.value[index]?.focus();
|
||||||
});
|
});
|
||||||
@@ -212,7 +212,7 @@ function recursiveFindParentNode(
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 递归显示子节点 -->
|
<!-- 递归显示子节点 -->
|
||||||
<ProcessNodeTree
|
<ProcessNodeTree
|
||||||
v-if="item && item.childNode"
|
v-if="item && item.childNode"
|
||||||
:parent-node="item"
|
:parent-node="item"
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ const props = defineProps({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
// 定义事件,更新父组件。
|
// 定义事件,更新父组件
|
||||||
defineEmits<{
|
defineEmits<{
|
||||||
'update:modelValue': [node: SimpleFlowNode | undefined];
|
'update:modelValue': [node: SimpleFlowNode | undefined];
|
||||||
}>();
|
}>();
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import { router } from '#/router';
|
|||||||
|
|
||||||
import { useGridColumns, useGridFormSchema } from './data';
|
import { useGridColumns, useGridFormSchema } from './data';
|
||||||
|
|
||||||
|
// TODO @jason:这里是不是要迁移下?
|
||||||
/** 刷新表格 */
|
/** 刷新表格 */
|
||||||
function handleRefresh() {
|
function handleRefresh() {
|
||||||
gridApi.query();
|
gridApi.query();
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ const emit = defineEmits<{
|
|||||||
select: [expression: BpmProcessExpressionApi.ProcessExpression];
|
select: [expression: BpmProcessExpressionApi.ProcessExpression];
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
|
// TODO @jason:这里是不是要迁移下?
|
||||||
// 查询参数
|
// 查询参数
|
||||||
const queryParams = ref({
|
const queryParams = ref({
|
||||||
status: CommonStatusEnum.ENABLE,
|
status: CommonStatusEnum.ENABLE,
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ const emit = defineEmits<{
|
|||||||
select: [listener: BpmProcessListenerApi.ProcessListener];
|
select: [listener: BpmProcessListenerApi.ProcessListener];
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
|
// TODO @jason:这里是不是要迁移下?
|
||||||
// 查询参数
|
// 查询参数
|
||||||
const queryParams = ref({
|
const queryParams = ref({
|
||||||
type: '',
|
type: '',
|
||||||
|
|||||||
@@ -3,9 +3,7 @@ import 'bpmn-js/dist/assets/diagram-js.css';
|
|||||||
import 'bpmn-js/dist/assets/bpmn-font/css/bpmn.css';
|
import 'bpmn-js/dist/assets/bpmn-font/css/bpmn.css';
|
||||||
import 'bpmn-js/dist/assets/bpmn-font/css/bpmn-codes.css';
|
import 'bpmn-js/dist/assets/bpmn-font/css/bpmn-codes.css';
|
||||||
import 'bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css';
|
import 'bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css';
|
||||||
// TODO @puhui999:样式问题:设计器那,位置不太对;
|
|
||||||
|
|
||||||
export { default as MyProcessDesigner } from './designer';
|
export { default as MyProcessDesigner } from './designer';
|
||||||
// TODO @puhui999:流程发起时,预览相关的,需要使用;
|
|
||||||
export { default as MyProcessViewer } from './designer/index2';
|
export { default as MyProcessViewer } from './designer/index2';
|
||||||
export { default as MyProcessPenal } from './penal';
|
export { default as MyProcessPenal } from './penal';
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ const [Modal, modalApi] = useVbenModal({
|
|||||||
try {
|
try {
|
||||||
await formRef.value?.validate();
|
await formRef.value?.validate();
|
||||||
emit('confirm', { ...form.value });
|
emit('confirm', { ...form.value });
|
||||||
modalApi.close();
|
await modalApi.close();
|
||||||
} catch {
|
} catch {
|
||||||
// validate failed
|
// validate failed
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ watch(
|
|||||||
<div class="panel-tab__content">
|
<div class="panel-tab__content">
|
||||||
<ElForm>
|
<ElForm>
|
||||||
<!-- add by 芋艿:由于「异步延续」暂时用不到,所以这里 display 为 none -->
|
<!-- add by 芋艿:由于「异步延续」暂时用不到,所以这里 display 为 none -->
|
||||||
|
<!-- TODO @jaosn:这里 antd 属性地 hidden,需要关注么? -->
|
||||||
<ElFormItem label="异步延续" class="!hidden">
|
<ElFormItem label="异步延续" class="!hidden">
|
||||||
<ElCheckbox
|
<ElCheckbox
|
||||||
v-model="taskConfigForm.asyncBefore"
|
v-model="taskConfigForm.asyncBefore"
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ import {
|
|||||||
MULTI_LEVEL_DEPT,
|
MULTI_LEVEL_DEPT,
|
||||||
} from '#/views/bpm/components/simple-process-design/consts';
|
} from '#/views/bpm/components/simple-process-design/consts';
|
||||||
import { useFormFieldsPermission } from '#/views/bpm/components/simple-process-design/helpers';
|
import { useFormFieldsPermission } from '#/views/bpm/components/simple-process-design/helpers';
|
||||||
|
// TODO @jason:antd 是不是导入对齐这个?
|
||||||
import { ProcessExpressionSelectModal } from '#/views/bpm/processExpression/components';
|
import { ProcessExpressionSelectModal } from '#/views/bpm/processExpression/components';
|
||||||
|
|
||||||
defineOptions({ name: 'UserTask' });
|
defineOptions({ name: 'UserTask' });
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ const bpmnInstances = () => (window as any).bpmnInstances;
|
|||||||
const type: Ref<string> = ref('time');
|
const type: Ref<string> = ref('time');
|
||||||
const condition: Ref<string> = ref('');
|
const condition: Ref<string> = ref('');
|
||||||
const valid: Ref<boolean> = ref(false);
|
const valid: Ref<boolean> = ref(false);
|
||||||
|
// TODO @jason:const dateValue = ref<Dayjs>(); 需要么?
|
||||||
const dateValue = ref();
|
const dateValue = ref();
|
||||||
|
|
||||||
const placeholder = computed<string>(() => {
|
const placeholder = computed<string>(() => {
|
||||||
@@ -106,6 +107,7 @@ function validate(): boolean {
|
|||||||
// 选择时间 Modal
|
// 选择时间 Modal
|
||||||
const [DateModal, dateModalApi] = useVbenModal({
|
const [DateModal, dateModalApi] = useVbenModal({
|
||||||
title: '选择时间',
|
title: '选择时间',
|
||||||
|
// TODO @jason:antd 这里有个属性,需要么?
|
||||||
onConfirm: onDateConfirm,
|
onConfirm: onDateConfirm,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -123,6 +125,7 @@ function onDateConfirm(): void {
|
|||||||
// 持续时长 Modal
|
// 持续时长 Modal
|
||||||
const [DurationModal, durationModalApi] = useVbenModal({
|
const [DurationModal, durationModalApi] = useVbenModal({
|
||||||
title: '时间配置',
|
title: '时间配置',
|
||||||
|
// TODO @jason:antd 这里有个属性,需要么?
|
||||||
onConfirm: onDurationConfirm,
|
onConfirm: onDurationConfirm,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -137,6 +140,7 @@ function onDurationConfirm(): void {
|
|||||||
// 循环配置 Modal
|
// 循环配置 Modal
|
||||||
const [CycleModal, cycleModalApi] = useVbenModal({
|
const [CycleModal, cycleModalApi] = useVbenModal({
|
||||||
title: '时间配置',
|
title: '时间配置',
|
||||||
|
// TODO @jason:antd 这里有个属性,需要么?
|
||||||
onConfirm: onCycleConfirm,
|
onConfirm: onCycleConfirm,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -194,10 +194,10 @@ const saveConfig = async () => {
|
|||||||
// 3. 是否跳过发起人
|
// 3. 是否跳过发起人
|
||||||
currentNode.value.childProcessSetting.skipStartUserNode =
|
currentNode.value.childProcessSetting.skipStartUserNode =
|
||||||
configForm.value.skipStartUserNode;
|
configForm.value.skipStartUserNode;
|
||||||
// 4. 主→子变量
|
// 4. 主->子变量
|
||||||
currentNode.value.childProcessSetting.inVariables =
|
currentNode.value.childProcessSetting.inVariables =
|
||||||
configForm.value.inVariables;
|
configForm.value.inVariables;
|
||||||
// 5. 子→主变量
|
// 5. 子->主变量
|
||||||
currentNode.value.childProcessSetting.outVariables =
|
currentNode.value.childProcessSetting.outVariables =
|
||||||
configForm.value.outVariables;
|
configForm.value.outVariables;
|
||||||
// 6. 发起人设置
|
// 6. 发起人设置
|
||||||
@@ -256,9 +256,9 @@ const showChildProcessNodeConfig = (node: SimpleFlowNode) => {
|
|||||||
// 3. 是否跳过发起人
|
// 3. 是否跳过发起人
|
||||||
configForm.value.skipStartUserNode =
|
configForm.value.skipStartUserNode =
|
||||||
node.childProcessSetting.skipStartUserNode;
|
node.childProcessSetting.skipStartUserNode;
|
||||||
// 4. 主流程→子流程变量
|
// 4. 主->子变量
|
||||||
configForm.value.inVariables = node.childProcessSetting.inVariables ?? [];
|
configForm.value.inVariables = node.childProcessSetting.inVariables ?? [];
|
||||||
// 5. 子流程→主流程变量
|
// 5. 子->主变量
|
||||||
configForm.value.outVariables = node.childProcessSetting.outVariables ?? [];
|
configForm.value.outVariables = node.childProcessSetting.outVariables ?? [];
|
||||||
// 6. 发起人设置
|
// 6. 发起人设置
|
||||||
configForm.value.startUserType =
|
configForm.value.startUserType =
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ const [Drawer, drawerApi] = useVbenDrawer({
|
|||||||
});
|
});
|
||||||
|
|
||||||
function open() {
|
function open() {
|
||||||
// 使用三元表达式代替if-else,解决linter 警告
|
// 使用三元表达式代替 if-else,解决 linter 警告
|
||||||
condition.value = currentNode.value.conditionSetting
|
condition.value = currentNode.value.conditionSetting
|
||||||
? cloneDeep(currentNode.value.conditionSetting)
|
? cloneDeep(currentNode.value.conditionSetting)
|
||||||
: {
|
: {
|
||||||
@@ -132,7 +132,7 @@ watch(
|
|||||||
const showInput = ref(false);
|
const showInput = ref(false);
|
||||||
// 输入框的引用
|
// 输入框的引用
|
||||||
const inputRef = ref<HTMLInputElement | null>(null);
|
const inputRef = ref<HTMLInputElement | null>(null);
|
||||||
// 监听 showInput 的变化,当变为true 时自动聚焦
|
// 监听 showInput 的变化,当变为 true 时自动聚焦
|
||||||
watch(showInput, (value) => {
|
watch(showInput, (value) => {
|
||||||
if (value) {
|
if (value) {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
@@ -158,6 +158,7 @@ function changeNodeName() {
|
|||||||
defineExpose({ open }); // 提供 open 方法,用于打开弹窗
|
defineExpose({ open }); // 提供 open 方法,用于打开弹窗
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
|
<!-- TODO @jason:antd 是 1/3,这里要统一么? -->
|
||||||
<Drawer class="w-2/5">
|
<Drawer class="w-2/5">
|
||||||
<template #title>
|
<template #title>
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ defineOptions({
|
|||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
modelValue: {
|
modelValue: {
|
||||||
type: Object,
|
type: Object,
|
||||||
|
// TODO @jason:这里 required: false,
|
||||||
default: () => ({}),
|
default: () => ({}),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -262,7 +262,7 @@ function updateFormFieldKey(
|
|||||||
formSetting.updateFormFields[String(newKey)] = value;
|
formSetting.updateFormFields[String(newKey)] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 删除修改字段设置 */
|
/** 删除修改字段设置项 */
|
||||||
function deleteFormFieldSetting(formSetting: FormTriggerSetting, key: string) {
|
function deleteFormFieldSetting(formSetting: FormTriggerSetting, key: string) {
|
||||||
if (!formSetting?.updateFormFields) return;
|
if (!formSetting?.updateFormFields) return;
|
||||||
delete formSetting.updateFormFields[key];
|
delete formSetting.updateFormFields[key];
|
||||||
@@ -383,6 +383,7 @@ onMounted(() => {
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
|
<!-- TODO @jason:antd 这里是 1/3,需要保持一致么? -->
|
||||||
<Drawer class="w-2/5">
|
<Drawer class="w-2/5">
|
||||||
<template #title>
|
<template #title>
|
||||||
<div class="config-header">
|
<div class="config-header">
|
||||||
|
|||||||
@@ -373,7 +373,7 @@ function showUserTaskNodeConfig(node: SimpleFlowNode) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2.1 审批人设置策略
|
// 2.1 审批人设置
|
||||||
configForm.value.candidateStrategy = node.candidateStrategy!;
|
configForm.value.candidateStrategy = node.candidateStrategy!;
|
||||||
// 解析候选人参数
|
// 解析候选人参数
|
||||||
parseCandidateParam(node.candidateStrategy!, node?.candidateParam);
|
parseCandidateParam(node.candidateStrategy!, node?.candidateParam);
|
||||||
@@ -402,7 +402,7 @@ function showUserTaskNodeConfig(node: SimpleFlowNode) {
|
|||||||
// 2.5 设置审批人为空时
|
// 2.5 设置审批人为空时
|
||||||
configForm.value.assignEmptyHandlerType = node.assignEmptyHandler?.type;
|
configForm.value.assignEmptyHandlerType = node.assignEmptyHandler?.type;
|
||||||
configForm.value.assignEmptyHandlerUserIds = node.assignEmptyHandler?.userIds;
|
configForm.value.assignEmptyHandlerUserIds = node.assignEmptyHandler?.userIds;
|
||||||
// 2.6 设置用户任务的审批人与发起人相同处理
|
// 2.6 设置用户任务的审批人与发起人相同时
|
||||||
configForm.value.assignStartUserHandlerType = node.assignStartUserHandlerType;
|
configForm.value.assignStartUserHandlerType = node.assignStartUserHandlerType;
|
||||||
// 3. 操作按钮设置
|
// 3. 操作按钮设置
|
||||||
buttonsSetting.value =
|
buttonsSetting.value =
|
||||||
@@ -456,7 +456,7 @@ function useButtonsSetting() {
|
|||||||
|
|
||||||
const changeBtnDisplayName = (index: number) => {
|
const changeBtnDisplayName = (index: number) => {
|
||||||
btnDisplayNameEdit.value[index] = true;
|
btnDisplayNameEdit.value[index] = true;
|
||||||
// 输入框自动聚焦
|
// 输入框自动聚集
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
if (_btnDisplayNameInputRefs.value[index]) {
|
if (_btnDisplayNameInputRefs.value[index]) {
|
||||||
_btnDisplayNameInputRefs.value[index]?.focus();
|
_btnDisplayNameInputRefs.value[index]?.focus();
|
||||||
@@ -533,7 +533,7 @@ function useTimeoutHandler() {
|
|||||||
configForm.value.timeDuration = 1;
|
configForm.value.timeDuration = 1;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// 超时时间 ISO 表示
|
// 超时时间的 ISO 表示
|
||||||
const isoTimeDuration = computed(() => {
|
const isoTimeDuration = computed(() => {
|
||||||
if (!configForm.value.timeoutHandlerEnable) {
|
if (!configForm.value.timeoutHandlerEnable) {
|
||||||
return undefined;
|
return undefined;
|
||||||
@@ -586,12 +586,12 @@ function updatePermission(type: string) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 在组件初始化时记录初始值
|
// 在组件初始化时记录初始位置
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// 固定添加发起人ID字段
|
// 固定添加发起人ID字段
|
||||||
formFieldOptions.unshift({
|
formFieldOptions.unshift({
|
||||||
field: ProcessVariableEnum.START_USER_ID,
|
field: ProcessVariableEnum.START_USER_ID,
|
||||||
title: '发起人ID',
|
title: '发起人',
|
||||||
type: 'UserSelect',
|
type: 'UserSelect',
|
||||||
required: true,
|
required: true,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -59,10 +59,10 @@ const showInputs = ref<boolean[]>([]);
|
|||||||
watch(
|
watch(
|
||||||
showInputs,
|
showInputs,
|
||||||
(newValues) => {
|
(newValues) => {
|
||||||
// 当状态为 true 时
|
// 当状态为 true 时, 自动聚焦
|
||||||
newValues.forEach((value, index) => {
|
newValues.forEach((value, index) => {
|
||||||
if (value) {
|
if (value) {
|
||||||
// 当显示状态从 false 变为 true 时
|
// 当显示状态从 false 变为 true 时, 自动聚焦
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
inputRefs.value[index]?.focus();
|
inputRefs.value[index]?.focus();
|
||||||
});
|
});
|
||||||
@@ -137,7 +137,7 @@ function deleteCondition(index: number) {
|
|||||||
|
|
||||||
// 移动节点
|
// 移动节点
|
||||||
function moveNode(index: number, to: number) {
|
function moveNode(index: number, to: number) {
|
||||||
// -1 :向左 1:向右
|
// -1 :向左 1: 向右
|
||||||
if (
|
if (
|
||||||
currentNode.value.conditionNodes &&
|
currentNode.value.conditionNodes &&
|
||||||
currentNode.value.conditionNodes[index]
|
currentNode.value.conditionNodes[index]
|
||||||
|
|||||||
@@ -64,10 +64,10 @@ const showInputs = ref<boolean[]>([]);
|
|||||||
watch(
|
watch(
|
||||||
showInputs,
|
showInputs,
|
||||||
(newValues) => {
|
(newValues) => {
|
||||||
// 当状态为 true 时
|
// 当状态为 true 时, 自动聚焦
|
||||||
newValues.forEach((value, index) => {
|
newValues.forEach((value, index) => {
|
||||||
if (value) {
|
if (value) {
|
||||||
// 当显示状态从 false 变为 true 时
|
// 当显示状态从 false 变为 true 时, 自动聚焦
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
inputRefs.value[index]?.focus();
|
inputRefs.value[index]?.focus();
|
||||||
});
|
});
|
||||||
@@ -141,7 +141,7 @@ function deleteCondition(index: number) {
|
|||||||
|
|
||||||
// 移动节点
|
// 移动节点
|
||||||
function moveNode(index: number, to: number) {
|
function moveNode(index: number, to: number) {
|
||||||
// -1 :向左 1:向右
|
// -1 :向左 1: 向右
|
||||||
if (
|
if (
|
||||||
currentNode.value.conditionNodes &&
|
currentNode.value.conditionNodes &&
|
||||||
currentNode.value.conditionNodes[index]
|
currentNode.value.conditionNodes[index]
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ const [Modal, modalApi] = useVbenModal({
|
|||||||
try {
|
try {
|
||||||
const data = modalApi.getData<any[]>();
|
const data = modalApi.getData<any[]>();
|
||||||
// 填充列表数据
|
// 填充列表数据
|
||||||
await gridApi.setGridOptions({ data });
|
gridApi.setGridOptions({ data });
|
||||||
} finally {
|
} finally {
|
||||||
modalApi.unlock();
|
modalApi.unlock();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ const [Modal, modalApi] = useVbenModal({
|
|||||||
try {
|
try {
|
||||||
const data = modalApi.getData<any[]>();
|
const data = modalApi.getData<any[]>();
|
||||||
// 填充列表数据
|
// 填充列表数据
|
||||||
await gridApi.setGridOptions({ data });
|
gridApi.setGridOptions({ data });
|
||||||
} finally {
|
} finally {
|
||||||
modalApi.unlock();
|
modalApi.unlock();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ function recursiveFindParentNode(
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<!-- 发起人节<EFBFBD>?-->
|
<!-- 发起人节点 -->
|
||||||
<StartUserNode
|
<StartUserNode
|
||||||
v-if="currentNode && currentNode.type === BpmNodeTypeEnum.START_USER_NODE"
|
v-if="currentNode && currentNode.type === BpmNodeTypeEnum.START_USER_NODE"
|
||||||
:flow-node="currentNode"
|
:flow-node="currentNode"
|
||||||
@@ -87,7 +87,7 @@ function recursiveFindParentNode(
|
|||||||
@update:flow-node="handleModelValueUpdate"
|
@update:flow-node="handleModelValueUpdate"
|
||||||
@find-parent-node="findParentNode"
|
@find-parent-node="findParentNode"
|
||||||
/>
|
/>
|
||||||
<!-- 抄送节<EFBFBD>?-->
|
<!-- 抄送节点 -->
|
||||||
<CopyTaskNode
|
<CopyTaskNode
|
||||||
v-if="currentNode && currentNode.type === BpmNodeTypeEnum.COPY_TASK_NODE"
|
v-if="currentNode && currentNode.type === BpmNodeTypeEnum.COPY_TASK_NODE"
|
||||||
:flow-node="currentNode"
|
:flow-node="currentNode"
|
||||||
@@ -120,7 +120,7 @@ function recursiveFindParentNode(
|
|||||||
@update:model-value="handleModelValueUpdate"
|
@update:model-value="handleModelValueUpdate"
|
||||||
@find-parent-node="findParentNode"
|
@find-parent-node="findParentNode"
|
||||||
/>
|
/>
|
||||||
<!-- 延迟器节<EFBFBD>?-->
|
<!-- 延迟器节点 -->
|
||||||
<DelayTimerNode
|
<DelayTimerNode
|
||||||
v-if="currentNode && currentNode.type === BpmNodeTypeEnum.DELAY_TIMER_NODE"
|
v-if="currentNode && currentNode.type === BpmNodeTypeEnum.DELAY_TIMER_NODE"
|
||||||
:flow-node="currentNode"
|
:flow-node="currentNode"
|
||||||
@@ -134,13 +134,13 @@ function recursiveFindParentNode(
|
|||||||
:flow-node="currentNode"
|
:flow-node="currentNode"
|
||||||
@update:flow-node="handleModelValueUpdate"
|
@update:flow-node="handleModelValueUpdate"
|
||||||
/>
|
/>
|
||||||
<!-- 触发器节<EFBFBD>?-->
|
<!-- 触发器节点 -->
|
||||||
<TriggerNode
|
<TriggerNode
|
||||||
v-if="currentNode && currentNode.type === BpmNodeTypeEnum.TRIGGER_NODE"
|
v-if="currentNode && currentNode.type === BpmNodeTypeEnum.TRIGGER_NODE"
|
||||||
:flow-node="currentNode"
|
:flow-node="currentNode"
|
||||||
@update:flow-node="handleModelValueUpdate"
|
@update:flow-node="handleModelValueUpdate"
|
||||||
/>
|
/>
|
||||||
<!-- 子流程节<EFBFBD>?-->
|
<!-- 子流程节点 -->
|
||||||
<ChildProcessNode
|
<ChildProcessNode
|
||||||
v-if="
|
v-if="
|
||||||
currentNode && currentNode.type === BpmNodeTypeEnum.CHILD_PROCESS_NODE
|
currentNode && currentNode.type === BpmNodeTypeEnum.CHILD_PROCESS_NODE
|
||||||
|
|||||||
@@ -263,6 +263,7 @@ const saveLoading = ref<boolean>(false);
|
|||||||
/** 保存操作 */
|
/** 保存操作 */
|
||||||
async function handleSave() {
|
async function handleSave() {
|
||||||
try {
|
try {
|
||||||
|
saveLoading.value = true;
|
||||||
// 保存前校验所有步骤的数据
|
// 保存前校验所有步骤的数据
|
||||||
const result = await validateAllSteps();
|
const result = await validateAllSteps();
|
||||||
if (!result) {
|
if (!result) {
|
||||||
@@ -273,7 +274,7 @@ async function handleSave() {
|
|||||||
const modelData = {
|
const modelData = {
|
||||||
...formData.value,
|
...formData.value,
|
||||||
};
|
};
|
||||||
saveLoading.value = true;
|
|
||||||
switch (actionType) {
|
switch (actionType) {
|
||||||
case 'copy': {
|
case 'copy': {
|
||||||
// 情况三:复制场景
|
// 情况三:复制场景
|
||||||
@@ -323,11 +324,10 @@ async function handleDeploy() {
|
|||||||
if (!formData.value.id) {
|
if (!formData.value.id) {
|
||||||
await confirm('是否确认发布该流程?');
|
await confirm('是否确认发布该流程?');
|
||||||
}
|
}
|
||||||
|
deployLoading.value = true;
|
||||||
// 1.2 校验所有步骤
|
// 1.2 校验所有步骤
|
||||||
await validateAllSteps();
|
await validateAllSteps();
|
||||||
|
|
||||||
deployLoading.value = true;
|
|
||||||
|
|
||||||
// 2.1 更新表单数据
|
// 2.1 更新表单数据
|
||||||
const modelData = {
|
const modelData = {
|
||||||
...formData.value,
|
...formData.value,
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ import { inject, onBeforeUnmount, provide, ref, shallowRef, watch } from 'vue';
|
|||||||
import { ContentWrap } from '@vben/common-ui';
|
import { ContentWrap } from '@vben/common-ui';
|
||||||
import { BpmModelFormType } from '@vben/constants';
|
import { BpmModelFormType } from '@vben/constants';
|
||||||
|
|
||||||
|
import { ElMessage } from 'element-plus';
|
||||||
|
|
||||||
import { getForm } from '#/api/bpm/form';
|
import { getForm } from '#/api/bpm/form';
|
||||||
import {
|
import {
|
||||||
MyProcessDesigner,
|
MyProcessDesigner,
|
||||||
@@ -47,7 +49,6 @@ const controlForm = ref({
|
|||||||
headerButtonSize: 'mini',
|
headerButtonSize: 'mini',
|
||||||
additionalModel: [CustomContentPadProvider, CustomPaletteProvider],
|
additionalModel: [CustomContentPadProvider, CustomPaletteProvider],
|
||||||
});
|
});
|
||||||
|
|
||||||
const model = ref<BpmModelApi.Model>(); // 流程模型的信息
|
const model = ref<BpmModelApi.Model>(); // 流程模型的信息
|
||||||
|
|
||||||
/** 初始化 modeler */
|
/** 初始化 modeler */
|
||||||
@@ -63,7 +64,7 @@ const save = async (bpmnXml: string) => {
|
|||||||
emit('success', bpmnXml);
|
emit('success', bpmnXml);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('保存失败:', error);
|
console.error('保存失败:', error);
|
||||||
// ElMessage.error('保存失败');
|
ElMessage.error('保存失败');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import {
|
|||||||
} from 'element-plus';
|
} from 'element-plus';
|
||||||
|
|
||||||
import { getForm } from '#/api/bpm/form';
|
import { getForm } from '#/api/bpm/form';
|
||||||
|
// TODO @jason:这里要迁移下么?
|
||||||
// import {
|
// import {
|
||||||
// HttpRequestSetting,
|
// HttpRequestSetting,
|
||||||
// parseFormFields,
|
// parseFormFields,
|
||||||
|
|||||||
@@ -185,6 +185,7 @@ onMounted(() => {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Page auto-content-height>
|
<Page auto-content-height>
|
||||||
|
<!-- TODO @jason:这里交互,可以做成类似 vue3 + element-plus 那个一样,滚动切换分类哈?对标钉钉、飞书哈; -->
|
||||||
<!-- 第一步,通过流程定义的列表,选择对应的流程 -->
|
<!-- 第一步,通过流程定义的列表,选择对应的流程 -->
|
||||||
<template v-if="!selectProcessDefinition">
|
<template v-if="!selectProcessDefinition">
|
||||||
<ElCard
|
<ElCard
|
||||||
|
|||||||
@@ -223,8 +223,8 @@ watch(
|
|||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
/** 初始化 */
|
/** 初始化 */
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
loading.value = true;
|
|
||||||
try {
|
try {
|
||||||
|
loading.value = true;
|
||||||
await getDetail();
|
await getDetail();
|
||||||
// 获得用户列表
|
// 获得用户列表
|
||||||
userOptions.value = await getSimpleUserList();
|
userOptions.value = await getSimpleUserList();
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, watch } from 'vue';
|
import { ref, watch } from 'vue';
|
||||||
|
|
||||||
|
// TODO @jason:这个貌似暂时还没迁移的样子?
|
||||||
// import { MyProcessViewer } from '#/views/bpm/components/bpmn-process-designer/package';
|
// import { MyProcessViewer } from '#/views/bpm/components/bpmn-process-designer/package';
|
||||||
|
|
||||||
defineOptions({ name: 'ProcessInstanceBpmnViewer' });
|
defineOptions({ name: 'ProcessInstanceBpmnViewer' });
|
||||||
|
|||||||
@@ -275,6 +275,7 @@ async function openPopover(type: string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Object.keys(popOverVisible.value).forEach((item) => {
|
Object.keys(popOverVisible.value).forEach((item) => {
|
||||||
|
// TODO @jason:这里是不是保持和 antd 一致?
|
||||||
popOverVisible.value[item] = item === type;
|
popOverVisible.value[item] = item === type;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -704,6 +705,8 @@ function handleSignFinish(url: string) {
|
|||||||
approveFormRef.value?.validateField('signPicUrl');
|
approveFormRef.value?.validateField('signPicUrl');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO @jason:handlePopoverVisible 需要要有么?
|
||||||
|
|
||||||
defineExpose({ loadTodoTask });
|
defineExpose({ loadTodoTask });
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
@@ -725,9 +728,9 @@ defineExpose({ loadTodoTask });
|
|||||||
<template #reference>
|
<template #reference>
|
||||||
<ElButton plain type="primary" @click="openPopover('approve')">
|
<ElButton plain type="primary" @click="openPopover('approve')">
|
||||||
<IconifyIcon icon="lucide:check" />
|
<IconifyIcon icon="lucide:check" />
|
||||||
<span class="ml-1">{{
|
<span class="ml-1">
|
||||||
getButtonDisplayName(BpmTaskOperationButtonTypeEnum.APPROVE)
|
{{ getButtonDisplayName(BpmTaskOperationButtonTypeEnum.APPROVE) }}
|
||||||
}}</span>
|
</span>
|
||||||
</ElButton>
|
</ElButton>
|
||||||
</template>
|
</template>
|
||||||
<!-- 办理表单 -->
|
<!-- 办理表单 -->
|
||||||
@@ -979,6 +982,7 @@ defineExpose({ loadTodoTask });
|
|||||||
label-width="100px"
|
label-width="100px"
|
||||||
>
|
>
|
||||||
<ElFormItem label="新审批人" prop="assigneeUserId">
|
<ElFormItem label="新审批人" prop="assigneeUserId">
|
||||||
|
<!-- TODO @jason:是不是用 unocss 哈?antd 和 ele 都要改下 -->
|
||||||
<ElSelect
|
<ElSelect
|
||||||
v-model="transferForm.assigneeUserId"
|
v-model="transferForm.assigneeUserId"
|
||||||
clearable
|
clearable
|
||||||
@@ -1040,9 +1044,11 @@ defineExpose({ loadTodoTask });
|
|||||||
<template #reference>
|
<template #reference>
|
||||||
<ElButton plain @click="openPopover('delegate')">
|
<ElButton plain @click="openPopover('delegate')">
|
||||||
<IconifyIcon :size="14" icon="icon-park-outline:user-positioning" />
|
<IconifyIcon :size="14" icon="icon-park-outline:user-positioning" />
|
||||||
<span class="ml-1">{{
|
<span class="ml-1">
|
||||||
getButtonDisplayName(BpmTaskOperationButtonTypeEnum.DELEGATE)
|
{{
|
||||||
}}</span>
|
getButtonDisplayName(BpmTaskOperationButtonTypeEnum.DELEGATE)
|
||||||
|
}}
|
||||||
|
</span>
|
||||||
</ElButton>
|
</ElButton>
|
||||||
</template>
|
</template>
|
||||||
<div class="flex flex-1 flex-col px-5 pt-5" v-loading="formLoading">
|
<div class="flex flex-1 flex-col px-5 pt-5" v-loading="formLoading">
|
||||||
@@ -1116,9 +1122,11 @@ defineExpose({ loadTodoTask });
|
|||||||
<template #reference>
|
<template #reference>
|
||||||
<ElButton plain @click="openPopover('addSign')">
|
<ElButton plain @click="openPopover('addSign')">
|
||||||
<IconifyIcon :size="14" icon="icon-park-outline:plus" />
|
<IconifyIcon :size="14" icon="icon-park-outline:plus" />
|
||||||
<span class="ml-1">{{
|
<span class="ml-1">
|
||||||
getButtonDisplayName(BpmTaskOperationButtonTypeEnum.ADD_SIGN)
|
{{
|
||||||
}}</span>
|
getButtonDisplayName(BpmTaskOperationButtonTypeEnum.ADD_SIGN)
|
||||||
|
}}
|
||||||
|
</span>
|
||||||
</ElButton>
|
</ElButton>
|
||||||
</template>
|
</template>
|
||||||
<div class="flex flex-1 flex-col px-5 pt-5" v-loading="formLoading">
|
<div class="flex flex-1 flex-col px-5 pt-5" v-loading="formLoading">
|
||||||
@@ -1272,9 +1280,9 @@ defineExpose({ loadTodoTask });
|
|||||||
<template #reference>
|
<template #reference>
|
||||||
<ElButton plain @click="openPopover('return')">
|
<ElButton plain @click="openPopover('return')">
|
||||||
<IconifyIcon :size="14" icon="lucide:arrow-left" />
|
<IconifyIcon :size="14" icon="lucide:arrow-left" />
|
||||||
<span class="ml-1">{{
|
<span class="ml-1">
|
||||||
getButtonDisplayName(BpmTaskOperationButtonTypeEnum.RETURN)
|
{{ getButtonDisplayName(BpmTaskOperationButtonTypeEnum.RETURN) }}
|
||||||
}}</span>
|
</span>
|
||||||
</ElButton>
|
</ElButton>
|
||||||
</template>
|
</template>
|
||||||
<div class="flex flex-1 flex-col px-5 pt-5" v-loading="formLoading">
|
<div class="flex flex-1 flex-col px-5 pt-5" v-loading="formLoading">
|
||||||
|
|||||||
@@ -54,7 +54,6 @@ const [Modal, modalApi] = useVbenModal({
|
|||||||
</ElButton>
|
</ElButton>
|
||||||
</ElTooltip>
|
</ElTooltip>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Vue3Signature
|
<Vue3Signature
|
||||||
class="h-full flex-1 border border-solid border-gray-300"
|
class="h-full flex-1 border border-solid border-gray-300"
|
||||||
ref="signature"
|
ref="signature"
|
||||||
|
|||||||
@@ -86,6 +86,8 @@ function useGridColumns(): VxeTableGridOptions['columns'] {
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO @jason:是不是要 const formRef = ref<formCreate>();
|
||||||
|
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
const taskForm = ref<TaskForm>({
|
const taskForm = ref<TaskForm>({
|
||||||
rule: [],
|
rule: [],
|
||||||
@@ -187,6 +189,7 @@ defineExpose({
|
|||||||
</Grid>
|
</Grid>
|
||||||
</div>
|
</div>
|
||||||
<Modal class="w-3/5">
|
<Modal class="w-3/5">
|
||||||
|
<!-- TODO @jason:是不是 antd 和 ele 保持统一? -->
|
||||||
<FormCreate
|
<FormCreate
|
||||||
ref="formRef"
|
ref="formRef"
|
||||||
v-model="taskForm.value"
|
v-model="taskForm.value"
|
||||||
|
|||||||
Reference in New Issue
Block a user