考核、项目列表权限控制,角色隐藏删除按钮等

dev_2022-05-11
jialong.yu 3 years ago
parent d6f052d4e2
commit bab1a5e1d1
  1. 18
      src/pages/account/login/index.vue
  2. 6
      src/pages/achievement/show/index.vue
  3. 4
      src/pages/assessment/add/index.vue
  4. 17
      src/pages/assessment/list/index.vue
  5. 28
      src/pages/project/list/index.vue
  6. 2
      src/pages/system/list/role.vue
  7. 4
      src/setting.js
  8. 6
      src/store/modules/user.js

@ -62,7 +62,7 @@
</template>
<script>
import { mapActions } from "vuex";
import { mapActions, mapMutations } from "vuex";
import vFooter from "@/layouts/footer";
import util from "@/libs/util";
import Setting from "@/setting";
@ -108,6 +108,9 @@ export default {
});
},
methods: {
...mapMutations("user", [
"SET_ROLENAME"
]),
...mapActions("user", [
"setCustomer", "setCustomerName"
]),
@ -131,15 +134,20 @@ export default {
this.getVerImg();
this.loginForm.code = "";
util.local.set(Setting.tokenKey, res.data.token, Setting.tokenExpires);
this.queryCustomer();
}).catch(res => {
});
this.getRole()
this.queryCustomer()
}).catch(res => {})
} else {
return util.errorMsg("请检查表单数据");
}
});
},
//
getRole() {
this.$post(`${this.api.getUserAllRoleByToken}?platformId=${Setting.platformId}`).then(res => {
this.SET_ROLENAME(res)
}).catch(err => {})
},
queryCustomer() { //
this.$get(this.api.isClient).then(res => {
util.successMsg("登录成功");

@ -59,7 +59,7 @@
{{ scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column prop="judgmentName" label="任务名称" align="center">
<el-table-column prop="judgmentName" label="任务名称" align="center" min-width="200">
</el-table-column>
<el-table-column v-if='project' prop="userAnswer" label="考核点" align="center" >
<template slot-scope="scope">
@ -68,7 +68,7 @@
</div>
</template>
</el-table-column>
<el-table-column prop="answer" label="参考答案" align="center" width="400">
<el-table-column prop="answer" label="参考答案" align="center" min-width="400">
<template slot-scope="scope">
<div v-if=' scope.row.lcRuleRecords'>
<div v-for="(item, index) in scope.row.lcRuleRecords">
@ -80,7 +80,7 @@
</div>
</template>
</el-table-column>
<el-table-column prop="userAnswer" label="学生答案" align="center" width="400">
<el-table-column prop="userAnswer" label="学生答案" align="center" min-width="400">
<template slot-scope="scope">
<div v-if=' scope.row.lcRuleRecords'>
<div v-for="(item, index) in scope.row.lcRuleRecords">

@ -397,11 +397,13 @@ export default {
});
},
getProjectData() {
const curItem = this.curriculumList.find(e => e.cid === this.form.curriculumId)
let data={
pageNum:this.page,
pageSize:this.pageSize,
cid:this.form.curriculumId,
projectName:this.keyword
projectName:this.keyword,
systemId: curItem ? curItem.systemId : 1
}
this.$post(this.api.projectListByCourseId,data).then(res => {
let { status, data } = res;

@ -96,19 +96,19 @@
</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="170">
<el-table-column label="操作" width="170">
<template slot-scope="scope">
<template v-if="scope.row.status == 0">
<template v-if="scope.row.status == 0 && (roleName.includes('超级') || roleName === scope.row.roleName || (roleName === '管理员' && !scope.row.roleName.includes('超级')))">
<el-button v-if="scope.row.type == 1" type="text" @click="start(scope.row)">启动</el-button>
<el-button v-if="auth('修改')" type="text" @click="edit(scope.row)">修改</el-button>
</template>
<template v-else-if="scope.row.status == 1">
<template v-else-if="scope.row.status == 1 && (roleName.includes('超级') || roleName === scope.row.roleName || (roleName === '管理员' && !scope.row.roleName.includes('超级')))">
<el-button v-if="auth('提前结束')" type="text" @click="finish(scope.row)">提前结束</el-button>
</template>
<template v-else-if="scope.row.status == 2">
<el-button v-if="auth('查看成绩')" type="text" @click="show(scope.row)">查看成绩</el-button>
</template>
<el-button v-if="(scope.row.status == 0 || scope.row.status == 2) && auth('删除')" type="text" @click="delData(scope.row)">删除</el-button>
<el-button v-if="(scope.row.status == 0 || scope.row.status == 2) && auth('删除') && (roleName.includes('超级') || roleName === scope.row.roleName || (roleName === '管理员' && !scope.row.roleName.includes('超级')))" type="text" @click="delData(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
@ -119,8 +119,8 @@
</template>
<script>
import { mapState } from "vuex";
import util from "@/libs/util";
export default {
data() {
return {
@ -188,9 +188,14 @@ export default {
listLoading:false,//
ticker: null, //
sss:1,
datassdata:0,
datassdata:0
};
},
computed: {
...mapState("user", [
'roleName'
])
},
watch: {
"form.month": function(val) {
if (val) {

@ -87,8 +87,8 @@
<el-table-column label="操作">
<template slot-scope="scope">
<el-button type="text" @click="edit(scope.row,'0',queryData.founder)">查看</el-button>
<el-button v-if="scope.row.founder && (isSuper || roleName === scope.row.roleName || (roleName === '管理员' && !scope.row.roleName.includes('超级')))" type="text" @click="edit(scope.row,'1',queryData.founder)">编辑</el-button>
<el-button v-if="scope.row.founder && (isSuper || roleName === scope.row.roleName || (roleName === '管理员' && !scope.row.roleName.includes('超级')))" type="text" @click="handleDelete(scope.row.projectId)">删除</el-button>
<el-button v-if="scope.row.founder && (roleName.includes('超级') || roleName === scope.row.roleName || (roleName === '管理员' && !scope.row.roleName.includes('超级')))" type="text" @click="edit(scope.row,'1',queryData.founder)">编辑</el-button>
<el-button v-if="scope.row.founder && (roleName.includes('超级') || roleName === scope.row.roleName || (roleName === '管理员' && !scope.row.roleName.includes('超级')))" type="text" @click="handleDelete(scope.row.projectId)">删除</el-button>
<el-button v-if="auth('复制')" type="text" @click="copyData(scope.row.projectId)">复制</el-button>
<el-switch
v-if="auth('禁用')"
@ -123,10 +123,8 @@
</template>
<script>
import Setting from "@/setting";
import { mapState, mapActions, mapMutations } from "vuex";
import util from "@/libs/util";
export default {
data() {
return {
@ -202,15 +200,12 @@ export default {
copyVisible: false,
projectName: "",
currentRow: {}, //
listDataAll: [],
isSuper: false, //
isAdmin: false, //
roleName: '' //
listDataAll: []
};
},
computed: {
...mapState("user", [
"userId", "roleId"
"userId", "roleId", 'roleName'
]),
...mapState("project", [
"lastSystemId",
@ -232,11 +227,8 @@ export default {
deep: true
}
},
// created() {
// this.queryData = this.queryDataStatus
// },
mounted() {
this.getRole()
this.getSystemData()
if(this.queryDataStatus.platformId) {
this.queryData = this.queryDataStatus
}
@ -267,16 +259,6 @@ export default {
});
},
//
getRole() {
this.$post(`${this.api.getUserAllRoleByToken}?platformId=${Setting.platformId}`).then(res => {
this.isSuper = res.includes('超级管理员')
this.isAdmin = res === '管理员'
this.roleName = res
this.getSystemData();
}).catch(err => {
});
},
getData() {
this.setSystemId(this.systemId);
let data = {

@ -26,7 +26,7 @@
<template slot-scope="scope">
<el-button v-if="auth('角色权限-查看')" type="text" @click="showRole(scope.row)">查看</el-button>
<el-button v-if="auth('角色权限-编辑') && scope.row.roleName !== '超级管理员'" type="text" @click="editRole(scope.row)">编辑</el-button>
<el-button v-if="auth('角色权限-删除') && scope.row.roleName !== '超级管理员'" type="text" @click="handleDelete(scope.row)">删除</el-button>
<el-button v-if="auth('角色权限-删除') && scope.row.roleName !== '超级管理员' && scope.row.roleName !== '管理员'" type="text" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>

@ -36,8 +36,8 @@ if (isHh) {
} else if (isDev) {
jumpPath = "http://192.168.31.154:8087/";
// host = "http://www.occupationlab.com:9000/";//线上
host = "http://39.108.250.202:9000/"; // 中台测试服
// host = "http://192.168.31.151:9000/"; // 榕
// host = "http://39.108.250.202:9000/"; // 中台测试服
host = "http://192.168.31.151:9000/"; // 榕
// host = "http://192.168.31.125:9000/"; // 坤
// host = 'http://192.168.31.137:9000/'; // 赓
title = "职站服务端管理系统";

@ -18,7 +18,8 @@ export default {
userId: 3,
userName: "",
roleId: "",
dataTime: ""
dataTime: "",
roleName: ''
},
mutations: {
SET_INFO: (state, info) => {
@ -45,6 +46,9 @@ export default {
},
SET_USERNAME: (state, userName) => {
state.userName = userName;
},
SET_ROLENAME: (state, roleName) => {
state.roleName = roleName
}
},
actions: {

Loading…
Cancel
Save