Selaa lähdekoodia

去掉与原句比对

natasha 2 vuotta sitten
vanhempi
commit
734cde2f68

+ 22 - 22
src/components/Adult/common/DuoSentenceSegwordChs/components/DuoSegbywordChs.vue

@@ -270,28 +270,28 @@ export default {
     },
     //生成拼音
     _createPinyin() {
-      let _this = this;
-      let sent_arr = this.sent_str.split(/\s+/);
-      let res_str = "";
-      sent_arr.forEach((item) => {
-        if (item) {
-          let bool = this.checkEn(item);
-          if (bool) {
-            res_str += item.trim() + " ";
-          } else if (item == "(") {
-            res_str += " " + item.trim() + " ";
-          } else if (item == ")") {
-            res_str += " " + item.trim() + " ";
-          } else {
-            res_str += item.trim();
-          }
-        }
-      });
-      res_str = res_str.replace(/\s+/g, "");
-      if (res_str.trim() != this.sent_org.trim()) {
-        this.$message.warning("跟原句不一致,请检查是否误删除或新增其他内容");
-        return;
-      }
+    //   let _this = this;
+    //   let sent_arr = this.sent_str.split(/\s+/);
+    //   let res_str = "";
+    //   sent_arr.forEach((item) => {
+    //     if (item) {
+    //       let bool = this.checkEn(item);
+    //       if (bool) {
+    //         res_str += item.trim() + " ";
+    //       } else if (item == "(") {
+    //         res_str += " " + item.trim() + " ";
+    //       } else if (item == ")") {
+    //         res_str += " " + item.trim() + " ";
+    //       } else {
+    //         res_str += item.trim();
+    //       }
+    //     }
+    //   });
+    //   res_str = res_str.replace(/\s+/g, "");
+    //   if (res_str.trim() != this.sent_org.trim()) {
+    //     this.$message.warning("跟原句不一致,请检查是否误删除或新增其他内容");
+    //     return;
+    //   }
       let textListList = [];
       let arr = this.sent_str.split(/\s+/);
       let seg_word = this.sent_str.replace(/\s+/g, " ");

+ 4 - 4
src/components/Adult/common/SegwordConfig.vue

@@ -31,7 +31,7 @@
               <el-radio label="28px">28px</el-radio>
             </el-radio-group>
           </div>
-          <div class="adult-book-input-item">
+          <!-- <div class="adult-book-input-item">
             <span class="adult-book-lable">字的颜色:</span>
             <el-radio-group v-model="scope.row.fontColor">
               <el-radio
@@ -48,7 +48,7 @@
                 >
               </el-radio>
             </el-radio-group>
-          </div>
+          </div> -->
           <div class="adult-book-input-item">
             <span class="adult-book-lable">字体:</span>
             <el-radio-group v-model="scope.row.fontFamily">
@@ -65,7 +65,7 @@
             <span class="adult-book-lable">设置下划线:</span>
             <el-checkbox v-model="scope.row.underLine">显示下划线</el-checkbox>
           </div>
-          <div class="adult-book-input-item">
+          <div class="adult-book-input-item" v-if="type!='dialogue_answer_chs'">
             <span class="adult-book-lable">设置间距:</span>
             <el-checkbox-group v-model="scope.row.wordPadding">
               <el-checkbox
@@ -88,7 +88,7 @@ import "@/utils/pinyin_dict_withtone";
 import "@/utils/pinyinUtil";
 export default {
   components: {},
-  props: ["data"],
+  props: ["data", "type"],
   data() {
     return {
       colorList: [

+ 4 - 4
src/components/Adult/common/SentenceSegwordChs/components/SegbywordChs.vue

@@ -205,10 +205,10 @@ export default {
       });
       res_str = res_str.replace(/\s+/g, " ");
       let org_sent = this.curQue.sentence;
-      if (res_str.trim() != org_sent.trim()) {
-        this.$message.warning("跟原句不一致,请检查是否误删除或新增其他内容");
-        return;
-      }
+    //   if (res_str.trim() != org_sent.trim()) {
+    //     this.$message.warning("跟原句不一致,请检查是否误删除或新增其他内容");
+    //     return;
+    //   }
       let textListList = [];
       let arr = this.curQue.seg_words.split(/\s+/);
       this.$set(this.curQue, "segList", arr);

+ 4 - 4
src/components/Adult/common/SentenceSegwordChs2/components/SegbywordChs.vue

@@ -185,10 +185,10 @@ export default {
       });
       res_str = res_str.replace(/\s+/g, " ");
       let org_sent = this.curQue.sentence;
-      if (res_str.trim() != org_sent.trim()) {
-        this.$message.warning("跟原句不一致,请检查是否误删除或新增其他内容");
-        return;
-      }
+    //   if (res_str.trim() != org_sent.trim()) {
+    //     this.$message.warning("跟原句不一致,请检查是否误删除或新增其他内容");
+    //     return;
+    //   }
       let textListList = [];
       let arr = this.curQue.seg_words.split(/\s+/);
       this.$set(this.curQue, "segList", arr);

+ 8 - 8
src/components/Adult/inputModules/ArticleTemChs/components/SegbywordChs.vue

@@ -271,10 +271,10 @@ export default {
       });
       res_str = res_str.replace(/\s+/g, " ");
       let org_sent = this.paraCon.sentences[sentIndex];
-      if (res_str.trim() != org_sent.trim()) {
-        this.$message.warning("跟原句不一致,请检查是否误删除或新增其他内容");
-        return;
-      }
+    //   if (res_str.trim() != org_sent.trim()) {
+    //     this.$message.warning("跟原句不一致,请检查是否误删除或新增其他内容");
+    //     return;
+    //   }
       let arr = this.paraCon.seg_words[sentIndex].sent_str.split(/\s+/);
       this.$set(this.paraCon.segList, sentIndex, arr);
       let wordsList = [];
@@ -309,10 +309,10 @@ export default {
       });
       res_str = res_str.replace(/\s+/g, " ");
       let org_sent = this.paraCon.sentences[sentIndex];
-      if (res_str.trim() != org_sent.trim()) {
-        this.$message.warning("跟原句不一致,请检查是否误删除或新增其他内容");
-        return;
-      }
+    //   if (res_str.trim() != org_sent.trim()) {
+    //     this.$message.warning("跟原句不一致,请检查是否误删除或新增其他内容");
+    //     return;
+    //   }
       let textListList = [];
       let arr = this.paraCon.seg_words[sentIndex].sent_str.split(/\s+/);
       this.$set(this.paraCon.segList, sentIndex, arr);

+ 2 - 2
src/components/Adult/inputModules/DialogueAnswerChs/index.vue

@@ -68,7 +68,7 @@
     </div>
 
     <el-dialog
-      title="添加对话22"
+      title="添加对话"
       :close-on-click-modal="false"
       :modal-append-to-body="false"
       append-to-body
@@ -76,7 +76,7 @@
       width="80%"
       top="10px"
     >
-      <DialogueTem :curQue="curQue.list[listIndex]" :listIndex="listIndex" />
+      <DialogueTem :curQue="curQue.list[listIndex]" :listIndex="listIndex" :type="curQue.type" />
       <span slot="footer" class="dialog-footer">
         <el-button @click="cancleDialogue">取 消</el-button>
         <el-button type="primary" @click="cancleDialogue">确 定</el-button>

+ 4 - 4
src/components/Adult/inputModules/DialogueArticleChs/components/RoleChs.vue

@@ -128,10 +128,10 @@ export default {
     _createPinyin() {
       let res_str = this.curRole.detail.seg_words.replace(/\s+/g, "");
       let org_sent = this.curRole.detail.fullName;
-      if (res_str.trim() != org_sent.trim()) {
-        this.$message.warning("跟原句不一致,请检查是否误删除或新增其他内容");
-        return;
-      }
+    //   if (res_str.trim() != org_sent.trim()) {
+    //     this.$message.warning("跟原句不一致,请检查是否误删除或新增其他内容");
+    //     return;
+    //   }
       let textListList = [];
       let segArr = JSON.parse(JSON.stringify(this.curRole.detail.segList));
       segArr.forEach((item) => {

+ 8 - 8
src/components/Adult/inputModules/DialogueArticleChs/components/SegbywordChs.vue

@@ -271,10 +271,10 @@ export default {
       });
       res_str = res_str.replace(/\s+/g, " ");
       let org_sent = this.paraCon.sentences[sentIndex];
-      if (res_str.trim() != org_sent.trim()) {
-        this.$message.warning("跟原句不一致,请检查是否误删除或新增其他内容");
-        return;
-      }
+    //   if (res_str.trim() != org_sent.trim()) {
+    //     this.$message.warning("跟原句不一致,请检查是否误删除或新增其他内容");
+    //     return;
+    //   }
       let arr = this.paraCon.seg_words[sentIndex].sent_str.split(/\s+/);
       this.$set(this.paraCon.segList, sentIndex, arr);
       let wordsList = [];
@@ -308,10 +308,10 @@ export default {
       });
       res_str = res_str.replace(/\s+/g, " ");
       let org_sent = this.paraCon.sentences[sentIndex];
-      if (res_str.trim() != org_sent.trim()) {
-        this.$message.warning("跟原句不一致,请检查是否误删除或新增其他内容");
-        return;
-      }
+    //   if (res_str.trim() != org_sent.trim()) {
+    //     this.$message.warning("跟原句不一致,请检查是否误删除或新增其他内容");
+    //     return;
+    //   }
       let textListList = [];
       let arr = this.paraCon.seg_words[sentIndex].sent_str.split(/\s+/);
       this.$set(this.paraCon.segList, sentIndex, arr);

+ 4 - 4
src/components/Adult/inputModules/DialogueTem/components/RoleChs.vue

@@ -122,10 +122,10 @@ export default {
     _createPinyin() {
       let res_str = this.curRole.detail.seg_words.replace(/\s+/g, "");
       let org_sent = this.curRole.detail.fullName;
-      if (res_str.trim() != org_sent.trim()) {
-        this.$message.warning("跟原句不一致,请检查是否误删除或新增其他内容");
-        return;
-      }
+    //   if (res_str.trim() != org_sent.trim()) {
+    //     this.$message.warning("跟原句不一致,请检查是否误删除或新增其他内容");
+    //     return;
+    //   }
       let textListList = [];
       let segArr = JSON.parse(JSON.stringify(this.curRole.detail.segList));
       segArr.forEach((item) => {

+ 57 - 47
src/components/Adult/inputModules/DialogueTem/components/SegbywordChs.vue

@@ -94,11 +94,21 @@
             >
           </div>
         </div>
+        <!-- <div class="adult-book-input-item">
+            <span class="adult-book-lable">字的大小:</span>
+            <el-radio-group v-model="scope.row.fontSize">
+              <el-radio label="12px">12px</el-radio>
+              <el-radio label="16px">16px</el-radio>
+              <el-radio label="20px">20px</el-radio>
+              <el-radio label="24px">24px</el-radio>
+              <el-radio label="28px">28px</el-radio>
+            </el-radio-group>
+        </div> -->
         <template>
           <div class="NPC-words-box">
             <span class="Big-Book-left-text">校对拼音:</span>
             <div class="NPC-words-list">
-              <SegwordConfig :data="paraCon.wordsList[sentIndex]" />
+              <SegwordConfig :data="paraCon.wordsList[sentIndex]" :type="type" />
             </div>
             <div class="yunmu">
               <span>点击可复制</span>
@@ -136,7 +146,7 @@ import SegwordConfig from "../../../common/SegwordConfig.vue";
 export default {
   name: "SegbywordChs",
   components: { SegwordConfig },
-  props: ["curQue", "paraIndex", "createPinyin", "segList"],
+  props: ["curQue", "paraIndex", "createPinyin", "segList", "type"],
   data() {
     return {
       proofParaIndex: 0, //校对句子所属的段落
@@ -240,28 +250,28 @@ export default {
     //确定分词结果
     _sureSegWord() {
       let sentIndex = this.sentIndex;
-      let sent_arr = this.paraCon.seg_words[sentIndex].sent_str.split(/\s+/);
-      let res_str = "";
-      sent_arr.forEach((item) => {
-        if (item) {
-          let bool = this.checkEn(item);
-          if (bool) {
-            res_str += item.trim() + " ";
-          } else if (item == "(") {
-            res_str += " " + item.trim() + " ";
-          } else if (item == ")") {
-            res_str += " " + item.trim() + " ";
-          } else {
-            res_str += item.trim();
-          }
-        }
-      });
-      res_str = res_str.replace(/\s+/g, " ");
-      let org_sent = this.paraCon.sentences[sentIndex];
-      if (res_str.trim() != org_sent.trim()) {
-        this.$message.warning("跟原句不一致,请检查是否误删除或新增其他内容");
-        return;
-      }
+    //   let sent_arr = this.paraCon.seg_words[sentIndex].sent_str.split(/\s+/);
+    //   let res_str = "";
+    //   sent_arr.forEach((item) => {
+    //     if (item) {
+    //       let bool = this.checkEn(item);
+    //       if (bool) {
+    //         res_str += item.trim() + " ";
+    //       } else if (item == "(") {
+    //         res_str += " " + item.trim() + " ";
+    //       } else if (item == ")") {
+    //         res_str += " " + item.trim() + " ";
+    //       } else {
+    //         res_str += item.trim();
+    //       }
+    //     }
+    //   });
+    //   res_str = res_str.replace(/\s+/g, " ");
+    //   let org_sent = this.paraCon.sentences[sentIndex];
+    //   if (res_str.trim() != org_sent.trim()) {
+    //     this.$message.warning("跟原句不一致,请检查是否误删除或新增其他内容");
+    //     return;
+    //   }
       let arr = this.paraCon.seg_words[sentIndex].sent_str.split(/\s+/);
       this.$set(this.paraCon.segList, sentIndex, arr);
       let wordsList = [];
@@ -282,28 +292,28 @@ export default {
     //生成拼音
     _createPinyin() {
       let sentIndex = this.sentIndex;
-      let sent_arr = this.paraCon.seg_words[sentIndex].sent_str.split(/\s+/);
-      let res_str = "";
-      sent_arr.forEach((item) => {
-        if (item) {
-          let bool = this.checkEn(item);
-          if (bool) {
-            res_str += item.trim() + " ";
-          } else if (item == "(") {
-            res_str += " " + item.trim() + " ";
-          } else if (item == ")") {
-            res_str += " " + item.trim() + " ";
-          } else {
-            res_str += item.trim();
-          }
-        }
-      });
-      res_str = res_str.replace(/\s+/g, " ");
-      let org_sent = this.paraCon.sentences[sentIndex];
-      if (res_str.trim() != org_sent.trim()) {
-        this.$message.warning("跟原句不一致,请检查是否误删除或新增其他内容");
-        return;
-      }
+    //   let sent_arr = this.paraCon.seg_words[sentIndex].sent_str.split(/\s+/);
+    //   let res_str = "";
+    //   sent_arr.forEach((item) => {
+    //     if (item) {
+    //       let bool = this.checkEn(item);
+    //       if (bool) {
+    //         res_str += item.trim() + " ";
+    //       } else if (item == "(") {
+    //         res_str += " " + item.trim() + " ";
+    //       } else if (item == ")") {
+    //         res_str += " " + item.trim() + " ";
+    //       } else {
+    //         res_str += item.trim();
+    //       }
+    //     }
+    //   });
+    //   res_str = res_str.replace(/\s+/g, " ");
+    //   let org_sent = this.paraCon.sentences[sentIndex];
+    //   if (res_str.trim() != org_sent.trim()) {
+    //     this.$message.warning("跟原句不一致,请检查是否误删除或新增其他内容");
+    //     return;
+    //   }
       let textListList = [];
       let arr = this.paraCon.seg_words[sentIndex].sent_str.split(/\s+/);
       this.$set(this.paraCon.segList, sentIndex, arr);
@@ -383,7 +393,7 @@ export default {
   //生命周期 - 挂载完成(可以访问DOM元素)
   mounted() {
     console.log("segList");
-    console.log(this.segList);
+    console.log(this.paraCon);
     this.getParaSegWordsResult();
   },
   beforeCreate() {}, //生命周期 - 创建之前

+ 1 - 0
src/components/Adult/inputModules/DialogueTem/index.vue

@@ -146,6 +146,7 @@
           :curQue="curQue"
           :paraIndex="paraIndex"
           :segList="segList"
+          :type="type"
           v-if="isByWord"
         />
       </div>

+ 4 - 4
src/components/Adult/inputModules/SentenceSegwordChs/components/SegbywordChs.vue

@@ -184,10 +184,10 @@ export default {
       });
       res_str = res_str.replace(/\s+/g, " ");
       let org_sent = this.curQue.sentence;
-      if (res_str.trim() != org_sent.trim()) {
-        this.$message.warning("跟原句不一致,请检查是否误删除或新增其他内容");
-        return;
-      }
+    //   if (res_str.trim() != org_sent.trim()) {
+    //     this.$message.warning("跟原句不一致,请检查是否误删除或新增其他内容");
+    //     return;
+    //   }
       let textListList = [];
       let arr = this.curQue.seg_words.split(/\s+/);
       this.$set(this.curQue, "segList", arr);

+ 14 - 13
src/components/Adult/preview/DialogueArticleViewChs/AnswerModel.vue

@@ -99,7 +99,7 @@
                                   ? 'NNPE-chs-underline'
                                   : '',
                               ]"
-                              :style="{ fontSize: pItem.config.fontSize }"
+                              :style="hengStyle(pItem.config)"
                               >{{ pItem.chs }}</span
                             >
                           </template>
@@ -115,7 +115,7 @@
                                 class="answer-input userRight"
                                 v-model="curQue.answerArr[pItem.hengIndex - 1]"
                                 :canEdit="false"
-                                :style="hengStyle(pItem.config.fontSize)"
+                                :style="hengStyle(pItem.config)"
                               />
                             </template>
                             <template v-else>
@@ -151,7 +151,7 @@
                                 "
                                 :hengIndex="pItem.hengIndex - 1"
                                 @saveBlankTF="saveBlankTF"
-                                :style="hengStyle(pItem.config.fontSize)"
+                                :style="hengStyle(pItem.config)"
                               />
                             </template>
                           </template>
@@ -198,7 +198,7 @@
                                 ? 'wordActive'
                                 : '',
                             ]"
-                            :style="{ fontSize: pItem.config.fontSize }"
+                            :style="hengStyle(pItem.config)"
                             >{{ item.wordsList[pIndex + 1].chs }}</span
                           >
 
@@ -264,7 +264,7 @@
                                 ? 'wordActive'
                                 : '',
                             ]"
-                            :style="{ fontSize: pItem.config.fontSize }"
+                            :style="hengStyle(pItem.config)"
                             >{{ item.wordsList[pIndex + 2].chs }}</span
                           >
                           <span
@@ -319,7 +319,7 @@
                                 ? 'NNPE-chs-underline'
                                 : '',
                             ]"
-                            :style="{ fontSize: pItem.config.fontSize }"
+                            :style="hengStyle(pItem.config)"
                             >{{ pItem.chs }}</span
                           >
                         </template>
@@ -335,7 +335,7 @@
                               class="answer-input userRight"
                               v-model="curQue.answerArr[pItem.hengIndex - 1]"
                               :canEdit="false"
-                              :style="hengStyle(pItem.config.fontSize)"
+                              :style="hengStyle(pItem.config)"
                             />
                           </template>
                           <template v-else>
@@ -371,7 +371,7 @@
                               "
                               :hengIndex="pItem.hengIndex - 1"
                               @saveBlankTF="saveBlankTF"
-                              :style="hengStyle(pItem.config.fontSize)"
+                              :style="hengStyle(pItem.config)"
                             />
                           </template>
                         </template>
@@ -510,7 +510,7 @@
                         class="answer-input userRight"
                         v-model="curQue.answerArr[pItem.hengIndex - 1]"
                         :canEdit="false"
-                        :style="hengStyle(pItem.config.fontSize)"
+                        :style="hengStyle(pItem.config)"
                       />
                     </template>
                     <template v-else>
@@ -541,7 +541,7 @@
                         "
                         :hengIndex="pItem.hengIndex - 1"
                         @saveBlankTF="saveBlankTF"
-                        :style="hengStyle(pItem.config.fontSize)"
+                        :style="hengStyle(pItem.config)"
                       />
                     </template>
                   </template>
@@ -725,12 +725,13 @@ export default {
       };
     },
     hengStyle() {
-      return function (fontSize) {
-        let sizeVal = fontSize.replace("px", "");
+      return function (config) {
+        let sizeVal = config.fontSize.replace("px", "");
         return {
           minHeight: Number(sizeVal) + 9 + "px",
           lineHeight: Number(sizeVal) + 8 + "px",
-          fontSize: fontSize,
+          fontSize: config.fontSize,
+          fontFamily: config.fontFamily
         };
       };
     },