From 3c5002443f75cbb048bb8ee03919779aa9222f1c Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Tue, 27 Jul 2021 16:46:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=BF=87=E6=BB=A4=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E5=BC=B9=E6=A1=86=E5=9B=9E=E6=98=BE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/panel/edit/index.vue | 6 +- .../src/views/panel/filter/filterDialog.vue | 57 ++++++++++++++++--- 2 files changed, 52 insertions(+), 11 deletions(-) diff --git a/frontend/src/views/panel/edit/index.vue b/frontend/src/views/panel/edit/index.vue index 2f294489b2..1fe526a6ab 100644 --- a/frontend/src/views/panel/edit/index.vue +++ b/frontend/src/views/panel/edit/index.vue @@ -543,8 +543,10 @@ export default { this.$forceUpdate() }, editDialog() { - const serviceName = this.curComponent.serviceName - this.currentWidget = ApplicationContext.getService(serviceName) + if (this.curComponent && this.curComponent.serviceName) { + const serviceName = this.curComponent.serviceName + this.currentWidget = ApplicationContext.getService(serviceName) + } this.currentFilterCom = this.curComponent this.openFilterDialog() }, diff --git a/frontend/src/views/panel/filter/filterDialog.vue b/frontend/src/views/panel/filter/filterDialog.vue index 68b5befd6a..c655a042b1 100644 --- a/frontend/src/views/panel/filter/filterDialog.vue +++ b/frontend/src/views/panel/filter/filterDialog.vue @@ -3,7 +3,7 @@ - +
@@ -56,7 +56,7 @@ @start="start1" > -
+
{{ item.name }}
@@ -67,7 +67,7 @@
- +
@@ -125,7 +125,7 @@ @start="start1" > -
+
{{ item.name }}
@@ -318,7 +318,8 @@ export default { timer: null, expandedArray: [], viewKeyWord: '', - titlePopovervisible: false + titlePopovervisible: false, + fieldsParent: null } }, computed: { @@ -344,15 +345,20 @@ export default { this.componentInfo.options.attrs.datas = this.widget.optionDatas(res.data) this.componentInfo.options.attrs.fieldId = fieldId this.componentInfo.options.attrs.dragItems = values + this.componentInfo.options.attrs.activeName = this.activeName + this.componentInfo.options.attrs.fieldsParent = this.fieldsParent this.$emit('re-fresh-component', this.componentInfo) }) } else { this.componentInfo.options.attrs.fieldId = fieldId this.componentInfo.options.attrs.dragItems = values + this.componentInfo.options.attrs.activeName = this.activeName + this.componentInfo.options.attrs.fieldsParent = this.fieldsParent this.$emit('re-fresh-component', this.componentInfo) } } else if (this.componentInfo && this.componentInfo.options.attrs.fieldId) { this.componentInfo.options.attrs.fieldId = null + this.componentInfo.options.attrs.activeName = null this.$emit('re-fresh-component', this.componentInfo) } }, @@ -377,10 +383,23 @@ export default { if (this.componentInfo && this.componentInfo.options.attrs.dragItems) { this.selectField = this.componentInfo.options.attrs.dragItems } + this.initWithField() this.loadViews() }, methods: { + initWithField() { + if (this.componentInfo && this.componentInfo.options.attrs.activeName) { + this.activeName = this.componentInfo.options.attrs.activeName + if (this.componentInfo.options.attrs.fieldsParent) { + this.fieldsParent = this.componentInfo.options.attrs.fieldsParent + this.$nextTick(() => { + this.activeName === 'dataset' && this.showFieldDatas(this.fieldsParent) + this.activeName !== 'dataset' && this.comShowFieldDatas(this.fieldsParent) + }) + } + } + }, getTreeData(val) { if (val) { this.isTreeSearch = true @@ -559,6 +578,7 @@ export default { this.showDomType = 'field' this.setTailLink(row) this.addTail(row) + this.fieldsParent = row this.loadField(row.id) }, comShowFieldDatas(row) { @@ -566,6 +586,7 @@ export default { this.comShowDomType = 'field' this.comSetTailLink(row) this.comAddTail(row) + this.fieldsParent = row this.comLoadField(row.tableId) }, onMove(e, originalEvent) { @@ -760,15 +781,33 @@ export default { color: #409EFF; } .filter-db-row { - :hover { - cursor: pointer; - } i { - color: #409EFF; + color: #3685f2; } // background-color: #3685f2; // color: #fff; } + .filter-db-row:hover { + background-color: #f5f7fa !important; + cursor: pointer; + } + .filter-db-row-checked:hover { + background-color: #f5f7fa !important; + color: inherit; + cursor: pointer; + i { + background-color: inherit; + color: #3685f2; + } + } + .filter-db-row-checked { + background-color: #3685f2 !important; + color: #fff; + i { + background-color: #3685f2; + color: #fff; + } + } .draggable-group { display: inline-block; width: 100%;