du
2025-03-27 8c4d603b7a5be04bcfc0a1ba1243d5afb7daa36b
口播内容
已修改1个文件
19 ■■■■■ 文件已修改
easegen-front/src/views/chooseTemplate/index.vue 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
easegen-front/src/views/chooseTemplate/index.vue
@@ -1341,11 +1341,11 @@
    2: '2'
  }
})
const removeHtmlTags= (html) =>{
  const parser = new DOMParser();
  const doc = parser.parseFromString(html, 'text/html');
  return doc.body.textContent || "";
}
// const removeHtmlTags= (html) =>{
//   const parser = new DOMParser();
//   const doc = parser.parseFromString(html, 'text/html');
//   return doc.body.textContent || "";
// }
const saveSubmit = async (type) => {
  // 检查场景是否为空
@@ -1423,7 +1423,10 @@
        const innerPictureCom = item.innerPicture
        console.log('innerPictureCom:', JSON.stringify(innerPictureCom))
        console.log(item.pptRemark)
        item.pptRemark = removeHtmlTags(item.pptRemark)
        // item.pptRemark = removeHtmlTags(item.pptRemark)
        item.pptRemark = editorRef.value.getText()
        console.log( item.pptRemark)
        // item.pptRemark=item.pptRemark.replace(/<[^>]+>/g, '')
        const formatItem = {
          background: {
            backgroundType: item.backgroundType,
@@ -1541,8 +1544,8 @@
        }
        if (item.driverType == 1) {
          // 去除所有HTML标签和SSML标签后再判断内容是否为空
          const plainText = item.pptRemark
          if (!plainText || plainText === '') {
          const plainText = item.pptRemark ? item.pptRemark.replace(/<[^>]+>/g, '') : ''
          if (!plainText || plainText.trim() === '') {
            warningStrArr.push(
              `场景<span style="color: red; font-weight: bold;">${i + 1}</span>无有效的口播内容`
            )