guanchunjie 3 rokov pred
rodič
commit
82b4adae45

+ 12 - 9
src/components/Adult/Preview.vue

@@ -6,11 +6,6 @@
     v-if="cur"
   >
     <div
-      v-if="
-        cur.detailList &&
-          cur.detailList.length > 0 &&
-          cur.detailList[0].sentence
-      "
       class="NNPE-title"
     >
       <!-- 页眉 -->
@@ -48,11 +43,11 @@
                 >
                   <div class="synthesis-box">
                     <div>
-                      <span class="pinyin">{{ itemCon.pinyin }}</span>
+                      <span class="pinyin" :class="[noFont.indexOf(itemCon.pinyin)>-1?'noFont':'']">{{ itemCon.pinyin }}</span>
                       <span class="hanzi content-con">{{ itemCon.chs }}</span>
                     </div>
                     <div style="text-align: left">
-                      <span class="pinyin">{{
+                      <span class="pinyin" :class="[noFont.indexOf(items.detail.wordsList[indexCon + 1].pinyin)>-1?'noFont':'']">{{
                         item.wordsList[indexCon + 1].pinyin
                       }}</span>
                       <span class="hanzi content-con">{{
@@ -62,7 +57,7 @@
                   </div>
                 </template>
                 <template v-else>
-                  <span class="pinyin">{{ itemCon.pinyin }}</span>
+                  <span class="pinyin" :class="[noFont.indexOf(itemCon.pinyin)>-1?'noFont':'']">{{ itemCon.pinyin }}</span>
                   <span class="hanzi content-con">{{ itemCon.chs }}</span>
                 </template>
               </div>
@@ -70,7 +65,7 @@
           </template>
         </div>
       </div>
-      <div class="NNPE-operate">
+      <div class="NNPE-operate" v-if="isShowTitle">
         <a class="btn-prev" @click="handleNNPEprev" />
         <a class="btn-next" @click="handleNNPEnext" />
       </div>
@@ -333,6 +328,7 @@ export default {
     "FatherTreeData",
     "changeId",
     "themeColor",
+    "isShowTitle"
   ],
   data() {
     return {
@@ -369,6 +365,7 @@ export default {
         },
       ],
       chsFhList: [",", "。", "“", ":", "》", "《", "?", "!", ";"],
+      noFont: ['~','!','@','#','$','%','^','&','*','(',')'], // 对应不要拼音字体
       idArr: [], //当前的pid
     };
   },
@@ -485,6 +482,8 @@ export default {
               });
             } else {
               _this.changeId(this.idArr[i - 1]);
+              _this.$forceUpdate()
+
             }
           }
         });
@@ -526,6 +525,7 @@ export default {
               });
             } else {
               _this.changeId(this.idArr[i + 1]);
+              _this.$forceUpdate()
             }
           }
         });
