tangning il y a 3 jours
Parent
commit
b399cacba2

+ 19 - 15
src/view/case/photos/canvas-photo-editor.js

@@ -957,17 +957,16 @@ export class CanvasPhotoEditor {
         ctx.lineWidth = 1 / this.scale
         ctx.strokeRect(pageX + layout.x, itemY, layout.width, layout.height)
         // 设置填充颜色
-        ctx.strokeStyle = '#e5e7eb'
+        if(!this.show){
+          ctx.strokeStyle = '#e5e7eb'
+        }
         ctx.fillStyle = photoId?'#fff':'#D9D9D9'; // 黄色
         // 绘制填充矩形
         ctx.fillRect(pageX + layout.x, itemY, layout.width, layout.height);
         // 说明文字占位框
         if (this._selectedPageItem && this._selectedPageItem.pageIndex === pageIndex && this._selectedPageItem.index === itemIndex) {
-
-          ctx.fillStyle = 'red'; // 黄色
-          ctx.strokeStyle = 'red'; // 黄色
-          // ctx.strokeStyle = this.selectedPageColor
-          ctx.lineWidth = 2 / this.scale
+          ctx.strokeStyle = this.selectedPageColor
+          ctx.lineWidth = 4 * this.scale
           ctx.strokeRect(pageX + layout.x - 1, itemY - 1, layout.width + 2, layout.height + 2)
           ctx.strokeStyle = '#e5e7eb'
 
@@ -1559,10 +1558,10 @@ export class CanvasPhotoEditor {
             }
 
             // 相框底板
-            ctx.fillStyle = "#D9D9D9";
+            ctx.fillStyle = photoId?'#fff':"#D9D9D9";
             ctx.fillRect(coord.x, coord.y, coord.width, coord.height);
-            ctx.strokeStyle = "#eee";
-            ctx.strokeRect(coord.x, coord.y, coord.width, coord.height);
+            // ctx.strokeStyle = "#eee";
+            // ctx.strokeRect(coord.x, coord.y, coord.width, coord.height);
 
             if (photo) {
               const img = this.imgCache.get(photo.id);
@@ -1641,7 +1640,10 @@ export class CanvasPhotoEditor {
     } catch (err) {
       console.error(err);
       if (err?.message === 'Invalid string length') {
-        alert("图片数量较多导致内存占用过高,建议分段制作再导出。");
+        ElMessageBox.confirm("图片数量较多导致内存占用过高,建议分段制作再导出。", "提示", {
+          // type: "warning",
+          // showClose: false
+        })
       } else {
         ElMessage.error("导出失败");
       }
@@ -1726,10 +1728,10 @@ export class CanvasPhotoEditor {
               ...page.item[i],
             }
 
-            ctx.fillStyle = "#D9D9D9";
+            ctx.fillStyle = photoId?'#fff':"#D9D9D9";
             ctx.fillRect(coord.x, coord.y, coord.width, coord.height);
-            ctx.strokeStyle = "#eee";
-            ctx.strokeRect(coord.x, coord.y, coord.width, coord.height);
+            // ctx.strokeStyle = "#eee";
+            // ctx.strokeRect(coord.x, coord.y, coord.width, coord.height);
 
             if (photo) {
               const img = this.imgCache.get(photo.id);
@@ -1902,15 +1904,17 @@ export class CanvasPhotoEditor {
     } else {
       this.exportPagesAsImages(paperType, name);
     }
+    console.log('正在导出1');
   }
-  async checkIndexing(mes = '此操作将会清除所有标引是否继续?') {
+  async checkIndexing(mes = '此操作将会清除所有标引是否继续?', type = false) {
     let selectIndexPage = this.dragPageData.drawing?Math.min(this.dragPageData.index,this.dragPageData.movedIndex):this.selectedPageIndex//拖拽模式判断是否有标引
     let newList = this.indexingLineList.filter(ele =>{
-      return ele.indexingList.some(item => item.pageIndex > selectIndexPage-1)
+      return ele.indexingList.some(item => type?item.pageIndex > selectIndexPage:item.pageIndex > selectIndexPage-1)
     })
     if(this.dragPageData.drawing && newList.length){
       this.dragPageData.drawing = false;
     }
+    console.log(type,this.selectedPageIndex,newList, this.indexingLineList, this.dragPageData.drawing)
     let length = this.selectedPageIndex==-1?this.indexingLineList.length:newList.length;
     // try {
     if (length && await ElMessageBox.confirm(mes, '提示')) {

+ 2 - 1
src/view/case/photos/index.vue

@@ -577,10 +577,11 @@ const autoLayout = () => {
   // editor.value.drawAllPages()
 };
 const handleAddType = async (type) => {
+  console.log('handleAddType', selectedPageIndex.value == pages.value.length-1)
   if(selectedPageIndex.value == pages.value.length-1){
     return insertBlankPage(type);
   }
-  const check = await editor.value.checkIndexing();
+  const check = await editor.value.checkIndexing('此操作将会清除所有标引是否继续?', type);
   insertBlankPage(type);
 };
 // 插入空白页

+ 1 - 1
src/view/material/exportPhotos.vue

@@ -58,7 +58,7 @@ const submit = () => {
         }
       }, 40);
       // props.showPagesRef.exportToPDF(exportInfo.value.paperType,props.title, exportInfo.value.fileType)
-      // console.log('正在导出2');
+      console.log('正在导出2');
       // loading.close();
     }
   };

+ 3 - 1
src/view/material/sceneImg.vue

@@ -1207,7 +1207,9 @@ const exportToPDF = async (isAll, item) => {
 };
 const handleOpen = (val) => {
   if (!val) {
-    // handleClick({ paneName: "照片卷" });
+    setTimeout(()=>{
+      handleClick({ paneName: "照片卷" });
+    }, 500)
   } else {
     console.log("handleOpen");
     let Alllist = {