mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-19 15:56:47 +08:00
feat:增加获取授权列表
This commit is contained in:
@@ -111,11 +111,11 @@
|
||||
<span>您确定要取消该用户的授权吗</span>
|
||||
</div>
|
||||
<div class="del_btnbox">
|
||||
<div class="del_btn btn1">
|
||||
<div class="btnText" @click="delete_exit">取消</div>
|
||||
<div class="del_btn btn1" @click="closeCancelModal">
|
||||
<div class="btnText">取消</div>
|
||||
</div>
|
||||
<div class="del_btn btn2">
|
||||
<div class="btnText" @click="delete_exit">确定</div>
|
||||
<div class="del_btn btn2" @click="cancelAuth">
|
||||
<div class="btnText">确定</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -124,8 +124,8 @@
|
||||
|
||||
<div class="botm"></div>
|
||||
<div class="btnn">
|
||||
<button class="btn1">取消</button>
|
||||
<button class="btn2">确定</button>
|
||||
<button class="btn1" @click="closeCancelModal">取消</button>
|
||||
<button class="btn2" @click="closeCancelModal">确定</button>
|
||||
</div>
|
||||
</a-drawer>
|
||||
</template>
|
||||
@@ -167,6 +167,7 @@ export default {
|
||||
// state: "管理权",
|
||||
// },
|
||||
],
|
||||
cancelAuthId: null, //取消授权id
|
||||
});
|
||||
|
||||
const closeDrawer = () => {
|
||||
@@ -182,8 +183,9 @@ export default {
|
||||
console.log("selectedRowKeys changed: ", selectedRowKeys);
|
||||
state.selectedRowKeys = selectedRowKeys;
|
||||
};
|
||||
const showCancelModal = () => {
|
||||
const showCancelModal = (id) => {
|
||||
state.cancelModal = true;
|
||||
state.cancelAuthId = id;
|
||||
};
|
||||
const closeCancelModal = () => {
|
||||
state.cancelModal = false;
|
||||
@@ -252,12 +254,12 @@ export default {
|
||||
width: 100,
|
||||
align: "center",
|
||||
scopedSlots: { customRender: "action" }, //引入的插槽
|
||||
customRender: () => {
|
||||
customRender: (text) => {
|
||||
return (
|
||||
<div
|
||||
class="opa"
|
||||
onClick={() => {
|
||||
showCancelModal();
|
||||
showCancelModal(text.record.id);
|
||||
}}
|
||||
>
|
||||
取消授权
|
||||
@@ -284,8 +286,26 @@ export default {
|
||||
api
|
||||
.optionAuthPerm(obj)
|
||||
.then((res) => {
|
||||
console.log("获取权限名单成功", res);
|
||||
// console.log("获取权限名单成功", res);
|
||||
if (res.data.code === 200) {
|
||||
console.log("获取权限名单成功", res.data.data.records);
|
||||
let arr = res.data.data.records;
|
||||
let array = [];
|
||||
arr.map((value) => {
|
||||
let obj = {
|
||||
key: value.id,
|
||||
id: value.id,
|
||||
|
||||
name: value.memberName ? value.memberName : "-",
|
||||
|
||||
com: value.orgName ? value.orgName : "-",
|
||||
gang: "产品经理",
|
||||
number: "20201234",
|
||||
state: "管理权",
|
||||
};
|
||||
array.push(obj);
|
||||
});
|
||||
state.tableData = array;
|
||||
state.tableDataTotal = res.data.data.total;
|
||||
}
|
||||
})
|
||||
@@ -310,6 +330,32 @@ export default {
|
||||
state.name = null;
|
||||
optionAuthPerm();
|
||||
};
|
||||
|
||||
//取消授权
|
||||
const cancelAuth = () => {
|
||||
let obj = {
|
||||
keyWord: "",
|
||||
type: 2,
|
||||
tag: 1,
|
||||
opt: 4,
|
||||
refId: state.cancelAuthId,
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
};
|
||||
console.log("获取权限名单obj", obj);
|
||||
api
|
||||
.optionAuthPerm(obj)
|
||||
.then((res) => {
|
||||
// console.log("获取权限名单成功", res);
|
||||
if (res.data.code === 200) {
|
||||
console.log("取消授权成功", res.data.data);
|
||||
optionAuthPerm();
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("取消授权失败", err);
|
||||
});
|
||||
};
|
||||
return {
|
||||
...toRefs(state),
|
||||
closeDrawer,
|
||||
@@ -321,6 +367,7 @@ export default {
|
||||
changePagination,
|
||||
searchAuth,
|
||||
resetAuth,
|
||||
cancelAuth,
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user