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