From 6aac0dd9c6d6bd3de148f3d6e123f9c91b1aab4b Mon Sep 17 00:00:00 2001
From: user1 <10901603+no-distractions1@user.noreply.gitee.com>
Date: 星期二, 02 七月 2024 09:31:04 +0800
Subject: [PATCH] Merge branch 'master' of http://182.92.203.7:2001/r/testbookLayout

---
 src/books/artAndDrama/view/components/chapter004.vue         |    3 +
 src/books/mathBook/view/components/chapter001.vue            |    8 ++
 .env.product                                                 |    4 
 src/books/childHealth/view/content/components/chapter008.vue |    4 
 src/components/graffiti/index.vue                            |   35 ++++++++---
 src/books/mathBook/assets/main.less                          |    5 +
 src/components/graffiti/components/brushSize.vue             |   22 +++++-
 src/components/examinations/index.vue                        |   31 ++++++---
 src/books/mathBook/view/components/index.vue                 |   12 +++
 src/books/childHealth/view/content/index.vue                 |    2 
 src/books/artAndDrama/view/components/index.vue              |    6 +-
 11 files changed, 94 insertions(+), 38 deletions(-)

diff --git a/.env.product b/.env.product
index 3958a74..76a6d12 100644
--- a/.env.product
+++ b/.env.product
@@ -1,6 +1,6 @@
 VUE_APP_ENV = 'product'
 VUE_APP_API_URL = "https://jsek.bnuic.com"
 VUE_APP_RESOURCE_CTX = 'https://jsek.bnuic.com/books/resource/'
-VUE_APP_PUBLIC_PATH = 'https://jsek.bnuic.com/books/book/english'
+VUE_APP_PUBLIC_PATH = 'https://jsek.bnuic.com/books/book/mathBook'
 VUE_APP_BOOK_LIST = "childHealth/lifeCare/sportsAndHealth/embedded/english/artAndDance/artAndDrama/mathBook"
-VUE_APP_BOOK_ID = 'english'
\ No newline at end of file
+VUE_APP_BOOK_ID = 'mathBook'
\ No newline at end of file
diff --git a/src/books/artAndDrama/view/components/chapter004.vue b/src/books/artAndDrama/view/components/chapter004.vue
index 5f3fd49..158b8b6 100644
--- a/src/books/artAndDrama/view/components/chapter004.vue
+++ b/src/books/artAndDrama/view/components/chapter004.vue
@@ -66,6 +66,7 @@
                             class="hs1">鈼�</span>鏄ュぉ鏉ヤ簡锛屾槬椋庡惞杩囷紝鏌虫爲鍙戣娊浜嗭紝杩庢槬鑺卞紑浜嗭紝灏忕嚂瀛愬湪澶╃┖鑷敱鍦伴缈斻�備竴鍒囬兘鏄偅涔堢敓鏈哄媰鍕冦�傝涓衡�滄槬澶┾�濇秱涓婁綘鍠滄鐨勯鑹层��</p>
                     <!-- 鍥剧墖缂哄け -->
                     <!-- <p class="center"><img class="img-e" alt="" src="./../assets/images/0033-1.jpg" /></p> -->
+                     <graffiti  :page="32" :bcImg="this.config.activeBook.resourceUrl + '/image/0033-1.jpg'" :imgWidth="596" :imgHeight="800" />
                 </div>
                 <!-- 姝ゆ涓洪〉鑴氶儴鍒嗭紙闇�瑕佽缃〉鐮侊級 -->
                 <div class="page-footer">
@@ -222,6 +223,7 @@
 </template>
 <script>
 import { getResourcePath } from "@/assets/methods/resources";
+import graffiti from '@/components/graffiti/index.vue'
 export default {
     name: "chapterFour",
     props: {
@@ -229,6 +231,7 @@
             type: Array,
         },
     },
