-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Pr@main/feat workflow api field #2821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Your code has several minor issues and suggestions for improvement:
Here's a revised version of your component: <template>
<el-card
v-resize="(wh: any) => resizeCondition(wh, item, index)"
shadow="never"
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">
<span class="flex-align-center">
<img src="@/assets/sort.svg" alt="" height="15" :class="{ 'mr-4': !index === form_data.branch.length - 1 }" />
{{ item.type }}
</span>
<div class="info" v-if="item.conditions.length > 1">
<!-- Your condition info content here -->
</div>
</div>
</el-card>
</template>
<script setup lang="ts">
// Import necessary components and define props if needed
const { form_data, item_model } = defineProps<{
form_data: object;
item_model: object;
}>()
onMounted(() => {
set(item_model, 'validate', validate);
});
</script>
<style scoped lang="scss">
.drag-card.no-drag {
.handle {
img.handle-img {
// No need for separate styling since it doesn't change anyway
}
}
}
.drag-card:not(.no-drag) {
.handle {
img.handle-img {
&:hover {
display: block;
}
}
}
}
</style>Key Changes Made:
These changes ensure cleaner and more maintainable code while addressing some of the identified issues. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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')" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The provided code has two main areas for improvement:
Here's the cleaned-up version with minor adjustments: <span v-if="item.label" class="break-all">
<span>{{ item.label }}
{{ '{' + item.value + '}' }}
</span>
<el-tooltip effect="dark" :content="$t('views.applicationWorkflow.setting.copyParam')" placement="right-start"></el-tooltip>Ensure proper HTML structure integrity and test the changes in various environments to confirm they meet functionality requirements. |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No significant irregularities or obvious optimizations were found in the provided code snippet. It appears to correctly format an
el-tablecolumn with ellipsis truncation for both 'variable' and 'default_value'. Additionally, the template is structured slightly differently but serves similar functionality. If this changes the behavior of your table (e.g., causing performance issues), you might need further testing on specific data sets. Otherwise, no adjustments seem necessary.