@@ -597,6 +597,9 @@ export default {
           font-size: 14px;
           line-height: 22px;
           height: 22px;
+          &.noFont{
+            font-family: initial;
+          }
         }
         .synthesis-box {
           display: flex;

+ 21 - 5
src/components/Adult/common/HzModule.vue

@@ -134,10 +134,26 @@
     </div>
     <div class="adult-book-input-item" v-if="curQueItem.RecordControl">
       <span class="adult-book-lable">控件展示:</span>
-      <img v-if="curQueItem.RecordControl=='mini'" src="../../../assets/adult/mini.png" alt="">
-      <img v-else-if="curQueItem.RecordControl=='normal'" src="../../../assets/adult/normal.png" alt="">
-      <img v-else-if="curQueItem.RecordControl=='pro'" src="../../../assets/adult/pro.png" alt="">
-      <img v-else-if="curQueItem.RecordControl=='pro-max'" src="../../../assets/adult/pro-max.png" alt="">
+      <img
+        v-if="curQueItem.RecordControl == 'mini'"
+        src="../../../assets/adult/mini.png"
+        alt=""
+      />
+      <img
+        v-else-if="curQueItem.RecordControl == 'normal'"
+        src="../../../assets/adult/normal.png"
+        alt=""
+      />
+      <img
+        v-else-if="curQueItem.RecordControl == 'pro'"
+        src="../../../assets/adult/pro.png"
+        alt=""
+      />
+      <img
+        v-else-if="curQueItem.RecordControl == 'pro-max'"
+        src="../../../assets/adult/pro-max.png"
+        alt=""
+      />
     </div>
     <div class="adult-book-input-item">
       <span class="adult-book-lable">音频:</span>
@@ -257,7 +273,7 @@ export default {
           const obj = {
             name: item.name,
             url: item.response.file_info_list[0].file_url,
-            id: item.response.file_info_list[0].file_id,
+            id: "[FID##" + item.response.file_info_list[0].file_id + "##FID]",
           };
           articleImgRes.push(obj);
         }

+ 4 - 0
src/components/Adult/common/data.js

@@ -719,6 +719,10 @@ let fnData = [{
         type: "video_chs",
         name: "视频控件"
     },
+    {
+        type: "table_chs",
+        name: "表格",
+    },
 ]
 
 

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

@@ -5,7 +5,7 @@
     v-if="curQue"
     v-loading="loading"
   >
-    <div class="Big-Book-img" v-if="type!='adultinput'">
+    <div class="Big-Book-img" v-if="type != 'adultinput'">
       <UploadArt
         :change-fill-id="changeImage"
         :datafile-list="fileCon.img_list"
@@ -41,7 +41,7 @@
         </li>
       </ul>
     </div>
-    <div class="Big-Book-mp3" v-if="type!='adultinput'">
+    <div class="Big-Book-mp3" v-if="type != 'adultinput'">
       <Upload
         type="mp3"
         :changeFillId="changeMp3"
@@ -84,7 +84,7 @@ export default {
     Clauseresult,
     Segbyword,
   },
-  props: ["curQue", "changeCurQue", "tmIndex","type"],
+  props: ["curQue", "changeCurQue", "tmIndex", "type"],
   data() {
     return {
       imageNumber: 1000,
@@ -121,7 +121,7 @@ export default {
             name: item.name,
             duration: item.response.file_info_list[0].media_duration,
             url: item.response.file_info_list[0].file_url,
-            id: item.response.file_info_list[0].file_id,
+            id: "[FID##" + item.response.file_info_list[0].file_id + "##FID]",
           };
           articleImgRes.push(obj);
         }

+ 645 - 0
src/components/Adult/inputModules/Table.vue

@@ -0,0 +1,645 @@
+<!--  -->
+<template>
+  <div class="Big-Book-table" v-if="curQue">
+    <div class="Big-Book-Single-content">
+      <div class="adult-book-input-item">
+        <span class="adult-book-lable">标题:</span>   
+        <el-input
+          type="textarea"
+          class="adult-book-input"
+          :autosize="{ minRows: 2 }"
+          placeholder="请输入标题"
+          v-model="curQue.title"
+          @blur="curQue.title = curQue.title.trim()"
+        ></el-input>
+      </div>
+      <div
+        class="Big-Book-main"
+        style="border-bottom: 1px #ccc solid; margin-bottom: 20px"
+      >
+        <div class="adult-book-input-item">
+          <span class="adult-book-lable">表头:</span>
+          <el-radio-group v-model="curQue.isHeader" @change="changeHeader"
+            >     
+            <el-radio :label="true">有</el-radio>
+            <el-radio :label="false">无</el-radio>
+          </el-radio-group>
+        </div>
+        <template v-if="curQue.isHeader">
+          <div
+            class="adult-book-input-item"
+            v-for="(item, i) in curQue.headerList"
+            :key="i"
+          >
+            <span class="adult-book-lable">表头{{ i + 1 }}:</span>           
+             <el-input
+              type="textarea"
+              placeholder="请输入内容"
+              v-model="item.con"
+              class="adult-book-input"
+              :autosize="{ minRows: 2 }"
+              @blur="item.con = item.con.trim()"
+            ></el-input>
+            <img
+              @click="deleteHeader(i)"
+              class="close"
+              src="../../../assets/adult/del-close.png"
+              alt=""
+            />
+          </div>
+          <div class="addoption" @click="addHeader">添加表头</div>
+        </template>
+        <table style="table-layout: fixed">
+          <tr v-if="curQue.headerList.length > 0 && curQue.isHeader">
+            <th
+              :class="'th' + heai"
+              v-for="(item, heai) in curQue.headerList"
+              :key="heai + 'header'"
+            >
+              {{ item.con }}
+            </th>
+          </tr>
+          <tr v-for="(item, rowi) in curQue.option" :key="rowi + 'row'">
+            <td
+              :class="'td' + coli"
+              v-for="(it, coli) in item"
+              :key="coli + 'col'"
+            >
+              <el-button
+                v-if="!it.ByMerge"
+                size="small"
+                @click="editTd(rowi, coli)"
+                >编辑</el-button
+              >
+              <!-- <el-button
+                size="small"
+                type="primary"
+                @click="removeTd(rowi, coli)"
+                >删除</el-button
+              > -->
+              <!-- <template v-if="coli == item.length - 1"> 删除列 </template> -->
+              <div>
+                <el-button
+                  style="position: absolute; top: 50px; left: 15px"
+                  size="mini"
+                  v-if="rowi == curQue.option.length - 1"
+                  @click="removeCol(coli)"
+                  >删除列</el-button
+                >
+              </div>
+            </td>
+            <el-button size="small" @click="removeRow(rowi)">删除行</el-button>
+          </tr>
+        </table>
+        <div class="add">
+          <div class="addoption" @click="addRow">增加行</div>
+          <div class="addoption" v-if="!curQue.isHeader" @click="addCol">
+            增加列
+          </div>
+        </div>
+        <div class="adult-book-input-item">
+          <span class="adult-book-lable">提示标题:</span>           
+          <el-input
+            type="textarea"
+            class="adult-book-input"
+            :autosize="{ minRows: 2 }"
+            placeholder="请输入提示标题"
+            v-model="curQue.hintTitle"
+            @blur="curQue.hintTitle = curQue.hintTitle.trim()"
+          ></el-input>
+        </div>
+        <div
+          v-for="(item, htindex) in curQue.hintOtion"
+          :key="'hint' + htindex"
+        >
+          <div class="adult-book-input-item">
+            <span class="adult-book-lable">提示选项:</span>           
+            <el-input
+              type="textarea"
+              class="adult-book-input"
+              :autosize="{ minRows: 2 }"
+              placeholder="请输入提示内容"
+              v-model="item.con"
+              @blur="item.con = item.con.trim()"
+            ></el-input>
+            <img
+              @click="deleteHint(htindex)"
+              class="close"
+              src="../../../assets/adult/del-close.png"
+              alt=""
+            />
+          </div>
+          <div class="adult-book-input-item">
+            <span class="adult-book-lable">选项拼音:</span>           
+            <el-input
+              type="textarea"
+              class="adult-book-input"
+              :autosize="{ minRows: 2 }"
+              placeholder="请输入选项拼音"
+              v-model="item.pinyin"
+              @blur="item.pinyin = item.pinyin.trim()"
+            ></el-input>
+            <el-button @click="getPinyin(item)">生成拼音</el-button>
+          </div>
+        </div>
+
+        <div class="addoption" @click="addHint">添加选项</div>
+      </div>
+    </div>
+    <el-dialog
+      title="编辑内容"
+      :visible.sync="dialogVisible"
+      width="30%"
+      :before-close="handleClose"
+      destroy-on-close
+    >
+      <template v-if="data">
+        <div class="adult-book-input-item">
+          <span class="adult-book-lable">内容:</span>
+          <el-input
+            type="textarea"
+            class="adult-book-input"
+            :autosize="{ minRows: 2 }"
+            placeholder="请输入内容"
+            v-model="data.con"
+            @blur="data.con = data.con.trim()"
+          ></el-input>
+        </div>
+        <!-- <div
+          class="Big-Book-con"
+          v-for="(item, i) in data.answerList"
+          :key="i + 'answer'"
+        >
+          <span>答案:</span>           
+          <el-input
+            style="width: 300px"
+            type="textarea"
+            autosize
+            placeholder="请输入答案"
+            v-model="item.answer"
+            @blur="item.answer = item.answer.trim()"
+          ></el-input>
+          <img
+            @click="deleteAnswer(data, i)"
+            class="close"
+            src="../../../assets/adult/del-close.png"
+            alt=""
+          />
+        </div>
+        <div class="addoption" @click="addAnswer(data)">增加答案</div>
+        <div class="Big-Book-con">
+          <span>合并单元格:</span>      
+          <el-radio-group
+            v-model="data.MergeDirection"
+            @change="changeMergeDirection"
+            >     
+            <el-radio label="bottom">向下合并</el-radio>
+            <el-radio label="right">向右合并</el-radio>
+            <el-radio label="false">不合并</el-radio>
+          </el-radio-group>
+        </div>
+        <div class="Big-Book-con">
+          <span>是否需要录音:</span>           
+          <el-radio v-model="data.isRecord" :label="true">是</el-radio>
+          <el-radio v-model="data.isRecord" :label="false">否</el-radio>
+        </div>
+        <div
+          class="Big-Book-con"
+          v-if="mergeList.length > 0 && data.MergeDirection != 'false'"
+        >
+          <span>合并数量:</span>
+          <el-select
+            placeholder="请选择"
+            v-model="data.mergeNumber"
+            @change="changemMergeNumber"
+          >
+            <el-option
+              v-for="item in mergeList"
+              :key="item + 'a'"
+              :value="item"
+            >
+            </el-option>
+          </el-select>
+        </div>
+        <div class="Big-Book-mp3" v-if="data">
+          <span>音频:</span>
+          <Upload
+            :changeFillId="changeMp3"
+            :datafileList="data.mp3_list"
+            :filleNumber="mp3Number"
+            :uploadType="'mp3'"
+          />
+        </div> -->
+      </template>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="handleClose">取 消</el-button>
+        <el-button type="primary" @click="save">保 存</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import Upload from "../common/Upload.vue";
+export default {
+  name: "table",
+  props: ["curQue", "fn_data", "changeCurQue"],
+  components: { Upload },
+  data() {
+    return {
+      form: {
+        stem: {
+          con: "",
+          pinyin: "",
+          english: "",
+          highlight: "",
+          underline: "",
+          img_url: [],
+          mp3_url: [],
+        },
+      },
+      dialogVisible: false,
+      data: null,
+      rowIndex: null,
+      colIndex: null,
+      mp3Number: 1,
+      mergeList: [],
+      currentOption: null,
+      data_structure: {
+        type: "table",
+        name: "表格",
+        title: "",
+        isHeader: false,
+        headerList: [
+          {
+            con: "",
+          },
+        ],
+        option: [
+          [
+            {
+              img_list: [],
+              mp3_list: [],
+              answerList: [
+                {
+                  answer: "",
+                },
+              ],
+              con: "",
+              MergeDirection: "false", //合并方向
+              isRecord: false,
+              ByMerge: false, //是否被合并
+            },
+          ],
+        ],
+        img_list: [],
+        hintTitle: "",
+        hintOtion: [
+          {
+            con: "",
+            pinyin: "",
+          },
+        ],
+      },
+    };
+  },
+  computed: {},
+  watch: {},
+  //方法集合
+  methods: {
+    // 点击生成拼音
+    getPinyin(item) {
+      let bool = false;
+      let value = "";
+      if (item.con == "") {
+        this.$message.warning("请先输入内容,再生成拼音");
+        bool = true;
+      } else {
+        value = item.con;
+      }
+      if (bool) {
+        return;
+      }
+      let result = pinyinUtil.getPinyin(value);
+      item.pinyin = result;
+      this.$forceUpdate();
+    },
+    // 删除提示选项
+    deleteHint(index) {
+      if (this.curQue.hintOtion.length <= 1) {
+        this.$message.warning("至少要保留一个选项");
+        return;
+      }
+      this.curQue.hintOtion.splice(index, 1);
+    },
+    // 增加提示选项
+    addHint() {
+      let obj = JSON.parse(JSON.stringify(this.data_structure.hintOtion[0]));
+      this.curQue.hintOtion.push(obj);
+    },
+    // 修改表头时清空option否则引发bug
+    changeHeader(val) {
+      let obj = JSON.parse(JSON.stringify(this.data_structure.option));
+      this.curQue.option = obj;
+    },
+    // 选择合并方向或者不合并
+    changeMergeDirection(val) {
+      if (val == "bottom") {
+        let num = this.currentOption.length - 1 - this.rowIndex;
+        for (let i = 1; i <= num; i++) {
+          this.mergeList.push(i);
+        }
+      }
+      if (val == "false") {
+        let currentTd = this.curQue.option[this.rowIndex][this.colIndex];
+        if (currentTd.MergeDirection == "bottom") {
+          this.currentOption.forEach((item, row) => {
+            item.forEach((it, col) => {
+              if (
+                col == this.colIndex &&
+                row > this.rowIndex &&
+                row <= this.rowIndex + currentTd.mergeNumber
+              ) {
+                it.ByMerge = false;
+              }
+            });
+          });
+        }
+      }
+    },
+    // 选择合并数量
+    changemMergeNumber(val) {
+      this.currentOption.forEach((item, row) => {
+        item.forEach((it, col) => {
+          if (
+            col == this.colIndex &&
+            row > this.rowIndex &&
+            row <= this.rowIndex + val
+          ) {
+            it.ByMerge = true;
+          }
+        });
+      });
+    },
+    //   上传音频
+    changeMp3(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]",
+            media_duration: item.response.file_info_list[0].media_duration, //音频时长
+          };
+          articleImgRes.push(obj);
+        }
+      });
+      this.data.mp3_list = JSON.parse(JSON.stringify(articleImgRes));
+    },
+    //   删除答案
+    deleteAnswer(data, index) {
+      if (data.answerList.length <= 1) {
+        this.$message.warning("至少要保留1个答案");
+        return;
+      }
+      data.answerList.splice(index, 1);
+    },
+    // 增加答案
+    addAnswer(data) {
+      let type = this.curQue.type;
+      let cur_fn_data_arr = this.fn_data.filter((item) => item.type == type);
+      let cur_fn_data = JSON.parse(JSON.stringify(cur_fn_data_arr[0]));
+      let obj = cur_fn_data.data_structure.option[0][0].answerList[0];
+      data.answerList.push(obj);
+    },
+    //   删除行
+    removeRow(index) {
+      if (this.curQue.option.length <= 1) {
+        this.$message.warning("至少要保留一行");
+        return;
+      }
+      this.curQue.option.forEach((item, i) => {
+        if (i == index) {
+          this.curQue.option.splice(i, 1);
+        }
+      });
+    },
+    // 删除列
+    removeCol(index) {
+      if (this.curQue.option[0].length <= 1) {
+        this.$message.warning("至少要保留一格");
+        return;
+      }
+      this.curQue.option.forEach((item) => {
+        item.forEach((it, i) => {
+          if (i == index) {
+            item.splice(i, 1);
+          }
+        });
+      });
+      this.curQue.headerList.forEach((item, i) => {
+        if (i == index) {
+          this.curQue.headerList.splice(i, 1);
+        }
+      });
+    },
+    //   删除td
+    removeTd(rowi, coli) {
+      console.log(rowi, coli);
+    },
+    // 编辑td
+    editTd(rowi, coli) {
+      this.rowIndex = rowi;
+      this.colIndex = coli;
+      this.data = JSON.parse(JSON.stringify(this.curQue.option[rowi][coli]));
+      this.dialogVisible = true;
+      this.currentOption = null;
+      this.currentOption = JSON.parse(JSON.stringify(this.curQue.option));
+      if (this.data.MergeDirection == "false") {
+        this.mergeList = [];
+      }
+    },
+    // 保存
+    save() {
+      this.curQue.option = JSON.parse(JSON.stringify(this.currentOption));
+      this.curQue.option[this.rowIndex][this.colIndex] = JSON.parse(
+        JSON.stringify(this.data)
+      );
+      this.dialogVisible = false;
+    },
+    //   增加行
+    addRow() {
+      let obj = JSON.parse(JSON.stringify(this.data_structure.option[0][0]));
+      let arr = [];
+      for (let i = 0; i < this.curQue.option[0].length; i++) {
+        arr.push(obj);
+      }
+      this.curQue.option.push(arr);
+    },
+    //   增加列
+    addCol() {
+      let obj = JSON.parse(JSON.stringify(this.data_structure.option[0][0]));
+      this.curQue.option.forEach((item, i) => {
+        item.push(obj);
+      });
+    },
+    // 删除其中一个选项
+    deleteHeader(index) {
+      if (this.curQue.headerList.length <= 1) {
+        this.$message.warning("至少要保留一个表头");
+        return;
+      }
+      this.curQue.headerList.splice(index, 1);
+      this.curQue.option.forEach((item) => {
+        item.splice(index, 1);
+      });
+    },
+    //添加一个表头
+    addHeader() {
+      let optionobj = JSON.parse(
+        JSON.stringify(this.data_structure.headerList[0])
+      );
+      this.curQue.headerList.push(optionobj);
+      let obj = JSON.parse(JSON.stringify(this.data_structure.option[0][0]));
+      this.curQue.option.forEach((item) => {
+        item.push(obj);
+      });
+    },
+    // 关闭弹窗并清空数据
+    handleClose() {
+      this.dialogVisible = false;
+      this.data = null;
+    },
+  },
+  //生命周期 - 创建完成(可以访问当前this实例)
+  created() {
+    if (!this.curQue) {
+      this.changeCurQue(this.data_structure);
+    }
+  },
+  //生命周期 - 挂载完成(可以访问DOM元素)
+  mounted() {},
+  beforeCreate() {}, //生命周期 - 创建之前
+  beforeMount() {}, //生命周期 - 挂载之前
+  beforeUpdate() {}, //生命周期 - 更新之前
+  updated() {}, //生命周期 - 更新之后
+  beforeDestroy() {}, //生命周期 - 销毁之前
+  destroyed() {}, //生命周期 - 销毁完成
+  activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
+};
+</script>
+<style lang='scss' scope>
+//@import url(); 引入公共css类
+.Big-Book-table {
+  &-content {
+    &.m {
+      display: flex;
+      justify-content: flex-start;
+      align-items: flex-start;
+    }
+
+    .Big-Book-title {
+      font-size: 16px;
+      line-height: 40px;
+      color: #000;
+      margin-right: 15px;
+    }
+  }
+  .Big-Book-main {
+    > div {
+      margin-bottom: 10px;
+      &.Big-Book-pinyin {
+        display: flex;
+        justify-content: flex-start;
+        align-items: center;
+      }
+    }
+  }
+  .addoption {
+    width: 150px;
+    height: 40px;
+    left: 40px;
+    top: 304px;
+    background: #f3f3f3;
+    border: 1px dashed rgba(0, 0, 0, 0.15);
+    box-sizing: border-box;
+    border-radius: 4px;
+    text-align: center;
+    line-height: 40px;
+    cursor: pointer;
+    margin-right: 20px;
+  }
+  .Big-Book-divide {
+    > div {
+      width: 100%;
+    }
+    .answerList {
+      > div {
+        margin-top: 16px;
+        display: flex;
+        align-items: center;
+        > :nth-child(1) {
+          display: inline-block;
+          width: 100px;
+          margin-right: 10px;
+          word-break: break-all;
+        }
+
+        .checkbox-group {
+          > span {
+            display: inline-block;
+            margin-left: 29px;
+          }
+        }
+      }
+    }
+  }
+  .Big-Book-con {
+    display: flex;
+    align-items: center;
+    margin: 15px 0;
+    img {
+      width: 24px;
+      height: 24px;
+      cursor: pointer;
+    }
+  }
+  .Big-Book-mp3 {
+    display: flex;
+  }
+  .add {
+    display: flex;
+    margin-top: 50px;
+  }
+  table {
+    tr {
+      th {
+        min-width: 100px;
+        max-width: 100px;
+        min-height: 40px;
+        max-height: 40px;
+        border: 1px solid black;
+        text-align: center;
+        padding: 5px;
+        word-break: break-all;
+        overflow: hidden;
+        text-overflow: ellipsis;
+      }
+      td {
+        min-width: 100px;
+        max-width: 100px;
+        height: 42px;
+        border: 1px solid black;
+        text-align: center;
+        padding: 5px;
+        word-break: break-all;
+        position: relative;
+      }
+      display: flex;
+      align-items: center;
+    }
+  }
+}
+</style>

