lsc 2 years ago
parent
commit
95ced9c3dd

+ 10 - 8
src/components/pages/components/ganChart.vue

@@ -81,13 +81,13 @@ let options = {
       {
         id: 4,
         label: "开始时间",
-        value: (task) => dayjs(task.start).format("YYYY-MM-DD"),
+        value: 'start',
         width: 78,
       },
       {
         id: 5,
         label: "结束时间",
-        value: (task) => dayjs(task.end).format("YYYY-MM-DD"),
+        value: 'end',
         width: 78,
       },
     ],
@@ -248,13 +248,14 @@ export default {
       deep: true,
       handler(newValue, oldValue) {
         var unitJson = this.Json
+        this.tasks = []
         for (var i = 0; i < unitJson.length; i++) {
           let task = unitJson[i].chapterInfo[0].taskJson
           for (var j = 0; j < task.length; j++) {
             this.tasks.push({
               id: i + '-' + j,
-              label2: '第' + (i + 1) + '阶段-'+'任务' + (j + 1) + '-' + task[j].task,
-              label: this.datedifference(task[j].time[0], task[j].time[1]) + '天',
+              label2: '第' + (i + 1) + '阶段-' + '任务' + (j + 1) + '-' + task[j].task,
+              label: this.datedifference(task[j].time[0], task[j].time[1]),
               start: this.getTody(task[j].time[0]),
               end: this.getTody(task[j].time[1]),
               percent: 85,
@@ -297,7 +298,7 @@ export default {
       }
       var today = year + "-" + times;
 
-      return today;
+      return year ? today : '无';
     },
     //计算时间差
     datedifference(date1, date2) {
@@ -310,18 +311,19 @@ export default {
       dateSpan = sDate2 - sDate1;
       dateSpan = Math.abs(dateSpan);
       iDays = Math.floor(dateSpan / (24 * 3600 * 1000));
-      return iDays;
+      return iDays ? iDays + '天' : "";
     },
     //获取数据-----------------------------------------------------
     getTaskList() {
       var unitJson = this.Json
+      this.tasks = []
       for (var i = 0; i < unitJson.length; i++) {
         let task = unitJson[i].chapterInfo[0].taskJson
         for (var j = 0; j < task.length; j++) {
           this.tasks.push({
             id: i + '-' + j,
-            label2: '第' + (i + 1) + '阶段-'+'任务' + (j + 1) + '-' + task[j].task,
-            label: this.datedifference(task[j].time[0], task[j].time[1]) + '天',
+            label2: '第' + (i + 1) + '阶段-' + '任务' + (j + 1) + '-' + task[j].task,
+            label: this.datedifference(task[j].time[0], task[j].time[1]),
             start: this.getTody(task[j].time[0]),
             end: this.getTody(task[j].time[1]),
             percent: 85,

+ 2 - 2
src/components/pages/components/proMan.vue

@@ -50,7 +50,7 @@ export default {
         var day =
           new Date(endTime).getTime() - new Date(startTime).getTime(); //日期转时间戳
         var time = Math.floor(day / 86400000);
-        return time
+        return time ? time : '0'
       }
     },
     timeB() {
@@ -59,7 +59,7 @@ export default {
         time.setTime(time.getTime());
         var s2 = time.getFullYear() + "-" + ((time.getMonth() + 1) < 10 ? '0' + (time.getMonth() + 1) : (time.getMonth() + 1)) + "-"
           + ((time.getDate()) < 10 ? '0' + (time.getDate()) : (time.getDate()));
-        return s2
+        return time.getFullYear() ? s2 : '无'
       }
     },
     getMan(){

+ 64 - 41
src/components/pages/student/addCourse.vue

@@ -43,19 +43,19 @@
               </div>
               <div>上传项目内容</div>
             </div>
-            <!-- <div v-if="steps == 4" class="four">
+            <div v-if="steps == 4 && type == 2" class="four">
               <div>
                 <img src="../../../assets/icon/five.png" alt style="width:33px" />
               </div>
-              <div>项目管理</div>
-            </div> 
-            <div v-else class="fourNo" @click="navSteps(4)">
+              <div>项目进展</div>
+            </div>
+            <div v-else-if="type == 2" class="fourNo" @click="navSteps(4)">
               <div>
                 <img src="../../../assets/icon/fiveNo.png" alt style="width:33px" />
               </div>
-              <div>项目管理</div>
-            </div>-->
-            <div v-if="steps == 4" class="four">
+              <div>项目进展</div>
+            </div>
+            <div v-if="steps == 5" class="four">
               <div>
                 <img src="../../../assets/icon/four.png" alt />
               </div>
@@ -90,8 +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 == 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="{
@@ -590,7 +590,7 @@
                         <div class="line"></div>
                       </div>
                       <div>
-                        <editor-bar style="width: 90% !important; margin: 0" placeholder="请输入任务描述" v-model="
+                        <editor-bar style="width: 90% !important; margin: 0;height: 500px;" class="ed_s" placeholder="请输入任务描述" v-model="
                           unitJson[unitIndex].chapterInfo[0].taskJson[
                             itemTaskIndex
                           ].taskDetail
@@ -863,21 +863,21 @@
               </div>
             </div>
           </div>
-          <!-- <div class="rightBox" v-if="this.steps == 4">
+          <div class="rightBox" v-if="steps == 4">
             <div class="proMan">
               <div class="title"><img src="../../../assets/icon/task.png" alt />任务进展甘特图</div>
-              <ganChart :Json="unitJson"></ganChart>
+              <ganChart :Json="unitJson" v-if="steps == 4"></ganChart>
             </div>
             <div class="proMan">
               <div class="title"><img src="../../../assets/icon/proMan.png" alt />负责人看板</div>
-              <proMan :Json="unitJson"></proMan>
+              <proMan :Json="unitJson" :ManAarray="ManAarray"></proMan>
             </div>
-          </div> -->
+          </div>
           <div style="
               width: calc(100% - 20px);
               background: rgb(255, 255, 255);
               border-radius: 10px;
-            " v-if="this.steps == 4">
+            " v-if="steps == 5">
             <div class="basic_box_success">
               <div class="right_img">
                 <img src="../../../assets/icon/right.png" alt />
@@ -899,11 +899,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 && type == 2) || (steps == 3 && type != 2) ? "确认上传" : "下一步" }}
             </button>
           </div>
         </div>
@@ -1752,6 +1752,7 @@ export default {
       userid: this.$route.query.userid,
       oid: this.$route.query.oid,
       org: this.$route.query.org,
+      type: this.$route.query.type,
       cid: this.$route.query.cid != undefined ? this.$route.query.cid : "",
       orgArray: ["150e3120-9195-11ed-b13d-005056b86db5"],
       oidArray: [],
@@ -2038,7 +2039,7 @@ export default {
       return _guid;
     },
     lastSteps() {
-      if (this.steps == 4) {
+      if (this.steps == 5) {
         this.goTo(
           this.fpath + "?userid=" +
           this.userid +
@@ -2263,14 +2264,22 @@ export default {
               return;
             } else {
               this.addWork();
-              this.steps++;
+              if(this.type != 2){
+                this.steps = 5
+              }else{
+                this.steps++;
+              }
             }
           } else {
             if (this.courseName == "") {
               this.$message.error("请将信息填写完整");
               return;
             } else {
-              this.steps++;
+              if(this.type != 2){
+                this.steps = 5
+              }else{
+                this.steps++;
+              }
               if (this.userid != this.courseUserid) {
                 this.updateWork2();
               } else {
@@ -2278,15 +2287,14 @@ export default {
               }
             }
           }
+        }else if (this.steps == 4) {
+          if (this.userid != this.courseUserid) {
+            this.updateWork2();
+          } else {
+            this.updateWork();
+          }
+          this.steps++
         }
-        //  else if (this.steps == 4) {
-        //   if (this.userid != this.courseUserid) {
-        //     this.updateWork2();
-        //   } else {
-        //     this.updateWork();
-        //   }
-        //   this.steps++
-        // }
       } else {
         if (this.steps == 1) {
           if (this.courseName != "") {
@@ -2321,14 +2329,22 @@ export default {
               return;
             } else {
               this.addWork();
-              this.steps++;
+              if(this.type != 2){
+                this.steps = 5
+              }else{
+                this.steps++;
+              }
             }
           } else {
             if (this.courseName == "") {
               this.$message.error("请将信息填写完整");
               return;
             } else {
-              this.steps++
+              if(this.type != 2){
+                this.steps = 5
+              }else{
+                this.steps++;
+              }
               if (this.userid != this.courseUserid) {
                 this.updateWork2();
               } else {
@@ -2336,15 +2352,14 @@ export default {
               }
             }
           }
+        }else if (this.steps == 4) {
+          if (this.userid != this.courseUserid) {
+            this.updateWork2();
+          } else {
+            this.updateWork();
+          }
+          this.steps++
         }
-        // else if (this.steps == 4) {
-        //   if (this.userid != this.courseUserid) {
-        //     this.updateWork2();
-        //   } else {
-        //     this.updateWork();
-        //   }
-        //   this.steps++
-        // }
       }
       this.$refs.stepBox.scrollTop = 0;
     },
@@ -3363,7 +3378,11 @@ export default {
       }
       if (cPan == 2) {
         if (this.steps != 3) {
-          this.steps--;
+          if(this.type == 2 && this.steps == 5){
+            this.steps == 3;
+          }else{
+            this.steps--;
+          }
         }
         return;
       }
@@ -7559,4 +7578,8 @@ ol {
   height: 17px;
   width: 17px;
 }
+
+.ed_s >>> .text{
+  height: calc(100% - 42px);
+}
 </style>

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

@@ -82,7 +82,7 @@
               <div @click="goToCourse(item.courseId)">编辑</div>
               <div @click="get(item.courseId)">预览</div>
               <!-- 项目进展 -->
-              <div @click="getA(item.courseId)">管理</div>
+              <div @click="goToCourse2(item.courseId)">管理</div>
               <div @click="jump(item.courseId)">评论</div>
 
               <!-- <div v-if="groupA == '0'" @click="
@@ -283,6 +283,19 @@ export default {
       }
       // this.$router.push(path);
     },
+    goToCourse2(cid){
+      this.$router.push(
+          "/studentAddCourse?cid=" +
+          cid +
+          "&userid=" +
+          this.userid +
+          "&oid=" +
+          this.oid +
+          "&org=" +
+          this.org +
+          "&type=2"
+        );
+    },
     tableRowClassName({ row, rowIndex }) {
       if ((rowIndex + 1) % 2 === 0) {
         return "even_row";