Bläddra i källkod

Merge branch 'master' of https://git.cocorobo.cn/CocoRoboLabs/pbl-teacher-table

zengyicheng 2 år sedan
förälder
incheckning
d71c46ebcf

+ 1 - 1
dist/index.html

@@ -25,7 +25,7 @@
       height: 100%;
       width: 100%;
       background: #e6eaf0;
-    }</style><link href=./static/css/app.1b8dcff7f9aa6532b00bca48a49a7a2e.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3512a67a6213c2df4180.js></script><script type=text/javascript src=./static/js/vendor.e8eb4c1cc481dbb543fc.js></script><script type=text/javascript src=./static/js/app.cbfd53cf75749b701285.js></script></body></html><script>function stopSafari() {
+    }</style><link href=./static/css/app.ee856fd3f5cfd2841a7c1f9851ed54b6.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3512a67a6213c2df4180.js></script><script type=text/javascript src=./static/js/vendor.e8eb4c1cc481dbb543fc.js></script><script type=text/javascript src=./static/js/app.0da0a6a8318beccd5afc.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
dist/static/css/app.1b8dcff7f9aa6532b00bca48a49a7a2e.css.map


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
dist/static/css/app.ee856fd3f5cfd2841a7c1f9851ed54b6.css


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
dist/static/css/app.ee856fd3f5cfd2841a7c1f9851ed54b6.css.map


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
dist/static/js/app.0da0a6a8318beccd5afc.js


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
dist/static/js/app.0da0a6a8318beccd5afc.js.map


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
dist/static/js/manifest.3512a67a6213c2df4180.js.map


+ 1 - 1
src/components/pages/scourse.vue

@@ -151,7 +151,7 @@
             <div class="kc_time">{{ item.time }}</div>
           </div>
           <div class="three_bottom">
