From 30ec98b0f9f2515c1408ee2253d22c524ba5e1b2 Mon Sep 17 00:00:00 2001
From: zhangjq <z16372660229@163.com>
Date: 星期六, 07 二月 2026 18:30:35 +0800
Subject: [PATCH] “修改文案编辑获取和合同筛选文案1”

---
 src/views/copywriting/generated/index.vue |   41 +++++++++++++++++++++++++++++++++++++----
 1 files changed, 37 insertions(+), 4 deletions(-)

diff --git a/src/views/copywriting/generated/index.vue b/src/views/copywriting/generated/index.vue
index 579c3bf..3621b59 100644
--- a/src/views/copywriting/generated/index.vue
+++ b/src/views/copywriting/generated/index.vue
@@ -174,6 +174,11 @@
         this.fromReview,
         this.outWord
       );
+      
+      // 濡傛灉鏄潵鑷紪杈戞寜閽烦杞笖娌℃湁鏂囨鍐呭锛屽皾璇曟牴鎹甀D鑾峰彇鏂囨璇︽儏
+      if (this.fromEdit && !this.editorContent && this.id) {
+        this.loadCopywritingDetail(this.id);
+      }
 
       // 浠庤矾鐢卞弬鏁拌幏鍙栭檮浠朵俊鎭�
       const selectedAttachmentId = this.$route.query.selectedAttachmentId;
@@ -499,10 +504,6 @@
           this.attachmentLoading = false;
         }
       },
-
-      /**
-       * 闄勪欢閫夋嫨鍙樺寲浜嬩欢
-       */
       handleAttachmentChange(value) {
         this.selectedAttachment = value;
         // 鏇存柊瀹㈡埛璧勬枡闄勪欢
@@ -518,6 +519,38 @@
           console.log('宸叉洿鏂板鎴疯祫鏂欓檮浠�:', this.jianli);
         }
       },
+      
+      // 鏍规嵁ID鍔犺浇鏂囨璇︽儏
+      async loadCopywritingDetail(id) {
+        try {
+          this.loading = true;
+          // 璋冪敤鏂囨璇︽儏鎺ュ彛鑾峰彇鏈�鏂板唴瀹�
+          const response = await defHttp.get({
+            url: '/copywriting/copywriting/list',
+            params: {
+              id: id
+            }
+          });
+          
+          if (response?.records && response.records.length > 0) {
+            const copywriting = response.records[0];
+            // 鏇存柊缂栬緫鍣ㄥ唴瀹�
+            if (copywriting.text) {
+              this.editorContent = copywriting.text;
+              console.log('宸插姞杞芥枃妗堣鎯�:', copywriting.text);
+            }
+            // 鏇存柊鏍囬
+            if (copywriting.title) {
+              this.title = copywriting.title;
+            }
+          }
+        } catch (error) {
+          console.error('鍔犺浇鏂囨璇︽儏澶辫触:', error);
+          message.warning('鍔犺浇鏂囨璇︽儏澶辫触锛岀紪杈戝櫒鍙兘涓虹┖');
+        } finally {
+          this.loading = false;
+        }
+      },
     },
   };
 </script>

--
Gitblit v1.8.0