From b9ef373f5da136098456705d7a88779ae8d013cb Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Mon, 4 Jul 2022 11:53:26 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20=E4=B8=8B?= =?UTF-8?q?=E6=8B=89=E8=BF=87=E6=BB=A4=E5=99=A8=E6=B7=BB=E5=8A=A0=E5=90=8C?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9B=86=E5=A4=9A=E5=AD=97=E6=AE=B5=E8=99=BD?= =?UTF-8?q?=E7=84=B6=E6=9C=89=E6=8F=90=E7=A4=BA=E4=BD=86=E8=BF=98=E6=98=AF?= =?UTF-8?q?=E8=83=BD=E6=B7=BB=E5=8A=A0=E6=88=90=E5=8A=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/panel/filter/filterDialog.vue | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/frontend/src/views/panel/filter/filterDialog.vue b/frontend/src/views/panel/filter/filterDialog.vue index 4a537cd934..4b4ceb332c 100644 --- a/frontend/src/views/panel/filter/filterDialog.vue +++ b/frontend/src/views/panel/filter/filterDialog.vue @@ -298,7 +298,8 @@ export default { }, currentElement: null, allFields: [], - tempTreeDatas: null + tempTreeDatas: null, + showTips: false } }, computed: { @@ -672,8 +673,14 @@ export default { this.comLoadField(row.tableId) }, onMove(e, originalEvent) { + this.showTips = false this.moveId = e.draggedContext.element.id - return true + const tabelId = e.draggedContext.element.tableId + const prohibit = this.currentElement.options.attrs.dragItems.some(item => item.tableId === tabelId) + if (prohibit) { + this.showTips = true + } + return !prohibit }, endDs(e) { @@ -717,12 +724,14 @@ export default { const result = this.currentElement.options.attrs.dragItems.filter(item => !res.has(item.tableId) && res.set(item.tableId), 1) this.currentElement.options.attrs.dragItems = result const newLen = result.length - if (sourceLen > newLen) this.$warning(this.$t('panel.prohibit_multiple')) + if (sourceLen > newLen || this.showTips) this.$warning(this.$t('panel.prohibit_multiple')) }, enableSureButton() { let valid = true - const enable = this.currentElement.options.attrs.dragItems && this.currentElement.options.attrs.dragItems + + const enable = + this.currentElement.options.attrs.dragItems && this.currentElement.options.attrs.dragItems .length > 0 if (this.widget.validDynamicValue) { valid = this.widget.validDynamicValue(this.currentElement)