Просмотр исходного кода

叙述体课文句首句尾标点处理

natasha 3 месяцев назад
Родитель
Сommit
f37a4fb2d6

Разница между файлами не показана из-за своего большого размера
+ 795 - 316
src/views/book/courseware/preview/components/article/NormalModelChs.vue


+ 492 - 154
src/views/book/courseware/preview/components/article/PhraseModelChs.vue

@@ -113,6 +113,325 @@
                   >
                     <template v-if="!pItem.width">
                       <template v-if="pItem.isShow">
+                        <span
+                          v-if="
+                            item.wordsList[pIndex - 1] &&
+                            item.wordsList[pIndex - 1].chs &&
+                            firstFhlist.indexOf(item.wordsList[pIndex - 1].chs) > -1 &&
+                            item.wordsList[pIndex - 2] &&
+                            item.wordsList[pIndex - 2].chs &&
+                            firstFhlist.indexOf(item.wordsList[pIndex - 2].chs) > -1
+                          "
+                          class="NNPE-words-box"
+                        >
+                          <span
+                            v-if="curQue.property.pinyin_position == 'top' && config.isShowPY && item.dhaspinyin"
+                            :class="[
+                              'NNPE-pinyin',
+                              noFont.indexOf(item.wordsList[pIndex - 2].pinyin) > -1 ? 'noFont' : '',
+                            ]"
+                            style="text-align: left"
+                            :style="{
+                              fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
+                              height:
+                                attrib && attrib.pinyin_size
+                                  ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
+                                  : '22px',
+                            }"
+                            @click.stop="
+                              viewNotes($event, item.wordsList[pIndex - 2].pinyin, '', item.wordsList[pIndex - 2])
+                            "
+                            >{{
+                              NumberList.indexOf(item.wordsList[pIndex - 2].pinyin) == -1
+                                ? item.wordsList[pIndex - 2].pinyin
+                                : ''
+                            }}</span
+                          >
+                          <el-tooltip
+                            popper-class="article-bubble"
+                            effect="light"
+                            placement="bottom-start"
+                            v-if="item.wordsList[pIndex - 2].matchNotesObj.con"
+                          >
+                            <div
+                              slot="content"
+                              :style="{
+                                color: attrib && attrib.text_color ? attrib.text_color : '#de4444',
+                                fontSize: attrib && attrib.font_size ? attrib.font_size : '',
+                              }"
+                              v-html="item.wordsList[pIndex - 2].matchNotesObj.con"
+                            ></div>
+                            <span
+                              class="NNPE-chs"
+                              style="text-align: left"
+                              :style="{
+                                fontFamily: item.wordsList[pIndex - 2].config.fontFamily,
+                                textDecoration: item.wordsList[pIndex - 2].config.textDecoration,
+                                borderBottom: item.wordsList[pIndex - 2].config.border === 'dotted' ? '1px dotted' : '',
+                                fontWeight: item.wordsList[pIndex - 2].config.fontWeight,
+                                color:
+                                  item.wordsList[pIndex - 2].matchNotesObj.con &&
+                                  item.wordsList[pIndex - 2].matchNotesObj.notesColor
+                                    ? item.wordsList[pIndex - 2].matchNotesObj.notesColor
+                                    : item.wordsList[pIndex - 2].config.color,
+                                height:
+                                  attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
+                                fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
+                                lineHeight:
+                                  attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
+                                width: item.wordsList[pIndex - 2].chs.trim() === '' ? '6px' : '',
+                              }"
+                              @click.stop="
+                                viewNotes(
+                                  $event,
+                                  item.wordsList[pIndex - 2].words
+                                    ? item.wordsList[pIndex - 2].words
+                                    : item.wordsList[pIndex - 2].chs,
+                                  '',
+                                  item.wordsList[pIndex - 2],
+                                )
+                              "
+                              >{{ convertText(item.wordsList[pIndex - 2].chs)
+                              }}<img
+                                v-if="
+                                  item.wordsList[pIndex - 2].img &&
+                                  item.wordsList[pIndex - 2].img.length > 0 &&
+                                  item.wordsList[pIndex - 2].imgPosition === 'after'
+                                "
+                                :src="item.wordsList[pIndex - 2].img[0].file_url"
+                                :style="{
+                                  height: attrib && attrib.font_size ? attrib.font_size : '20px',
+                                }"
+                            /></span>
+                          </el-tooltip>
+                          <template v-else>
+                            <span
+                              class="NNPE-chs"
+                              style="text-align: left"
+                              :style="{
+                                fontFamily: item.wordsList[pIndex - 2].config.fontFamily,
+                                textDecoration: item.wordsList[pIndex - 2].config.textDecoration,
+                                borderBottom: item.wordsList[pIndex - 2].config.border === 'dotted' ? '1px dotted' : '',
+                                fontWeight: item.wordsList[pIndex - 2].config.fontWeight,
+                                color:
+                                  item.wordsList[pIndex - 2].matchNotesObj.con &&
+                                  item.wordsList[pIndex - 2].matchNotesObj.notesColor
+                                    ? item.wordsList[pIndex - 2].matchNotesObj.notesColor
+                                    : item.wordsList[pIndex - 2].config.color,
+                                height:
+                                  attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
+                                fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
+                                lineHeight:
+                                  attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
+
+                                width: item.wordsList[pIndex - 2].chs.trim() === '' ? '6px' : '',
+                              }"
+                              @click.stop="
+                                viewNotes(
+                                  $event,
+                                  item.wordsList[pIndex - 2].words
+                                    ? item.wordsList[pIndex - 2].words
+                                    : item.wordsList[pIndex - 2].chs,
+                                  '',
+                                  item.wordsList[pIndex - 2],
+                                )
+                              "
+                              >{{ convertText(item.wordsList[pIndex - 2].chs)
+                              }}<img
+                                v-if="
+                                  item.wordsList[pIndex - 2].img &&
+                                  item.wordsList[pIndex - 2].img.length > 0 &&
+                                  item.wordsList[pIndex - 2].imgPosition === 'after'
+                                "
+                                :src="item.wordsList[pIndex - 2].img[0].file_url"
+                                :style="{
+                                  height: attrib && attrib.font_size ? attrib.font_size : '20px',
+                                }"
+                            /></span>
+                          </template>
+
+                          <span
+                            v-if="curQue.property.pinyin_position == 'bottom' && config.isShowPY && item.dhaspinyin"
+                            :class="[
+                              'NNPE-pinyin',
+                              noFont.indexOf(item.wordsList[pIndex - 2].pinyin) > -1 ? 'noFont' : '',
+                            ]"
+                            style="text-align: left"
+                            :style="{
+                              fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
+                              height:
+                                attrib && attrib.pinyin_size
+                                  ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
+                                  : '22px',
+                            }"
+                            @click.stop="
+                              viewNotes($event, item.wordsList[pIndex - 2].pinyin, '', item.wordsList[pIndex - 2])
+                            "
+                            >{{
+                              NumberList.indexOf(item.wordsList[pIndex - 2].pinyin) == -1
+                                ? item.wordsList[pIndex - 2].pinyin
+                                : ''
+                            }}</span
+                          >
+                        </span>
+                        <span
+                          v-if="
+                            item.wordsList[pIndex - 1] &&
+                            item.wordsList[pIndex - 1].chs &&
+                            firstFhlist.indexOf(item.wordsList[pIndex - 1].chs) > -1
+                          "
+                          class="NNPE-words-box"
+                        >
+                          <span
+                            v-if="curQue.property.pinyin_position == 'top' && config.isShowPY && item.dhaspinyin"
+                            :class="[
+                              'NNPE-pinyin',
+                              noFont.indexOf(item.wordsList[pIndex - 1].pinyin) > -1 ? 'noFont' : '',
+                            ]"
+                            style="text-align: left"
+                            :style="{
+                              fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
+                              height:
+                                attrib && attrib.pinyin_size
+                                  ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
+                                  : '22px',
+                            }"
+                            @click.stop="
+                              viewNotes($event, item.wordsList[pIndex - 1].pinyin, '', item.wordsList[pIndex - 2])
+                            "
+                            >{{
+                              NumberList.indexOf(item.wordsList[pIndex - 1].pinyin) == -1
+                                ? item.wordsList[pIndex - 1].pinyin
+                                : ''
+                            }}</span
+                          >
+                          <el-tooltip
+                            popper-class="article-bubble"
+                            effect="light"
+                            placement="bottom-start"
+                            v-if="item.wordsList[pIndex - 1].matchNotesObj.con"
+                          >
+                            <div
+                              slot="content"
+                              :style="{
+                                color: attrib && attrib.text_color ? attrib.text_color : '#de4444',
+                                fontSize: attrib && attrib.font_size ? attrib.font_size : '',
+                              }"
+                              v-html="item.wordsList[pIndex - 1].matchNotesObj.con"
+                            ></div>
+                            <span
+                              class="NNPE-chs"
+                              style="text-align: left"
+                              :style="{
+                                fontFamily: item.wordsList[pIndex - 1].config.fontFamily,
+                                textDecoration: item.wordsList[pIndex - 1].config.textDecoration,
+                                borderBottom: item.wordsList[pIndex - 1].config.border === 'dotted' ? '1px dotted' : '',
+                                fontWeight: item.wordsList[pIndex - 1].config.fontWeight,
+                                color:
+                                  item.wordsList[pIndex - 1].matchNotesObj.con &&
+                                  item.wordsList[pIndex - 1].matchNotesObj.notesColor
+                                    ? item.wordsList[pIndex - 1].matchNotesObj.notesColor
+                                    : item.wordsList[pIndex - 1].config.color,
+                                height:
+                                  attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
+                                fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
+                                lineHeight:
+                                  attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
+                                width: item.wordsList[pIndex - 1].chs.trim() === '' ? '6px' : '',
+                              }"
+                              @click.stop="
+                                viewNotes(
+                                  $event,
+                                  item.wordsList[pIndex - 1].words
+                                    ? item.wordsList[pIndex - 1].words
+                                    : item.wordsList[pIndex - 1].chs,
+                                  '',
+                                  item.wordsList[pIndex - 1],
+                                )
+                              "
+                              >{{ convertText(item.wordsList[pIndex - 1].chs)
+                              }}<img
+                                v-if="
+                                  item.wordsList[pIndex - 1].img &&
+                                  item.wordsList[pIndex - 1].img.length > 0 &&
+                                  item.wordsList[pIndex - 1].imgPosition === 'after'
+                                "
+                                :src="item.wordsList[pIndex - 1].img[0].file_url"
+                                :style="{
+                                  height: attrib && attrib.font_size ? attrib.font_size : '20px',
+                                }"
+                            /></span>
+                          </el-tooltip>
+                          <template v-else>
+                            <span
+                              class="NNPE-chs"
+                              style="text-align: left"
+                              :style="{
+                                fontFamily: item.wordsList[pIndex - 1].config.fontFamily,
+                                textDecoration: item.wordsList[pIndex - 1].config.textDecoration,
+                                borderBottom: item.wordsList[pIndex - 1].config.border === 'dotted' ? '1px dotted' : '',
+                                fontWeight: item.wordsList[pIndex - 1].config.fontWeight,
+                                color:
+                                  item.wordsList[pIndex - 1].matchNotesObj.con &&
+                                  item.wordsList[pIndex - 1].matchNotesObj.notesColor
+                                    ? item.wordsList[pIndex - 1].matchNotesObj.notesColor
+                                    : item.wordsList[pIndex - 1].config.color,
+                                height:
+                                  attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
+                                fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
+                                lineHeight:
+                                  attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
+
+                                width: item.wordsList[pIndex - 1].chs.trim() === '' ? '6px' : '',
+                              }"
+                              @click.stop="
+                                viewNotes(
+                                  $event,
+                                  item.wordsList[pIndex - 1].words
+                                    ? item.wordsList[pIndex - 1].words
+                                    : item.wordsList[pIndex - 1].chs,
+                                  '',
+                                  item.wordsList[pIndex - 1],
+                                )
+                              "
+                              >{{ convertText(item.wordsList[pIndex - 1].chs)
+                              }}<img
+                                v-if="
+                                  item.wordsList[pIndex - 1].img &&
+                                  item.wordsList[pIndex - 1].img.length > 0 &&
+                                  item.wordsList[pIndex - 1].imgPosition === 'after'
+                                "
+                                :src="item.wordsList[pIndex - 1].img[0].file_url"
+                                :style="{
+                                  height: attrib && attrib.font_size ? attrib.font_size : '20px',
+                                }"
+                            /></span>
+                          </template>
+
+                          <span
+                            v-if="curQue.property.pinyin_position == 'bottom' && config.isShowPY && item.dhaspinyin"
+                            :class="[
+                              'NNPE-pinyin',
+                              noFont.indexOf(item.wordsList[pIndex - 1].pinyin) > -1 ? 'noFont' : '',
+                            ]"
+                            style="text-align: left"
+                            :style="{
+                              fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
+                              height:
+                                attrib && attrib.pinyin_size
+                                  ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
+                                  : '22px',
+                            }"
+                            @click.stop="
+                              viewNotes($event, item.wordsList[pIndex - 1].pinyin, '', item.wordsList[pIndex - 2])
+                            "
+                            >{{
+                              NumberList.indexOf(item.wordsList[pIndex - 1].pinyin) == -1
+                                ? item.wordsList[pIndex - 1].pinyin
+                                : ''
+                            }}</span
+                          >
+                        </span>
                         <template
                           v-if="
                             item.wordsList[pIndex + 1] &&
