Merge pull request #8421 from dataease/pr@dev_placeholder_color
fix(过滤组件): 过滤组件提示文字颜色支持调整 #7650
This commit is contained in:
commit
968342db31
@ -172,6 +172,7 @@ export default {
|
||||
watch: {
|
||||
'element.style': {
|
||||
handler(val) {
|
||||
this.setPlaceholderColor()
|
||||
this.handlerPositionChange(val)
|
||||
},
|
||||
deep: true,
|
||||
@ -186,6 +187,7 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.setPlaceholderColor()
|
||||
},
|
||||
created() {
|
||||
const { horizontal, vertical, brColor, wordColor, innerBgColor } = this.element.style
|
||||
@ -196,6 +198,15 @@ export default {
|
||||
this.$set(this.element.style, 'innerBgColor', innerBgColor || '')
|
||||
},
|
||||
methods: {
|
||||
setPlaceholderColor() {
|
||||
let styleEle = document.querySelector(`#style${this.element.id}`)
|
||||
if (!styleEle) {
|
||||
styleEle = document.createElement('style')
|
||||
styleEle.id = `style${this.element.id}`
|
||||
document.querySelector('head').appendChild(styleEle)
|
||||
}
|
||||
styleEle.innerHTML = `#component${this.element.id} .el-input__inner::placeholder {\n color: ${this.element.style.wordColor} \n }`
|
||||
},
|
||||
filterLoaded(p) {
|
||||
this.$emit('filter-loaded', p)
|
||||
},
|
||||
|
||||
@ -327,6 +327,7 @@ export default {
|
||||
this.fileList.push({ url: imgUrlTrans(this.curComponent.commonBackground.outerImage) })
|
||||
}
|
||||
this.backgroundOrigin = deepCopy(this.curComponent.commonBackground ? this.curComponent.commonBackground : COMMON_BACKGROUND_NONE)
|
||||
this.backgroundOrigin.style = deepCopy(this.curComponent.style || { brColor: '', innerBgColor: '', wordColor: ''})
|
||||
this.queryBackground()
|
||||
},
|
||||
queryBackground() {
|
||||
@ -343,6 +344,10 @@ export default {
|
||||
this.curComponent.commonBackground.alpha = this.backgroundOrigin.alpha
|
||||
this.curComponent.commonBackground.borderRadius = this.backgroundOrigin.borderRadius
|
||||
this.curComponent.commonBackground.innerPadding = this.backgroundOrigin.innerPadding
|
||||
this.curComponent.style.brColor = this.backgroundOrigin.style.brColor
|
||||
this.curComponent.style.innerBgColor = this.backgroundOrigin.style.innerBgColor
|
||||
this.curComponent.style.wordColor = this.backgroundOrigin.style.wordColor
|
||||
console.log('backgroundSetClose');
|
||||
this.$emit('backgroundSetClose')
|
||||
},
|
||||
save() {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user