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. 15
      src/router/permission.js
  6. 3
      src/store/modules/user.js

@ -75,6 +75,7 @@
width="55" width="55"
align="center" align="center"
:reserve-selection="true" :reserve-selection="true"
:selectable="disabledSelection"
></el-table-column> ></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center"> <el-table-column type="index" width="60" label="序号" align="center">
<template <template
@ -112,7 +113,7 @@
<ques-dialog ref="quesDialog" :title="topicsTitle" :visible.sync="visible" :isDetail.sync="isDetail" @getData="dialogGetData" @closeTopics="closeTopics"></ques-dialog> <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="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> <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 <el-upload
@ -281,6 +282,11 @@ export default {
}) })
.catch(() => {}); .catch(() => {});
}, },
disabledSelection(row,index){
let list = this.listData
if(row.myShare) return false
return true
},
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val; this.multipleSelection = val;
}, },
@ -380,16 +386,15 @@ export default {
handleDataRemove(file, fileList) { handleDataRemove(file, fileList) {
this.uploadList = fileList this.uploadList = fileList
}, },
closeImport(){
this.uploadList = []
},
uploadSure(){ uploadSure(){
this.importVisible = false this.importVisible = false
this.page = 1 this.page = 1
this.keyword = '' this.keyword = ''
this.getData() this.getData()
}, },
closeUpload() {
this.uploadList = []
this.uploadDataList = []
},
} }
}; };
</script> </script>

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

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

@ -105,7 +105,144 @@ export default {
isAdd: true, isAdd: true,
roleVisible: false, roleVisible: false,
searchTimer: null, 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: [] checkedIds: []
}; };
}, },
@ -145,8 +282,8 @@ export default {
remark : '', remark : '',
id: '' id: ''
} }
this.checkedIds = [] // this.checkedIds = []
this.permissions = [] // this.permissions = []
}, },
currentChange(val) { currentChange(val) {
this.pageNo = val; this.pageNo = val;
@ -156,6 +293,7 @@ export default {
if(!this.permissions.length){ if(!this.permissions.length){
this.$get(this.api.queryPermissionMenu).then(res => { this.$get(this.api.queryPermissionMenu).then(res => {
this.permissions = res.data.children[0].children this.permissions = res.data.children[0].children
console.log(11,JSON.stringify(this.permissions))
}).catch(res => {}) }).catch(res => {})
} }
}, },
@ -163,7 +301,7 @@ export default {
this.isAdd = true this.isAdd = true
this.getPer() this.getPer()
this.checkedIds = [] this.checkedIds = []
this.permissions.length && this.$refs.per.setCheckedNodes([]) // this.permissions.length && this.$refs.per.setCheckedNodes([])
this.roleVisible = true this.roleVisible = true
}, },
handleRolePer(data,permissions){ handleRolePer(data,permissions){
@ -186,7 +324,7 @@ export default {
let perRes = await this.$get(`${this.api.toAssign}/${row.id}`) let perRes = await this.$get(`${this.api.toAssign}/${row.id}`)
if(perRes.success){ if(perRes.success){
this.checkedIds = this.handleRolePer(perRes.data.rolePermissions,this.permissions) 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; document.title = to.meta.title ? `${to.meta.title} | ${Setting.titleSuffix}` : Setting.titleSuffix;
const role = util.session.get(Setting.usernameKey); const role = util.session.get(Setting.usernameKey);
if (!role && to.path !== '/login') { if (!role && to.path !== '/login') {
if(to.fullPath == '/'){
next('/login') next('/login')
}else{ // if(to.fullPath == '/'){
next({ // next('/login')
path: '/login', // }else{
query: {redirect: to.fullPath} // next({
}) // path: '/login',
} // query: {redirect: to.fullPath}
// })
// }
} else if(role && to.path == '/login') { } else if(role && to.path == '/login') {
next('/index') next('/index')
} else { } else {

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