forked from github/dataease
feat:仪表板联动时,在视图上增加取消联动按钮
This commit is contained in:
parent
1dca2e0ff7
commit
2a8d39bbb8
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div v-show="existLinkage" class="bar-main">
|
<div v-show="existLinkage" class="bar-main">
|
||||||
<div>
|
<div>
|
||||||
<el-button size="mini" type="info" @click="clearAllLinkage">清除所有联动</el-button>
|
<el-button size="mini" type="warning" @click="clearAllLinkage"><i class="icon iconfont icon-quxiaoliandong" />{{ $t('panel.remove_all_linkage') }}</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
</setting-menu>
|
</setting-menu>
|
||||||
<i v-if="activeModel==='edit'&&curComponent&&editFilter.includes(curComponent.type)" class="icon iconfont icon-edit" @click.stop="edit" />
|
<i v-if="activeModel==='edit'&&curComponent&&editFilter.includes(curComponent.type)" class="icon iconfont icon-edit" @click.stop="edit" />
|
||||||
<i v-if="curComponent.type==='view'" class="icon iconfont icon-fangda" @click.stop="showViewDetails" />
|
<i v-if="curComponent.type==='view'" class="icon iconfont icon-fangda" @click.stop="showViewDetails" />
|
||||||
|
<i v-if="curComponent.type==='view'&&existLinkage" class="icon iconfont icon-quxiaoliandong" @click.stop="clearLinkage" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@ -53,6 +54,19 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
existLinkage() {
|
||||||
|
let linkageFiltersCount = 0
|
||||||
|
this.componentData.forEach(item => {
|
||||||
|
if (item.linkageFilters && item.linkageFilters.length > 0) {
|
||||||
|
item.linkageFilters.forEach(linkage => {
|
||||||
|
if (this.element.propValue.viewId === linkage.sourceViewId) {
|
||||||
|
linkageFiltersCount++
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return linkageFiltersCount
|
||||||
|
},
|
||||||
linkageInfo() {
|
linkageInfo() {
|
||||||
return this.targetLinkageInfo[this.element.propValue.viewId]
|
return this.targetLinkageInfo[this.element.propValue.viewId]
|
||||||
},
|
},
|
||||||
@ -93,6 +107,21 @@ export default {
|
|||||||
},
|
},
|
||||||
linkageEdit() {
|
linkageEdit() {
|
||||||
|
|
||||||
|
},
|
||||||
|
// 清除相同sourceViewId 的 联动条件
|
||||||
|
clearLinkage() {
|
||||||
|
this.componentData.forEach(item => {
|
||||||
|
if (item.linkageFilters && item.linkageFilters.length > 0) {
|
||||||
|
const newList = item.linkageFilters.filter(linkage => linkage.sourceViewId !== this.element.propValue.viewId)
|
||||||
|
item.linkageFilters.splice(0, item.linkageFilters.length)
|
||||||
|
// 重新push 可保证数组指针不变 可以watch到
|
||||||
|
if (newList.length > 0) {
|
||||||
|
newList.forEach(newLinkage => {
|
||||||
|
item.linkageFilters.push(newLinkage)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1210,7 +1210,9 @@ export default {
|
|||||||
do_not_save: "Don't Save",
|
do_not_save: "Don't Save",
|
||||||
save_and_close: 'Save',
|
save_and_close: 'Save',
|
||||||
drill: 'drill',
|
drill: 'drill',
|
||||||
linkage: 'linkage'
|
linkage: 'linkage',
|
||||||
|
cancel_linkage: 'Cancel Linkage',
|
||||||
|
remove_all_linkage: 'Remove All Linkage'
|
||||||
},
|
},
|
||||||
plugin: {
|
plugin: {
|
||||||
local_install: 'Local installation',
|
local_install: 'Local installation',
|
||||||
|
@ -1209,7 +1209,9 @@ export default {
|
|||||||
do_not_save: '不保存',
|
do_not_save: '不保存',
|
||||||
save: '保存',
|
save: '保存',
|
||||||
drill: '下钻',
|
drill: '下钻',
|
||||||
linkage: '联动'
|
linkage: '联动',
|
||||||
|
cancel_linkage: '取消联动',
|
||||||
|
remove_all_linkage: '清除所有联动'
|
||||||
},
|
},
|
||||||
plugin: {
|
plugin: {
|
||||||
local_install: '本地安裝',
|
local_install: '本地安裝',
|
||||||
|
@ -1211,7 +1211,9 @@ export default {
|
|||||||
do_not_save: '不保存',
|
do_not_save: '不保存',
|
||||||
save: '保存',
|
save: '保存',
|
||||||
drill: '下钻',
|
drill: '下钻',
|
||||||
linkage: '联动'
|
linkage: '联动',
|
||||||
|
cancel_linkage: '取消联动',
|
||||||
|
remove_all_linkage: '清除所有联动'
|
||||||
},
|
},
|
||||||
plugin: {
|
plugin: {
|
||||||
local_install: '本地安装',
|
local_install: '本地安装',
|
||||||
|
@ -178,7 +178,7 @@ const data = {
|
|||||||
if (element.propValue.viewId === targetViewId) { // 如果目标视图 和 当前循环组件id相等 则进行条件增减
|
if (element.propValue.viewId === targetViewId) { // 如果目标视图 和 当前循环组件id相等 则进行条件增减
|
||||||
const targetFieldId = targetInfoArray[1] // 目标视图列ID
|
const targetFieldId = targetInfoArray[1] // 目标视图列ID
|
||||||
const condition = new Condition('', targetFieldId, 'eq', [dimension.value], [targetViewId])
|
const condition = new Condition('', targetFieldId, 'eq', [dimension.value], [targetViewId])
|
||||||
|
condition.sourceViewId = viewId
|
||||||
let j = currentFilters.length
|
let j = currentFilters.length
|
||||||
while (j--) {
|
while (j--) {
|
||||||
const filter = currentFilters[j]
|
const filter = currentFilters[j]
|
||||||
|
Loading…
Reference in New Issue
Block a user