+    components:{graffiti},
     //鍦ㄨ繖閲屽璋冪敤鐨勬柟娉曡繘琛屾寕杞�
     mounted() {
         this.getVidoePath();
diff --git a/src/books/artAndDrama/view/components/index.vue b/src/books/artAndDrama/view/components/index.vue
index ebc8d63..76a4d16 100644
--- a/src/books/artAndDrama/view/components/index.vue
+++ b/src/books/artAndDrama/view/components/index.vue
@@ -159,8 +159,8 @@
     }, 500);
 
     // 娴嬭瘯椤甸潰璺宠浆
-      setTimeout(() => {
-      this.gotoPage(5,36);
+    //  setTimeout(() => {
+    //  this.gotoPage(4,32);
     //   setTimeout(() => {
     //     this.renderSign("Highlight", {
     //       id: "2ACA9359",
@@ -188,7 +188,7 @@
     //   txt: " 杩愬姩绯荤粺鏄敱楠ㄣ�侀杩炵粨鍜岄楠艰倢涓夐儴鍒嗙粍鎴愮殑銆傚叏韬殑楠ㄩ�氳繃楠ㄨ繛缁撶粍鎴愪汉浣撻楠硷紙瑙佸浘1-1锛夈�傞楠兼槸浜轰綋鐨勬敮鏋讹紝鍏锋湁淇濇姢鍐呰剰鍣ㄥ畼銆佷緵鑲岃倝闄勭潃鍜屼綔涓鸿倢鑲夎繍鍔ㄧ殑鏉犳潌绛変綔鐢ㄣ�傚湪绁炵粡绯荤粺鐨勬敮閰嶄笅锛岃倢鑲夋敹缂╃壍鍔ㄦ墍闄勭潃鐨勯缁曠潃鍏宠妭杞姩锛屼娇韬綋浜х敓鍚勭鍔ㄤ綔銆傛墍浠ワ紝杩愬姩绯荤粺鍏锋湁杩愬姩銆佹敮鎸佸拰淇濇姢绛夊姛鑳斤紝骞煎勾鏃舵湡鐨勯楠艰繕鍏锋湁閫犺鍔熻兘銆� ",
     //   txtIndex: 57
     // });
-      }, 500);
+    // }, 500);
   },
   methods: {
     // setZoom1() {
diff --git a/src/books/childHealth/view/content/components/chapter008.vue b/src/books/childHealth/view/content/components/chapter008.vue
index 256dd23..c6ade5d 100644
--- a/src/books/childHealth/view/content/components/chapter008.vue
+++ b/src/books/childHealth/view/content/components/chapter008.vue
@@ -1521,12 +1521,12 @@
           <div class="fl fl-around openImgBox">
             <div class="left" style="width: 40%">
               <p class="center">
-                <img src="../../../assets/images/chapterEight/0238-3.jpg" class="w100">
+                <img src="../../../assets/images/chapterEight/0238-3.jpg" style="height: 178px;">
               </p>
               <p class="img">鍥�8-6 鍗曟墜鑳稿鎸夊帇</p>
             </div>
             <div class="right" style="width: 40%">
-              <div class="banshi openImgBox" style="height:214px">
+              <div class="banshi openImgBox" style="height:188px">
                   <div class="swiper-container swiper-img">
                     <div class="swiper-wrapper">
                       <div class="swiper-slide">
diff --git a/src/books/childHealth/view/content/index.vue b/src/books/childHealth/view/content/index.vue
index 0b2d947..213ed4f 100644
--- a/src/books/childHealth/view/content/index.vue
+++ b/src/books/childHealth/view/content/index.vue
@@ -229,7 +229,7 @@
 
     // 娴嬭瘯椤甸潰璺宠浆
     // setTimeout(() => {
-    // this.gotoPage(8,175);
+    // this.gotoPage(8,233);
     //   setTimeout(() => {
     //     this.renderSign("Highlight", {
     //       id: "2ACA9359",
diff --git a/src/books/mathBook/assets/main.less b/src/books/mathBook/assets/main.less
index 4fc2485..07f8deb 100644
--- a/src/books/mathBook/assets/main.less
+++ b/src/books/mathBook/assets/main.less
@@ -771,6 +771,11 @@
       }
     }
   }
+  .gr-title {
+    font-size: 16px;
+    color:#00aeef;
+    margin-top: 40px;
+  }
 }
 
 /* 濯掍綋鏌ヨ鍋氬熀纭�鍝嶅簲寮忓竷灞� */
diff --git a/src/books/mathBook/view/components/chapter001.vue b/src/books/mathBook/view/components/chapter001.vue
index a7f9230..a31cf36 100644
--- a/src/books/mathBook/view/components/chapter001.vue
+++ b/src/books/mathBook/view/components/chapter001.vue
@@ -571,6 +571,11 @@
               v-if="questionData"
               :isReal="false"
             ></examinations>
+            <p class="gr-title">鍥涖�佸嚱鏁� f(x)=x鈥�-3 鐨勫浘鍍忓湪 杞村乏杈圭殑閮ㄥ垎濡傚浘鎵�绀猴紝璇蜂綘鐢诲嚭杩欎釜鍑芥暟鍥惧儚鍦� y杞村彸杈圭殑閮ㄥ垎.</p>
+            <div style="margin:0 auto;width:330px">
+              <graffiti :page="9" :bcImg="this.config.activeBook.resourceUrl + '/images/0103-2.jpg'" :imgHeight="300" :imgWidth="300" :bcColor="'#d3edfa'"  /> 
+            </div>
+            
           </div>
         </div>
       </div>
@@ -817,11 +822,12 @@
 
 <script>
 import examinations from "@/components/examinations/index.vue";
