Browse Source

study页面新设计及功能

zengyicheng 2 years ago
parent
commit
0ba4d0d628

+ 1 - 1
dist/index.html

@@ -1 +1 @@
-<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><title>pbl-student</title><link href=./static/css/app.e0a91a2c52689cf922be10ea9cf8d12d.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.35062edb107d42aa0826.js></script><script type=text/javascript src=./static/js/app.52d011f53ccd5ed6ebb6.js></script></body></html>
+<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><title>pbl-student</title><link href=./static/css/app.d20803cae684f9bab7b20cebe749770c.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.deec116227fdc82db9e5.js></script><script type=text/javascript src=./static/js/app.249b86bbef20056df44d.js></script></body></html>

File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.d20803cae684f9bab7b20cebe749770c.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.d20803cae684f9bab7b20cebe749770c.css.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.e0a91a2c52689cf922be10ea9cf8d12d.css.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.249b86bbef20056df44d.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.249b86bbef20056df44d.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.52d011f53ccd5ed6ebb6.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.52d011f53ccd5ed6ebb6.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/manifest.3ad1d5771e9b13dbdad2.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/vendor.35062edb107d42aa0826.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/vendor.deec116227fdc82db9e5.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/vendor.deec116227fdc82db9e5.js.map


+ 47 - 2
package-lock.json