@@ -626,180 +945,190 @@
                           </span>
                         </template>
                         <template v-else>
-                          <span
-                            v-if="curQue.property.pinyin_position == 'top' && config.isShowPY && item.dhaspinyin"
-                            class="NNPE-pinyin"
-                            :class="[
-                              pItem.chs != '“' && pItem.padding ? 'padding' : '',
-                              pItem.className ? pItem.className : '',
-                              noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : '',
-                            ]"
-                            :style="{
-                              fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
-                              height:
-                                attrib && attrib.pinyin_size
-                                  ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
-                                  : '22px',
-                            }"
-                            @click.stop="viewNotes($event, pItem.pinyin, '', pItem)"
-                            >{{ NumberList.indexOf(pItem.pinyin) == -1 ? pItem.pinyin : '' }}</span
-                          >
-                          <el-tooltip
-                            popper-class="article-bubble"
-                            effect="light"
-                            placement="bottom-start"
-                            v-if="pItem.matchNotesObj.con"
-                          >
-                            <div
-                              slot="content"
-                              :style="{
-                                color: attrib && attrib.text_color ? attrib.text_color : '#de4444',
-                                fontSize: attrib && attrib.font_size ? attrib.font_size : '',
-                              }"
-                              v-html="pItem.matchNotesObj.con"
-                            ></div>
+                          <span class="NNPE-words-box">
                             <span
-                              class="NNPE-chs"
+                              v-if="curQue.property.pinyin_position == 'top' && config.isShowPY && item.dhaspinyin"
+                              class="NNPE-pinyin"
                               :class="[
-                                pItem.chs != '“' && pItem.padding && config.isShowPY ? 'padding' : '',
-                                newWordList.indexOf(pItem.chs) > -1 ? 'active' : '',
-                                pItem.words ? 'active' : '',
+                                pItem.chs != '“' && pItem.padding ? 'padding' : '',
+                                pItem.className ? pItem.className : '',
+                                noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : '',
                               ]"
                               :style="{
