qinyan 1 рік тому
батько
коміт
cfafe7ebf9

+ 4 - 0
src/modules/resource/http.ts

@@ -58,6 +58,10 @@ export const http = ResourceModule.http({
     return this.request(`/h5/delete/${id}`, { method: "POST" });
   },
 
+  copyPromotion(id: string) {
+    return this.request(`/h5/copy/${id}`, { method: "POST" });
+  },
+
   publishPromotion(id: string, publish: boolean) {
     return this.request("/sys/h5/publish", {
       method: "POST",

+ 3 - 0
src/pages/website/Promotion2/components/PromotionItem.tsx

@@ -109,6 +109,9 @@ export default defineUI({
                   <Menu.Item>
                     <div onClick={() => emit("menu", "stat")}>统计分析</div>
                   </Menu.Item>
+                  <Menu.Item>
+                    <div onClick={() => emit("menu", "copy")}>复制作品</div>
+                  </Menu.Item>
                   <Menu.Item>
                     <div onClick={() => emit("menu", "edit")}>编辑</div>
                   </Menu.Item>

+ 4 - 0
src/pages/website/Promotion2/controller.tsx

@@ -53,6 +53,10 @@ export function createPromotinController(
         await resource.actions.deletePromotion(record);
         ctrl.ListCtrl.fresh();
         break;
+      case "copy":
+        await resource.https.copyPromotion(record._id);
+        ctrl.ListCtrl.loadPage(1);
+        break;
       case "rename":
         await resource.actions.renamePromotion(record);
         break;