Jelajahi Sumber

表格带拼音标点包起来处理

natasha 3 hari lalu
induk
melakukan
4952633971

+ 793 - 7
src/views/book/courseware/preview/components/table/TablePreview.vue

@@ -54,7 +54,307 @@
                   <!-- , computedRichStyle(col.content) -->
                   <div class="cell-wrap-content" :style="[tdStyle(col.content)]">
                     <template v-if="isEnable(data.property.view_pinyin)">
-                      <template v-if="col.rich_text_list">
+                      <template v-if="col.new_rich_text_list && col.new_rich_text_list.length !== 0">
+                        <div
+                          v-for="(item, index) in col.new_rich_text_list"
+                          :key="index"
+                          class="pinyin-text pinyin-text-sentence"
+                          :class="[
+                            index === 0 ? 'pinyin-text-left' : '',
+                            item.type === 'audio' ? 'pinyin-text-audio' : '',
+                            item.type === 'newline' ? 'pinyin-text-br' : '',
+                          ]"
+                        >
+                          <!-- 文字块:包含 word_list -->
+                          <span
+                            v-if="item.type === 'text'"
+                            :key="'text-' + index"
+                            class="pinyin-sentence"
+                            :style="[
+                              { 'align-items': data.property.pinyin_position === 'top' ? 'flex-end' : 'flex-start' },
+                            ]"
+                          >
+                            <span
+                              v-for="(word, wIndex) in item.new_text_list"
+                              :key="wIndex"
+                              class="pinyin-text"
+                              :class="[
+                                word.text.trim() && word.isShow ? 'pinyin-text-padding' : '',
+                                item.new_text_list[wIndex + 1] &&
+                                item.new_text_list[wIndex + 1].text.trim() &&
+                                chsFhList.indexOf(item.new_text_list[wIndex + 1].text.trim()) > -1
+                                  ? 'pinyin-text-padding-left'
+                                  : '',
+                              ]"
+                            >
+                              <div v-if="word.isShow" class="table-words-box">
+                                <span
+                                  v-if="
+                                    item.new_text_list[wIndex - 1] &&
+                                    item.new_text_list[wIndex - 1].text &&
+                                    firstFhlist.indexOf(item.new_text_list[wIndex - 1].text) > -1 &&
+                                    item.new_text_list[wIndex - 2] &&
+                                    item.new_text_list[wIndex - 2].text &&
+                                    firstFhlist.indexOf(item.new_text_list[wIndex - 2].text) > -1
+                                  "
+                                  :style="{
+                                    flexDirection:
+                                      data.property.pinyin_position === 'top' ? 'column' : 'column-reverse',
+                                    'align-items': getWordAlignItems(item.new_text_list[wIndex - 2], item),
+                                    ...item.new_text_list[wIndex - 2].last_styleObj,
+                                  }"
+                                >
+                                  <span class="pinyin" :style="getPinyinStyle(item.new_text_list[wIndex - 2])">
+                                    {{
+                                      item.new_text_list[wIndex - 2].pinyin.trim() &&
+                                      item.new_text_list[wIndex - 2].showPinyin !== 'false'
+                                        ? item.new_text_list[wIndex - 2].pinyin
+                                        : '&nbsp;'
+                                    }}</span
+                                  >
+                                  <span class="py-char" :style="getCharStyle(item.new_text_list[wIndex - 2], item)">{{
+                                    convertText(item.new_text_list[wIndex - 2].text).trim()
+                                      ? convertText(item.new_text_list[wIndex - 2].text)
+                                      : '&nbsp;'
+                                  }}</span>
+                                </span>
+                                <span
+                                  v-if="
+                                    item.new_text_list[wIndex - 1] &&
+                                    item.new_text_list[wIndex - 1].text &&
+                                    firstFhlist.indexOf(item.new_text_list[wIndex - 1].text) > -1
+                                  "
+                                >
+                                  <span
+                                    :style="{
+                                      flexDirection:
+                                        data.property.pinyin_position === 'top' ? 'column' : 'column-reverse',
+                                      'align-items': getWordAlignItems(item.new_text_list[wIndex - 1], item),
+                                      ...item.new_text_list[wIndex - 1].last_styleObj,
+                                    }"
+                                  >
+                                    <span class="pinyin" :style="getPinyinStyle(item.new_text_list[wIndex - 1])">
+                                      {{
+                                        item.new_text_list[wIndex - 1].pinyin.trim() &&
+                                        item.new_text_list[wIndex - 1].showPinyin !== 'false'
+                                          ? item.new_text_list[wIndex - 1].pinyin
+                                          : '&nbsp;'
+                                      }}</span
+                                    >
+                                    <span class="py-char" :style="getCharStyle(item.new_text_list[wIndex - 1], item)">{{
+                                      convertText(item.new_text_list[wIndex - 1].text).trim()
+                                        ? convertText(item.new_text_list[wIndex - 1].text)
+                                        : '&nbsp;'
+                                    }}</span>
+                                  </span>
+                                </span>
+                                <span v-if="word.type === 'text'">
+                                  <span
+                                    :style="{
+                                      flexDirection:
+                                        data.property.pinyin_position === 'top' ? 'column' : 'column-reverse',
+                                      'align-items': getWordAlignItems(word, item),
+                                      ...word.last_styleObj,
+                                    }"
+                                  >
+                                    <span class="pinyin" :style="getPinyinStyle(word)">
+                                      {{
+                                        word.pinyin.trim() && word.showPinyin !== 'false' ? word.pinyin : '&nbsp;'
+                                      }}</span
+                                    >
+                                    <span class="py-char" :style="getCharStyle(word, item)">{{
+                                      convertText(word.text).trim() ? convertText(word.text) : '&nbsp;'
+                                    }}</span>
+                                  </span>
+                                </span>
+                                <span v-else-if="word.type === 'input'">
+                                  <span
+                                    v-if="data.property.pinyin_position === 'top'"
+                                    class="pinyin"
+                                    :style="getPinyinStyle(word)"
+                                    >&nbsp;</span
+                                  >
+                                  <template v-if="data.property.fill_type === fillTypeList[0].value">
+                                    <el-input
+                                      :key="index"
+                                      v-model="word.value"
+                                      :disabled="disabled"
+                                      :class="[...computedAnswerClass(word, i, j)]"
+                                      :style="getInputStyle(word.last_styleObj, word)"
+                                    />
+                                  </template>
+                                  <template v-else-if="data.property.fill_type === fillTypeList[1].value">
+                                    <el-popover :key="index" placement="top" trigger="click">
+                                      <div class="word-list">
+                                        <span
+                                          v-for="{ content, mark } in data.word_list"
+                                          :key="mark"
+                                          class="word-item"
+                                          @click="handleSelectWord(content, mark, word)"
+                                        >
+                                          {{ convertText(content) }}
+                                        </span>
+                                      </div>
+
+                                      <el-input
+                                        slot="reference"
+                                        v-model="word.value"
+                                        :readonly="true"
+                                        :class="[...computedAnswerClass(word, i, j)]"
+                                        :style="getInputStyle(word.last_styleObj, word)"
+                                      />
+                                    </el-popover>
+                                  </template>
+
+                                  <template v-else-if="data.property.fill_type === fillTypeList[2].value">
+                                    <span :key="j" class="write-click" @click="handleWriteClick(word)">
+                                      <img
+                                        v-show="word.write_base64"
+                                        style="background-color: #f4f4f4"
+                                        :src="word.write_base64"
+                                        alt="write-show"
+                                      />
+                                    </span>
+                                  </template>
+
+                                  <template v-else-if="data.property.fill_type === fillTypeList[3].value">
+                                    <SoundRecordBox
+                                      ref="record"
+                                      :key="j"
+                                      type="mini"
+                                      :many-times="false"
+                                      class="record-box"
+                                      :answer-record-list="data.audio_answer_list"
+                                      :task-model="isJudgingRightWrong ? 'ANSWER' : ''"
+                                      :attrib="data.unified_attrib"
+                                      @handleWav="handleMiniWav($event, word)"
+                                    />
+                                  </template>
+                                </span>
+                                <span
+                                  v-if="
+                                    item.new_text_list[wIndex + 1] &&
+                                    item.new_text_list[wIndex + 1].text &&
+                                    chsFhList.indexOf(item.new_text_list[wIndex + 1].text) > -1
+                                  "
+                                >
+                                  <span>
+                                    <span
+                                      :style="{
+                                        flexDirection:
+                                          data.property.pinyin_position === 'top' ? 'column' : 'column-reverse',
+                                        'align-items': getWordAlignItems(item.new_text_list[wIndex + 1], item),
+                                        ...item.new_text_list[wIndex + 1].last_styleObj,
+                                      }"
+                                    >
+                                      <span class="pinyin" :style="getPinyinStyle(item.new_text_list[wIndex + 1])">
+                                        {{
+                                          item.new_text_list[wIndex + 1].pinyin.trim() &&
+                                          item.new_text_list[wIndex + 1].showPinyin !== 'false'
+                                            ? item.new_text_list[wIndex + 1].pinyin
+                                            : '&nbsp;'
+                                        }}</span
+                                      >
+                                      <span
+                                        class="py-char"
+                                        :style="getCharStyle(item.new_text_list[wIndex + 1], item)"
+                                        >{{
+                                          convertText(item.new_text_list[wIndex + 1].text).trim()
+                                            ? convertText(item.new_text_list[wIndex + 1].text)
+                                            : '&nbsp;'
+                                        }}</span
+                                      >
+                                    </span>
+                                  </span>
+                                  <span
+                                    v-if="
+                                      item.new_text_list[wIndex + 2] &&
+                                      item.new_text_list[wIndex + 2].text &&
+                                      chsFhList.indexOf(item.new_text_list[wIndex + 2].text) > -1
+                                    "
+                                  >
+                                    <span
+                                      :style="{
+                                        flexDirection:
+                                          data.property.pinyin_position === 'top' ? 'column' : 'column-reverse',
+                                        'align-items': getWordAlignItems(item.new_text_list[wIndex + 2], item),
+                                        ...item.new_text_list[wIndex + 2].last_styleObj,
+                                      }"
+                                    >
+                                      <span class="pinyin" :style="getPinyinStyle(item.new_text_list[wIndex + 2])">
+                                        {{
+                                          item.new_text_list[wIndex + 2].pinyin.trim() &&
+                                          item.new_text_list[wIndex + 2].showPinyin !== 'false'
+                                            ? item.new_text_list[wIndex + 2].pinyin
+                                            : '&nbsp;'
+                                        }}</span
+                                      >
+                                      <span
+                                        class="py-char"
+                                        :style="getCharStyle(item.new_text_list[wIndex + 2], item)"
+                                        >{{
+                                          convertText(item.new_text_list[wIndex + 2].text).trim()
+                                            ? convertText(item.new_text_list[wIndex + 2].text)
+                                            : '&nbsp;'
+                                        }}</span
+                                      >
+                                    </span>
+                                  </span>
+                                </span>
+                              </div>
+                            </span>
+                          </span>
+                          <!-- 图片块 -->
+                          <div
+                            v-else-if="item.type === 'image'"
+                            :key="'image-' + index"
+                            :style="item.containerStyle"
+                            class="image-container"
+                          >
+                            <img
+                              :src="item.src"
+                              :alt="item.alt"
+                              :width="item.width"
+                              :height="item.height"
+                              :style="item.imageStyle"
+                              class="inline-image"
+                            />
+                          </div>
+                          <!-- 视频块 -->
+                          <div
+                            v-else-if="item.type === 'video'"
+                            :key="'video-' + index"
+                            :style="item.containerStyle"
+                            class="video-container"
+                          >
+                            <video
+                              :poster="item.poster"
+                              :width="item.width"
+                              :height="item.height"
+                              :style="item.mediaStyle"
+                              controls
+                              class="inline-video"
+                            >
+                              <source :src="item.src" :type="item.videoType" />
+                              您的浏览器不支持视频播放
+                            </video>
+                          </div>
+                          <!-- 音频块 -->
+                          <div
+                            v-else-if="item.type === 'audio'"
+                            :key="'audio-' + index"
+                            :style="item.containerStyle"
+                            class="audio-container"
+                          >
+                            <audio :src="item.src" :style="item.mediaStyle" controls class="inline-audio">
+                              您的浏览器不支持音频播放
+                            </audio>
+                          </div>
+                          <!-- 换行符 -->
+                          <br v-else-if="item.type === 'newline'" :key="'newline-' + index" />
+                        </div>
+                      </template>
+                      <template v-else-if="col.rich_text_list">
                         <div
                           v-for="(item, index) in col.rich_text_list"
                           :key="index"
