feat: Optimize the interface when there are too many interface parameters.(#2795)

* perf: Optimization drag sorting condition nodes

* feat: Optimize the interface when there are too many interface parameters.(#2795)
This commit is contained in:
wangdan-fit2cloud 2025-04-08 15:10:53 +08:00 committed by GitHub
parent 919a3eee5d
commit 2d6d16e046
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 42 additions and 6 deletions

1
ui/src/assets/sort.svg Normal file
View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1744092984968" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1250" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M384 768a64 64 0 1 0 0 128 64 64 0 0 0 0-128z m0-320a64 64 0 1 0 0 128 64 64 0 0 0 0-128z m0-320a64 64 0 1 0 0 128 64 64 0 0 0 0-128z m256 640a64 64 0 1 0 0 128 64 64 0 0 0 0-128z m0-320a64 64 0 1 0 0 128 64 64 0 0 0 0-128z m0-320a64 64 0 1 0 0 128 64 64 0 0 0 0-128z" p-id="1251"></path></svg>

After

Width:  |  Height:  |  Size: 627 B

View File

@ -15,8 +15,20 @@
ref="tableRef"
row-key="field"
>
<el-table-column prop="variable" :label="$t('dynamicsForm.paramForm.field.label')" />
<el-table-column prop="default_value" :label="$t('dynamicsForm.default.label')" />
<el-table-column prop="variable" :label="$t('dynamicsForm.paramForm.field.label')">
<template #default="{ row }">
<span class="ellipsis-1" :title="row.variable">
{{ row.variable }}
</span>
</template>
</el-table-column>
<el-table-column prop="default_value" :label="$t('dynamicsForm.default.label')">
<template #default="{ row }">
<span class="ellipsis-1" :title="row.default_value">
{{ row.default_value }}
</span>
</template>
</el-table-column>
<el-table-column :label="$t('common.required')">
<template #default="{ row }">
<div @click.stop>

View File

@ -22,12 +22,15 @@
<el-card
v-resize="(wh: any) => resizeCondition(wh, item, index)"
shadow="never"
class="card-never mb-8"
class="drag-card card-never mb-8"
:class="{ 'no-drag': index === form_data.branch.length - 1 }"
style="--el-card-padding: 12px"
>
<div class="handle flex-between lighter">
{{ item.type }}
<span class="flex align-center">
<img src="@/assets/sort.svg" alt="" height="15" class="handle-img mr-4" />
{{ item.type }}
</span>
<div class="info" v-if="item.conditions.length > 1">
<span>{{
$t('views.applicationWorkflow.nodes.conditionNode.conditions.info')
@ -337,4 +340,24 @@ onMounted(() => {
set(props.nodeModel, 'validate', validate)
})
</script>
<style lang="scss" scoped></style>
<style lang="scss" scoped>
.drag-card.no-drag {
.handle {
.handle-img {
display: none;
}
}
}
.drag-card:not(.no-drag) {
.handle {
.handle-img {
display: none;
}
&:hover {
.handle-img {
display: block;
}
}
}
}
</style>

View File

@ -8,7 +8,7 @@
@mouseenter="showicon = true"
@mouseleave="showicon = false"
>
<span>{{ item.label }} {{ '{' + item.value + '}' }}</span>
<span class="break-all">{{ item.label }} {{ '{' + item.value + '}' }}</span>
<el-tooltip
effect="dark"
:content="$t('views.applicationWorkflow.setting.copyParam')"