| | |
| | | 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) |
| | |
| | | if (!curr.pptRemark) return prev; |
| | | |
| | | // 去除所有SSML标签,只保留文本内容 |
| | | const plainText = curr.pptRemark.replace(/<[^>]+>/g, ''); |
| | | const plainText = curr.pptRemark; |
| | | return prev + plainText.length; |
| | | }, 0) |
| | | //视频时长换算 |
| | |
| | | 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() // 选择的数字人 |
| | |
| | | 2: '2' |
| | | } |
| | | }) |
| | | const removeHtmlTags= (html) =>{ |
| | | const parser = new DOMParser(); |
| | | const doc = parser.parseFromString(html, 'text/html'); |
| | | return doc.body.textContent || ""; |
| | | } |
| | | |
| | | const saveSubmit = async (type) => { |
| | | // 检查场景是否为空 |
| | |
| | | |
| | | 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, |
| | |
| | | originWidth: item.width, |
| | | originHeight: item.height, |
| | | color: '#ffffff', |
| | | pptRemark: editorHtml.elemToHtml(item.pptRemark) |
| | | pptRemark: item.pptRemark |
| | | }, |
| | | |
| | | components: [ |
| | | { |
| | | ...cloneDeep(digitalHumanComponents), // 深拷贝 |
| | |
| | | speech_rate: voiceData.speechRate, |
| | | volume: voiceData.volume, |
| | | smartSpeed: '', |
| | | textJson: editorHtml.elemToHtml(item.pptRemark), |
| | | textJson: item.pptRemark, |
| | | }, |
| | | audioDriver: { |
| | | fileName: item.fileList && item.fileList[0]?.name, |
| | |
| | | editorRef.value.insertNode(node); |
| | | editorRef.value.move(1); |
| | | } |
| | | // 定义 createAudio 异步函数 |
| | | const createAudio = async () => { |
| | | // 获取编辑器文本内容 |
| | | const text = editorRef.value.getText(); |
| | |
| | | console.error('API 请求失败:', error); |
| | | showAudioPlay1.value = false; |
| | | } |
| | | }; |
| | | } |
| | | //取消试听 |
| | | const pauseAudio = () => { |
| | | currentAudio.value.pause() |