Commit 2707c984 authored by 王's avatar

添加老师班级成员

parent fec97b3f
...@@ -12,8 +12,8 @@ module.exports = { ...@@ -12,8 +12,8 @@ module.exports = {
//本地代理设置 //本地代理设置
proxyTable: { proxyTable: {
'/api': { '/api': {
target: 'http://local.base-api.sing.com', // 接口的域名 // target: 'http://local.base-api.sing.com', // 接口的域名
// target: 'https://wechat-test.changchangenglish.com/', target: 'https://wechat-test.changchangenglish.com/',
changeOrigin: true, // 如果接口跨域,需要进行这个参数配置 changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
} }
}, },
......
...@@ -88,10 +88,6 @@ ...@@ -88,10 +88,6 @@
</el-table> </el-table>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column
prop="id"
label="班级ID">
</el-table-column>
<el-table-column <el-table-column
prop="periods_title" prop="periods_title"
label="期数名称"> label="期数名称">
...@@ -112,8 +108,17 @@ ...@@ -112,8 +108,17 @@
prop="created_at" prop="created_at"
label="创建时间"> label="创建时间">
</el-table-column> </el-table-column>
<el-table-column
label="操作">
<template slot-scope="scope">
<el-button @click="showUser(scope.row)" size="mini" plain type="primary">
班级成员
</el-button>
</template>
</el-table-column>
</el-table> </el-table>
<page :total="total" :limit="limit" @pageChange="onPageChange"/> <page :total="total" :limit="limit" @pageChange="onPageChange"/>
<user-list :userObj="userObj" @reflash="getTeacherDetail"/>
</div> </div>
</template> </template>
...@@ -121,10 +126,12 @@ ...@@ -121,10 +126,12 @@
import {getTeacherDetailApi,getClassStatisticsApi} from "../../service/api"; import {getTeacherDetailApi,getClassStatisticsApi} from "../../service/api";
import {TEACHERTYPE} from "../../util/wordbook"; import {TEACHERTYPE} from "../../util/wordbook";
import page from '../framework/page' import page from '../framework/page'
import UserList from '../class/userList'
export default { export default {
name: "index", name: "index",
components:{ components:{
page page,
UserList
}, },
data(){ data(){
return { return {
...@@ -133,7 +140,12 @@ import page from '../framework/page' ...@@ -133,7 +140,12 @@ import page from '../framework/page'
detail: {}, detail: {},
total: 0, total: 0,
limit: 10, limit: 10,
nowPage: 1 nowPage: 1,
userObj:{
classId:'',
title:'',
show:false,
}
} }
}, },
methods:{ methods:{
...@@ -151,6 +163,13 @@ import page from '../framework/page' ...@@ -151,6 +163,13 @@ import page from '../framework/page'
}) })
} }
}, },
showUser(data){
this.userObj={
classId:data.id,
show:true,
title:`${this.detail.name}班级用户列表`
}
},
onPageChange(val){ onPageChange(val){
this.nowPage = val this.nowPage = val
this.getTeacherDetail() this.getTeacherDetail()
......
...@@ -46,8 +46,65 @@ ...@@ -46,8 +46,65 @@
</div> </div>
<div class="b-title">期数列表</div> <div class="b-title">期数列表</div>
<el-table <el-table
@expand-change="changeRow"
:data="periodList" :data="periodList"
style="width: 100%"> style="width: 100%">
<el-table-column type="expand">
<template slot-scope="scope">
<el-table
:data="[scope.row]"
style="width: 100%">
<el-table-column
label="到课率">
<template slot-scope="scope2">
<span>{{ scope2.row.arrive_course_rate | percent}}</span>
</template>
</el-table-column>
<el-table-column
label="看课率">
<template slot-scope="scope2">
<span>{{ scope2.row.watch_course_rate | percent}}</span>
</template>
</el-table-column>
<el-table-column
label="完课率">
<template slot-scope="scope2">
<span>{{ scope2.row.over_course_rate | percent}}</span>
</template>
</el-table-column>
<el-table-column
label="作业率">
<template slot-scope="scope2">
<span>{{ scope2.row.work_rate | percent}}</span>
</template>
</el-table-column>
<el-table-column
label="全勤作业率">
<template slot-scope="scope2">
<span>{{ scope2.row.over_work_rate | percent}}</span>
</template>
</el-table-column>
<el-table-column
label="打卡率">
<template slot-scope="scope2">
<span>{{ scope2.row.clock_rate | percent}}</span>
</template>
</el-table-column>
<el-table-column
label="全勤打卡率">
<template slot-scope="scope2">
<span>{{ scope2.row.over_clock_rate | percent}}</span>
</template>
</el-table-column>
<el-table-column
label="转化率">
<template slot-scope="scope2">
<span>{{ scope2.row.transform_rate | percent}}</span>
</template>
</el-table-column>
</el-table>
</template>
</el-table-column>
<el-table-column <el-table-column
prop="periods_title" prop="periods_title"
label="期数名称"> label="期数名称">
...@@ -163,7 +220,7 @@ ...@@ -163,7 +220,7 @@
</template> </template>
<script> <script>
import {getOrderListApi,getUserDetailApi} from "../../service/api"; import {getOrderListApi,getUserDetailApi,getPeriodsStatisticsApi} from "../../service/api";
import page from '../framework/page' import page from '../framework/page'
import {INVITETYPE,ORDERSTATUS,BUYTYPE} from "../../util/wordbook"; import {INVITETYPE,ORDERSTATUS,BUYTYPE} from "../../util/wordbook";
import teacherDialog from './dialog' import teacherDialog from './dialog'
...@@ -196,6 +253,20 @@ ...@@ -196,6 +253,20 @@
this.getUser() this.getUser()
}, },
methods:{ methods:{
changeRow(data,b){
if(b.indexOf(data)>-1){
getPeriodsStatisticsApi(data.id).then(res=>{
data.arrive_course_rate = res.arrive_course_rate;
data.watch_course_rate = res.watch_course_rate;
data.over_course_rate = res.over_course_rate;
data.work_rate = res.work_rate;
data.over_work_rate = res.over_work_rate;
data.clock_rate = res.clock_rate;
data.over_clock_rate = res.over_clock_rate;
data.transform_rate = res.transform_rate;
})
}
},
onPageChange(val){ onPageChange(val){
this.nowPage = val; this.nowPage = val;
this.getUser(); this.getUser();
...@@ -249,6 +320,9 @@ ...@@ -249,6 +320,9 @@
}, },
moneytFilter(val){ moneytFilter(val){
return val = val / 100 + '元' return val = val / 100 + '元'
},
percent(val){
return (val * 100).toFixed(2)+'%'
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment