|
|
|
|
@ -3,7 +3,8 @@ import { ZERO } from '../../dataset/constant/Common'
|
|
|
|
|
import { ControlComponent, ImageDisplay } from '../../dataset/enum/Control'
|
|
|
|
|
import {
|
|
|
|
|
IComputePageRowPositionPayload,
|
|
|
|
|
IComputePageRowPositionResult
|
|
|
|
|
IComputePageRowPositionResult,
|
|
|
|
|
IComputeRowPositionPayload
|
|
|
|
|
} from '../../interface/Position'
|
|
|
|
|
import { IEditorOption } from '../../interface/Editor'
|
|
|
|
|
import { IElement, IElementPosition } from '../../interface/Element'
|
|
|
|
|
@ -14,6 +15,7 @@ import {
|
|
|
|
|
} from '../../interface/Position'
|
|
|
|
|
import { Draw } from '../draw/Draw'
|
|
|
|
|
import { EditorMode, EditorZone } from '../../dataset/enum/Editor'
|
|
|
|
|
import { deepClone } from '../../utils'
|
|
|
|
|
|
|
|
|
|
export class Position {
|
|
|
|
|
private cursorPosition: IElementPosition | null
|
|
|
|
|
@ -110,10 +112,8 @@ export class Position {
|
|
|
|
|
} else if (curRow.rowFlex === RowFlex.RIGHT) {
|
|
|
|
|
x += innerWidth - curRow.width
|
|
|
|
|
}
|
|
|
|
|
// 列表向右移动-留出列表样式位置
|
|
|
|
|
if (curRow.isList) {
|
|
|
|
|
x += curRow.offsetX || 0
|
|
|
|
|
}
|
|
|
|
|
// 当前行X轴偏移量
|
|
|
|
|
x += curRow.offsetX || 0
|
|
|
|
|
// 当前td所在位置
|
|
|
|
|
const tablePreX = x
|
|
|
|
|
const tablePreY = y
|
|
|
|
|
@ -244,6 +244,24 @@ export class Position {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public computeRowPosition(
|
|
|
|
|
payload: IComputeRowPositionPayload
|
|
|
|
|
): IElementPosition[] {
|
|
|
|
|
const { row, innerWidth } = payload
|
|
|
|
|
const positionList: IElementPosition[] = []
|
|
|
|
|
this.computePageRowPosition({
|
|
|
|
|
positionList,
|
|
|
|
|
innerWidth,
|
|
|
|
|
rowList: [deepClone(row)],
|
|
|
|
|
pageNo: 0,
|
|
|
|
|
startX: 0,
|
|
|
|
|
startY: 0,
|
|
|
|
|
startIndex: 0,
|
|
|
|
|
startRowIndex: 0
|
|
|
|
|
})
|
|
|
|
|
return positionList
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public setCursorPosition(position: IElementPosition | null) {
|
|
|
|
|
this.cursorPosition = position
|
|
|
|
|
}
|
|
|
|
|
|