-                                fontFamily: pItem.config.fontFamily,
-                                textDecoration: pItem.config.textDecoration,
-                                borderBottom: pItem.config.border === 'dotted' ? '1px dotted' : '',
-                                fontWeight: pItem.config.fontWeight,
+                                fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
                                 height:
-                                  attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
-                                fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
-                                lineHeight:
-                                  attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
-                                color:
-                                  newWordList.indexOf(pItem.chs) > -1 || pItem.words
-                                    ? attrib
-                                      ? attrib.topic_color
-                                      : pItem.config.color
-                                    : pItem.matchNotesObj.con && pItem.matchNotesObj.notesColor
-                                      ? pItem.matchNotesObj.notesColor
-                                      : pItem.config.color,
-
-                                width: pItem.chs.trim() === '' ? '6px' : '',
+                                  attrib && attrib.pinyin_size
+                                    ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
+                                    : '22px',
                               }"
-                              ><span
-                                v-for="(wItem, wIndex) in pItem.leg"
-                                :key="'ci' + wIndex + pIndex + index"
+                              @click.stop="viewNotes($event, pItem.pinyin, '', pItem)"
+                              >{{ NumberList.indexOf(pItem.pinyin) == -1 ? pItem.pinyin : '' }}</span
+                            >
+                            <el-tooltip
+                              popper-class="article-bubble"
+                              effect="light"
+                              placement="bottom-start"
+                              v-if="pItem.matchNotesObj.con"
+                            >
+                              <div
+                                slot="content"
+                                :style="{
+                                  color: attrib && attrib.text_color ? attrib.text_color : '#de4444',
+                                  fontSize: attrib && attrib.font_size ? attrib.font_size : '',
+                                }"
+                                v-html="pItem.matchNotesObj.con"
+                              ></div>
+                              <span
+                                class="NNPE-chs"
                                 :class="[
-                                  pItem.chstimeList &&
-                                  pItem.chstimeList[wIndex] &&
-                                  curTime >= pItem.chstimeList[wIndex].wordBg &&
-                                  curTime < item.timeList[pItem.sentIndex].ed
-                                    ? 'wordActive'
-                                    : '',
+                                  pItem.chs != '“' && pItem.padding && config.isShowPY ? 'padding' : '',
+                                  newWordList.indexOf(pItem.chs) > -1 ? 'active' : '',
+                                  pItem.words ? 'active' : '',
                                 ]"
                                 :style="{
+                                  fontFamily: pItem.config.fontFamily,
+                                  textDecoration: pItem.config.textDecoration,
+                                  borderBottom: pItem.config.border === 'dotted' ? '1px dotted' : '',
+                                  fontWeight: pItem.config.fontWeight,
+                                  height:
+                                    attrib && attrib.font_size
+                                      ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
+                                      : '28px',
+                                  fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
+                                  lineHeight:
+                                    attrib && attrib.font_size
+                                      ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
+                                      : '28px',
                                   color:
                                     newWordList.indexOf(pItem.chs) > -1 || pItem.words
                                       ? attrib
                                         ? attrib.topic_color
-                                        : pItem.matchNotesObj.con && pItem.matchNotesObj.notesColor
-                                          ? pItem.matchNotesObj.notesColor
-                                          : pItem.config.color
-                                      : pItem.config.color,
-                                }"
-                                @click.stop="viewNotes($event, pItem.chs[wIndex], pItem.chs, pItem)"
-                                >{{ convertText(pItem.chs[wIndex]) }}</span
-                              >
-                              <img
-                                v-if="pItem.img && pItem.img.length > 0 && pItem.imgPosition === 'after'"
-                                :src="pItem.img[0].file_url"
-                                :style="{
-                                  height: attrib && attrib.font_size ? attrib.font_size : '20px',
+                                        : pItem.config.color
+                                      : pItem.matchNotesObj.con && pItem.matchNotesObj.notesColor
+                                        ? pItem.matchNotesObj.notesColor
+                                        : pItem.config.color,
+
+                                  width: pItem.chs.trim() === '' ? '6px' : '',
                                 }"
-                              />
-                            </span>
-                          </el-tooltip>
-                          <template v-else>
-                            <span
-                              class="NNPE-chs"
-                              :class="[
-                                pItem.chs != '“' && pItem.padding && config.isShowPY ? 'padding' : '',
-                                newWordList.indexOf(pItem.chs) > -1 ? 'active' : '',
-                                pItem.words ? 'active' : '',
-                              ]"
-                              :style="{
-                                fontFamily: pItem.config.fontFamily,
-                                textDecoration: pItem.config.textDecoration,
-                                borderBottom: pItem.config.border === 'dotted' ? '1px dotted' : '',
-                                fontWeight: pItem.config.fontWeight,
-                                height:
-                                  attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
-                                fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
-                                lineHeight:
-                                  attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
-                                color:
-                                  newWordList.indexOf(pItem.chs) > -1 || pItem.words
-                                    ? attrib
-                                      ? attrib.topic_color
-                                      : pItem.config.color
-                                    : pItem.matchNotesObj.con && pItem.matchNotesObj.notesColor
-                                      ? pItem.matchNotesObj.notesColor
-                                      : pItem.config.color,
-
-                                width: pItem.chs.trim() === '' ? '6px' : '',
-                              }"
-                              ><span
-                                v-for="(wItem, wIndex) in pItem.leg"
-                                :key="'ci' + wIndex + pIndex + index"
+                                ><span
+                                  v-for="(wItem, wIndex) in pItem.leg"
+                                  :key="'ci' + wIndex + pIndex + index"
+                                  :class="[
+                                    pItem.chstimeList &&
+                                    pItem.chstimeList[wIndex] &&
+                                    curTime >= pItem.chstimeList[wIndex].wordBg &&
+                                    curTime < item.timeList[pItem.sentIndex].ed
+                                      ? 'wordActive'
+                                      : '',
+                                  ]"
+                                  :style="{
+                                    color:
+                                      newWordList.indexOf(pItem.chs) > -1 || pItem.words
+                                        ? attrib
+                                          ? attrib.topic_color
+                                          : pItem.matchNotesObj.con && pItem.matchNotesObj.notesColor
+                                            ? pItem.matchNotesObj.notesColor
+                                            : pItem.config.color
+                                        : pItem.config.color,
+                                  }"
+                                  @click.stop="viewNotes($event, pItem.chs[wIndex], pItem.chs, pItem)"
+                                  >{{ convertText(pItem.chs[wIndex]) }}</span
+                                >
+                                <img
+                                  v-if="pItem.img && pItem.img.length > 0 && pItem.imgPosition === 'after'"
+                                  :src="pItem.img[0].file_url"
+                                  :style="{
+                                    height: attrib && attrib.font_size ? attrib.font_size : '20px',
+                                  }"
+                                />
+                              </span>
+                            </el-tooltip>
+                            <template v-else>
+                              <span
+                                class="NNPE-chs"
                                 :class="[
-                                  pItem.chstimeList &&
-                                  pItem.chstimeList[wIndex] &&
-                                  curTime >= pItem.chstimeList[wIndex].wordBg &&
-                                  curTime < item.timeList[pItem.sentIndex].ed
-                                    ? 'wordActive'
-                                    : '',
+                                  pItem.chs != '“' && pItem.padding && config.isShowPY ? 'padding' : '',
+                                  newWordList.indexOf(pItem.chs) > -1 ? 'active' : '',
+                                  pItem.words ? 'active' : '',
                                 ]"
                                 :style="{
+                                  fontFamily: pItem.config.fontFamily,
+                                  textDecoration: pItem.config.textDecoration,
+                                  borderBottom: pItem.config.border === 'dotted' ? '1px dotted' : '',
+                                  fontWeight: pItem.config.fontWeight,
+                                  height:
+                                    attrib && attrib.font_size
+                                      ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
+                                      : '28px',
+                                  fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
+                                  lineHeight:
+                                    attrib && attrib.font_size
+                                      ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
+                                      : '28px',
                                   color:
                                     newWordList.indexOf(pItem.chs) > -1 || pItem.words
                                       ? attrib
                                         ? attrib.topic_color
