feat: 新增页面框选效果

This commit is contained in:
奔跑的面条
2022-08-18 20:30:02 +08:00
parent 23bbac7318
commit c987dd8816
9 changed files with 179 additions and 21 deletions
@@ -52,7 +52,9 @@ export const useChartEditStore = defineStore({
// 初始化
isCreate: false,
// 拖拽中
isDrag: false
isDrag: false,
// 框选中
isSelect: false
},
// 右键菜单
rightMenuShow: false,
@@ -216,10 +218,10 @@ export const useChartEditStore = defineStore({
},
// * 设置鼠标位置
setMousePosition(x?: number, y?: number, startX?: number, startY?: number): void {
if (startX) this.mousePosition.startX = startX
if (startY) this.mousePosition.startY = startY
if (x) this.mousePosition.x = x
if (y) this.mousePosition.y = y
if (startX) this.mousePosition.startX = startX
if (startY) this.mousePosition.startY = startY
},
// * 找到目标 id 数据的下标位置,id可为父级或子集数组(无则返回-1)
fetchTargetIndex(id?: string): number {