白名单功能暂存
This commit is contained in:
20
src/api/AccessRestriction.vue/AccessRestriction.js
Normal file
20
src/api/AccessRestriction.vue/AccessRestriction.js
Normal file
@@ -0,0 +1,20 @@
|
||||
import request from '@/utils/request';
|
||||
import qs from 'qs';
|
||||
|
||||
|
||||
//
|
||||
export const redEnvelopePage = query => {
|
||||
return request({
|
||||
url: '/admin/room/redEnvelope/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
//
|
||||
export const redEnvelopeSave = query => {
|
||||
return request({
|
||||
url: '/admin/room/redEnvelope/save',
|
||||
method: 'post',
|
||||
params: query
|
||||
});
|
||||
};
|
152
src/views/accessRestriction/AccessRestriction.vue
Normal file
152
src/views/accessRestriction/AccessRestriction.vue
Normal file
@@ -0,0 +1,152 @@
|
||||
<template>
|
||||
<div class="outer">
|
||||
<div class="search">
|
||||
<div class="searchLeft">
|
||||
<span>用户平台ID</span>
|
||||
<el-input
|
||||
v-model="userId"
|
||||
size="default"
|
||||
placeholder="用户平台ID"
|
||||
class="input"
|
||||
></el-input>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 按钮 -->
|
||||
<div class="buttonBox">
|
||||
<el-button class="primary" type="primary" size="default" @click="search()"
|
||||
>查询</el-button
|
||||
>
|
||||
</div>
|
||||
<!-- 列表 -->
|
||||
<el-table :data="tableData" border style="width: 100%; margin-top: 25px">
|
||||
<el-table-column prop="" align="center" label="用戶id" />
|
||||
<el-table-column prop="" align="center" label="用戶昵称" />
|
||||
<el-table-column prop="" align="center" label="手机号" />
|
||||
<el-table-column prop="" align="center" label="注册时间" />
|
||||
<el-table-column prop="" align="center" label="进入访问限制时间" />
|
||||
<el-table-column prop="" align="center" label="邀请码" />
|
||||
<el-table-column prop="" align="center" label="注册设备" />
|
||||
<el-table-column prop="" align="center" label="访问设备" />
|
||||
<el-table-column prop="" align="center" label="最近一次访问低点" />
|
||||
<el-table-column align="center" label="操作" width="400">
|
||||
<template v-slot="scope">
|
||||
<el-button
|
||||
@click="unfreeze(scope.row)"
|
||||
class="primary"
|
||||
type="primary"
|
||||
size="default"
|
||||
>解除限制</el-button
|
||||
>
|
||||
<el-button
|
||||
@click="addWhite(scope.row)"
|
||||
class="primary"
|
||||
type="primary"
|
||||
size="default"
|
||||
>加入白名单</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<el-pagination
|
||||
style="margin-top: 10px"
|
||||
class="paginationClass"
|
||||
v-model:current-page="currentPage"
|
||||
v-model:page-size="pageSize"
|
||||
:page-sizes="[10, 20, 30, 40, 50, 100, 200, 300, 400, 500]"
|
||||
:small="small"
|
||||
:disabled="disabled"
|
||||
:background="background"
|
||||
layout="sizes, prev, pager, next"
|
||||
:total="total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
/>
|
||||
<!-- 公共二次确认删除弹窗 -->
|
||||
<el-dialog v-model="delDialog" title="提示" width="30%" center>
|
||||
<span> {{ delDialogText }}</span>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="delDialog = false">取消</el-button>
|
||||
<el-button type="primary" @click="sureClick(val, type)"> 确认 </el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
// import {} from "@/api/accessRestriction.vue/AccessRestriction.vue";
|
||||
import { ElMessage } from "element-plus";
|
||||
export default {
|
||||
name: "AccessRestriction",
|
||||
data() {
|
||||
return {
|
||||
userId: "", //用戶id
|
||||
tableData: [], //列表数据
|
||||
total: 10, //总页数
|
||||
currentPage: 1, //页码
|
||||
pageSize: 10, //条数
|
||||
delDialog: true, //控制公共弹窗展示
|
||||
delDialogText: "", //公共弹窗标题
|
||||
};
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
// 搜索
|
||||
search() {},
|
||||
// 解除限制按钮
|
||||
unfreeze(row) {
|
||||
console.log(row);
|
||||
},
|
||||
// 加入白名单
|
||||
addWhite(row) {
|
||||
console.log(row);
|
||||
},
|
||||
// 二次确认
|
||||
sureClick() {},
|
||||
// 分页导航
|
||||
handleSizeChange(val) {
|
||||
// this.getData();
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
// this.getData();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.outer {
|
||||
padding-top: 20px;
|
||||
background: #ecf0f5;
|
||||
border-top: 3px solid #d2d6de;
|
||||
.search {
|
||||
width: 100%;
|
||||
height: 41px;
|
||||
.searchLeft,
|
||||
.searchRight {
|
||||
width: 20%;
|
||||
float: left;
|
||||
span {
|
||||
margin-right: 10px;
|
||||
}
|
||||
.input {
|
||||
width: 75%;
|
||||
}
|
||||
}
|
||||
}
|
||||
.buttonBox {
|
||||
margin-top: 10px;
|
||||
}
|
||||
.authorityBox {
|
||||
.authoritySpan {
|
||||
margin-right: 20px;
|
||||
}
|
||||
.authorityInpput {
|
||||
width: 50%;
|
||||
}
|
||||
}
|
||||
.dialogTableVisibleBut {
|
||||
margin: -25px 0 20px 0px;
|
||||
}
|
||||
}
|
||||
</style>
|
261
src/views/accessRestriction/AccessWhitelist.vue
Normal file
261
src/views/accessRestriction/AccessWhitelist.vue
Normal file
@@ -0,0 +1,261 @@
|
||||
<template>
|
||||
<div class="outer">
|
||||
<!-- 搜索 -->
|
||||
<div class="search">
|
||||
<div class="searchLeft">
|
||||
<span>用户平台ID</span>
|
||||
<el-input
|
||||
v-model="userId"
|
||||
size="default"
|
||||
placeholder="用户平台ID"
|
||||
class="input"
|
||||
></el-input>
|
||||
</div>
|
||||
<div class="searchRight">
|
||||
<span>用户手机号</span>
|
||||
<el-input
|
||||
v-model="userPhone"
|
||||
size="default"
|
||||
placeholder="用户手机号"
|
||||
class="input"
|
||||
></el-input>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 按钮 -->
|
||||
<div class="buttonBox">
|
||||
<el-button class="primary el-icon-edi" type="primary" size="default" @click="add()"
|
||||
>新增</el-button
|
||||
>
|
||||
<el-button class="primary" type="primary" size="default" @click="search()"
|
||||
>查询</el-button
|
||||
>
|
||||
</div>
|
||||
<!-- 列表 -->
|
||||
<el-table :data="tableData" border style="width: 100%; margin-top: 25px">
|
||||
<el-table-column prop="" align="center" label="用戶id" />
|
||||
<el-table-column prop="" align="center" label="用戶昵称" />
|
||||
<el-table-column prop="" align="center" label="昵称" />
|
||||
<el-table-column prop="" align="center" label="注册时间" />
|
||||
<el-table-column prop="" align="center" label="身份" />
|
||||
<el-table-column prop="" align="center" label="进入白名单时间" />
|
||||
<el-table-column prop="" align="center" label="最近一次访问低点" />
|
||||
<el-table-column prop="" align="center" label="进入白名单来源" />
|
||||
<el-table-column align="center" label="操作" width="400">
|
||||
<template v-slot="scope">
|
||||
<el-button
|
||||
@click="delWhite(scope.row)"
|
||||
class="primary"
|
||||
type="primary"
|
||||
size="default"
|
||||
>加入白名单</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<el-pagination
|
||||
style="margin-top: 10px"
|
||||
class="paginationClass"
|
||||
v-model:current-page="currentPage"
|
||||
v-model:page-size="pageSize"
|
||||
:page-sizes="[10, 20, 30, 40, 50, 100, 200, 300, 400, 500]"
|
||||
:small="small"
|
||||
:disabled="disabled"
|
||||
:background="background"
|
||||
layout="sizes, prev, pager, next"
|
||||
:total="total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
/>
|
||||
<!-- 公共二次确认删除弹窗 -->
|
||||
<el-dialog v-model="delDialog" title="提示" width="30%" center>
|
||||
<span> {{ delDialogText }}</span>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="delDialog = false">取消</el-button>
|
||||
<el-button type="primary" @click="sureClick(val, type)"> 确认 </el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<!-- 添加弹窗 -->
|
||||
<el-dialog v-model="addSure" title="提示" width="30%" center>
|
||||
<div class="selectBox">
|
||||
<span>添加号码类型</span>
|
||||
<el-select v-model="value" placeholder="请选择" @change="changeFun">
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="selectBox">
|
||||
<span>用户ID</span>
|
||||
<el-input
|
||||
v-model="selectUserId"
|
||||
size="default"
|
||||
placeholder="用户平台ID"
|
||||
class="input"
|
||||
></el-input>
|
||||
</div>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="delDialog = false">取消</el-button>
|
||||
<el-button type="primary" @click="addSureClick(val, type)"> 添加 </el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<el-upload
|
||||
action="https://jsonplaceholder.typicode.com/posts/"
|
||||
list-type="picture-card"
|
||||
:on-preview="handlePictureCardPreview"
|
||||
:on-remove="handleRemove"
|
||||
>
|
||||
<i class="el-icon-plus"></i>
|
||||
</el-upload>
|
||||
<el-dialog v-model:visible="dialogVisible">
|
||||
<img width="100%" :src="dialogImageUrl" alt="" />
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
// import {} from "@/api/accessRestriction/AccessRestriction";
|
||||
import { ElMessage } from "element-plus";
|
||||
export default {
|
||||
name: "AccessWhitelist",
|
||||
data() {
|
||||
return {
|
||||
userId: "", //用戶id
|
||||
userPhone: "", //用戶手机号
|
||||
tableData: [], //列表数据
|
||||
total: 10, //总页数
|
||||
currentPage: 1, //页码
|
||||
pageSize: 10, //条数
|
||||
delDialog: false, //控制公共弹窗展示
|
||||
delDialogText: "确定要移除白名单吗?", //公共弹窗标题
|
||||
addSure: false, //控制确认添加弹窗展示
|
||||
value: "1", //选择器
|
||||
options: [
|
||||
{
|
||||
value: "1",
|
||||
label: "用户id",
|
||||
},
|
||||
{
|
||||
value: "2",
|
||||
label: "用户手机号",
|
||||
},
|
||||
],
|
||||
selectUserId: "", //添加弹窗用户id
|
||||
|
||||
dialogImageUrl: "",
|
||||
dialogVisible: false,
|
||||
};
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
// 新增
|
||||
add() {},
|
||||
// 搜索
|
||||
search() {},
|
||||
// 移除白名单
|
||||
delWhite(row) {
|
||||
console.log(row);
|
||||
},
|
||||
// 二次确认
|
||||
sureClick() {},
|
||||
// 添加确认
|
||||
addSureClick() {},
|
||||
changeFun(e) {
|
||||
console.log(this.value);
|
||||
},
|
||||
// 分页导航
|
||||
handleSizeChange(val) {
|
||||
// this.getData();
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
// this.getData();
|
||||
},
|
||||
|
||||
handleRemove(file, fileList) {
|
||||
console.log(file, fileList);
|
||||
},
|
||||
handlePictureCardPreview(file) {
|
||||
this.dialogImageUrl = file.url;
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="less">
|
||||
.outer {
|
||||
padding-top: 20px;
|
||||
background: #ecf0f5;
|
||||
border-top: 3px solid #d2d6de;
|
||||
.search {
|
||||
width: 100%;
|
||||
height: 41px;
|
||||
.searchLeft,
|
||||
.searchRight {
|
||||
width: 20%;
|
||||
float: left;
|
||||
span {
|
||||
margin-right: 10px;
|
||||
}
|
||||
.input {
|
||||
width: 75%;
|
||||
}
|
||||
}
|
||||
}
|
||||
.buttonBox {
|
||||
margin-top: 10px;
|
||||
}
|
||||
.authorityBox {
|
||||
.authoritySpan {
|
||||
margin-right: 20px;
|
||||
}
|
||||
.authorityInpput {
|
||||
width: 50%;
|
||||
}
|
||||
}
|
||||
.dialogTableVisibleBut {
|
||||
margin: -25px 0 20px 0px;
|
||||
}
|
||||
.selectBox {
|
||||
margin-bottom: 10px;
|
||||
span {
|
||||
display: inline-block;
|
||||
margin-right: 25px;
|
||||
}
|
||||
.el-input {
|
||||
width: 40%;
|
||||
}
|
||||
}
|
||||
|
||||
.avatar-uploader .el-upload {
|
||||
border: 1px dashed #d9d9d9;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
.avatar-uploader .el-upload:hover {
|
||||
border-color: #409eff;
|
||||
}
|
||||
.avatar-uploader-icon {
|
||||
font-size: 28px;
|
||||
color: #8c939d;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
line-height: 100px;
|
||||
text-align: center;
|
||||
}
|
||||
.avatar {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
</style>
|
Reference in New Issue
Block a user