feat: 新增多选删除功能

This commit is contained in:
奔跑的面条
2022-08-15 16:50:52 +08:00
parent 8832da10c9
commit dcb7806847
3 changed files with 48 additions and 15 deletions
+9 -3
View File
@@ -107,18 +107,24 @@ const optionsHandle = (
allList: MenuOptionsItemType[],
targetInstance: CreateComponentType
) => {
// 多选
const moreMenuEnums = [MenuEnum.GROUP, MenuEnum.DELETE]
// 单选
const singleMenuEnums = targetList
// 多选处理
if (chartEditStore.getTargetChart.selectId.length > 1) {
const list: MenuOptionsItemType[] = []
targetList.forEach(item => {
allList.forEach(item => {
// 成组
if (item.key === MenuEnum.GROUP) {
if (moreMenuEnums.includes(item.key as MenuEnum)) {
list.push(item)
}
})
return list
}
return targetList
return singleMenuEnums
}
// 主题色