Commit 91c9faaa authored by 徐一鸣's avatar 徐一鸣

用户管理-权限审批接口调试

parent cbf601ab
...@@ -15,22 +15,28 @@ ...@@ -15,22 +15,28 @@
<el-table-column label="" width="40"></el-table-column> <el-table-column label="" width="40"></el-table-column>
<el-table-column label="账号" width="160"> <el-table-column label="账号" width="160">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-text="scope.row.account"></span> <span v-text="scope.row.user_id"></span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="业务系统名称"> <el-table-column label="业务系统名称">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-text="scope.row.name"></span> <span v-text="scope.row.user_name"></span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="用户类型" align="center" width="240"> <el-table-column label="用户类型" align="center" width="240">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-text="scope.row.role"></span> <span
v-text="
['-', '超级管理员', '组织管理员', '普通用户', '开发者'][
scope.row.is_admin || 0
]
"
></span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="用户所属组织"> <el-table-column label="用户所属组织">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-text="scope.row.organization"></span> <span v-text="scope.row.department"></span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="用户状态" align="center" width="160"> <el-table-column label="用户状态" align="center" width="160">
...@@ -40,7 +46,7 @@ ...@@ -40,7 +46,7 @@
</el-table-column> </el-table-column>
<el-table-column label="申请时间" align="center" width="200"> <el-table-column label="申请时间" align="center" width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-text="scope.row.update_time"></span> <span v-text="scope.row.update_date"></span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="300"> <el-table-column label="操作" align="center" width="300">
...@@ -69,56 +75,51 @@ import apassDialog from "@/components/apass-dialog"; ...@@ -69,56 +75,51 @@ import apassDialog from "@/components/apass-dialog";
export default { export default {
components: { apassList, apassDialog }, components: { apassList, apassDialog },
data: () => ({ data: () => ({
listTotal: 300, listTotal: 0,
listData: [ listData: [],
{
account: "012344",
name: "贵阳机关事务大数据平台",
role: "普通用户",
organization: "贵阳市水利局",
state: 0,
update_time: "2020-04-27 13:24:19",
},
{
account: "012345",
name: "贵州省水利厅",
role: "普通用户",
organization: "贵阳市水利局",
state: 1,
update_time: "2020-04-27 13:24:19",
},
{
account: "012346",
name: "贵州省公安厅",
role: "普通用户",
organization: "贵阳市水利局",
state: 1,
update_time: "2020-04-27 13:24:19",
},
{
account: "012347",
name: "贵阳机关事务大数据平台",
role: "普通用户",
organization: "贵阳市水利局",
state: 1,
update_time: "2020-04-27 13:24:19",
},
{
account: "012348",
name: "长兴县应急指挥平台",
role: "普通用户",
organization: "贵阳市水利局",
state: 1,
update_time: "2020-04-27 13:24:19",
},
],
}), }),
methods: { methods: {
listAction(value) { listAction(filters) {
console.log(value); this.$http
.get("/apaas/backmgt/user/userApply/list", {
params: {
page: filters.page,
limit: filters.size,
},
})
.then(({ data }) => {
this.listTotal = data.total;
this.listData = data.data;
})
.catch((error) => {
console.log(error);
});
}, },
permissionAction(item, passFlag = true) { permissionAction(item, passFlag = true) {
console.log((passFlag ? "通过 " : "拒绝 ") + item.name); this.$http
.put(
"/apaas/backmgt/user/userApply",
{},
{
params: {
result: passFlag ? 1 : 0,
user_id: item.user_id,
id: item.id,
},
}
)
.then(({ data }) => {
this.$message({
message: `操作成功.`,
type: "success",
});
})
.catch((error) => {
this.$message({
message: `操作失败.`,
type: "warning",
});
});
}, },
}, },
}; };
......
...@@ -75,7 +75,7 @@ export default { ...@@ -75,7 +75,7 @@ export default {
}, },
deleteItem(item) { deleteItem(item) {
this.dialogInfo.title = ""; this.dialogInfo.title = "";
this.dialogInfo.msg = "确认删除当前角色"; this.dialogInfo.msg = "确认删除当前角色?";
this.dialogInfo.cancelText = ""; this.dialogInfo.cancelText = "";
this.dialogInfo.sunbmitText = ""; this.dialogInfo.sunbmitText = "";
this.dialogInfo.submit = () => { this.dialogInfo.submit = () => {
......
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
<a <a
class="btn" class="btn"
:class="{ warn: scope.row.state === 1 }" :class="{ warn: scope.row.state === 1 }"
@click="setState(scope.row)" @click="changeState(scope.row)"
> >
{{ scope.row.state === 0 ? "启用" : "禁用" }} {{ scope.row.state === 0 ? "启用" : "禁用" }}
</a> </a>
...@@ -126,11 +126,33 @@ export default { ...@@ -126,11 +126,33 @@ export default {
console.log(error); console.log(error);
}); });
}, },
setRole(item) { changeState(item) {
console.log("setRole " + item.name); console.log(item);
},
setState(item) { this.$http
console.log("setState " + item.name); .put(
"/apaas/backmgt/user/status",
{},
{
params: {
user_id: item.user_id,
status: item.state == 0 ? 1 : 0,
},
}
)
.then(({ data }) => {
this.$message({
message: `${item.state == 0 ? "已启用" : "已禁用"}${item.user_name}.`,
type: "success",
});
this.initDatas(this.tempFilter);
})
.catch((error) => {
this.$message({
message: `${item.state == 0 ? "启用" : "禁用"}${item.user_name}失败.`,
type: "warning",
});
});
}, },
}, },
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment