From 7fe66523c87a00ea5be4d2f784356db825c6a3cd Mon Sep 17 00:00:00 2001
From: litian <2804272236@qq.com>
Date: 星期五, 07 二月 2025 17:29:43 +0800
Subject: [PATCH] shangshuan

---
 src/books/childcareInstitutionsManagement/view/components/chapter001.vue |   87 +++++++++++++++++++++++++++++++++++++++----
 1 files changed, 79 insertions(+), 8 deletions(-)

diff --git a/src/books/childcareInstitutionsManagement/view/components/chapter001.vue b/src/books/childcareInstitutionsManagement/view/components/chapter001.vue
index a02d69f..c09952d 100644
--- a/src/books/childcareInstitutionsManagement/view/components/chapter001.vue
+++ b/src/books/childcareInstitutionsManagement/view/components/chapter001.vue
@@ -422,7 +422,7 @@
           <p><img class="rwmb-1" alt="" src="../../assets/images/xxxgjc.png" /></p>
           <p class="td-0">
             1.璇蜂綘鏍规嵁鏈涔犱换鍔$殑鍐呭锛屽皢鍥藉鎵樿偛鏈烘瀯鐨勫彂灞曞巻鍙插拰鎴戝浗鎵樿偛鏈烘瀯鐨勫彂灞曞巻鍙插埗浣滄垚鎬濈淮瀵煎浘锛屽苟杩涜瀵圭収鍒嗘瀽銆�
-            <img class="jc-img" alt="" src="../../assets/images/SWDT.svg" />
+            <img class="jc-img" alt="" src="../../assets/images/SWDT.svg" title="璇蜂娇鐢ㄦ�濈淮瀵煎浘宸ュ叿缁樺埗鎬濈淮瀵煎浘锛岀粯鍒跺畬姣曞悗涓嬭浇涓哄浘鐗囷紝涓婁紶鍒版暀鏉愪腑" @click="showMindMapDialog"/>
             <span class="btn-box" @click="askAnswerOne = !askAnswerOne" title="鏌ョ湅绛旀">
                 <svg xmlns="http://www.w3.org/2000/svg" width="20.501" height="20.501" viewBox="0 0 20.501 20.501">
                   <path class="a"
@@ -431,24 +431,35 @@
                 </svg>
               </span>
           </p>
-          </p>
-          <div class="w100 fl ju-cn">
-            <ul class="fl ju-ev w80 choice">
+          <div class="w100 textarea-box">
+            <ul class="fl w80">
               <li>
+                <el-upload
+                  ref="upload"
+                  class="upload-demo"
+                  action="'#'"
+                  :limit="1"
+                  :http-request="fileUpload"
+                  :show-file-list="false"
+                >
                 <button class="btn-border btn-w" >
                   涓婁紶鍥剧墖
                 </button>
+              </el-upload>
               </li>
-              <li>
-                <button class="btn-border btn-w">
+              <li class="li-btn">
+                <button class="btn-border btn-w" @click="delFile">
                   鍒犻櫎鍥剧墖
                 </button>
               </li>
             </ul>
+            <div>
+              <img class="img-a" alt="" :src="questionDataImg" />
+            </div>
           </div>
           <div class="w100 " v-show="askAnswerOne">
             <img class="img-a" alt="" src="../../assets/images/answerImg1.png" />
-            <img class="img-a" alt="" src="../../assets/images/answerImg1.png" />
+            <img class="img-a" alt="" src="../../assets/images/answerImg2.png" />
           </div>
           <p class="td-0">
             2.缁撳悎鏈涔犱换鍔℃墍瀛︿範鐨勫唴瀹瑰拰鐢熸椿瀹為檯锛岃涓�璇翠綘瀵规垜鍥藉啘鏉戝湴鍖烘墭鑲叉満鏋勫彂灞曠殑鐪嬫硶銆�
@@ -1581,15 +1592,21 @@
       </div>
     </div>
     <preView :isClear="dialogVisible" :md5="p_md5" :pdfTitle="pdfTitle" ref="pdfDialogRef"></preView>
+    <el-dialog :visible.sync="mindMapDialog"  width="80%" top="2vh" append-to-body>
+      <div class="wendabox">
+        <iframe src="https://www.iodraw.com/mind" frameborder="0"></iframe>
+      </div>
+    </el-dialog>
   </div>
 </template>
 <script>
-import { getResourcePath } from "@/assets/methods/resources";
+import { getResourcePath,uploadFilePath } from "@/assets/methods/resources";
 import {
   getCollectResource,
   setCollectResource,
 } from "@/assets/methods/resources";
 import preView from '@/components/pdfview/index.vue'
+import tool from '@/assets/js/toolClass.js'
 export default {
   name: "chapterOne",
   props: {
@@ -1606,6 +1623,7 @@
       pdfTitle: '',
       p_md5: '',
       pdfDialogRef: "",
+      mindMapDialog: false,
       collectImg: require("../../assets/images/icon/heart.png"),
       collectCheck: require("../../assets/images/icon/heart-check.png"),
       videoPathOne: "",
@@ -1650,6 +1668,7 @@
           }
          
         },
+      questionDataImg:""
     };
   },
   async mounted() {
@@ -1659,11 +1678,13 @@
     );
     if (bookQuestion) {
       this.questionData = JSON.parse(bookQuestion);
+      this.questionDataImg = getResourcePath(this.questionData.askAbout.one);
     }
     this.getVidoePath();
     this.collectResourceList = await getCollectResource(
       this.config.activeBook.bookId
     );
+    
   },
   methods: {
     async getVidoePath() {
@@ -1711,6 +1732,56 @@
         JSON.stringify(this.chapterData)
       );
     },
+
+    //鎵撳紑鎬濈淮瀵煎浘
+    showMindMapDialog(){
+      this.mindMapDialog = true
+
+    },
+
+    //涓婁紶鍥剧墖
+    fileUpload(file){
+      return new Promise((resolve, reject) => {
+      const isJPG = file.file.type === 'image/jpeg' || file.file.type === 'image/png'
+      if (!isJPG) {
+        ElMessage.error('涓婁紶鏂囦欢鍙兘鏄� jpg/png 鏍煎紡!')
+        return reject()
+      }
+      const FileName = file.file.name.split('.')[0]
+      const Extension = file.file.name.split('.')[1]
+      const FileType = file.file.type
+      let size = 1024
+      tool
+        .getFileMd5(file.file, size * 1024)
+        .then(async(e) => {
+          if (!(this.questionData.askAbout.one == e)) {
+            const imgData = new FormData()
+            imgData.append('Md5', e)
+            imgData.append('FileName', FileName)
+            imgData.append('Extension', Extension)
+            imgData.append('FileType', FileType)
+            imgData.append('MetaData', null)
+            imgData.append('file', file.file)
+            let rData = await uploadFilePath(imgData);
+            if (rData){
+              this.questionData.askAbout.one = e
+              this.questionDataImg = await getResourcePath(e);
+            }
+          } else {
+            ElMessage.error('褰撳墠鏂囦欢宸蹭笂浼狅紝璇峰嬁閲嶅鎿嶄綔锛�')
+          }
+        })
+        .catch((e) => {
+          console.error(e)
+        })
+      })
+
+    },
+    //鍒犻櫎
+    delFile(){
+      this.questionData.askAbout.one = ''
+      this.questionDataImg = ''
+    },
     //璧勬簮鏀惰棌浜嬩欢
     // resourcePath  鏂囦欢璺緞锛�
     // resourceType  鏂囦欢绫诲瀷

--
Gitblit v1.9.1