lansir преди 1 година
родител
ревизия
627a9fb957
променени са 3 файла, в които са добавени 596 реда и са изтрити 538 реда
  1. 28 17
      pages/studentRanked/components/mark-score.vue
  2. 166 59
      pages/studentRanked/studentRanked.vue
  3. 402 462
      pages/studentRanked/studentRankedChange.vue

+ 28 - 17
pages/studentRanked/components/mark-score.vue

@@ -33,24 +33,31 @@
 			</view>
 
 			<scroll-view scroll-y style="height: 400px;" show-scrollbar>
-				<u-grid :col="6" :border="false">
-					<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"
-						:class="{'no-select' : activeId >= 0 && activeId != index}">
-						<u--image :src="item.img" width="46px" height="46px"></u--image>
-						<view class="ui-pt10">
-							<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>
-					</u-grid-item>
-				</u-grid>
+				<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"
+                            :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">
+                    			<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> -->
+                    	</u-grid-item>
+                    </u-grid>
+                </view>
 			</scroll-view>
 
-			<view class="ui-p ui-flex" style="background-color: #1b63a870;justify-content: end;">
+			<view class="ui-p ui-flex ui-flex-center" style="background-color: #1b63a870;">
 				<view class="ui-flex" style="width: 250px;">
-					<u-button size="small" plain :text="score ? '取消选择' : '关闭点评'" @click="cancelAct"
-						style="background-color: #0d4980;" class="ui-mr10"></u-button>
-					<u-button size="small" :disabled="!score" type="primary" @click="submit" text="提交点评"></u-button>
+					<!-- <u-button size="small" plain :text="score ? '取消选择' : '关闭点评'" @click="cancelAct"
+						style="background-color: #0d4980;" class="ui-mr10"></u-button> -->
+					<u-button size="small" :disabled="!score" type="primary" @click="submit(1)" text="提交点评 +1"></u-button>
+					<u-button class="ui-ml10" size="small" :disabled="!score" type="primary" @click="submit(3)" text="提交点评 +3"></u-button>
 				</view>
 			</view>
 		</view>
@@ -187,7 +194,8 @@
 					this.$emit('close', false)
 				}
 			},
