| | |
| | | |
| | | // 编辑器模式 |
| | | mode: "default", |
| | | fileList:[], |
| | | fileList: [], |
| | | // 工具栏配置 |
| | | toolbarConfig: { |
| | | excludeKeys: [ |
| | |
| | | |
| | | if (response.data && response.data.url) { |
| | | let imgUrl = response.data.url; |
| | | // imgUrl = imgUrl.replace( |
| | | // "http://218.108.11.22:8093/profile-api/upload", |
| | | // "http://192.88.117.236:8090/prod-api/profile/upload" |
| | | // ); |
| | | imgUrl = imgUrl.replace( |
| | | "http://218.108.11.22:8093/profile-api/upload", |
| | | "http://192.168.191.181:8095/profile/upload" |
| | | "http://m.zjtongde.com:13871/prod-api/profile/upload", |
| | | "http://192.88.117.236:8090/prod-api/profile/upload" |
| | | ); |
| | | insertFn(imgUrl); |
| | | } |
| | |
| | | options: [], |
| | | optionstag: [], |
| | | // 内网的部分(文件) |
| | | oldPattern: "http://192.168.191.181:8095/profile/upload", |
| | | // oldPattern: "http://192.168.191.181:8095/profile/upload", |
| | | oldPattern: "http://192.88.117.236:8090/prod-api/profile/upload", |
| | | // 内网的部分(文件) |
| | | oldPatternhtml: "/http:\/\/192\.168\.191\.181:8095\/profile\/upload\//g", |
| | | oldPatternhtml: "/http:\/\/192\.88\.117\.236:8095\/profile\/upload\//g", |
| | | // 外网部分(文件) |
| | | newPattern: "http://218.108.11.22:8093/profile-api/upload", |
| | | // newPattern: "http://218.108.11.22:8093/profile-api/upload",、、新华 |
| | | newPattern: "http://m.zjtongde.com:13871/prod-api/profile/upload", |
| | | |
| | | xjxsoptions: [ |
| | | { |
| | |
| | | // ------------------ |
| | | |
| | | // let html = |
| | | // '<p>测试</p><video class="ql-video" controls="controls" controlslist="nofullscreen" type="video/mp4" style="object-fit:fill;width: 100%;" preload="auto" playsinline="true" x-webkit-airplay="allow" x5-video-orientation="portraint" x5-playsinline="true" x5-video-player-fullscreen="true" src="http://192.168.191.181:8095/profile/upload/vadio/营养泵介绍.mp4"></video><p>测试111</p><video class="ql-video" controls="controls" controlslist="nofullscreen" type="video/mp4" style="object-fit:fill;width: 100%;" preload="auto" playsinline="true" x-webkit-airplay="allow" x5-video-orientation="portraint" x5-playsinline="true" x5-video-player-fullscreen="true" src="http://192.168.191.181:8095/profile/upload/vadio/注射器推注.mp4"></video><p><br></p>'; |
| | | // '<p>测试</p><video class="ql-video" controls="controls" controlslist="nofullscreen" type="video/mp4" style="object-fit:fill;width: 100%;" preload="auto" playsinline="true" x-webkit-airplay="allow" x5-video-orientation="portraint" x5-playsinline="true" x5-video-player-fullscreen="true" src="http://192.88.117.236:8090/prod-api/profile/upload/vadio/营养泵介绍.mp4"></video><p>测试111</p><video class="ql-video" controls="controls" controlslist="nofullscreen" type="video/mp4" style="object-fit:fill;width: 100%;" preload="auto" playsinline="true" x-webkit-airplay="allow" x5-video-orientation="portraint" x5-playsinline="true" x5-video-player-fullscreen="true" src="http://192.88.117.236:8090/prod-api/profile/upload/vadio/注射器推注.mp4"></video><p><br></p>'; |
| | | // // html = html.parserdom(this.oldPattern, this.newPattern); |
| | | // html = this.parserdom(html); |
| | | // console.log(html, "html"); |
| | |
| | | var doc = parser.parseFromString(html, "text/html"); |
| | | |
| | | // 定义要替换的新旧URL |
| | | var oldUrlBase = "http://192.168.191.181:8095/profile/upload"; |
| | | var newUrlBase = "http://218.108.11.22:8093/profile-api/upload"; |
| | | var oldUrlBase = this.oldPattern; |
| | | // var newUrlBase = "http://218.108.11.22:8093/profile-api/upload"; |
| | | var newUrlBase = this.newPattern; |
| | | |
| | | // 获取所有的video元素 |
| | | var videos = doc.querySelectorAll("video"); |
| | | var images = doc.querySelectorAll("img"); |
| | | |
| | | // 遍历所有的video元素并替换src属性 |
| | | videos.forEach(function (video) { |
| | | var src = video.getAttribute("src"); |
| | | if (src.startsWith(oldUrlBase)) { |
| | | video.setAttribute("src", src.replace(oldUrlBase, newUrlBase)); |
| | | } |
| | | }); |
| | | console.log(images,'images'); |
| | | |
| | | images.forEach(function (img) { |
| | | var src = img.getAttribute("src"); |
| | | if (src.startsWith(oldUrlBase)) { |
| | | img.setAttribute("src", src.replace(oldUrlBase, newUrlBase)); |
| | | } |
| | | }); |
| | | |
| | |
| | | fileName: this.generateRandomHtmlFilename(), |
| | | }).then((res) => { |
| | | this.ruleForm.richText = res.msg; |
| | | this.ruleForm.richText = res.msg.replace( |
| | | this.oldPattern, |
| | | this.newPattern |
| | | ); |
| | | console.log(this.ruleForm.richText, "this.ruleForm.richText"); |
| | | // 处理内网html |
| | | addrichText({ |