File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed
design/saas/src/milestone Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -2,16 +2,16 @@ export default {
22 renderless : ( props , hooks , { constants } , api ) => {
33 return {
44 getMileIcon : ( node ) => {
5- const status = node [ props . statusField ]
6- const statusColor = props . milestonesStatus [ status ]
7- const isCompleted = status === constants . STATUS_COMPLETED
5+ const status = props . milestonesStatus [ node [ props . statusField ] ] || constants . DEFAULT_COLOR
86
9- if ( statusColor ) {
10- return {
11- background : props . solid ? statusColor : '' ,
12- color : props . solid && ! isCompleted ? '#ffffff' : statusColor ,
13- 'border-color' : statusColor
14- }
7+ const isCompleted = node [ props . statusField ] === props . completedField
8+ const switchColor = isCompleted && ! props . solid
9+ const { r, g, b } = api . hexToRgb ( status )
10+
11+ return {
12+ background : ( switchColor ? constants . DEFAULT_BACK_COLOR : status ) + '!important' ,
13+ color : ( switchColor ? status : constants . DEFAULT_BACK_COLOR ) + '!important' ,
14+ boxShadow : `rgba(${ r } ,${ g } ,${ b } ,.4) ${ constants . BOX_SHADOW_PX } `
1515 }
1616 } ,
1717 getFlagStyle : ( { index, idx } ) => {
Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ export const clickOutside =
7979 // 优先使用 event.composedPath() 来判断事件源是否在组件内部,以兼容 Shadow DOM。
8080 // 在 Shadow DOM 中,事件冒泡穿过 Shadow Root 后,event.target 会被重定向为 host 元素,
8181 // 导致传统的 contains 判断失效。composedPath 则能提供真实的事件路径。
82- const path = event . composedPath && event . composedPath ( )
82+ const path = event ? .composedPath && event . composedPath ( )
8383 if ( path ? ! path . includes ( parent . $el ) : ! parent . $el . contains ( event . target ) ) {
8484 state . show = false
8585 props . mini && ! state . currentValue && ( state . collapse = true )
You can’t perform that action at this time.
0 commit comments