zhangjq
2026-02-07 30ec98b0f9f2515c1408ee2253d22c524ba5e1b2
“修改文案编辑获取和合同筛选文案1”
1个文件已修改
41 ■■■■■ 已修改文件
src/views/copywriting/generated/index.vue 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/copywriting/generated/index.vue
@@ -174,6 +174,11 @@
        this.fromReview,
        this.outWord
      );
      // 如果是来自编辑按钮跳转且没有文案内容,尝试根据ID获取文案详情
      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>