Skip to content

Commit 3fe6a39

Browse files
perf: Optimization drag sorting condition nodes
1 parent 919a3ee commit 3fe6a39

File tree

2 files changed

+27
-3
lines changed

2 files changed

+27
-3
lines changed

ui/src/assets/sort.svg

Lines changed: 1 addition & 0 deletions
Loading

ui/src/workflow/nodes/condition-node/index.vue

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,15 @@
2222
<el-card
2323
v-resize="(wh: any) => resizeCondition(wh, item, index)"
2424
shadow="never"
25-
class="card-never mb-8"
25+
class="drag-card card-never mb-8"
2626
:class="{ 'no-drag': index === form_data.branch.length - 1 }"
2727
style="--el-card-padding: 12px"
2828
>
2929
<div class="handle flex-between lighter">
30-
{{ item.type }}
30+
<span class="flex align-center">
31+
<img src="@/assets/sort.svg" alt="" height="15" class="handle-img mr-4" />
32+
{{ item.type }}
33+
</span>
3134
<div class="info" v-if="item.conditions.length > 1">
3235
<span>{{
3336
$t('views.applicationWorkflow.nodes.conditionNode.conditions.info')
@@ -337,4 +340,24 @@ onMounted(() => {
337340
set(props.nodeModel, 'validate', validate)
338341
})
339342
</script>
340-
<style lang="scss" scoped></style>
343+
<style lang="scss" scoped>
344+
.drag-card.no-drag {
345+
.handle {
346+
.handle-img {
347+
display: none;
348+
}
349+
}
350+
}
351+
.drag-card:not(.no-drag) {
352+
.handle {
353+
.handle-img {
354+
display: none;
355+
}
356+
&:hover {
357+
.handle-img {
358+
display: block;
359+
}
360+
}
361+
}
362+
}
363+
</style>

0 commit comments

Comments
 (0)