Browse Source

feat: update

gemercheung 1 year ago
parent
commit
ca2afdf17b

+ 1 - 1
.env

@@ -6,4 +6,4 @@ VITE_SERVICE_URL="https://test.4dkankan.com"
 VITE_SWSS_URL="https://uat-laser.4dkankan.com/uat"
 VITE_SWSS_URL="https://uat-laser.4dkankan.com/uat"
 VITE_LASER_URL="https://uat-laser.4dkankan.com"
 VITE_LASER_URL="https://uat-laser.4dkankan.com"
 VITE_FDKK_URL="https://laser.4dkankan.com"
 VITE_FDKK_URL="https://laser.4dkankan.com"
-VITE_DOC_URL="https://192.168.0.25/docs/#/product/all/zh-cn/README"
+VITE_DOC_URL="https://192.168.0.25/docs/#/product/huodiao/README"

+ 1 - 1
.env.development

@@ -7,4 +7,4 @@ VITE_SERVICE_URL="https://test.4dkankan.com"
 VITE_SWSS_URL="https://uat-laser.4dkankan.com/uat"
 VITE_SWSS_URL="https://uat-laser.4dkankan.com/uat"
 VITE_LASER_URL="https://uat-laser.4dkankan.com"
 VITE_LASER_URL="https://uat-laser.4dkankan.com"
 VITE_FDKK_URL="https://uat-laser.4dkankan.com/uat"
 VITE_FDKK_URL="https://uat-laser.4dkankan.com/uat"
-VITE_DOC_URL="https://192.168.0.25/docs/#/product/all/zh-cn/README"
+VITE_DOC_URL="https://192.168.0.25/docs/#/product/huodiao/README"

+ 1 - 1
.env.fire

@@ -6,4 +6,4 @@ VITE_SERVICE_URL="https://4dkankan.com"
 VITE_SWSS_URL="https://laser.4dkankan.com/"
 VITE_SWSS_URL="https://laser.4dkankan.com/"
 VITE_LASER_URL="https://laser.4dkankan.com"
 VITE_LASER_URL="https://laser.4dkankan.com"
 VITE_FDKK_URL="https://uat-laser.4dkankan.com/uat"
 VITE_FDKK_URL="https://uat-laser.4dkankan.com/uat"
-VITE_DOC_URL="https://192.168.0.25/docs/#/product/all/zh-cn/README"
+VITE_DOC_URL="https://192.168.0.25/docs/#/product/huodiao/README"

+ 2 - 2
src/core/Scene.js

@@ -242,7 +242,7 @@ export default class Scene extends Mitt {
     this.renderer.setSize(this.width, this.height);
     this.renderer.setSize(this.width, this.height);
   }
   }
 
 
-  exportScreenshot() {
+  exportScreenshot(isSaveJpg = true) {
     if (window.devicePixelRatio !== 1) {
     if (window.devicePixelRatio !== 1) {
       this.emit("devicePixelRatio");
       this.emit("devicePixelRatio");
       return;
       return;
@@ -280,7 +280,7 @@ export default class Scene extends Mitt {
             console.log(`Width: ${offset}`);
             console.log(`Width: ${offset}`);
             if (index === slides) {
             if (index === slides) {
               console.log("last");
               console.log("last");
-              that.emit("submitScreenshot");
+              that.emit("submitScreenshot", isSaveJpg);
             }
             }
           }, index * 500);
           }, index * 500);
         })(i, this); // 传递当前迭代的索引i给setTimeout的回调函数
         })(i, this); // 传递当前迭代的索引i给setTimeout的回调函数

+ 1 - 1
src/core/box/HorizontalBox.js