-            <div @click="jump(item.courseId)">查看内容</div>
+            <!-- <div @click="jump(item.courseId)">查看内容</div> -->
             <div @click="
               goTo(
                 '/studentAddCourse?cid=' +

+ 156 - 224
src/components/pages/student/addCourse.vue

@@ -47,25 +47,25 @@
               <div>
                 <img src="../../../assets/icon/four.png" alt />
               </div>
-              <div>上传完成</div>
+              <div>项目管理</div>
             </div>
-            <div v-else class="fourNo">
+            <div v-else class="fourNo" @click="navSteps(4)">
               <div>
                 <img src="../../../assets/icon/fourNo.png" alt />
               </div>
-              <div>上传完成</div>
+              <div>项目管理</div>
             </div>
             <div v-if="steps == 5" class="four">
               <div>
                 <img src="../../../assets/icon/four.png" alt />
               </div>
-              <div>项目管理</div>
+              <div>上传完成</div>
             </div>
             <div v-else class="fourNo">
               <div>
                 <img src="../../../assets/icon/fourNo.png" alt />
               </div>
-              <div>项目管理</div>
+              <div>上传完成</div>
             </div>
           </div>
           <div class="stepsBottom" v-if="steps == 3">
@@ -90,7 +90,8 @@
               <h3 class="info_title" v-if="steps == 1">项目内容填写</h3>
               <h3 class="info_title" v-if="steps == 2">请选择项目框架</h3>
               <h3 class="info_title" v-if="steps == 3">项目内容填写</h3>
-              <h3 class="info_title" v-if="steps == 4">上传项目</h3>
+              <h3 class="info_title" v-if="steps == 4">项目管理</h3>
+              <h3 class="info_title" v-if="steps == 5">上传项目</h3>
               <el-breadcrumb separator-class="el-icon-arrow-right" style="margin-top: 15px">
                 <!-- /studentCourse -->
                 <el-breadcrumb-item :to="{
@@ -643,7 +644,10 @@
                             </div>
                           </div>
                         </div>
-                        <div v-if="itemTool.tool" style="margin-top:10px">
+                        <div v-if="itemTool.toolPhoto" style="margin-top:10px">
+                          <div class="toolimg">
+                            <img :src="itemTool.toolPhoto" alt="" @click="previewImg(itemTool.toolPhoto)">
+                          </div>
                         </div>
                       </div>
                       <div class="addToolFun" @click="addToolFunD(itemTaskIndex)">
@@ -683,6 +687,12 @@
               background: rgb(255, 255, 255);
               border-radius: 10px;
             " v-if="this.steps == 4">
+          </div>
+          <div style="
+              width: calc(100% - 20px);
+              background: rgb(255, 255, 255);
+              border-radius: 10px;
+            " v-if="this.steps == 5">
             <div class="basic_box_success">
               <div class="right_img">
                 <img src="../../../assets/icon/right.png" alt />
@@ -704,11 +714,11 @@
 ">
               返回项目
             </button>
-            <button class="info_btn" v-if="steps > 1 && steps != 5" @click="lastSteps">
-              {{ steps == 4 ? "返回首页" : "上一步" }}
+            <button class="info_btn" v-if="steps > 1 && steps != 6" @click="lastSteps">
+              {{ steps == 5 ? "返回首页" : "上一步" }}
             </button>
-            <button class="info_btn" v-if="steps < 4" @click="nextSteps">
-              {{ steps == 3 ? "确认上传" : "下一步" }}
+            <button class="info_btn" v-if="steps < 5" @click="nextSteps">
+              {{ steps == 4 ? "确认上传" : "下一步" }}
             </button>
           </div>
         </div>
@@ -1703,25 +1713,18 @@ export default {
           j++
         ) {
           if (
-            this.unitJson[_unitIndex].chapterInfo[0].taskJson[j].toolChoose
-              .length > 1
+            !this.unitJson[_unitIndex].chapterInfo[0].taskJson[j].people
           ) {
-            for (
-              var z = 0;
-              z <
-              this.unitJson[_unitIndex].chapterInfo[0].taskJson[j].toolChoose
-                .length;
-              z++
-            ) {
-              if (
-                !this.unitJson[_unitIndex].chapterInfo[0].taskJson[j]
-                  .toolChoose[z].tool.length
-              ) {
-                this.$message.error("请把工具添加完整");
-                cPan = 2;
-                break;
-              }
-            }
+            this.$message.error("请填写负责人");
+            cPan = 2
+            break;
+          }
+          if (
+            !this.unitJson[_unitIndex].chapterInfo[0].taskJson[j].time
+          ) {
+            this.$message.error("请填写任务完成时间");
+            cPan = 2
+            break;
           }
           if (this.unitJson[_unitIndex].chapterInfo[0].taskJson[j].eList) {
             this.unitJson[_unitIndex].chapterInfo[0].taskJson[j].eList =
@@ -1833,7 +1836,7 @@ export default {
       return _guid;
     },
     lastSteps() {
-      if (this.steps == 4) {
+      if (this.steps == 5) {
         this.goTo(
           this.fpath + "?userid=" +
           this.userid +
@@ -1921,6 +1924,12 @@ export default {
             this.checkEva(this.checkId);
           }, 1000);
         }
+        if (s == 4 && this.cidType == 0) {
+          this.$message.error("请将信息填写完整");
+          return;
+        } else if (s == 4) {
+          this.steps = 4;
+        }
       }
       this.$refs.stepBox.scrollTop = 0;
     },
@@ -1968,6 +1977,8 @@ export default {
               this.steps++;
             }
           }
+        } else if (this.steps == 4) {
+          this.steps++
         }
       } else {
         if (this.steps == 1) {
@@ -2076,6 +2087,7 @@ export default {
             type: "success",
           });
           this.unitJson.splice(this.unitIndex, 1);
+          this.deleteStudentToolS(this.unitIndex)
           this.unitIndex = this.unitIndex - 1;
         })
         .catch((err) => {
@@ -2113,12 +2125,55 @@ export default {
           _this.unitJson[_this.unitIndex].chapterInfo[0].taskJson[
             itemTaskIndex
           ].toolArray.splice(i, 1);
+          this.deleteStudentToolSTT(itemTaskIndex, i)
           _this.$message.success("删除成功");
         })
         .catch(() => {
           return;
         });
     },
