du
2025-03-27 7beaae553ac24855a7e94af934b6000530e9eb11
文本
已修改1个文件
32 ■■■■■ 文件已修改
easegen-front/src/views/chooseTemplate/index.vue 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
easegen-front/src/views/chooseTemplate/index.vue
@@ -1111,12 +1111,6 @@
        PPTArr.value = res
        PPTArr.value[0].isActive = true
        selectPPT.value = PPTArr.value[0]
        const htmlContent = PPTArr.value[0].pptRemark;
        // 创建一个临时的 DOM 元素
        const tempDiv = document.createElement('div');
        tempDiv.innerHTML = htmlContent;
        // 获取纯文本内容
        selectPPT.value.pptRemark = tempDiv.textContent;
        console.log('selectPPT.value', selectPPT.value)
        showLeftList.value = true
        clearInterval(schedulePPTTimer.value)
@@ -1143,7 +1137,7 @@
      if (!curr.pptRemark) return prev;
      // 去除所有SSML标签,只保留文本内容
      const plainText = curr.pptRemark.replace(/<[^>]+>/g, '');
      const plainText = curr.pptRemark;
      return prev + plainText.length;
    }, 0)
    //视频时长换算
@@ -1250,13 +1244,6 @@
      child.isActive = false
    }
  })
  console.log(item)
  const htmlContent = item.pptRemark;
  // 创建一个临时的 DOM 元素
  const tempDiv = document.createElement('div');
  tempDiv.innerHTML = htmlContent;
  // 获取纯文本内容
  item.pptRemark = tempDiv.textContent;
  selectPPT.value = item
}
const selectHost = ref() // 选择的数字人
@@ -1354,6 +1341,11 @@
    2: '2'
  }
})
const removeHtmlTags= (html) =>{
  const parser = new DOMParser();
  const doc = parser.parseFromString(html, 'text/html');
  return doc.body.textContent || "";
}
const saveSubmit = async (type) => {
  // 检查场景是否为空
@@ -1430,7 +1422,9 @@
        const innerPictureCom = item.innerPicture
        console.log('innerPictureCom:', JSON.stringify(innerPictureCom))
        console.log(item.pptRemark)
        item.pptRemark = removeHtmlTags(item.pptRemark)
        console.log(plainText)
        const formatItem = {
          background: {
            backgroundType: item.backgroundType,
@@ -1443,8 +1437,9 @@
            originWidth: item.width,
            originHeight: item.height,
            color: '#ffffff',
            pptRemark: editorHtml.elemToHtml(item.pptRemark)
            pptRemark: item.pptRemark
          },
          components: [
            {
              ...cloneDeep(digitalHumanComponents), // 深拷贝
@@ -1474,7 +1469,7 @@
            speech_rate: voiceData.speechRate,
            volume: voiceData.volume,
            smartSpeed: '',
            textJson: editorHtml.elemToHtml(item.pptRemark),
            textJson: item.pptRemark,
          },
          audioDriver: {
            fileName: item.fileList && item.fileList[0]?.name,
@@ -1700,7 +1695,6 @@
    editorRef.value.insertNode(node);
    editorRef.value.move(1);
}
// 定义 createAudio 异步函数
const createAudio = async () => {
  // 获取编辑器文本内容
  const text = editorRef.value.getText();
@@ -1754,7 +1748,7 @@
    console.error('API 请求失败:', error);
    showAudioPlay1.value = false;
  }
};
}
//取消试听
const pauseAudio = () => {
  currentAudio.value.pause()