tangning 16 hours ago
parent
commit
9d3609237b
3 changed files with 17 additions and 9 deletions
  1. 3 0
      src/store/case.ts
  2. 11 6
      src/view/case/photos/canvas-photo-editor.js
  3. 3 3
      src/view/case/photos/index.vue

+ 3 - 0
src/store/case.ts

@@ -152,6 +152,9 @@ export const getCaseInfo = async (caseId) => {
       // window.open(window.location.origin + "/admin/#/statistics/scene");
       // window.open(window.location.origin + "/admin/#/statistics/scene");
     });
     });
   }
   }
+  if(caseInfoData.value?.caseTitle){
+    document.title = caseInfoData.value.caseTitle
+  }
   return caseInfoData.value;
   return caseInfoData.value;
 }
 }
   
   

+ 11 - 6
src/view/case/photos/canvas-photo-editor.js

@@ -326,7 +326,7 @@ export class CanvasPhotoEditor {
     this.canvas.style.cursor = 'grab'
     this.canvas.style.cursor = 'grab'
     if(this.dragPageData.drawing){//鼠标释放左键时,移动页面到指定位置)
     if(this.dragPageData.drawing){//鼠标释放左键时,移动页面到指定位置)
     // 末尾必须加分号!!!
     // 末尾必须加分号!!!
-    let newPagelist = this.moveItem(this.pages, this.dragPageData.index, this.dragPageData.movedIndex)
+    let newPagelist = this.moveItem(this.pages, this.dragPageData.index, this.dragPageData.movedIndex-1)
     this.pages = newPagelist;
     this.pages = newPagelist;
       this.drawAllPages()
       this.drawAllPages()
     }
     }
@@ -1037,17 +1037,22 @@ export class CanvasPhotoEditor {
 
 
   insertBlankPage(direction) {
   insertBlankPage(direction) {
     //direction true 右边 false 左边
     //direction true 右边 false 左边
+    console.log(this.selectedPageIndex, direction, 'selectedPageIndex')
     const layout = this.getItemSize()
     const layout = this.getItemSize()
     // if (this.selectedPageIndex === -1) return this.pages
     // if (this.selectedPageIndex === -1) return this.pages
     const newPages = [...this.pages]
     const newPages = [...this.pages]
-    const PageIndex = direction ? this.selectedPageIndex + 1 : this.selectedPageIndex;
-    newPages.splice(PageIndex, 0, {
+    // const PageIndex = direction ? this.selectedPageIndex + 1 : this.selectedPageIndex;
+    // newPages.splice(PageIndex, 0, {
+    //   list: [],
+    //   layoutMode: this.layoutMode, //页码布局类型
+    //   coordinate: [], //坐标信息
+    // })
+    this.pages = [...newPages, {
       list: [],
       list: [],
       layoutMode: this.layoutMode, //页码布局类型
       layoutMode: this.layoutMode, //页码布局类型
       coordinate: [], //坐标信息
       coordinate: [], //坐标信息
-    })
-    this.pages = newPages
-    if (!direction) this.selectedPageIndex++
+    }]
+    // if (!direction) this.selectedPageIndex++
     this.resetPosition()
     this.resetPosition()
     return this.pages
     return this.pages
   }
   }

+ 3 - 3
src/view/case/photos/index.vue

@@ -91,7 +91,7 @@
               >
               >
               <el-dropdown-item command="landscape"
               <el-dropdown-item command="landscape"
                 >
                 >
-                <i class="iconfont icon-layout_h"></i>一张竖版</el-dropdown-item
+                <i class="iconfont icon-layout_one"></i>一张竖版</el-dropdown-item
               >
               >
             </el-dropdown-menu>
             </el-dropdown-menu>
           </template>
           </template>
@@ -423,10 +423,10 @@ const handleAddType = async (type) => {
   insertBlankPage(type);
   insertBlankPage(type);
 };
 };
 // 插入空白页
 // 插入空白页
+// direction: true-右侧 false-左侧
 const insertBlankPage = (direction = true) => {
 const insertBlankPage = (direction = true) => {
-  //direction true 右边 false 左边
   if (editor.value) {
   if (editor.value) {
-    pages.value = editor.value.insertBlankPage(direction);
+    pages.value = editor.value.insertBlankPage(false);
   }
   }
 };
 };
 const changeIndexing = async () => {
 const changeIndexing = async () => {