fix: 修复过滤组件不同状态初始化 位置设置不生效 以及下拉框和下拉树 多选时tag 标签样式不生效问题

This commit is contained in:
dataeaseShu 2022-07-01 18:22:51 +08:00
parent 06e6297109
commit 7105c6a405
4 changed files with 44 additions and 6 deletions

View File

@ -1,7 +1,7 @@
import { sin, cos } from '@/components/canvas/utils/translate' import { sin, cos } from '@/components/canvas/utils/translate'
import store from '@/store' import store from '@/store'
import { colorReverse } from '@/components/canvas/utils/utils' import { colorReverse } from '@/components/canvas/utils/utils'
import Vue from 'vue'
export const LIGHT_THEME_COLOR_MAIN = '#000000' export const LIGHT_THEME_COLOR_MAIN = '#000000'
export const LIGHT_THEME_COLOR_SLAVE1 = '#CCCCCC' export const LIGHT_THEME_COLOR_SLAVE1 = '#CCCCCC'
export const LIGHT_THEME_PANEL_BACKGROUND = '#F1F3F5' export const LIGHT_THEME_PANEL_BACKGROUND = '#F1F3F5'
@ -352,7 +352,7 @@ export function adaptCurThemeCommonStyle(component) {
if (isFilterComponent(component.component)) { if (isFilterComponent(component.component)) {
const filterStyle = store.state.canvasStyleData.chartInfo.filterStyle const filterStyle = store.state.canvasStyleData.chartInfo.filterStyle
for (const styleKey in filterStyle) { for (const styleKey in filterStyle) {
component.style[styleKey] = filterStyle[styleKey] Vue.set(component.style, styleKey, filterStyle[styleKey])
} }
} else { } else {
if (component.style.color) { if (component.style.color) {

View File

@ -231,6 +231,12 @@ export default {
}, },
visualChange(value) { visualChange(value) {
this.value = value this.value = value
this.$nextTick(() => {
if (!this.element.options.attrs.multiple) {
return
}
this.handleElTagStyle()
})
}, },
changeValue(value) { changeValue(value) {
if (!this.inDraw) { if (!this.inDraw) {

View File

@ -16,7 +16,7 @@
@check="changeCheckNode" @check="changeCheckNode"
@select-clear="selectClear" @select-clear="selectClear"
@onFoucs="onFoucs" @onFoucs="onFoucs"
@treeCheckChange="change" @treeCheckChange="handleElTagStyle"
/> />
</template> </template>
@ -221,7 +221,7 @@ export default {
this.handleCoustomStyle() this.handleCoustomStyle()
}) })
}, },
change() { handleElTagStyle() {
setTimeout(() => { setTimeout(() => {
textSelectWidget(this.$refs.deSelectTree.$refs.select.$el, this.element.style) textSelectWidget(this.$refs.deSelectTree.$refs.select.$el, this.element.style)
}, 50) }, 50)
@ -383,7 +383,20 @@ export default {
.el-tree { .el-tree {
background: var(--BgSelectTreeColor, #FFFFFF) !important; background: var(--BgSelectTreeColor, #FFFFFF) !important;
color: var(--SelectTreeColor, #606266) !important; color: var(--SelectTreeColor, #606266) !important;
.el-tree-node.is-current {
background-color: rgb(245, 247, 250, .5) !important;
} }
.el-tree-node:focus>.el-tree-node__content {
background-color: rgb(245, 247, 250, .5) !important;
}
.el-tree-node__content:hover {
background-color: rgb(245, 247, 250, .5) !important;
}
}
.el-input-group--append { .el-input-group--append {
.el-input__inner { .el-input__inner {

View File

@ -16,6 +16,25 @@ export default {
} }
} }
}, },
watch: {
cssArr: {
handler() {
if (['de-select', 'de-select-tree'].includes(this.element.component)) {
if (!this.element.options.attrs.multiple) {
return
}
this.handleElTagStyle()
};
},
deep: true
},
},
computed: {
cssArr() {
const { brColor, wordColor, innerBgColor } = this.element.style;
return { brColor, wordColor, innerBgColor }
}
},
mounted() { mounted() {
this.handleCoustomStyle() this.handleCoustomStyle()
}, },