ananzhusen 1 ano atrás
pai
commit
8c272177f4
2 arquivos alterados com 11 adições e 2 exclusões
  1. 8 1
      src/services/common.ts
  2. 3 1
      src/views/components/Graphics.vue

+ 8 - 1
src/services/common.ts

@@ -338,7 +338,14 @@ export const save = async (
     }
     await axios.post('/api/data/folders/update', {
       _id: _folderId,
-      list: _list,
+      list: _list.map((el) => {
+        return {
+          name: el.name,
+          id: el._id || el.id,
+          image: el.image,
+          component: el.component,
+        };
+      }),
     });
   }
   //  保存图纸之后的钩子函数

+ 3 - 1
src/views/components/Graphics.vue

@@ -565,6 +565,7 @@ const getImageList = async () => {
       );
       let list = _ret.list.map((_item) => {
         return {
+          ..._item,
           image: _item.metadata.url,
           visible: true,
           folder: item.fullpath,
@@ -1381,7 +1382,7 @@ const delComponent = async () => {
       }
     );
     await axios.post(`/api/files/delete`, {
-      filenames: [delDialog.contextmenuObj.component.image],
+      filenames: [delDialog.contextmenuObj.component.filename],
       physically: false,
     });
   }
@@ -1547,6 +1548,7 @@ const fileSuccessed = async (content: any) => {
     }
   } else if (activedGroup.value === '图片') {
     uploadGroup.list.push({
+      ...content.response,
       image: content.response.url,
       visible: true,
       folder: content.response.metadata.directory,