+    deleteStudentToolSTT(task, tool) {
+      let params = [{
+        cid: this.cid,
+        stage: this.unitIndex,
+        task: task,
+        tool: tool,
+      }]
+      this.ajax
+        .post(this.$store.state.api + "deleteStudentToolSTT", params)
+        .then((res) => {
+        })
+        .catch((err) => {
+          console.error(err);
+        });
+    },
+    deleteStudentToolST(task) {
+      let params = [{
+        cid: this.cid,
+        stage: this.unitIndex,
+        task: task,
+      }]
+      this.ajax
+        .post(this.$store.state.api + "deleteStudentToolST", params)
+        .then((res) => {
+        })
+        .catch((err) => {
+          console.error(err);
+        });
+    },
+    deleteStudentToolS() {
+      let params = [{
+        cid: this.cid,
+        stage: this.unitIndex,
+      }]
+      this.ajax
+        .post(this.$store.state.api + "deleteStudentToolS", params)
+        .then((res) => {
+        })
+        .catch((err) => {
+          console.error(err);
+        });
+    },
     deleteSentence(i) {
       var _this = this;
       if (_this.time()) {
@@ -2161,6 +2216,7 @@ export default {
               i,
               1
             );
+            this.deleteStudentToolST(i);
             _this.$message.success("删除成功");
           })
           .catch(() => {
@@ -2561,6 +2617,7 @@ export default {
                     askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
                   },
                 ],
+                toolArray: [],
                 isShowTools: false,
                 askCount: 1,
                 isFold: 0,
@@ -2603,6 +2660,7 @@ export default {
         toolDetail: "",
         toolPhoto: "",
         toolEdit: false,
+        toolId: this.guid()
       });
       this.$forceUpdate();
       this.dialogVisibleTool = false;
