Commit 0ea13fc6 authored by 罗林杰's avatar 罗林杰

修改点击量

parent 7b3c9c42
import request from '@/utils/request'
import Qs from 'qs'
/**
* 1. 列表查询
* 2. 查询详细信息
* 3. 新增
* 4. 修改
* 5. 逻辑删除
* 6. 导出
*
*/
// 1. 查询访问量表列表
export function listMemTraffic(query) {
return request({
url: '/memtraffic/list',
method: 'get',
params: query
})
}
// 2. 查询访问量表详细信息
export function getMemTraffic(businessId) {
return request({
url: '/memtraffic/detail/' + businessId,
method: 'get'
})
}
// 3. 新增访问量表
export function addMemTraffic(data) {
data = Qs.stringify(data)
return request({
url: '/memtraffic/add',
method: 'post',
data: data
})
}
// 4. 修改访问量表
export function updateMemTraffic(data) {
const businessId = data.businessId
data = Qs.stringify(data)
return request({
url: '/memtraffic/update/' + businessId,
method: 'put',
data
})
}
// 5. 逻辑删除访问量表
export function delMemTraffic(businessId) {
return request({
url: '/memtraffic/deleteLogical/' + businessId,
method: 'delete'
})
}
// 6. 导出访问量表
export function exportMemTraffic(query) {
return request({
url: '/memtraffic/export',
method: 'get',
params: query,
responseType: 'blob'
})
}
<template>
<div class="app-container">
<el-form ref="queryForm" style="padding: 0 0 0 10px" :model="queryParams" :inline="true">
<el-form-item label="用户" prop="userId">
<el-form-item label="访问量" prop="memTraffic">
<el-input
v-model="queryParams.memNickName"
placeholder="请输入用户"
clearable
:maxlength="50"
size="small"
style="width: 150px"
/>
</el-form-item>
<el-form-item label="被拉黑人" prop="targetId">
<el-input
v-model="queryParams.targetName"
placeholder="请输入被拉黑人"
v-model="queryParams.memTraffic"
placeholder="请输入访问量"
clearable
:maxlength="50"
size="small"
......@@ -38,34 +28,19 @@
</el-form-item>
</el-form>
<div style="padding:5px 10px">
<div class="mb12 font-small-bold">黑名单表列表</div>
<el-table v-loading="loading" border :data="opmBlackListList">
<div class="mb12 font-small-bold">访问量表列表</div>
<el-table v-loading="loading" border :data="memTrafficList">
<el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column label="用户" prop="userId" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.memNickName || '-' }}
</template>
</el-table-column>
<el-table-column label="被拉黑人" prop="memNickName" :show-overflow-tooltip="true">
<el-table-column label="用户id" prop="userId" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.targetName || '-' }}
{{ scope.row.userId || '-' }}
</template>
</el-table-column>
<el-table-column label="拉黑时间" prop="createDate" :show-overflow-tooltip="true">
<el-table-column label="访问量" prop="memTraffic" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.createDate || '-' }}
{{ scope.row.memTraffic || '0' }}
</template>
</el-table-column>
<!-- <el-table-column label="操作" class-name="small-padding fixed-width" width="200px">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button-->
<!-- :class="commonField.delClass"-->
<!-- :type="commonField.typeParent"-->
<!-- :size="commonField.size"-->
<!-- @click="handleDelete(scope.row)"-->
<!-- >删除</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
</div>
<pagination
......@@ -75,43 +50,22 @@
:limit.sync="queryParams.rows"
@pagination="getList"
/>
<!-- 添加或修改黑名单表配置对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="90px">
<el-form-item label="用户id" prop="userId">
<el-input v-model.trim="form.userId" show-word-limit :maxlength="50" placeholder="请输入用户id" />
</el-form-item>
<el-form-item label="目标id" prop="targetId">
<el-input v-model.trim="form.targetId" show-word-limit :maxlength="50" placeholder="请输入目标id" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button class="cancelBtn" @click="cancel">取 消</el-button>
<el-button class="submitBtn" type="primary" @click="submitForm">确 定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listOpmBlackList,
getOpmBlackList,
delOpmBlackList,
addOpmBlackList,
updateOpmBlackList,
exportOpmBlackList } from '@/api/contentManagement/opmBlackList'
import { listMemTraffic } from '@/api/contentManagement/memTraffic'
import commonField from '@/utils/commonField'
export default {
name: 'OpmBlackList',
name: 'MemTraffic',
data() {
return {
// 遮罩层
loading: true,
// 总条数
total: 0,
// 黑名单表表格数据
opmBlackListList: [],
// 访问量表表格数据
memTrafficList: [],
// 弹出层标题
title: '',
// 是否显示弹出层
......@@ -132,13 +86,16 @@ export default {
page: 1,
rows: 10,
userId: undefined,
targetId: undefined,
memTraffic: undefined,
flag: ''
},
// 表单参数
form: {},
// 表单校验
rules: {
userId: [
{ required: true, message: '请输入用户id', trigger: 'blur' }
]
}
}
},
......@@ -151,12 +108,12 @@ export default {
this.getList() // 列表查询
},
methods: {
/** 查询黑名单表列表 */
/** 查询访问量表列表 */
getList() {
this.loading = true
listOpmBlackList(this.queryParams).then(
listMemTraffic(this.queryParams).then(
response => {
this.opmBlackListList = response.data
this.memTrafficList = response.data
this.total = response.total
this.loading = false
}
......@@ -172,7 +129,7 @@ export default {
this.form = {
businessId: undefined,
userId: undefined,
targetId: undefined,
memTraffic: undefined,
flag: '1'
}
this.resetForm('form')
......@@ -188,103 +145,10 @@ export default {
page: 1,
rows: 10,
userId: undefined,
targetId: undefined,
memTraffic: undefined,
flag: ''
}
this.handleQuery()
},
/** 新增按钮操作 */
handleAdd() {
this.reset()
this.open = true
this.title = '添加黑名单表'
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
const id = row.businessId
getOpmBlackList(id).then(response => {
this.form = response.data
this.open = true
this.title = '修改黑名单表'
})
},
// 改变状态
handleStatusChange(row) {
const text = row.flag === '1' ? '启用' : '停用'
this.$confirm('确认操作?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
return updateOpmBlackList(row)
}).then(() => {
this.$message({
message: text + '成功',
type: 'success'
})
}).catch(function() {
row.flag = row.flag === '0' ? '1' : '0'
})
},
/** 提交按钮 */
submitForm: function() {
this.$refs['form'].validate(valid => {
if (valid) {
if (this.form.businessId !== undefined) {
updateOpmBlackList(this.form).then(response => {
this.msgSuccess('修改成功')
this.open = false
this.getList()
})
} else {
addOpmBlackList(this.form).then(response => {
this.msgSuccess('新增成功')
this.open = false
this.getList()
})
}
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.businessId
this.$confirm('是否确认操作?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
return delOpmBlackList(id)
}).then(() => {
this.getList()
this.$message({
message: '删除成功',
type: 'success'
})
}).catch(function() {
})
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams
this.$confirm('是否确认操作?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
return exportOpmBlackList(queryParams).then(response => {
const blob = new Blob([response])
const downloadElement = document.createElement('a')
const href = window.URL.createObjectURL(blob)// 创建下载的链接
downloadElement.href = href
downloadElement.download = '黑名单表信息' + '.xls' // 下载后文件名
document.body.appendChild(downloadElement)
downloadElement.click()// 点击下载
document.body.removeChild(downloadElement)// 下载完成移除元素
window.URL.revokeObjectURL(href)// 释放掉blob对象
})
})
}
}
}
......
......@@ -873,6 +873,9 @@ export default {
getActionTypeLabel(value) {
const option = this.actionTypeOptions.find(option => option.dictValue === value)
return option ? option.dictLabel : '-'
},
recharge() {
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment