guanchunjie il y a 3 ans
Parent
commit
3c039d69e5

+ 58 - 99
src/components/Adult/common/SentenceModule.vue

@@ -22,39 +22,59 @@
     <div class="NPC-sentence-Segword">
       <SentenceSegwordChs :curQue="curQueItem.detail" />
     </div>
-    <div class="adult-book-input-item" v-if="type == 'sentence_input'">
-      <span class="adult-book-lable">答案:</span>
-      <div
-        class="NPC-sentence-input-box"
-        v-for="(ansItem, ansIndex) in curQueItem.answer"
-        :key="'answer' + ansIndex"
-      >
-        <el-input
-          class="adult-book-input"
-          type="textarea"
-          autosize
-          placeholder="请输入答案"
-          v-model="curQueItem.answer[ansIndex]"
-          @blur="onBlurIndex(ansIndex, 'answer')"
-        ></el-input>
-        <div class="adult-book-del-icon">
-          <i class="el-icon-circle-close"></i>
+    <div class="adult-book-input-item">
+      <span class="adult-book-lable">英文:</span>
+      <el-input
+        size="small"
+        class="adult-book-input"
+        placeholder="请输入句子翻译"
+        v-model="curQueItem.en"
+        @blur="onBlur(curQueItem, 'en')"
+      ></el-input>
+    </div>
+    <template v-if="type == 'sentence_input'">
+      <div class="adult-book-input-item">
+        <span class="adult-book-lable">答案:</span>
+        <div>
+          <div
+            class="NPC-sentence-input-box"
+            v-for="(ansItem, ansIndex) in curQueItem.answer"
+            :key="'answer' + ansIndex"
+          >
+            <el-input
+              class="adult-book-input"
+              type="textarea"
+              autosize
+              placeholder="请输入答案"
+              v-model="curQueItem.answer[ansIndex]"
+              @blur="onBlurIndex(ansIndex, 'answer')"
+            ></el-input>
+            <div class="adult-book-del-icon" @click="delAnswer(ansIndex)">
+              <i class="el-icon-circle-close"></i>
+            </div>
+          </div>
         </div>
       </div>
-    </div>
-    <div class="adult-book-input-item" style="padding-left: 80px">
-      <el-button size="mini" type="primary" icon="el-icon-plus"
-        >添加答案</el-button
-      >
-    </div>
+      <div class="adult-book-input-item" style="padding-left: 80px">
+        <el-button
+          size="mini"
+          type="primary"
+          icon="el-icon-plus"
+          @click="addAnswer"
+          >添加答案</el-button
+        >
+      </div>
+    </template>
     <div class="adult-book-input-item" v-if="type == 'sentence_judge'">
       <span class="adult-book-lable">判断:</span>
-      <el-radio v-model="curQueItem.judge" :label="true">正确</el-radio>
-      <el-radio v-model="curQueItem.judge" :label="false">错误</el-radio>
+      <el-radio-group v-model="curQueItem.judge">
+        <el-radio :lable="true" :label="true">正确</el-radio>
+        <el-radio :lable="false" :label="false">错误</el-radio>
+      </el-radio-group>
     </div>
     <div class="adult-book-input-item" v-if="type == 'sentence_record'">
       <span class="adult-book-lable">录音组件:</span>
-      <img src="../../../assets/adult/mini.png" alt="" />
+      <img src="../../../assets/adult/mini.png" class="adult-record-min" />
     </div>
     <div class="adult-book-input-item" v-if="type == 'recordHZ_inputPY_chs'">
       <span>录音</span>
@@ -67,8 +87,8 @@
     >
       <img src="../../../assets/adult/pro-plus.png" alt="" />
     </div>
-    <div class="adult-book-input-item" v-if="type == 'inputItem_chs'">
-      <span class="adult-book-lable">音频</span>
+    <div class="adult-book-input-item">
+      <span class="adult-book-lable">音频</span>
       <Upload
         :changeFillId="changeMp3"
         :datafileList="fileCon.mp3_list"
@@ -107,16 +127,7 @@ export default {
     };
   },
   computed: {},