@@ -2614,7 +2672,7 @@ export default {
     openToolFun(tool, taskCount, i) {
       window.parent.postMessage(
         {
-          tools: tool+'s',
+          tools: tool + 's',
           cid: this.cid,
           stage: this.unitIndex,
           task: taskCount,
@@ -2623,6 +2681,9 @@ export default {
         "*"
       );
     },
+    previewImg(url) {
+      this.$hevueImgPreview(url);
+    },
     addTaskBorder() {
       this.unitJson[this.unitIndex].chapterInfo[0].taskJson.push({
         task: "",
@@ -2896,26 +2957,18 @@ export default {
         j++
       ) {
         if (
-          this.unitJson[_unitIndex].chapterInfo[0].taskJson[j].toolChoose
-            .length > 1
+          !this.unitJson[_unitIndex].chapterInfo[0].taskJson[j].people
         ) {
-          for (
-            var z = 0;
-            z <
-            this.unitJson[_unitIndex].chapterInfo[0].taskJson[j].toolChoose
-              .length;
-            z++
-          ) {
-            if (
-              !this.unitJson[_unitIndex].chapterInfo[0].taskJson[j].toolChoose[
-                z
-              ].tool.length
-            ) {
-              this.$message.error("请把工具添加完整");
-              cPan = 2;
-              break;
-            }
-          }
+          this.$message.error("请填写负责人");
+          cPan = 2
+          break;
+        }
+        if (
+          !this.unitJson[_unitIndex].chapterInfo[0].taskJson[j].time
+        ) {
+          this.$message.error("请填写任务完成时间");
+          cPan = 2
+          break;
         }
         if (this.unitJson[_unitIndex].chapterInfo[0].taskJson[j].eList) {
           this.unitJson[_unitIndex].chapterInfo[0].taskJson[j].eList =
@@ -2941,10 +2994,12 @@ export default {
       this.ajax
         .post(this.$store.state.api + "updateStudentWorkNew4", params)
         .then((res) => {
-          this.$message({
-            message: "修改成功",
-            type: "success",
-          });
+          if (this.steps != 1 && this.steps != 2 && this.steps != 3 && this.steps != 4) {
+            this.$message({
+              message: "修改成功",
+              type: "success",
+            });
+          }
           this.courseId = this.cid;
         })
         .catch((err) => {
@@ -2961,22 +3016,18 @@ export default {
           j++
         ) {
           if (
-            this.unitJson[i].chapterInfo[0].taskJson[j].toolChoose.length > 1
+            !this.unitJson[i].chapterInfo[0].taskJson[j].people
           ) {
-            for (
-              var z = 0;
-              z < this.unitJson[i].chapterInfo[0].taskJson[j].toolChoose.length;
-              z++
-            ) {
-              if (
-                !this.unitJson[i].chapterInfo[0].taskJson[j].toolChoose[z].tool
-                  .length
-              ) {
-                this.$message.error("请把工具添加完整");
-                cPan = 2;
-                break;
-              }
-            }
+            this.$message.error("请填写负责人");
+            cPan = 2
+            break;
+          }
+          if (
+            !this.unitJson[i].chapterInfo[0].taskJson[j].time
+          ) {
+            this.$message.error("请填写任务完成时间");
+            cPan = 2
+            break;
           }
           if (this.unitJson[i].chapterInfo[0].taskJson[j].eList) {
             this.unitJson[i].chapterInfo[0].taskJson[j].eList = this.unitJson[
@@ -3025,7 +3076,7 @@ export default {
       this.ajax
         .post(this.$store.state.api + "updateStudentWorkNew2", params)
         .then((res) => {
-          if (this.steps != 1 && this.steps != 2 && this.steps != 3) {
+          if (this.steps != 1 && this.steps != 2 && this.steps != 3 && this.steps != 4) {
             if (this.cidType == 1) {
               this.$message({
                 message: "修改成功",
@@ -3190,6 +3241,7 @@ export default {
                           ],
                         },
                       ],
+                      toolArray: [],
                       isShowTools: false,
                       askCount: 1,
                       isFold: 0,
@@ -4096,164 +4148,30 @@ export default {
       this.ajax
         .get(this.$store.state.api + "select_student_course_detail", params)
         .then((res) => {
-          // console.log(this.unitJson);
-          let unitJson = JSON.parse(res.data[0][0].chapters);
-          this.unitJson2 = JSON.parse(res.data[0][0].chapters);
-          let _unitJson2 = JSON.parse(JSON.stringify(this.unitJson));
-          let _unitJson = [];
-          let _chapAarry = [];
-          let _unitIndex = JSON.parse(JSON.stringify(this.unitIndex));
-          let _unitIndex2 = JSON.parse(JSON.stringify(this.unitIndex));
-          let index = 1;
-          let chapindex;
-          if (_unitJson2.length > unitJson.length) {
-            for (let c = 0; c < _unitJson2.length; c++) {
-              _chapAarry.push(_unitJson2[c].chapterInfo[0].chapterid);
-            }
-            for (let j = 0; j < unitJson.length; j++) {
-              let count = 0;
-              for (let k = 0; k < _unitJson2.length; k++) {
-                if (
-                  unitJson[j].chapterInfo[0].chapterid ==
-                  _unitJson2[k].chapterInfo[0].chapterid
-                ) {
-                  count++;
-                  _chapAarry.splice(
-                    _chapAarry.indexOf(_unitJson2[k].chapterInfo[0].chapterid),
-                    1
-                  );
-                  _unitJson.push(unitJson[j]);
-                  break;
-                }
-              }
-              // if(count === 0){
-              //   this.$message.error("您所修改的阶段已经被其他老师删除了");
-              // }
-            }
-            for (let k = 0; k < _unitJson2.length; k++) {
-              if (_unitJson2[k].isUpdate == 1) {
-                _chapAarry.splice(
-                  _chapAarry.indexOf(_unitJson2[k].chapterInfo[0].chapterid),
-                  1
-                );
-                _unitJson.push(_unitJson2[k]);
-              }
-            }
-            console.log(_chapAarry);
-            for (let d = 0; d < _unitJson2.length; d++) {
-              if (
-                _chapAarry.indexOf(_unitJson2[d].chapterInfo[0].chapterid) != -1
-              ) {
-                if (_unitIndex == d) {
-                  index = 2;
-                }
-                chapindex = d;
-                // this.$message.error("您所修改的阶段已经被其他老师删除了");
-              }
-            }
-          } else {
-            _unitJson = JSON.parse(JSON.stringify(_unitJson2));
-          }
-
-          for (let i = 0; i < unitJson.length; i++) {
-            if (
-              (i < _unitJson.length - 1 || i == _unitJson.length - 1) &&
-              _unitJson[i].chapterInfo[0].chapterid !=
-              unitJson[i].chapterInfo[0].chapterid
-            ) {
-              if (i == _unitJson.length - 1) {
-                // this.unitIndex++
-                _unitIndex2++;
-              }
-              _unitJson.splice(i, 0, unitJson[i]);
-            } else if (i > _unitJson.length - 1) {
-              _unitJson.push(unitJson[i]);
-            } else if (
-              _unitJson[i].chapterInfo[0].chapterid ==
-              unitJson[i].chapterInfo[0].chapterid
-            ) {
-              _unitJson[i] = unitJson[i];
-            }
-            // if (i == _unitIndex) {
-            //   continue;
-            // } else
-          }
-
-          if (_chapAarry.length && index != 2) {
-            if (chapindex < _unitIndex) {
-              this.isDelete = 2;
-              // this.unitIndex--;
-              _unitIndex2--;
-            } else if (
-              _unitJson2[_unitIndex].chapterInfo[0].chapterid !=
-              _unitJson[_unitIndex].chapterInfo[0].chapterid
-            ) {
-              this.isDelete = 2;
-              for (let n = 0; n < _unitJson.length; n++) {
-                if (
-                  _unitJson2[_unitIndex].chapterInfo[0].chapterid ==
-                  _unitJson[n].chapterInfo[0].chapterid
-                ) {
-                  // this.unitIndex = n;
-                  _unitIndex2 = n;
-                  _unitJson[n] = _unitJson2[_unitIndex];
-                  break;
+          console.log(res.data[2]);
+          let unitJson = JSON.parse(JSON.stringify(this.unitJson))
+          let works = res.data[2]
+          for (var i = 0; i < unitJson.length; i++) {
+            let task = unitJson[i].chapterInfo[0].taskJson
+            for (var j = 0; j < task.length; j++) {
+              var tool = task[j].toolArray
+              for (var z = 0; z < tool.length; z++) {
+                let _tool = tool[z]
+                _tool.toolPhoto = ""
+                for (var k = 0; k < works.length; k++) {
+                  let _work = works[k]
+                  if (_work.stage == i && _work.task == j && _work.tool == z && _work.atool == _tool.tool) {
+                    _tool.toolPhoto = _work.content;
+                    break;
+                  }
                 }
               }
             }
-          } else if (index != 2) {
-            // _unitJson[this.unitIndex] = _unitJson2[_unitIndex];
-            _unitJson[_unitIndex2] = _unitJson2[_unitIndex];
-          }
-          if (index == 1) {
-            this.unitJson = _unitJson;
-            this.$forceUpdate();
-            setTimeout(() => {
-              if (this.unitIndex != _unitIndex2) {
-                this.isDelete = 2;
-                this.unitIndex = _unitIndex2;
-              }
-            }, 0);
-            this.timer = setTimeout(() => {
-              this.seleteCourseUpdate();
-            }, 1000);
-          } else if (index == 2) {
-            let _this = this;
-            _this
-              .$confirm(
-                "您所修改的阶段已经被其他老师删除了,需要恢复嘛?",
-                "提示",
-                {
-                  confirmButtonText: "需要",
-                  cancelButtonText: "取消",
-                  type: "warning",
-                }
-              )
-              .then(() => {
-                if (_this.time()) {
-                  _this.restoreWork(
-                    _chapAarry[0],
-                    _unitJson,
-                    chapindex,
-                    _unitJson2,
-                    _unitIndex2
-                  );
-                }
-              })
-              .catch(() => {
-                _this.unitJson = _unitJson;
-                _this.$forceUpdate();
-                setTimeout(() => {
-                  if (this.unitIndex != _unitIndex2) {
-                    this.isDelete = 2;
-                    this.unitIndex = _unitIndex2;
-                  }
-                }, 0);
-                _this.timer = setTimeout(() => {
-                  _this.seleteCourseUpdate();
-                }, 1000);
-              });
           }
+          this.unitJson = unitJson
+          this.timer = setTimeout(() => {
+            this.seleteCourseUpdate();
+          }, 1000);
         })
         .catch((err) => {
           console.error(err);
@@ -7210,4 +7128,18 @@ ol {
 .groupContent>>>.el-input-number.is-without-controls .el-input__inner {
   text-align: left;
 }
+
+.toolimg {
+  width: 200px;
+  height: 105px;
+  border-radius: 5px;
+  box-shadow: rgb(223 218 218) 0px 0px 6px 1px;
+  cursor: pointer;
+}
+
+.toolimg>img {
+  height: 100%;
+  width: 100%;
+  object-fit: contain;
+}
 </style>

+ 1 - 1
src/components/pages/student/course.vue

@@ -80,7 +80,7 @@
             </div>
             <div class="three_bottom">
               <!-- <div @click="jump(item.courseId)">评课</div> -->
-              <div @click="get(item.courseId)">查看内容</div>
+              <!-- <div @click="get(item.courseId)">查看内容</div> -->
               <div v-if="groupA == '0'" @click="goToCourse(item.courseId)">
                 修改
               </div>

Vissa filer visades inte eftersom för många filer har ändrats