-                                        : pItem.matchNotesObj.con && pItem.matchNotesObj.notesColor
-                                          ? pItem.matchNotesObj.notesColor
-                                          : pItem.config.color
-                                      : pItem.config.color,
-                                }"
-                                @click.stop="viewNotes($event, pItem.chs[wIndex], pItem.chs, pItem)"
-                                >{{ convertText(pItem.chs[wIndex]) }}</span
-                              >
-                              <img
-                                v-if="pItem.img && pItem.img.length > 0 && pItem.imgPosition === 'after'"
-                                :src="pItem.img[0].file_url"
-                                :style="{
-                                  height: attrib && attrib.font_size ? attrib.font_size : '20px',
+                                        : pItem.config.color
+                                      : pItem.matchNotesObj.con && pItem.matchNotesObj.notesColor
+                                        ? pItem.matchNotesObj.notesColor
+                                        : pItem.config.color,
+
+                                  width: pItem.chs.trim() === '' ? '6px' : '',
                                 }"
-                              />
-                            </span>
-                          </template>
+                                ><span
+                                  v-for="(wItem, wIndex) in pItem.leg"
+                                  :key="'ci' + wIndex + pIndex + index"
+                                  :class="[
+                                    pItem.chstimeList &&
+                                    pItem.chstimeList[wIndex] &&
+                                    curTime >= pItem.chstimeList[wIndex].wordBg &&
+                                    curTime < item.timeList[pItem.sentIndex].ed
+                                      ? 'wordActive'
+                                      : '',
+                                  ]"
+                                  :style="{
+                                    color:
+                                      newWordList.indexOf(pItem.chs) > -1 || pItem.words
+                                        ? attrib
+                                          ? attrib.topic_color
+                                          : pItem.matchNotesObj.con && pItem.matchNotesObj.notesColor
+                                            ? pItem.matchNotesObj.notesColor
+                                            : pItem.config.color
+                                        : pItem.config.color,
+                                  }"
+                                  @click.stop="viewNotes($event, pItem.chs[wIndex], pItem.chs, pItem)"
+                                  >{{ convertText(pItem.chs[wIndex]) }}</span
+                                >
+                                <img
+                                  v-if="pItem.img && pItem.img.length > 0 && pItem.imgPosition === 'after'"
+                                  :src="pItem.img[0].file_url"
+                                  :style="{
+                                    height: attrib && attrib.font_size ? attrib.font_size : '20px',
+                                  }"
+                                />
+                              </span>
+                            </template>
 
-                          <span
-                            v-if="curQue.property.pinyin_position == 'bottom' && config.isShowPY && item.dhaspinyin"
-                            class="NNPE-pinyin"
-                            :class="[
-                              pItem.chs != '“' && pItem.padding ? 'padding' : '',
-                              pItem.className ? pItem.className : '',
-                              noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : '',
-                            ]"
-                            :style="{
-                              fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
-                              height:
-                                attrib && attrib.pinyin_size
-                                  ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
-                                  : '22px',
-                            }"
-                            @click.stop="viewNotes($event, pItem.pinyin, '', pItem)"
-                            >{{ NumberList.indexOf(pItem.pinyin) == -1 ? pItem.pinyin : '' }}</span
-                          >
+                            <span
+                              v-if="curQue.property.pinyin_position == 'bottom' && config.isShowPY && item.dhaspinyin"
+                              class="NNPE-pinyin"
+                              :class="[
+                                pItem.chs != '“' && pItem.padding ? 'padding' : '',
+                                pItem.className ? pItem.className : '',
+                                noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : '',
+                              ]"
+                              :style="{
+                                fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
+                                height:
+                                  attrib && attrib.pinyin_size
+                                    ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
+                                    : '22px',
+                              }"
+                              @click.stop="viewNotes($event, pItem.pinyin, '', pItem)"
+                              >{{ NumberList.indexOf(pItem.pinyin) == -1 ? pItem.pinyin : '' }}</span
+                            >
+                          </span>
                         </template>
                       </template>
                     </template>
