Browse Source

修改批注功能

zengyicheng 2 years ago
parent
commit
3372b71c28
3 changed files with 314 additions and 54 deletions
  1. 2 2
      src/components/courseDetail.vue
  2. 40 40
      src/components/study.vue
  3. 272 12
      src/components/studyStudent.vue

+ 2 - 2
src/components/courseDetail.vue

@@ -221,7 +221,7 @@ export default {
         .then((res) => {
           console.log(res.data);
           this.updateVc();
-          if (this.tType == 1 || this.tType == 2) {
+          if (this.tType == 1 || this.tType == 2 || this.tType == 4) {
             this.goTo(
               "/studyStudent?type=" +
                 i +
@@ -240,7 +240,7 @@ export default {
                 "&screenType=" +
                 this.screenType
             );
-          } else {
+          }else {
             this.goTo(
               "/study?type=" +
                 i +

+ 40 - 40
src/components/study.vue

@@ -1721,7 +1721,7 @@
         </div>
       </div>
     </div>
-    <div class="pButton" @click="selectPz">批</div>
+    <!-- <div class="pButton" @click="selectPz">批</div>
     <div v-if="pzDialog == true" class="newDialogCss">
       <div class="pzTop">
         <div>批注</div>
@@ -1763,7 +1763,7 @@
         </div>
         <div class="addTextCss" @click="addPz">确定</div>
       </div>
-    </div>
+    </div> -->
     <div v-if="proVisible" class="mask">
       <div class="progressBox">
         <div class="lbox">
@@ -2590,44 +2590,44 @@ export default {
           console.error(err);
         });
     },
-    addPz() {
-      let params = [
-        {
-          cid: this.id,
-          uid: this.userid,
-          c: this.pzConText,
-        },
-      ];
-      this.ajax
-        .post(this.$store.state.api + "addPz", params)
-        .then((res) => {
-          this.$message({
-            message: "添加成功",
-            type: "success",
-          });
-          this.pzConText = "";
-          this.addPzDialog = false;
-          this.selectPz();
-        })
-        .catch((err) => {
-          this.$message.error("添加失败");
-          console.error(err);
-        });
-    },
-    selectPz() {
-      this.pzDialog = true;
-      let params = {
-        cid: this.id,
-      };
-      this.ajax
-        .get(this.$store.state.api + "selectPzList", params)
-        .then((res) => {
-          this.pzList = res.data[0];
-        })
-        .catch((err) => {
-          console.error(err);
-        });
-    },
+    // addPz() {
+    //   let params = [
+    //     {
+    //       cid: this.id,
+    //       uid: this.userid,
+    //       c: this.pzConText,
+    //     },
+    //   ];
+    //   this.ajax
+    //     .post(this.$store.state.api + "addPz", params)
+    //     .then((res) => {
+    //       this.$message({
+    //         message: "添加成功",
+    //         type: "success",
+    //       });
+    //       this.pzConText = "";
+    //       this.addPzDialog = false;
+    //       this.selectPz();
+    //     })
+    //     .catch((err) => {
+    //       this.$message.error("添加失败");
+    //       console.error(err);
+    //     });
+    // },
+    // selectPz() {
+    //   this.pzDialog = true;
+    //   let params = {
+    //     cid: this.id,
+    //   };
+    //   this.ajax
+    //     .get(this.$store.state.api + "selectPzList", params)
+    //     .then((res) => {
+    //       this.pzList = res.data[0];
+    //     })
+    //     .catch((err) => {
+    //       console.error(err);
+    //     });
+    // },
     selectStudent() {
       let params = {
         uid: this.userid,

+ 272 - 12
src/components/studyStudent.vue

@@ -813,7 +813,7 @@
                   </div>
                   <div v-if="
                     tType &&
-                    ((tType == 2 && sIsOpen == true) || tType == 1) &&
+                    ((tType == 2 && sIsOpen == true) || tType == 1 || tType == 4) &&
                     tool.tool.indexOf(16) != -1
                   " class="worksBox">
                     <div class="zuoyeYulan" v-if="
@@ -877,7 +877,7 @@
                   </div>
                   <div v-if="
                     tType &&
-                    ((tType == 2 && sIsOpen == true) || tType == 1) &&
+                    ((tType == 2 && sIsOpen == true) || tType == 1 || tType == 4) &&
                     tool.tool.indexOf(4) != -1 && (tool.askJson[0].answer || tool.askJson[0].answer === 0)
                   " class="xuan_right_box">
                     <div class="tool_right_box" v-for="(item, index) in tool.askJson" :key="index">
@@ -897,7 +897,7 @@
                   </div>
                   <div v-if="
                     tType &&
-                    ((tType == 2 && sIsOpen == true) || tType == 1) &&
+                    ((tType == 2 && sIsOpen == true) || tType == 1 || tType == 4) &&
                     tool.tool.indexOf(4) != -1
                   " class="worksBox">
                     <div class="zuoyeYulan" v-if="
@@ -952,7 +952,7 @@
                   </div>
                   <div v-if="
                     tType &&
-                    ((tType == 2 && sIsOpen == true) || tType == 1) &&
+                    ((tType == 2 && sIsOpen == true) || tType == 1 || tType == 4) &&
                     tool.tool.indexOf(15) != -1
                   " class="worksBox">
                     <div class="zuoyeYulan" v-if="
@@ -1013,7 +1013,7 @@
                   </div>
                   <div v-if="
                     tType &&
-                    ((tType == 2 && sIsOpen == true) || tType == 1) &&
+                    ((tType == 2 && sIsOpen == true) || tType == 1 || tType == 4) &&
                     tool.tool.indexOf(1) != -1
                   " class="worksBox">
                     <div class="zuoyeYulan" v-if="
@@ -1070,7 +1070,7 @@
                   </div>
                   <div v-if="
                     tType &&
-                    ((tType == 2 && sIsOpen == true) || tType == 1) &&
+                    ((tType == 2 && sIsOpen == true) || tType == 1 || tType == 4) &&
                     tool.tool.indexOf(3) != -1
                   " class="worksBox">
                     <div class="zuoyeYulan" v-if="
@@ -1127,7 +1127,7 @@
                   </div>
                   <div v-if="
                     tType &&
-                    ((tType == 2 && sIsOpen == true) || tType == 1) &&
+                    ((tType == 2 && sIsOpen == true) || tType == 1 || tType == 4) &&
                     tool.tool.indexOf(6) != -1
                   " class="worksBox">
                     <div class="zuoyeYulan" v-if="
@@ -1184,7 +1184,7 @@
                   </div>
                   <div v-if="
                     tType &&
-                    ((tType == 2 && sIsOpen == true) || tType == 1) &&
+                    ((tType == 2 && sIsOpen == true) || tType == 1 || tType == 4) &&
                     tool.tool.indexOf(7) != -1
                   " class="worksBox">
                     <div class="zuoyeYulan" v-if="
@@ -1241,7 +1241,7 @@
                   </div>
                   <div v-if="
                     tType &&
-                    ((tType == 2 && sIsOpen == true) || tType == 1) &&
+                    ((tType == 2 && sIsOpen == true) || tType == 1 || tType == 4) &&
                     tool.tool.indexOf(26) != -1
                   " class="worksBox">
                     <div class="zuoyeYulan" v-if="
@@ -1278,7 +1278,7 @@
                   </div>
                   <div v-if="
                     tType &&
-                    ((tType == 2 && sIsOpen == true) || tType == 1) &&
+                    ((tType == 2 && sIsOpen == true) || tType == 1 || tType == 4) &&
                     tool.tool.indexOf(40) != -1
                   " class="worksBox">
                     <div class="zuoyeYulan" v-if="
@@ -1355,7 +1355,7 @@
                   </div>
                   <div v-if="
                     tType &&
-                    ((tType == 2 && sIsOpen == true) || tType == 1) &&
+                    ((tType == 2 && sIsOpen == true) || tType == 1 || tType == 4) &&
                     tool.tool.indexOf(41) != -1
                   " class="worksBox">
                     <div class="zuoyeYulan" v-if="
@@ -1743,6 +1743,49 @@
         </el-dialog>
       </div>
     </div>
+    <div class="pButton" @click="selectPz" v-if="tType == 4">批</div>
+    <div v-if="pzDialog == true" class="newDialogCss">
+      <div class="pzTop">
+        <div>批注</div>
+        <div @click="pzDialog = false">
+          <img src="../assets/close1.png" alt="" />
+        </div>
+      </div>
+      <div class="pzBox">
+        <div class="pzListBox" v-if="pzList != undefined">
+          <div class="pzList" v-for="(pz, pzIndex) in pzList" :key="pzIndex">
+            <div class="pzNavTop">
+              <div>批</div>
+              <div>{{ pz.username }}的批注</div>
+            </div>
+            <div class="pzContent">
+              {{ pz.content }}
+            </div>
+          </div>
+        </div>
+        <div class="pzListBox" v-else style="padding-left: 10px">暂无批注</div>
+        <div class="addPz" @click="addPzDialog = true">添加批注</div>
+      </div>
+    </div>
+    <div v-if="addPzDialog == true" class="addDialogCss">
+      <div class="pzTop">
+        <div class="teacherPz">
+          <div class="teacherPzImg">
+            <img src="../assets/icon/teacherPz.png" alt="" />
+          </div>
+          <div style="margin-left: 10px; height: 25px">教师批注</div>
+        </div>
+        <div @click="addPzDialog = false">
+          <img src="../assets/close1.png" alt="" />
+        </div>
+      </div>
+      <div class="addPzBox">
+        <div style="padding-top: 10px;height:80%">
+          <textarea class="binfo_input pzConText" cols placeholder="请填写项目课程关键问题...." v-model="pzConText"></textarea>
+        </div>
+        <div class="addTextCss" @click="addPz">确定</div>
+      </div>
+    </div>
     <div v-if="proVisible" class="mask">
       <div class="progressBox">
         <div class="lbox">
@@ -2191,6 +2234,7 @@ export default {
       commentText: "",
       full: false,
       sIsOpen: false,
+      pzDialog: false,
       type: 1,
       vedio: [],
       text: [],
@@ -2227,6 +2271,7 @@ export default {
       taskCount: 0,
       imgList: [],
       noImgList: [],
+      pzList: [],
       PlTextList: [
         "Excellent!",
         "nice!",
@@ -2329,6 +2374,8 @@ export default {
       askList: [],
       answerList: [],
       navList: [],
+      addPzDialog: false,
+      pzConText: "",
       worksStudent: [],
       workStudent: [],
       noWorksS: [],
@@ -3498,7 +3545,7 @@ export default {
       //     window.scrollTo(0, a.offsetTop);
       //   }
       // }, 0);
-
+      this.selectPz();
       this.getHomeWork();
       this.getCourseDetail();
     },
@@ -3803,6 +3850,48 @@ export default {
           console.error(err);
         });
     },
+    addPz() {
+      let params = [
+        {
+          cid: this.id,
+          uid: this.userid,
+          s:this.courseType,
+          t:this.taskCount,
+          c: this.pzConText,
+        },
+      ];
+      this.ajax
+        .post(this.$store.state.api + "addPz", params)
+        .then((res) => {
+          this.$message({
+            message: "添加成功",
+            type: "success",
+          });
+          this.pzConText = "";
+          this.addPzDialog = false;
+          this.selectPz();
+        })
+        .catch((err) => {
+          this.$message.error("添加失败");
+          console.error(err);
+        });
+    },
+    selectPz() {
+      this.pzDialog = true;
+      let params = {
+        cid: this.id,
+        s:this.courseType,
+        t:this.taskCount,
+      };
+      this.ajax
+        .get(this.$store.state.api + "selectPzList", params)
+        .then((res) => {
+          this.pzList = res.data[0];
+        })
+        .catch((err) => {
+          console.error(err);
+        });
+    },
     updateSLook() {
       let params = {
         sopen: this.sIsOpen == false ? 1 : 2,
@@ -6696,4 +6785,175 @@ export default {
   padding: 5px;
   margin-left: 10px;
 }
+.pButton {
+  position: fixed;
+  right: 5%;
+  bottom: 5%;
+  color: #fff;
+  width: 50px;
+  height: 50px;
+  border-radius: 50%;
+  text-align: center;
+  line-height: 50px;
+  background-image: -webkit-linear-gradient(left, #72aaf4, #4d81d5);
+  cursor: pointer;
+}
+
+.newDialogCss {
+  position: fixed;
+  right: 7%;
+  top: 50%;
+  width: 340px;
+  transform: translateY(-50%);
+  height: 60%;
+  box-shadow: 0px 0 8px 0px #555555;
+  border-radius: 15px;
+}
+
+.pzTop {
+  color: #fff;
+  background: #000;
+  display: flex;
+  flex-direction: row;
+  flex-wrap: nowrap;
+  align-items: center;
+  justify-content: space-between;
+  height: 40px;
+  border-radius: 15px 15px 0 0;
+}
+
+.pzTop>div:nth-child(1) {
+  padding-left: 10px;
+}
+
+.pzTop>div:nth-child(2) {
+  width: 15px;
+  height: 15px;
+  padding-right: 10px;
+  cursor: pointer;
+}
+
+.pzTop>div:nth-child(2)>img {
+  width: 100%;
+  height: 100%;
+}
+
+.pzBox {
+  height: calc(100% - 40px);
+  background: #ededed;
+  border-radius: 0 0 15px 15px;
+}
+
+.pzList {
+  background: #fff;
+  width: 90%;
+  margin: 0 auto 15px;
+}
+
+.pzNavTop {
+  display: flex;
+  flex-direction: row;
+  flex-wrap: nowrap;
+  padding: 10px 10px 0 10px;
+  align-items: center;
+}
+
+.pzNavTop>div:nth-child(1) {
+  background: #3760af;
+  width: 40px;
+  height: 40px;
+  color: #fff;
+  text-align: center;
+  line-height: 40px;
+  border-radius: 50%;
+  font-size: 14px;
+}
+
+.pzNavTop>div:nth-child(2) {
+  font-size: 18px;
+  color: #959595;
+  margin-left: 5px;
+}
+
+.pzContent {
+  padding: 10px;
+  word-break: break-word;
+}
+
+.pzListBox {
+  padding-top: 15px;
+  height: calc(100% - 60px);
+  overflow: auto;
+}
+
+.addPz {
+  background: #4b79ce;
+  width: 100px;
+  color: #fff;
+  font-size: 12px;
+  height: 30px;
+  margin: 0 auto;
+  text-align: center;
+  line-height: 30px;
+  border-radius: 10px;
+  cursor: pointer;
+}
+
+.addDialogCss {
+  position: fixed;
+  right: 37%;
+  top: 50%;
+  width: 600px;
+  transform: translateY(-50%);
+  height: 50%;
+  box-shadow: 0px 0 8px 0px #555555;
+  border-radius: 15px;
+}
+
+.teacherPz {
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  flex-wrap: nowrap;
+}
+
+.teacherPzImg {
+  width: 30px;
+  height: 30px;
+}
+
+.teacherPzImg>img {
+  width: 100%;
+  height: 100%;
+}
+
+.addPzBox {
+  height: calc(100% - 40px);
+  background: #ededed;
+}
+
+.pzConText {
+  width: 95%;
+  height: 100%;
+  margin: 0 auto;
+  border: none;
+  background: #fff;
+  border-radius: 0px;
+}
+
+.addTextCss {
+  background: #4b79ce;
+  width: 80px;
+  height: 30px;
+  text-align: center;
+  color: #fff;
+  line-height: 30px;
+  border-radius: 10px;
+  margin: 10px auto 0;
+  cursor: pointer;
+}
+
+.pzConText:focus-visible {
+  border: none !important;
+}
 </style>