增加管理员删除操作
This commit is contained in:
@@ -2,7 +2,7 @@ import Vue from 'vue'
|
||||
import App from './App.vue'
|
||||
import router from './router'
|
||||
import store from './store'
|
||||
import { Message, Pagination, Alert, Loading } from 'element-ui';
|
||||
import { Message, Pagination, Alert, Loading, Dialog } from 'element-ui';
|
||||
import 'element-ui/lib/theme-chalk/index.css';
|
||||
import { skipUrl, pageStop, pageMove, goTologin, copy, startupUnderLoading, closeUnderLoading, formattedDate, updateURLSearchParams, clearCookies } from "@/utils/common.js"
|
||||
import http from "@/utils/request"
|
||||
@@ -44,6 +44,7 @@ if (!Array.isArray) {
|
||||
Vue.use(Pagination);
|
||||
Vue.use(Alert);
|
||||
Vue.use(Loading);
|
||||
Vue.use(Dialog);
|
||||
|
||||
// v-focus
|
||||
Vue.directive('focus', {
|
||||
|
||||
@@ -32,7 +32,7 @@ service.interceptors.request.use(
|
||||
// config['headers']['authorization'] = "661aiz52k5e6vqgmkxnz0wvbv8nciz8h"
|
||||
|
||||
// if (process.env.NODE_ENV == "development") config['headers']['authorization'] = "0h870ovk2xckoqfsh8a3t3sg4sg5z7eg"
|
||||
if (process.env.NODE_ENV == "development") config["headers"]["authorization"] = "95paemsnrr393p9vikpp16qo72"
|
||||
if (process.env.NODE_ENV == "development") config["headers"]["authorization"] = "d515090446191e8cc90d98f9a216af1c"
|
||||
|
||||
return config
|
||||
},
|
||||
|
||||
@@ -29,6 +29,21 @@
|
||||
<a class="edit-box flexcenter" v-if="info.isauthor == 1" :href="`https://www.gter.net/bbs/post/edit.html?tid=${tid}&pid=${info.pid}`">
|
||||
<img class="edit-icom" src="@/assets/img/detail/edit.png" />
|
||||
</a>
|
||||
|
||||
<div class="manager-box" v-if="managementauthority">
|
||||
<div class="dot-box flexflex" @click="openAdminOperate(null)">
|
||||
<div class="item"></div>
|
||||
<div class="item"></div>
|
||||
<div class="item"></div>
|
||||
</div>
|
||||
<template v-if="adminOperateState">
|
||||
<div class="operate-mask" @click="closeAdminOperate"></div>
|
||||
<div class="operate">
|
||||
<div class="item" @click="popUupDialog(0)">删除该帖</div>
|
||||
<div class="item" @click="popUupDialog(1)">删帖且禁言</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
<template v-if="type == 5">
|
||||
<div class="summary-content">
|
||||
@@ -165,6 +180,20 @@
|
||||
<div class="edit-box flexcenter" v-if="item.ismyself == 1" @click.stop="openEditPop(item)">
|
||||
<img class="edit-icom" src="@/assets/img/detail/edit.png" />
|
||||
</div>
|
||||
<div class="manager-box" v-if="managementauthority">
|
||||
<div class="dot-box flexflex" @click="openAdminOperate(index)">
|
||||
<div class="item"></div>
|
||||
<div class="item"></div>
|
||||
<div class="item"></div>
|
||||
</div>
|
||||
<template v-if="item.adminOperateState">
|
||||
<div class="operate-mask" @click="closeAdminOperate"></div>
|
||||
<div class="operate">
|
||||
<div class="item" @click="popUupDialog(0)">删除该楼</div>
|
||||
<div class="item" @click="popUupDialog(1)">删楼且禁言</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-content flex1" @click.stop="handleReplyPop(item)" v-html="item.message"></div>
|
||||
@@ -527,6 +556,10 @@ export default {
|
||||
9: "CS/EE",
|
||||
10: "生农医药",
|
||||
},
|
||||
|
||||
adminOperateState: false, // 管理员面板 显示状态
|
||||
deletePostToken: "",
|
||||
managementauthority: 0, // 是否是管理员
|
||||
}
|
||||
},
|
||||
|
||||
@@ -569,7 +602,7 @@ export default {
|
||||
let data = res.data
|
||||
let info = data.info
|
||||
|
||||
console.log(data.type)
|
||||
this.managementauthority = data.managementauthority
|
||||
|
||||
info["message"] = info["message"].trim()
|
||||
|
||||
@@ -1165,6 +1198,53 @@ export default {
|
||||
this.locationThreadData = obj1
|
||||
})
|
||||
},
|
||||
|
||||
// 打开管理员 面板
|
||||
openAdminOperate(index) {
|
||||
this.deletePostToken = ""
|
||||
|
||||
if (index == null) {
|
||||
this.adminOperateState = true
|
||||
this.deletePostToken = this.token
|
||||
return
|
||||
}
|
||||
this.postList.list[index]["adminOperateState"] = true
|
||||
this.deletePostToken = this.postList.list[index].token
|
||||
|
||||
this.$forceUpdate()
|
||||
// this.postList = this.token
|
||||
},
|
||||
|
||||
// 关闭管理员 面板
|
||||
closeAdminOperate() {
|
||||
this.adminOperateState = false
|
||||
|
||||
this.postList.list.forEach(element => {
|
||||
element["adminOperateState"] = false
|
||||
})
|
||||
this.$forceUpdate()
|
||||
},
|
||||
|
||||
// 弹出提示框
|
||||
popUupDialog(hackinguser) {
|
||||
this.closeAdminOperate()
|
||||
const userConfirmed = confirm(`确定要${hackinguser ? "删除且禁言" : "删除"}?`)
|
||||
if (userConfirmed) {
|
||||
this.deletePost(hackinguser)
|
||||
}
|
||||
},
|
||||
|
||||
// 删帖
|
||||
deletePost(hackinguser) {
|
||||
this.$http.post("/api/manage/delete", { token: this.deletePostToken, hackinguser }).then(res => {
|
||||
if (res.code != 200) return
|
||||
if (document.referrer) window.history.back()
|
||||
else window.location.href = "/"
|
||||
|
||||
this.openHintBox("res.message")
|
||||
this.deletePostToken = ""
|
||||
})
|
||||
},
|
||||
},
|
||||
|
||||
components: {
|
||||
@@ -1338,6 +1418,57 @@ export default {
|
||||
width: 0.4rem;
|
||||
}
|
||||
}
|
||||
|
||||
.manager-box {
|
||||
position: relative;
|
||||
|
||||
.dot-box {
|
||||
margin-left: 0.4533rem;
|
||||
height: 0.8rem;
|
||||
align-items: center;
|
||||
.item {
|
||||
width: 0.1333rem;
|
||||
height: 0.1333rem;
|
||||
border-radius: 50%;
|
||||
background: #8a8a8a;
|
||||
border: 0.0133rem #7f7f7f solid;
|
||||
&:not(:last-of-type) {
|
||||
margin-right: 0.04rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.operate-mask {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
background: rgba(138, 138, 138, 0.6);
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.operate {
|
||||
box-shadow: 0 0 0.3rem rgba(0, 0, 0, 0.1);
|
||||
background: #fff;
|
||||
position: absolute;
|
||||
top: 0.8rem;
|
||||
right: 0;
|
||||
font-size: 0.36rem;
|
||||
width: 2.9067rem;
|
||||
border-radius: 0.1rem;
|
||||
|
||||
.item {
|
||||
height: 1.0667rem;
|
||||
line-height: 1.0667rem;
|
||||
text-align: center;
|
||||
color: #333;
|
||||
|
||||
&:not(:last-of-type) {
|
||||
border-bottom: 0.0133rem solid #f0f0f0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.card-content {
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
|
||||
<div v-if="count > limit" class="paging flexcenter">
|
||||
<el-pagination small background layout="prev, pager, next" @current-change="currentChange()"
|
||||
:current-page.sync="page" :page-size="limit" :total="count">
|
||||
:current-page.sync="page" :page-size="limit" :total="count * 1">
|
||||
</el-pagination>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user