+import graffiti from '@/components/graffiti/index.vue'
 import { getResourcePath } from "@/assets/methods/resources";
 import { getCollectResource,setCollectResource } from "@/assets/methods/resources";
 export default {
   name: "chapter-one",
-  components: { examinations },
+  components: { examinations,graffiti },
   props: {
     showPageList: {
       type: Array,
diff --git a/src/books/mathBook/view/components/index.vue b/src/books/mathBook/view/components/index.vue
index 87f357e..65ba975 100644
--- a/src/books/mathBook/view/components/index.vue
+++ b/src/books/mathBook/view/components/index.vue
@@ -163,7 +163,7 @@
 
     // 娴嬭瘯椤甸潰璺宠浆
     // setTimeout(() => {
-    //   this.gotoPage(2, 10);
+    //   this.gotoPage(1, 9);
     //   setTimeout(() => {
     //     this.renderSign("Highlight", {
     //       id: "2ACA9359",
@@ -866,8 +866,16 @@
           if (!res.data.data) return [];
           for (let index = 0; index < res.data.data.length; index++) {
             const item = res.data.data[index];
+            // 鏁板鍏紡鍔犵被鍚嶅幓淇敼鏍峰紡
+            if(item.type && item.type == 'material') {
+              if(!item.infoList.length) return false
+              item.infoList.forEach(citem => {
+                if(citem.answer) citem.answer = citem.answer.replace(/\<math/gi, '<math class="examination-math"')
+              })
+            } else {
+              if(item.answer) item.answer = item.answer.replace(/\<math/gi, '<math class="examination-math"')
+            }
               item.isCollect = this.collectId.indexOf(item.id) > -1 ? true :false
-            console.log(item.id ,this.collectId.indexOf(item.id));
             if (this.questionId[num][page].indexOf(item.id) > -1) {
               if (item.type && item.type == "material") {
                 cardList.push(item);
diff --git a/src/components/examinations/index.vue b/src/components/examinations/index.vue
index 5192350..d6d99a8 100644
--- a/src/components/examinations/index.vue
+++ b/src/components/examinations/index.vue
@@ -371,14 +371,14 @@
                   </template>
                   <div class="referBox">
                     <span>鍙傝�冪瓟妗堬細</span>
-                    <p
-                      v-html="arrayToString(value.answer)"
+                    <span
+                      v-html="value.answer"
                       class="ti-2"
                       :class="[
                         'subjectiveBox',
                         value.isUnfold ? 'showText' : 'hideText',
                       ]"
-                    ></p>
+                    ></span>
                   </div>
                   <!-- 瑙f瀽 -->
                   <div class="referBox" v-if="value.analysisCon">
@@ -464,20 +464,24 @@
         >淇濆瓨</el-button
       >
       <el-button
-        @click="(e) =>{
-          handleQuestion()
-          saveAnswer(e)
-        }"
+        @click="
+          (e) => {
+            handleQuestion();
+            saveAnswer(e);
+          }
+        "
         class="examinations-btn-box"
         :style="{ borderColor: primaryColor }"
         >鎻愪氦</el-button
       >
       <el-button @click="redo" class="examinations-btn-box">閲嶅仛</el-button>
       <el-button
-        @click="(e) => {
-          openAnswers()
-          saveAnswer(e)
-        }"
+        @click="
+          (e) => {
+            openAnswers();
+            saveAnswer(e);
+          }
+        "
         class="examinations-btn-box"
         :style="{ borderColor: primaryColor }"
         >鏌ョ湅绛旀</el-button
@@ -1373,4 +1377,9 @@
   width: 18px;
   object-fit: contain;
 }
+/deep/ .examination-math {
+  display: flex;
+  align-items: center;
+  flex-wrap: wrap;
+}
 </style>
diff --git a/src/components/graffiti/components/brushSize.vue b/src/components/graffiti/components/brushSize.vue
index 52d103b..ec5043a 100644
--- a/src/components/graffiti/components/brushSize.vue
+++ b/src/components/graffiti/components/brushSize.vue
@@ -1,15 +1,23 @@
 <template>
-  <div class="wrap-range">
+  <div class="brushSize">
     <!-- 涓轰簡涓嶅湪瀛愮粍浠朵腑鍙樻洿鍊硷紝涓嶇敤v-model -->
-    <input
+     <div class="wrap-range">
+      <input
       type="range"
       :value="brushSize"
       min="1"
       max="30"
       title="璋冩暣绗斿埛绮楃粏"
+      class="input-brush"
       @change="(event) => $emit('change-size', +event.target.value)"
     />
-    <el-color-picker v-model="checkColor" @change="onChangeColor"></el-color-picker>
+     </div>
+
+    <!-- <el-color-picker v-model="checkColor" @change="onChangeColor"></el-color-picker> -->
+     <div>
+       <input type="color" v-model="checkColor" @input="onChangeColor">
+     </div>
+    
   </div>
 </template>
 
@@ -32,8 +40,8 @@
     }
   },
   methods:{
-    onChangeColor(color) {
-      this.$emit("change-color", color);
+    onChangeColor(e) {
+      this.$emit("change-color", e.srcElement.value);
     },
   }
 };
@@ -41,9 +49,13 @@
 // const brushSize = computed(() => props.size);
 </script>
 <style lang="less" scoped>
