From 8c4d603b7a5be04bcfc0a1ba1243d5afb7daa36b Mon Sep 17 00:00:00 2001
From: du <13220750630.163.com>
Date: 星期四, 27 三月 2025 11:23:50 +0800
Subject: [PATCH] 口播内容

---
 easegen-front/src/views/chooseTemplate/index.vue |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/easegen-front/src/views/chooseTemplate/index.vue b/easegen-front/src/views/chooseTemplate/index.vue
index bdfda27..c8d860e 100644
--- a/easegen-front/src/views/chooseTemplate/index.vue
+++ b/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) {
           // 鍘婚櫎鎵�鏈塇TML鏍囩鍜孲SML鏍囩鍚庡啀鍒ゆ柇鍐呭鏄惁涓虹┖
-          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>鏃犳湁鏁堢殑鍙f挱鍐呭`
             )

--
Gitblit v1.9.3