Skip to content

Commit cdf2b21

Browse files
calvinjiangzhuangchong
authored andcommitted
improve the select component on the page of workflow relation (#13805)
1 parent 99da77a commit cdf2b21

File tree

1 file changed

+11
-3
lines changed
  • dolphinscheduler-ui/src/views/projects/workflow/relation

1 file changed

+11
-3
lines changed

Diff for: dolphinscheduler-ui/src/views/projects/workflow/relation/index.tsx

+11-3
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
* limitations under the License.
1616
*/
1717

18-
import { defineComponent, onMounted, toRefs, watch } from 'vue'
18+
import { defineComponent, onMounted, toRefs, watch, VNode, h } from 'vue'
1919
import { useI18n } from 'vue-i18n'
2020
import { useRoute } from 'vue-router'
21-
import { NSelect, NButton, NIcon, NSpace, NTooltip } from 'naive-ui'
21+
import { NSelect, NButton, NIcon, NSpace, NTooltip, SelectOption } from 'naive-ui'
2222
import { ReloadOutlined, EyeOutlined } from '@vicons/antd'
2323
import { useRelation } from './use-relation'
2424
import Card from '@/components/card'
@@ -48,14 +48,20 @@ const workflowRelation = defineComponent({
4848
: getWorkflowList(Number(route.params.projectCode))
4949
}
5050

51+
const renderOption = ({ node, option }: { node: VNode; option: SelectOption }) =>
52+
h(NTooltip, null, {
53+
trigger: () => node,
54+
default: () => option.label
55+
})
56+
5157
watch(
5258
() => [variables.workflow, variables.labelShow, locale.value],
5359
() => {
5460
handleResetDate()
5561
}
5662
)
5763

58-
return { t, handleResetDate, ...toRefs(variables) }
64+
return { t, handleResetDate, ...toRefs(variables), renderOption }
5965
},
6066
render() {
6167
const { t, handleResetDate } = this
@@ -86,10 +92,12 @@ const workflowRelation = defineComponent({
8692
<NSpace>
8793
<NSelect
8894
clearable
95+
filterable
8996
style={{ width: '300px' }}
9097
placeholder={t('project.workflow.workflow_name')}
9198
options={this.workflowOptions}
9299
v-model={[this.workflow, 'value']}
100+
renderOption={this.renderOption}
93101
/>
94102
<NTooltip trigger={'hover'}>
95103
{{

0 commit comments

Comments
 (0)