diff --git a/frontend/src/components/widget/DeWidget/DeSelectTree.vue b/frontend/src/components/widget/DeWidget/DeSelectTree.vue index 30bbf4edc9..0c73552eda 100644 --- a/frontend/src/components/widget/DeWidget/DeSelectTree.vue +++ b/frontend/src/components/widget/DeWidget/DeSelectTree.vue @@ -129,7 +129,7 @@ export default { method(param).then(res => { this.datas = this.optionDatas(res.data) this.$nextTick(() => { - this.$refs.deSelectTree.treeDataUpdateFun(this.datas) + this.$refs.deSelectTree && this.$refs.deSelectTree.treeDataUpdateFun(this.datas) }) }) || (this.element.options.value = '') }, @@ -191,7 +191,7 @@ export default { method({ fieldIds: this.element.options.attrs.fieldId.split(',') }).then(res => { this.datas = this.optionDatas(res.data) this.$nextTick(() => { - this.$refs.deSelectTree.treeDataUpdateFun(this.datas) + this.$refs.deSelectTree && this.$refs.deSelectTree.treeDataUpdateFun(this.datas) }) }) } @@ -231,7 +231,8 @@ export default { const param = { component: this.element, value: this.formatFilterValue(), - operator: this.operator + operator: this.operator, + isTree: true } this.inDraw && this.$store.commit('addViewFilter', param) }, diff --git a/frontend/src/components/widget/bean/Condition.js b/frontend/src/components/widget/bean/Condition.js index 566a2e1a82..ad3c1dc985 100644 --- a/frontend/src/components/widget/bean/Condition.js +++ b/frontend/src/components/widget/bean/Condition.js @@ -5,11 +5,12 @@ * viewIds 过滤视图范围 */ export class Condition { - constructor(componentId, fieldId, operator, value, viewIds) { + constructor(componentId, fieldId, operator, value, viewIds, isTree) { this.componentId = componentId this.fieldId = fieldId this.operator = operator || 'eq' this.value = value this.viewIds = viewIds + this.isTree = isTree || false } } diff --git a/frontend/src/utils/conditionUtil.js b/frontend/src/utils/conditionUtil.js index f557d516c6..4416b25f4c 100644 --- a/frontend/src/utils/conditionUtil.js +++ b/frontend/src/utils/conditionUtil.js @@ -26,10 +26,10 @@ export const valueValid = condition => { } export const formatCondition = obj => { - const { component, value, operator } = obj + const { component, value, operator, isTree } = obj const fieldId = component.options.attrs.fieldId const viewIds = component.options.attrs.viewIds - const condition = new Condition(component.id, fieldId, operator, value, viewIds) + const condition = new Condition(component.id, fieldId, operator, value, viewIds, isTree) return condition }