yujialong 4 years ago
parent 44077cee02
commit 94434ab283
  1. 15
      src/pages/quesBank/list/myQuesBank.vue
  2. 7
      src/pages/quesBank/list/quesDialog.vue
  3. 3
      src/pages/setting/person/index.vue
  4. 148
      src/pages/system/list/role.vue
  5. 17
      src/router/permission.js
  6. 3
      src/store/modules/user.js

@ -75,6 +75,7 @@
width="55"
align="center"
:reserve-selection="true"
:selectable="disabledSelection"
></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center">
<template
@ -112,7 +113,7 @@
<ques-dialog ref="quesDialog" :title="topicsTitle" :visible.sync="visible" :isDetail.sync="isDetail" @getData="dialogGetData" @closeTopics="closeTopics"></ques-dialog>
<el-dialog title="批量导入" :visible.sync="importVisible" width="24%" center :close-on-click-modal="false">
<el-dialog title="批量导入" :visible.sync="importVisible" width="24%" center @close="closeImport" :close-on-click-modal="false">
<div style="text-align: center">
<div style="margin-bottom: 10px;"><el-button type="primary" @click="downLoad">模板下载<i class="el-icon-download el-icon--right"></i></el-button></div>
<el-upload
@ -281,6 +282,11 @@ export default {
})
.catch(() => {});
},
disabledSelection(row,index){
let list = this.listData
if(row.myShare) return false
return true
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
@ -380,16 +386,15 @@ export default {
handleDataRemove(file, fileList) {
this.uploadList = fileList
},
closeImport(){
this.uploadList = []
},
uploadSure(){
this.importVisible = false
this.page = 1
this.keyword = ''
this.getData()
},
closeUpload() {
this.uploadList = []
this.uploadDataList = []
},
}
};
</script>

@ -32,6 +32,7 @@
<el-form-item label="上传" prop="source">
<el-upload
:accept="acceptExt"
:before-upload="handleUploadChange"
:on-remove="handleRemove"
:on-error="uploadError"
:on-success="uploadSuccess"
@ -170,6 +171,7 @@ export default {
questionType: ['','单选题','多选题','判断题','简答题','填空题'],
fillList: [''],
uploadList: [],
uploading: false
};
},
computed: {
@ -310,7 +312,7 @@ export default {
this.topicForm[`option${this.options[i]}`] = n
})
}
if(this.uploading) return this.$message.warning('视频正在上传,请稍等')
this.topicForm.userId = this.userId
if(this.topicForm.id) {
this.$post(this.api.updateQuestions,this.topicForm).then(res => {
@ -407,6 +409,9 @@ export default {
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}`);
},
handleUploadChange(){
this.uploading = true
},
handleRemove(file, fileList) {
this.uploadList = fileList
},

@ -339,7 +339,7 @@ export default {
},
methods: {
...mapActions('user', [
'setAvatar'
'setAvatar','setUserName'
]),
getProvince(){
this.$get(this.api.queryProvince).then(res => {
@ -458,6 +458,7 @@ export default {
let data = userInfoEntity
this.$post(this.api.userinfoUpdate,data).then(res => {
if(res.success){
this.setUserName(personalInformation.userName)
this.$message.success('提交成功')
this.$router.back()
}else{

@ -105,7 +105,144 @@ export default {
isAdd: true,
roleVisible: false,
searchTimer: null,
permissions: [],
permissions: [
{
id: 1,
name: '学校管理',
children: [
{
id: 1,
name: '新增客户'
},{
id: 2,
name: '批量删除'
},{
id: 3,
name: '查看'
},{
id: 4,
name: '编辑'
},{
id: 5,
name: '删除'
},{
id: 6,
name: '禁用'
},
]
},{
id: 1,
name: '用户管理',
children: [
{
id: 7,
name: '新增用户'
},{
id: 8,
name: '批量导入'
},{
id: 9,
name: '批量删除'
},{
id: 10,
name: '查看'
},{
id: 11,
name: '编辑'
},{
id: 12,
name: '重置密码'
},{
id: 13,
name: '删除'
},
]
},{
id: 1,
name: '题库管理',
children: [
{
id: 14,
name: '我上传的题库',
children: [
{
id: 2,
name: '新增'
},{
id: 4,
name: '批量删除'
},{
id: 5,
name: '编辑'
},{
id: 2,
name: '删除'
},
]
},{
id: 15,
name: '公共题库',
children: [
{
id: 2,
name: '新增'
},{
id: 4,
name: '批量删除'
},{
id: 5,
name: '编辑'
},{
id: 2,
name: '删除'
},
]
}
]
},{
id: 16,
name: '系统设置',
children: [
{
id: 17,
name: '员工管理',
children: [
{
id: 18,
name: '新增'
},{
id: 19,
name: '批量删除'
},{
id: 20,
name: '编辑'
},{
id: 21,
name: '删除'
},
]
},{
id: 1,
name: '角色权限',
children: [
{
id: 22,
name: '新增'
},{
id: 23,
name: '批量删除'
},{
id: 24,
name: '编辑'
},{
id: 25,
name: '删除'
},
]
}
]
}
],
checkedIds: []
};
},
@ -145,8 +282,8 @@ export default {
remark : '',
id: ''
}
this.checkedIds = []
this.permissions = []
// this.checkedIds = []
// this.permissions = []
},
currentChange(val) {
this.pageNo = val;
@ -156,6 +293,7 @@ export default {
if(!this.permissions.length){
this.$get(this.api.queryPermissionMenu).then(res => {
this.permissions = res.data.children[0].children
console.log(11,JSON.stringify(this.permissions))
}).catch(res => {})
}
},
@ -163,7 +301,7 @@ export default {
this.isAdd = true
this.getPer()
this.checkedIds = []
this.permissions.length && this.$refs.per.setCheckedNodes([])
// this.permissions.length && this.$refs.per.setCheckedNodes([])
this.roleVisible = true
},
handleRolePer(data,permissions){
@ -186,7 +324,7 @@ export default {
let perRes = await this.$get(`${this.api.toAssign}/${row.id}`)
if(perRes.success){
this.checkedIds = this.handleRolePer(perRes.data.rolePermissions,this.permissions)
this.$refs.per.setCheckedNodes(this.checkedIds)
// this.$refs.per.setCheckedNodes(this.checkedIds)
}
}
},

@ -8,14 +8,15 @@ router.beforeEach((to, from, next) => {
document.title = to.meta.title ? `${to.meta.title} | ${Setting.titleSuffix}` : Setting.titleSuffix;
const role = util.session.get(Setting.usernameKey);
if (!role && to.path !== '/login') {
if(to.fullPath == '/'){
next('/login')
}else{
next({
path: '/login',
query: {redirect: to.fullPath}
})
}
next('/login')
// if(to.fullPath == '/'){
// next('/login')
// }else{
// next({
// path: '/login',
// query: {redirect: to.fullPath}
// })
// }
} else if(role && to.path == '/login') {
next('/index')
} else {

@ -102,5 +102,8 @@ export default {
}
post(api.userinfoUpdate,data).then(res => {}).catch(res => {})
},
setUserName({ state,commit },userName) {
commit('SET_USERNAME',userName)
},
}
}
Loading…
Cancel
Save