Browse Source

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

lsc 1 year ago
parent
commit
101bfd2d4d

+ 92 - 5
src/components/pages/test/check/index.vue

@@ -68,6 +68,41 @@
               <span :class="{ active: stype == 3 }" @click="checkDataType(3)" v-show="false">按数量查看</span>
             </div>
             <div class="left">
+              <div style="margin-right: 10px;position: relative;" v-if="stype == 2 || stype == 3">
+                <el-select v-model="TeachingValue" @change="searchCourse" placeholder="按教研室">
+                  <el-option
+                    label="全部"
+                    value="">
+                  </el-option>
+                  <el-option
+                    v-for="item in TeachingOptions"
+                    :key="item.id"
+                    :label="item.name"
+                    :value="item.id">
+                  </el-option>
+                </el-select>
+              </div>
+              <div style="margin-right: 10px;position: relative;" v-if="stype == 2 || stype == 3">
+                <el-date-picker
+                  v-model="SubmitTime"
+                  type="date"
+                   @change="searchCourse"
+                  value-format="yyyy-MM-dd"
+                  placeholder="选择日期">
+                </el-date-picker>
+                <!-- <el-select v-model="SubmitTime" placeholder="按提交时间筛选">
+                  <el-option
+                    label="全部"
+                    value="">
+                  </el-option>
+                  <el-option
+                    v-for="item in SubmitTimeOptions"
+                    :key="item.id"
+                    :label="item.name"
+                    :value="item.id">
+                  </el-option>
+                </el-select> -->
+              </div>
               <div style="margin-right: 10px;position: relative;" v-if="stype == 2 || stype == 3">
                 <el-input v-model="courseName" class="student_input" placeholder="请输入需要搜索的姓名"></el-input>
                 <span class="serach_icon" @click="searchCourse"></span>
@@ -339,7 +374,7 @@
         </div>
       </div>
     </div>
-    <share-box :testJson="testJson" :dialogVisibleShare.sync="dialogVisibleShare"></share-box>
+    <share-box :testJson="testJson" :TeachingValue="TeachingValue" :TeachName="TeachNameCpt"   :dialogVisibleShare.sync="dialogVisibleShare"></share-box>
     <wpdf :dialogVisiblePdf.sync="dialogVisiblePdf" :url="wurl"></wpdf>
     <wVideo :dialogVisibleVideo.sync="dialogVisibleVideo" :url="wurl"></wVideo>
     <wOffice :dialogVisibleOffice.sync="dialogVisibleOffice" :url="wurl"></wOffice>
@@ -427,6 +462,10 @@ export default {
       cJson: [],
       loading: false,
       look: "",
+      TeachingOptions:[],
+      TeachingValue :'',
+      SubmitTimeOptions: [],
+      SubmitTime: '',
       tableHeight: 500,
       isLoading: false,
       pageSize: 10,
@@ -464,7 +503,21 @@ export default {
   },
   watch: {},
   computed: {
-
+    TeachNameCpt: function () {
+        // `this` 指向 vm 实例
+        return this.TeachingOptions.filter(i => {return i.id == this.TeachingValue})
+    },
+    // TeachNameCpt(){
+    //   return function (val) {
+    //     let a = this.TeachingOptions.filter(i => {
+    //       if (i.id == val) {
+    //          return i.name  
+    //       }}
+    //     )
+    //     console.log('aaaaaaaaaaaaaa',a);
+    //     return a;
+    //   };
+    // },
     // vcWords() {
     //   return function (array) {
     //     let _array = [];
@@ -525,6 +578,22 @@ export default {
 		}
   },
   methods: {
+    //获取教研室列表
+    getClass2() {
+      let params = {
+          oid: this.oid,
+      };
+      this.ajax
+          .get(this.$store.state.api + "selectTeacherOfficeBySchool", params)
+          .then((res) => {
+              this.TeachingOptions = res.data[0];
+              console.log('this.TeachingOptions',this.TeachingOptions);
+          })
+          .catch((err) => {
+              this.isLoading = false;
+              console.error(err);
+          });
+    },
     filterName(value, row, index) {
       let name = []
       for (var i = 0; i < row.array[index].json.answer2.length; i++) {
@@ -633,13 +702,28 @@ export default {
       this.isLoading = true;
       let params = {
         cid: this.cid,
-        cn: this.courseName
+        cn: this.courseName,
+        tim : !this.SubmitTime? '' : this.SubmitTime,
+        tea: this.TeachingValue
       };
       this.ajax
-        .get(this.$store.state.api + "getTestWorksNoPage", params)
+        .get(this.$store.state.api + "getTestWorksNoPageCopy", params)
         .then(async (res) => {
-          this.isLoading = false;
           this.testJson = res.data[0][0]
+          console.log('this.testJson',JSON.parse(JSON.stringify(this.testJson)));
+          if (this.testJson.juriP) {
+            let ajuri2 =  this.testJson.juri2.split (',');
+            let ajurip =  this.testJson.juriP.split (',');
+            let JData = ajuri2.reverse()
+            this.TeachingOptions = JData.map((key, index) => ({
+              id : key,
+              name: ajurip[index]
+            }));
+          }else{
+            this.getClass2()
+          }
+          // console.log('dddd',this.TeachingOptions);
+
           this.works = res.data[1]
           this.iscount = res.data[2][0].count
           this.pcount = res.data[3][0].count
@@ -778,6 +862,8 @@ export default {
           }
           this.testArray = testArray
           this.worksArray = array
+          this.isLoading = false;
+          
         })
         .catch((err) => {
           console.error(err);
@@ -1533,6 +1619,7 @@ export default {
     document.getElementsByTagName('html')[0].style.overflow = 'hidden'
     this.$nextTick(function () {
       this.getData();
+      // this.getClass2()
       this.changeHeight()
     });
   },

+ 20 - 2
src/components/pages/test/shareBox/index.vue

@@ -8,8 +8,9 @@
                     <span>{{ testJson.title }}</span>
                 </div>
                 <div class="info" >
+                    <!-- {{ reversedMessage }} -->
                     <span>表单范围:</span>
-                    <span>{{ testJson.juriP ? testJson.juriP : '所有人' }}</span>
+                    <span>{{ reversedMessage }}</span>
                 </div>
                 <div class="info" v-if="testJson && testJson.overtime">
                     <span>截止时间:</span>
@@ -72,6 +73,12 @@ export default {
         testJson: {
             type: Object
         },
+        TeachingValue: {
+            type: String
+        },
+        TeachName: {
+            type: Array
+        }
     },
     data() {
         return {
@@ -83,6 +90,15 @@ export default {
             isSuo: true
         };
     },
+    computed: {
+        reversedMessage() {
+            if (this.TeachingValue == '') {
+                return this.testJson.juriP ? this.testJson.juriP : '所有人'
+            }else{
+                return this.TeachName[0].name
+            }
+        }
+    },
     methods: {
         handleClose(done) {
             this.close();
@@ -150,10 +166,12 @@ export default {
             // }
             let params = {
                 id: this.testJson.courseId,
+                tea: this.TeachingValue
             };
             this.ajax
-                .get(this.$store.state.api + "getTestWorkShare", params)
+                .get(this.$store.state.api + "getTestWorkShareCopy", params)
                 .then((res) => {
+                    console.log('res.datares.datares.datares.datares.datares.data',res.data);
                     let parray = res.data[0]
                     let is = res.data[1]
                     this.noCount = parray.length - is.length