mirror of
https://gitee.com/dromara/go-view.git
synced 2025-04-22 13:36:23 +08:00
feat: 交互绑定组件,可以绑定分组内组件
This commit is contained in:
parent
9307614a94
commit
30d1e7dda2
@ -169,7 +169,27 @@ const fnDimensionsAndSource = (interactOn: InteractEventOn | undefined) => {
|
|||||||
|
|
||||||
// 绑定组件列表
|
// 绑定组件列表
|
||||||
const fnEventsOptions = (): Array<SelectOption | SelectGroupOption> => {
|
const fnEventsOptions = (): Array<SelectOption | SelectGroupOption> => {
|
||||||
const filterOptionList = chartEditStore.componentList.filter(item => {
|
// 扁平化树形数据
|
||||||
|
const fnFlattern = (
|
||||||
|
data: Array<CreateComponentType | CreateComponentGroupType>
|
||||||
|
): Array<CreateComponentType | CreateComponentGroupType> => {
|
||||||
|
return data.reduce(
|
||||||
|
(
|
||||||
|
iter: Array<CreateComponentType | CreateComponentGroupType>,
|
||||||
|
val: CreateComponentType | CreateComponentGroupType
|
||||||
|
) => {
|
||||||
|
if (val.groupList && val.groupList.length > 0) {
|
||||||
|
iter.push(val)
|
||||||
|
} else {
|
||||||
|
iter.push(val)
|
||||||
|
}
|
||||||
|
return val.groupList ? [...iter, ...fnFlattern(val.groupList)] : iter
|
||||||
|
},
|
||||||
|
[]
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
const filterOptionList = fnFlattern(chartEditStore.componentList).filter(item => {
|
||||||
// 排除自己
|
// 排除自己
|
||||||
const isNotSelf = item.id !== targetData.value.id
|
const isNotSelf = item.id !== targetData.value.id
|
||||||
// 排除静态组件
|
// 排除静态组件
|
||||||
|
Loading…
x
Reference in New Issue
Block a user