@@ -1414,8 +1743,9 @@ export default {
       resArr: [],
       resObj: null,
       curTime: 0, // 单位s
-      chsFhList: [',', '。', '”', ':', '》', '?', '!', ';', '#', '、'],
+      chsFhList: [',', '。', '”', ':', '》', '?', '!', ';', '#', '、', '’', ')', '〕', '〕〕', '〉'],
       enFhList: [',', '.', ';', '?', '!', ':', '>', '<'],
+      firstFhlist: ['(', '“', '‘', '〔', '〔〔', '〈'],
       NumberList: ['①', '②', '③', '④', '⑤', '⑥', '⑦', '⑧', '⑨', '⑩', '⑪', '⑫', '⑬', '⑭', '⑮', '⑯', '⑰', '⑱', '⑲', '⑳'],
       newWords: ['鱼', '辩礼义'],
       oldHz: '',
@@ -1771,7 +2101,11 @@ export default {
         //   wItem.chs = "<a>" + wItem.chs + "</a><a>" + chs + "</a>";
         //   wItem.pinyin = "<a>" + wItem.pinyin + "</a><a>" + pinyin + "</a>";
         // }
-        if (this.chsFhList.indexOf(wItem.chs) > -1 || this.NumberList.indexOf(wItem.chs) > -1) {
+        if (
+          this.chsFhList.indexOf(wItem.chs) > -1 ||
+          this.NumberList.indexOf(wItem.chs) > -1 ||
+          this.firstFhlist.indexOf(wItem.chs) > -1
+        ) {
           wItem.isShow = false;
         } else {
           wItem.isShow = true;
@@ -1783,7 +2117,11 @@ export default {
       // }
     },
     mergeWordSymbols(wItem) {
-      if (this.chsFhList.indexOf(wItem.chs) > -1 || this.NumberList.indexOf(wItem.chs) > -1) {
+      if (
+        this.chsFhList.indexOf(wItem.chs) > -1 ||
+        this.NumberList.indexOf(wItem.chs) > -1 ||
+        this.firstFhlist.indexOf(wItem.chs) > -1
+      ) {
         wItem.isShow = false;
       } else {
         wItem.isShow = true;

+ 291 - 77
src/views/book/courseware/preview/components/article/Practicechs.vue

@@ -108,6 +108,213 @@
               >
                 <template v-if="!pItem.width">
                   <template v-if="pItem.isShow">
+                    <span
+                      v-if="
+                        item.sentArr[pIndex - 1] &&
+                        item.sentArr[pIndex - 1].chs &&
+                        firstFhlist.indexOf(item.sentArr[pIndex - 1].chs) > -1 &&
+                        item.sentArr[pIndex - 2] &&
+                        item.sentArr[pIndex - 2].chs &&
+                        firstFhlist.indexOf(item.sentArr[pIndex - 2].chs) > -1
+                      "
+                      class="NNPE-words-box"
+                    >
+                      <template v-if="curQue.property.pinyin_position == 'top'">
+                        <span
+                          v-if="config.isShowPY"
+                          :class="[
+                            'NNPE-pinyin',
+                            sentIndex == index ? 'wordBlank' : '',
+                            noFont.indexOf(item.sentArr[pIndex - 2].pinyin) > -1 ? 'noFont' : '',
+                          ]"
+                          style="text-align: left"
+                          :style="{
+                            fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
+                            height:
+                              attrib && attrib.pinyin_size ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt' : '22px',
+                          }"
+                          >{{
+                            NumberList.indexOf(item.sentArr[pIndex - 2].pinyin) == -1
+                              ? item.sentArr[pIndex - 2].pinyin
+                              : ''
+                          }}</span
+                        >
+                      </template>
+                      <span class="NNPE-chs" style="text-align: left" :class="[sentIndex == index ? 'wordBlank' : '']">
+                        <span
+                          :class="[
+                            pItem.timeList[0] &&
+                            curQue.wordTime &&
+                            curTime >= pItem.timeList[0].wordBg &&
+                            curTime <= curQue.wordTime[index].ed
+                              ? 'active'
+                              : '',
+                            sentIndex == index ? 'wordBlank' : '',
+                          ]"
+                          :style="{
+                            fontFamily: item.sentArr[pIndex - 2].config.fontFamily,
+                            textDecoration: item.sentArr[pIndex - 2].config.textDecoration,
+                            borderBottom: item.sentArr[pIndex - 2].config.border === 'dotted' ? '1px dotted' : '',
+                            fontWeight: item.sentArr[pIndex - 2].config.fontWeight,
+                            height:
+                              attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
+                            fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
+                            lineHeight:
+                              attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
+                            display: 'inline-block',
+                            width: item.sentArr[pIndex - 2].chs.trim() === '' ? '6px' : '',
+                            color:
+                              pItem.timeList[0] &&
+                              curQue.wordTime &&
+                              curTime >= pItem.timeList[0].wordBg &&
+                              curTime <= curQue.wordTime[index].ed &&
+                              attrib
+                                ? attrib.topic_color
+                                : item.sentArr[pIndex - 2].config.color,
+                          }"
+                        >
+                          {{
+                            NumberList.indexOf(item.sentArr[pIndex - 2].pinyin) == -1
+                              ? convertText(item.sentArr[pIndex - 2].chs)
+                              : ''
+                          }}</span
+                        >
+                        <img
+                          v-if="
+                            item.sentArr[pIndex - 2].img &&
+                            item.sentArr[pIndex - 2].img.length > 0 &&
+                            item.sentArr[pIndex - 2].imgPosition === 'after'
+                          "
+                          :src="item.sentArr[pIndex - 2].img[0].file_url"
+                          :style="{
+                            height: attrib && attrib.font_size ? attrib.font_size : '20px',
+                          }"
+                        />
+                      </span>
+                      <template v-if="curQue.property.pinyin_position == 'bottom'">
+                        <span
+                          v-if="config.isShowPY"
+                          :class="[
+                            'NNPE-pinyin',
+                            sentIndex == index ? 'wordBlank' : '',
+                            noFont.indexOf(item.sentArr[pIndex - 2].pinyin) > -1 ? 'noFont' : '',
+                          ]"
+                          style="text-align: left"
+                          :style="{
+                            fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
+                            height:
+                              attrib && attrib.pinyin_size ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt' : '22px',
+                          }"
+                          >{{
+                            NumberList.indexOf(item.sentArr[pIndex - 2].pinyin) == -1
+                              ? item.sentArr[pIndex - 2].pinyin
+                              : ''
+                          }}</span
+                        >
+                      </template>
+                    </span>
+                    <span
+                      v-if="
+                        item.sentArr[pIndex - 1] &&
+                        item.sentArr[pIndex - 1].chs &&
+                        firstFhlist.indexOf(item.sentArr[pIndex - 1].chs) > -1
+                      "
+                      class="NNPE-words-box"
+                    >
+                      <template v-if="curQue.property.pinyin_position == 'top'">
+                        <span
+                          v-if="config.isShowPY"
+                          :class="[
+                            'NNPE-pinyin',
+                            sentIndex == index ? 'wordBlank' : '',
+                            noFont.indexOf(item.sentArr[pIndex - 1].pinyin) > -1 ? 'noFont' : '',
+                          ]"
+                          style="text-align: left"
+                          :style="{
+                            fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
+                            height:
+                              attrib && attrib.pinyin_size ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt' : '22px',
+                          }"
+                          >{{
+                            NumberList.indexOf(item.sentArr[pIndex - 1].pinyin) == -1
+                              ? item.sentArr[pIndex - 1].pinyin
+                              : ''
+                          }}</span
+                        >
+                      </template>
+                      <span class="NNPE-chs" style="text-align: left" :class="[sentIndex == index ? 'wordBlank' : '']">
+                        <span
+                          :class="[
+                            pItem.timeList[0] &&
+                            curQue.wordTime &&
+                            curTime >= pItem.timeList[0].wordBg &&
+                            curTime <= curQue.wordTime[index].ed
+                              ? 'active'
+                              : '',
+                            sentIndex == index ? 'wordBlank' : '',
+                          ]"
+                          :style="{
+                            fontFamily: item.sentArr[pIndex - 1].config.fontFamily,
+                            textDecoration: item.sentArr[pIndex - 1].config.textDecoration,
+                            borderBottom: item.sentArr[pIndex - 1].config.border === 'dotted' ? '1px dotted' : '',
+                            fontWeight: item.sentArr[pIndex - 1].config.fontWeight,
+                            height:
+                              attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
+                            fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
+                            lineHeight:
+                              attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
+                            display: 'inline-block',
+                            width: item.sentArr[pIndex - 1].chs.trim() === '' ? '6px' : '',
+                            color:
+                              pItem.timeList[0] &&
+                              curQue.wordTime &&
+                              curTime >= pItem.timeList[0].wordBg &&
+                              curTime <= curQue.wordTime[index].ed &&
+                              attrib
+                                ? attrib.topic_color
+                                : item.sentArr[pIndex - 1].config.color,
+                          }"
+                        >
+                          {{
+                            NumberList.indexOf(item.sentArr[pIndex - 1].pinyin) == -1
+                              ? convertText(item.sentArr[pIndex - 1].chs)
+                              : ''
+                          }}</span
+                        >
+                        <img
+                          v-if="
+                            item.sentArr[pIndex - 1].img &&
+                            item.sentArr[pIndex - 1].img.length > 0 &&
+                            item.sentArr[pIndex - 1].imgPosition === 'after'
+                          "
+                          :src="item.sentArr[pIndex - 1].img[0].file_url"
+                          :style="{
+                            height: attrib && attrib.font_size ? attrib.font_size : '20px',
+                          }"
+                        />
+                      </span>
+                      <template v-if="curQue.property.pinyin_position == 'bottom'">
+                        <span
+                          v-if="config.isShowPY"
+                          :class="[
+                            'NNPE-pinyin',
+                            sentIndex == index ? 'wordBlank' : '',
+                            noFont.indexOf(item.sentArr[pIndex - 1].pinyin) > -1 ? 'noFont' : '',
+                          ]"
+                          style="text-align: left"
+                          :style="{
+                            fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
+                            height:
+                              attrib && attrib.pinyin_size ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt' : '22px',
+                          }"
+                          >{{
+                            NumberList.indexOf(item.sentArr[pIndex - 1].pinyin) == -1
+                              ? item.sentArr[pIndex - 1].pinyin
+                              : ''
+                          }}</span
+                        >
+                      </template>
+                    </span>
                     <template
                       v-if="
                         item.sentArr[pIndex + 1] &&
@@ -419,95 +626,101 @@
                       </span>
                     </template>
                     <template v-else>
-                      <template v-if="curQue.property.pinyin_position == 'top'">
+                      <span class="NNPE-words-box">
+                        <template v-if="curQue.property.pinyin_position == 'top'">
+                          <span
+                            v-if="config.isShowPY"
+                            class="NNPE-pinyin"
+                            :class="[
+                              pItem.chs != '“' && pItem.padding ? 'padding' : '',
+                              pItem.className ? pItem.className : '',
+                              sentIndex == index ? 'wordBlank' : '',
+                              noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : '',
+                            ]"
+                            :style="{
+                              fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
+                              height:
+                                attrib && attrib.pinyin_size
+                                  ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
+                                  : '22px',
+                            }"
+                            >{{ NumberList.indexOf(pItem.pinyin) == -1 ? pItem.pinyin : '' }}</span
+                          >
+                        </template>
                         <span
-                          v-if="config.isShowPY"
-                          class="NNPE-pinyin"
+                          class="NNPE-chs"
                           :class="[
