Browse Source

批量上传

zengyicheng 2 years ago
parent
commit
4d19021bf0
1 changed files with 54 additions and 21 deletions
  1. 54 21
      src/components/studyStudent.vue

+ 54 - 21
src/components/studyStudent.vue

@@ -1813,11 +1813,7 @@
                           />
                         </div>
                         <div class="workImg" v-if="w.type == 1">
-                          <img
-                            :src="word"
-                            @click="openFile(w.works)"
-                            alt
-                          />
+                          <img :src="word" @click="openFile(w.works)" alt />
                           <!-- @click="openFile(w.works)" -->
                           <div
                             class="answerScore"
@@ -3719,11 +3715,7 @@
                         :class="w.type == 1 ? 'isTypeOne' : ''"
                       >
                         <div class="workImg">
-                          <img
-                            :src="word"
-                            @click="openFile(w.works)"
-                            alt
-                          />
+                          <img :src="word" @click="openFile(w.works)" alt />
                           <!-- @click="openFile(w.works)" -->
                           <div
                             class="answerScore"
@@ -4032,9 +4024,7 @@
                               <div class="workImg" v-if="w.type == 1">
                                 <img
                                   :src="word"
-                                  @click="
-                                    openFile(w.works)
-                                  "
+                                  @click="openFile(w.works)"
                                   alt
                                 />
                                 <!-- @click="openFile(w.works)" -->
@@ -4082,9 +4072,7 @@
                                 <img
                                   style="cursor: pointer"
                                   :src="video"
-                                  @click="
-                                    openVideo(w)
-                                  "
+                                  @click="openVideo(w)"
                                   alt
                                 />
                                 <!--  @click="openVideo(w.works)" -->
@@ -6570,11 +6558,26 @@
               <img :src="word" alt v-else-if="item.fileType == 4" />
               <img :src="video" alt v-else />
               <!-- <span class="picName">{{ item.name }}</span> -->
-              <el-input
+              <!-- <el-input
                 v-model="item.username"
                 placeholder="请输入学生名字"
                 style="margin-top: 10px"
-              ></el-input>
+              ></el-input> -->
+
+              <el-select
+                v-model="item.username"
+                filterable
+                allow-create
+                placeholder="请选择学生"
+              >
+                <el-option
+                  v-for="item1 in classJuri"
+                  :key="item1.userid"
+                  :label="item1.name ? item1.name : item1.username"
+                  :value="item1.userid"
+                >
+                </el-option>
+              </el-select>
 
               <div class="deleteWord" @click="clean2(index)">
                 <img src="../assets/icon/deleteWorks.png" alt />
@@ -6615,10 +6618,25 @@
     >
       <div style="text-align: center">
         <span class="tian1">名称</span>
-        <el-input
+        <el-select
           v-model="worksSName"
+          filterable
+          allow-create
           style="width: 250px; margin: 15px 0px"
-        ></el-input>
+          placeholder="请选择学生"
+        >
+          <el-option
+            v-for="item in classJuri"
+            :key="item.userid"
+            :label="item.name ? item.name : item.username"
+            :value="item.userid"
+          >
+          </el-option>
+        </el-select>
+        <!-- <el-input
+          v-model="worksSName"
+          style="width: 250px; margin: 15px 0px"
+        ></el-input> -->
       </div>
       <span slot="footer" class="dialog-footer">
         <el-button @click="dialogVisibleSname = false">取 消</el-button>
@@ -6686,6 +6704,7 @@ export default {
       dialogVisibleDeleteGroup: false,
       dialogVisibleSname: false,
       worksSName: "",
+      classJuri: [],
       snameWid: "",
       sStudent: {},
       bzText: "",
@@ -7239,6 +7258,19 @@ export default {
           console.error(err);
         });
     },
+    selectCStudent() {
+      let params = {
+        cid: this.classId,
+      };
+      this.ajax
+        .get(this.$store.state.api + "selectSnameByCid", params)
+        .then((res) => {
+          this.classJuri = res.data[0];
+        })
+        .catch((err) => {
+          console.error(err);
+        });
+    },
     selectWorksStudent() {
       let params = {
         oid: this.oid,
@@ -8294,7 +8326,7 @@ export default {
                     ateacher: b[j].ateacher,
                     wid: b[j].id,
                     works: b[j].content,
-                    sName: b[j].userid,
+                    sName: b[j].name ? b[j].name : b[j].userid,
                     type: b[j].type == 1 ? 0 : b[j].type == 4 ? 1 : 3,
                     time: b[j].time,
                     score: b[j].score,
@@ -11272,6 +11304,7 @@ export default {
     this.getCourseDetail();
     this.selectCount();
     this.getHomeWork();
+    this.selectCStudent();
     if (this.tType == 4) {
       this.pzDialog = true;
       this.selectPz();