Commit f748a398 authored by chenfenglei's avatar chenfenglei

清除缓存上移,老师列表limit100

parent c1f5e035
...@@ -122,6 +122,12 @@ ...@@ -122,6 +122,12 @@
<el-table-column <el-table-column
type="selection" type="selection"
width="55"> width="55">
</el-table-column>
<el-table-column
label="备注">
<template slot-scope="scope">
{{ scope.row.desc}}
</template>
</el-table-column> </el-table-column>
<el-table-column label="用户" className="f-c" width="150" sortable prop="user_id"> <el-table-column label="用户" className="f-c" width="150" sortable prop="user_id">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -200,12 +206,6 @@ ...@@ -200,12 +206,6 @@
{{ scope.row.weight}} {{ scope.row.weight}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column
label="备注">
<template slot-scope="scope">
{{ scope.row.desc}}
</template>
</el-table-column>
<el-table-column label="操作" width="320"> <el-table-column label="操作" width="320">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="warning" size="mini" @click="editPrivilege(scope.row)">编辑</el-button> <el-button type="warning" size="mini" @click="editPrivilege(scope.row)">编辑</el-button>
......
...@@ -2,19 +2,22 @@ ...@@ -2,19 +2,22 @@
<div class="head-index"> <div class="head-index">
<img class="logo" :src="iconUrl" @click="toHome"/>{{$store.state.userName}} <img class="logo" :src="iconUrl" @click="toHome"/>{{$store.state.userName}}
<div class="fl-r"> <div class="fl-r">
<el-button round size="mini" class="edit-btn" @click="dialogUpdate=true">修改密码 </el-button>
<el-button round size="mini" class="edit-btn" @click="logOut">退出登录 </el-button>
<el-dropdown> <el-dropdown>
<el-button round size="mini" class="edit-password" >账号管理 <i class="el-icon-arrow-down el-icon--right"></i></el-button> <el-button round size="mini" class="edit-btn" >工具管理 <i class="el-icon-arrow-down el-icon--right"></i></el-button>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="dialogVisible=true">修改密码</el-dropdown-item> <el-dropdown-item @click.native="entranceObj.show=true">无需登录入口</el-dropdown-item>
<el-dropdown-item @click.native="logOut">退出登录</el-dropdown-item> <el-dropdown-item @click.native="qrcodeObj.show=true">生成二维码</el-dropdown-item>
</el-dropdown-menu> <el-dropdown-item @click.native="linkObj.show=true">生成短链接</el-dropdown-item>
</el-dropdown> <el-dropdown-item @click.native="userObj.show=true">清除缓存</el-dropdown-item>
<!-- <el-button round size="mini" style="clear:both" @click="logOut">退出登录</el-button> --> </el-dropdown-menu>
</el-dropdown>
</div> </div>
<el-dialog <el-dialog
title="修改密码" title="修改密码"
:visible.sync="dialogVisible" :visible.sync="dialogUpdate"
center center
width="400px"> width="400px">
<el-form ref="ruleForm2" label-width="80px" :model="ruleForm2" :rules="rules2"> <el-form ref="ruleForm2" label-width="80px" :model="ruleForm2" :rules="rules2">
...@@ -29,146 +32,171 @@ ...@@ -29,146 +32,171 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button> <el-button @click="dialogUpdate = false">取 消</el-button>
<el-button type="primary" @click="changePass">确 定</el-button> <el-button type="primary" @click="changePass">确 定</el-button>
</span> </span>
</el-dialog> </el-dialog>
<clear-cache :userObj="userObj" />
<entrance :entranceObj="entranceObj" />
<get-link :linkObj="linkObj" />
<getqr-code :qrcodeObj="qrcodeObj" />
</div> </div>
</template> </template>
<script> <script>
import {logoutApi,editAdminPasswordApi} from "../../service/api"; import clearCache from "./other/clearCache";
import iconUrl from '../../assets/logos.png' import entrance from "./other/entrance";
import cookie from '../../util/cookie' import getLink from "./other/getLink";
import md5 from 'js-md5'; import getqrCode from "./other/getqrCode";
export default { import { logoutApi, editAdminPasswordApi } from "../../service/api";
name: "headIndex", import iconUrl from "../../assets/logos.png";
data(){ import cookie from "../../util/cookie";
var validateOldPass = (rule, value, callback) => { import md5 from "js-md5";
if (value === '') { export default {
callback(new Error('请输入密码')); name: "headIndex",
} else { data() {
callback(); var validateOldPass = (rule, value, callback) => {
} if (value === "") {
}; callback(new Error("请输入密码"));
var validatePass = (rule, value, callback) => { } else {
if (value === '') { callback();
callback(new Error('请输入新密码')); }
} else { };
if (this.ruleForm2.checkPass !== '') { var validatePass = (rule, value, callback) => {
this.$refs.ruleForm2.validateField('checkPass'); if (value === "") {
} callback(new Error("请输入新密码"));
callback(); } else {
} if (this.ruleForm2.checkPass !== "") {
}; this.$refs.ruleForm2.validateField("checkPass");
var validatePass2 = (rule, value, callback) => {
if (value === '') {
callback(new Error('请再次输入密码'));
} else if (value !== this.ruleForm2.pass) {
callback(new Error('两次输入密码不一致!'));
} else {
callback();
}
};
return {
iconUrl:iconUrl,
dialogVisible:false,
rules2: {
pass: [
{validator: validatePass, trigger: 'blur'}
],
checkPass: [
{validator: validatePass2, trigger: 'blur'}
],
oldPass:[
{validator: validateOldPass, trigger: 'blur'}
]
},
ruleForm2:{
oldPass:'',
checkPass:'',
pass:''
} }
callback();
} }
}, };
methods:{ var validatePass2 = (rule, value, callback) => {
a(){ if (value === "") {
console.log("aa") callback(new Error("请再次输入密码"));
}, } else if (value !== this.ruleForm2.pass) {
logOut(){ callback(new Error("两次输入密码不一致!"));
this.$confirm('确定退出系统?', '提示', { } else {
confirmButtonText: '确定', callback();
cancelButtonText: '取消', }
type: 'warning' };
}).then(() => { return {
logoutApi().then(()=>{ userObj:{
cookie.delete('cc_token'); title:'清除缓存',
this.$store.dispatch('setToken',''); show:false
this.$store.dispatch('setUserName',''); },
window.location.href = '/#/login' entranceObj:{
}) title:'无需登录入口',
}).catch(() => { show:false
},
}); linkObj:{
}, title:'生成短链接',
changePass(){ show:false
this.$refs['ruleForm2'].validate((valid) => { },
if (valid) { qrcodeObj:{
let json = { title:'生成二维码',
passwd_new:md5(this.ruleForm2.pass), show:false
passwd_old:md5(this.ruleForm2.oldPass) },
}; iconUrl: iconUrl,
editAdminPasswordApi(json).then(res=>{ dialogUpdate: false,
this.$alert('修改成功,请重新登录', '成功', { rules2: {
confirmButtonText: '确定', pass: [{ validator: validatePass, trigger: "blur" }],
callback: action => { checkPass: [{ validator: validatePass2, trigger: "blur" }],
logoutApi().then(()=>{ oldPass: [{ validator: validateOldPass, trigger: "blur" }]
cookie.delete('cc_token');
this.$store.dispatch('setToken','');
this.$store.dispatch('setUserName','');
window.location.href = '/#/login'
})
}
});
})
} else {
console.log('error submit!!');
return false;
}
});
}, },
toHome(){ ruleForm2: {
this.$router.push({name:'first'}) oldPass: "",
checkPass: "",
pass: ""
} }
};
},
components:{
clearCache,
entrance,
getLink,
getqrCode
},
methods: {
a() {
console.log("aa");
},
logOut() {
this.$confirm("确定退出系统?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
logoutApi().then(() => {
cookie.delete("cc_token");
this.$store.dispatch("setToken", "");
this.$store.dispatch("setUserName", "");
window.location.href = "/#/login";
});
})
.catch(() => {});
},
changePass() {
this.$refs["ruleForm2"].validate(valid => {
if (valid) {
let json = {
passwd_new: md5(this.ruleForm2.pass),
passwd_old: md5(this.ruleForm2.oldPass)
};
editAdminPasswordApi(json).then(res => {
this.$alert("修改成功,请重新登录", "成功", {
confirmButtonText: "确定",
callback: action => {
logoutApi().then(() => {
cookie.delete("cc_token");
this.$store.dispatch("setToken", "");
this.$store.dispatch("setUserName", "");
window.location.href = "/#/login";
});
}
});
});
} else {
console.log("error submit!!");
return false;
}
});
},
toHome() {
this.$router.push({ name: "first" });
} }
} }
};
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
@import "../../util/public"; @import "../../util/public";
.head-index{ .head-index {
height: 100%; height: 100%;
line-height: 60px; line-height: 60px;
.logo{ .logo {
height: 50px; height: 50px;
vertical-align: middle; vertical-align: middle;
margin-right: 20px; margin-right: 20px;
position: relative; position: relative;
top: -5px; top: -5px;
}
}
.btn-div{
text-align: center;
}
.edit-password{
margin-left: 10px;
}
.el-dropdown {
vertical-align: top;
}
.el-dropdown + .el-dropdown {
margin-left: 15px;
}
.el-icon-arrow-down {
font-size: 12px;
} }
}
.btn-div {
text-align: center;
}
.edit-btn {
margin-left: 10px;
}
.el-dropdown {
vertical-align: top;
}
.el-dropdown + .el-dropdown {
margin-left: 15px;
}
.el-icon-arrow-down {
font-size: 12px;
}
</style> </style>
<template> <template>
<div class="clearCache"> <el-dialog :title="userObj.title"
:visible.sync="userObj.show" center
width="800px">
<el-table <el-table
:data="cacheList" :data="cacheList"
style="width: 100%;"> style="width: 100%;">
...@@ -17,15 +19,23 @@ ...@@ -17,15 +19,23 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </el-dialog>
</template> </template>
<script> <script>
import {clearCacheListApi} from "../../service/api" import {clearCacheListApi} from "../../../service/api"
export default { export default {
name:"ClearCache",
props:[
'userObj'
],
data(){ data(){
return{ return{
cacheList:[{name:"主题列表",key:"course_relation_list"},{name:"课包列表",key:"course_category_list "},{name:"课包内容",key:"element_detail"}] cacheList:[
} {name:"主题列表",key:"course_relation_list"},
{name:"课包列表",key:"course_category_list "},
{name:"课包内容",key:"element_detail"}
]
}
}, },
methods:{ methods:{
cache(data){ cache(data){
......
<template>
<el-dialog :title="entranceObj.title"
:visible.sync="entranceObj.show" center
width="80%">
</el-dialog>
</template>
<script>
export default {
name:"entrance",
props:[
'entranceObj'
],
data(){
return{
}
},
methods:{
}
}
</script>
<style scoped lang="less">
</style>
<template>
<el-dialog :title="linkObj.title"
:visible.sync="linkObj.show" center
width="800px">
<el-form :model="form" ref="form" label-width="100px" class="demo-ruleForm">
<el-form-item
label="输入链接"
prop="age"
:rules="[
{ required: true, message: '内容不能为空'}
]"
>
<el-input type="link" v-model.number="form.link" autocomplete="off"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitForm('form')">获取</el-button>
</el-form-item>
</el-form>
<div class="link_content" v-if="content.show">
<div class="content">
<el-input v-model="content.text" disabled></el-input>
</div>
<el-button type="primary" >复制链接</el-button>
</div>
</el-dialog>
</template>
<script>
export default {
name: "getLink",
props: ["linkObj"],
data() {
return {
form: {
link: ""
},
content:{
show:true,
text:""
}
};
},
methods: {
submitForm(formName) {
this.$refs[formName].validate(valid => {
if (valid) {
alert("submit!");
} else {
console.log("error submit!!");
return false;
}
});
}
}
};
</script>
<style scoped lang="less">
.content{
height: 100px;
}
</style>
\ No newline at end of file
<template>
<el-dialog :title="qrcodeObj.title"
:visible.sync="qrcodeObj.show" center
width="800px">
<el-form :model="form" ref="form" label-width="100px" class="demo-ruleForm">
<el-form-item
label="输入链接"
prop="age"
:rules="[
{ required: true, message: '内容不能为空'}
]"
>
<el-input type="link" v-model.number="form.link" autocomplete="off"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitForm('form')">获取</el-button>
</el-form-item>
</el-form>
<div class="link_content" v-if="content.show">
<div class="content">
</div>
<el-button type="primary" >下载二维码</el-button>
</div>
</el-dialog>
</template>
<script>
export default {
name: "getqrCode",
props: ["qrcodeObj"],
data() {
return {
form: {
link: ""
},
content:{
show:true
}
};
},
methods: {
submitForm(formName) {
this.$refs[formName].validate(valid => {
if (valid) {
alert("submit!");
} else {
console.log("error submit!!");
return false;
}
});
}
}
};
</script>
<style scoped lang="less">
.content{
width: 300px;
height: 300px;
background: red;
margin: 0 auto;
}
</style>
\ No newline at end of file
<template>
<div>
</div>
</template>
<script>
export default {
name: "notBuyClass",
data(){
return{
}
},
mounted(){
},
methods:{
}
}
</script>
<style scoped>
</style>
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="带班老师" prop="teacherList" v-if = "!form.id"> <el-form-item label="带班老师" prop="teacherList" v-if = "!form.id">
<el-select v-model="form.teacherList" multiple placeholder="请选择" @change="onTeacher1Change"> <el-select v-model="form.teacherList" placeholder="请选择" @change="onTeacher1Change">
<el-option <el-option
v-for="item in teacher1Options" v-for="item in teacher1Options"
:key="item.id" :key="item.id"
...@@ -236,7 +236,12 @@ ...@@ -236,7 +236,12 @@
}); });
}, },
getTeachers(){ getTeachers(){
getTeacherListApi().then((res)=>{ let json1 = {
page: 1,
limit: 100
};
getTeacherListApi(json1).then((res)=>{
console.log(res.list)
this.teacherOptions = res.list; this.teacherOptions = res.list;
this.teacher1Options = res.list; this.teacher1Options = res.list;
this.teacher2Options = res.list; this.teacher2Options = res.list;
...@@ -300,9 +305,9 @@ ...@@ -300,9 +305,9 @@
} }
}, },
mounted(){ mounted(){
// this.initPage() // this.initPage()
this.getGoodsOption();
this.getTeachers(); this.getTeachers();
this.getGoodsOption();
} }
} }
</script> </script>
......
...@@ -166,6 +166,7 @@ ...@@ -166,6 +166,7 @@
} }
}, },
editIndex(data){ editIndex(data){
console.log(data)
this.dialogObj={ this.dialogObj={
show:true, show:true,
type:1, type:1,
......
...@@ -754,3 +754,8 @@ const getJoinNumUrl = 'api/admin/class/teacher/group/num/'; ...@@ -754,3 +754,8 @@ const getJoinNumUrl = 'api/admin/class/teacher/group/num/';
export const getJoinNumApi = function (id) { export const getJoinNumApi = function (id) {
return Vue.prototype.$fetch(`${getJoinNumUrl}${id}`) return Vue.prototype.$fetch(`${getJoinNumUrl}${id}`)
}; };
// 未购买列表
// const getNotBuyUrl = '';
// export const getNotBuyApi = function (id) {
// return Vue.prototype.$fetch(`${getNotBuyUrl}${id}`)
// };
...@@ -177,6 +177,17 @@ export default [ ...@@ -177,6 +177,17 @@ export default [
component: e=>require(['@/components/coupon'],e), component: e=>require(['@/components/coupon'],e),
} }
}, },
{
value:'未购买列表',
routerName:'notBuyClass',
path:'/notBuyClass',
cover:'5-7',
router:{
path: '/notBuyClass',
name:'notBuyClass',
component: e=>require(['@/components/notBuyClass'],e),
}
},
{ {
value:'业绩排行', value:'业绩排行',
routerName:'achievement', routerName:'achievement',
...@@ -396,16 +407,6 @@ export default [ ...@@ -396,16 +407,6 @@ export default [
component: e=>require(['@/components/system/sysConfig'],e), component: e=>require(['@/components/system/sysConfig'],e),
} }
},{
value:'清除缓存',
routerName:'clearCache',
path:'/clearCache',
cover:'8-6',
router:{
path: '/clearCache',
name:'clearCache',
component: e=>require(['@/components/system/clearCache'],e),
}
}, },
{ {
value:'操作日志', value:'操作日志',
......
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