|
@@ -299,10 +299,12 @@ export class CanvasPhotoEditor {
|
|
|
const rect = this.canvas.getBoundingClientRect()
|
|
const rect = this.canvas.getBoundingClientRect()
|
|
|
const mouseX = (e.clientX - rect.left - this.drawOffsetX) / this.scale
|
|
const mouseX = (e.clientX - rect.left - this.drawOffsetX) / this.scale
|
|
|
const mouseY = (e.clientY - rect.top - this.drawOffsetY) / this.scale
|
|
const mouseY = (e.clientY - rect.top - this.drawOffsetY) / this.scale
|
|
|
- if (this.dragPageData.drawing && this.indexingLineList.length) {
|
|
|
|
|
- await this.clearLineThrottle()
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ console.log('pageIndex', this.dragPageData.movedIndex, this.indexingLineList.length)
|
|
|
|
|
+ // if (this.dragPageData.drawing && this.indexingLineList.length) {
|
|
|
|
|
+ // let check = await this.clearLineThrottle()
|
|
|
|
|
+ // console.log('pageIndexcheck', check)
|
|
|
|
|
+ // return
|
|
|
|
|
+ // }
|
|
|
if (this.indexing && drawing) {
|
|
if (this.indexing && drawing) {
|
|
|
const PhotoIndex = this.getPhotoPositionInPage(e)
|
|
const PhotoIndex = this.getPhotoPositionInPage(e)
|
|
|
console.log('PhotoIndex', PhotoIndex, this.tempArrow)
|
|
console.log('PhotoIndex', PhotoIndex, this.tempArrow)
|
|
@@ -335,9 +337,10 @@ export class CanvasPhotoEditor {
|
|
|
// 先把节流函数定义在外面(关键!)
|
|
// 先把节流函数定义在外面(关键!)
|
|
|
clearLineThrottle = throttle(async () => {
|
|
clearLineThrottle = throttle(async () => {
|
|
|
if (this.indexingLineList.length) {
|
|
if (this.indexingLineList.length) {
|
|
|
- await this.checkIndexing('修改页面排序将会清除所有标引是否继续?')
|
|
|
|
|
|
|
+ return await this.checkIndexing('修改页面排序将会清除所有标引是否继续?')
|
|
|
this.drawAllPages()
|
|
this.drawAllPages()
|
|
|
}
|
|
}
|
|
|
|
|
+ return false
|
|
|
}, 1000, { leading: true, trailing: false })
|
|
}, 1000, { leading: true, trailing: false })
|
|
|
|
|
|
|
|
async handleMouseUp(e) {
|
|
async handleMouseUp(e) {
|
|
@@ -345,7 +348,7 @@ export class CanvasPhotoEditor {
|
|
|
this.canvas.style.cursor = 'grab'
|
|
this.canvas.style.cursor = 'grab'
|
|
|
if (this.dragPageData.drawing && this.dragPageData.index != this.dragPageData.movedIndex) {//鼠标释放左键时,移动页面到指定位置)
|
|
if (this.dragPageData.drawing && this.dragPageData.index != this.dragPageData.movedIndex) {//鼠标释放左键时,移动页面到指定位置)
|
|
|
// 末尾必须加分号!!!
|
|
// 末尾必须加分号!!!
|
|
|
- console.log('handleMouseUpdragPageData', this.dragPageData)
|
|
|
|
|
|
|
+ let check = await this.checkIndexing('修改页面排序将会清除所有标引是否继续?')
|
|
|
let newPagelist = this.moveItem(this.pages, this.dragPageData.index, this.dragPageData.movedIndex)
|
|
let newPagelist = this.moveItem(this.pages, this.dragPageData.index, this.dragPageData.movedIndex)
|
|
|
this.pages = newPagelist;
|
|
this.pages = newPagelist;
|
|
|
this.dragPageData.drawing = false//退出page编辑模式
|
|
this.dragPageData.drawing = false//退出page编辑模式
|
|
@@ -1897,10 +1900,14 @@ export class CanvasPhotoEditor {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
async checkIndexing(mes = '此操作将会清除所有标引是否继续?') {
|
|
async checkIndexing(mes = '此操作将会清除所有标引是否继续?') {
|
|
|
|
|
+ let selectIndexPage = this.dragPageData.drawing?Math.min(this.dragPageData.index,this.dragPageData.movedIndex):this.selectedPageIndex//拖拽模式判断是否有标引
|
|
|
let newList = this.indexingLineList.filter(ele =>{
|
|
let newList = this.indexingLineList.filter(ele =>{
|
|
|
- return ele.indexingList.some(item => item.pageIndex > this.selectedPageIndex-1)
|
|
|
|
|
|
|
+ return ele.indexingList.some(item => item.pageIndex > selectIndexPage-1)
|
|
|
})
|
|
})
|
|
|
- console.log(this.indexingLineList,'this.indexingLineList', newList, this.selectedPageIndex)
|
|
|
|
|
|
|
+ if(this.dragPageData.drawing && newList.length){
|
|
|
|
|
+ this.dragPageData.drawing = false;
|
|
|
|
|
+ }
|
|
|
|
|
+ console.log(this.indexingLineList,'this.indexingLineList', newList, selectIndexPage, this.selectedPageIndex, this.dragPageData)
|
|
|
let length = this.selectedPageIndex==-1?this.indexingLineList.length:newList.length;
|
|
let length = this.selectedPageIndex==-1?this.indexingLineList.length:newList.length;
|
|
|
// try {
|
|
// try {
|
|
|
if (length && await ElMessageBox.confirm(mes, '提示')) {
|
|
if (length && await ElMessageBox.confirm(mes, '提示')) {
|