WXL
2024-09-07 a49ce34b34915aaa940b969fc42ade4845cd2222
src/views/knowledge/education/compilequer/index.vue
@@ -408,7 +408,7 @@
];
export default {
  name: "Educationinfo",
  name: "aEducationinfo",
  components: { OptionalForm },
  data() {
    return {
@@ -585,7 +585,7 @@
          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);
          }
@@ -623,12 +623,13 @@
        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) => {
@@ -646,6 +647,26 @@
        }
      });
    },
    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) => {