tangning 1 день назад
Родитель
Сommit
7febae3be1
2 измененных файлов с 12 добавлено и 8 удалено
  1. 12 7
      src/view/case/newphotos/index.vue
  2. 0 1
      src/view/case/photos/index.vue

+ 12 - 7
src/view/case/newphotos/index.vue

@@ -152,8 +152,8 @@ const changeList = async (list) => {
     const res = await getCaseImgTagData(caseId.value, imgId);
     console.log("getCaseImgTagData2", res);
     if (res.data) {
-      if (res.data.data) {
-        loadedDrawData.value = res.data.data;
+      if (res.data[0] && imgId) {
+        loadedDrawData.value = res.data[0]?.data;
       }
       if ("isHorizontal" in res.data) {
         // console.error("sortType.value", sortType.value, !res.data.isHorizontal);
@@ -261,17 +261,22 @@ const renderCanvas = () => {
           ? childRef.value.getImageIds()
           : imgIds.value,
       };
-
+      const title = `${props.title}-照片卷.jpg`;
+      const current = router.currentRoute.value;
+      const query = { ...current.query, editSub: 'photoEdit' };
+      console.log("submitMergePhotos1", params.files);
+      if (!query.parentId && !save) {
+        let fileImgurl = URL.createObjectURL(params.files?.[0]); // 完全兼容
+        saveAs(fileImgurl, title);
+        return;
+      }
+      console.log("submitMergePhotos1", params.files);
       setTimeout(async () => {
         try {
           const res = await submitMergePhotos(params);
           const { data, code } = res;
-          console.log("submitMergePhotos1", data, save);
-          const title = `${props.title}-照片卷.jpg`;
           if (data && data.imgUrl) {
             if (save) {
-              const current = router.currentRoute.value;
-              const query = { ...current.query, editSub: 'photoEdit' };
               console.log("submitMergePhotos1", query.parentId, data.id, route);
               if(!query.parentId){//新的照片制卷
                 handleAutoSave(data.id);

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

@@ -258,7 +258,6 @@ const renderCanvas = () => {
         ),
         caseId: caseId.value,
       };
-
       setTimeout(async () => {
         try {
           const res = await submitMergePhotos(params);