| | |
| | | ]; |
| | | |
| | | export default { |
| | | name: "Educationinfo", |
| | | name: "aEducationinfo", |
| | | components: { OptionalForm }, |
| | | data() { |
| | | return { |
| | |
| | | this.dynamicTags = res.data[0].heLibraryTagList.map( |
| | | this.processElement |
| | | ); |
| | | this.Getmissioncontent(this.ruleForm.richText); |
| | | this.Getmissioncontent(this.ruleForm.htmlRichText); |
| | | if (this.ruleForm.deptNames) { |
| | | this.tempDetpRelevanceslist = JSON.parse(this.ruleForm.deptNames); |
| | | } |
| | |
| | | this.ruleForm.suitway.length != 0 |
| | | ? this.ruleForm.suitway.join(",") |
| | | : ""; |
| | | |
| | | this.fileName = this.fileName ? this.fileName : "测试.html"; |
| | | addrichText({ |
| | | content: this.content, |
| | | fileName: this.fileName ? this.fileName : "测试.html", |
| | | fileName: this.ensureHtmlExtension(this.fileName), |
| | | }).then((res) => { |
| | | this.ruleForm.richText = res.msg; |
| | | this.ruleForm.htmlRichText = this.replaceIpAndPort(res.msg); |
| | | if (this.id) { |
| | | this.ruleForm.isoperation = 2; |
| | | compilelibrary(this.ruleForm).then((res) => { |
| | |
| | | } |
| | | }); |
| | | }, |
| | | replaceIpAndPort(path) { |
| | | // 正则表达式匹配IP地址和端口 |
| | | const ipPortRegex = /(\b(?:\d{1,3}\.){3}\d{1,3}(?::\d+)?)/; |
| | | // 替换为指定的IP地址和端口 |
| | | return path.replace(ipPortRegex, "192.168.191.181:8095"); |
| | | }, |
| | | ensureHtmlExtension(filename) { |
| | | // 检查文件名是否以.mp4结尾 |
| | | if (filename.toLowerCase().endsWith(".mp4")) { |
| | | // 如果是,不进行任何更改 |
| | | return filename; |
| | | } |
| | | // 否则,检查是否以.html结尾 |
| | | if (!filename.toLowerCase().endsWith(".html")) { |
| | | // 如果不是,添加.html后缀 |
| | | filename += ".html"; |
| | | } |
| | | return filename; |
| | | }, |
| | | |
| | | // 保存疾病 |
| | | confirmillness(guid) { |
| | | this.illnesslist.forEach((item, index) => { |
| | |
| | | <el-dialog title="模板预览" :visible.sync="previewtf" width="60%"> |
| | | <div class="preview-left"> |
| | | <!-- 单选 --> |
| | | <div v-html="richText"></div> |
| | | <div v-html="htmlRichText"></div> |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="previewGo">前往模板详情修改</el-button> |
| | |
| | | checkboxlist: [], |
| | | tableLabel: [], |
| | | questionList: [], |
| | | richText: "<p>Hello, <strong>world</strong>!</p>", |
| | | htmlRichText: "<p>Hello, <strong>world</strong>!</p>", |
| | | // 患者表单 |
| | | tableLabelhz: [ |
| | | // { label: "序号", width: "", prop: "patid" }, |
| | |
| | | selectfn(row, type) { |
| | | // 模板情况下获取模板信息 |
| | | this.libName = row.preachname; |
| | | this.richText = null; |
| | | this.htmlRichText = null; |
| | | this.libId = row.id; |
| | | console.log(row, "row"); |
| | | this.Tasktemplate = row; |
| | |
| | | this.previewid = row.svyid; |
| | | console.log(this.questionList, "questionList"); |
| | | // this.Variablehandling(row.svyLibScripts, 1); |
| | | console.log(row.richText); |
| | | console.log(row.htmlRichText); |
| | | axios |
| | | .get(row.richText) |
| | | .get(row.htmlRichText) |
| | | .then((response) => { |
| | | console.log(response.data, "数据"); // 输出获取到的文件内容 |
| | | this.richText = response.data; |
| | | this.richText = this.addStyleToImages(this.richText); |
| | | this.htmlRichText = response.data; |
| | | this.htmlRichText = this.addStyleToImages(this.htmlRichText); |
| | | }) |
| | | .catch((error) => { |
| | | this.$modal.msgError("获取富文本失败"); |