ソースを参照

feat(draw): update

gemercheung 1 年間 前
コミット
64cdabf7ab

+ 1 - 1
src/core/Scene.js

@@ -68,7 +68,7 @@ export default class Scene extends Mitt {
 
   load = (list, type, data) => {
     if (!list) return;
-    console.log("scene: ", list, type);
+    console.log("scene: ", list, type, data);
     //axesHeloer
     this.clearScene();
     this.sceneType = type;

+ 2 - 1
src/core/box/object/LinePoints.js

@@ -55,9 +55,10 @@ export default class LinePoints extends Line2 {
     }
     const geometry = new LineGeometry();
     cross.visible = false;
-    console.log("points", points);
+    // console.log("points", points);
     geometry.setPositions(points);
     super(geometry, matLine);
+    this.name = "line_" + this.uuid;
     this.scale.set(1, 1, 1);
     this.position.y += 0.5;
     this.add(cross);

+ 2 - 2
src/core/box/object/marker.js

@@ -21,8 +21,8 @@ export default class Marker extends THREE.Mesh {
     this.visible = true;
     this.scale.set(1, 1, 1);
     this.position.y += 0.5;
-    this.name = "marker_";
+    this.name = "marker_" + this.uuid;
     this.renderOrder = 1000;
-    console.log(this, this.position);
+    // console.log(this, this.position);
   }
 }

+ 2 - 0
src/request/urls.ts

@@ -194,8 +194,10 @@ export const caseExtractDetailOpt = "/fusion-xj/caseExtractDetail/saveOrUpdate";
 export const caseExtractDetailExport = "/fusion-xj/caseExtractDetail/downDocx";
 
 //标注
+export const getCaseImgTag = "/fusion-xj/caseImgTag/info";
 export const saveCaseImgTag = "/fusion-xj/caseImgTag/saveOrUpdate";
 
+
 // 火调链接地址设置密码
 export const setCasePsw = "/fusion-xj/web/fireProject/updateRandomCode";
 export const getCasePsw = "/fusion-xj/web/fireProject/getRandCode";

+ 6 - 2
src/store/case.ts

@@ -18,7 +18,8 @@ import {
   caseExtractDetailOpt,
   caseExtractDetailExport,
   copyExample,
-  saveCaseImgTag
+  saveCaseImgTag,
+  getCaseImgTag
 } from "@/request";
 import { ModelScene, QuoteScene, Scene, SceneType } from "./scene";
 import { CaseFile } from "./caseFile";
@@ -131,4 +132,7 @@ export const exportCaseDetailInfo = (caseId: number) =>
 // 
 
 export const saveCaseImgTagData = (params: any) =>
-  axios.post(saveCaseImgTag, { ...params });
+  axios.post(saveCaseImgTag, { ...params });
+
+export const getCaseImgTagData = (caseId: number) =>
+  axios.get(getCaseImgTag, { params: { caseId } });

+ 7 - 4
src/view/case/photos/index.vue

@@ -78,7 +78,7 @@ import { Swiper, SwiperSlide } from "swiper/vue";
 import "swiper/css";
 // import { addCaseFile } from "@/store/caseFile";
 import { addCaseImgFile } from "../quisk";
-import { saveCaseImgTagData } from "@/store/case";
+import { saveCaseImgTagData, getCaseImgTagData } from "@/store/case";
 import Scene from "@/core/Scene.js";
 import draggable from "./draggable.vue";
 const props = defineProps({ caseId: Number });
@@ -111,7 +111,7 @@ function refresh() {
     childRef.value.getList();
   }
 }
-const changeList = (list) => {
+const changeList = async (list) => {
   let newList = [];
   list.map((item, index) => {
     if (sortType.value) {
@@ -127,14 +127,17 @@ const changeList = (list) => {
   const arr = [];
   newList.map((i) => arr.push(JSON.parse(JSON.stringify(i))));
   const type = sortType.value ? 2 : 1;
+  const res = await getCaseImgTagData(caseId.value);
+
   if (scene) {
-    scene.load(arr, type);
-    console.log("changeList", arr, type);
+    scene.load(arr, type, res.data.data || []);
+    console.log("changeList", arr, type, res.data.data);
   }
 };
 const renderCanvas = () => {
   const canvas = document.getElementById("canvas");
   // console.log(canvas)
+
   scene = new Scene(canvas);
   scene.init();
   window.scene = scene;

+ 3 - 3
src/view/case/records/manifest.vue

@@ -152,7 +152,7 @@ const data = reactive({
 
   location: '',
   detail: [{
-    id: "1",
+    // id: "1",
     name: "",
     spec: "",
     num: "",
@@ -160,7 +160,7 @@ const data = reactive({
     desc: "",
   },
   {
-    id: "2",
+    // id: "2",
     name: "",
     spec: "",
     num: "",
@@ -224,7 +224,7 @@ const addwitnessInfo = () => {
 }
 const addItem = () => {
   data.detail.push({
-    id: "1",
+    // id: "1",
     name: "",
     spec: "",
     num: "",