Commit d7b11f2f authored by 王's avatar

班级列表权限添加老师

parent fbe211cd
...@@ -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, // 如果接口跨域,需要进行这个参数配置
} }
}, },
......
...@@ -84,12 +84,13 @@ ...@@ -84,12 +84,13 @@
{{ scope.row.is_continue_buy | isOrNot}} {{ scope.row.is_continue_buy | isOrNot}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" v-if="!$store.state.readonly" width="360"> <el-table-column label="操作" v-if="!$store.state.readonly" width="410">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="warning" size="mini" @click="editComment(scope.row.id, scope.row.desc)" v-if="!$store.state.readonly">编辑备注</el-button> <el-button type="warning" size="mini" @click="editComment(scope.row.id, scope.row.desc)" v-if="!$store.state.readonly">编辑备注</el-button>
<el-button type="warning" size="mini" @click="changeUser(scope.row)" v-if="!$store.state.readonly">看课权限</el-button> <el-button type="warning" size="mini" @click="changeUser(scope.row)" v-if="!$store.state.readonly">看课权限</el-button>
<el-button type="primary" size="mini" @click="userLook(scope.row)" v-if="!$store.state.readonly">看课情况</el-button> <el-button type="primary" size="mini" @click="userLook(scope.row)" v-if="!$store.state.readonly">看课情况</el-button>
<el-button type="danger" size="mini" @click="onDel(scope.row)" v-if="$store.state.deletePermission && !$store.state.readonly">删除</el-button> <el-button type="danger" size="mini" @click="onDel(scope.row)" v-if="$store.state.deletePermission && !$store.state.readonly">删除</el-button>
<el-button type="warning" size="mini" @click="addTeacher(scope.row)" v-if="!$store.state.readonly">{{scope.row.is_add_teacher === 0 ? '添加老师' : '取消添加老师'}}</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -165,7 +166,7 @@ ...@@ -165,7 +166,7 @@
label="爸妈看一看"> label="爸妈看一看">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.watch_list && scope.row.watch_list.length > 0 && scope.row.watch_list.find(i=>{return i.page_id === 1})"> <span v-if="scope.row.watch_list && scope.row.watch_list.length > 0 && scope.row.watch_list.find(i=>{return i.page_id === 1})">
学习时长:{{scope.row.watch_list.find(i=>{return i.page_id === 1}).stay_time}} {{scope.row.watch_list.find(i=>{return i.page_id === 1}).stay_time}}
</span> </span>
<span v-if="!scope.row.watch_list.find(i=>{return i.page_id === 1})"> <span v-if="!scope.row.watch_list.find(i=>{return i.page_id === 1})">
暂未上课 暂未上课
...@@ -175,10 +176,10 @@ ...@@ -175,10 +176,10 @@
<el-table-column <el-table-column
label="宝贝玩一玩"> label="宝贝玩一玩">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.watch_list && scope.row.watch_list.length > 0 && scope.row.watch_list.find(i=>{return i.page_id === 1})"> <span v-if="scope.row.watch_list && scope.row.watch_list.length > 0 && scope.row.watch_list.find(i=>{return i.page_id === 2})">
学习时长:{{scope.row.watch_list.find(i=>{return i.page_id === 2}).stay_time}} {{scope.row.watch_list.find(i=>{return i.page_id === 2}).stay_time}}
</span> </span>
<span v-if="!scope.row.watch_list.find(i=>{return i.page_id === 1})"> <span v-if="!scope.row.watch_list.find(i=>{return i.page_id === 2})">
暂未上课 暂未上课
</span> </span>
</template> </template>
...@@ -186,15 +187,38 @@ ...@@ -186,15 +187,38 @@
<el-table-column <el-table-column
label="爸妈秀宝贝"> label="爸妈秀宝贝">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.watch_list && scope.row.watch_list.length > 0 && scope.row.watch_list.find(i=>{return i.page_id === 1})"> <span v-if="scope.row.watch_list && scope.row.watch_list.length > 0 && scope.row.watch_list.find(i=>{return i.page_id === 3})">
学习记录:<div v-html="scope.row.watch_list.find(i=>{return i.page_id === 0}).learn_report"></div>{{scope.row.watch_list.find(i=>{return i.page_id === 3}).stay_time}} <div v-html="scope.row.watch_list.find(i=>{return i.page_id === 0}).learn_report"></div>{{scope.row.watch_list.find(i=>{return i.page_id === 3}).stay_time}}
</span> </span>
<span v-if="!scope.row.watch_list.find(i=>{return i.page_id === 1})"> <span v-if="!scope.row.watch_list.find(i=>{return i.page_id === 3})">
暂未上课
</span>
</template>
</el-table-column>
<el-table-column
label="多元趣味课">
<template slot-scope="scope">
<span v-if="scope.row.watch_list && scope.row.watch_list.length > 0 && scope.row.watch_list.find(i=>{return i.page_id === 5})">
<div v-html="scope.row.watch_list.find(i=>{return i.page_id === 0}).learn_report"></div>{{scope.row.watch_list.find(i=>{return i.page_id === 5}).stay_time}}
</span>
<span v-if="!scope.row.watch_list.find(i=>{return i.page_id === 5})">
暂未上课 暂未上课
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column
label="分享">
<template slot-scope="scope">
<span v-if="scope.row.watch_list && scope.row.watch_list.length > 0 && scope.row.watch_list.find(i=>{return i.page_id === 4})">
<div v-html="scope.row.watch_list.find(i=>{return i.page_id === 0}).learn_report"></div>{{scope.row.watch_list.find(i=>{return i.page_id === 4}).stay_time}}
</span>
<span v-if="!scope.row.watch_list.find(i=>{return i.page_id === 4})">
暂未分享
</span>
</template>
</el-table-column>
</el-table> </el-table>
<page2 :nowPage="lookDetail.nowPage" :total="lookDetail.total" :limit="lookDetail.limit" @pageChange="onLookDetailPageChange" @sizeChange="onLookDetailSizeChange"/>
</el-dialog> </el-dialog>
<el-dialog :modal="false" :visible.sync="changeClassObj.show" title="切换班级"> <el-dialog :modal="false" :visible.sync="changeClassObj.show" title="切换班级">
<el-form> <el-form>
...@@ -219,8 +243,9 @@ ...@@ -219,8 +243,9 @@
</template> </template>
<script> <script>
import {addClassUesrApi,getClassUserApi,changeUserApi,delClassUserApi,getUserListApi,addPeriodsClassUserDescApi,userLookApi,getPeriodsApi,changeClassApi,getClassListApi} from "../../service/api"; import {addClassUesrApi,getClassUserApi,changeUserApi,delClassUserApi,getUserListApi,addPeriodsClassUserDescApi,userLookApi,getPeriodsApi,changeClassApi,getClassListApi,addUserTeacherApi} from "../../service/api";
import page from '../framework/page' import page from '../framework/page'
import page2 from '../framework/page'
import {ISORNOT} from "../../util/wordbook"; import {ISORNOT} from "../../util/wordbook";
export default { export default {
...@@ -235,7 +260,10 @@ ...@@ -235,7 +260,10 @@
lookDetail:{ lookDetail:{
show:false, show:false,
loading:false, loading:false,
list:[] list:[],
nowPage: 1,
limit: 5,
total:0
}, },
changeClassObj:{ changeClassObj:{
show:false, show:false,
...@@ -260,7 +288,8 @@ ...@@ -260,7 +288,8 @@
} }
}, },
components:{ components:{
page page,
page2
}, },
filters:{ filters:{
isOrNot(value){ isOrNot(value){
...@@ -326,11 +355,44 @@ ...@@ -326,11 +355,44 @@
userLook(data){ userLook(data){
this.lookDetail.show = true; this.lookDetail.show = true;
this.lookDetail.loading = true; this.lookDetail.loading = true;
userLookApi(data.periods_id,data.user_id).then(res=>{ let json = {
limit: this.lookDetail.limit,
page: this.lookDetail.nowPage
}
this.lookDetail.data = {
periods_id:data.periods_id,
user_id: data.user_id
}
userLookApi(data.periods_id,data.user_id, json).then(res=>{
this.lookDetail.list = res.list; this.lookDetail.list = res.list;
this.lookDetail.loading = false; this.lookDetail.loading = false;
this.lookDetail.total = res.total;
}) })
}, },
getUserLook(){
if(!this.lookDetail.data) return;
this.lookDetail.show = true;
this.lookDetail.loading = true;
let json = {
limit: this.lookDetail.limit,
page: this.lookDetail.nowPage
}
let data = this.lookDetail.data;
userLookApi(data.periods_id,data.user_id, json).then(res=>{
this.lookDetail.list = res.list;
this.lookDetail.loading = false;
this.lookDetail.total = res.total;
})
},
onLookDetailPageChange(val){
this.lookDetail.nowPage = val
this.getUserLook();
},
onLookDetailSizeChange(val){
this.lookDetail.limit = val
this.lookDetail.nowPage = 1;
this.getUserLook();
},
initPage(){ initPage(){
getClassUserApi(this.userObj.classId,{limit:500}).then(res=>{ getClassUserApi(this.userObj.classId,{limit:500}).then(res=>{
this.userTable = res.list this.userTable = res.list
...@@ -359,6 +421,21 @@ ...@@ -359,6 +421,21 @@
}); });
}); });
}, },
addTeacher(data){
this.$confirm('此操作将修改是否添加老师权限?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
addUserTeacherApi(data.id,{is_add_teacher:data.is_add_teacher === 0 ? 1 : 0}).then(res=>{
this.$message({
type: 'success',
message: '修改成功!'
});
this.initPage()
});
});
},
onDel(data){ onDel(data){
this.$confirm('此操作将删除该成员?', '提示', { this.$confirm('此操作将删除该成员?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
......
...@@ -92,6 +92,10 @@ ...@@ -92,6 +92,10 @@
prop="periods_title" prop="periods_title"
label="期数名称"> label="期数名称">
</el-table-column> </el-table-column>
<el-table-column
prop="total_join_num"
label="带班总人数">
</el-table-column>
<el-table-column <el-table-column
prop="join_num" prop="join_num"
label="参加人数"> label="参加人数">
......
...@@ -423,6 +423,11 @@ const changeUserUrl = `${_baseUrl}api/admin/class/user/`; ...@@ -423,6 +423,11 @@ const changeUserUrl = `${_baseUrl}api/admin/class/user/`;
export const changeUserApi = function (id,json) { export const changeUserApi = function (id,json) {
return Vue.prototype.$put(`${changeUserUrl}${id}`,json) return Vue.prototype.$put(`${changeUserUrl}${id}`,json)
}; };
// 添加是否添加老师权限
const addUserTeacherUrl = `${_baseUrl}api/admin/class/user/teacher/`;
export const addUserTeacherApi = function (id,json) {
return Vue.prototype.$put(`${addUserTeacherUrl}${id}`,json)
};
// 移除班级用户 // 移除班级用户
const delClassUserUrl = `${_baseUrl}api/admin/class/user/`; const delClassUserUrl = `${_baseUrl}api/admin/class/user/`;
export const delClassUserApi = function (id) { export const delClassUserApi = function (id) {
...@@ -526,8 +531,8 @@ export const getClassStatisticsApi = function (periods_id, class_id) { ...@@ -526,8 +531,8 @@ export const getClassStatisticsApi = function (periods_id, class_id) {
}; };
// 用户看课情况 // 用户看课情况
const userLookUrl = `/api/admin/user/static/list/`; const userLookUrl = `/api/admin/user/static/list/`;
export const userLookApi = function (periods_id,user_id) { export const userLookApi = function (periods_id,user_id, json) {
return Vue.prototype.$fetch(`${userLookUrl}${periods_id}/${user_id}`) return Vue.prototype.$fetch(`${userLookUrl}${periods_id}/${user_id}`, json)
}; };
//订单统计 //订单统计
const orderCountUrl = `/api/admin/order/statistics`; const orderCountUrl = `/api/admin/order/statistics`;
......
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