+.brushSize {
+  display: flex;
+}
 .wrap-range {
   display: flex;
   align-items: center;
+  margin-right: 10px;
   .el-color-picker {
     margin-left: 20px;
   }
diff --git a/src/components/graffiti/index.vue b/src/components/graffiti/index.vue
index 11c1519..a14524d 100644
--- a/src/components/graffiti/index.vue
+++ b/src/components/graffiti/index.vue
@@ -1,6 +1,6 @@
 <!-- 娑傝壊杩炵嚎棰樻帶浠� -->
 <template>
-  <div class="page">
+  <div class="page" :style="{height:imgHeight + 120 + 'px'}">
     <div class="main">
       <div id="canvas_panel">
         <canvas
@@ -13,7 +13,7 @@
         >
       </div>
     </div>
-    <div class="footer">
+    <div class="footer" :style="{backgroundColor:bcColor}">
       <BrushSize :size="brushSize" @change-size="onChangeSize"  @change-color="onChangeColor" />
       <ToolBtns :tool="brushTool" @change-tool="onChangeTool" />
     </div>
@@ -32,6 +32,16 @@
     },
     bcImg:{
       type:String
+    },
+    imgWidth:{
+      type:Number
+    },
+    imgHeight:{
+      type:Number
+    },
+    bcColor:{
+      type:String,
+      default:'#fff'
     }
   },
   data() {
@@ -53,12 +63,14 @@
   },
   mounted() {
     this.backgroundImage = this.bcImg
-    this.canvas = document.getElementById("canvas");
+    this.canvas = (this.container ? this.container : document).getElementById("canvas");
     if (this.canvas.getContext) {
       this.context = this.canvas.getContext("2d", { willReadFrequently: true });
       this.initCanvas();
       // window.addEventListener('resize', updateCanvasPosition);
-      window.addEventListener("scroll",this.updateCanvasOffset,true); // 娣诲姞婊氬姩鏉℃粴鍔ㄤ簨浠剁洃鍚櫒
+      (
+        this.container ? this.container : document
+      ).addEventListener("scroll",this.updateCanvasOffset,true); // 娣诲姞婊氬姩鏉℃粴鍔ㄤ簨浠剁洃鍚櫒
       this.getCanvasOffset();
       this.context.lineGap = "round";
       this.context.lineJoin = "round";
@@ -101,7 +113,9 @@
     initCanvas() {
       const that = this
       const resetCanvas = () => {
-        const elPanel = document.getElementById("canvas_panel");
+        const elPanel = (
+        this.container ? this.container : document
+      ).getElementById("canvas_panel");
         that.canvas.width = elPanel.clientWidth;
         that.canvas.height = elPanel.clientHeight;
         that.context = that.canvas.getContext("2d", {
@@ -122,7 +136,7 @@
           imgData.setAttribute('crossOrigin', '');
         }
         imgData.onload = () => {
-          this.context.drawImage(imgData,0,0)
+          this.context.drawImage(imgData,0,0,this.imgWidth,this.imgHeight)
         }
       }
       resetCanvas();
@@ -218,7 +232,7 @@
         imgData.setAttribute('crossOrigin', '');
       }
       imgData.onload = () => {
-        this.context.drawImage(imgData,0,0)
+        this.context.drawImage(imgData,0,0,this.imgWidth,this.imgHeight)
       }
     },
     // 淇濆瓨鐢诲竷鑳屾櫙鍜屽垝绾垮埌鏈湴鏂规硶
@@ -228,7 +242,9 @@
     },
     // 淇濆瓨涓轰竴寮犲浘鐗囧苟涓嬭浇鐨勬柟娉�
     saveImgData() {
-      var link = document.createElement("a");
+      var link = (
+        this.container ? this.container : document
+      ).createElement("a");
       var imgData = this.canvas.toDataURL({format: 'png', quality:1, width:20000, height:4000});
       var strDataURI = imgData.substr(22, imgData.length);
       var blob = dataURLtoBlob(imgData);
@@ -263,7 +279,6 @@
     saveData(data) {
       this.historyData.length >= 50 && this.historyData.shift(); // 璁剧疆鍌ㄥ瓨涓婇檺涓�50姝�
       this.historyData.push(data);
-      console.log('鏁版嵁',this.historyData);
     },
     // 娓呴櫎銆佹挙閿�銆佷繚瀛樼姸鎬佷笉闇�瑕佷繚鎸侊紝鎿嶄綔瀹屽悗鎭㈠绗斿埛鐘舵��
     resetToolActive() {
@@ -280,7 +295,6 @@
   display: flex;
   flex-direction: column;
   width:100%;
-  height: 866px;
 }
 
 .main {
@@ -292,7 +306,6 @@
   justify-content: space-around;
   align-items: center;
   height: 88px;
-  background-color: #fff;
 }
 
 #canvas_panel {

--
Gitblit v1.9.1