fix:saas模式下,里程碑颜色匹配逻辑 (#3568)
This commit is contained in:
parent
266c96c46c
commit
7f7e780573
|
@ -2,16 +2,16 @@ export default {
|
||||||
renderless: (props, hooks, { constants }, api) => {
|
renderless: (props, hooks, { constants }, api) => {
|
||||||
return {
|
return {
|
||||||
getMileIcon: (node) => {
|
getMileIcon: (node) => {
|
||||||
const status = node[props.statusField]
|
const status = props.milestonesStatus[node[props.statusField]] || constants.DEFAULT_COLOR
|
||||||
const statusColor = props.milestonesStatus[status]
|
|
||||||
const isCompleted = status === constants.STATUS_COMPLETED
|
|
||||||
|
|
||||||
if (statusColor) {
|
const isCompleted = node[props.statusField] === props.completedField
|
||||||
return {
|
const switchColor = isCompleted && !props.solid
|
||||||
background: props.solid ? statusColor : '',
|
const { r, g, b } = api.hexToRgb(status)
|
||||||
color: props.solid && !isCompleted ? '#ffffff' : statusColor,
|
|
||||||
'border-color': statusColor
|
return {
|
||||||
}
|
background: (switchColor ? constants.DEFAULT_BACK_COLOR : status) + '!important',
|
||||||
|
color: (switchColor ? status : constants.DEFAULT_BACK_COLOR) + '!important',
|
||||||
|
boxShadow: `rgba(${r},${g},${b},.4) ${constants.BOX_SHADOW_PX}`
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getFlagStyle: ({ index, idx }) => {
|
getFlagStyle: ({ index, idx }) => {
|
||||||
|
|
|
@ -79,7 +79,7 @@ export const clickOutside =
|
||||||
// 优先使用 event.composedPath() 来判断事件源是否在组件内部,以兼容 Shadow DOM。
|
// 优先使用 event.composedPath() 来判断事件源是否在组件内部,以兼容 Shadow DOM。
|
||||||
// 在 Shadow DOM 中,事件冒泡穿过 Shadow Root 后,event.target 会被重定向为 host 元素,
|
// 在 Shadow DOM 中,事件冒泡穿过 Shadow Root 后,event.target 会被重定向为 host 元素,
|
||||||
// 导致传统的 contains 判断失效。composedPath 则能提供真实的事件路径。
|
// 导致传统的 contains 判断失效。composedPath 则能提供真实的事件路径。
|
||||||
const path = event.composedPath && event.composedPath()
|
const path = event?.composedPath && event.composedPath()
|
||||||
if (path ? !path.includes(parent.$el) : !parent.$el.contains(event.target)) {
|
if (path ? !path.includes(parent.$el) : !parent.$el.contains(event.target)) {
|
||||||
state.show = false
|
state.show = false
|
||||||
props.mini && !state.currentValue && (state.collapse = true)
|
props.mini && !state.currentValue && (state.collapse = true)
|
||||||
|
|
Loading…
Reference in New Issue