-                            pItem.chs != '“' && pItem.padding ? 'padding' : '',
-                            pItem.className ? pItem.className : '',
+                            pItem.chs != '“' && pItem.padding && config.isShowPY ? 'padding' : '',
                             sentIndex == index ? 'wordBlank' : '',
-                            noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : '',
                           ]"
-                          :style="{
-                            fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
-                            height:
-                              attrib && attrib.pinyin_size ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt' : '22px',
-                          }"
-                          >{{ NumberList.indexOf(pItem.pinyin) == -1 ? pItem.pinyin : '' }}</span
                         >
-                      </template>
-                      <span
-                        class="NNPE-chs"
-                        :class="[
-                          pItem.chs != '“' && pItem.padding && config.isShowPY ? 'padding' : '',
-                          sentIndex == index ? 'wordBlank' : '',
-                        ]"
-                      >
-                        <template v-for="(wItem, wIndex) in pItem.leg">
+                          <template v-for="(wItem, wIndex) in pItem.leg">
+                            <span
+                              :key="'ci' + wIndex + pIndex + index"
+                              :class="[
+                                pItem.timeList[wIndex] &&
+                                curQue.wordTime &&
+                                curQue.wordTime[index] &&
+                                curTime >= pItem.timeList[wIndex].wordBg &&
+                                curTime <= curQue.wordTime[index].ed
+                                  ? 'active'
+                                  : '',
+                                sentIndex == index ? 'wordBlank' : '',
+                              ]"
+                              :style="{
+                                fontFamily: pItem.config.fontFamily,
+                                textDecoration: pItem.config.textDecoration,
+                                borderBottom: pItem.config.border === 'dotted' ? '1px dotted' : '',
+                                fontWeight: pItem.config.fontWeight,
+                                height:
+                                  attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
+                                fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
+                                lineHeight:
+                                  attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
+                                display: 'inline-block',
+                                width: pItem.chs[wIndex].trim() === '' ? '6px' : '',
+                                color:
+                                  pItem.timeList[wIndex] &&
+                                  curQue.wordTime &&
+                                  curQue.wordTime[index] &&
+                                  curTime >= pItem.timeList[wIndex].wordBg &&
+                                  curTime <= curQue.wordTime[index].ed &&
+                                  attrib
+                                    ? attrib.topic_color
+                                    : pItem.config.color,
+                              }"
+                              >{{ NumberList.indexOf(pItem.pinyin) == -1 ? convertText(pItem.chs[wIndex]) : '' }}
+                            </span>
+                          </template>
+                          <img
+                            v-if="pItem.img && pItem.img.length > 0 && pItem.imgPosition === 'after'"
+                            :src="pItem.img[0].file_url"
+                            :style="{
+                              height: attrib && attrib.font_size ? attrib.font_size : '20px',
+                            }"
+                          />
+                        </span>
+                        <template v-if="curQue.property.pinyin_position == 'bottom'">
                           <span
-                            :key="'ci' + wIndex + pIndex + index"
+                            v-if="config.isShowPY"
+                            class="NNPE-pinyin"
                             :class="[
-                              pItem.timeList[wIndex] &&
-                              curQue.wordTime &&
-                              curQue.wordTime[index] &&
-                              curTime >= pItem.timeList[wIndex].wordBg &&
-                              curTime <= curQue.wordTime[index].ed
-                                ? 'active'
-                                : '',
+                              pItem.chs != '“' && pItem.padding ? 'padding' : '',
+                              pItem.className ? pItem.className : '',
                               sentIndex == index ? 'wordBlank' : '',
+                              noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : '',
                             ]"
                             :style="{
-                              fontFamily: pItem.config.fontFamily,
-                              textDecoration: pItem.config.textDecoration,
-                              borderBottom: pItem.config.border === 'dotted' ? '1px dotted' : '',
-                              fontWeight: pItem.config.fontWeight,
+                              fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
                               height:
-                                attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
-                              fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
-                              lineHeight:
-                                attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
-                              display: 'inline-block',
-                              width: pItem.chs[wIndex].trim() === '' ? '6px' : '',
-                              color:
-                                pItem.timeList[wIndex] &&
-                                curQue.wordTime &&
-                                curQue.wordTime[index] &&
-                                curTime >= pItem.timeList[wIndex].wordBg &&
-                                curTime <= curQue.wordTime[index].ed &&
-                                attrib
-                                  ? attrib.topic_color
-                                  : pItem.config.color,
+                                attrib && attrib.pinyin_size
+                                  ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
+                                  : '22px',
                             }"
-                            >{{ NumberList.indexOf(pItem.pinyin) == -1 ? convertText(pItem.chs[wIndex]) : '' }}
-                          </span>
+                            >{{ NumberList.indexOf(pItem.pinyin) == -1 ? pItem.pinyin : '' }}</span
+                          >
                         </template>
-                        <img
-                          v-if="pItem.img && pItem.img.length > 0 && pItem.imgPosition === 'after'"
-                          :src="pItem.img[0].file_url"
-                          :style="{
-                            height: attrib && attrib.font_size ? attrib.font_size : '20px',
-                          }"
-                        />
                       </span>
-                      <template v-if="curQue.property.pinyin_position == 'bottom'">
-                        <span
-                          v-if="config.isShowPY"
-                          class="NNPE-pinyin"
-                          :class="[
-                            pItem.chs != '“' && pItem.padding ? 'padding' : '',
-                            pItem.className ? pItem.className : '',
-                            sentIndex == index ? 'wordBlank' : '',
-                            noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : '',
-                          ]"
-                          :style="{
-                            fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
-                            height:
-                              attrib && attrib.pinyin_size ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt' : '22px',
-                          }"
-                          >{{ NumberList.indexOf(pItem.pinyin) == -1 ? pItem.pinyin : '' }}</span
-                        >
-                      </template>
                     </template>
                   </template>
                 </template>
