Skip to content

Commit 7f7e780

Browse files
authored
fix:saas模式下,里程碑颜色匹配逻辑 (#3568)
1 parent 266c96c commit 7f7e780

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

packages/design/saas/src/milestone/index.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff 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 }) => {

packages/renderless/src/search/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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)

0 commit comments

Comments
 (0)