@@ -330,7 +630,7 @@
                                       v-model="word.value"
                                       :disabled="disabled"
                                       :class="[...computedAnswerClass(word, i, j)]"
-                                      :style="getInputStyle(item.styleObj, word)"
+                                      :style="getInputStyle(word.last_styleObj, word)"
                                     />
                                   </template>
                                   <template v-else-if="data.property.fill_type === fillTypeList[1].value">
@@ -351,7 +651,7 @@
                                         v-model="word.value"
                                         :readonly="true"
                                         :class="[...computedAnswerClass(word, i, j)]"
-                                        :style="getInputStyle(item.styleObj, word)"
+                                        :style="getInputStyle(word.last_styleObj, word)"
                                       />
                                     </el-popover>
                                   </template>
@@ -764,7 +1064,7 @@
       <PreviewOperation
         v-if="isHasInput"
         :is-show-retry="isHasInput"
-        :is-show-answer="isHasInput && isShowAnswerFill"
+        :is-show-answer="true"
         :is-show-judge-correct="isShowJudgeCorrect"
         @showAnswerAnalysis="showAnswerAnalysis"
         @judgeCorrect="judgeCorrect"
@@ -837,7 +1137,281 @@
                     <!-- , computedRichStyle(col.content) -->
                     <div class="cell-wrap-content" :style="[tdStyle(col.content)]">
                       <template v-if="isEnable(data.property.view_pinyin)">
