Skip to content

Commit c61e823

Browse files
perf: workflow search style
1 parent c098e0f commit c61e823

File tree

5 files changed

+44
-18
lines changed

5 files changed

+44
-18
lines changed

ui/src/locales/lang/en-US/workflow.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export default {
4040
copyError: 'Node already copied',
4141
paramErrorMessage: 'Parameter already exists: ',
4242
saveMessage: 'Current changes have not been saved. Save before exiting?',
43+
searchPlaceholder: 'Please enter node name',
4344
},
4445
delete: {
4546
confirmTitle: 'Confirm to delete this node?',

ui/src/locales/lang/zh-CN/workflow.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export default {
3939
copyError: '已复制节点',
4040
paramErrorMessage: '参数已存在: ',
4141
saveMessage: '当前的更改尚未保存,是否保存后退出?',
42+
searchPlaceholder: '请输入节点名称'
4243
},
4344
delete: {
4445
confirmTitle: '确定删除该节点?',

ui/src/locales/lang/zh-Hant/workflow.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export default {
3939
copyError: '已複製節點',
4040
paramErrorMessage: '參數已存在: ',
4141
saveMessage: '當前修改未保存,是否保存後退出?',
42+
searchPlaceholder: '請輸入節點名稱',
4243
},
4344
delete: {
4445
confirmTitle: '確定刪除該節點?',
@@ -523,5 +524,5 @@ export default {
523524
SystemPromptPlaceholder: '系統提示詞,可以引用系統中的變量:如',
524525
UserPromptPlaceholder: '用戶提示詞,可以引用系統中的變量:如',
525526
initiator: '發起人',
526-
abnormalInformation: '異常信息'
527+
abnormalInformation: '異常信息',
527528
}

ui/src/workflow/common/NodeSearch.vue

Lines changed: 40 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,48 +2,61 @@
22
<div>
33
<!-- 搜索 -->
44
<el-card
5+
class="workflow-search"
56
v-if="showSearch"
67
shadow="always"
78
style="--el-card-padding: 8px 12px; --el-card-border-radius: 8px"
89
>
9-
<div class="workflow-search-container">
10+
<div class="workflow-search-container flex-between">
1011
<el-input
1112
ref="searchInputRef"
1213
v-model="searchText"
13-
placeholder="搜索..."
14-
:prefix-icon="Search"
14+
:placeholder="$t('workflow.tip.searchPlaceholder')"
1515
clearable
1616
@keyup.enter="handleSearch"
1717
@keyup.esc="closeSearch"
1818
>
19-
<template #append>
20-
<el-button @click="closeSearch">取消</el-button>
21-
</template>
2219
</el-input>
20+
<span>
21+
<el-space :size="4">
22+
<span class="lighter"> 2/3 </span>
23+
<el-divider direction="vertical" />
24+
25+
<el-button text>
26+
<el-icon><ArrowUp /></el-icon>
27+
</el-button>
28+
<el-button text>
29+
<el-icon><ArrowDown /></el-icon>
30+
</el-button>
31+
<el-button text @click="closeSearch()">
32+
<el-icon><Close /></el-icon>
33+
</el-button>
34+
</el-space>
35+
</span>
2336
</div>
2437
</el-card>
38+
<!-- 开启搜索按钮 -->
39+
<!-- <el-button v-else @click="openSearch()" circle class="workflow-search-button" size="large">
40+
<el-icon :size="20"><Search /></el-icon>
41+
</el-button> -->
2542
</div>
2643
</template>
2744

2845
<script setup lang="ts">
2946
import { ref, onMounted, onUnmounted, nextTick } from 'vue'
30-
import { Search } from '@element-plus/icons-vue'
3147
3248
// Props定义
3349
interface Props {
3450
onSearch?: (keyword: string) => void // 搜索回调
3551
}
36-
3752
const props = withDefaults(defineProps<Props>(), {
38-
useElementPlus: false,
3953
onSearch: undefined,
4054
})
4155
4256
// 状态
4357
const showSearch = ref(false)
4458
const searchText = ref('')
4559
const searchInputRef = ref<any>(null)
46-
const nativeInputRef = ref<HTMLInputElement | null>(null)
4760
4861
// 快捷键处理
4962
const handleKeyDown = (e: KeyboardEvent) => {
@@ -93,7 +106,24 @@ onUnmounted(() => {
93106
</script>
94107

95108
<style scoped>
109+
.workflow-search-button {
110+
position: absolute;
111+
top: 72px;
112+
left: 24px;
113+
z-index: 2;
114+
}
115+
.workflow-search {
116+
position: absolute;
117+
top: 72px;
118+
left: 50%;
119+
transform: translateX(-50%);
120+
z-index: 2;
121+
}
96122
.workflow-search-container {
97123
width: 360px;
124+
:deep(.el-input__wrapper) {
125+
box-shadow: none;
126+
padding: 0 8px 0 1px!important;
127+
}
98128
}
99129
</style>

ui/src/workflow/index.vue

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -232,13 +232,6 @@ defineExpose({
232232
left: 24px;
233233
z-index: 2;
234234
}
235-
.workflow-search {
236-
position: absolute;
237-
top: 72px;
238-
left: 50%;
239-
transform: translateX(-50%);
240-
z-index: 2;
241-
}
242235
.lf-drag-able {
243236
cursor: pointer;
244237
}

0 commit comments

Comments
 (0)