@@ -45,7 +45,7 @@ export default class HorizontalBox extends THREE.Group {
 
 
     const matLine = new LineMaterial({
     const matLine = new LineMaterial({
       color: 0xe44d54,
       color: 0xe44d54,
-      linewidth: 3, // in world units with size attenuation, pixels otherwise
+      linewidth: 4, // in world units with size attenuation, pixels otherwise
       dashed: false,
       dashed: false,
       alphaToCoverage: true,
       alphaToCoverage: true,
     });
     });

+ 1 - 1
src/core/box/VerticalBox.js

@@ -37,7 +37,7 @@ export default class VerticalBox extends THREE.Group {
 
 
     const matLine = new LineMaterial({
     const matLine = new LineMaterial({
       color: 0xe44d54,
       color: 0xe44d54,
-      linewidth: 3, // in world units with size attenuation, pixels otherwise
+      linewidth: 4, // in world units with size attenuation, pixels otherwise
       dashed: false,
       dashed: false,
       alphaToCoverage: true,
       alphaToCoverage: true,
     });
     });

+ 12 - 5
src/core/player/Player.js

@@ -177,7 +177,7 @@ export default class Player {
     this.inited = true;
     this.inited = true;
     this.matLine = new LineMaterial({
     this.matLine = new LineMaterial({
       color: this.lineColor,
       color: this.lineColor,
-      linewidth: 3, // in world units with size attenuation, pixels otherwise
+      linewidth: 4, // in world units with size attenuation, pixels otherwise
       dashed: false,
       dashed: false,
       alphaToCoverage: true,
       alphaToCoverage: true,
     });
     });
@@ -488,7 +488,7 @@ export default class Player {
     e.y = 5;
     e.y = 5;
     const matLine = new LineMaterial({
     const matLine = new LineMaterial({
       color: this.lineColor,
       color: this.lineColor,
-      linewidth: 3, // in world units with size attenuation, pixels otherwise
+      linewidth: 4, // in world units with size attenuation, pixels otherwise
       dashed: false,
       dashed: false,
       alphaToCoverage: true,
       alphaToCoverage: true,
     });
     });
@@ -574,9 +574,9 @@ export default class Player {
       if (this.activeEdges.length > 0) {
       if (this.activeEdges.length > 0) {
         this.activeEdges.forEach((edge) => {
         this.activeEdges.forEach((edge) => {
           const exist = imgList.find((item) => item.userData === edge.id);
           const exist = imgList.find((item) => item.userData === edge.id);
-          // console.log("exist", exist);
           if (exist) {
           if (exist) {
             let others = [0, 1, 2, 3].filter((x) => !edge.dir.includes(x));
             let others = [0, 1, 2, 3].filter((x) => !edge.dir.includes(x));
+            // console.log("others", others);
             edge.dir.forEach((dir) => {
             edge.dir.forEach((dir) => {
               exist.touchLines.children[dir].visible = true;
               exist.touchLines.children[dir].visible = true;
             });
             });
@@ -623,10 +623,17 @@ export default class Player {
         if (uni_dir.length > 0) {
         if (uni_dir.length > 0) {
           this.activeEdges[egIndex].dir = uni_dir;
           this.activeEdges[egIndex].dir = uni_dir;
         } else {
         } else {
+          console.log("全空", this.activeEdges[egIndex].id);
+          let imgList = this.scene.boxManager.imgList;
+          const image = imgList.find(
+            (item) => item.userData === this.activeEdges[egIndex].id
+          );
+          image.touchLines.children.forEach((line) => {
+            line.visible = false;
+          });
           this.activeEdges.splice(egIndex, 1);
           this.activeEdges.splice(egIndex, 1);
+          this.update();
         }
         }
-        console.log("exist", this.activeEdges);
-        // this.showAllActiveEdges();
       }
       }
     }
     }
     if (type === 3) {
     if (type === 3) {

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

@@ -245,7 +245,7 @@ const renderCanvas = () => {
     console.log("autoSave");
     console.log("autoSave");
     handleAutoSave();
     handleAutoSave();
   });
   });
-  scene.on("submitScreenshot", () => {
+  scene.on("submitScreenshot", (save) => {
     if (window.scene) {
     if (window.scene) {
       const params = {
       const params = {
         files: window.scene.blobScreens.map(
         files: window.scene.blobScreens.map(
@@ -261,7 +261,10 @@ const renderCanvas = () => {
           const { data, code } = res;
           const { data, code } = res;
           const title = `${props.title}-照片卷.jpg`;
           const title = `${props.title}-照片卷.jpg`;
           if (data && data.imgUrl) {
           if (data && data.imgUrl) {
-            saveAs(data.imgUrl, title);
+            if (save) {
+              debugger;
+              saveAs(data.imgUrl, title);
+            }
           }
           }
           window.scene.endScreenshot();
           window.scene.endScreenshot();
         } catch (error) {
         } catch (error) {
@@ -351,8 +354,12 @@ const handleSave = async () => {
       data: data,
       data: data,
       isHorizontal: !sortType.value,
       isHorizontal: !sortType.value,
     });
     });
-    ElMessage.success("保存成功!");
+
     console.log("res", res);
     console.log("res", res);
+    if (newlist.value.length > 0) {
+      window.scene.exportScreenshot(false);
+    }
+    ElMessage.success("保存成功!");
   }
   }
 };
 };