11<template >
22 <div v-show =" show" class =" workflow-dropdown-menu border border-r-6" >
33 <el-tabs v-model =" activeName" class =" workflow-dropdown-tabs" >
4- <div style =" display : flex ; width : 100% ; justify-content : center " class =" mb-4" >
5- <el-input
6- v-model =" search_text"
7- style =" width : 240px "
8- :placeholder =" $t('views.applicationWorkflow.searchBar.placeholder')"
9- >
4+ <div style =" display : flex ; width : 100% ; justify-content : center ;" class =" mb-12" >
5+ <el-input v-model =" search_text" class =" mr-12 ml-12"
6+ :placeholder =" $t('views.applicationWorkflow.searchBar.placeholder')" >
107 <template #suffix >
118 <el-icon class =" el-input__icon" ><search /></el-icon >
129 </template >
1613 <el-tab-pane :label =" $t('views.applicationWorkflow.baseComponent')" name =" base" >
1714 <el-scrollbar height =" 400" >
1815 <div v-if =" filter_menu_nodes.length > 0" >
19- <template v-for =" (item , index ) in filter_menu_nodes " :key =" index " >
20- <div
21- class =" workflow-dropdown-item cursor flex p-8-12"
22- @click.stop =" clickNodes(item)"
23- @mousedown.stop =" onmousedown(item)"
24- >
25- <component :is =" iconComponent(`${item.type}-icon`)" class =" mr-8 mt-4" :size =" 32" />
26- <div class =" pre-wrap" >
27- <div class =" lighter" >{{ item.label }}</div >
28- <el-text type =" info" size =" small" >{{ item.text }}</el-text >
29- </div >
16+ <template v-for =" (node , index ) in filter_menu_nodes " :key =" index " >
17+ <el-text type =" info" size =" small" class =" color-secondary ml-12" >{{ node.label }}</el-text >
18+ <div class =" flex-wrap mt-8" >
19+ <template v-for =" (item , index ) in node .list " :key =" index " >
20+ <el-popover placement =" right" :width =" 280" >
21+ <template #reference >
22+ <div class =" flex align-center border border-r-6 mb-12 p-8-12 cursor ml-12" style =" width : 39% ; " @click.stop =" clickNodes(item)"
23+ @mousedown.stop =" onmousedown(item)" >
24+ <component :is =" iconComponent(`${item.type}-icon`)" class =" mr-8" :size =" 32" />
25+ <div class =" lighter" >{{ item.label }}</div >
26+ </div >
27+ </template >
28+ <template #default >
29+ <div class =" flex align-center mb-8" >
30+ <component :is =" iconComponent(`${item.type}-icon`)" class =" mr-8" :size =" 32" />
31+ <div class =" lighter color-text-primary" >{{ item.label }}</div >
32+ </div >
33+ <el-text type =" info" size =" small" class =" color-secondary lighter" >{{ item.text }}</el-text >
34+ </template >
35+ </el-popover >
36+ </template >
3037 </div >
3138 </template >
3239 </div >
@@ -167,10 +174,21 @@ const filter_application_list = computed(() => {
167174})
168175
169176const filter_menu_nodes = computed (() => {
170- return menuNodes .filter ((item ) =>
171- item .label .toLocaleLowerCase ().includes (search_text .value .toLocaleLowerCase ()),
172- )
173- })
177+ if (! search_text .value ) return menuNodes ;
178+ const searchTerm = search_text .value .toLowerCase ();
179+
180+ return menuNodes .reduce ((result , item ) => {
181+ const filteredList = item .list .filter (listItem =>
182+ listItem .label .toLowerCase ().includes (searchTerm )
183+ );
184+
185+ if (filteredList .length ) {
186+ result .push ({ ... item , list: filteredList });
187+ }
188+
189+ return result ;
190+ }, []);
191+ });
174192function clickNodes(item : any , data ? : any , type ? : string ) {
175193 if (data ) {
176194 item [' properties' ][' stepName' ] = data .name
@@ -197,10 +215,10 @@ function clickNodes(item: any, data?: any, type?: string) {
197215 ... (! fileUploadSetting
198216 ? {}
199217 : {
200- ... (fileUploadSetting .document ? { document_list: [] } : {}),
201- ... (fileUploadSetting .image ? { image_list: [] } : {}),
202- ... (fileUploadSetting .audio ? { audio_list: [] } : {}),
203- }),
218+ ... (fileUploadSetting .document ? { document_list: [] } : {}),
219+ ... (fileUploadSetting .image ? { image_list: [] } : {}),
220+ ... (fileUploadSetting .audio ? { audio_list: [] } : {}),
221+ }),
204222 }
205223 } else {
206224 item [' properties' ][' node_data' ] = {
@@ -242,10 +260,10 @@ function onmousedown(item: any, data?: any, type?: string) {
242260 ... (! fileUploadSetting
243261 ? {}
244262 : {
245- ... (fileUploadSetting .document ? { document_list: [] } : {}),
246- ... (fileUploadSetting .image ? { image_list: [] } : {}),
247- ... (fileUploadSetting .audio ? { audio_list: [] } : {}),
248- }),
263+ ... (fileUploadSetting .document ? { document_list: [] } : {}),
264+ ... (fileUploadSetting .image ? { image_list: [] } : {}),
265+ ... (fileUploadSetting .audio ? { audio_list: [] } : {}),
266+ }),
249267 }
250268 } else {
251269 item [' properties' ][' node_data' ] = {
@@ -285,7 +303,7 @@ onMounted(() => {
285303 top : 49px ;
286304 right : 122px ;
287305 z-index : 99 ;
288- width : 268 px ;
306+ width : 400 px ;
289307 box-shadow : 0px 4px 8px 0px var (--app-text-color-light-1 );
290308 background : #ffffff ;
291309 padding-bottom : 8px ;
0 commit comments