Sfoglia il codice sorgente

chore(api): 适配“删除大屏和文件”接口

ccnnde 2 mesi fa
parent
commit
4963dfaf09
1 ha cambiato i file con 10 aggiunte e 10 eliminazioni
  1. 10 10
      src/views/components/Graphics.vue

+ 10 - 10
src/views/components/Graphics.vue

@@ -1736,22 +1736,22 @@ const onContextMenu = async (e: MouseEvent, group: any, item: any) => {
   }
 
   if(!(moveGroups['模板']&&moveGroups['模板'].length)){
-    let ret: { list: any[] } = await axios.post('/api/directory/list', {
+    let ret: any[] = await axios.post('/api/directory/list', {
         fullpath:"/大屏/模板",
     });
     moveGroups['模板'] = [];
-    ret.list.forEach((item)=>{
+    ret.forEach((item)=>{
       if(item.fullpath!=='/大屏/模板/默认'){
          moveGroups['模板'].push({name:item.fullpath.split('/')[3]})
       }
     });
   }
   if(!(moveGroups['方案']&&moveGroups['方案'].length)){
-    let ret: { list: any[] } = await axios.post('/api/directory/list', {
+    let ret: any[] = await axios.post('/api/directory/list', {
         fullpath:"/大屏/方案",
     });
     moveGroups['方案'] = [];
-    ret.list.forEach((item)=>{
+    ret.forEach((item)=>{
       if(item.fullpath!=='/大屏/方案/默认'){
          moveGroups['方案'].push({name:item.fullpath.split('/')[3]})
       }
@@ -1975,10 +1975,10 @@ const onMenu = async (val: string) => {
       } else if(!path.startsWith('/api/file')) {
         path = '/api/file' + path;
       }
-      await axios.patch(`${path}`, {
-        // filenames: [filename],
-        directory: `/大屏/${activedGroup.value}/${val || '默认'}`,
-      });
+      // await axios.patch(`${path}`, {
+      //   // filenames: [filename],
+      //   directory: `/大屏/${activedGroup.value}/${val || '默认'}`,
+      // });
       break;
   }
   contextmenu.activeValue = 0;
@@ -2044,7 +2044,7 @@ const _delComponent = async () => {
         }
       }
     );
-    await axios.post(`/api/files/delete`, {
+    await axios.post(`/api/file/delete`, {
       fullnames: [delDialog.contextmenuObj.component.filename],
       physically: true,
     });
@@ -2123,7 +2123,7 @@ const delComponent = async () => {
   if(fullname.startsWith('/api/file/')) {
     fullname = fullname.slice('/api/file/'.length);
   }
-  await axios.post(`/api/files/delete`, {
+  await axios.post(`/api/file/delete`, {
     fullnames: [fullname],
     physically: true,
   });