natasha 1 рік тому
батько
коміт
6432f8586e
1 змінених файлів з 115 додано та 51 видалено
  1. 115 51
      src/views/Textanalysis/index.vue

+ 115 - 51
src/views/Textanalysis/index.vue

@@ -266,58 +266,117 @@
                   }"
                 >
                   <template v-if="fenci">
-                    <span v-for="(word, indexsss) in itemss.text" :key="indexsss + 'word'" :class="['word']">
-                      <template v-if="word.isShow">
-                        <span
-                          v-if="pinyinShow"
-                          :class="['pinyin']"
-                          :style="{
-                            fontSize: pinyinFontsize + 'px',
-                            lineHeight: pinyinLineHeight + 'px',
-                          }"
-                        >
-                          {{ word.pinyin }}
+                    <template v-if="itemss.pinyin_lt">
+                        <span class="word">
+                            <span
+                                v-if="pinyinShow"
+                                :class="['pinyin']"
+                                :style="{
+                                    fontSize: pinyinFontsize + 'px',
+                                    lineHeight: pinyinLineHeight + 'px',
+                                }"
+                                >
+                                {{ itemss.pinyin_lt }}
+                            </span>
+                            <br v-if="pinyinShow" />
+                            <span :class="['word-box']">
+                                <span
+                                    class="hanzi"
+                                    v-for="(word, indexsss) in itemss.text" :key="indexsss + 'word'"
+                                    :style="{
+                                        fontSize: wordFontsize + 'px',
+                                        lineHeight: wordLineHeight + 'px',
+                                        background: word.color ? word.color : '',
+                                        color: word.color
+                                        ? '#000'
+                                        : !xifen
+                                        ? leftNavIndex == 0
+                                            ? seleLevelMapList.indexOf(word.levels.P_G) != -1
+                                            ? levelMap[word.levels.P_G].color
+                                            : '#000'
+                                            : leftNavIndex == 1
+                                            ? seleLevelMapList.indexOf(word.levels.W_G) != -1
+                                            ? levelMap[word.levels.W_G].color
+                                            : '#000'
+                                            : leftNavIndex == 2
+                                            ? seleLevelMapList.indexOf(word.levels.C_G) != -1
+                                            ? levelMap[word.levels.C_G].color
+                                            : '#000'
+                                            : '#000'
+                                        : leftNavIndex == 0
+                                        ? seleLevelMapList.indexOf(word.levels.P_L) != -1
+                                            ? levelMap[word.levels.P_L].color
+                                            : '#000'
+                                        : leftNavIndex == 1
+                                        ? seleLevelMapList.indexOf(word.levels.W_L) != -1
+                                            ? levelMap[word.levels.W_L].color
+                                            : '#000'
+                                        : leftNavIndex == 2
+                                        ? seleLevelMapList.indexOf(word.levels.C_L) != -1
+                                            ? levelMap[word.levels.C_L].color
+                                            : '#000'
+                                        : '#000',
+                                    }"
+                                    >{{ word.word }}</span>
+                            </span>
                         </span>