@@ -750,8 +963,9 @@ export default {
     return {
       resObj: null,
       curTime: 0, // 单位s
-      chsFhList: [',', '。', '”', ':', '》', '?', '!', ';', '、'],
+      chsFhList: [',', '。', '”', ':', '》', '?', '!', ';', '#', '、', '’', ')', '〕', '〕〕', '〉'],
       enFhList: [',', '.', ';', '?', '!', ':', '>', '<'],
+      firstFhlist: ['(', '“', '‘', '〔', '〔〔', '〈'],
       NumberList: ['①', '②', '③', '④', '⑤', '⑥', '⑦', '⑧', '⑨', '⑩', '⑪', '⑫', '⑬', '⑭', '⑮', '⑯', '⑰', '⑱', '⑲', '⑳'],
       stopAudio: false,
       sentIndex: 0,
@@ -1019,7 +1233,7 @@ export default {
     },
     // 词和标点合一起
     mergeWordSymbol(wItem) {
-      if (this.chsFhList.indexOf(wItem.chs) > -1) {
+      if (this.chsFhList.indexOf(wItem.chs) > -1 || this.firstFhlist.indexOf(wItem.chs) > -1) {
         wItem.isShow = false;
       } else {
         wItem.isShow = true;

+ 289 - 70
src/views/book/courseware/preview/components/article/WordModelChs.vue

@@ -100,6 +100,223 @@
                   >
                     <template v-if="!pItem.width">
                       <template v-if="pItem.isShow">
+                        <span
+                          v-if="
+                            item.wordsList[pIndex - 1] &&
+                            item.wordsList[pIndex - 1].chs &&
+                            firstFhlist.indexOf(item.wordsList[pIndex - 1].chs) > -1 &&
+                            item.wordsList[pIndex - 2] &&
+                            item.wordsList[pIndex - 2].chs &&
+                            firstFhlist.indexOf(item.wordsList[pIndex - 2].chs) > -1
+                          "
+                          class="NNPE-words-box"
+                          @click="showWordDetail($event, item.wordsList[pIndex - 2])"
+                        >
+                          <span
+                            v-if="curQue.property.pinyin_position == 'top' && config.isShowPY && item.dhaspinyin"
+                            :class="[
+                              'NNPE-pinyin',
+                              noFont.indexOf(item.wordsList[pIndex - 2].pinyin) > -1 ? 'noFont' : '',
+                            ]"
+                            style="text-align: left"
+                            :style="{
+                              fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
+                              height:
+                                attrib && attrib.pinyin_size
+                                  ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
+                                  : '22px',
+                            }"
+                            >{{
+                              NumberList.indexOf(item.wordsList[pIndex - 2].pinyin) == -1
+                                ? item.wordsList[pIndex - 2].pinyin
+                                : ''
+                            }}</span
+                          >
+                          <span
+                            class="NNPE-chs"
+                            style="text-align: left"
+                            :class="[
+                              item.timeList &&
+                              item.timeList[pItem.sentIndex] &&
+                              curTime >= item.timeList[pItem.sentIndex].bg &&
+                              curTime <= item.timeList[pItem.sentIndex].ed &&
+                              curTime
+                                ? 'active'
+                                : '',
+                              pItem.paraIndex == paraIndex && pItem.sentIndex == sentIndex ? 'overActive' : '',
+                              pItem.chstimeList &&
+                              pItem.chstimeList[0] &&
+                              curTime >= pItem.chstimeList[0].wordBg &&
+                              curQue.wordTime &&
+                              curTime <= item.timeList[pItem.sentIndex].ed
+                                ? 'wordActive'
+                                : '',
+                            ]"
+                            :style="{
+                              fontFamily: item.wordsList[pIndex - 2].config.fontFamily,
+                              textDecoration: item.wordsList[pIndex - 2].config.textDecoration,
+                              borderBottom: item.wordsList[pIndex - 2].config.border === 'dotted' ? '1px dotted' : '',
+                              fontWeight: item.wordsList[pIndex - 2].config.fontWeight,
+                              color: item.wordsList[pIndex - 2].config.color,
+                              height:
+                                attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
+                              fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
+                              lineHeight:
+                                attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
+                              backgroundColor:
+                                item.timeList &&
+                                item.timeList[pItem.sentIndex] &&
+                                curTime >= item.timeList[pItem.sentIndex].bg &&
+                                curTime <= item.timeList[pItem.sentIndex].ed &&
+                                curTime &&
+                                attrib
+                                  ? attrib.assist_color
+                                  : '',
+                              width: item.wordsList[pIndex - 2].chs.trim() === '' ? '6px' : '',
+                            }"
+                            >{{
+                              NumberList.indexOf(item.wordsList[pIndex - 2].pinyin) == -1
+                                ? convertText(item.wordsList[pIndex - 2].chs)
+                                : ''
+                            }}<img
+                              v-if="
+                                item.wordsList[pIndex - 2].img &&
+                                item.wordsList[pIndex - 2].img.length > 0 &&
+                                item.wordsList[pIndex - 2].imgPosition === 'after'
+                              "
+                              :src="item.wordsList[pIndex - 2].img[0].file_url"
+                              :style="{
+                                height: attrib && attrib.font_size ? attrib.font_size : '20px',
+                              }"
+                          /></span>
+                          <span
+                            v-if="curQue.property.pinyin_position == 'bottom' && config.isShowPY && item.dhaspinyin"
+                            :class="[
+                              'NNPE-pinyin',
+                              noFont.indexOf(item.wordsList[pIndex - 2].pinyin) > -1 ? 'noFont' : '',
+                            ]"
+                            style="text-align: left"
+                            :style="{
+                              fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
+                              height:
+                                attrib && attrib.pinyin_size
+                                  ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
+                                  : '22px',
+                            }"
+                            >{{
+                              NumberList.indexOf(item.wordsList[pIndex - 2].pinyin) == -1
+                                ? item.wordsList[pIndex - 2].pinyin
+                                : ''
+                            }}</span
+                          >
+                        </span>
+                        <span
+                          v-if="
+                            item.wordsList[pIndex - 1] &&
+                            item.wordsList[pIndex - 1].chs &&
+                            firstFhlist.indexOf(item.wordsList[pIndex - 1].chs) > -1
+                          "
+                          class="NNPE-words-box"
+                          @click="showWordDetail($event, item.wordsList[pIndex - 1])"
+                        >
+                          <span
+                            v-if="curQue.property.pinyin_position == 'top' && config.isShowPY && item.dhaspinyin"
+                            :class="[
+                              'NNPE-pinyin',
+                              noFont.indexOf(item.wordsList[pIndex - 1].pinyin) > -1 ? 'noFont' : '',
+                            ]"
+                            style="text-align: left"
+                            :style="{
+                              fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
+                              height:
+                                attrib && attrib.pinyin_size
+                                  ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
+                                  : '22px',
+                            }"
+                            >{{
+                              NumberList.indexOf(item.wordsList[pIndex - 1].pinyin) == -1
+                                ? item.wordsList[pIndex - 1].pinyin
+                                : ''
+                            }}</span
+                          >
+                          <span
+                            class="NNPE-chs"
+                            style="text-align: left"
+                            :class="[
+                              item.timeList &&
+                              item.timeList[pItem.sentIndex] &&
+                              curTime >= item.timeList[pItem.sentIndex].bg &&
+                              curTime <= item.timeList[pItem.sentIndex].ed &&
+                              curTime
+                                ? 'active'
+                                : '',
+                              pItem.paraIndex == paraIndex && pItem.sentIndex == sentIndex ? 'overActive' : '',
+                              pItem.chstimeList &&
+                              pItem.chstimeList[0] &&
+                              curTime >= pItem.chstimeList[0].wordBg &&
+                              curQue.wordTime &&
+                              curTime <= item.timeList[pItem.sentIndex].ed
+                                ? 'wordActive'
+                                : '',
+                            ]"
+                            :style="{
+                              fontFamily: item.wordsList[pIndex - 1].config.fontFamily,
+                              textDecoration: item.wordsList[pIndex - 1].config.textDecoration,
+                              borderBottom: item.wordsList[pIndex - 1].config.border === 'dotted' ? '1px dotted' : '',
+                              fontWeight: item.wordsList[pIndex - 1].config.fontWeight,
+                              color: item.wordsList[pIndex - 1].config.color,
+                              height:
+                                attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
+                              fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
+                              lineHeight:
+                                attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
+                              backgroundColor:
+                                item.timeList &&
+                                item.timeList[pItem.sentIndex] &&
+                                curTime >= item.timeList[pItem.sentIndex].bg &&
+                                curTime <= item.timeList[pItem.sentIndex].ed &&
+                                curTime &&
+                                attrib
+                                  ? attrib.assist_color
+                                  : '',
+                              width: item.wordsList[pIndex - 1].chs.trim() === '' ? '6px' : '',
+                            }"
+                            >{{
+                              NumberList.indexOf(item.wordsList[pIndex - 1].pinyin) == -1
+                                ? convertText(item.wordsList[pIndex - 1].chs)
+                                : ''
+                            }}<img
+                              v-if="
+                                item.wordsList[pIndex - 1].img &&
+                                item.wordsList[pIndex - 1].img.length > 0 &&
+                                item.wordsList[pIndex - 1].imgPosition === 'after'
+                              "
+                              :src="item.wordsList[pIndex - 1].img[0].file_url"
+                              :style="{
+                                height: attrib && attrib.font_size ? attrib.font_size : '20px',
+                              }"
+                          /></span>
+                          <span
+                            v-if="curQue.property.pinyin_position == 'bottom' && config.isShowPY && item.dhaspinyin"
+                            :class="[
+                              'NNPE-pinyin',
+                              noFont.indexOf(item.wordsList[pIndex - 1].pinyin) > -1 ? 'noFont' : '',
+                            ]"
+                            style="text-align: left"
+                            :style="{
+                              fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
+                              height:
+                                attrib && attrib.pinyin_size
+                                  ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
+                                  : '22px',
+                            }"
+                            >{{
+                              NumberList.indexOf(item.wordsList[pIndex - 1].pinyin) == -1
+                                ? item.wordsList[pIndex - 1].pinyin
+                                : ''
+                            }}</span
+                          >
+                        </span>
                         <template
                           v-if="
                             item.wordsList[pIndex + 1] &&
