yujialong 4 years ago
parent 1004a1de26
commit 42eca4bfec
  1. 2
      src/api/index.js
  2. 2
      src/pages/client/list/index.vue
  3. 3
      src/pages/quesBank/list/myQuesBank.vue
  4. 157
      src/pages/system/list/role.vue
  5. 7
      src/setting.js

@ -1,5 +1,5 @@
import Setting from '@/setting'
let uploadURL = Setting.apiUploadURL
let uploadURL = Setting.upload.apiURL
export default {
// 登录 

@ -88,7 +88,7 @@
</template>
<script>
import { mapActions } from 'vuex';
import { mapActions } from 'vuex'
export default {
name: 'index',
data() {

@ -363,7 +363,8 @@ export default {
this.$message.success('上传成功')
}
}else{
res.message ? this.$message.error(res.message) : this.$message.error('上传失败,请检查数据')
// res.message ? this.$message.error(res.message) : this.$message.error('')
res.message && this.$message.error(res.message)
}
},
showFaild(){

@ -3,7 +3,6 @@
<el-card shadow="hover" class="m-b-20">
<div>
<div class="p-title m-b-20">筛选</div>
<div class="flex">
<div>
<el-input placeholder="请输入角色名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
@ -35,10 +34,10 @@
<el-table-column label="操作" width="180">
<template slot-scope="scope">
<el-button type="text" @click="showRole(scope.row)" v-auth="'system:角色权限:查看'">查看</el-button>
<template v-if="scope.row.id != 1">
<!-- <template v-if="scope.row.id != 1"> -->
<el-button type="text" @click="editRole(scope.row)" v-auth="'system:角色权限:编辑'">编辑</el-button>
<el-button type="text" @click="handleDelete(scope.row)" v-auth="'system:角色权限:删除'">删除</el-button>
</template>
<!-- </template> -->
</template>
</el-table-column>
</el-table>
@ -80,7 +79,7 @@
</template>
<script>
import { mapState } from 'vuex';
import { mapState } from 'vuex'
export default {
name: 'role',
data() {
@ -105,150 +104,13 @@ export default {
isAdd: true,
roleVisible: false,
searchTimer: null,
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: '删除'
},
]
}
]
}
],
permissions: [],
checkedIds: []
};
},
computed: {
...mapState('user', [
'clientId','clientName'
'userId','clientId'
])
},
watch: {
@ -282,8 +144,8 @@ export default {
remark : '',
id: ''
}
// this.checkedIds = []
// this.permissions = []
this.checkedIds = []
this.permissions = []
},
currentChange(val) {
this.pageNo = val;
@ -293,7 +155,6 @@ 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 => {})
}
},
@ -301,7 +162,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){
@ -324,7 +185,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)
}
}
},

@ -17,8 +17,6 @@ const Setting = {
// 接口请求地址
// apiBaseURL: env === 'development' ? 'http://192.168.31.152:8001' : 'http://39.108.250.202:8000',
apiBaseURL: env === 'development' ? 'http://192.168.31.152:8001' : 'http://39.108.250.202:9000',
// oss文件管理接口地址
apiUploadURL: 'http://8.134.8.197:8001',
// 接口请求返回错误时,弹窗的持续时间,单位:秒
modalDuration: 3,
// 接口请求返回错误时,弹窗的类型,可选值为 Message 或 Notice
@ -58,6 +56,11 @@ const Setting = {
* */
// 相同路由,不同参数间进行切换,是否强力更新
sameRouteForceUpdate: false,
// 文件上传
upload: {
apiURL: 'http://8.134.8.197:8001',
maxSize: 30,
},
// 是否使用动态路由
dynamicRoute: false
};

Loading…
Cancel
Save