-                        <br v-if="pinyinShow" />
-                        <span
-                          class="hanzi"
-                          :style="{
-                            fontSize: wordFontsize + 'px',
-                            lineHeight: wordLineHeight + 'px',
-                            background: word.color ? word.color : '',
-                            color: word.color
-                              ? '#000'
-                              : !xifen
-                              ? leftNavIndex == 0
-                                ? seleLevelMapList.indexOf(word.levels.P_G) != -1
-                                  ? levelMap[word.levels.P_G].color
-                                  : '#000'
-                                : leftNavIndex == 1
-                                ? seleLevelMapList.indexOf(word.levels.W_G) != -1
-                                  ? levelMap[word.levels.W_G].color
-                                  : '#000'
-                                : leftNavIndex == 2
-                                ? seleLevelMapList.indexOf(word.levels.C_G) != -1
-                                  ? levelMap[word.levels.C_G].color
-                                  : '#000'
-                                : '#000'
-                              : leftNavIndex == 0
-                              ? seleLevelMapList.indexOf(word.levels.P_L) != -1
-                                ? levelMap[word.levels.P_L].color
-                                : '#000'
-                              : leftNavIndex == 1
-                              ? seleLevelMapList.indexOf(word.levels.W_L) != -1
-                                ? levelMap[word.levels.W_L].color
-                                : '#000'
-                              : leftNavIndex == 2
-                              ? seleLevelMapList.indexOf(word.levels.C_L) != -1
-                                ? levelMap[word.levels.C_L].color
-                                : '#000'
-                              : '#000',
-                          }"
-                        >{{ word.word }}</span>
-                      </template>
-                    </span>
+
+                    </template>
+                    <template v-else>
+                        <span v-for="(word, indexsss) in itemss.text" :key="indexsss + 'word'" :class="['word']">
+                            <template v-if="word.isShow">
+                                <span
+                                v-if="pinyinShow"
+                                :class="['pinyin']"
+                                :style="{
+                                    fontSize: pinyinFontsize + 'px',
+                                    lineHeight: pinyinLineHeight + 'px',
+                                }"
+                                >
+                                {{ word.pinyin }}
+                                </span>
+                                <br v-if="pinyinShow" />
+                                <span
+                                class="hanzi"
+                                :style="{
+                                    fontSize: wordFontsize + 'px',
+                                    lineHeight: wordLineHeight + 'px',
+                                    background: word.color ? word.color : '',
+                                    color: word.color
+                                    ? '#000'
+                                    : !xifen
+                                    ? leftNavIndex == 0
+                                        ? seleLevelMapList.indexOf(word.levels.P_G) != -1
+                                        ? levelMap[word.levels.P_G].color
+                                        : '#000'
+                                        : leftNavIndex == 1
+                                        ? seleLevelMapList.indexOf(word.levels.W_G) != -1
+                                        ? levelMap[word.levels.W_G].color
+                                        : '#000'
+                                        : leftNavIndex == 2
+                                        ? seleLevelMapList.indexOf(word.levels.C_G) != -1
+                                        ? levelMap[word.levels.C_G].color
+                                        : '#000'
+                                        : '#000'
+                                    : leftNavIndex == 0
+                                    ? seleLevelMapList.indexOf(word.levels.P_L) != -1
+                                        ? levelMap[word.levels.P_L].color
+                                        : '#000'
+                                    : leftNavIndex == 1
+                                    ? seleLevelMapList.indexOf(word.levels.W_L) != -1
+                                        ? levelMap[word.levels.W_L].color
+                                        : '#000'
+                                    : leftNavIndex == 2
+                                    ? seleLevelMapList.indexOf(word.levels.C_L) != -1
+                                        ? levelMap[word.levels.C_L].color
+                                        : '#000'
+                                    : '#000',
+                                }"
+                                >{{ word.word }}</span>
+                            </template>
+                        </span>
+                    </template>
+                    
                   </template>
                   <template v-else>
                     <span v-for="(word, indexsss) in itemss.text" :key="indexsss + 'word'" class="word" :style="{padding: `0 ${wordsMargin<3?'1':wordsMargin>5?'2':wordsMargin-2}px`}">
@@ -1262,7 +1321,9 @@ export default {
                 this.ArticelData.forEach((item) => {
                     item.forEach((items) => {
                     items.forEach((itemss, index) => {
+                        let wordStr = ''
                         itemss.text.forEach((itemsss) => {
+                            wordStr += itemsss.word
                         if (this.chsFhList.indexOf(itemsss.word) === -1) {
                             itemsss.isShow = true;
                         } else {
@@ -1282,6 +1343,9 @@ export default {
                         }
                         str += itemsss.word;
                         });
+                        if(itemss.pinyin_lt){
+                            itemss.wordStr = wordStr
+                        }
                     });
                     });
                 });