-                        <template v-if="col.rich_text_list">
+                        <template v-if="col.new_rich_text_list && col.new_rich_text_list.length !== 0">
+                          <div
+                            v-for="(item, index) in col.new_rich_text_list"
+                            :key="index"
+                            class="pinyin-text pinyin-text-sentence"
+                            :class="[
+                              index === 0 ? 'pinyin-text-left' : '',
+                              item.type === 'audio' ? 'pinyin-text-audio' : '',
+                              item.type === 'newline' ? 'pinyin-text-br' : '',
+                            ]"
+                          >
+                            <!-- 文字块:包含 word_list -->
+                            <span
+                              v-if="item.type === 'text'"
+                              :key="'text-' + index"
+                              class="pinyin-sentence"
+                              :style="[
+                                { 'align-items': data.property.pinyin_position === 'top' ? 'flex-end' : 'flex-start' },
+                              ]"
+                            >
+                              <span
+                                v-for="(word, wIndex) in item.new_text_list"
+                                :key="wIndex"
+                                class="pinyin-text"
+                                :class="[
+                                  word.text.trim() && word.isShow ? 'pinyin-text-padding' : '',
+                                  item.new_text_list[wIndex + 1] &&
+                                  item.new_text_list[wIndex + 1].text.trim() &&
+                                  chsFhList.indexOf(item.new_text_list[wIndex + 1].text.trim()) > -1
+                                    ? 'pinyin-text-padding-left'
+                                    : '',
+                                ]"
+                              >
+                                <div v-if="word.isShow" class="table-words-box">
+                                  <span
+                                    v-if="
+                                      item.new_text_list[wIndex - 1] &&
+                                      item.new_text_list[wIndex - 1].text &&
+                                      firstFhlist.indexOf(item.new_text_list[wIndex - 1].text) > -1 &&
+                                      item.new_text_list[wIndex - 2] &&
+                                      item.new_text_list[wIndex - 2].text &&
+                                      firstFhlist.indexOf(item.new_text_list[wIndex - 2].text) > -1
+                                    "
+                                    :style="{
+                                      flexDirection:
+                                        data.property.pinyin_position === 'top' ? 'column' : 'column-reverse',
+                                      'align-items': getWordAlignItems(item.new_text_list[wIndex - 2], item),
+                                      ...item.new_text_list[wIndex - 2].last_styleObj,
+                                    }"
+                                  >
+                                    <span class="pinyin" :style="getPinyinStyle(item.new_text_list[wIndex - 2])">
+                                      {{
+                                        item.new_text_list[wIndex - 2].pinyin.trim() &&
+                                        item.new_text_list[wIndex - 2].showPinyin !== 'false'
+                                          ? item.new_text_list[wIndex - 2].pinyin
+                                          : '&nbsp;'
+                                      }}</span
+                                    >
+                                    <span class="py-char" :style="getCharStyle(item.new_text_list[wIndex - 2], item)">{{
+                                      convertText(item.new_text_list[wIndex - 2].text).trim()
+                                        ? convertText(item.new_text_list[wIndex - 2].text)
+                                        : '&nbsp;'
+                                    }}</span>
+                                  </span>
+                                  <span
+                                    v-if="
+                                      item.new_text_list[wIndex - 1] &&
+                                      item.new_text_list[wIndex - 1].text &&
+                                      firstFhlist.indexOf(item.new_text_list[wIndex - 1].text) > -1
+                                    "
+                                  >
+                                    <span
+                                      :style="{
+                                        flexDirection:
+                                          data.property.pinyin_position === 'top' ? 'column' : 'column-reverse',
+                                        'align-items': getWordAlignItems(item.new_text_list[wIndex - 1], item),
+                                        ...item.new_text_list[wIndex - 1].last_styleObj,
+                                      }"
+                                    >
+                                      <span class="pinyin" :style="getPinyinStyle(item.new_text_list[wIndex - 1])">
+                                        {{
+                                          item.new_text_list[wIndex - 1].pinyin.trim() &&
+                                          item.new_text_list[wIndex - 1].showPinyin !== 'false'
+                                            ? item.new_text_list[wIndex - 1].pinyin
+                                            : '&nbsp;'
+                                        }}</span
+                                      >
+                                      <span
+                                        class="py-char"
+                                        :style="getCharStyle(item.new_text_list[wIndex - 1], item)"
+                                        >{{
+                                          convertText(item.new_text_list[wIndex - 1].text).trim()
+                                            ? convertText(item.new_text_list[wIndex - 1].text)
+                                            : '&nbsp;'
+                                        }}</span
+                                      >
+                                    </span>
+                                  </span>
+                                  <span v-if="word.type === 'text'">
+                                    <span
+                                      :style="{
+                                        flexDirection:
+                                          data.property.pinyin_position === 'top' ? 'column' : 'column-reverse',
+                                        'align-items': getWordAlignItems(word, item),
+                                        ...word.last_styleObj,
+                                      }"
+                                    >
+                                      <span class="pinyin" :style="getPinyinStyle(word)">
+                                        {{
+                                          word.pinyin.trim() && word.showPinyin !== 'false' ? word.pinyin : '&nbsp;'
+                                        }}</span
+                                      >
+                                      <span class="py-char" :style="getCharStyle(word, item)">{{
+                                        convertText(word.text).trim() ? convertText(word.text) : '&nbsp;'
+                                      }}</span>
+                                    </span>
+                                  </span>
+                                  <span v-else-if="word.type === 'input'">
+                                    <span
+                                      v-if="data.property.pinyin_position === 'top'"
+                                      class="pinyin"
+                                      :style="getPinyinStyle(word)"
+                                      >&nbsp;</span
+                                    >
+
+                                    <span
+                                      v-show="computedAnswerText(word, i, j).length > 0"
+                                      :key="`answer-${j}`"
+                                      class="right-answer"
+                                      :style="{
+                                        marginTop: data.property.pinyin_position === 'top' ? '18px' : '',
+                                        ...word.last_styleObj,
+                                      }"
+                                    >
+                                      {{ convertText(computedAnswerText(word, i, j)) }}
+                                    </span>
+                                    <el-input
+                                      v-if="computedAnswerText(word, i, j).length === 0"
+                                      :key="index"
+                                      v-model="word.value"
+                                      :disabled="disabled"
+                                      :class="[...computedAnswerClass(word, i, j)]"
+                                      :style="getInputStyle(word.last_styleObj, word)"
+                                    />
+                                    <span
+                                      v-if="data.property.pinyin_position === 'bottom'"
+                                      class="pinyin"
+                                      :style="getPinyinStyle(word)"
+                                      >&nbsp;</span
+                                    >
+                                  </span>
+                                  <span
+                                    v-if="
+                                      item.new_text_list[wIndex + 1] &&
+                                      item.new_text_list[wIndex + 1].text &&
+                                      chsFhList.indexOf(item.new_text_list[wIndex + 1].text) > -1
+                                    "
+                                  >
+                                    <span>
+                                      <span
+                                        :style="{
+                                          flexDirection:
+                                            data.property.pinyin_position === 'top' ? 'column' : 'column-reverse',
+                                          'align-items': getWordAlignItems(item.new_text_list[wIndex + 1], item),
+                                          ...item.new_text_list[wIndex + 1].last_styleObj,
+                                        }"
+                                      >
+                                        <span class="pinyin" :style="getPinyinStyle(item.new_text_list[wIndex + 1])">
+                                          {{
+                                            item.new_text_list[wIndex + 1].pinyin.trim() &&
+                                            item.new_text_list[wIndex + 1].showPinyin !== 'false'
+                                              ? item.new_text_list[wIndex + 1].pinyin
+                                              : '&nbsp;'
+                                          }}</span
+                                        >
+                                        <span
+                                          class="py-char"
+                                          :style="getCharStyle(item.new_text_list[wIndex + 1], item)"
+                                          >{{
+                                            convertText(item.new_text_list[wIndex + 1].text).trim()
+                                              ? convertText(item.new_text_list[wIndex + 1].text)
+                                              : '&nbsp;'
+                                          }}</span
+                                        >
+                                      </span>
+                                    </span>
+                                    <span
+                                      v-if="
+                                        item.new_text_list[wIndex + 2] &&
+                                        item.new_text_list[wIndex + 2].text &&
+                                        chsFhList.indexOf(item.new_text_list[wIndex + 2].text) > -1
+                                      "
+                                    >
+                                      <span
+                                        :style="{
+                                          flexDirection:
+                                            data.property.pinyin_position === 'top' ? 'column' : 'column-reverse',
+                                          'align-items': getWordAlignItems(item.new_text_list[wIndex + 2], item),
+                                          ...item.new_text_list[wIndex + 2].last_styleObj,
+                                        }"
+                                      >
+                                        <span class="pinyin" :style="getPinyinStyle(item.new_text_list[wIndex + 2])">
+                                          {{
+                                            item.new_text_list[wIndex + 2].pinyin.trim() &&
+                                            item.new_text_list[wIndex + 2].showPinyin !== 'false'
+                                              ? item.new_text_list[wIndex + 2].pinyin
+                                              : '&nbsp;'
+                                          }}</span
+                                        >
+                                        <span
+                                          class="py-char"
+                                          :style="getCharStyle(item.new_text_list[wIndex + 2], item)"
+                                          >{{
+                                            convertText(item.new_text_list[wIndex + 2].text).trim()
+                                              ? convertText(item.new_text_list[wIndex + 2].text)
+                                              : '&nbsp;'
+                                          }}</span
+                                        >
+                                      </span>
+                                    </span>
+                                  </span>
+                                </div>
+                              </span>
+                            </span>
+                            <!-- 图片块 -->
+                            <div
+                              v-else-if="item.type === 'image'"
+                              :key="'image-' + index"
+                              :style="item.containerStyle"
+                              class="image-container"
+                            >
+                              <img
+                                :src="item.src"
+                                :alt="item.alt"
+                                :width="item.width"
+                                :height="item.height"
+                                :style="item.imageStyle"
+                                class="inline-image"
+                              />
+                            </div>
+                            <!-- 视频块 -->
+                            <div
+                              v-else-if="item.type === 'video'"
+                              :key="'video-' + index"
+                              :style="item.containerStyle"
+                              class="video-container"
+                            >
+                              <video
+                                :poster="item.poster"
+                                :width="item.width"
+                                :height="item.height"
+                                :style="item.mediaStyle"
+                                controls
+                                class="inline-video"
+                              >
+                                <source :src="item.src" :type="item.videoType" />
+                                您的浏览器不支持视频播放
+                              </video>
+                            </div>
+                            <!-- 音频块 -->
+                            <div
+                              v-else-if="item.type === 'audio'"
+                              :key="'audio-' + index"
+                              :style="item.containerStyle"
+                              class="audio-container"
+                            >
+                              <audio :src="item.src" :style="item.mediaStyle" controls class="inline-audio">
+                                您的浏览器不支持音频播放
+                              </audio>
+                            </div>
+                            <!-- 换行符 -->
+                            <br v-else-if="item.type === 'newline'" :key="'newline-' + index" />
+                          </div>
+                        </template>
+                        <template v-else-if="col.rich_text_list">
                           <div
                             v-for="(item, index) in col.rich_text_list"
                             :key="index"
