调整黑白名单
This commit is contained in:
parent
b3d480f01e
commit
1115e1e814
@ -16,21 +16,21 @@ export function getWhiteList(data) {
|
||||
})
|
||||
}
|
||||
|
||||
/* export function updateWhiteList(data) {
|
||||
export function updateWhiteList(data) {
|
||||
return request({
|
||||
url: '/white_list/edit',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
} */
|
||||
}
|
||||
|
||||
export function delWhiteList(data) {
|
||||
/* export function delWhiteList(data) {
|
||||
return request({
|
||||
url: '/white_list/del',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
} */
|
||||
|
||||
export function uploadWhiteList(data) {
|
||||
return request({
|
||||
|
@ -22,7 +22,7 @@
|
||||
</el-upload>
|
||||
</div>
|
||||
<el-table
|
||||
:data="blockplayerList"
|
||||
:data="blacklist"
|
||||
border
|
||||
fit
|
||||
highlight-current-row
|
||||
@ -32,8 +32,8 @@
|
||||
height="480"
|
||||
>
|
||||
<el-table-column
|
||||
label="账号"
|
||||
prop="account_id"
|
||||
label="账号/钱包/email"
|
||||
prop="user_identity"
|
||||
/>
|
||||
<el-table-column
|
||||
label="是否拉黑"
|
||||
@ -41,7 +41,7 @@
|
||||
align=" "
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<svg-icon v-if="scope.row.blocked === 1" icon-class="ok" style="font-size: 20px;" />
|
||||
<svg-icon v-if="scope.row.enable === 1" icon-class="ok" style="font-size: 20px;" />
|
||||
<svg-icon v-else icon-class="no" style="font-size: 20px;" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -71,7 +71,7 @@
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="handleUpdate(scope.row)">编辑</el-button>
|
||||
<el-button type="text" size="small" @click="handleDel(scope.row)">删除</el-button>
|
||||
<!-- <el-button type="text" size="small" @click="handleDel(scope.row)">删除</el-button> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -84,13 +84,13 @@
|
||||
@current-change="handleCurrentChange"
|
||||
/>
|
||||
<el-dialog :title="dialogTitle" :visible.sync="dialogFormVisible" :close-on-click-modal="false" @close="handleDialogClose()">
|
||||
<el-form ref="form" :rules="rules" :model="form" label-position="left" label-width="90px" style="width: 400px; margin-left:50px;">
|
||||
<el-form-item label="账号" prop="account_id">
|
||||
<el-input v-model="form.account_id" :readonly="dialogStatus!=='create'" />
|
||||
<el-form ref="form" :rules="rules" :model="form" label-position="left" label-width="130px" style="width: 400px; margin-left:50px;">
|
||||
<el-form-item label="账号/钱包/email" prop="user_identity">
|
||||
<el-input v-model="form.user_identity" :readonly="dialogStatus!=='create'" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否拉黑">
|
||||
<el-switch
|
||||
v-model="form.blocked"
|
||||
v-model="form.enable"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
active-color="#13ce66"
|
||||
@ -124,20 +124,20 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
account_id: '',
|
||||
blocked: 1
|
||||
user_identity: '',
|
||||
enable: 1
|
||||
},
|
||||
dialogFormVisible: false,
|
||||
dialogStatus: '',
|
||||
listLoading: true,
|
||||
blockplayerList: [],
|
||||
blacklist: [],
|
||||
dialogTitle: '新增',
|
||||
emptytext: ' ',
|
||||
totalpage: 0,
|
||||
curpage: 1,
|
||||
page_size: 8,
|
||||
rules: {
|
||||
account_id: [{ required: true, message: 'required', trigger: 'blur' }]
|
||||
user_identity: [{ required: true, message: 'required', trigger: 'blur' }]
|
||||
},
|
||||
uploadUrl: '',
|
||||
uploadData: {
|
||||
@ -155,8 +155,8 @@ export default {
|
||||
// this.getList()
|
||||
},
|
||||
handleUpdate(row) {
|
||||
this.form.blocked = row.blocked
|
||||
this.form.account_id = row.account_id
|
||||
this.form.enable = row.enable
|
||||
this.form.user_identity = row.user_identity
|
||||
this.dialogStatus = 'update'
|
||||
this.dialogTitle = '编辑'
|
||||
this.dialogFormVisible = true
|
||||
@ -170,9 +170,9 @@ export default {
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
delBlockPlayer({ account_id: row.account_id }).then(response => {
|
||||
delBlockPlayer({ user_identity: row.user_identity }).then(response => {
|
||||
if (response.code === 0) {
|
||||
if (this.blockplayerList.length === 1 && this.curpage === this.totalpage && this.curpage > 1) {
|
||||
if (this.blacklist.length === 1 && this.curpage === this.totalpage && this.curpage > 1) {
|
||||
this.curpage--
|
||||
}
|
||||
this.getList()
|
||||
@ -195,11 +195,11 @@ export default {
|
||||
}
|
||||
}
|
||||
getBlockPlayerList(data).then(response => {
|
||||
this.blockplayerList = response.data
|
||||
this.blacklist = response.data
|
||||
this.totalpage = response.total_page
|
||||
this.curpage = response.cur_page
|
||||
// this.pager = response.cur_page
|
||||
if (this.blockplayerList === undefined || this.blockplayerList.length <= 0) {
|
||||
if (this.blacklist === undefined || this.blacklist.length <= 0) {
|
||||
this.emptytext = 'No data'
|
||||
}
|
||||
})
|
||||
@ -219,8 +219,8 @@ export default {
|
||||
},
|
||||
resetTemp() {
|
||||
this.form = {
|
||||
account_id: '',
|
||||
blocked: 0
|
||||
user_identity: '',
|
||||
enable: 0
|
||||
}
|
||||
},
|
||||
createData() {
|
||||
|
@ -32,13 +32,18 @@
|
||||
height="480"
|
||||
>
|
||||
<el-table-column
|
||||
label="账号"
|
||||
prop="account_id"
|
||||
label="账号/钱包/email"
|
||||
prop="user_identity"
|
||||
/>
|
||||
<el-table-column
|
||||
label="类型"
|
||||
prop="type"
|
||||
/>
|
||||
label="是否生效"
|
||||
prop="enable"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<svg-icon v-if="scope.row.enable === 0" icon-class="no" style="font-size: 20px;" />
|
||||
<svg-icon v-else icon-class="ok" style="font-size: 20px;" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!--el-table-column
|
||||
prop="createtime"
|
||||
label="创建时间"
|
||||
@ -64,8 +69,8 @@
|
||||
label="操作"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<!--el-button type="text" size="small" @click="handleUpdate(scope.row)">编辑</el-button-->
|
||||
<el-button type="text" size="small" @click="handleDel(scope.row)">删除</el-button>
|
||||
<el-button type="text" size="small" @click="handleUpdate(scope.row)">编辑</el-button>
|
||||
<!-- <el-button type="text" size="small" @click="handleDel(scope.row)">删除</el-button> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -78,12 +83,18 @@
|
||||
@current-change="handleCurrentChange"
|
||||
/>
|
||||
<el-dialog :title="dialogTitle" :visible.sync="dialogFormVisible" :close-on-click-modal="false" @close="handleDialogClose()">
|
||||
<el-form ref="form" :rules="rules" :model="form" label-position="left" label-width="90px" style="width: 400px; margin-left:50px;">
|
||||
<el-form-item label="账号" prop="account_id">
|
||||
<el-input v-model="form.account_id" />
|
||||
<el-form ref="form" :rules="rules" :model="form" label-position="left" label-width="130px" style="width: 400px; margin-left:50px;">
|
||||
<el-form-item label="账号/钱包/email" prop="user_identity">
|
||||
<el-input v-model="form.user_identity" />
|
||||
</el-form-item>
|
||||
<el-form-item label="类型" prop="type">
|
||||
<el-input v-model="form.type" />
|
||||
<el-form-item label="是否生效" prop="enable">
|
||||
<el-switch
|
||||
v-model="form.enable"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#ff4949"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
@ -101,7 +112,7 @@
|
||||
|
||||
<script>
|
||||
// import Pagination from '@/components/Pagination/index.vue'
|
||||
import { addWhiteList, getWhiteList, delWhiteList, uploadWhiteList } from '@/api/whitelist'
|
||||
import { addWhiteList, getWhiteList, updateWhiteList, uploadWhiteList } from '@/api/whitelist'
|
||||
import { parseTime } from '@/utils'
|
||||
|
||||
export default {
|
||||
@ -112,8 +123,8 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
account_id: '',
|
||||
blocked: 1
|
||||
user_identity: '',
|
||||
enable: 1
|
||||
},
|
||||
dialogFormVisible: false,
|
||||
dialogStatus: '',
|
||||
@ -125,7 +136,7 @@ export default {
|
||||
curpage: 1,
|
||||
page_size: 8,
|
||||
rules: {
|
||||
account_id: [{ required: true, message: 'required', trigger: 'blur' }],
|
||||
user_identity: [{ required: true, message: 'required', trigger: 'blur' }],
|
||||
type: [{ required: true, message: 'required', trigger: 'blur' }]
|
||||
},
|
||||
uploadUrl: '',
|
||||
@ -144,8 +155,8 @@ export default {
|
||||
// this.getList()
|
||||
},
|
||||
handleUpdate(row) {
|
||||
this.form.type = row.type
|
||||
this.form.account_id = row.account_id
|
||||
this.form.enable = row.enable
|
||||
this.form.user_identity = row.user_identity
|
||||
this.dialogStatus = 'update'
|
||||
this.dialogTitle = '编辑'
|
||||
this.dialogFormVisible = true
|
||||
@ -153,13 +164,13 @@ export default {
|
||||
this.$refs['form'].clearValidate()
|
||||
})
|
||||
},
|
||||
handleDel(row) {
|
||||
/* handleDel(row) {
|
||||
this.$confirm('此操作将无法恢复, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
delWhiteList({ account_id: row.account_id }).then(response => {
|
||||
delWhiteList({ user_identity: row.user_identity }).then(response => {
|
||||
if (response.code === 0) {
|
||||
if (this.whitelist.length === 1 && this.curpage === this.totalpage && this.curpage > 1) {
|
||||
this.curpage--
|
||||
@ -175,7 +186,7 @@ export default {
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
}, */
|
||||
getList() {
|
||||
const data = {
|
||||
'page_dto': {
|
||||
@ -187,7 +198,6 @@ export default {
|
||||
this.whitelist = response.data
|
||||
this.totalpage = response.total_page
|
||||
this.curpage = response.cur_page
|
||||
// this.pager = response.cur_page
|
||||
if (this.whitelist === undefined || this.whitelist.length <= 0) {
|
||||
this.emptytext = 'No data'
|
||||
}
|
||||
@ -208,8 +218,8 @@ export default {
|
||||
},
|
||||
resetTemp() {
|
||||
this.form = {
|
||||
account_id: '',
|
||||
blocked: 0
|
||||
user_identity: '',
|
||||
enable: 0
|
||||
}
|
||||
},
|
||||
createData() {
|
||||
@ -230,8 +240,7 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
/* updateData() {
|
||||
console.log('update', this.form)
|
||||
updateData() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
updateWhiteList(this.form).then(response => {
|
||||
@ -248,7 +257,7 @@ export default {
|
||||
})
|
||||
}
|
||||
})
|
||||
}, */
|
||||
},
|
||||
handleSuccess(response, file, fileList) {
|
||||
// 成功回调
|
||||
console.log('File uploaded successfully:', response)
|
||||
|
Loading…
x
Reference in New Issue
Block a user