+ 7 - 3
src/components/Adult/preview/CourseStart.vue

@@ -11,18 +11,18 @@
                         <template v-if="curQue.detail.wordsList[indexCon + 1] && curQue.detail.wordsList[indexCon + 1].chs && chsFhList.indexOf(curQue.detail.wordsList[indexCon + 1].chs) > -1">
                             <div class="synthesis-box">
                                 <div>
-                                    <span class="pinyin">{{itemCon.pinyin}}</span>
+                                    <span class="pinyin" :class="[noFont.indexOf(itemCon.pinyin)>-1?'noFont':'']">{{itemCon.pinyin}}</span>
                                     <span class="hanzi content-con">{{itemCon.chs}}</span>
                                 </div>
                                 <div style="text-align: left">
-                                    <span class="pinyin">{{curQue.detail.wordsList[indexCon + 1].pinyin}}</span>
+                                    <span class="pinyin" :class="[noFont.indexOf(items.detail.wordsList[indexCon + 1].pinyin)>-1?'noFont':'']">{{curQue.detail.wordsList[indexCon + 1].pinyin}}</span>
                                     <span class="hanzi content-con">{{curQue.detail.wordsList[indexCon + 1].chs}}</span>
                                 </div>
                             </div>
                             
                         </template>
                         <template v-else>