-  watch: {
-    // checkList: {
-    //   handler: function (val, oldVal) {
-    //     const _this = this;
-    //     _this.checkListRes = val;
-    //   },
-    //   // 深度观察监听
-    //   deep: true,
-    // },
-  },
+  watch: {},
   //方法集合
   methods: {
     onBlur(item, field) {
@@ -144,22 +155,6 @@ export default {
     changeIsAnswer(type) {
       this.changAnswer(this.index, type);
     },
-    // 点击生成拼音
-    getPinyin(item) {
-      let bool = false;
-      let value = "";
-      if (item.hanzi == "") {
-        this.$message.warning("请先输入内容,再生成拼音");
-        bool = true;
-      } else {
-        value = item.hanzi;
-      }
-      if (bool) {
-        return;
-      }
-      let result = pinyinUtil.getPinyin(value);
-      item.pinyin = result;
-    },
     changeMp3(fileList) {
       const articleImgList = JSON.parse(JSON.stringify(fileList));
       const articleImgRes = [];
@@ -176,35 +171,18 @@ export default {
       });
       this.curQueItem.mp3_list = JSON.parse(JSON.stringify(articleImgRes));
     },
-    changeImage(fileList) {
-      console.log(fileList);
-      const articleImgList = JSON.parse(JSON.stringify(fileList));
-      const articleImgRes = [];
-      articleImgList.forEach((item) => {
-        if (item.response) {
-          const obj = {
-            name: item.name,
-            url: item.response.file_info_list[0].file_url,
-            id: "[FID##" + item.response.file_info_list[0].file_id + "#FID]",
-          };
-          articleImgRes.push(obj);
-        }
-      });
-      //this.articleImgList = articleImgRes;
-      this.curQueItem.img_list = JSON.parse(JSON.stringify(articleImgRes));
-    },
-    //添加释义
-    addDef() {
-      let leg = this.curQueItem.definition_list.length;
-      let last = this.curQueItem.definition_list[leg - 1];
+    //添加答案
+    addAnswer() {
+      let leg = this.curQueItem.answer.length;
+      let last = this.curQueItem.answer[leg - 1];
       if (!last) {
-        this.$message.warning("请填写");
+        this.$message.warning("请先填写完整");
         return;
       }
-      this.curQueItem.definition_list.push("");
+      this.curQueItem.answer.push("");
     },
-    delDef(defIndex) {
-      this.curQueItem.definition_list.splice(defIndex, 1);
+    delAnswer(ansIndex) {
+      this.curQueItem.answer.splice(ansIndex, 1);
     },
   },
   //生命周期 - 创建完成(可以访问当前this实例)
@@ -254,26 +232,6 @@ export default {
       }
     }
   }
-
-  &-SentenceModule {
-    // display: flex;
-    // justify-content: flex-start;
-    // align-items: center;
-    > .adult-book-input-item {
-      display: flex;
-      justify-content: flex-start;
-      align-items: center;
-      margin-right: 10px;
-      > span {
-        line-height: 32px;
-        font-size: 14px;
-      }
-    }
-    .NPC-sentence-Segword {
-      margin-top: 16px;
-    }
-  }
-
   &-mp3 {
     margin-top: 6px;
     span {
@@ -290,6 +248,7 @@ export default {
   display: flex;
   justify-content: flex-start;
   align-items: flex-start;
+  margin-bottom: 10px;
 }
 </style>
 <style lang="scss">

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

@@ -3,20 +3,20 @@
   <div class="Big-Book-Maxwidth NPC-Clauseresult">
     <div class="adult-book-input-item">
       <span class="adult-book-lable">分词结果:</span>
-    </div>
-    <div class="NPC-para-list">
-      <div class="NPC-sentence-list">
-        <el-input
-          class="adult-book-input"
-          type="textarea"
-          :autosize="{ minRows: 2 }"
-          placeholder="请输入内容"
-          v-model="curQue.seg_words"
-          :readonly="true"
-        ></el-input>
-        <el-button type="danger" size="small" @click="proofSegWords"
-          >校对</el-button
-        >
+      <div class="NPC-para-list">
+        <div class="NPC-sentence-list">
+          <el-input
+            class="adult-book-input"
+            type="textarea"
+            :autosize="{ minRows: 2 }"
+            placeholder="请输入内容"
+            v-model="curQue.seg_words"
+            :readonly="true"
+          ></el-input>
+          <el-button type="danger" size="small" @click="proofSegWords"
+            >校对</el-button
+          >
+        </div>
       </div>
     </div>
 

+ 0 - 9
src/components/Adult/common/SentenceSegwordChs/index.vue

@@ -42,15 +42,6 @@ export default {
       cTVisible: false,
       loading: false,
       segList: null,
-      data_structure: {
-        type: "sentence_segword_chs",
-        name: "句子分词",
-        pyPosition: "top", //top 拼音在上面;bottom 拼音在下面
-        sentence: "", //句子
-        segList: [], //分词结果
-        seg_words: "",
-        wordsList: [],
-      },
     };
   },
   computed: {},

+ 1 - 1
src/components/Adult/common/data.js

@@ -607,7 +607,7 @@ let fnData = [{
       name: "句子判断",
     },
     {
-      type: "sentence_Record",
+      type: "sentence_record",
       name: "句子录音",
     },
   ],

+ 1 - 1
src/components/Adult/inputModules/Sentence.vue

@@ -101,6 +101,7 @@ export default {
               seg_words: "",
               wordsList: [],
             },
+            en: "", //英文
             answer: [""],
             judge: true,
           },
@@ -180,7 +181,6 @@ export default {
     },
     //处理数据
     handleStructure(type) {
-      debugger;
       let data = JSON.parse(JSON.stringify(this.data_structure_sentence));
       data.fn_list.map((item) => {
         if (item.type == type) {

+ 6 - 0
src/styles/index.scss

@@ -239,6 +239,12 @@ input:-ms-input-placeholder {
     padding:8px;
     cursor: pointer;
   }
+  .adult-record{
+    &-min{
+     width:64px;
+     height:40px;
+  }
+}
 }
 
 .adult-book-preview-sty{