WXL
2024-09-07 a49ce34b34915aaa940b969fc42ade4845cd2222
src/views/knowledge/education/compilequer/index.vue
@@ -408,14 +408,14 @@
];
export default {
  name: "Educationinfo",
  name: "aEducationinfo",
  components: { OptionalForm },
  data() {
    return {
      headers: {
        Authorization: "Bearer " + getToken(),
      },
      uploadImgUrl: process.env.VUE_APP_BASE_API + "/common/upload",
      uploadImgUrl: process.env.VUE_APP_BASE_API + "/common/uploadSort",
      uploadImgUrlword: process.env.VUE_APP_BASE_API + "/common/uploadShow",
      uploadUrlPath: "没有文件上传",
      quillUpdateImg: false,
@@ -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) => {
@@ -828,7 +849,7 @@
    // --------------------------
    // 预览模版
    // 预览模板
    PreviewTemplate() {
      this.drawer = true;
    },