-			submit() {
+			submit(scoreValue) {    //修改成固定给分值
+                this.score = scoreValue;
 				let obj = {
 					teacher_id: this.$store.state.teacher_id,
 					stu_school_ids: this.stuList,
@@ -236,7 +244,10 @@
 	/deep/ .el-dialog__body {
 		padding: 0;
 	}
-
+    .item-active{
+        background-color: #ffffff42;
+        border-radius: 10px;
+    }
 	.no-select {
 		opacity: .5;
 	}

+ 166 - 59
pages/studentRanked/studentRanked.vue

@@ -1,6 +1,7 @@
 <template>
     <view class="page">
-        <view class="txt-white ui-flex-row ui-flex-align-center" style="border-bottom: 4px solid #4472C4;padding-left: 40rpx;height: 54px;position: fixed;top:0;width: 750rpx;z-index: 10;backdrop-filter: blur(4px);"
+        <view class="txt-white ui-flex-row ui-flex-align-center"
+            style="border-bottom: 4px solid #4472C4;padding-left: 40rpx;height: 54px;position: fixed;top:0;width: 750rpx;z-index: 10;backdrop-filter: blur(4px);"
             :style="{'background-color': multiSelect ? '#4472c4' : ''}">
             <view class="ui-p ui-flex-row">
                 <text class="f40">{{chooseClassName}}</text>
@@ -15,7 +16,7 @@
                     <text class="f32" style="#9ccbff">请点击选则学生批量点评</text>
                 </view>
                 <view class="ui-flex" style="width: 250px;">
-                    <el-button @click="setMulti" plain text="取消选择" style="background-color: #0d4980;"
+                    <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()">
@@ -30,18 +31,23 @@
             <view class="platform-text txt-white">讲台</view>
             <view class="ranked-radio"></view>
         </view> -->
-
-        <view class="ui-flex-row ui-flex-space-around" style="padding:140rpx 0 200rpx 0;">
-            <view v-for="(column, index) in list" :key="index" v-if="index%2 == 0" class="ui-flex-row">
-                <view v-for="index2 in 2" class="ui-flex-column" :class="{
-                        'ui-mr10' : index2 == 1,
-                        'ui-ml10' : index2 == 2
+        <Draggable class="ui-flex-row ui-flex-space-around" :disabled="!seatMove" forceFallback style="padding:140rpx 0 200rpx 0;" group="ii"
+            @end="onMoveColumnEnd" @choose="activeList = []" v-model="list" :delay="500" animation="300">
+            <view v-for="(column, index) in list" :key="index" class="ui-flex-column" :class="{
+                        'ui-mrr' : !!(index%2),
+                        'ui-mll' : !(index%2)
                     }">
-                    <view @click="Comment(stuItem)" v-for="stuItem in list[index2+index-1].nodes" :key="stuItem.id"
-                        class="ui-flex-column ranked-item-tr ui-flex-align-center"
+                <!-- <view class="ui-flex-column" :class="{
+                        'ui-mr10' : !!index%1,
+                        'ui-ml10' : !!index%2
+                    }"> -->
+                    <view @click="toClickStu(stuItem)" v-for="stuItem in column.nodes" :key="stuItem.id"
+                        v-if="stuItem.id" class="ui-flex-column ranked-item-tr ui-flex-align-center"
                         :class="{active : activeList.includes(stuItem.id)}">
-                        <image :src="getLevelIcon(stuItem)" mode="widthFix" style="width: 130rpx;height: 48rpx;"></image>
-                        <image style="width: 100rpx;height: 100rpx;margin-top: -20rpx;" :src="stuItem.student_cartoon_photo" mode=""></image>
+                        <image :src="getLevelIcon(stuItem)" mode="widthFix" style="width: 130rpx;height: 48rpx;">
+                        </image>
+                        <image style="width: 100rpx;height: 100rpx;margin-top: -20rpx;"
+                            :src="stuItem.student_cartoon_photo" mode=""></image>
                         <view class="stu-tag text-center ui-flex-row ui-mt10">
                             <view class="stu-tag-add ui-flex-1">{{stuItem.plus_score_total}}</view>
                             <view class="stu-tag-sub ui-flex-1">{{stuItem.minus_score_total}}</view>
@@ -52,18 +58,9 @@
                         <u-badge absolute style="left: 10px;top: 10px;"
                             :value="activeList.indexOf(stuItem.id) + 1"></u-badge>
                     </view>
-                </view>
+                <!-- </view> -->
             </view>
-        </view>
-
-        <!-- 切换班级 -->
-        <!-- <u-picker :show="show_classes" @confirm="doChooseClass" :columns="classesList" keyName="class_name"
-			@cancel="show_classes=false"></u-picker> -->
-            <!-- <u-grid :border="false" >
-                <u-grid-item v-for="(item,baseListIndex) in classesList" :key="item.id">
-                    <text class="grid-text">{{item.class_name}}</text>
-                </u-grid-item>
-            </u-grid> -->
+        </Draggable>
 
         <!-- 点评 -->
         <markScore @change='change' @close='onScoreClose' :stuList='activeList' ref="markScore"></markScore>
@@ -71,20 +68,30 @@
         <!-- 点评记录 -->
         <!--  :stuList="activeList" -->
         <markScoreList ref="markScoreList" :chooseClassId="chooseClassId"></markScoreList>
-        
+
         <!-- 随机点名 -->
         <randomRollCall ref="randomRollCall" :list="studentList" @comment="randomRollComment"></randomRollCall>
 
         <!-- 计时器 -->
         <timerClock ref="timerClock"></timerClock>
-        
+
         <!-- 排行榜 -->
         <rankList ref="rankList" :chooseClassId="chooseClassId"></rankList>
+        
+        <view v-if="seatMove" class="ui-pull-bottom ui-p" style="background-color: #0000006b;backdrop-filter: blur(4px);border-top: 1px solid #616161;">
+            <view class="ui-flex-row ui-flex-center txt-white ui-mt10 ui-mb30">
+                长按拖动调整整列,单选2位学生互相交换
+            </view>
+            <view class="ui-flex-row ui-flex-center">
+                <el-button round type="primary" @click="updateStuChange">保存座位</el-button>
+                <el-button round type="text" @click="setSeatMove(false)">取消</el-button>
+            </view>
+        </view>
 
-        <view class="ui-pull-bottom ui-flex-row ui-p"
+        <view v-else class="ui-pull-bottom ui-flex-row ui-p"
             style="background-color: #0000006b;backdrop-filter: blur(4px);border-top: 1px solid #616161;">
             <view class="ui-flex-1 ui-flex-row">
-                <!--   -->
+                
                 <el-dropdown trigger="click" @command="doChooseClass">
                     <view-btn-item title="选择班级" src="../../static/jyicon/shubao.png"></view-btn-item>
                     <el-dropdown-menu slot="dropdown">
@@ -94,19 +101,25 @@
                         </el-dropdown-item>
                     </el-dropdown-menu>
                 </el-dropdown>
-                
-                <view-btn-item title="点评记录" src="../../static/jyicon/kedan.png" @click="$refs.markScoreList.open()"></view-btn-item>
-                <view-btn-item title="座位调整" src="../../static/jyicon/xuewei.png" @click="$pageTo('./studentRankedChange')"></view-btn-item>
-                <view-btn-item :title="multiSelect ? '取消多选' : '学生多选'" src="../../static/jyicon/gerenzhongxin.png" @click="setMulti"></view-btn-item>
-                <view-btn-item title="随机点名" src="../../static/jyicon/fangfa.png" @click="$refs.randomRollCall.open()"></view-btn-item>
-                <view-btn-item title="计时器" src="../../static/jyicon/shalou.png" @click="$refs.timerClock.open()"></view-btn-item>
+
+                <view-btn-item title="点评记录" src="../../static/jyicon/kedan.png"
+                    @click="$refs.markScoreList.open()"></view-btn-item>
+                <view-btn-item title="座位调整" src="../../static/jyicon/xuewei.png"
+                    @click="setSeatMove(true)"></view-btn-item>
+                <view-btn-item :title="multiSelect ? '取消多选' : '学生多选'" src="../../static/jyicon/gerenzhongxin.png"
+                    @click="setMulti(!multiSelect)"></view-btn-item>
+                <view-btn-item title="随机点名" src="../../static/jyicon/fangfa.png"
+                    @click="$refs.randomRollCall.open()"></view-btn-item>
+                <view-btn-item title="计时器" src="../../static/jyicon/shalou.png"
+                    @click="$refs.timerClock.open()"></view-btn-item>
                 <view-btn-item title="撤销点评" src="../../static/jyicon/dingyue.png"
                     :class="[lastTipBatchId ? 'bottom-btn-item' : 'bottom-btn-item-disabled']"
                     @click="repealScore()"></view-btn-item>
             </view>
 
             <view class="ui-flex-row">
-                <view-btn-item title="排行榜" src="../../static/jyicon/jiangpai.png" @click="$refs.rankList.open()"></view-btn-item>
+                <view-btn-item title="排行榜" src="../../static/jyicon/jiangpai.png"
+                    @click="$refs.rankList.open()"></view-btn-item>
                 <!-- <view-btn-item title="切换老师" src="../../static/jyicon/jiangpai.png" @click="debug"></view-btn-item> -->
                 <view-btn-item title="退出登录" src="../../static/jyicon/xiaoxi.png" @click="loginOut()"></view-btn-item>
             </view>
@@ -115,6 +128,7 @@
 </template>
 
 <script>
+    import Draggable from "@/components/vuedraggable/src/vuedraggable.js";
     import markScore from './components/mark-score.vue'
     import markScoreList from './components/mark-score-list.vue'
     import randomRollCall from './components/random-roll-call.vue'
@@ -132,6 +146,7 @@
             timerClock,
             rankList,
             viewBtnItem,
+            Draggable,
         },
         data() {
             return {
@@ -143,11 +158,12 @@
                 chooseClassId: '',
                 activeList: [],
                 multiSelect: false,
-                lastTipBatchId : '' // 最后点评的uuid,用于撤销
+                lastTipBatchId: '', // 最后点评的uuid,用于撤销,
+                seatMove: false, //0不调整
             }
         },