@@ -4,6 +4,37 @@
   "lockfileVersion": 1,
   "requires": true,
   "dependencies": {
+    "@babel/runtime": {
+      "version": "7.18.3",
+      "resolved": "https://registry.npmmirror.com/@babel/runtime/-/runtime-7.18.3.tgz",
+      "integrity": "sha512-38Y8f7YUhce/K7RMwTp7m0uCumpv9hZkitCbBClqQIow1qSbCvGkcegKOXpEWCQLfWmevgRiWokZ1GkpfhbZug==",
+      "requires": {
+        "regenerator-runtime": "^0.13.4"
+      },
+      "dependencies": {
+        "regenerator-runtime": {
+          "version": "0.13.9",
+          "resolved": "https://registry.npmmirror.com/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz",
+          "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA=="
+        }
+      }
+    },
+    "@babel/runtime-corejs3": {
+      "version": "7.18.3",
+      "resolved": "https://registry.npmmirror.com/@babel/runtime-corejs3/-/runtime-corejs3-7.18.3.tgz",
+      "integrity": "sha512-l4ddFwrc9rnR+EJsHsh+TJ4A35YqQz/UqcjtlX2ov53hlJYG5CxtQmNZxyajwDVmCxwy++rtvGU5HazCK4W41Q==",
+      "requires": {
+        "core-js-pure": "^3.20.2",
+        "regenerator-runtime": "^0.13.4"
+      },
+      "dependencies": {
+        "regenerator-runtime": {
+          "version": "0.13.9",
+          "resolved": "https://registry.npmmirror.com/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz",
+          "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA=="
+        }
+      }
+    },
     "@types/q": {
       "version": "1.5.5",
       "resolved": "https://registry.nlark.com/@types/q/download/@types/q-1.5.5.tgz",
@@ -2230,6 +2261,11 @@
       "resolved": "https://registry.nlark.com/core-js/download/core-js-2.6.12.tgz",
       "integrity": "sha1-2TM9+nsGXjR8xWgiGdb2kIWcwuw="
     },
+    "core-js-pure": {
+      "version": "3.22.7",
+      "resolved": "https://registry.npmmirror.com/core-js-pure/-/core-js-pure-3.22.7.tgz",
+      "integrity": "sha512-wTriFxiZI+C8msGeh7fJcbC/a0V8fdInN1oS2eK79DMBGs8iIJiXhtFJCiT3rBa8w6zroHWW3p8ArlujZ/Mz+w=="
+    },
     "core-util-is": {
       "version": "1.0.3",
       "resolved": "https://registry.nlark.com/core-util-is/download/core-util-is-1.0.3.tgz",
@@ -11386,8 +11422,7 @@
     "tslib": {
       "version": "2.3.1",
       "resolved": "https://registry.nlark.com/tslib/download/tslib-2.3.1.tgz?cache=0&sync_timestamp=1628722556410&other_urls=https%3A%2F%2Fregistry.nlark.com%2Ftslib%2Fdownload%2Ftslib-2.3.1.tgz",
-      "integrity": "sha1-6KM1rdXOrlGqJh0ypJAVjvBC7wE=",
-      "dev": true
+      "integrity": "sha1-6KM1rdXOrlGqJh0ypJAVjvBC7wE="
     },
     "tsml": {
       "version": "1.0.1",
@@ -12032,6 +12067,16 @@
       "resolved": "https://registry.nlark.com/vuex/download/vuex-3.6.2.tgz",
       "integrity": "sha1-I2vAhqhww655lG8QfxbeWdWJXnE="
     },
+    "wangeditor": {
+      "version": "4.7.15",
+      "resolved": "https://registry.npmmirror.com/wangeditor/-/wangeditor-4.7.15.tgz",
+      "integrity": "sha512-aPTdREd8BxXVyJ5MI+LU83FQ7u1EPd341iXIorRNYSOvoimNoZ4nPg+yn3FGbB93/owEa6buLw8wdhYnMCJQLg==",
+      "requires": {
+        "@babel/runtime": "^7.11.2",
+        "@babel/runtime-corejs3": "^7.11.2",
+        "tslib": "^2.1.0"
+      }
+    },
     "watchpack": {
       "version": "1.7.5",
       "resolved": "https://registry.nlark.com/watchpack/download/watchpack-1.7.5.tgz",

+ 2 - 1
package.json

@@ -19,7 +19,8 @@
     "vue-cookies": "^1.7.4",
     "vue-router": "^3.0.1",
     "vue-video-player": "^5.0.2",
-    "vuex": "^3.6.2"
+    "vuex": "^3.6.2",
+    "wangeditor": "^4.7.15"
   },
   "devDependencies": {
     "autoprefixer": "^7.1.2",

BIN
src/assets/icon/all.png


BIN
src/assets/icon/allActive.png


BIN
src/assets/icon/homeWork.png


BIN
src/assets/icon/question.png


+ 257 - 92
src/components/study.vue

@@ -24,6 +24,72 @@
         </div>
       </div>
       <div class="body_student">
+        <div class="new_top">
+          <div class="before"></div>
+          <div class="courseIndex">
+            <div>第{{ courseType - 0 + 1 }}阶段</div>
+            <div>{{ chapInfo.dyName }}</div>
+          </div>
+          <div
+            style="position: absolute; right: 0"
+            class="returnBtn"
+            @click.stop="
+              goTo(
+                '/courseDetail?userid=' +
+                  userid +
+                  '&oid=' +
+                  oid +
+                  '&courseId=' +
+                  id
+              )
+            "
+          >
+            返回
+          </div>
+        </div>
+        <div class="student_head">
+          <div class="course_text">{{ chapInfo.dyText }}</div>
+          <div class="box_course" v-if="vedio.length > 0">
+            <div class="wheel">
+              <div class="workd_media">
+                <video-player
+                  class="video-player vjs-custom-skin"
+                  ref="videoPlayer"
+                  :playsinline="true"
+                  :options="playerO"
+                  @play="onPlayerPlay($event)"
+                  style="width: 90%; height: 100%; margin: 20px auto"
+                ></video-player>
+              </div>
+            </div>
+            <div class="vedioList">
+              <div class="vedioNav">视频列表</div>
+              <div
+                class="media"
+                v-for="(media, index) in vedio"
+                :key="index"
+                style="width: 160px; margin: 10px auto"
+              >
+                <img
+                  style="height: 90px; width: 160px"
+                  :src="
+                    media.cover != null && media.cover != ''
+                      ? JSON.parse(media.cover).length > 0
+                        ? JSON.parse(media.cover)[0].url
+                        : mr
+                      : mr
+                  "
+                  alt=""
+                  @click="lookVedio(media.url)"
+                />
+              </div>
+            </div>
+            <!-- <div style="font-size: 18px; margin: 15px">
+              {{ chapInfo.dyName }}
+            </div> -->
+          </div>
+          <div v-else>暂无视频</div>
+        </div>
         <div class="study_top">
           <div class="checkbox">
             <div
@@ -32,10 +98,10 @@
               @click="type = 1"
             >
               <div v-if="type == 1">
-                <img src="../assets/icon/videoActive.png" alt="" />
+                <img src="../assets/icon/allActive.png" alt="" />
               </div>
-              <div v-else><img src="../assets/icon/video.png" alt="" /></div>
-              视频
+              <div v-else><img src="../assets/icon/all.png" alt="" /></div>
+              全部
             </div>
             <div
               class="check"
@@ -83,75 +149,20 @@
               工具
             </div>
           </div>
-          <div
-            class="returnBtn"
-            @click.stop="
-              goTo(
-                '/courseDetail?userid=' +
-                  userid +
-                  '&oid=' +
-                  oid +
-                  '&courseId=' +
-                  id
-              )
-            "
-          >
-            返回
-          </div>
-        </div>
-        <div class="student_head" v-if="type == 1">
-          <div class="box_course">
-            <div class="wheel" v-if="vedio.length > 0">
-              <div class="workd_media">
-                <!-- <el-image
-                style="width: 100%; height: 300px"
-                :src="require('../../assets/tu4.png')"
-              ></el-image> -->
-                <video-player
-                  class="video-player vjs-custom-skin"
-                  ref="videoPlayer"
-                  :playsinline="true"
-                  :options="playerO"
-                  @play="onPlayerPlay($event)"
-                  style="width: 95%; height: 100%; margin: 20px auto"
-                ></video-player>
-              </div>
-              <!-- <div class="cd_content_steps">
-								<div
-									class="cd_steps_box"
-									v-for="(media, index) in vedio"
-									:key="media"
-									@click="switchVideo(media, index)"
-								>
-									 <i :class="{ active: index < 1 }"></i> -->
-              <!-- <i
-										:class="{
-											active: playerOptions.sources[0].src == media,
-										}"
-									></i>
-									<span>视频{{ index + 1 }}</span> -->
-              <!-- </div>
-							</div> -->
-              <!-- <img src="../assets/sp2.png" alt="" /> -->
-            </div>
-            <div style="font-size: 18px; margin: 15px">
-              {{ chapInfo.dyName }}
-            </div>
-          </div>
         </div>
         <div class="student_body">
           <div class="videoTop">
-            <div v-if="type == 1">视频列表</div>
+            <div v-if="type == 1"></div>
             <div v-if="type == 3">{{ chapInfo.dyName }}</div>
             <div v-if="type == 5">工具</div>
             <div v-else></div>
-            <div
+            <!-- <div
               @click="openAddWork"
               class="upbtn"
               v-if="type == 1 || type == 2"
             >
               提交实践作业
-            </div>
+            </div> -->
           </div>
           <div class="project_box" v-if="type == 2">
             <div class="detail_content_top">
@@ -160,26 +171,75 @@
             </div>
             <div class="detail_content" v-html="courseDetail.template"></div>
           </div>
-          <div class="project_box" v-if="type == 1 && vedio.length > 0">
-            <div class="filebox">
-              <div class="media" v-for="(media, index) in vedio" :key="index">
-                <img
-                  :src="
-                    media.cover != null && media.cover != ''
-                      ? JSON.parse(media.cover).length > 0
-                        ? JSON.parse(media.cover)[0].url
-                        : mr
-                      : mr
-                  "
-                  alt=""
-                />
-                <div class="title">{{ media.name }}</div>
-                <div class="btn" @click="lookVedio(media.url)">点击播放</div>
+          <div
+            class="project_box"
+            style="padding-bottom: 40px"
+            v-if="type == 1 && vedio.length > 0"
+          >
+            <div
+              style="
+                display: flex;
+                flex-wrap: nowrap;
+                flex-direction: column;
+                position: relative;
+              "
+            >
+              <div class="queTop">
+                <div class="question">
+                  <img src="../assets/icon/question.png" alt="" />
+                </div>
+                <div class="queTitle">
+                  <div>提问:</div>
+                  <div>{{ chapInfoList[courseType - 0].question }}</div>
+                </div>
+              </div>
+              <div class="ediBottom">
+                <editor-bar
+                  style="width: 75%; padding: 10px 0 20px 0px; margin: 0"
+                  v-model="question"
+                ></editor-bar>
+                <div
+                  class="addEditor"
+                  style="position: absolute; bottom: -20px; right: 25%"
+                  @click="addQuestion"
+                >
+                  提交
+                </div>
               </div>
             </div>
           </div>
-          <div class="project_box" v-if="type == 1 && vedio.length == 0">
-            暂无视频
+          <div
+            class="project_box"
+            style="margin-top: 15px; padding-bottom: 30px"
+            v-if="type == 1"
+          >
+            <div
+              style="
+                display: flex;
+                flex-wrap: nowrap;
+                flex-direction: column;
+                position: relative;
+              "
+            >
+              <div class="queTop">
+                <div class="question">
+                  <img src="../assets/icon/homeWork.png" alt="" />
+                </div>
+                <div class="queTitle">
+                  <div>作业上传<span>(上传图文视频等)</span></div>
+                  <div>:{{ chapInfo.dyName }}</div>
+                </div>
+              </div>
+              <div class="ediBottom">
+                <div
+                  class="addEditor"
+                  style="margin-top: 23px"
+                  @click="openAddWork"
+                >
+                  选择文件
+                </div>
+              </div>
+            </div>
           </div>
           <div class="project_box" v-if="type == 3">
             <div class="filebox">
@@ -211,10 +271,7 @@
             <div class="upFile" v-if="type == 3 || type == 4">提交</div>
           </div>
           <div class="project_box" v-if="type == 5">
-            <div
-              class="filebox"
-              v-if="!chapInfo.chapterInfo[0].toolChoose"
-            >
+            <div class="filebox" v-if="!chapInfo.chapterInfo[0].toolChoose">
               暂无数据
             </div>
             <div class="filebox" v-else>
@@ -400,7 +457,9 @@
 
 <script>
 import "../common/aws-sdk-2.235.1.min.js";
+import EditorBar from "../components/tools/wangEnduit.vue";
 export default {
+  components: { EditorBar },
   data() {
     return {
       dialogVisible: false,
@@ -457,6 +516,7 @@ export default {
       noneBtnImg: false,
       proVisible: false,
       progress: 0,
+      question: "",
     };
   },
   methods: {
@@ -628,6 +688,30 @@ export default {
       this.courseType = i;
       this.getCourseDetail();
     },
+    addQuestion() {
+      let params = [
+        {
+          cid: this.id,
+          // chid: this.chapInfoList[this.courseType - 0].chapterInfo[0].chapterid,
+          chid: this.courseType,
+          t: this.question,
+          uid: this.userid,
+        },
+      ];
+      this.ajax
+        .post(this.$store.state.api + "addProblem", params)
+        .then((res) => {
+          this.$message({
+            message: "提交成功",
+            type: "success",
+          });
+          this.question = "";
+        })
+        .catch((err) => {
+          this.$message.error("提交失败");
+          console.error(err);
+        });
+    },
     getCourseDetail() {
       const loading = this.$loading.service({
         background: "rgba(255, 255, 255, 0.7)",
@@ -794,7 +878,8 @@ export default {
 .evaluate > img,
 .up_photo > img,
 .chapter_add > img,
-.deleteWord > img {
+.deleteWord > img,
+.question > img {
   width: 100%;
   height: 100%;
 }
@@ -824,10 +909,12 @@ export default {
 }
 .box_course {
   display: flex;
-  flex-direction: column;
+  flex-direction: row;
+  justify-content: flex-start;
+  align-items: center;
 }
 .wheel {
-  width: 100%;
+  width: 70%;
 }
 .right_box {
   display: flex;
@@ -844,7 +931,6 @@ export default {
 .student_body {
   width: 100%;
   margin: 0 auto;
-  background: #fff;
   margin-top: 20px;
   padding: 0 0 20px;
 }
@@ -889,11 +975,9 @@ export default {
   flex-direction: row;
   justify-content: space-between;
   background: #fff;
-  height: 60px;
   align-items: center;
   width: 95%;
-  margin: 10px auto;
-  border-bottom: 2px solid #ededed;
+  padding: 20px;
 }
 .upbtn {
   margin: 25px;
@@ -909,6 +993,7 @@ export default {
 }
 .project_box {
   padding: 0 30px 10px 21px;
+  background: #fff;
 }
 
 .filebox {
@@ -1033,9 +1118,6 @@ export default {
 .marginT {
   margin-top: 20px;
 }
-.workd_media {
-  width: 100%;
-}
 .cd_content_steps {
   display: flex;
   width: 90%;
@@ -1231,4 +1313,87 @@ export default {
   width: 75px;
   margin-top: 7px;
 }
+.new_top {
+  display: flex;
+  background: #fff;
+  flex-direction: row;
+  justify-content: flex-start;
+  align-items: center;
+  margin: 10px 0;
+  height: 60px;
+  position: relative;
+}
+.before {
+  position: absolute;
+  background: #c3dad4;
+  width: 6px;
+  height: 100%;
+}
+.courseIndex {
+  display: flex;
+  flex-direction: row;
+  align-items: baseline;
+}
+.courseIndex > div:nth-child(1) {
+  margin: 0 20px;
+  padding-bottom: 5px;
+  color: #288a6e;
+  font-size: 20px;
+  width: 80px;
+  font-weight: bold;
+  border-bottom: 4px solid #41c4a4;
+  text-align: center;
+}
+.courseIndex > div:nth-child(2) {
+  font-size: 23px;
+  color: #c0c0c0;
+}
+.course_text {
+  padding: 20px 0 10px 15px;
+  text-indent: 30px;
+  width: 80%;
+  min-height: 80px;
+}
+.vedioList {
+  background: #f2f2f2;
+  width: 200px;
+  height: 530px;
+  border-radius: 10px;
+  overflow: auto;
+}
+.vedioNav {
+  margin: 10px 15px;
+  border-bottom: 1px solid #d7d7d7;
+  padding-bottom: 5px;
+}
+.queTop {
+  display: flex;
+  padding: 10px 0;
+  flex-direction: row;
+  justify-content: flex-start;
+  align-items: center;
+}
+.question {
+  width: 40px;
+}
+.queTitle {
+  margin-left: 5px;
+  font-size: 25px;
+  display: flex;
+  align-items: center;
+}
+.queTitle > div:nth-child(1) {
+  color: #cbcbcb;
+}
+.addEditor {
+  width: 100px;
+  height: 30px;
+  background: #42cda6;
+  color: #fff;
+  border-radius: 5px;
+  text-align: center;
+  line-height: 30px;
+  box-shadow: 1px 3px 6px 1px #bfbfbf;
+  cursor: pointer;
+}
 </style>

+ 186 - 0
src/components/tools/leftBar.vue

@@ -0,0 +1,186 @@
+<template>
+  <div class="bottom">
+    <!-- <div
+      class="item"
+      @click="clickItem('/')"
+      :class="{ active: $route.path === '/' }"
+    >
+      <p>首页</p>
+    </div>
+    <div
+      class="item"
+      @click="clickItem('/b')"
+      :class="{ active: $route.path === '/b' }"
+    >
+      <p>学习中心</p>
+    </div> -->
+    <el-row class="tac">
+      <el-col :span="12">
+        <el-menu
+          :default-active="path"
+          background-color="#fff"
+          text-color="#777"
+          active-text-color="#fff"
+          router
+        >
+          <el-menu-item index="/course">
+            <div class="img" v-if="path == '/course'">
+              <img src="../../assets/icon/course-active.svg" alt="" />
+            </div>
+            <div class="img" v-else>
+              <img src="../../assets/icon/course.png" alt="" />
+            </div>
+            <span>课程项目管理</span>
+          </el-menu-item>
+          <el-menu-item index="/student">
+            <div class="img" v-if="path == '/student'">
+              <img src="../../assets/icon/student-active.svg" alt="" />
+            </div>
+            <div class="img" v-else>
+              <img src="../../assets/icon/user.png" alt="" />
+            </div>
+            <span slot="title">学生管理</span>
+          </el-menu-item>
+          <el-menu-item index="/works">
+            <div class="img" v-if="path == '/works'">
+              <img src="../../assets/icon/work-active.svg" alt="" />
+            </div>
+            <div class="img" v-else>
+              <img src="../../assets/icon/works.png" alt="" />
+            </div>
+            <span slot="title">评价管理</span>
+          </el-menu-item>
+          <el-menu-item index="/class">
+            <div class="img" v-if="path == '/class'">
+              <img src="../../assets/icon/class-active.svg" alt="" />
+            </div>
+            <div class="img" v-else>
+              <img src="../../assets/icon/class.png" alt="" />
+            </div>
+            <span slot="title">班级管理</span>
+          </el-menu-item>
+          <el-menu-item index="/data">
+            <div class="img" v-if="path == '/data'">
+              <img src="../../assets/icon/data-active.svg" alt="" />
+            </div>
+            <div class="img" v-else>
+              <img src="../../assets/icon/data.png" alt="" />
+            </div>
+            <span slot="title">我的资料</span>
+          </el-menu-item>
+          <el-menu-item index="/notice">
+            <div class="img" v-if="path == '/notice'">
+              <img src="../../assets/icon/new-active.svg" alt="" />
+            </div>
+            <div class="img" v-else>
+              <img src="../../assets/icon/notice.png" alt="" />
+            </div>
+            <span slot="title">通知公告</span>
+          </el-menu-item>
+          <el-menu-item index="/library">
+            <div class="img" v-if="path == '/library'">
+              <img src="../../assets/icon/new-active.svg" alt="" />
+            </div>
+            <div class="img" v-else>
+              <img src="../../assets/icon/notice.png" alt="" />
+            </div>
+            <span slot="title">素材库</span>
+          </el-menu-item>
+          <!-- <el-menu-item index="/ask">
+            <div class="img" v-if="path == '/ask'">
+              <img
+                src="../../assets/icon/ask-active.png"
+                style="width: 110%; height: 110%; margin-left: -3px"
+                alt=""
+              />
+            </div>
+            <div class="img" v-else>
+              <img
+                src="../../assets/icon/ask.png"
+                style="width: 110%; height: 110%; margin-left: -3px"
+                alt=""
+              />
+            </div>
+            <span slot="title">问卷调查</span>
+          </el-menu-item> -->
+        </el-menu>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+export default {
+  props: {
+    luyou: Number,
+  },
+  data() {
+    return {
+      path: this.$route.path,
+    };
+  },
+  methods: {
+    clickItem: function (path) {
+      this.$router.push(path);
+    },
+  },
+  watch: {
+    luyou: {
+      handler(n, o) {
+        this.path = this.$route.path;
+      },
+      deep: true, // 深度监听父组件传过来对象变化
+    },
+  },
+};
+</script>
+
+<style scoped>
+.bottom {
+  position: absolute;
+  left: 20px;
+  margin-top: 20px;
+  background-color: #fff;
+  width: 180px;
+  height: calc(100% - 100px);
+  min-height: 500px;
+  z-index: 999;
+  display: inline-block;
+  border-radius: 5px;
+  overflow: hidden;
+}
+.item {
+  margin: 5px 20%;
+  float: left;
+}
+.item p {
+  margin: 0;
+  font-size: 15px;
+}
+.active {
+  color: #108b70;
+}
+.bottom >>> .el-menu-item.is-active {
+  background: #3d67bc !important;
+}
+.tac >>> .el-col-12 {
+  width: 100%;
+}
+.tac >>> .el-menu {
+  border-right: none;
+}
+.tac >>> .el-menu-item {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+.img {
+  width: 20px;
+  padding-right: 5px;
+  padding-bottom: 3px;
+}
+.img > img {
+  width: 100%;
+  height: 100%;
+}
+</style>

+ 173 - 0
src/components/tools/wangEnduit.vue

@@ -0,0 +1,173 @@
+<template lang="html">  
+  <div class="editor"  >  
+    <div ref="toolbar" class="toolbar">  
+    </div>  
+    <div ref="editor" class="text">  
+    </div>  
+  </div>  
+</template>  
+  
+<script>
+import E from "wangeditor";
+import "../../common/aws-sdk-2.235.1.min";
+import { Loading } from 'element-ui';
+// import 'wangeditor/release/wangEditor.min.css'
+export default {
+  name: "editoritem",
+  data() {
+    return {
+      // uploadPath,
+      editor: null,
+      info_: null,
+    };
+  },
+  model: {
+    prop: "value",
+    event: "change",
+  },
+  props: {
+    value: {
+      type: String,
+      default: "",
+    },
+    isClear: {
+      type: Boolean,
+      default: false,
+    },
+  },
+  watch: {
+    isClear(val) {
+      // 触发清除文本域内容
+      if (val) {
+        this.editor.txt.clear();
+        this.info_ = null;
+      }
+    },
+    value: function (value) {
+      if (value !== this.editor.txt.html()) {
+        this.editor.txt.html(this.value);
+      }
+    },
+    //value为编辑框输入的内容,这里我监听了一下值,当父组件调用得时候,如果给value赋值了,子组件将会显示父组件赋给的值
+  },
+  mounted() {
+    this.seteditor();
+    this.editor.txt.html(this.value);
+  },
+  methods: {
+    seteditor() {
+      this.editor = new E(this.$refs.toolbar, this.$refs.editor);
+      // 关闭菜单栏fixed
+      this.editor.config.menuFixed = false;
+      // 普通的自定义菜单
+      this.editor.config.menus = [
+        "head", //标题
+        "bold", //加粗
+        "fontSize", //字体大小
+        "fontName", //字体
+        "italic", //斜体
+        "underline", //下划线
+        "strikeThrough", //删除线
+        "indent", //缩进
+        "lineHeight", //行高
+        // "foreColor",
+        // "backColor",
+        // "link",
+        "list",
+        "todo",
+        "justify",
+        "quote",
+        // "emoticon",
+        "image",
+        // "video",
+        "table",
+        // "code",
+        "splitLine",
+        "undo",
+        "redo",
+      ];
+      // 带格式粘贴
+      this.editor.config.pasteFilterStyle = false;
+      //忽略粘贴内容中的图片
+      this.editor.config.pasteIgnoreImg = false;
+      this.editor.config.showLinkImg = false;
+      var that = this;
+      this.editor.config.customUploadImg = function (files, insert) {
+        const loading = Loading.service({
+          lock: true,
+          background: 'rgba(0, 0, 0, 0.7)'
+        });
+        // 图片自定义上传方法
+        for (var i = 0; i < files.length; i++) {
+          var file = files[i];
+          var credentials = {
+            accessKeyId: "AKIATLPEDU37QV5CHLMH",
+            secretAccessKey: "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",
+          }; //秘钥形式的登录上传
+          window.AWS.config.update(credentials);
+          window.AWS.config.region = "cn-northwest-1"; //设置区域
+
+          var bucket = new window.AWS.S3({ params: { Bucket: "ccrb" } }); //选择桶
+
+          if (file) {
+            var params = {
+              Key:
+                file.name.split(".")[0] +
+                new Date().getTime() +
+                "." +
+                file.name.split(".")[1],
+              ContentType: file.type,
+              Body: file,
+              "Access-Control-Allow-Credentials": "*",
+              ACL: "public-read",
+            }; //key可以设置为桶的相抵路径,Body为文件, ACL最好要设置
+            var options = {
+              partSize: 2048 * 1024 * 1024,
+              queueSize: 2,
+              leavePartsOnError: true,
+            };
+            bucket
+              .upload(params, options)
+              .on("httpUploadProgress", function (evt) {
+                //这里可以写进度条
+                // console.log("Uploaded : " + parseInt((evt.loaded * 80) / evt.total) + '%');
+              })
+              .send(function (err, data) {
+                 loading.close();
+                if (err) {
+                  that.$message.error("上传失败");
+                } else {
+                  //上传成功处理
+                  insert(data.Location);
+                }
+              });
+          }
+        }
+      };
+      this.editor.config.onchange = (html) => {
+        this.info_ = html; // 绑定当前逐渐地值
+        this.$emit("change", this.info_); // 将内容同步到父组件中
+      };
+      // 创建富文本编辑器
+      this.editor.create();
+    },
+  },
+};
+</script>  
+  
+<style lang="css">
+.editor {
+  width: 100%;
+  margin: 10px auto;
+  position: relative;
+  z-index: 0;
+}
+.toolbar {
+  border: 1px solid #ccc;
+}
+.text {
+  border: 1px solid #ccc;
+  height: 230px;
+  overflow: auto;
+}
+</style>  

Some files were not shown because too many files changed in this diff