Skip to content

Commit

Permalink
fix: 分组拖拽组件修改未考虑到公共步骤引用的特殊性,禁用公共步骤编辑时拖拽子步骤离开夫步骤
Browse files Browse the repository at this point in the history
  • Loading branch information
YeungHoiChiu committed Aug 8, 2024
1 parent 464f600 commit b0b3b02
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/components/PublicStepUpdate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ const jump = (id) => {
<el-tab-pane :label="$t('pubSteps.selected')" name="select">
<step-draggable
:is-edit="true"
:is-public-steps="true"
:steps="publicStep.steps"
@set-parent="setParent"
@add-step="addStep"
Expand Down
6 changes: 5 additions & 1 deletion src/components/StepDraggable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ const props = defineProps({
type: Boolean,
default: false,
},
isPublicSteps: {
type: Boolean,
default: false, // 公共步骤可能会引用多个不同case的步骤,不应该允许拖拽更改parentId
},
parentId: Number, // 用于分组拖拽时,更新step数据的parentId
});
const emit = defineEmits([
Expand Down Expand Up @@ -163,7 +167,7 @@ const addStepTotarget = (id, toNext) => {
<VueDraggableNext
tag="div"
:list="steps"
group="case-step"
:group="isPublicSteps ? '' : 'case-step'"
handle=".handle"
animation="200"
force-fallback="true"
Expand Down

0 comments on commit b0b3b02

Please sign in to comment.