@@ -375,81 +592,82 @@
                           </span>
                         </template>
                         <template v-else>
-                          <span
-                            v-if="curQue.property.pinyin_position == 'top' && config.isShowPY && item.dhaspinyin"
-                            class="NNPE-pinyin"
-                            :class="[
-                              pItem.chs != '“' && pItem.padding ? 'padding' : '',
-                              pItem.className ? pItem.className : '',
-                            ]"
-                            :style="{
-                              fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
-                              height:
-                                attrib && attrib.pinyin_size
-                                  ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
-                                  : '22px',
-                            }"
-                            >{{ NumberList.indexOf(pItem.pinyin) == -1 ? pItem.pinyin : '' }}</span
-                          >
-                          <span
-                            class="NNPE-chs"
-                            :class="[
-                              item.timeList &&
-                              item.timeList[pItem.sentIndex] &&
-                              curTime >= item.timeList[pItem.sentIndex].bg &&
-                              curTime <= item.timeList[pItem.sentIndex].ed &&
-                              curTime
-                                ? 'active'
-                                : '',
-                              pItem.chs != '“' && pItem.padding && config.isShowPY ? 'padding' : '',
-                            ]"
-                            :style="{
-                              fontFamily: pItem.config.fontFamily,
-                              textDecoration: pItem.config.textDecoration,
-                              borderBottom: pItem.config.border === 'dotted' ? '1px dotted' : '',
-                              fontWeight: pItem.config.fontWeight,
-                              color: pItem.config.color,
-                              height:
-                                attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
-                              fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
-                              lineHeight:
-                                attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
-                              backgroundColor:
+                          <span class="NNPE-words-box" @click="showWordDetail($event, pItem)">
+                            <span
+                              v-if="curQue.property.pinyin_position == 'top' && config.isShowPY && item.dhaspinyin"
+                              class="NNPE-pinyin"
+                              :class="[
+                                pItem.chs != '“' && pItem.padding ? 'padding' : '',
+                                pItem.className ? pItem.className : '',
+                              ]"
+                              :style="{
+                                fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
+                                height:
+                                  attrib && attrib.pinyin_size
+                                    ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
+                                    : '22px',
+                              }"
+                              >{{ NumberList.indexOf(pItem.pinyin) == -1 ? pItem.pinyin : '' }}</span
+                            >
+                            <span
+                              class="NNPE-chs"
+                              :class="[
                                 item.timeList &&
                                 item.timeList[pItem.sentIndex] &&
                                 curTime >= item.timeList[pItem.sentIndex].bg &&
                                 curTime <= item.timeList[pItem.sentIndex].ed &&
-                                curTime &&
-                                attrib
-                                  ? attrib.assist_color
+                                curTime
+                                  ? 'active'
                                   : '',
-                              width: pItem.chs.trim() === '' ? '6px' : '',
-                            }"
-                            @click="showWordDetail($event, pItem)"
-                            >{{ NumberList.indexOf(pItem.pinyin) == -1 ? convertText(pItem.chs) : ''
-                            }}<img
-                              v-if="pItem.img && pItem.img.length > 0 && pItem.imgPosition === 'after'"
-                              :src="pItem.img[0].file_url"
+                                pItem.chs != '“' && pItem.padding && config.isShowPY ? 'padding' : '',
+                              ]"
                               :style="{
-                                height: attrib && attrib.font_size ? attrib.font_size : '20px',
+                                fontFamily: pItem.config.fontFamily,
+                                textDecoration: pItem.config.textDecoration,
+                                borderBottom: pItem.config.border === 'dotted' ? '1px dotted' : '',
+                                fontWeight: pItem.config.fontWeight,
+                                color: pItem.config.color,
+                                height:
+                                  attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
+                                fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
+                                lineHeight:
+                                  attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
+                                backgroundColor:
+                                  item.timeList &&
+                                  item.timeList[pItem.sentIndex] &&
+                                  curTime >= item.timeList[pItem.sentIndex].bg &&
+                                  curTime <= item.timeList[pItem.sentIndex].ed &&
+                                  curTime &&
+                                  attrib
+                                    ? attrib.assist_color
+                                    : '',
+                                width: pItem.chs.trim() === '' ? '6px' : '',
                               }"
-                          /></span>
-                          <span
-                            v-if="curQue.property.pinyin_position == 'bottom' && config.isShowPY && item.dhaspinyin"
-                            class="NNPE-pinyin"
-                            :class="[
-                              pItem.chs != '“' && pItem.padding ? 'padding' : '',
-                              pItem.className ? pItem.className : '',
-                            ]"
-                            :style="{
-                              fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
-                              height:
-                                attrib && attrib.pinyin_size
-                                  ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
-                                  : '22px',
-                            }"
-                            >{{ NumberList.indexOf(pItem.pinyin) == -1 ? pItem.pinyin : '' }}</span
-                          >
+                              >{{ NumberList.indexOf(pItem.pinyin) == -1 ? convertText(pItem.chs) : ''
+                              }}<img
+                                v-if="pItem.img && pItem.img.length > 0 && pItem.imgPosition === 'after'"
+                                :src="pItem.img[0].file_url"
+                                :style="{
+                                  height: attrib && attrib.font_size ? attrib.font_size : '20px',
+                                }"
+                            /></span>
+                            <span
+                              v-if="curQue.property.pinyin_position == 'bottom' && config.isShowPY && item.dhaspinyin"
+                              class="NNPE-pinyin"
+                              :class="[
+                                pItem.chs != '“' && pItem.padding ? 'padding' : '',
+                                pItem.className ? pItem.className : '',
+                              ]"
+                              :style="{
+                                fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
+                                height:
+                                  attrib && attrib.pinyin_size
+                                    ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
+                                    : '22px',
+                              }"
+                              >{{ NumberList.indexOf(pItem.pinyin) == -1 ? pItem.pinyin : '' }}</span
+                            >
+                          </span>
                         </template>
                       </template>
                     </template>
@@ -987,8 +1205,9 @@ export default {
       resArr: [],
       resObj: null,
       curTime: 0, // 单位s
-      chsFhList: [',', '。', '”', ':', '》', '?', '!', ';', '、', '……'],
+      chsFhList: [',', '。', '”', ':', '》', '?', '!', ';', '#', '、', '’', ')', '〕', '〕〕', '〉'],
       enFhList: [',', '.', ';', '?', '!', ':', '>', '<'],
+      firstFhlist: ['(', '“', '‘', '〔', '〔〔', '〈'],
       NumberList: ['①', '②', '③', '④', '⑤', '⑥', '⑦', '⑧', '⑨', '⑩', '⑪', '⑫', '⑬', '⑭', '⑮', '⑯', '⑰', '⑱', '⑲', '⑳'],
       newWords: ['鱼', '辩礼义'],
       isShow: false,
@@ -1253,7 +1472,7 @@ export default {
     mergeWordSymbol(sItem, wItem, curIndex) {
       let leg = sItem.length;
       if (wItem && wItem.chs) {
-        if (this.chsFhList.indexOf(wItem.chs) > -1) {
+        if (this.chsFhList.indexOf(wItem.chs) > -1 || this.firstFhlist.indexOf(wItem.chs) > -1) {
           wItem.isShow = false;
         } else {
           wItem.isShow = true;

Некоторые файлы не были показаны из-за большого количества измененных файлов