瀏覽代碼

Merge branch 'master' of 121.40.237.253:lijie/zhxy-desk

lijie 1 年之前
父節點
當前提交
067e72d307

+ 1 - 1
pages/studentRanked/components/mark-score-list.vue

@@ -13,7 +13,7 @@
                     <!-- <view>{{}}</view> -->
 
                     <text slot="label" class="txt-muted">{{item.created_at}} </text>
-                    <el-tag slot="value" plain :type="item.studentTab.type_text == '好评' ? '' : 'danger'">{{item.studentTab.tab_name}} {{item.score}}</el-tag>
+                    <el-tag slot="value" plain :type="item.studentTab && item.studentTab.type_text == '好评' ? '' : 'danger'">{{item.studentTab && item.studentTab.tab_name}} {{item.score}}</el-tag>
                     <!-- <u-badge slot="value" value="+1" plain size="mini" type="success"></u-badge> -->
                     <!-- <view class="" slot="right-icon">
                         <i class="el-icon-delete ui-ml30 " style="font-size: 20px;" @click="itemClick(item,index)"></i>

+ 53 - 41
pages/studentRanked/components/mark-score.vue

@@ -22,7 +22,7 @@
 				<view class="ui-flex-1"></view>
 			</view>
 			<view style="background: #0000003b;">
-				<u-tabs :list="courseList" :activeStyle="{
+				<u-tabs :list="viewCourseList" :activeStyle="{
                     color: '#fff',
                     fontWeight: 'bold',
                     transform: 'scale(1.2)'
@@ -36,14 +36,14 @@
 				<view class="ui-p">
                     <u-grid :col="6" :border="false" style="align-items: baseline;">
                     	<u-grid-item @click="toActive(index,item)" v-for="(item, index) in list" :key="index" class="ui-p"
-                            v-if="course_id ?  item.course_id == course_id : true"
+                            v-if="course_id ? item.course_id == course_id : (course_name ? item.course_name == course_name : true)"
                             :bgColor="activeId == index ? '#ffffff42' : '#0000'"
                     		:class="{
                                 'no-select' : activeId >= 0 && activeId != index,
                                 'item-active' : activeId == index
                             }">
                     		<u--image :src="item.img" width="46px" height="46px"></u--image>
-                    		<view class="ui-pt10">
+                    		<view class="ui-pt10 text-center">
                     			<text class="grid-text txt-white f28">{{item.tab_name}}</text>
                     		</view>
                     		<!-- <u-badge v-if="activeId == index" absolute :offset="[0,10]" :value="score"></u-badge> -->
@@ -71,9 +71,6 @@
     // 标签缓存
     let tabList = {};
     
-	import {
-		getStudentTabs
-	} from "@/common/api/studentTab.js"
 	export default {
 		props: {
 			stuList: {
@@ -94,6 +91,7 @@
 				score: 0, //加扣分分数
 				activeId: -1, //选中项
                 course_id : 0,
+                course_name : '',
 				itemTab: '',
 				courseList: [],
 			}
@@ -107,6 +105,35 @@
 				}
 			}
 		},
+        computed : {
+            viewCourseList(){
+                let custom = [];
+                this.list.forEach(item => {
+                    if(item.course_id == 0 && item.course_name){
+                        if(!custom.includes(item.course_name)){
+                            custom.push(item.course_name)
+                        }
+                    }
+                });
+                
+                console.log(custom)
+                
+                
+                return [
+                    {
+                        id : 0,
+                        name : '全部'
+                    },
+                    ...this.courseList,
+                    ...custom.map(item => {
+                        return {
+                            id : 0,
+                            name : item
+                        }
+                    })
+                ]
+            }
+        },
 		methods: {
 			change(e){
 				this.curIndex = e
@@ -114,7 +141,7 @@
 			},
             changeCourse(item){
                 this.course_id = item.id;
-                // this.getTipList();
+                this.course_name = item.name == '全部' ? '' : item.name;
             },
             getTipList() {
                 if(tabList[this.curIndex]){
@@ -134,45 +161,30 @@
                     }
                 })
             },
-			getStudentTabs() {
-				this.$api.sendRequest({
-					url: getStudentTabs,
-					method: "post",
-					data: {
-						type: this.type
-					},
-					success: res => {
-						console.log(res, "res");
-					}
-				})
-			},
+            getAllCourse(){
+                if(this.courseList.length){
+                    return;
+                }
+                this.$api.sendRequest({
+                	url: '/mobile/systemBaseData/getAllCourse',
+                	method: "post",
+                	success: res => {
+                		// console.log(res);
+                        this.courseList = res.data.map(item => {
+                            return {
+                                name : item.course_name,
+                                id : item.id
+                            }
+                        })
+                	}
+                })
+            },
 			// 外部访问使用
 			open(title) {
                 this.title = title;
 				this.show = true;
                 this.getTipList();
-                
-                if(this.courseList.length == 0){
-                    this.$api.sendRequest({
-                    	url: '/mobile/systemBaseData/getAllCourse',
-                    	method: "post",
-                    	success: res => {
-                    		console.log(res);
-                            this.courseList = [
-                                {
-                                    id : 0,
-                                    name : '全部'
-                                },
-                                ...res.data.map(item => {
-                                    return {
-                                        name : item.course_name,
-                                        id : item.id
-                                    }
-                                })
-                            ]
-                    	}
-                    })
-                }
+                this.getAllCourse();
 			},
 			toActive(index, item) {
 				// 是否旧的选中项

+ 21 - 4
pages/studentRanked/studentRanked.vue

@@ -6,7 +6,7 @@
             <view class="ui-p ui-flex-row">
                 <text class="f40">{{chooseClassName}}</text>
                 <view class="ui-flex-row">
-                    <text class="f40 ui-ml30 ui-mr10">李老师</text>
+                    <text class="f40 ui-ml30 ui-mr10">{{teacher.teacher_name}}</text>
                     <!-- <u-icon name="arrow-down-fill" color="#fff"></u-icon> -->
                 </view>
             </view>
@@ -16,8 +16,7 @@
                     <text class="f32" style="#9ccbff">请点击选择学生批量点评</text>
                 </view>
                 <view class="ui-flex" style="width: 250px;">
-                    <el-button @click="setMulti(false)" plain text="取消选择" style="background-color: #0d4980;"
-                        class="ui-mr10">取消选择</el-button>
+                    <el-button @click="setMulti(false)" plain text="取消选择" style="background-color: #0d4980;" class="ui-mr10">取消选择</el-button>
                     <el-badge :value="activeList.length">
                         <el-button type="primary" @click="commentMulti()">
                             批量点评
@@ -172,7 +171,25 @@
                     })
                 })
                 return list;
+            },
+            teacher(){
+                return this.$store.state.teacherInfo || {}
             }
+        },
+        onLoad(){
+            let teacher_id = this.teacher.id;
+            this.$api.sendRequest({
+                url: `/mobile/teacher/draw`,
+                method: "get",
+                data: {
+                    teacher_id: teacher_id,
+                    year : 2024
+                    
+                },
+                success: res => {
+                    
+                }
+            })
         },
 		created() {
             this.getClassroomList();
@@ -228,7 +245,7 @@
             //     this.getstudentTabLog()
             // },
             getClassroomList() {
-                let teacher_id = this.$store.state.teacherInfo.id
+                let teacher_id = this.teacher.id
                 this.$api.sendRequest({
                     url: `/mobile/teacher/teachClasses`,
                     method: "post",