WXL (wul)
2026-05-07 ecbcc059d43f64877551756de129c653d31d0032
src/views/knowledge/education/index.vue
@@ -1,6 +1,5 @@
<template>
  <div class="educationmanagement">
    <!-- 左侧栏 -->
    <div class="sidecolumn">
      <div class="sidecolumn-top">
@@ -785,9 +784,9 @@
      });
    },
         Newcategory(){
      this.classifyform= {}, //类别表单
      this.radio = "主分类";
     this.dialogFormVisible = true
      (this.classifyform = {}), //类别表单
        (this.radio = "主分类");
      this.dialogFormVisible = true;
     this.zifon = true;
      this.zufon = true;
    },
@@ -800,9 +799,8 @@
        .then((response) => {
          console.log(response.data, "数据"); // 输出获取到的文件内容
          this.htmlRichText = response.data;
          // this.htmlRichText = this.addStyleToImages(this.htmlRichText);
          console.log(this.htmlRichText);
          this.htmlRichText = this.addStyleToImages(this.htmlRichText);
          // console.log(this.htmlRichText);
        })
        .catch((error) => {
          this.$modal.msgError("获取富文本失败");
@@ -810,10 +808,21 @@
        });
    },
    addStyleToImages(html) {
      return html.replace(
      if (!html) return html;
      // 1. 先修复路径
      let processedHtml = html.replace(
        /\/aifollowup\/aifollowup\//g,
        "/aifollowup/"
      );
      // 2. 再修复样式
      processedHtml = processedHtml.replace(
        /<img([^>]*)style=(['"])(?:(?!\2).)*\2([^>]*)>/g,
        '<img$1style="width:100%;height:auto;"$3>'
      );
      return processedHtml;
    },
    /** 删除按钮操作 */