forked from github/dataease
Merge pull request #2564 from dataease/pr@dev@fix_multi_field_tip
fix(仪表板): 下拉过滤器添加同数据集多字段虽然有提示但还是能添加成功
This commit is contained in:
commit
71ce298b01
@ -298,7 +298,8 @@ export default {
|
|||||||
},
|
},
|
||||||
currentElement: null,
|
currentElement: null,
|
||||||
allFields: [],
|
allFields: [],
|
||||||
tempTreeDatas: null
|
tempTreeDatas: null,
|
||||||
|
showTips: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -672,8 +673,14 @@ export default {
|
|||||||
this.comLoadField(row.tableId)
|
this.comLoadField(row.tableId)
|
||||||
},
|
},
|
||||||
onMove(e, originalEvent) {
|
onMove(e, originalEvent) {
|
||||||
|
this.showTips = false
|
||||||
this.moveId = e.draggedContext.element.id
|
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) {
|
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)
|
const result = this.currentElement.options.attrs.dragItems.filter(item => !res.has(item.tableId) && res.set(item.tableId), 1)
|
||||||
this.currentElement.options.attrs.dragItems = result
|
this.currentElement.options.attrs.dragItems = result
|
||||||
const newLen = result.length
|
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() {
|
enableSureButton() {
|
||||||
let valid = true
|
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
|
.length > 0
|
||||||
if (this.widget.validDynamicValue) {
|
if (this.widget.validDynamicValue) {
|
||||||
valid = this.widget.validDynamicValue(this.currentElement)
|
valid = this.widget.validDynamicValue(this.currentElement)
|
||||||
|
Loading…
Reference in New Issue
Block a user