Skip to content

Commit

Permalink
6.14.1
Browse files Browse the repository at this point in the history
  • Loading branch information
zhpywhatever committed Jun 14, 2024
1 parent 6851166 commit 88e7029
Show file tree
Hide file tree
Showing 2 changed files with 95 additions and 9 deletions.
7 changes: 4 additions & 3 deletions frontend/src/online_user_administrator/components/black.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@
margin-top: 20px;
"
>
用户名
用户ID
<el-input
v-model="newBlack_user_name"
v-model="newBlack_user_Id"
style="width: 12.5vw"
clearable
/>
Expand Down Expand Up @@ -101,6 +101,7 @@ import { ElMessage } from "element-plus";
export default {
data() {
return {
newBlack_user_Id: 0,
newBlack_user_name: "",
newBlack_manager_name: "",
BlackInfo: {},
Expand All @@ -125,7 +126,7 @@ export default {
axios
.post("/manager/blacklist_add/", {
manager_name: this.newBlack_manager_name,
user_name: this.newBlack_user_name,
user_id: this.newBlack_user_Id,
})
.then((response) => {
console.log(response);
Expand Down
97 changes: 91 additions & 6 deletions frontend/src/online_user_administrator/components/permission.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,23 @@
size="large"
@click="
(LostVisible = true),
((Lost_id_Id = scope.row.user_id),
(UnLost_id = scope.row.user_id))
((Lost_Id = scope.row.user_id),
(UnLost_Id = scope.row.user_id))
"
>Lost</el-button
>
<el-button
link
type="danger"
size="large"
@click="
(BlacklistVisible = true),
((Black_Id = scope.row.user_id),
(UnBlack_Id = scope.row.user_id))
"
>Balicklist</el-button
>
</template>
</el-table-column>
</el-table>
Expand Down Expand Up @@ -81,6 +93,40 @@
</span>
</template>
</el-dialog>

<el-dialog
v-model="BlacklistVisible"
title="添加黑名单"
width="30%"
align-center
:before-close="handleClose"
>
<div
style="
margin-left: 2vw;
font-weight: bold;
font-size: 1rem;
margin-top: 20px;
"
>
管理员账号:
<el-input
v-model="newBlack_manager_name"
style="width: 12.5vw"
clearable
/>
</div>
<template #footer>
<span>
<el-button type="primary" @click="Blacklist()">确认添加至黑名单</el-button>
</span>
<span>
<el-button type="danger" @click="UnBlacklist()" style="margin-left: 15px"
>取消该用户黑名单</el-button
>
</span>
</template>
</el-dialog>
</el-scrollbar>
</template>
<script>
Expand All @@ -91,14 +137,18 @@ import { ElMessage } from "element-plus";
export default {
data() {
return {
Lost_id: 0,
newBlack_manager_name: "",
Lost_Id: 0,
Frozen_Id: 0,
Delete_Id: 0,
UnLost_id: 0,
UnLost_Id: 0,
UnFrozen_Id: 0,
Black_Id: 0,
UnBlack_Id: 0,
UnDelete_Id: 0,
user_datas: [],
LostVisible: false,
BlacklistVisible:false,
FrozenVisible: false,
DeleteVisible: false,
};
Expand Down Expand Up @@ -149,11 +199,46 @@ export default {
ElMessage.error(error.response.data.error);
});
},
async Blacklist() {
console.log("Black_Id:"+this.Black_Id);
this.BlacklistVisible = false;
axios
.post("/manager/blacklist_add/", {
manager_name: this.newBlack_manager_name,
user_id: this.Black_Id,
})
.then((response) => {
console.log(response);
ElMessage.success("拉黑成功"); // 显示消息提醒
this.QueryUserData();
})
.catch((error) => {
// console.log("有错误");
ElMessage.error(error.response.data.error);
});
},
async UnBlacklist() {
this.BlacklistVisible = false;
axios
.post("/manager/blacklist_delet/", {
user_id: this.UnBlack_Id,
})
.then((response) => {
console.log(response);
ElMessage.success("已从黑名单移除"); // 显示消息提醒
this.QueryUserData();
})
.catch((error) => {
// console.log("有错误");
ElMessage.error(error.response.data.error);
});
},
async Lost() {
this.LostVisible = false;
axios
.post("/manager/user_lost/", {
user_id: this.Lost_id,
user_id: this.Lost_Id,
})
.then((response) => {
console.log(response);
Expand All @@ -171,7 +256,7 @@ export default {
// console.log("看看这里喔:", this.UnLost_id);
axios
.post("/manager/user_unlost/", {
user_id: this.UnLost_id,
user_id: this.UnLost_Id,
})
.then((response) => {
console.log(response);
Expand Down

0 comments on commit 88e7029

Please sign in to comment.