Merge pull request #8421 from dataease/pr@dev_placeholder_color

fix(过滤组件): 过滤组件提示文字颜色支持调整 #7650
This commit is contained in:
dataeaseShu 2024-03-08 17:40:56 +08:00 committed by GitHub
commit 968342db31
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 16 additions and 0 deletions

View File

@ -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)
},

View File

@ -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() {