feat(BD列表): 操作列表新增“权限分配”
This commit is contained in:
parent
68193b5ed6
commit
b63f164bc5
@ -123,3 +123,28 @@ export function pageWorkStatistics(params) {
|
|||||||
params
|
params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取用户选中的权限信息
|
||||||
|
export function getSysBDAuthResourceByUserId(userId) {
|
||||||
|
return request({
|
||||||
|
url: `/team/bd/auth-resources?userId=${userId}`,
|
||||||
|
method: "get"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// APP权限列表
|
||||||
|
export function getBDAuthTable() {
|
||||||
|
return request({
|
||||||
|
url: "/team/bd/auth-resource",
|
||||||
|
method: "get"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改权限
|
||||||
|
export function deleteAndAddBDAuth(data) {
|
||||||
|
return request({
|
||||||
|
url: "/team/bd/auth",
|
||||||
|
method: "put",
|
||||||
|
data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|||||||
126
src/views/team/business-development/auth.vue
Normal file
126
src/views/team/business-development/auth.vue
Normal file
@ -0,0 +1,126 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog
|
||||||
|
title="权限设置"
|
||||||
|
:visible="true"
|
||||||
|
width="400px"
|
||||||
|
:before-close="handleClose"
|
||||||
|
>
|
||||||
|
<el-form ref="form" :model="form">
|
||||||
|
<el-checkbox-group
|
||||||
|
v-model="form.resourceList"
|
||||||
|
size="small"
|
||||||
|
class="flex-l flex-wrap"
|
||||||
|
>
|
||||||
|
<el-checkbox
|
||||||
|
v-for="item in sysResourceList"
|
||||||
|
:key="item.id"
|
||||||
|
style=" margin-bottom:20px"
|
||||||
|
:label="item.id"
|
||||||
|
>{{ item.resourceName }}
|
||||||
|
</el-checkbox>
|
||||||
|
</el-checkbox-group>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<div slot="footer">
|
||||||
|
<el-button type="primary" @click="submit()">提交</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
getSysBDAuthResourceByUserId,
|
||||||
|
getBDAuthTable,
|
||||||
|
deleteAndAddBDAuth
|
||||||
|
} from "@/api/room-anchor";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "AdministratorAuth",
|
||||||
|
props: {
|
||||||
|
userId: {
|
||||||
|
type: String,
|
||||||
|
default: ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
sysResourceList: [],
|
||||||
|
activeUserId: "",
|
||||||
|
listLoading: false,
|
||||||
|
form: {
|
||||||
|
userId: "",
|
||||||
|
resourceList: []
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
userId: {
|
||||||
|
immediate: true,
|
||||||
|
deep: true,
|
||||||
|
handler(newVal) {
|
||||||
|
if (newVal) {
|
||||||
|
this.form.userId = newVal;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.AdministratorAuthTable();
|
||||||
|
this.renderData();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleClose() {
|
||||||
|
this.$emit("close");
|
||||||
|
},
|
||||||
|
AdministratorAuthTable() {
|
||||||
|
const that = this;
|
||||||
|
that.listLoading = true;
|
||||||
|
getBDAuthTable()
|
||||||
|
.then(res => {
|
||||||
|
that.listLoading = false;
|
||||||
|
that.sysResourceList = res.body || [];
|
||||||
|
})
|
||||||
|
.catch(er => {
|
||||||
|
console.error(er);
|
||||||
|
that.listLoading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
renderData() {
|
||||||
|
const that = this;
|
||||||
|
that.listLoading = true;
|
||||||
|
getSysBDAuthResourceByUserId(that.form.userId)
|
||||||
|
.then(res => {
|
||||||
|
that.listLoading = false;
|
||||||
|
that.form.resourceList = res.body || [];
|
||||||
|
})
|
||||||
|
.catch(er => {
|
||||||
|
console.error(er);
|
||||||
|
that.listLoading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
submit() {
|
||||||
|
const that = this;
|
||||||
|
that.listLoading = true;
|
||||||
|
deleteAndAddBDAuth(that.form)
|
||||||
|
.then(res => {
|
||||||
|
that.listLoading = false;
|
||||||
|
that.$opsMessage.success();
|
||||||
|
that.$emit("success", Object.assign({}, that.form));
|
||||||
|
that.handleClose();
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
that.listLoading = false;
|
||||||
|
that.$emit("fial", err);
|
||||||
|
that.handleClose();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
accountHandleSuccess(data) {
|
||||||
|
this.$message({
|
||||||
|
message: "Successful",
|
||||||
|
type: "success"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
@ -261,6 +261,13 @@
|
|||||||
@click.native="changeBinding(scope.row, scope.$index)"
|
@click.native="changeBinding(scope.row, scope.$index)"
|
||||||
>换绑BD Leader</el-dropdown-item
|
>换绑BD Leader</el-dropdown-item
|
||||||
>
|
>
|
||||||
|
|
||||||
|
<!-- 权限分配 -->
|
||||||
|
<el-dropdown-item
|
||||||
|
v-if="buttonPermissions.includes('bd:list:role:change')"
|
||||||
|
@click.native="AttributionSystem(scope.row)"
|
||||||
|
>权限分配</el-dropdown-item
|
||||||
|
>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
</template>
|
</template>
|
||||||
@ -311,6 +318,13 @@
|
|||||||
@close="teamBindDrawerVisible = false"
|
@close="teamBindDrawerVisible = false"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<!-- 权限分配组件 -->
|
||||||
|
<auth-system
|
||||||
|
v-if="authSystemVisable"
|
||||||
|
:user-id="thatSelectedUserId"
|
||||||
|
@close="authSystemVisable = false"
|
||||||
|
/>
|
||||||
|
|
||||||
<!-- 绑定BDLeader 组件 -->
|
<!-- 绑定BDLeader 组件 -->
|
||||||
<bind-bd-leader
|
<bind-bd-leader
|
||||||
v-if="BDLeaderBindDrawerVisible"
|
v-if="BDLeaderBindDrawerVisible"
|
||||||
@ -347,6 +361,7 @@ import AddBd from "./add-bd";
|
|||||||
import TeamCreate from "./../components/TeamCreate";
|
import TeamCreate from "./../components/TeamCreate";
|
||||||
import BindTeam from "./bind-team";
|
import BindTeam from "./bind-team";
|
||||||
import bindBdLeader from "./bind-bd-leader";
|
import bindBdLeader from "./bind-bd-leader";
|
||||||
|
import authSystem from "./auth";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "BusinessDevelopment",
|
name: "BusinessDevelopment",
|
||||||
@ -356,12 +371,14 @@ export default {
|
|||||||
AddBd,
|
AddBd,
|
||||||
TeamCreate,
|
TeamCreate,
|
||||||
BindTeam,
|
BindTeam,
|
||||||
bindBdLeader
|
bindBdLeader,
|
||||||
|
authSystem
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
teamBindDrawerVisible: false,
|
teamBindDrawerVisible: false,
|
||||||
BDLeaderBindDrawerVisible: false,
|
BDLeaderBindDrawerVisible: false,
|
||||||
|
authSystemVisable: false,
|
||||||
thatRow: {},
|
thatRow: {},
|
||||||
bdOps: {},
|
bdOps: {},
|
||||||
teamCreateVisible: false,
|
teamCreateVisible: false,
|
||||||
@ -535,6 +552,12 @@ export default {
|
|||||||
this.BDLeaderBindDrawerVisible = true;
|
this.BDLeaderBindDrawerVisible = true;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
AttributionSystem(row) {
|
||||||
|
const that = this;
|
||||||
|
this.thatSelectedUserId = row.userId;
|
||||||
|
that.authSystemVisable = true;
|
||||||
|
},
|
||||||
|
|
||||||
// 展示团队成员
|
// 展示团队成员
|
||||||
clickTeamMember(row) {
|
clickTeamMember(row) {
|
||||||
this.teamMemberVisible = true;
|
this.teamMemberVisible = true;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user