Skip to content

Commit 612d850

Browse files
committed
[Feature][Workflow relationship] Format name.
1 parent 3304ede commit 612d850

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

  • dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/kinship/_source

dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/kinship/_source/graphGridOption.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ const getCategory = (categoryDic, { workFlowPublishStatus, schedulePublishStatus
3131
}
3232
}
3333

34+
const formatName = (str) => {
35+
if (typeof str !== 'string') return ''
36+
37+
return str.slice(0, 6) + (str.length > 6 ? '\n...' : '')
38+
}
39+
3440
const publishStatusFormat = (status) => {
3541
return status === 0 || status === '0' ? i18n.$t('offline') : status === 1 || status === '1' ? i18n.$t('online') : '-'
3642
}
@@ -116,8 +122,7 @@ export default function (locations, links, sourceWorkFlowCode, isShowLabel) {
116122
position: 'inside',
117123
formatter: (params) => {
118124
if (!params.data.name) return ''
119-
const str = params.data.name.split('_').map(item => `{a|${item}\n}`).join('')
120-
return str
125+
return formatName(params.data.name)
121126
},
122127
color: '#222222',
123128
textStyle: {

0 commit comments

Comments
 (0)