libushang před 2 dny
rodič
revize
a73ed1772f

+ 9 - 0
src/api/globalMap/onlinePlotting.ts

@@ -41,6 +41,15 @@ export const createPattern = (data) => {
   });
 };
 
+// 预案分享
+export const sharePattern = (data) => {
+  return request({
+    url: '/api/pattern/share',
+    method: 'post',
+    data: data
+  });
+};
+
 // 创建协同
 export const createCollaboration = (data) => {
   return request({

+ 12 - 1
src/views/globalMap/RightMenu/OnlinePlotting/index.vue

@@ -237,7 +237,8 @@ import {
   deletePatternById,
   getPatternInfo,
   getPatternList,
-  getTemplateTree
+  getTemplateTree,
+  sharePattern
 } from '@/api/globalMap/onlinePlotting';
 import { Search } from '@element-plus/icons-vue';
 import html2canvas from 'html2canvas';
@@ -966,6 +967,16 @@ const handleShareConfirm = (data) => {
     showForm.value = true;
   } else {
     // 分享
+    const userIdList = [];
+    data.forEach((item) => {
+      userIdList.push(item.userId);
+    });
+    console.log('分享', userIdList);
+    sharePattern({
+      "userIdList": userIdList
+    }).then((res)=>{
+      showSuccessMsg(res.msg);
+    });
   }
   shareState.type = '';
   shareState.id = '';