闫增涛
2024-05-15 2e664020f32a0eda87139bc1363fa34b7b5697ba
Merge branch 'master' of http://182.92.203.7:2001/r/testbookLayout
2个文件已删除
4个文件已修改
3665 ■■■■■ 已修改文件
public/information.json 1514 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/resource.json 2066 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/methods/examination.js 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/books/childHealth/view/content/components/chapter001.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/books/childHealth/view/content/index.vue 43 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/books/childHealth/view/index.vue 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/information.json
File was deleted
public/resource.json
File was deleted
src/assets/methods/examination.js
@@ -1,7 +1,7 @@
import { activeBook } from "@/assets/js/config";
import MG from "@/assets/js/middleGround/WebMiddleGroundApi";
import getPublicImage from "@/assets/js/middleGround/tool";
const getQuestionList = (questionList) => {
const getQuestionList = async (questionList) => {
  let cardList = [
    {
      catalogName: "单选题",
@@ -50,7 +50,7 @@
        Embedded_QuestionBank_Difficulty: [],
      },
    };
    MG.store.getProductDetail(query).then( (res) => {
    const res = await MG.store.getProductDetail(query);
       res.datas.cmsDatas[0].datas.forEach((item, index) => {
        const questionObj = {
          number: index + 1, // 题号
@@ -191,7 +191,6 @@
          shortArr.push(questionObj);
        }
      });
    });
  }
  cardList[0].infoList = singleChoiceArr
  cardList[1].infoList = judgeArr
@@ -205,13 +204,14 @@
      citem.number = cindex + 1;
    }
  }
  return cardList
  console.log(cardList.filter(item=>item.infoList.length > 0),"cardList.filter(item=>item.infoList.length > 0)");
  return cardList.filter(item=>item.infoList.length > 0);
};
const getQuestionData = (chapterData) => {
const getQuestionData = async (chapterData) => {
  const data = { ...chapterData };
  for (let key in chapterData) {
    data[key] = getQuestionList(chapterData[key]);
    data[key] = await getQuestionList(chapterData[key]);
  }
  return data;
};
src/books/childHealth/view/content/components/chapter001.vue
@@ -3429,9 +3429,9 @@
      pathTen:''
    };
  },
  mounted() {
    this.$data.questionData = getQuestionData(testData[1])
    // console.log('题目',this.$data.questionData );
  async mounted() {
    this.$data.questionData = await getQuestionData(testData[1])
    console.log('题目',this.$data.questionData );
    this.$data.pathOne = getResourcePath('f6f6588a75086576b87bed2fb9ca1ec1')
    this.$data.pathTwo = getResourcePath('e5993b62684fe55d13190cfe52bf00ed')
    this.$data.pathThree = getResourcePath('6b6d42213aa85aa5ff7724aaf96ffee6')
src/books/childHealth/view/content/index.vue
@@ -51,7 +51,7 @@
  },
  watch: {
    showCatalogList: {
      handler(newVal) {
      handler(newVal, oldVal) {
        if (
          this.$store.state.qiankun &&
          this.$store.state.qiankun.catalogChange
@@ -96,10 +96,17 @@
    //   this.gotoPage(5, 100);
    //   setTimeout(() => {
    //     this.renderSign("Note", {
    //       page: 100,
    //       txt: "前儿童生长发育的影响是一个渐",
    //       id: "2ACA9359",
    //       txt: "营养素和热量,才能",
    //       page: "100",
    //       type: "Highlight",
    //       color: "#F5E12A"
    //     });
    //     setTimeout(() => {
    //       this.delSign({
    //         ids: ["2ACA9359"]
    //       });
    //     }, 2000);
    //   }, 1000);
    // }, 3000);
  },
@@ -145,18 +152,17 @@
        }
      }
      // showCatalogList 当前显示的三个章节,watch监听传递给主应用
      console.log(this.showCatalogList);
      // 更新上一次滚动的位置
      this.previousScrollTop = event.target.scrollTop;
      // 返回页码和章节信息
      if (this.$store.state.qiankun && this.$store.state.qiankun.pageChange)
        this.$store.state.qiankun.pageChange({
          page: 100,
          catalog: 5,
          catalogId: "",
          catalogName: ""
        });
      // if (this.$store.state.qiankun && this.$store.state.qiankun.pageChange)
      //   this.$store.state.qiankun.pageChange({
      //     page: 100,
      //     catalog: 5,
      //     catalogId: "",
      //     catalogName: ""
      //   });
    },
    gotoPage(catalog, page) {
      if (catalog >= 0 && catalog <= this.catalogLength) {
@@ -202,33 +208,24 @@
            // 高亮
            pageDom.innerHTML = pageDom.innerHTML.replace(
              reg,
              `<span datatype="Highlight" dataid="${data.id}" style="background: ${data.color};" class="highLight">${data.txt}</span>`
              `<span datatype="Highlight" dataid="${data.id}" style="background: ${data.color};" class="highLight" onclick="signClick('Highlight','${data.id}')">${data.txt}</span>`
            );
            break;
          case "Dashing":
            // 划线
            pageDom.innerHTML = pageDom.innerHTML.replace(
              reg,
              `<span datatype="Dashing" dataid="${data.id}" style="text-decoration-color:${data.color};" class="underline">${data.txt}</span>`
              `<span datatype="Dashing" dataid="${data.id}" style="text-decoration-color:${data.color};" class="underline" onclick="signClick('Dashing','${data.id}')">${data.txt}</span>`
            );
            break;
          case "Note":
            // 笔记
            pageDom.innerHTML = pageDom.innerHTML.replace(
              reg,
              `<span datatype="Note" dataid="${data.id}" style="border-bottom-color:${data.color}" class="notesline">${data.txt}</span><img src="${NoteIcon}" style="cursor: pointer" />`
              `<span datatype="Note" dataid="${data.id}" style="border-bottom-color:${data.color}" class="notesline" onclick="signClick('Note','${data.id}')">${data.txt}<img src="${NoteIcon}" style="cursor: pointer" /></span>`
            );
            break;
        }
        // 绑定事件
        const thisAddDom = (
          this.container ? this.container : document
        ).querySelector(`[dataid="${data.id}"]`);
        thisAddDom.addEventListener("click", function (e) {
          console.log("点击事件回调的实例,通过这个参数获取类型", e);
          if (this.$store.state.qiankun && this.$store.state.qiankun.signClick)
            this.$store.state.qiankun.signClick(type, data);
        });
      }
    },
    delSign({ ids, type }) {
src/books/childHealth/view/index.vue
@@ -9,7 +9,7 @@
export default {
  name: "child-health",
  components: {
    pageContent,
    pageContent
  },
  data() {
    return {
@@ -61,8 +61,8 @@
      };
      this.MG.store.getProductDetail(query).then((res) => {
        console.log("图书信息",res.datas); 
        this.$data.bookData =  res.datas
        this.$store.commit('setRootCmsItemId',res.datas.rootCmsItemId)
        this.$data.bookData = res.datas;
        this.$store.commit("setRootCmsItemId", res.datas.rootCmsItemId);
      });
    },
    getParentWithClass(element, className) {
@@ -74,7 +74,9 @@
      }
    },
    handleMouseUp(e) {
      const selection = (this.container ? this.container : window).getSelection();
      const selection = (
        this.container ? this.container : window
      ).getSelection();
      const txt = selection.toString();
      if (selection.type != "none" && txt) {
        let node = selection.anchorNode.parentNode;
@@ -110,12 +112,20 @@
            y: e.y
          });
        }
      } else {
        if (this.$store.state.qiankun.windowSelection) {
          this.$store.state.qiankun.windowSelection({
            chapterNum: "",
            txt: "",
            page: "",
            x: "",
            y: ""
          });
        }
      }
    }
  }
};
</script>
<style lang="less" scoped>
</style>
<style lang="less" scoped></style>