소스 검색

feat(draw): update

gemercheung 1 년 전
부모
커밋
0ef7a1ad7c
2개의 변경된 파일13개의 추가작업 그리고 4개의 파일을 삭제
  1. 1 1
      src/core/player/Player.js
  2. 12 3
      src/view/case/photos/index.vue

+ 1 - 1
src/core/player/Player.js

@@ -425,7 +425,7 @@ export default class Player {
     this.scene.emit("data", data);
   }
   load(type, data) {
-    // this.clear();
+
     if (type === 1) {
       console.log("data1", data);
       const { hor_activeEdges, hor_lines, hor_markers } = data;

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

@@ -108,6 +108,7 @@ const addCaseFileHandler = async () => {
 };
 function refresh() {
   console.log("changeList", childRef.value);
+
   if (childRef.value) {
     childRef.value.getList();
   }
@@ -127,13 +128,21 @@ const changeList = async (list) => {
   newlist.value = newList;
   const arr = [];
   newList.map((i) => arr.push(JSON.parse(JSON.stringify(i))));
-  const type = sortType.value ? 2 : 1;
 
   if (!loadedDrawData.value) {
     const res = await getCaseImgTagData(caseId.value);
-    loadedDrawData.value = res.data ? res.data.data || [] : [];
+    if (res.data) {
+      if (res.data.data) {
+        loadedDrawData.value = res.data.data;
+      }
+      if ("isHorizontal" in res.data) {
+        sortType.value = !res.data.isHorizontal;
+      }
+    } else {
+      loadedDrawData.value = [];
+    }
   }
-
+  let type = sortType.value ? 2 : 1;
   if (scene) {
     scene.load(arr, type, loadedDrawData.value || []);
     console.log("changeList", arr, type, loadedDrawData.value);