Forráskód Böngészése

feat:图纸历史记录

ananzhusen 1 éve
szülő
commit
8f5a908e4f

+ 2 - 1
src/services/api.ts

@@ -55,10 +55,11 @@ export async function getCollectionList(
   return await axios.post(`/api/data/${collection}/list`, data, config);
 }
 
-export async function getLe5leV(id: string, projection?: any) {
+export async function getLe5leV(id: string, projection?: any, historyId?: string) {
   return await axios.post('/api/data/v/get', {
     id,
     projection,
+    historyId
   });
 }
 

+ 3 - 1
src/services/common.ts

@@ -634,7 +634,7 @@ export const save = async (
   });
   
   // data.childIds = childIds;
-  const body = {
+  const body:any = {
     data,
     image:data.image,
     name:data.name,
@@ -668,6 +668,8 @@ export const save = async (
     // } else
     
     if (data.id || data._id) {
+      body.ownerId = data.ownerId;
+      body.ownerName = data.ownerName;
       ret = await updateCollection(collection, {id:data.id || data._id,...body});
     } else {
       ret = await addCollection(collection, body); // 新增

+ 1 - 0
src/services/utils.ts

@@ -36,6 +36,7 @@ export interface Meta2dBackData extends Meta2dData {
   tags?: string[]; //标签数组
   filename?: string; //后端存储的文件名
   ownerId?:string;
+  ownerName?:string;
   case?:string;
 }
 

+ 2 - 1
src/views/components/View.vue

@@ -1066,7 +1066,7 @@ const open = async (flag: boolean = false) => {
     if (route.query.c) {
       ret = await getComponents(route.query.id + '');
     } else {
-      ret = await getLe5leV(route.query.id + '');
+      ret = await getLe5leV(route.query.id + '',undefined , route.query.historyId as string);
     }
     if (ret) {
       if (!(ret.data.pens && ret.data.pens.length)) {
@@ -1080,6 +1080,7 @@ const open = async (flag: boolean = false) => {
       ret.data.name = ret.name;
       ret.data.image = ret.image;
       ret.data.ownerId = ret.ownerId;
+      ret.data.ownerName = ret.ownerName;
       ret.data.case = ret.case;
       if(!ret.data.background){
         ret.data.background = '#1e2430';