| | |
| | | <template> |
| | | <div class="educationmanagement"> |
| | | |
| | | <!-- 左侧栏 --> |
| | | <div class="sidecolumn"> |
| | | <div class="sidecolumn-top"> |
| | |
| | | }); |
| | | }, |
| | | Newcategory(){ |
| | | this.classifyform= {}, //类别表单 |
| | | this.radio = "主分类"; |
| | | this.dialogFormVisible = true |
| | | (this.classifyform = {}), //类别表单 |
| | | (this.radio = "主分类"); |
| | | this.dialogFormVisible = true; |
| | | this.zifon = true; |
| | | this.zufon = true; |
| | | }, |
| | |
| | | .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("获取富文本失败"); |
| | |
| | | }); |
| | | }, |
| | | 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; |
| | | }, |
| | | |
| | | /** 删除按钮操作 */ |