@@ -961,7 +1535,216 @@
                         </template>
                       </template>
                       <template v-else>
-                        <template v-if="col.rich_text_list && col.rich_text_list.length !== 0">
+                        <template v-if="col.new_rich_text_list && col.new_rich_text_list.length !== 0">
+                          <div
+                            v-for="(item, index) in col.new_rich_text_list"
+                            :key="index"
+                            class="pinyin-text pinyin-text-sentence"
+                            :class="[
+                              index === 0 ? 'pinyin-text-left' : '',
+                              item.type === 'audio' ? 'pinyin-text-audio' : '',
+                              item.type === 'newline' ? 'pinyin-text-br' : '',
+                            ]"
+                          >
+                            <!-- 文字块:包含 word_list -->
+                            <span
+                              v-if="item.type === 'text'"
+                              :key="'text-' + index"
+                              class="pinyin-sentence"
+                              :style="[
+                                { 'align-items': data.property.pinyin_position === 'top' ? 'flex-end' : 'flex-start' },
+                              ]"
+                            >
+                              <span v-for="(word, wIndex) in item.new_text_list" :key="wIndex" class="pinyin-text">
+                                <span v-if="word.isShow" class="table-words-box">
+                                  <span
+                                    v-if="
+                                      item.new_text_list[wIndex - 1] &&
+                                      item.new_text_list[wIndex - 1].text &&
+                                      firstFhlist.indexOf(item.new_text_list[wIndex - 1].text) > -1 &&
+                                      item.new_text_list[wIndex - 2] &&
+                                      item.new_text_list[wIndex - 2].text &&
+                                      firstFhlist.indexOf(item.new_text_list[wIndex - 2].text) > -1
+                                    "
+                                    :style="{
+                                      flexDirection:
+                                        data.property.pinyin_position === 'top' ? 'column' : 'column-reverse',
+                                      'align-items': getWordAlignItems(item.new_text_list[wIndex - 2], item),
+                                      ...item.new_text_list[wIndex - 2].last_styleObj,
+                                    }"
+                                  >
+                                    <span class="py-char" :style="getCharStyle(item.new_text_list[wIndex - 2], item)">{{
+                                      convertText(item.new_text_list[wIndex - 2].text).trim()
+                                        ? convertText(item.new_text_list[wIndex - 2].text)
+                                        : '&nbsp;'
+                                    }}</span>
+                                  </span>
+                                  <span
+                                    v-if="
+                                      item.new_text_list[wIndex - 1] &&
+                                      item.new_text_list[wIndex - 1].text &&
+                                      firstFhlist.indexOf(item.new_text_list[wIndex - 1].text) > -1
+                                    "
+                                  >
+                                    <span
+                                      :style="{
+                                        flexDirection:
+                                          data.property.pinyin_position === 'top' ? 'column' : 'column-reverse',
+                                        'align-items': getWordAlignItems(item.new_text_list[wIndex - 1], item),
+                                        ...item.new_text_list[wIndex - 1].last_styleObj,
+                                      }"
+                                    >
+                                      <span
+                                        class="py-char"
+                                        :style="getCharStyle(item.new_text_list[wIndex - 1], item)"
+                                        >{{
+                                          convertText(item.new_text_list[wIndex - 1].text).trim()
+                                            ? convertText(item.new_text_list[wIndex - 1].text)
+                                            : '&nbsp;'
+                                        }}</span
+                                      >
+                                    </span>
+                                  </span>
+                                  <span v-if="word.type === 'text'">
+                                    <span
+                                      :style="{
+                                        flexDirection:
+                                          data.property.pinyin_position === 'top' ? 'column' : 'column-reverse',
+                                        'align-items': getWordAlignItems(word, item),
+                                        ...word.last_styleObj,
+                                      }"
+                                    >
+                                      <span class="py-char" :style="getCharStyle(word, item)">{{
+                                        convertText(word.text).trim() ? convertText(word.text) : '&nbsp;'
+                                      }}</span>
+                                    </span>
+                                  </span>
+                                  <template v-else-if="word.type === 'input'">
+                                    <span
+                                      v-show="computedAnswerText(word, i, j).length > 0"
+                                      :key="`answer-${j}`"
+                                      class="right-answer"
+                                      :style="word.last_styleObj"
+                                    >
+                                      {{ convertText(computedAnswerText(word, i, j)) }}
+                                    </span>
+                                    <el-input
+                                      v-if="computedAnswerText(word, i, j).length === 0"
+                                      :key="index"
+                                      v-model="word.value"
+                                      :disabled="disabled"
+                                      :class="[...computedAnswerClass(word, i, j)]"
+                                      :style="getInputStyle(word.last_styleObj, word)"
+                                    />
+                                  </template>
+                                  <template
+                                    v-if="
+                                      item.new_text_list[wIndex + 1] &&
+                                      item.new_text_list[wIndex + 1].text &&
+                                      chsFhList.indexOf(item.new_text_list[wIndex + 1].text) > -1
+                                    "
+                                  >
+                                    <span>
+                                      <span
+                                        :style="{
+                                          flexDirection:
+                                            data.property.pinyin_position === 'top' ? 'column' : 'column-reverse',
+                                          'align-items': getWordAlignItems(item.new_text_list[wIndex + 1], item),
+                                          ...item.new_text_list[wIndex + 1].last_styleObj,
+                                        }"
+                                      >
+                                        <span
+                                          class="py-char"
+                                          :style="getCharStyle(item.new_text_list[wIndex + 1], item)"
+                                          >{{
+                                            convertText(item.new_text_list[wIndex + 1].text).trim()
+                                              ? convertText(item.new_text_list[wIndex + 1].text)
+                                              : '&nbsp;'
+                                          }}</span
+                                        >
+                                      </span>
+                                    </span>
+                                    <span
+                                      v-if="
+                                        item.new_text_list[wIndex + 2] &&
+                                        item.new_text_list[wIndex + 2].text &&
+                                        chsFhList.indexOf(item.new_text_list[wIndex + 2].text) > -1
+                                      "
+                                    >
+                                      <span
+                                        :style="{
+                                          flexDirection:
+                                            data.property.pinyin_position === 'top' ? 'column' : 'column-reverse',
+                                          'align-items': getWordAlignItems(item.new_text_list[wIndex + 2], item),
+                                          ...item.new_text_list[wIndex + 2].last_styleObj,
+                                        }"
+                                      >
+                                        <span
+                                          class="py-char"
+                                          :style="getCharStyle(item.new_text_list[wIndex + 2], item)"
+                                          >{{
+                                            convertText(item.new_text_list[wIndex + 2].text).trim()
+                                              ? convertText(item.new_text_list[wIndex + 2].text)
+                                              : '&nbsp;'
+                                          }}</span
+                                        >
+                                      </span>
+                                    </span>
+                                  </template>
+                                </span>
+                              </span>
+                            </span>
+                            <!-- 图片块 -->
+                            <div
+                              v-else-if="item.type === 'image'"
+                              :key="'image-' + index"
+                              :style="item.containerStyle"
+                              class="image-container"
+                            >
+                              <img
+                                :src="item.src"
+                                :alt="item.alt"
+                                :width="item.width"
+                                :height="item.height"
+                                :style="item.imageStyle"
+                                class="inline-image"
+                              />
+                            </div>
+                            <!-- 视频块 -->
+                            <div
+                              v-else-if="item.type === 'video'"
+                              :key="'video-' + index"
+                              :style="item.containerStyle"
+                              class="video-container"
+                            >
+                              <video
+                                :poster="item.poster"
+                                :width="item.width"
+                                :height="item.height"
+                                :style="item.mediaStyle"
+                                controls
+                                class="inline-video"
+                              >
+                                <source :src="item.src" :type="item.videoType" />
+                                您的浏览器不支持视频播放
+                              </video>
+                            </div>
+                            <!-- 音频块 -->
+                            <div
+                              v-else-if="item.type === 'audio'"
+                              :key="'audio-' + index"
+                              :style="item.containerStyle"
+                              class="audio-container"
+                            >
+                              <audio :src="item.src" :style="item.mediaStyle" controls class="inline-audio">
+                                您的浏览器不支持音频播放
+                              </audio>
+                            </div>
+                            <!-- 换行符 -->
+                            <br v-else-if="item.type === 'newline'" :key="'newline-' + index" />
+                          </div>
+                        </template>
+                        <template v-else-if="col.rich_text_list && col.rich_text_list.length !== 0">
                           <div
                             v-for="(item, index) in col.rich_text_list"
                             :key="index"
@@ -1607,6 +2390,8 @@ export default {
       baseStyle['--input-font-family'] = styles ? styles.fontFamily : '';
       baseStyle['width'] = `${Math.max(40, words.value.length * 21.3)}px`;
       baseStyle['height'] = styles && styles.fontSize ? `${styles.fontSize.replace('pt', '') * 1.5}pt` : '24px';
+      baseStyle['margin-top'] =
+        this.isEnable(this.data.property.view_pinyin) && this.data.property.pinyin_position === 'top' ? '18px' : '';
 
       return baseStyle;
     },
@@ -2263,7 +3048,8 @@ $border-color: #e6e6e6;
         margin: 0.5em 0;
       }
 
-      span {
+      span,
+      .table-words-box {
         display: inline-flex;
         flex-wrap: wrap;
       }