-        computed : {
-            studentList(){
+        computed: {
+            studentList() {
                 let list = [];
                 this.list.forEach(item => {
                     item.nodes.forEach(el => {
@@ -164,21 +180,26 @@
             this.getClassroomList();
         },
         methods: {
-            debug(){
+            debug() {
                 console.log(this)
             },
-            getLevelIcon(item){
-                let val = ~~((item.score_total)/10);
+            studentRankedChange() {
+                uni.navigateTo({
+                    url: './studentRankedChange'
+                })
+            },
+            getLevelIcon(item) {
+                let val = ~~((item.score_total) / 10);
                 val = (val <= 0 ? 1 : val);
                 val = (val >= 16 ? 16 : val);
-                return '../../static/level_icon/'+ val +'.png';
+                return '../../static/level_icon/' + val + '.png';
             },
             // change(e) {
             //     this.type = e == 0 ? 1 : 2
             //     this.getTabs()
             // },
-            setMulti() {
-                this.multiSelect = !this.multiSelect;
+            setMulti(value) {
+                this.multiSelect = value;
                 this.activeList = [];
             },
             loginOut() {
@@ -227,8 +248,8 @@
                 })
             },
             // 随机点名后批量评价
-            randomRollComment(checkList){
-                if(checkList.length){
+            randomRollComment(checkList) {
+                if (checkList.length) {
                     this.activeList = checkList.map(item => {
                         return item.id
                     });
@@ -242,12 +263,82 @@
                     return this.studentList.find(el => {
                         return el.id == stuId;
                     }).title;
-                }).join( );
-                
+                }).join();
+
                 // this.getTabs()
                 this.$refs.markScore.open(title);
             },
-            Comment(item) {
+            setSeatMove(value) {
+                if(value){
+                    this.setMulti(false);
+                    this.listCopy = uni.$u.deepClone(this.list); 
+                }else{
+                    this.list = uni.$u.deepClone(this.listCopy); 
+                }
+                this.seatMove = value;
+                this.activeList = [];
+            },
+            // 两个学生交换位置
+            onMoveStuChange(id1, id2){
+                this.list.forEach(item => {
+                    item.nodes.forEach((el, index) => {
+                        if(el == this.onMoveStuChange._move1){
+                            // console.log(1,el);
+                            this.$set(item.nodes, index, uni.$u.deepClone(this.onMoveStuChange._move2));
+                        }
+                        if(el == this.onMoveStuChange._move2){
+                            this.$set(item.nodes, index, uni.$u.deepClone(this.onMoveStuChange._move1));
+                        }
+                    })
+                })
+                this.activeList = [];
+            },
+            onMoveColumnEnd(list){  //自动处理,无需改变
+                // console.log(list);
+            },
+            // 更新座位
+            updateStuChange(){
+                let seat_list = this.list.map(item => {
+                    return {
+                        id : item.id,
+                        title : item.title,
+                        nodes : item.nodes.map(el => {
+                            return {
+                                id : el.id,
+                                key : el.key,
+                                title : el.title
+                            }
+                        })
+                    }
+                })
+                // console.log(data);
+                this.$api.sendRequest({
+                    url: `/mobile/saveSeat`,
+                    method: "PUT",
+                    data: {
+                        classroom_id : this.chooseClassId,
+                        seat_list : seat_list
+                    },
+                    success: res => {
+                        uni.showToast({
+                            title: res.msg,
+                        })
+                    }
+                })
+            },
+            // 点击学生
+            toClickStu(item) {
+                if (this.seatMove) { //单个换位置
+                    if (this.activeList.length == 0) {
+                        this.activeList.push(item.id);
+                        this.onMoveStuChange._move1 = item;
+                    } else {
+                        this.onMoveStuChange._move2 = item;
+                        this.onMoveStuChange(this.activeList[0], item.id);
+                    }
+                    return;
+                }
+
                 if (this.multiSelect) {
                     let index = this.activeList.indexOf(item.id)
                     if (index >= 0) {
@@ -257,7 +348,7 @@
                     }
                     return;
                 }
-                
+
                 this.activeList = [item.id];
                 this.commentMulti();
             },
@@ -269,12 +360,13 @@
                         class_id: this.chooseClassId
                     },
                     success: res => {
-                        this.list = res.data.reverse().map(item => {
-                            item.nodes = item.nodes.reverse().filter(el => {
-                                return !!el.id;
-                            })
-                            return item;
-                        })
+                        this.list = res.data;
+                        /* .reverse().map(item => {
+                                                    item.nodes = item.nodes.reverse().filter(el => {
+                                                        return !!el.id;
+                                                    })
+                                                    return item;
+                                                }) */
                     }
                 })
             },
@@ -292,7 +384,7 @@
             //     })
             // },
             onScoreClose(lastTipBatchId = false) {
-                if(lastTipBatchId){
+                if (lastTipBatchId) {
                     this.activeList = []
                     this.multiSelect = false
                     this.getStudent();
@@ -300,12 +392,12 @@
                 }
                 // this.getstudentTabLog()
             },
-            repealScore(){
+            repealScore() {
                 this.$api.sendRequest({
                     url: `/mobile/studentTab/multiDelStudentTabLog`,
                     method: "post",
                     data: {
-                        batch_id : this.lastTipBatchId
+                        batch_id: this.lastTipBatchId
                     },
                     success: res => {
                         this.lastTipBatchId = null;
@@ -441,6 +533,21 @@
         border: 1px solid #fff;
         border-left: 0;
     }
-
     
+    .ui-mrr{
+        margin-right: 50rpx;
+    }
+    .ui-mll{
+        margin-left: 50rpx;
+    }
+    .sortable-chosen{
+        background-color: #fbfbfb66;
+        border-radius: 5px;
+        
+    }
+    .sortable-ghost{
+        // margin-left : 0 !important;
+        // margin-right : 0 !important;
+        background-color: #fbfbfb00;
+    }
 </style>

+ 402 - 462
pages/studentRanked/studentRankedChange.vue

@@ -1,472 +1,412 @@
 <template>
 
-	<view class="">
-		<view style="margin-bottom: 32rpx;" class="">
-			<topBtn :list="btnList" :active.sync='reActive' />
-		</view>
-		<view v-if="reActive == 1" @click="openPop"
-			style="box-sizing: border-box;padding: 0 32rpx;margin-bottom: 32rpx;" class="btn-roll">
-			排位调整
-		</view>
-
-		<view class="" v-if="reActive == 0" @click="show_classes=true" style="width: auto;">
-			<view class="ui-p">
-				<view class="visit-item">
-					<view class="visit-item-left">
-						选择班级
-					</view>
-					<view  class="btn-roll ui-plr" style="width: auto;" v-if="chooseClassName">
-						{{ chooseClassName }}
-					</view>
-				</view>
-			</view>
-			
-		</view>
-		<view class="" v-if="reActive==0">
-			<view class="ranked" v-if="chooseClassName">
-				<view v-for="(item,index) in list" :key="index" class="ranked-item">
-					<view @click="reActive == 1 ?itemClick(item1):Comment(item1)" v-for="(item1,index1) in item.nodes"
-						:key="item1.id" class="ranked-item-tr">
-						<!-- <image style="width: 90rpx;height: 90rpx;" src="@/static/image/female.png" mode=""></image> -->
-						<view :class="active.indexOf(item1.id) == -1 ? '' :'active'" style="width: 90%;text-align: center;background-color: #fff;
+    <view class="">
+        <view v-if="reActive == 1" @click="openPop"
+            style="box-sizing: border-box;padding: 0 32rpx;margin-bottom: 32rpx;" class="btn-roll">
+            排位调整
+        </view>
+
+        
+        <view class="">
+            <view class="ranked">
+                <view v-for="(item,index) in selfClassList" :key="index" class="ranked-item">
+                    <view @click="reActive == 1 ?itemClick(item1):Comment(item1)" v-for="(item1,index1) in item.nodes"
+                        :key="item1.key" class="ranked-item-tr">
+                        <!-- <image style="width: 90rpx;height: 90rpx;" src="@/static/image/female.png" mode=""></image> -->
+                        <view :class="active.indexOf(item1.key) == -1 ? '' :'active'" style="width: 90%;text-align: center;background-color: #fff;
 					border-radius: 5px;">
-							{{item1.title}}
-						</view>
-					</view>
-				</view>
-			</view>
-			<view class="platform" v-if="chooseClassName">
-				<view class="ranked-radio">
-
-				</view>
-				<view class="platform-text">
-					讲台
-				</view>
-				<view class="platform-color">
-
-				</view>
-			</view>
-		</view>
-		<view class="" v-else>
-			<view class="ranked" >
-				<view v-for="(item,index) in selfClassList" :key="index" class="ranked-item">
-					<view @click="reActive == 1 ?itemClick(item1):Comment(item1)" v-for="(item1,index1) in item.nodes"
-						:key="item1.id" class="ranked-item-tr">
-						<!-- <image style="width: 90rpx;height: 90rpx;" src="@/static/image/female.png" mode=""></image> -->
-						<view :class="active.indexOf(item1.id) == -1 ? '' :'active'" style="width: 90%;text-align: center;background-color: #fff;
-					border-radius: 5px;">
-							{{item1.title}}
-						</view>
-					</view>
-				</view>
-			</view>
-			<view class="platform" >
-				<view class="ranked-radio">
-			
-				</view>
-				<view class="platform-text">
-					讲台
-				</view>
-				<view class="platform-color">
-			
-				</view>
-			</view>
-		</view>
-
-		<uni-popup ref="popup" background-color="transparent">
-			<view style="padding: 0;" class="popup-content"
-				:class="{ 'popup-height': type === 'left' || type === 'right' }">
-				<StuDraggable @change='change' :list.sync='selfClassList' />
-			</view>
-		</uni-popup>
-		<uni-popup @change="popChange" ref="CommentPopup" background-color="transparent">
-			<view style="padding: 32rpx;width: 700rpx;" class="popup-content"
-				:class="{ 'popup-height': type === 'left' || type === 'right' }">
-				<view class="pop-title">
-					<image style="width: 40rpx;height: 40rpx;margin-right: 10rpx;" src="@/static/image/icon.png"
-						mode=""></image> {{info.title}}
-				</view>
-
-				<view style="margin-top: 32rpx;" class="">
-					<Tag @click='CommentOn' :list='tagList' />
-				</view>
-			</view>
-		</uni-popup>
-		<u-picker :show="show_classes" @confirm="doChooseClass" :columns="teachList" keyName="class_name" @cancel="show_classes=false"></u-picker>
-		<view class="">
-			<view @click="loginOut()" class="form-btn-content">
-				退出登录
-			</view>
-		</view>
-	</view>
+                            {{item1.title}} {{item1.key}}
+                        </view>
+                    </view>
+                </view>
+            </view>
+        </view>
+
+        <uni-popup ref="popup" background-color="transparent">
+            <view style="padding: 0;" class="popup-content"
+                :class="{ 'popup-height': type === 'left' || type === 'right' }">
+                <StuDraggable @change='change' :list.sync='selfClassList' />
+            </view>
+        </uni-popup>
+        
+    </view>
 </template>
 
 <script>
-	import topBtn from '@/components/topBtn.vue'
-	import StuDraggable from './stuDraggable.vue'
-	import Tag from './tag.vue'
-	import { getStuSchoolIdByStuClassId } from "@/common/api/stu.js"
-	export default {
-		components: {
-			topBtn,
-			StuDraggable,
-			Tag
-		},
-		data() {
-			return {
-				show_classes : false,
-				id: 1,
-				info: {},
-				type: 'center',
-				btnList: ['学生评分', '坐位调整'],
-				reActive: 0,
-				active: [],
-				activeList: [],
-				tagList: [],
-				list: [],
-				teachList :[],
-				chooseClassName : '',
-				chooseClassId : '',
-				selfClassList : [],
-				notSelfClass : true,
-			}
-		},
-		mounted() {
-			// this.id = this.$route.query.id
-			this.id=this.$store.state.teacherInfo.selfclass.id
-			
-			// this.getStudent()
-			this.getClassroomList()
-		},
-		methods: {
-			loginOut(){
-				uni.setStorageSync("token",'')
-				uni.navigateTo({
-					url: "/pages/login/login"
-				})
-			},
-			doChooseClass(val){
-				console.log(val,"val");
-				this.chooseClassId=val.value[0].id
-				this.chooseClassName=val.value[0].class_name
-				this.getStudent()
-				this.show_classes=false
-			},
-			getClassroomList(){
-				let teacher_id=this.$store.state.teacherInfo.id
-				this.$api.sendRequest({
-					url: `/mobile/teacher/teachClasses`,
-					method: "post",
-					data: {
-						teacher_id : teacher_id
-					},
-					success: res => {
-						this.teachList.push(res.data)
-						console.log(this.teachList);
-					}
-				})
-				
-			},
-			itemClick(item) {
-				let val = this.active.indexOf(item.id)
-				if (val == -1) {
-					this.active.push(item.id)
-					this.activeList.push(item)
-				} else {
-					this.active.splice(val, 1)
-					this.activeList.splice(val, 1)
-				}
-				if (this.active.length == 2) {
-
-					this.selfClassList.forEach((item2, index2) => {
-						item2.nodes.forEach((item1, index1) => {
-							let indexVal = this.active.indexOf(item1.id)
-							if (indexVal != -1) {
-
-								this.activeList.forEach(item3 => {
-									if (item3.id != item1.id) {
-										item2.nodes.splice(index1, 1, item3)
-									}
-								})
-
-							}
-						})
-					})
-					this.activeList = []
-					this.active = []
-					let info = {
-						classroom_id: this.id,
-						seat_list: this.selfClassList
-					}
-					this.$api.sendRequest({
-						url: `/mobile/saveSeat`,
-						method: "PUT",
-						data: info,
-						success: res => {
-							uni.showToast({
-								title: res.msg,
-
-							})
-
-						}
-					})
-				}
-			},
-			openPop() {
-				if(!this.notSelfClass){
-					this.type = 'center'
-					this.$refs.popup.open('center')
-				}
-			},
-			Comment(item) {
-				console.log(item,"sgism");
-				//item的id是studentClass的id,需要转换成stu_school_id传到
-				
-				this.$api.sendRequest({
-					url: getStuSchoolIdByStuClassId,
-					data : {
-						stu_class_id : item.id
-					},
-					success: res => {
-						console.log(res,"resrrrrr");
-						
-						
-						let stu_school_id=res.data.stu_school_id
-						uni.navigateTo({
-							url: "/pages/studentTab/studentTab?stu_school_id="+stu_school_id
-						})
-					}
-				})
-			},
-			popChange(val) {
-				if (!val.show) {
-					this.tagList.forEach(item => {
-						item.show = false
-					})
-				}
-			},
-			getStudent() {
-				this.$api.sendRequest({
-					url: `/mobile/getSeat?classroom_id=${this.chooseClassId}`,
-					success: res => {
-						this.list = res.data
-
-					}
-				})
-			},
-			change(list) {
-				console.log("组件传的数据",list);
-				this.selfClassList = list
-				let info = {
-					classroom_id: this.id,
-					seat_list: this.selfClassList
-				}
-				this.$api.sendRequest({
-					url: `/mobile/saveSeat`,
-					method: "PUT",
-					data: info,
-					success: res => {
-						uni.showToast({
-							title: res.msg,
-						})
-					}
-				})
-			},
-			getTagList() {
-				this.$api.sendRequest({
-					url: `/mobile/student/tabs?id=${this.info.id}`,
-					success: res => {
-						res.data.forEach(item => {
-							item.show = false
-						})
-						this.tagList = res.data
-					}
-				})
-			},
-			CommentOn(item, score) {
-
-				let info = {
-					id: this.info.id,
-					tab_id: item.tab_id,
-					score: score
-				}
-				this.$api.sendRequest({
-					url: `/mobile/student/eval`,
-					data: info,
-					success: res => {
-						uni.showToast({
-							title: `${this.info.title} ${item.tab_name} ${item.type == 1 ? '+':'-'} ${score}分`,
-							icon: 'none'
-						})
-
-						this.$refs.CommentPopup.close()
-					}
-				})
-			}
-
-		},
-		watch: {
-			reActive(newVal) {
-				this.active = []
-				this.activeList = []
-				console.log(newVal);
-				if(newVal==1){
-					console.log(this.$store.state.teacherInfo.selfclass,"this.$store.state.teacherInfo.selfclass");
-					if(this.$store.state.teacherInfo.selfclass){
-						let classroom_id=this.$store.state.teacherInfo.selfclass.id
-						// let classroom_id=1
-						this.$api.sendRequest({
-							url: `/mobile/getSeat?classroom_id=${classroom_id}`,
-							success: res => {
-								console.log(res.data);
-								this.selfClassList = res.data
-								this.notSelfClass=false
-							}
-						})
-					}else{
-						this.selfClassList=[]
-						uni.showToast({
-							icon: "none",
-							title: "您不是班主任"
-						})
-					}
-				}
-			}
-		},
-
-	}
+    import topBtn from '@/components/topBtn.vue'
+    import StuDraggable from './stuDraggable.vue'
+    import Tag from './tag.vue'
+    import {
+        getStuSchoolIdByStuClassId
+    } from "@/common/api/stu.js"
+    export default {
+        components: {
+            topBtn,
+            StuDraggable,
+            Tag
+        },
+        data() {
+            return {
+                show_classes: false,
+                id: 1,
+                info: {},
+                type: 'center',
+                btnList: ['学生评分', '坐位调整'],
+                reActive: 0,
+                active: [],
+                activeList: [],
+                tagList: [],
+                list: [],
+                teachList: [],
+                chooseClassName: '',
+                chooseClassId: '',
+                selfClassList: [],
+                notSelfClass: true,
+            }
+        },
+        mounted() {
+            this.id = this.$store.state.teacherInfo.selfclass.id
+
+            this.getClassroomList();
+            this.reActive = 1;
+        },
+        methods: {
+            loginOut() {
+                uni.setStorageSync("token", '')
+                uni.navigateTo({
+                    url: "/pages/login/login"
+                })
+            },
+            doChooseClass(val) {
+                console.log(val, "val");
+                this.chooseClassId = val.value[0].id
+                this.chooseClassName = val.value[0].class_name
+                this.getStudent()
+                this.show_classes = false
+            },
+            getClassroomList() {
+                let teacher_id = this.$store.state.teacherInfo.id
+                this.$api.sendRequest({
+                    url: `/mobile/teacher/teachClasses`,
+                    method: "post",
+                    data: {
+                        teacher_id: teacher_id
+                    },
+                    success: res => {
+                        this.teachList.push(res.data)
+                        console.log(this.teachList);
+                    }
+                })
+
+            },
+            itemClick(item) {
+                let val = this.active.indexOf(item.key)
+                if (val == -1) {
+                    this.active.push(item.key)
+                    this.activeList.push(item)
+                } else {
+                    this.active.splice(val, 1)
+                    this.activeList.splice(val, 1)
+                }
+                if (this.active.length == 2) {
+
+                    this.selfClassList.forEach((item2, index2) => {
+                        item2.nodes.forEach((item1, index1) => {
+                            let indexVal = this.active.indexOf(item1.key)
+                            if (indexVal != -1) {
+
+                                this.activeList.forEach(item3 => {
+                                    if (item3.key != item1.key) {
+                                        item2.nodes.splice(index1, 1, item3)
+                                    }
+                                })
+
+                            }
+                        })
+                    })
+                    this.activeList = []
+                    this.active = []
+                    let info = {
+                        classroom_id: this.id,
+                        seat_list: this.selfClassList
+                    }
+                    // return console.log(info);
+                    this.$api.sendRequest({
+                        url: `/mobile/saveSeat`,
+                        method: "PUT",
+                        data: info,
+                        success: res => {
+                            uni.showToast({
+                                title: res.msg,
+
+                            })
+
+                        }
+                    })
+                }
+            },
+            openPop() {
+                if (!this.notSelfClass) {
+                    this.type = 'center'
+                    this.$refs.popup.open('center')
+                }
+            },
+            Comment(item) {
+                console.log(item, "sgism");
+                //item的id是studentClass的id,需要转换成stu_school_id传到
+
+                this.$api.sendRequest({
+                    url: getStuSchoolIdByStuClassId,
+                    data: {
+                        stu_class_id: item.id
+                    },
+                    success: res => {
+                        console.log(res, "resrrrrr");
+
+
+                        let stu_school_id = res.data.stu_school_id
+                        uni.navigateTo({
+                            url: "/pages/studentTab/studentTab?stu_school_id=" + stu_school_id
+                        })
+                    }
+                })
+            },
+            popChange(val) {
+                if (!val.show) {
+                    this.tagList.forEach(item => {
+                        item.show = false
+                    })
+                }
+            },
+            getStudent() {
+                this.$api.sendRequest({
+                    url: `/mobile/getSeat?classroom_id=${this.chooseClassId}`,
+                    success: res => {
+                        this.list = res.data
+
+                    }
+                })
+            },
+            change(list) {
+                console.log("组件传的数据", list);
+                this.selfClassList = list
+                let info = {
+                    classroom_id: this.id,
+                    seat_list: this.selfClassList
+                }
+                // return console.log(info);
+                this.$api.sendRequest({
+                    url: `/mobile/saveSeat`,
+                    method: "PUT",
+                    data: info,
+                    success: res => {
+                        uni.showToast({
+                            title: res.msg,
+                        })
+                    }
+                })
+            },
+            getTagList() {
+                this.$api.sendRequest({
+                    url: `/mobile/student/tabs?id=${this.info.id}`,
+                    success: res => {
+                        res.data.forEach(item => {
+                            item.show = false
+                        })
+                        this.tagList = res.data
+                    }
+                })
+            },
+            CommentOn(item, score) {
+
+                let info = {
+                    id: this.info.id,
+                    tab_id: item.tab_id,
+                    score: score
+                }
+                this.$api.sendRequest({
+                    url: `/mobile/student/eval`,
+                    data: info,
+                    success: res => {
+                        uni.showToast({
+                            title: `${this.info.title} ${item.tab_name} ${item.type == 1 ? '+':'-'} ${score}分`,
+                            icon: 'none'
+                        })
+
+                        this.$refs.CommentPopup.close()
+                    }
+                })
+            }
+
+        },
+        watch: {
+            reActive(newVal) {
+                this.active = []
+                this.activeList = []
+                console.log(newVal);
+                if (newVal == 1) {
+                    console.log(this.$store.state.teacherInfo.selfclass, "this.$store.state.teacherInfo.selfclass");
+                    if (this.$store.state.teacherInfo.selfclass) {
+                        let classroom_id = this.$store.state.teacherInfo.selfclass.id
+                        // let classroom_id=1
+                        this.$api.sendRequest({
+                            url: `/mobile/getSeat?classroom_id=${classroom_id}`,
+                            success: res => {
+                                console.log(res.data);
+                                this.selfClassList = res.data/* .reverse().map(item => {
+                                    item.nodes = item.nodes.reverse().filter(el => {
+                                        return !!el.id;
+                                    })
+                                    return item;
+                                }) */
+                                this.notSelfClass = false
+                            }
+                        })
+                    } else {
+                        this.selfClassList = []
+                        uni.showToast({
+                            icon: "none",
+                            title: "您不是班主任"
+                        })
+                    }
+                }
+            }
+        },
+
+    }
 </script>
 
 <style lang="scss" scoped>
-	.form-btn-content {
-		width: 30%;
-		background: #05cca1;
-		height: 72rpx;
-		border-radius: 36rpx;
-		color: #fff;
-		font-size: 32rpx;
-		text-align: center;
-		line-height: 72rpx;
-		margin: 0 auto;
-		position: fixed;
-		bottom: 40rpx;
-		left: 35%;
-		
-	}
-	.platform {
-		display: flex;
-		justify-content: center;
-		align-items: center;
-		position: relative;
-		height: 30rpx;
-		margin-top: 60rpx;
-
-		.platform-color {
-			position: absolute;
-			left: 0;
-			top: 0;
-			height: 60rpx;
-			background-color: rgba(5, 204, 161, 1);
-			width: 10rpx;
-		}
-
-		.platform-text {
-			text-align: center;
-			width: 60%;
-			margin-top: 40rpx;
-
-		}
-	}
-
-	.pop-title {
-		border-bottom: 1px solid #f2f2f2;
-		font-size: 36rpx;
-		padding-bottom: 20rpx;
-		display: flex;
-		align-items: center;
-	}
-
-	.popup-content {
-		border-radius: 10px;
-		box-sizing: border-box;
-		padding: 0 32rpx;
-	}
-
-	.btn-roll {
-		background-color: #fff;
-		border-radius: 25rpx;
-		width: 190rpx;
-		color: #666;
-		height: 60rpx;
-		line-height: 60rpx;
-		text-align: center;
-		margin-left: 32rpx;
-	}
-
-	.ranked {
-		width: 100%;
-
-		text-align: center;
-		font-size: 10px;
-		box-sizing: border-box;
-		display: flex;
-
-		.ranked-item {
-			flex: 1;
-			box-sizing: border-box;
-
-
-
-			.ranked-item-tr {
-				margin-bottom: 16rpx;
-				border-radius: 5px;
-				box-sizing: border-box;
-				width: 100%;
-
-				display: flex;
-				justify-content: center;
-			}
-
-			.ranked-item-tr:last-child {
-				margin-bottom: 0;
-			}
-
-			.active {
-				border: 1px solid #ccc !important;
-				background-color: rgba(5, 204, 161, 1) !important;
-				color: #fff !important;
-				box-sizing: border-box;
-			}
-		}
-
-		.ranked-item:nth-child(2n) {
-			border-right: 1px solid #ccc;
-		}
-
-		.ranked-item:last-child {
-			border-right: 0;
-		}
-
-	}
-
-	.ranked-radio {
-		width: 100px;
-		position: absolute;
-		left: 50%;
-		transform: translate(-50%);
-		top: 0rpx;
-
-		border-bottom: 3px solid rgba(5, 204, 161, 1);
-		border-radius: 50% 50% 0 0;
-	}
-	
-	.visit-item {
-		display: flex;
-		align-items: center;
-	
-		.visit-item-left {
-			width: 120rpx;
-			color: #666;
-		}
-	}
+    .form-btn-content {
+        width: 30%;
+        background: #05cca1;
+        height: 72rpx;
+        border-radius: 36rpx;
+        color: #fff;
+        font-size: 32rpx;
+        text-align: center;
+        line-height: 72rpx;
+        margin: 0 auto;
+        position: fixed;
+        bottom: 40rpx;
+        left: 35%;
+
+    }
+
+    .platform {
+        display: flex;
+        justify-content: center;
+        align-items: center;
+        position: relative;
+        height: 30rpx;
+        margin-top: 60rpx;
+
+        .platform-color {
+            position: absolute;
+            left: 0;
+            top: 0;
+            height: 60rpx;
+            background-color: rgba(5, 204, 161, 1);
+            width: 10rpx;
+        }
+
+        .platform-text {
+            text-align: center;
+            width: 60%;
+            margin-top: 40rpx;
+
+        }
+    }
+
+    .pop-title {
+        border-bottom: 1px solid #f2f2f2;
+        font-size: 36rpx;
+        padding-bottom: 20rpx;
+        display: flex;
+        align-items: center;
+    }
+
+    .popup-content {
+        border-radius: 10px;
+        box-sizing: border-box;
+        padding: 0 32rpx;
+    }
+
+    .btn-roll {
+        background-color: #fff;
+        border-radius: 25rpx;
+        width: 190rpx;
+        color: #666;
+        height: 60rpx;
+        line-height: 60rpx;
+        text-align: center;
+        margin-left: 32rpx;
+    }
+
+    .ranked {
+        width: 100%;
+
+        text-align: center;
+        font-size: 10px;
+        box-sizing: border-box;
+        display: flex;
+
+        .ranked-item {
+            flex: 1;
+            box-sizing: border-box;
+
+
+
+            .ranked-item-tr {
+                margin-bottom: 16rpx;
+                border-radius: 5px;
+                box-sizing: border-box;
+                width: 100%;
+
+                display: flex;
+                justify-content: center;
+            }
+
+            .ranked-item-tr:last-child {
+                margin-bottom: 0;
+            }
+
+            .active {
+                border: 1px solid #ccc !important;
+                background-color: rgba(5, 204, 161, 1) !important;
+                color: #fff !important;
+                box-sizing: border-box;
+            }
+        }
+
+        .ranked-item:nth-child(2n) {
+            border-right: 1px solid #ccc;
+        }
+
+        .ranked-item:last-child {
+            border-right: 0;
+        }
+
+    }
+
+    .ranked-radio {
+        width: 100px;
+        position: absolute;
+        left: 50%;
+        transform: translate(-50%);
+        top: 0rpx;
+
+        border-bottom: 3px solid rgba(5, 204, 161, 1);
+        border-radius: 50% 50% 0 0;
+    }
+
+    .visit-item {
+        display: flex;
+        align-items: center;
+
+        .visit-item-left {
+            width: 120rpx;
+            color: #666;
+        }
+    }
 </style>