Browse Source

作业提交

zengyicheng 2 years ago
parent
commit
4053f1025f
1 changed files with 54 additions and 14 deletions
  1. 54 14
      src/components/study.vue

+ 54 - 14
src/components/study.vue

@@ -336,7 +336,7 @@
               v-if="file.length && file[index] && file[index].length > 0"
             >
               <div class="queTop">
-                <div class="question" style="width: 30px;margin-top: 5px;">
+                <div class="question" style="width: 30px; margin-top: 5px">
                   <img src="../assets/icon/fileIcon.png" alt />
                 </div>
                 <div class="queTitle">
@@ -510,14 +510,14 @@
                           />
                           <div style="margin: 5px 0">训练服务器</div>
                         </div>
-                        <!-- <div v-if="tooC == 16">
-                        <img
-                          @click="addTools(tooC, toolIndex)"
-                          src="../assets/icon/thirdToolList/work.png"
-                          alt
-                        />
-                        <div style="margin: 5px 0">作业提交</div>
-                        </div>-->
+                        <div v-if="tooC == 16">
+                          <img
+                            @click="addTools(tooC, toolIndex, index)"
+                            src="../assets/icon/thirdToolList/work.png"
+                            alt
+                          />
+                          <div style="margin: 5px 0">作业提交</div>
+                        </div>
                       </div>
                     </div>
                   </div>
@@ -584,7 +584,46 @@
           :before-close="handleClose"
           class="dialog_change"
         >
-          <div class="first">
+          <div class="marginT">
+            <div>上传图片</div>
+            <div class="chapter_add" @click="addImg($event)" v-if="studyJuri[0].cover.length == 0">
+              <div class="up_photo">
+                <img src="../assets/photo.png" alt />
+              </div>
+              <input
+                type="file"
+                accept="image/png, image/gif, image/jpeg"
+                style="display: none"
+                @change="beforeUpload1($event, 1)"
+              />
+            </div>
+            <div
+              class="chapter_add"
+              style="
+                display: flex;
+                width: 100%;
+                flex-direction: row;
+                flex-wrap: wrap;
+                justify-content: flex-start;
+              "
+              v-if="studyJuri[0].cover.length > 0"
+            >
+              <div class="upCover">
+                <img
+                  :src="
+                    studyJuri[0].cover[0].url
+                  "
+                  alt
+                />
+                <span class="picName">{{ studyJuri[0].cover[0].name }}</span>
+
+                <div class="deleteWord" @click="clean(1)">
+                  <img src="../assets/icon/delete.png" alt />
+                </div>
+              </div>
+            </div>
+          </div>
+          <!-- <div class="first">
             <div>作业名称:</div>
             <div>{{ chapInfo.dyName }}</div>
           </div>
@@ -682,8 +721,8 @@
                 </div>
               </div>
             </div>
-          </div>
-          <div class="upload_send" @click="addWork">提交</div>
+          </div> -->
+          <div class="upload_send" @click="addCourseWorks(taskCount)">提交</div>
         </el-dialog>
       </div>
     </div>
@@ -1023,7 +1062,7 @@ export default {
           cid: this.id,
           stage: this.courseType,
           task: i,
-          content: this.upToolImg,
+          content: this.studyJuri[0].cover[0].url,
           type: 1,
         },
       ];
@@ -1034,7 +1073,8 @@ export default {
             message: "提交成功",
             type: "success",
           });
-          this.upToolImg = "";
+          this.studyJuri[0].cover = [];
+          this.dialogVisible = false;
         })
         .catch((err) => {
           this.$message.error("提交失败");