init
This commit is contained in:
44
src/api/cai/forbidFilter.js
Normal file
44
src/api/cai/forbidFilter.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询登陆拦截记录列表
|
||||
export function listForbidFilter(query) {
|
||||
return request({
|
||||
url: '/cai/forbidFilter/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询登陆拦截记录详细
|
||||
export function getForbidFilter(id) {
|
||||
return request({
|
||||
url: '/cai/forbidFilter/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增登陆拦截记录
|
||||
export function addForbidFilter(data) {
|
||||
return request({
|
||||
url: '/cai/forbidFilter',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改登陆拦截记录
|
||||
export function updateForbidFilter(data) {
|
||||
return request({
|
||||
url: '/cai/forbidFilter',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除登陆拦截记录
|
||||
export function delForbidFilter(id) {
|
||||
return request({
|
||||
url: '/cai/forbidFilter/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
44
src/api/cai/userForbidLog.js
Normal file
44
src/api/cai/userForbidLog.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询封禁记录列表
|
||||
export function listUserForbidLog(query) {
|
||||
return request({
|
||||
url: '/cai/userForbidLog/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询封禁记录详细
|
||||
export function getUserForbidLog(id) {
|
||||
return request({
|
||||
url: '/cai/userForbidLog/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增封禁记录
|
||||
export function addUserForbidLog(data) {
|
||||
return request({
|
||||
url: '/cai/userForbidLog',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改封禁记录
|
||||
export function updateUserForbidLog(data) {
|
||||
return request({
|
||||
url: '/cai/userForbidLog',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除封禁记录
|
||||
export function delUserForbidLog(id) {
|
||||
return request({
|
||||
url: '/cai/userForbidLog/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
343
src/views/cai/forbidFilter/index.vue
Normal file
343
src/views/cai/forbidFilter/index.vue
Normal file
@@ -0,0 +1,343 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="拦截数据" prop="member">
|
||||
<el-input
|
||||
v-model="queryParams.member"
|
||||
placeholder="请输入拦截数据"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="拦截用户" prop="userId">
|
||||
<el-input
|
||||
v-model="queryParams.userId"
|
||||
placeholder="请输入拦截用户"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="拦截编号" prop="traceNo">
|
||||
<el-input
|
||||
v-model="queryParams.traceNo"
|
||||
placeholder="请输入拦截编号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="关联ID" prop="forbidId">
|
||||
<el-input
|
||||
v-model="queryParams.forbidId"
|
||||
placeholder="请输入关联ID"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="理由" prop="filterReason">
|
||||
<el-input
|
||||
v-model="queryParams.filterReason"
|
||||
placeholder="请输入理由"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['cai:forbidFilter:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['cai:forbidFilter:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['cai:forbidFilter:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['cai:forbidFilter:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="forbidFilterList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="" align="center" prop="id" v-if="true"/>
|
||||
<el-table-column label="类型" align="center" prop="type" />
|
||||
<el-table-column label="拦截数据" align="center" prop="member" />
|
||||
<el-table-column label="拦截用户" align="center" prop="userId" />
|
||||
<el-table-column label="拦截编号" align="center" prop="traceNo" />
|
||||
<el-table-column label="关联ID" align="center" prop="forbidId" />
|
||||
<el-table-column label="理由" align="center" prop="filterReason" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['cai:forbidFilter:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['cai:forbidFilter:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改登陆拦截记录对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="拦截数据" prop="member">
|
||||
<el-input v-model="form.member" placeholder="请输入拦截数据" />
|
||||
</el-form-item>
|
||||
<el-form-item label="拦截用户" prop="userId">
|
||||
<el-input v-model="form.userId" placeholder="请输入拦截用户" />
|
||||
</el-form-item>
|
||||
<el-form-item label="拦截编号" prop="traceNo">
|
||||
<el-input v-model="form.traceNo" placeholder="请输入拦截编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="关联ID" prop="forbidId">
|
||||
<el-input v-model="form.forbidId" placeholder="请输入关联ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="理由" prop="filterReason">
|
||||
<el-input v-model="form.filterReason" placeholder="请输入理由" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listForbidFilter, getForbidFilter, delForbidFilter, addForbidFilter, updateForbidFilter } from "@/api/cai/forbidFilter";
|
||||
|
||||
export default {
|
||||
name: "ForbidFilter",
|
||||
data() {
|
||||
return {
|
||||
// 按钮loading
|
||||
buttonLoading: false,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 登陆拦截记录表格数据
|
||||
forbidFilterList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
type: undefined,
|
||||
member: undefined,
|
||||
userId: undefined,
|
||||
traceNo: undefined,
|
||||
forbidId: undefined,
|
||||
filterReason: undefined
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
id: [
|
||||
{ required: true, message: "不能为空", trigger: "blur" }
|
||||
],
|
||||
type: [
|
||||
{ required: true, message: "类型不能为空", trigger: "change" }
|
||||
],
|
||||
member: [
|
||||
{ required: true, message: "拦截数据不能为空", trigger: "blur" }
|
||||
],
|
||||
userId: [
|
||||
{ required: true, message: "拦截用户不能为空", trigger: "blur" }
|
||||
],
|
||||
traceNo: [
|
||||
{ required: true, message: "拦截编号不能为空", trigger: "blur" }
|
||||
],
|
||||
forbidId: [
|
||||
{ required: true, message: "关联ID不能为空", trigger: "blur" }
|
||||
],
|
||||
createTime: [
|
||||
{ required: true, message: "创建时间不能为空", trigger: "blur" }
|
||||
],
|
||||
filterReason: [
|
||||
{ required: true, message: "理由不能为空", trigger: "blur" }
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询登陆拦截记录列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listForbidFilter(this.queryParams).then(response => {
|
||||
this.forbidFilterList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: undefined,
|
||||
type: undefined,
|
||||
member: undefined,
|
||||
userId: undefined,
|
||||
traceNo: undefined,
|
||||
forbidId: undefined,
|
||||
createTime: undefined,
|
||||
filterReason: undefined
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加登陆拦截记录";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.loading = true;
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getForbidFilter(id).then(response => {
|
||||
this.loading = false;
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改登陆拦截记录";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.buttonLoading = true;
|
||||
if (this.form.id != null) {
|
||||
updateForbidFilter(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
} else {
|
||||
addForbidFilter(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除登陆拦截记录编号为"' + ids + '"的数据项?').then(() => {
|
||||
this.loading = true;
|
||||
return delForbidFilter(ids);
|
||||
}).then(() => {
|
||||
this.loading = false;
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('cai/forbidFilter/export', {
|
||||
...this.queryParams
|
||||
}, `forbidFilter_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
326
src/views/cai/userForbidLog/index.vue
Normal file
326
src/views/cai/userForbidLog/index.vue
Normal file
@@ -0,0 +1,326 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="" prop="member">
|
||||
<el-input
|
||||
v-model="queryParams.member"
|
||||
placeholder="请输入"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="封号时长 1.封6小时 2.封1天 3.封3天 4.封7天 5.封一个月 6.封10年" prop="forbidTime">
|
||||
<el-input
|
||||
v-model="queryParams.forbidTime"
|
||||
placeholder="请输入封号时长 1.封6小时 2.封1天 3.封3天 4.封7天 5.封一个月 6.封10年"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="原始用户ID(后台编辑用)" prop="originUid">
|
||||
<el-input
|
||||
v-model="queryParams.originUid"
|
||||
placeholder="请输入原始用户ID(后台编辑用)"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="理由" prop="reason">
|
||||
<el-input
|
||||
v-model="queryParams.reason"
|
||||
placeholder="请输入理由"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['cai:userForbidLog:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['cai:userForbidLog:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['cai:userForbidLog:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['cai:userForbidLog:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="userForbidLogList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="" align="center" prop="id" v-if="true"/>
|
||||
<el-table-column label="类型 :1 封用户uid 2.封设备uuid 3.imei 4.mac" align="center" prop="type" />
|
||||
<el-table-column label="" align="center" prop="member" />
|
||||
<el-table-column label="封号时长 1.封6小时 2.封1天 3.封3天 4.封7天 5.封一个月 6.封10年" align="center" prop="forbidTime" />
|
||||
<el-table-column label="原始用户ID(后台编辑用)" align="center" prop="originUid" />
|
||||
<el-table-column label="理由" align="center" prop="reason" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['cai:userForbidLog:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['cai:userForbidLog:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改封禁记录对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="" prop="member">
|
||||
<el-input v-model="form.member" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
<el-form-item label="封号时长 1.封6小时 2.封1天 3.封3天 4.封7天 5.封一个月 6.封10年" prop="forbidTime">
|
||||
<el-input v-model="form.forbidTime" placeholder="请输入封号时长 1.封6小时 2.封1天 3.封3天 4.封7天 5.封一个月 6.封10年" />
|
||||
</el-form-item>
|
||||
<el-form-item label="原始用户ID(后台编辑用)" prop="originUid">
|
||||
<el-input v-model="form.originUid" placeholder="请输入原始用户ID(后台编辑用)" />
|
||||
</el-form-item>
|
||||
<el-form-item label="理由" prop="reason">
|
||||
<el-input v-model="form.reason" placeholder="请输入理由" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listUserForbidLog, getUserForbidLog, delUserForbidLog, addUserForbidLog, updateUserForbidLog } from "@/api/cai/userForbidLog";
|
||||
|
||||
export default {
|
||||
name: "UserForbidLog",
|
||||
data() {
|
||||
return {
|
||||
// 按钮loading
|
||||
buttonLoading: false,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 封禁记录表格数据
|
||||
userForbidLogList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
type: undefined,
|
||||
member: undefined,
|
||||
forbidTime: undefined,
|
||||
originUid: undefined,
|
||||
reason: undefined
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
id: [
|
||||
{ required: true, message: "不能为空", trigger: "blur" }
|
||||
],
|
||||
type: [
|
||||
{ required: true, message: "类型 :1 封用户uid 2.封设备uuid 3.imei 4.mac不能为空", trigger: "change" }
|
||||
],
|
||||
member: [
|
||||
{ required: true, message: "不能为空", trigger: "blur" }
|
||||
],
|
||||
forbidTime: [
|
||||
{ required: true, message: "封号时长 1.封6小时 2.封1天 3.封3天 4.封7天 5.封一个月 6.封10年不能为空", trigger: "blur" }
|
||||
],
|
||||
createTime: [
|
||||
{ required: true, message: "创建时间不能为空", trigger: "blur" }
|
||||
],
|
||||
originUid: [
|
||||
{ required: true, message: "原始用户ID(后台编辑用)不能为空", trigger: "blur" }
|
||||
],
|
||||
reason: [
|
||||
{ required: true, message: "理由不能为空", trigger: "blur" }
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询封禁记录列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listUserForbidLog(this.queryParams).then(response => {
|
||||
this.userForbidLogList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: undefined,
|
||||
type: undefined,
|
||||
member: undefined,
|
||||
forbidTime: undefined,
|
||||
createTime: undefined,
|
||||
originUid: undefined,
|
||||
reason: undefined
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加封禁记录";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.loading = true;
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getUserForbidLog(id).then(response => {
|
||||
this.loading = false;
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改封禁记录";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.buttonLoading = true;
|
||||
if (this.form.id != null) {
|
||||
updateUserForbidLog(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
} else {
|
||||
addUserForbidLog(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除封禁记录编号为"' + ids + '"的数据项?').then(() => {
|
||||
this.loading = true;
|
||||
return delUserForbidLog(ids);
|
||||
}).then(() => {
|
||||
this.loading = false;
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('cai/userForbidLog/export', {
|
||||
...this.queryParams
|
||||
}, `userForbidLog_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
Reference in New Issue
Block a user