-                            <span class="pinyin">{{itemCon.pinyin}}</span>
+                            <span class="pinyin" :class="[noFont.indexOf(itemCon.pinyin)>-1?'noFont':'']">{{itemCon.pinyin}}</span>
                             <span class="hanzi content-con">{{itemCon.chs}}</span>
                         </template>
                     </div>
@@ -49,6 +49,7 @@ export default {
     //这里存放数据
     return {
       chsFhList: [",", "。", "“", ":", "》", "《", "?", "!", ";"],
+      noFont: ['~','!','@','#','$','%','^','&','*','(',')'], // 对应不要拼音字体
     };
   },
   //计算属性 类似于data概念
@@ -149,6 +150,9 @@ export default {
             font-size: 24px;
             line-height: 32px;
             height: 32px;
+            &.noFont{
+                font-family: initial;
+            }
         }
         .synthesis-box{
             display: flex;

+ 4 - 4
src/components/Adult/preview/InputHasRecord.vue

@@ -44,7 +44,7 @@
                                                 <template v-if="items.detail.wordsList[indexCon + 1] && items.detail.wordsList[indexCon + 1].chs && chsFhList.indexOf(items.detail.wordsList[indexCon + 1].chs) > -1">
                                                     <div class="synthesis-box">
                                                         <div>
-                                                            <span class="pinyin">{{itemCon.pinyin}}</span>
+                                                            <span class="pinyin" :class="[noFont.indexOf(itemCon.pinyin)>-1?'noFont':'']">{{itemCon.pinyin}}</span>
                                                             <span class="hanzi content-con">{{itemCon.chs}}</span>
                                                         </div>
                                                         <div style="text-align: left">
@@ -55,7 +55,7 @@
                                                     
                                                 </template>
                                                 <template v-else>
-                                                    <span class="pinyin">{{itemCon.pinyin}}</span>
+                                                    <span class="pinyin" :class="[noFont.indexOf(itemCon.pinyin)>-1?'noFont':'']">{{itemCon.pinyin}}</span>
                                                     <span class="hanzi content-con">{{itemCon.chs}}</span>
                                                 </template>
                                             </div>
@@ -87,7 +87,7 @@
                                     <template v-if="items.detail.wordsList[indexCon + 1] && items.detail.wordsList[indexCon + 1].chs && chsFhList.indexOf(items.detail.wordsList[indexCon + 1].chs) > -1">
                                         <div class="synthesis-box">
                                             <div>
-                                                <span class="pinyin">{{itemCon.pinyin}}</span>
+                                                <span class="pinyin" :class="[noFont.indexOf(itemCon.pinyin)>-1?'noFont':'']">{{itemCon.pinyin}}</span>
                                                 <span class="hanzi content-con">{{itemCon.chs}}</span>
                                             </div>
                                             <div style="text-align: left">
@@ -98,7 +98,7 @@
                                         
                                     </template>
                                     <template v-else>
-                                        <span class="pinyin">{{itemCon.pinyin}}</span>
+                                        <span class="pinyin" :class="[noFont.indexOf(itemCon.pinyin)>-1?'noFont':'']">{{itemCon.pinyin}}</span>
                                         <span class="hanzi content-con">{{itemCon.chs}}</span>
                                     </template>
                                 </div>

+ 19 - 23
src/components/Adult/preview/Ligature.vue

@@ -4,11 +4,7 @@
       <div class="left">
         <ul>
           <div>{{ curQue.conTitle }}</div>
-          <li
-            :class="'left' + index"
-            v-for="(item, index) in curQue.con"
-            :key="'left' + index"
-          >
+          <li v-for="(item, index) in curQue.con" :key="'left' + index">
             <!--             :style="{
               background:
                 JSON.stringify(data).indexOf(item.nodeId) != -1
@@ -21,7 +17,7 @@
                 :src="item.img_list[0].url"
                 alt=""
               />
-              <div class="text">
+              <div class="text" :class="'left' + index">
                 <!-- 大于0就说明分词了 -->
                 <template v-if="item.detail.wordsList.length > 0">
                   <div
@@ -96,11 +92,7 @@
       <div class="right">
         <ul>
           <div>{{ curQue.optionTitle }}</div>
-          <li
-            :class="'right' + index"
-            v-for="(item, index) in curQue.option"
-            :key="'right' + index"
-          >
+          <li v-for="(item, index) in curQue.option" :key="'right' + index">
             <!--             :style="{
               background:
                 JSON.stringify(data).indexOf(item.nodeId) != -1
@@ -128,7 +120,7 @@
                 :src="item.img_list[0].url"
                 alt=""
               />
-              <div class="text">
+              <div class="text" :class="'right' + index">
                 <!-- 大于0就说明分词了 -->
                 <template v-if="item.detail.wordsList.length > 0">
                   <div
@@ -390,18 +382,20 @@ export default {
   mounted() {
     this.showPlumb();
     // 根据记录自动连起来
-    setTimeout(() => {
-      for (let i = 0; i < this.curQue.con.length; i++) {
-        let nodeleft = document.getElementsByClassName(`left${i}`)[0];
-        let noderight = document.getElementsByClassName(`right${i}`)[0];
-        if (nodeleft && noderight) {
-          if (nodeleft.offsetHeight > noderight.offsetHeight) {
-            noderight.style.height = nodeleft.offsetHeight + "px";
-          } else {
-            nodeleft.style.height = noderight.offsetHeight + "px";
-          }
+    for (let i = 0; i < this.curQue.con.length; i++) {
+      let nodeleft = document.getElementsByClassName(`left${i}`)[0];
+      let noderight = document.getElementsByClassName(`right${i}`)[0];
+      if (nodeleft && noderight) {
+        console.log(nodeleft);
+        console.log(noderight);
+        if (nodeleft.offsetHeight > noderight.offsetHeight) {
+          noderight.style.height = nodeleft.offsetHeight + "px";
+        } else {
+          nodeleft.style.height = noderight.offsetHeight + "px";
         }
       }
+    }
+    setTimeout(() => {
       if (this.data.length > 0) {
         this.data.forEach((item) => {
           this.jsPlumb.connect({
@@ -494,7 +488,7 @@ export default {
               height: 158px;
             }
             .text {
-              max-width: 330px;
+              max-width: 200px;
               width: 100%;
               padding: 8px 16px;
               background: #ffffff;
@@ -572,12 +566,14 @@ export default {
               height: 158px;
             }
             .text {
+              max-width: 200px;
               padding: 8px 16px;
               background: #ffffff;
               border: 1px solid rgba(0, 0, 0, 0.1);
               box-sizing: border-box;
               border-radius: 8px;
               display: flex;
+              align-items: center;
               flex-wrap: wrap;
               p {
                 margin: 0;

+ 7 - 3
src/components/Adult/preview/SentenceInput.vue

@@ -21,18 +21,18 @@
                               <template v-if="items.detail.wordsList[indexCon + 1] && items.detail.wordsList[indexCon + 1].chs && chsFhList.indexOf(items.detail.wordsList[indexCon + 1].chs) > -1">
                                   <div class="synthesis-box">
                                       <div>
-                                            <span class="pinyin">{{itemCon.pinyin}}</span>
+                                            <span class="pinyin" :class="[noFont.indexOf(itemCon.pinyin)>-1?'noFont':'']">{{itemCon.pinyin}}</span>
                                             <span class="hanzi content-con">{{itemCon.chs}}</span>
                                         </div>
                                         <div style="text-align: left">
-                                            <span class="pinyin">{{items.detail.wordsList[indexCon + 1].pinyin}}</span>
+                                            <span class="pinyin" :class="[noFont.indexOf(items.detail.wordsList[indexCon + 1].pinyin)>-1?'noFont':'']">{{items.detail.wordsList[indexCon + 1].pinyin}}</span>
                                             <span class="hanzi content-con">{{items.detail.wordsList[indexCon + 1].chs}}</span>
                                         </div>
                                   </div>
                                   
                               </template>
                               <template v-else>
-                                    <span class="pinyin">{{itemCon.pinyin}}</span>
+                                    <span class="pinyin" :class="[noFont.indexOf(itemCon.pinyin)>-1?'noFont':'']">{{itemCon.pinyin}}</span>
                                     <span class="hanzi content-con">{{itemCon.chs}}</span>
                               </template>
                           </div>
@@ -79,6 +79,7 @@ export default {
         palyClass: '',
         dataType: [], // 题型
         chsFhList: [",", "。", "“", ":", "》", "《", "?", "!", ";"],
+        noFont: ['~','!','@','#','$','%','^','&','*','(',')'], // 对应不要拼音字体
     };
   },
   computed: {},
@@ -284,6 +285,9 @@ export default {
                         line-height: 130%;
                         color: #000000;
                         height: 18px;
+                        &.noFont{
+                            font-family: initial;
+                        }
                     }
                     .synthesis-box{
                         display: flex;

+ 7 - 3
src/components/Adult/preview/SentenceListenRead.vue

@@ -32,18 +32,18 @@
                                 <template v-if="items.detail.wordsList[indexCon + 1] && items.detail.wordsList[indexCon + 1].chs && chsFhList.indexOf(items.detail.wordsList[indexCon + 1].chs) > -1">
                                     <div class="synthesis-box">
                                         <div>
-                                                <span class="pinyin">{{itemCon.pinyin}}</span>
+                                                <span class="pinyin" :class="[noFont.indexOf(itemCon.pinyin)>-1?'noFont':'']">{{itemCon.pinyin}}</span>
                                                 <span class="hanzi content-con">{{itemCon.chs}}</span>
                                             </div>
                                             <div style="text-align: left">
-                                                <span class="pinyin">{{items.detail.wordsList[indexCon + 1].pinyin}}</span>
+                                                <span class="pinyin" :class="[noFont.indexOf(items.detail.wordsList[indexCon + 1].pinyin)>-1?'noFont':'']">{{items.detail.wordsList[indexCon + 1].pinyin}}</span>
                                                 <span class="hanzi content-con">{{items.detail.wordsList[indexCon + 1].chs}}</span>
                                             </div>
                                     </div>
                                     
                                 </template>
                                 <template v-else>
-                                        <span class="pinyin">{{itemCon.pinyin}}</span>
+                                        <span class="pinyin" :class="[noFont.indexOf(itemCon.pinyin)>-1?'noFont':'']">{{itemCon.pinyin}}</span>
                                         <span class="hanzi content-con">{{itemCon.chs}}</span>
                                 </template>
                             </div>
@@ -67,6 +67,7 @@ export default {
     return {
         curTime:0,
         chsFhList: [",", "。", "“", ":", "》", "《", "?", "!", ";"],
+        noFont: ['~','!','@','#','$','%','^','&','*','(',')'], // 对应不要拼音字体
         stopAudio: false,
     };
   },
@@ -233,6 +234,9 @@ export default {
                         line-height: 130%;
                         color: #000000;
                         height: 18px;
+                        &.noFont{
+                            font-family: initial;
+                        }   
                     }
                     .synthesis-box{
                         display: flex;

+ 10 - 6
src/components/Adult/preview/TextProblem.vue

@@ -12,22 +12,22 @@
                               <template v-if="item.detail.wordsList[indexCon + 1] && item.detail.wordsList[indexCon + 1].chs && chsFhList.indexOf(item.detail.wordsList[indexCon + 1].chs) > -1">
                                   <div class="synthesis-box">
                                       <div>
-                                            <span class="pinyin" v-if="item.detail.pyPosition=='top'">{{itemCon.pinyin}}</span>
+                                            <span class="pinyin" :class="[noFont.indexOf(itemCon.pinyin)>-1?'noFont':'']" v-if="item.detail.pyPosition=='top'">{{itemCon.pinyin}}</span>
                                             <span class="hanzi content-con">{{itemCon.chs}}</span>
-                                            <span class="pinyin" v-if="item.detail.pyPosition=='bottom'">{{itemCon.pinyin}}</span>
+                                            <span class="pinyin" :class="[noFont.indexOf(itemCon.pinyin)>-1?'noFont':'']" v-if="item.detail.pyPosition=='bottom'">{{itemCon.pinyin}}</span>
                                         </div>
                                         <div style="text-align: left">
-                                            <span class="pinyin" v-if="item.detail.pyPosition=='top'">{{item.detail.wordsList[indexCon + 1].pinyin}}</span>
+                                            <span class="pinyin" :class="[noFont.indexOf(items.detail.wordsList[indexCon + 1].pinyin)>-1?'noFont':'']" v-if="item.detail.pyPosition=='top'">{{item.detail.wordsList[indexCon + 1].pinyin}}</span>
                                             <span class="hanzi content-con">{{item.detail.wordsList[indexCon + 1].chs}}</span>
-                                            <span class="pinyin" v-if="item.detail.pyPosition=='bottom'">{{item.detail.wordsList[indexCon + 1].pinyin}}</span>
+                                            <span class="pinyin" :class="[noFont.indexOf(items.detail.wordsList[indexCon + 1].pinyin)>-1?'noFont':'']" v-if="item.detail.pyPosition=='bottom'">{{item.detail.wordsList[indexCon + 1].pinyin}}</span>
                                         </div>
                                   </div>
                                   
                               </template>
                               <template v-else>
-                                    <span class="pinyin" v-if="item.detail.pyPosition=='top'">{{itemCon.pinyin}}</span>
+                                    <span class="pinyin" :class="[noFont.indexOf(itemCon.pinyin)>-1?'noFont':'']" v-if="item.detail.pyPosition=='top'">{{itemCon.pinyin}}</span>
                                     <span class="hanzi content-con">{{itemCon.chs}}</span>
-                                    <span class="pinyin" v-if="item.detail.pyPosition=='bottom'">{{itemCon.pinyin}}</span>
+                                    <span class="pinyin" :class="[noFont.indexOf(itemCon.pinyin)>-1?'noFont':'']" v-if="item.detail.pyPosition=='bottom'">{{itemCon.pinyin}}</span>
                               </template>
                           </div>
                       </div>
@@ -51,6 +51,7 @@ export default {
   data() {
     return {
         chsFhList: [",", "。", "“", ":", "》", "《", "?", "!", ";"],
+        noFont: ['~','!','@','#','$','%','^','&','*','(',')'], // 对应不要拼音字体
     };
   },
   computed: {},
@@ -162,6 +163,9 @@ export default {
                         line-height: 20px;
                         color: #000000;
                         height: 20px;
+                        &.noFont{
+                            font-family: initial;
+                        }
                     }
                     .synthesis-box{
                         display: flex;

+ 8 - 0
src/components/Adult/preview/TinyModule.vue

@@ -1,6 +1,7 @@
 <!--  -->
 <template>
   <div class="Big-Book-prev-Tiny" v-if="curQue">
+    <h2 v-if="curQue.title">{{curQue.title}}</h2>
     <div v-html="curQue.con"></div>
   </div>
 </template>
@@ -33,5 +34,12 @@ export default {
 //@import url(); 引入公共css类
 .Big-Book-prev-Tiny{
     width: 100%;
+    h2{
+        margin: 16px 0 0;
+        font-weight: 500;
+        font-size: 16px;
+        line-height: 24px;
+        color: #000000;
+    }
 }
 </style>

+ 18 - 1
src/views/adultInput.vue

@@ -538,6 +538,17 @@
                     />
                   </template>
                 </template>
+                <template v-if="topicIitem.type == 'table_chs'">
+                  <template v-if="topicIitem.is_edit">
+                    <Table
+                      :curQue="topicIitem.data"
+                      :type="topicIitem.type"
+                      :fn_data="fn_data"
+                      :changeCurQue="changeCurQue"
+                    />
+                  </template>
+                  <template v-else> </template>
+                </template>
               </div>
               <div
                 v-if="topicIitem.data && topicIitem.is_edit"
@@ -629,6 +640,7 @@
           :FatherTreeData="FatherTreeData"
           :change-id="changeId"
           :themeColor="themeColor"
+          :isShowTitle="true"
         />
       </div>
       <span slot="footer" class="dialog-footer">
@@ -676,6 +688,7 @@ import CourseStart from "@/components/Adult/inputModules/CourseStart.vue";
 import RecordControl from "@/components/Adult/inputModules/RecordControl.vue";
 import Tinydemo from "@/components/Adult/inputModules/Tinydemo.vue";
 import VideoControl from "@/components/Adult/inputModules/VideoControl.vue";
+import Table from "@/components/Adult/inputModules/Table.vue";
 
 import Textdes from "@/components/Adult/inputModules/Textdes.vue";
 import Record from "@/components/Adult/inputModules/Record.vue";
@@ -761,6 +774,7 @@ export default {
     VideoControl,
     VideoControlView,
     SentenceSortQP,
+    Table,
   },
   data() {
     return {
@@ -1160,7 +1174,10 @@ export default {
       question_list.cur_fn_data.forEach((curItem) => {
         curItem.table_list.forEach((tabItem) => {
           tabItem.forEach((topicIitem) => {
-            if (topicIitem.type == "article_chs") {
+            if (
+              topicIitem.type == "article_chs" ||
+              topicIitem.type == "dialogue_article_chs"
+            ) {
               topicIitem.data.detail.forEach((item) => {
                 sentence_list = sentence_list.concat(item.sentences);
               });

+ 1 - 0
src/views/bookView.vue

@@ -36,6 +36,7 @@
           bookclientwidth="900"
           :TaskModel="TaskModel"
           @handleBookUserAnswer="handleBookUserAnswer"
+          :isShowTitle="true"
         />
       </div>
       <a

+ 1 - 0
src/views/courseView.vue

@@ -36,6 +36,7 @@
           :FatherTreeData="FatherTreeData"
           :change-id="changeId"
           :themeColor="themeColor"
+          :isShowTitle="true"
         />
       </div>
       <a