搬迁代码【第五版】

This commit is contained in:
liaozetao
2023-09-24 21:00:03 +08:00
parent ed04d0a068
commit a7093cf926
79 changed files with 25992 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@@ -0,0 +1,210 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<section class="content">
<div id="table"></div>
<div id="toolbar">
歌曲名
<input type="text" name="musicName" id="musicName" />
上报用户
<input type="text" name="erbanNo" id="erbanNo" />
状态
<select id="status">
<option value=""></option>
<option value="1">待解决</option>
<option value="2">已解决</option>
</select>
<button id="btnSearch" class="btn btn-sm btn-primary">查询</button>
<button id="batchSolve" class="btn btn-sm btn-primary">批量已解决</button>
</div>
</section>
</div>
</div>
</section>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "MusicErrorAdminView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
cache: false,
striped: true,
showRefresh: false,
search: false,
pageSize: 10,
pagination: true,
pageList: [10, 20, 30, 50],
sidePagination: "server", //表示服务端请求
//设置为undefined可以获取pageNumberpageSizesearchTextsortNamesortOrder
//设置为limit可以获取limit, offset, search, sort, order
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageSize: params.pageSize,
pageNumber: params.pageNumber,
musicName: $('#musicName').val(),
erbanNo: $('#erbanNo').val(),
status: $('#status').val()
};
return param;
},
uniqueId: 'id',
toolbar: '#toolbar',
url: '/admin/musicLibrary/listMusicError',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
},
columns: [
{ field: 'tmp', title: 'id', align: 'center', checkbox: true, width: '5%' },
{
field: '', title: '歌曲名-歌手名', align: 'center', valign: 'middle', width: '15%', formatter: function (val, row, index) {
return row.musicName + "-" + row.singer;
}
},
{ field: 'errorMsg', title: '报错内容', align: 'center', valign: 'middle', width: '20%' },
{ field: 'userNick', title: '上报用户', align: 'center', valign: 'middle', width: '10%' },
{
field: 'status',
title: '状态',
align: 'center',
valign: 'middle',
formatter: function (val, row, index) {
if (val == 1) {
return '待解决';
} else if (val == 2) {
return '已解决';
}
}
},
{
field: 'id',
title: '操作',
align: 'center',
width: '10%',
valign: 'middle',
formatter: function (val, row, index) {
var key = row.id;
var str = "";
if (row.status == 1) {
str += "<button class='btn btn-sm btn-success opt-solve' data-id=" + key + ">已解决</button>";
}
str += "<button class='btn btn-sm btn-success opt-del' data-id=" + key + ">删除</button>";
return str;
}
}
]
})
$('#table').on('click', '.opt-solve', function () {
var errorId = $(this).data('id');
if (errorId == 'undefined' || !errorId) {
return;
}
if (confirm("确定解决了吗?")) {
$.ajax({
type: 'post',
url: '/admin/musicLibrary/solveError',
data: {
errorId: errorId
},
dataType: 'json',
success: function (res) {
if (res.code == 200) {
$("#tipMsg").text("操作成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("操作失败,错误码:" + res.code);
$("#tipModal").modal('show');
}
}
})
}
$('#editModal').modal('show');
})
$('#table').on('click', '.opt-del', function () {
var errorId = $(this).data('id');
if (errorId == 'undefined' || !errorId) {
return;
}
if (confirm("确定要删除?")) {
$.ajax({
type: 'post',
url: '/admin/musicLibrary/delMusicError',
data: {
errorId: errorId
},
dataType: 'json',
success: function (res) {
if (res.code == 200) {
$("#tipMsg").text("删除成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("删除失败,错误码:" + res.code);
$("#tipModal").modal('show');
}
}
})
}
$('#editModal').modal('show');
})
$('#batchSolve').on('click', function () {
var rows = $('#table').bootstrapTable("getSelections");
if (rows && rows.length == 0) {
alert('请先选择记录!');
return;
}
var idArr = new Array();
for (var i = 0; i < rows.length; i++) {
idArr.push(rows[i].id);
}
$.ajax({
type: 'post',
url: '/admin/musicLibrary/batchSolveError',
dataType: 'json',
contentType: "application/json",
data: JSON.stringify(idArr),
success: function (res) {
if (res.code == 200) {
$("#editModal").modal('hide');
$("#tipMsg").text("批量操作成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("批量操作失败,错误码:" + res.code);
$("#tipModal").modal('show');
}
}
})
})
$('#btnSearch').on('click', function () {
TableHelper.doRefresh('#table');
})
})
}
},
};
</script>
<style scoped></style>

View File

@@ -0,0 +1,442 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<section class="content">
<div id="table"></div>
<div id="toolbar">
<input type="text" name="searchKey" id="searchKey" placeholder="请输入歌曲/歌手名称">
<button id="btnSearch" class="btn btn-sm btn-primary">查询</button>
<button id="btnSynMusic" class="btn btn-sm btn-primary">同步歌曲到搜索引擎</button>
</div>
</section>
</div>
</div>
</section>
<div class="modal fade" id="editModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">x</span></button>
<h4 class="modal-title" id="editModalLabel">修改歌曲信息</h4>
</div>
<div class="modal-body">
<form id="editMusic" class="form-horizontal">
<input type="hidden" name="musicId" id="musicId">
<div class="form-group">
<label for="nameTxt" class="col-sm-3 control-label">歌名:</label>
<div class="col-sm-8">
<input type="text" id="nameTxt" name="name" class="form-control validate[required]">
</div>
</div>
<div class="form-group">
<label for="singerTxt" class="col-sm-3 control-label">歌手:</label>
<div class="col-sm-8">
<input type="text" id="singerTxt" name="name" class="form-control validate[required]">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">封面:</label>
<div class="col-sm-8">
<img src="" id="addCoverImg" style="width:180px;height:90px" alt="">
<input type="file" id="coverFile" name="coverFile"
accept="image/gif,image/jpeg,image/jpg,image/png,image/svg">
<button class="btn btn-success" type="button" id="uploadCoverBtn">上传</button>
<input type="hidden" id="coverTxt" name="cover" class="form-control validate[required]" />
</div>
</div>
<div class="form-group">
<label for="urlTxt" class="col-sm-3 control-label">地址:</label>
<div class="col-sm-8">
<input type="text" id="urlTxt" name="url" class="form-control validate[required]">
</div>
</div>
<div class="form-group">
<label for="durationTxt" class="col-sm-3 control-label">时长:</label>
<div class="col-sm-8">
<input type="text" id="durationTxt" name="duration" class="form-control validate[required]">
</div>
</div>
<div class="form-group">
<label for="uploaderTxt" class="col-sm-3 control-label">上传人:</label>
<div class="col-sm-8">
<input type="text" id="uploaderTxt" name="uploader" class="form-control validate[required]">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="save">保存</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="syncModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">x</span></button>
<h4 class="modal-title" id="syncModalLabel">同步歌曲信息</h4>
</div>
<div class="modal-body">
<form id="syncMusicForm" class="form-horizontal">
<div class="form-group">
<label for="startDate" class="col-sm-3 control-label">起始时间:</label>
<div class="col-sm-8">
<input type="text" id="startDate" name="startValidTime" class="form-control"
placeholder="yyyy-mm-dd hh:mm:ss">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="syncSubmit">同步</button>
</div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "MusicLibraryAdminView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pagination: true,
pageList: [10, 20, 30, 50],
sidePagination: "server", //表示服务端请求
//设置为undefined可以获取pageNumberpageSizesearchTextsortNamesortOrder
//设置为limit可以获取limit, offset, search, sort, order
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageSize: params.pageSize,
pageNumber: params.pageNumber,
searchKey: $('#searchKey').val()
};
return param;
},
uniqueId: 'id',
toolbar: '#toolbar',
url: '/admin/musicLibrary/listMusic',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
},
columns: [
{ field: 'id', title: '歌曲ID', align: 'center', valign: 'middle' },
{ field: 'name', title: '歌名', align: 'center', valign: 'middle' },
{ field: 'singer', title: '歌手', align: 'center', valign: 'middle' },
{ field: 'duration', title: '时长(秒)', align: 'center', valign: 'middle' },
{ field: 'uploader', title: '上传人', align: 'center', valign: 'middle' },
{
field: 'isHot',
title: '是否热门',
align: 'center',
valign: 'middle',
formatter: function (val, row, index) {
if (val) {
return '是';
} else {
return '否';
}
}
},
{
field: 'status',
title: '状态',
align: 'center',
valign: 'middle',
formatter: function (val, row, index) {
if (val == 1) {
return '上线';
} else if (val == 2) {
return '下线';
}
}
},
{
field: 'tmp',
title: '操作',
align: 'center',
width: '12%',
valign: 'middle',
formatter: function (val, row, index) {
var key = row.id;
var isHot = row.isHot;
var str = "<button class='btn btn-sm btn-success opt-edit' style='margin-right: 4px;' data-id=" + key + ">编辑</button>";
if (isHot) {
str += "<button class='btn btn-sm btn-warning opt-cancelHotMusic' data-id=" + key + ">取消热门</button>";
} else {
str += "<button class='btn btn-sm btn-success opt-setMusicAsHot' data-id=" + key + ">设为热门</button>";
}
var status = row.status;
if (status == 1) {
str += "<button class='btn btn-sm btn-warning opt-offline' data-id=" + key + ">下线</button>";
} else if (status == 2) {
str += "<button class='btn btn-sm btn-success opt-online' data-id=" + key + ">上线</button>";
}
return str;
}
}
]
})
$('#table').on('click', '.opt-edit', function () {
cleanModal();
var musicId = $(this).data('id');
if (musicId == 'undefined' || !musicId) {
return;
}
var music = $('#table').bootstrapTable('getRowByUniqueId', musicId);
$('#musicId').val(music.id);
if (music.name) {
$('#nameTxt').val(music.name);
}
if (music.singer) {
$('#singerTxt').val(music.singer);
}
if (music.cover) {
$('#coverTxt').val(music.cover);
$('#addCoverImg').attr('src', music.cover);
}
if (music.url) {
$('#urlTxt').val(music.url);
}
if (music.duration) {
$('#durationTxt').val(music.duration);
}
if (music.uploader) {
$('#uploaderTxt').val(music.uploader);
}
$('#editModal').modal('show');
})
$('#table').on('click', '.opt-setMusicAsHot', function () {
if (confirm("确认设为热门?")) {
var musicId = $(this).data('id');
console.info("musicId:" + musicId);
if (musicId == 'undefined' || !musicId) {
return;
}
$.ajax({
type: 'post',
url: '/admin/musicLibrary/setMusicAsHot',
data: {
musicId: musicId
},
dataType: 'json',
success: function (res) {
if (res.code == 200) {
$("#tipMsg").text("修改状态成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("修改失败,错误码:" + res.code);
$("#tipModal").modal('show');
}
}
})
}
});
$('#table').on('click', '.opt-cancelHotMusic', function () {
if (confirm("确认取消热门?")) {
var musicId = $(this).data('id');
if (musicId == 'undefined' || !musicId) {
return;
}
$.ajax({
type: 'post',
url: '/admin/musicLibrary/cancelHotMusic',
data: {
musicId: musicId
},
dataType: 'json',
success: function (res) {
if (res.code == 200) {
$("#tipMsg").text("修改状态成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("修改失败,错误码:" + res.code);
$("#tipModal").modal('show');
}
}
})
}
});
$('#table').on('click', '.opt-online', function () {
if (confirm("确认上线此歌曲?")) {
var musicId = $(this).data('id');
if (musicId == 'undefined' || !musicId) {
return;
}
$.ajax({
type: 'post',
url: '/admin/musicLibrary/onlineMusic',
data: {
musicId: musicId
},
dataType: 'json',
success: function (res) {
if (res.code == 200) {
$("#tipMsg").text("修改状态成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("修改失败,错误码:" + res.code);
$("#tipModal").modal('show');
}
}
})
}
});
$('#table').on('click', '.opt-offline', function () {
if (confirm("确认下线此歌曲?")) {
var musicId = $(this).data('id');
if (musicId == 'undefined' || !musicId) {
return;
}
$.ajax({
type: 'post',
url: '/admin/musicLibrary/offlineMusic',
data: {
musicId: musicId
},
dataType: 'json',
success: function (res) {
if (res.code == 200) {
$("#tipMsg").text("修改状态成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("修改失败,错误码:" + res.code);
$("#tipModal").modal('show');
}
}
})
}
});
$('#btnSearch').on('click', function () {
TableHelper.doRefresh('#table');
})
$('#btnSynMusic').on('click', function () {
$('#syncModal').modal('show');
})
$('#syncSubmit').on('click', function () {
if ($('#syncMusicForm').validationEngine('validate')) {
var options = {
type: 'post',
url: '/admin/musicLibrary/syncMusic2ES.action',
dataType: 'json',
data: {
startTimeString: $('#startDate').val()
},
success: function (res) {
$('#syncSubmit').removeAttr("disabled");
if (res.code == 200) {
$("#syncModal").modal('hide');
$("#tipMsg").text("同步成功");
$("#tipModal").modal('show');
} else {
$("#tipMsg").text("同步失败,错误码:" + res.code);
$("#tipModal").modal('show');
}
}
}
$('#syncSubmit').attr("disabled", "true");
$("#syncMusicForm").ajaxSubmit(options);
}
})
$('#uploadCoverBtn').on('click', function () {
var options = {
type: 'post',
url: '/admin/musicLibrary/uploadCover.action',
dataType: 'json',
success: function (json) {
if (json.path) {
$('#coverTxt').val(json.path);
$('#addCoverImg').attr("src", json.path);
console.log(json.path);
} else {
$("#tipMsg").text(json.msg);
$("#tipModal").modal('show');
}
}
}
$("#editMusic").ajaxSubmit(options);
})
$('#save').on('click', function () {
if ($('#editMusic').validationEngine('validate')) {
$.ajax({
type: 'post',
url: '/admin/musicLibrary/updateMusic',
dataType: 'json',
data: {
id: $('#musicId').val(),
name: $('#nameTxt').val(),
singer: $('#singerTxt').val(),
cover: $('#coverTxt').val(),
url: $('#urlTxt').val(),
duration: $("#durationTxt").val(),
uploader: $("#uploaderTxt").val()
},
success: function (res) {
if (res.code == 200) {
$("#editModal").modal('hide');
$("#tipMsg").text("保存成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("保存失败,错误码:" + res.code);
$("#tipModal").modal('show');
}
}
})
}
})
function cleanModal() {
$('#uid').val('');
$('#tag').val('');
$('#addCoverImg').attr('src', '');
$('#coverTxt').val('');
$('#coverFile').val('');
}
})
}
},
};
</script>
<style scoped></style>

View File

@@ -0,0 +1,213 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<!-- .content -->
<section class="content">
<div id="table"></div>
<div id="toolbar">
<button id="addBtn" class="btn btn-sm btn-primary">增加</button>
</div>
</section><!-- .content -->
</div>
</div>
</section>
<div class="modal fade" id="modal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="modalLabel">新增</h4>
</div>
<div class="modal-body">
<form class="form-horizontal">
<div class="form-group">
<label for="group" class="col-sm-2 control-label">分类名:</label>
<div class="col-sm-10">
<input type="text" id="group" name="group" class="form-control validate[required]">
</div>
</div>
<div class="form-group">
<label for="seq" class="col-sm-2 control-label">排序:</label>
<div class="col-sm-10">
<input type="number" id="seq" name="seq" min="1" max="999"
class="form-control validate[required]">
</div>
</div>
<div class="form-group">
<label for="labels" class="col-sm-2 control-label">标签项:</label>
<div class="col-sm-10">
<textarea id="labels" name="labels" class="form-control validate[required]" rows="10"
placeholder="每个标签不能超过7个字用英文逗号分隔建议不超过50个"></textarea>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="save">保存</button>
</div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
import { showLoading, hideLoading } from '@/utils/maintainer';
export default {
name: "LabelAdminView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('#table').bootstrapTable('destroy');
initTable();
$("#table").on("click", '.opt-remove', function () {
var id = $(this).attr("data-id");
if (id == 'undefined') {
$("#tipMsg").text("id参数有误");
$("#tipModal").modal('show');
return;
}
if (confirm("你确认【删除】该标签组吗?")) {
showLoading();
$.ajax({
type: 'post',
url: "/admin/label/del.action",
data: { group: id },
success: function (json) {
hideLoading();
if (json.code === 200) {
$("#tipMsg").text("操作成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("操作失败" + json.message);
$("#tipModal").modal('show');
}
}
});
}
});
$("#table").on("click", '.opt-edit', function () {
var id = $(this).attr("data-id");
if (id == 'undefined') {
$("#tipMsg").text("id参数有误");
$("#tipModal").modal('show');
return;
}
const row = TableHelper.getRowByUniqueId("#table", id)
$("#group").val(row.group)
$("#seq").val(row.seq)
$("#labels").val(row.labels)
$("#modalLabel").val("编辑");
$("#modal").modal('show');
});
});
$("#addBtn").click(function () {
$("#group").val("")
$("#seq").val("")
$("#labels").val("")
$("#modalLabel").val("新增");
$("#modal").modal('show');
});
$("#save").click(function () {
const group = $("#group").val()
const seq = $("#seq").val()
const labels = $("#labels").val()
if (group == '' || group == undefined || group == null) {
alert("分类名不能为空")
} else if (seq == '' || seq == undefined || seq == null) {
alert("排序不能为空")
} else if (labels == '' || labels == undefined || labels == null) {
alert("标签项不能为空")
} else if (labels.split(',').length < 5) {
alert("标签数不能少于5个")
} else if (undefined != labels.split(",").find(l => l.length > 7)) {
alert("单个标签项不能超过7个字")
} else {
showLoading()
$.ajax({
type: "post",
url: "/admin/label/save.action",
data: { group, seq, labels },
success: function (json) {
hideLoading();
if (json.code == 200) {
$("#addModal").modal('hide');
$("#tipMsg").text("保存成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("保存失败 " + json.message);
$("#tipModal").modal('show');
}
}
});
}
});
}
},
};
function initTable() {
$('#table').bootstrapTable({
columns: [
{ field: 'group', title: '分类名', align: 'center', width: '10%' },
{ field: 'seq', title: '排序', align: 'center', width: '5%' },
{ field: 'labels', title: '标签', align: 'center', width: '40%' },
{ field: 'labelSize', title: '个数', align: 'center', width: '5%' },
{
field: 'updateTime', title: '修改时间', align: 'center', width: '10%', formatter: function (val, row, index) {
return new Date(val).format('yyyy-MM-dd hh:mm:ss');
}
},
{
field: 'operate', title: '操作', align: 'center', width: '10%', formatter: function (val, row, index) {
return '<button class="btn btn-sm btn-primary opt-edit" data-id=' + row.group + '>' +
'<i class="glyphicon glyphicon-edit"></i>编辑</button>' + ' ' +
'<button class="btn btn-sm btn-danger opt-remove" data-id=' + row.group + '>' +
'<i class="glyphicon glyphicon-remove"></i>删除</button>';
}
}
],
uniqueId: 'group',
showRefresh: false,
pagination: false,
search: false,
//设置为undefined可以获取pageNumberpageSizesearchTextsortNamesortOrder
//设置为limit可以获取limit, offset, search, sort, order
toolbar: '#toolbar',
url: '/admin/label/list.action',
onLoadSuccess: function () { //加载成功时执行
console.info("succeed")
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
});
}
</script>
<style scoped></style>

View File

@@ -0,0 +1,260 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<!-- .content -->
<section class="content">
<div id="table"></div>
<div id="toolbar">
名称:<input type="text" name="name" id="name" placeholder="请输入app名称">
&nbsp;&nbsp;&nbsp;
状态:
<select name="status" id="seachStatus" class="input-m">
<option value="">--全部--</option>
<option value="1">有效</option>
<option value="2">无效</option>
</select>
&nbsp;&nbsp;&nbsp;
<button class="btn btn-default" id="search">
<i class="glyphicon glyphicon-wrench"></i>查询
</button>
&nbsp;&nbsp;&nbsp;
<button class="btn btn-primary" id="add">
<i class="glyphicon glyphicon-plus"></i>增加
</button>
</div>
</section>
</div>
</div>
</section>
<!-- 弹窗 -->
<div class="modal fade" id="appNameModal" rabindex='-1' role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button class="close" type="button" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">x</span>
</button>
<div class="modal-title" id="appNameModalLabel">app配置</div>
</div>
<div class="modal-body">
<form action="" id="addForm" class="form-horizontal">
<input type="hidden" id="modal_id">
<div class="form-group">
<label for="modal_app" class="col-sm-3 control-label">app</label>
<div class="col-sm-8">
<input type="text" class="form-control validate[required]" name="app" id="modal_app"
placeholder="app">
</div>
</div>
<div class="form-group">
<label for="modal_appName" class="col-sm-3 control-label">app名称</label>
<div class="col-sm-8">
<input type="text" class="form-control validate[required]" name="app" id="modal_appName"
placeholder="请输入app名称">
</div>
</div>
<div class="form-group">
<label for="modal_remark" class="col-sm-3 control-label">备注</label>
<div class="col-sm-8">
<input type="text" class="form-control validate[minlength: 200]" name="remark"
id="modal_remark" placeholder="不超过200个字符">
</div>
</div>
<div class="form-group">
<label for="modal_status" class="col-sm-3 control-label">状态</label>
<div class="col-sm-8">
<select id="modal_status" name="status" class="form-control validate[required]">
<option value="">请选择...</option>
<option value="1">有效</option>
<option value="2">无效</option>
</select>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-primary" data-primary="addSave" id="save">保存</button>
</div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "AppAdminView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{ field: 'id', title: 'ID', align: 'center', valign: 'middle', width: '5%' },
{ field: 'app', title: 'app', align: 'center', valign: 'middle', width: '10%' },
{ field: 'appName', title: '名称', align: 'center', valign: 'middle', width: '10%' },
{ field: 'remark', title: '备注', align: 'center', valign: 'middle', width: '10%' },
{
field: 'status', title: '状态', align: 'center', valign: 'middle', width: '5%',
formatter: function (val, row, index) {
if (null == val) {
return '-';
}
if (val == 1) {
return '<span class="label label-success">有效</span>';
} else if (val == 2) {
return '<span class="label label-danger">无效</span>';
} else {
return val;
}
}
},
{
field: 'createTime', title: '创建时间', align: 'center', valign: 'middle', width: '10%',
formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format('yyyy-MM-dd hh:mm:ss');
} else {
return '-';
}
}
},
{
field: 'tmp', title: '操作', align: 'center', valign: 'middle', width: '10%', formatter: function (val, row, index) {
var key = row.id;
var str = '<button class="btn btn-primary btn-sm opt-edit" data-id="' + key + '">编辑</button>';
return str;
}
}
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pagination: true,
pageList: [10, 20, 30, 50],
sidePagination: 'server',
queryParamsType: 'undefined',
queryParams: function queryParams(params) {
var param = {
pageSize: params.pageSize,
pageNumber: params.pageNumber,
name: $('#name').val(),
status: $('#seachStatus').val(),
};
return param;
},
uniqueId: 'id',
toolbar: '#toolbar',
url: '/admin/appName/list',
onLoadSuccess: function () {
console.log('load success');
},
onLoadError: function () {
console.log('load fail');
}
});
// 编辑按钮点击事件
$('#table').on('click', '.opt-edit', function () {
clearModal();
var id = $(this).data('id');
$.ajax({
type: "get",
url: "/admin/appName/getById.action",
data: { id: id },
dataType: "json",
success: function (json) {
if (json && json.code == 200) {
var data = json.data;
$("#modal_id").val(id);
$('#modal_app').val(data.app);
$('#modal_appName').val(data.appName);
$('#modal_status').val(data.status);
$('#modal_remark').val(data.remark);
} else {
$("#tipMsg").text("获取菜单信息出错");
$("#tipModal").modal('show');
}
}
});
$("#appNameModalLabel").text("编辑app配置");
$("#appNameModal").modal('show');
});
// 添加事件
$('#add').on('click', function () {
clearModal();
$('#appNameModal').modal('show');
});
// 保存
$('#save').on('click', function () {
if ($('#addForm').validationEngine('validate')) {
var param = {};
param.id = $('#modal_id').val();
param.app = $('#modal_app').val();
param.appName = $('#modal_appName').val();
param.status = $('#modal_status').val();
param.remark = $('#modal_remark').val();
$.ajax({
type: 'post',
url: '/admin/appName/saveOrUpdate',
data: param,
dataType: 'json',
success: function (res) {
if (res.code == 200) {
$('#appNameModal').modal('hide');
$('#tipMsg').text('保存成功');
$('#tipModal').modal('show');
TableHelper.doRefresh('#table')
} else {
$('#tipMsg').text('保存失败,错误码:' + res.message);
$('#tipModal').modal('show');
}
}
})
}
});
$("#search").on('click', function () {
TableHelper.doRefresh('#table');
});
function clearModal() {
$('#addForm')[0].reset();
$('#addForm').validationEngine('hideAll');
$('#modal_id').val('');
}
});
}
},
};
</script>
<style scoped></style>

View File

@@ -0,0 +1,254 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<section class="content">
<div id="table"></div>
<div id="toolbar">
封禁类型<select id="blockTypeSearch" name="blockType" class="input-sm">
<option value="0">全部</option>
<option value="5">手机号</option>
<option value="2">设备号</option>
<option value="3">IP地址</option>
</select>
搜索内容<input type="text" class="input-sm" name="blockValue" id="blockValueSearch"
placeholder="手机号、设备号、IP地址">
<button id="btnSearch" class="btn btn-default">
<i class="glyphicon glyphicon-search"></i>搜索
</button>
<button id="addBtn" class="btn btn-default">
<i class="glyphicon glyphicon-plus"></i>增加
</button>
</div>
</section>
</div>
</div>
</section>
<div class="modal fade" id="genAccountModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="modalLabel">新增配置</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" id="addForm">
<div class="form-group">
<label for="blockTypeAdd" class="col-sm-3 control-label">封禁类型</label>
<div class="col-sm-9">
<select id="blockTypeAdd" name="blockType" class="form-control">
<option value="5">手机号</option>
<option value="2">设备号</option>
<option value="3">IP地址</option>
</select>
</div>
</div>
<div class="form-group">
<label for="blockValueAdd" class="col-sm-3 control-label">封禁内容</label>
<div class="col-sm-9">
<input type="text" class="form-control validate[required]" name="blockValue"
id="blockValueAdd" placeholder="手机号、设备号、IP地址">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="add">确定</button>
</div>
</div>
</div>
</div>
<div id="imgMask"><img src="" alt=""></div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
import { showLoading, hideLoading } from '@/utils/maintainer';
export default {
name: "BlockAdminView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{ field: 'configId', title: '序号', align: 'center', valign: 'middle', width: '5%' },
{
field: 'blockType', title: '封禁类型', align: 'center', valign: 'middle', width: '10%', formatter: function (val, row, index) {
if (val == 2) {
return "设备号";
} else if (val == 3) {
return "IP地址";
} else {
return "手机号";
}
}
},
{ field: 'blockValue', title: '封禁内容', align: 'center', valign: 'middle', width: '10%' },
{ field: 'operator', title: '操作人', align: 'center', valign: 'middle', width: '10%' },
{
field: 'createTime', title: '创建时间', align: 'center', valign: 'middle', width: '10%', formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format('yyyy-MM-dd hh:mm:ss');
} else {
return '-';
}
}
},
{
field: 'configId',
title: '操作',
align: 'center',
width: '10%',
valign: 'middle',
formatter: function (val, row, index) {
return '<button class="btn btn-sm btn-danger opt-remove" data-id=' + val +
'><i class="glyphicon glyphicon-remove"></i>删除</button>';
}
}
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pagination: true,
pageList: [10, 20, 30, 50],
sidePagination: "server", //表示服务端请求
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageSize: params.pageSize,
pageNumber: params.pageNumber,
blockType: $('#blockTypeSearch').val(),
blockValue: $('#blockValueSearch').val()
};
return param;
},
uniqueId: 'configId',
toolbar: '#toolbar',
url: '/admin/block/list',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
})
/*查询刷新*/
$('#btnSearch').on('click', function () {
console.log("refresh")
TableHelper.doRefresh('#table');
})
$('#addBtn').on('click', function () {
$("#addForm")[0].reset();
$('#genAccountModal').modal('show');
});
$("#add").click(function () {
if ($('#addForm').validationEngine('validate')) {
showLoading();
$.ajax({
type: "post",
url: "/admin/block/save",
data: $('#addForm').serialize(),
dataType: 'json',
success: function (json) {
if (json.code == 200) {
$("#genAccountModal").modal('hide');
$("#tipMsg").text("添加成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
hideLoading();
} else {
$("#tipMsg").text("保存失败," + json.message);
$("#tipModal").modal('show');
hideLoading();
}
}
})
}
});
$("#table").on("click", '.opt-remove', function () {
var id = $(this).attr("data-id");
if (id == 'undefined') {
$("#tipMsg").text("id参数有误");
$("#tipModal").modal('show');
return;
}
if (confirm("你确认删除该记录吗?" +
"\r\n删除后再也不能找回请谨慎操作")) {
$.ajax({
type: 'post',
url: "/admin/block/delete",
data: { 'configId': id },
dataType: "json",
success: function (json) {
if (json.code == 200) {
$("#tipMsg").text("删除成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("删除失败," + json.message);
$("#tipModal").modal('show');
}
}
});
}
});
})
}
},
};
</script>
<style scoped>
#imgMask {
position: absolute;
top: 0;
left: 0;
width: 200px;
height: 200px;
padding: 4px;
background: #fff;
z-index: 1000;
display: none;
}
#imgMask img {
width: 100%;
height: 100%;
vertical-align: top;
}
/*input,select{
margin-left: 8px;
margin-right: 8px;
}*/
#btnSearch {
margin-left: 36px;
}</style>

View File

@@ -0,0 +1,302 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<section class="content">
<div id="table"></div>
<div id="toolbar">
手机号:<input type="text" class="input-sm" name="phone" id="phone">
设备号:<input type="text" class="input-sm" name="deviceId" id="deviceId">
IP地址<input type="text" class="input-sm" name="ip" id="ip">
<button id="btnSearch" class="btn btn-sm btn-primary">查询</button>
</div>
</section>
</div>
</div>
</section>
<div class="modal fade" id="addAccountBlocked" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="modalLabel">新增配置</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" id="addBlockForm">
<div class="form-group">
<label for="blockTypeAdd" class="col-sm-3 control-label">封禁类型</label>
<div class="col-sm-9">
<select id="blockTypeAdd" name="blockType" class="form-control">
<option value="5">手机号</option>
<option value="2">设备号</option>
<option value="3">IP地址</option>
</select>
</div>
</div>
<div class="form-group">
<label for="blockValueAdd" class="col-sm-3 control-label">封禁内容</label>
<div class="col-sm-9">
<input type="text" class="form-control validate[required]" name="blockValue"
id="blockValueAdd" placeholder="手机号、设备号、IP地址">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="add">确定</button>
</div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
import { showLoading, hideLoading } from '@/utils/maintainer';
/*初始化*/
var picker3 = $('#addEndDate').datetimepicker({
format: 'yyyy-mm-dd hh:ii',
autoclose: true,
startDate: new Date()
})
/* picker3.on('changeDate', function () {
var date = $('#addEndDate').datetimepicker('getDate');
picker3.datetimepicker('setEndDate',date);
});*/
var erbanNo;
export default {
name: "BlockSearchUserAdminView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {//默认时间
var todayDate = new Date();
var minute = todayDate.getMinutes() < 10 ? "0" + todayDate.getMinutes() : todayDate.getMinutes();
var month = (todayDate.getMonth() + 1) < 10 ? "0" + (todayDate.getMonth() + 1) : (todayDate.getMonth() + 1);
var todayDateStr = todayDate.getFullYear() + "-" + month + "-" + todayDate.getDate() + " " + todayDate.getHours() + ":" + minute;
$("#addStartDate").val(todayDateStr);
})
$(function () {
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{ field: 'erbanNo', title: '平台号', align: 'center', valign: 'middle', width: '10%' },
{ field: 'phone', title: '手机号', align: 'center', valign: 'middle', width: '10%' },
{ field: 'deviceId', title: '设备号', align: 'center', valign: 'middle', width: '10%' },
{ field: 'loginIp', title: 'IP地址', align: 'center', valign: 'middle', width: '10%' },
{
field: 'erbanNo',
title: '操作',
align: 'center',
width: '10%',
valign: 'middle',
formatter: function (val, row, index) {
return "<button class='btn btn-sm btn-success opt-edit' data-id=" + val + " >封禁</button>";
}
}
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 20,
pagination: true,
pageList: [10, 20, 30, 50],
sidePagination: "client", //表示服务端请求
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageSize: params.pageSize,
pageNum: params.pageNumber,
ip: $('#ip').val(),
phone: $('#phone').val(),
deviceId: $('#deviceId').val()
};
return param;
},
uniqueId: 'erbanNo',
toolbar: '#toolbar',
url: '/admin/block/searchUser',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
})
/*查询刷新*/
$('#btnSearch').on('click', function () {
TableHelper.doRefresh('#table');
})
/*保存*/
$('#addSave').on('click', function () {
if ($('#addBlockForm').validationEngine('validate')) {
$("#tipMsg").text("正在封禁,请稍后");
$("#tipModal").modal('show');
$.ajax({
type: "post",
url: "/admin/accountBlock/saveAccountBlocked.action",
data: {
erbanNo: $("#erbanNo").val(),
blockDesc: $("#blockDesc").val(),
blockType: $("#blockType").val(),
startBlockTime: $('#addStartDate').val(),
endBlockTime: $('#addEndDate').val(),
wallStatus: $('#wallStatus').val()
},
dataType: 'json',
success: function (data) {
if (data.code == 200) {
$('#addAccountBlocked').modal('hide');
$("#tipMsg").text("保存成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("保存失败,错误码:" + data.message);
$("#tipModal").modal('show');
}
}
})
}
})
//解封
$('#table').on('click', '.opt-release', function () {
var key = parseInt($(this).data('id'));
console.log(key, typeof key);
$.ajax({
type: 'post',
url: '/admin/accountBlock/unBlockAccountBlocked.action',
data: { 'rowId': key },
dataType: 'json',
success: function (data) {
if (data.code == 200) {
$("#tipMsg").text("解封成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("解封失败,错误信息:" + data.message);
$("#tipModal").modal('show');
}
}
})
})
//编辑
$('#table').on('click', '.opt-edit', function () {
$('#addBlockForm')[0].reset();
erbanNo = $(this).attr("data-id");
initAddForm();
$('#addAccountBlocked').modal('show');
})
$('#blockTypeAdd').on('change', function () {
initAddForm();
})
//编辑弹窗保存
$('#add').on('click', function () {
if ($('#addBlockForm').validationEngine('validate')) {
showLoading();
$.ajax({
type: "post",
url: "/admin/block/save",
data: $('#addBlockForm').serialize(),
dataType: 'json',
success: function (json) {
if (json.code == 200) {
$("#addAccountBlocked").modal('hide');
$("#tipMsg").text("添加成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
hideLoading();
} else {
$("#tipMsg").text("保存失败," + json.message);
$("#tipModal").modal('show');
hideLoading();
}
}
})
}
})
})
}
},
};
function initAddForm() {
var blockType = $('#blockTypeAdd').val();
var row = $('#table').bootstrapTable('getRowByUniqueId', erbanNo);
var blockValue = "请选择另一个类型";
if (blockType == 5) {
blockValue = row.phone;
}
if (blockType == 2) {
blockValue = row.deviceId;
}
if (blockType == 3) {
blockValue = row.loginIp;
}
$('#blockValueAdd').val(blockValue);
}
</script>
<style scoped>
.bar1,
.bar2 {
margin-bottom: 10px;
}
label.col-sm-1 {
padding: 0;
line-height: 30px;
text-align: right;
/*padding-right: 4px;*/
}
label.col-sm-1 {
padding: 0;
line-height: 30px;
text-align: right;
/*padding-right: 4px;*/
}
input,
select {
margin-left: 8px;
margin-right: 8px;
}
#btnSearch {
margin-left: 36px;
}
.record {
margin-top: 10px;
}
.record .title {
font-size: 16px;
}
</style>

View File

@@ -0,0 +1,359 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<!-- .content -->
<section class="content">
<div id="table"></div>
<div id="toolbar">
app:
<select name="appId" id="appId" class="input-m">
<option value="">--全部--</option>
</select>
&nbsp;&nbsp;&nbsp;
渠道:
<input type="text" name="channel" id="channel" placeholder="请输入渠道名称">
&nbsp;&nbsp;&nbsp;
操作时间
<input type="text" name="startTime" id="startTime" class="input-sm" placeholder="请选择开始时间">
- <input type="text" name="endTime" id="endTime" class="input-sm" placeholder="请选择结束时间">
&nbsp;&nbsp;&nbsp;
<button class="btn btn-default" id="search">
<i class="glyphicon glyphicon-wrench"></i>查询
</button>
&nbsp;&nbsp;&nbsp;
<button class="btn btn-primary" id="add">
<i class="glyphicon glyphicon-plus"></i>增加
</button>
</div>
</section>
</div>
</div>
</section>
<!-- 弹窗 -->
<div class="modal fade" id="editModal" rabindex='-1' role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button class="close" type="button" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">x</span>
</button>
<div class="modal-title" id="editModalLabel">增加渠道分发配置配置</div>
</div>
<div class="modal-body">
<form action="" id="addForm" class="form-horizontal">
<input type="hidden" id="modal_id">
<div class="form-group">
<label for="modal_appId" class="col-sm-3 control-label">app</label>
<div class="col-sm-8">
<select name="modal_appId" id="modal_appId" class="validate[required]">
<option value="">请选择...</option>
</select>
</div>
</div>
<div class="form-group">
<label for="modal_channel" class="col-sm-3 control-label">渠道</label>
<div class="col-sm-8">
<textarea name="modal_channel" id="modal_channel" class="form-control validate[required]"
placeholder="请正确输入渠道名称,多个用,隔开"></textarea>
</div>
</div>
<div class="form-group">
<label for="modal_routeType" class="col-sm-3 control-label">routeType</label>
<div class="col-sm-8">
<input type="text" class="form-control validate[minlength: 200]" name="modal_routeType"
id="modal_routeType" placeholder="不超过200个字符">
</div>
</div>
<div class="form-group">
<label for="modal_routeValue" class="col-sm-3 control-label">routeValue</label>
<div class="col-sm-8">
<input type="text" class="form-control validate[minlength: 200]" name="modal_routeValue"
id="modal_routeValue" placeholder="不超过200个字符">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-primary" data-primary="addSave" id="save">保存</button>
</div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
var picker1 = $('#startTime').datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
autoclose: true,
endDate: new Date()
});
var picker2 = $('#endTime').datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
autoclose: true
});
picker1.on('changeDate', function () {
var date = $('#startTime').datetimepicker('getDate');
picker2.datepicker('setStartDate', date);
});
picker2.on('changeDate', function () {
var date = $('#endTime').datetimepicker('getDate');
picker1.datepicker('setEndDate', date);
});
var app = {};
var validApp = {};
export default {
name: "ChannelDistributeAdminView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
getAppNames();
function getAppNames() {
$.get('/admin/appName/listAll', {}, function (res) {
if (res.rows.length > 0) {
renderSelect(res.rows);
renderAppObj(res.rows);
}
})
}
function renderSelect(data) {
var $select = $('#appId');
for (var i = 0; i < data.length; i++) {
var $option = $('<option value="' + data[i].app + '" />');
$option.html(data[i].appName);
$select.append($option);
}
}
function renderAppObj(rows) {
for (var i = 0; i < rows.length; i++) {
var row = rows[i];
app[row.app] = row.appName;
// 有效的app
if (row.status == 1) {
validApp[row.app] = row.appName;
}
}
}
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{ field: 'id', title: 'ID', align: 'center', valign: 'middle', width: '5%' },
{
field: 'appId', title: 'app', align: 'center', valign: 'middle', width: '10%',
formatter: function (val, row, index) {
var name = app[val];
if (name != null) {
return name;
}
return val;
}
},
{ field: 'channel', title: '渠道', align: 'center', valign: 'middle', width: '10%' },
{ field: 'routeType', title: 'routeType', align: 'center', valign: 'middle', width: '10%' },
{ field: 'routeValue', title: 'routeValue', align: 'center', valign: 'middle', width: '10%' },
{
field: 'createTime', title: '操作时间', align: 'center', valign: 'middle', width: '10%',
formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format('yyyy-MM-dd hh:mm:ss');
} else {
return '-';
}
}
},
{
field: 'tmp', title: '操作', align: 'center', valign: 'middle', width: '10%', formatter: function (val, row, index) {
var key = row.id;
var str = '<button class="btn btn-primary btn-sm opt-edit" data-id="' + key + '">编辑</button>&nbsp;&nbsp;';
str += '<button class="btn btn-danger btn-sm opt-remove" data-id="' + key + '">删除</button>';
return str;
}
}
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pagination: true,
pageList: [10, 20, 30, 50],
sidePagination: 'server',
queryParamsType: 'undefined',
queryParams: function queryParams(params) {
var param = {
pageSize: params.pageSize,
pageNumber: params.pageNumber,
appId: $('#appId').val(),
channel: $('#channel').val(),
startTime: $('#startTime').val(),
endTime: $('#endTime').val()
};
return param;
},
uniqueId: 'id',
toolbar: '#toolbar',
url: '/admin/channel/distribute/list',
onLoadSuccess: function () {
console.log('load success');
},
onLoadError: function () {
console.log('load fail');
}
});
// 编辑按钮点击事件
$('#table').on('click', '.opt-edit', function () {
clearModal();
var id = $(this).data('id');
// 处理appId
$('#modal_appId').empty();
$('#modal_appId').append('<option value="">请选择</option>');
for (var key in app) {
$('#modal_appId').append('<option value="' + key + '">' + app[key] + '</option>');
}
$.ajax({
type: "get",
url: "/admin/channel/distribute/getById.action",
data: { id: id },
dataType: "json",
success: function (json) {
if (json && json.code == 200) {
var data = json.data;
$("#modal_id").val(id);
$('#modal_appId').val(data.appId);
$('#modal_channel').val(data.channel);
$('#modal_routeType').val(data.routeType);
$('#modal_routeValue').val(data.routeValue);
} else {
$("#tipMsg").text("获取信息出错");
$("#tipModal").modal('show');
}
}
});
$('#modal_appId').attr('disabled', 'disabled');
$('#modal_channel').attr('disabled', 'disabled');
$("#editModalLabel").text("编辑app配置");
$("#editModal").modal('show');
});
// 删除
$("#table").on("click", '.opt-remove', function () {
var id = $(this).attr("data-id");
if (id == 'undefined') {
$("#tipMsg").text("id参数有误");
$("#tipModal").modal('show');
return;
}
if (confirm("删除后该渠道配置的落地页将会失效 \r\n 是否确认删除?!")) {
$.ajax({
type: 'post',
url: "/admin/channel/distribute/delete.action",
data: { id: id },
dataType: "json",
success: function (json) {
if (json.code == 200) {
$("#tipMsg").text("删除成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("删除失败");
$("#tipModal").modal('show');
}
}
});
}
});
// 添加事件
$('#add').on('click', function () {
clearModal();
// 处理appId
$('#modal_appId').empty();
$('#modal_appId').append('<option value="">请选择</option>');
for (var key in validApp) {
$('#modal_appId').append('<option value="' + key + '">' + validApp[key] + '</option>');
}
$('#editModal').modal('show');
});
// 保存
$('#save').on('click', function () {
if ($('#addForm').validationEngine('validate')) {
if ($('#modal_appId').val().trim() == '') {
$('#tipMsg').text('请选择app');
$('#tipModal').modal('show');
return;
}
var param = {};
param.id = $('#modal_id').val();
param.appId = $('#modal_appId').val();
param.channel = $('#modal_channel').val();
param.routeType = $('#modal_routeType').val();
param.routeValue = $('#modal_routeValue').val();
$.ajax({
type: 'post',
url: '/admin/channel/distribute/saveOrUpdate',
data: param,
dataType: 'json',
success: function (res) {
if (res.code == 200) {
$('#editModal').modal('hide');
$('#tipMsg').text('保存成功');
$('#tipModal').modal('show');
TableHelper.doRefresh('#table')
} else {
$('#tipMsg').text('保存失败,错误码:' + res.message);
$('#tipModal').modal('show');
}
}
})
}
});
$("#search").on('click', function () {
TableHelper.doRefresh('#table');
});
function clearModal() {
$('#addForm')[0].reset();
$('#addForm').validationEngine('hideAll');
$('#modal_id').val('');
$('#modal_appId').removeAttr('disabled');
$('#modal_channel').removeAttr('disabled');
}
});
}
},
};
</script>
<style scoped></style>

View File

@@ -0,0 +1,193 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<!-- .content -->
<div id="table"></div>
</div>
</div>
</section>-->
<!--编辑客服-->
<div class="modal fade" id="customServiceModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="customServiceModalLabel">编辑</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" id="customServiceForm">
<input type="hidden" id="id">
<div class="form-group">
<label for="type" class="col-sm-3 control-label">客服类型:</label>
<div class="col-sm-9">
<select name="type" id="type" data-btn-class="btn-warning" class="form-control">
<option id="online" value="1">在线客服</option>
<option id="phone" value="2">电话客服</option>
</select>
</div>
</div>
<div class="form-group">
<label for="customContent" class="col-sm-3 control-label">联系方式:</label>
<div class="col-sm-9">
<input type="text" class="form-control" name="content" id="customContent">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="edit">提交</button>
</div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "CustomserviceAdminView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('#table').bootstrapTable('destroy');
//初始化表格数据
$('#table').bootstrapTable({
columns: [
{ field: 'tmp', title: 'id', align: 'center', checkbox: true, width: '5%', valign: 'middle' },
{ field: 'id', title: '编号', align: 'center', width: '5%', valign: 'middle' },
{ field: 'type', title: '客服种类', align: 'center', width: '5%', valign: 'middle' },
{ field: 'content', title: '联系方式', align: 'center', width: '5%', valign: 'middle' },
{
field: 'id',
title: '操作',
align: 'center',
width: '5%',
valign: 'middle',
formatter: function (val, row, index) {
return '<button id="btnEdit" name="btnEdit" class="btn btn-sm btn-success opt-edit" data-id=' + val + '>' +
'<i class="glyphicon glyphicon-edit"></i> 修改</button>&nbsp;&nbsp;';
}
}
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 20,
pagination: true,
pageList: [20, 50, 100, 200, 300, 500],
search: false,
sidePagination: "server", //表示服务端请求
//设置为undefined可以获取pageNumberpageSizesearchTextsortNamesortOrder
//设置为limit可以获取limit, offset, search, sort, order
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
page: params.pageNumber,
pageSize: params.pageSize,
};
return param;
},
toolbar: '#toolbar',
url: '/admin/custom/service/list.action',
onLoadSuccess: function () { //加载成功时执行
$(".bs-checkbox").css({ 'text-align': 'center', 'vertical-align': 'middle' });
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
});
$("#table").on("click", '.opt-edit', function () {
clearForm("customServiceForm");
var id = $(this).attr("data-id");
$.ajax({
type: "get",
url: "/admin/custom/service/getById.action",
data: { id: id },
dataType: "json",
success: function (json) {
if (json) {
$("#id").val(json.id);
$("#type").val(json.type);
if (json.type == "1") {
$("#online").attr("selected", "selected");
} else if (json.type == "2") {
$("#phone").attr("selected", "selected");
}
$("#customContent").val(json.content);
// 打开编辑弹窗
$("#customServiceModal").modal('show');
} else {
$("#tipMsg").text("获取菜单信息出错");
$("#tipModal").modal('show');
}
}
});
});
//编辑客服保存
$("#edit").on("click", function () {
var id = $("#id").val();
var type = $("#type").val();
var content = $("#customContent").val();
if ($("#customServiceForm").validationEngine('validate')) {
$.ajax({
type: 'post',
url: '/admin/custom/service/saveOrUpdate.action',
data: {
id: id,
type: type,
content: content
},
dataType: 'json',
success: function (json) {
if (json.success == 'true') {
$("#tipMsg").text("保存成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
$("#customServiceModal").modal('hide');
} else {
$("#tipMsg").text("保存失败." + json.msg);
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
$("#customServiceModal").modal('hide');
}
}
});
}
});
function clearForm(formId) {
var $form = $('#' + formId);
$form.find('input').val('');
$form.find('select').val('');
$form.find('textarea').val('');
$form.find('img').attr("src", "");
$form.find('span').html("");
}
});
}
},
};
</script>
<style scoped></style>

View File

@@ -0,0 +1,251 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<!-- .content -->
<section class="content">
<div id="table"></div>
<div id="toolbar">
<button id="add" class="btn btn-default">
<i class="glyphicon glyphicon-plus"></i>增加
</button>
</div>
</section>
</div>
</div>
</section>
<div class="modal fade" id="dictModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="modalLabel">字典信息</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" id="dictForm">
<div class="form-group">
<label for="code" class="col-sm-2 control-label">编码:</label>
<div class="col-sm-10">
<input type="text" class="form-control validate[required]" name="code" id="code">
</div>
</div>
<div class="form-group">
<label for="dictkey" class="col-sm-2 control-label">(key):</label>
<div class="col-sm-10">
<input type="text" class="form-control validate[required]" name="dictkey" id="dictkey">
</div>
</div>
<div class="form-group">
<label for="dictval" class="col-sm-2 control-label">(val):</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="dictval" id="dictval">
</div>
</div>
<div class="form-group">
<label for="showorder" class="col-sm-2 control-label">排序:</label>
<div class="col-sm-10">
<input type="text" class="form-control validate[required]" name="showorder" id="showorder"
value="0">
</div>
</div>
<div class="form-group">
<label for="status" class="col-sm-2 control-label">状态:</label>
<div class="col-sm-10">
<select name="status" id="status" data-btn-class="btn-warning">
<option value="1">有效</option>
<option value="0">无效</option>
</select>
</div>
</div>
<div class="form-group">
<label for="description" class="col-sm-2 control-label">描述:</label>
<div class="col-sm-10">
<textarea class="form-control" name="description" id="description"></textarea>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="save">保存</button>
</div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
import ComboboxHelper from '@/assets/plugins/bootstrap-combobox/js/bootstrap-combobox-helper';
var isEdit = false;
export default {
name: "DictAdminView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{ field: 'code', title: '编码', align: 'center', width: '15%' },
{ field: 'dictkey', title: '键(key)', align: 'center', width: '15%' },
{ field: 'dictval', title: '值(val)', width: '20%' },
{ field: 'showorder', title: '排序', align: 'center', width: '5%' },
{
field: 'status', title: '状态', align: 'center', width: '5%', formatter: function (val, row, index) {
if (val == true) {
return '有效';
}
return '无效';
}
},
{
field: 'createtime', title: '创建时间', align: 'center', width: '10%', formatter: function (val, row, index) {
var newDate = new Date();
newDate.setTime(val);
return newDate.toLocaleString();
}
},
{ field: 'description', title: '描述', align: 'center', width: '10%' },
{
field: 'tmp', title: '操作', align: 'center', width: '20%', formatter: function (val, row, index) {
var key = row.code + "," + row.dictkey;
return "<button class='btn btn-sm btn-success opt-edit' data-id=" + key + ">编辑</button>&nbsp;&nbsp;" +
"<button class='btn btn-sm btn-danger opt-del' data-id=" + key + ">删除</button>";
}
}
],
cache: false,
striped: true,
showRefresh: true,
pageSize: 10,
pagination: true,
pageList: [10, 20, 30, 50],
search: true,
sidePagination: "server", //表示服务端请求
//设置为undefined可以获取pageNumberpageSizesearchTextsortNamesortOrder
//设置为limit可以获取limit, offset, search, sort, order
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageNumber: params.pageNumber,
pageSize: params.pageSize,
searchText: params.searchText
};
return param;
},
toolbar: '#toolbar',
url: '/admin/dict/getlist.action',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
});
// 构建下拉组合框
ComboboxHelper.build(null, '#status');
$("#dictForm").validationEngine();
$("#add").click(function () {
// 打开编辑弹窗
$("#dictModal").modal('show');
isEdit = false;
$("#dictForm")[0].reset();
});
$("#table").on("click", '.opt-remove', function () {
var key = $(this).attr("data-id").split(",");
var code = key[0];
var dictkey = key[1];
$.ajax({
type: 'post',
url: "/admin/dict/del.action",
data: { 'code': code, 'dictkey': dictkey },
dataType: "json",
success: function (json) {
if (json.result == 1) {
$("#tipMsg").text("删除成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#roleTable");
} else {
$("#tipMsg").text("删除失败,错误码:" + json.result);
$("#tipModal").modal('show');
}
}
});
});
$("#table").on("click", '.opt-edit', function () {
var key = $(this).attr("data-id").split(",");
var code = key[0];
var dictkey = key[1];
isEdit = true;
$.ajax({
type: "post",
url: "/admin/dict/getone.action",
data: { 'code': code, 'dictkey': dictkey },
dataType: "json",
success: function (json) {
if (json.entity) {
$("#code").val(json.entity.code);
$("#dictkey").val(json.entity.dictkey);
$("#dictval").val(json.entity.dictval);
$("#showorder").val(json.entity.showorder);
$("#description").val(json.entity.description);
ComboboxHelper.setDef("#status", json.entity.status ? "1" : "0");
// 打开编辑弹窗
$("#dictModal").modal('show');
} else {
$("#tipMsg").text("获取系统字典信息出错");
$("#tipModal").modal('show');
}
}
});
});
$("#save").click(function () {
if ($("#dictForm").validationEngine('validate')) {
$.ajax({
type: "post",
url: "/admin/dict/save.action?isEdit=" + isEdit,
data: $('#dictForm').serialize(),
dataType: "json",
success: function (json) {
if (json.result == 1) {
$("#dictModal").modal('hide');
$("#tipMsg").text("保存成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("保存失败,错误码:" + json.result);
$("#tipModal").modal('show');
}
}
});
}
});
});
}
},
};
</script>
<style scoped></style>

View File

@@ -0,0 +1,357 @@
<template>
<!-- Content Header (Page header) -->
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<!-- .content -->
<section class="content">
<div id="userTable"></div>
<div id="toolbar">
<button id="add" class="btn btn-default">
<i class="glyphicon glyphicon-plus"></i>增加
</button>
</div>
</section>
<!-- .content -->
<div class="modal fade" id="userModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="modalLabel">角色信息</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" id="userForm">
<input type="hidden" name="id" id="id" />
<input type="hidden" name="optUid" id="optUid" />
<div class="form-group">
<label for="name" class="col-sm-3 control-label">名称:</label>
<div class="col-sm-8">
<input type="text" class="form-control validate[required]" name="name" id="name">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="save">保存</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="roleModal" tabindex="-1" role="dialog" aria-labelledby="modalLabe2">
<div class="modal-dialog" role="document">
<div class="modal-content" style="width: 700px;">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="modalLabe2">授权菜单</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" id="roleForm">
<input type="hidden" name="roleId" id="roleId" />
<div class="form-group">
<label for="name2" class="col-sm-3 control-label">名称:</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="name" id="name2" disabled="disabled">
</div>
</div>
<div id="menuTree"></div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="save2">保存</button>
</div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
import { showLoading, hideLoading } from '@/utils/maintainer';
var isEdit = false;
export default {
name: "RoleAdminView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('#userTable').bootstrapTable('destroy');
$('#userTable').bootstrapTable({
columns: [
{ field: 'id', title: 'ID', align: 'center', width: '3%' },
{ field: 'name', title: '名称', align: 'center', width: '20%' },
{
field: 'id',
title: '操作',
align: 'center',
width: '25%',
formatter: function (val, row, index) {
return '<button class="btn btn-sm btn-success opt-edit" data-id=' + val + '>' +
'<i class="glyphicon glyphicon-edit"></i>编辑</button>' +
'&nbsp;&nbsp;<button class="btn btn-sm btn-warning opt-role" data-id=' + val +
'><i class="glyphicon glyphicon-user"></i>授权菜单</button>' +
'&nbsp;&nbsp;<button class="btn btn-sm btn-danger opt-remove" data-id=' + val +
'><i class="glyphicon glyphicon-remove"></i>删除</button>';
}
}
],
cache: false,
striped: true,
showRefresh: true,
pageSize: 10,
pagination: true,
pageList: [10, 20, 30, 50],
search: true,
sidePagination: "server", //表示服务端请求
//设置为undefined可以获取pageNumberpageSizesearchTextsortNamesortOrder
//设置为limit可以获取limit, offset, search, sort, order
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageNumber: params.pageNumber,
pageSize: params.pageSize,
searchText: params.searchText
};
return param;
},
uniqueId: 'id',
toolbar: '#toolbar',
url: '/admin/role/getlist.action',
onLoadSuccess: function () { //加载成功时执行
// console.log("load success");
},
onLoadError: function () { //加载失败时执行
// console.log("load fail");
}
});
$("#userTable").on("click", '.opt-remove', function () {
var id = $(this).attr("data-id");
if (confirm("你确认删除【" + TableHelper.getRowByUniqueId("#userTable", id).username + "】吗?" +
"\r\n删除后再也不能找回请谨慎操作")) {
$.ajax({
type: 'post',
url: "/admin/role/del.action",
data: { 'id': id },
dataType: "json",
success: function (json) {
if (json.result == 1) {
$("#tipMsg").text("删除成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#userTable");
} else {
$("#tipMsg").text("删除失败,错误码:" + json.result);
$("#tipModal").modal('show');
}
}
});
}
});
$("#userTable").on("click", '.opt-edit', function () {
var id = $(this).attr("data-id");
isEdit = true;
$.ajax({
type: "post",
url: "/admin/role/getone.action",
data: { id: id },
dataType: "json",
success: function (json) {
if (json.entity) {
$("#id").val(json.entity.id);
$("#name").val(json.entity.name);
$("#userModal").modal('show');
} else {
$("#tipMsg").text("获取信息出错");
$("#tipModal").modal('show');
}
}
});
});
$('#add').click(function () {
$("#imgUrl").attr("src", "");
isEdit = false;
$("#userForm")[0].reset();
$("#id").val(0);
$("#optUid").val(0);
$("#userModal").modal('show');
});
$('#save').click(function () {
if ($("#userForm").validationEngine('validate')) {
$.ajax({
type: "post",
url: "/admin/role/save.action?isEdit=" + isEdit,
data: $('#userForm').serialize(),
dataType: "json",
success: function (json) {
if (json.result == 1) {
$("#userModal").modal('hide');
$("#tipMsg").text("保存成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#userTable");
} else {
$("#tipMsg").text("保存失败,错误码:" + json.result);
$("#tipModal").modal('show');
}
}
});
}
});
$('#save2').click(function () {
showLoading();
var selectedMenuNodes = $('#menuTree').treeview('getChecked');
var menuIds = "roleId=" + $("#roleId").val() + "&";
for (var index = 0; index < selectedMenuNodes.length; index++) {
menuIds += "menuIds=" + selectedMenuNodes[index].menuId + "&";
}
$.ajax({
type: "post",
url: "/admin/role/menu/save.action",
data: menuIds,
dataType: "json",
success: function (json) {
hideLoading();
if (json.result == 1) {
$("#roleModal").modal('hide');
$("#tipMsg").text("保存成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#userTable");
} else {
$("#tipMsg").text("保存失败,错误码:" + json.result);
$("#tipModal").modal('show');
}
}
});
});
});
$("#userTable").on("click", '.opt-role', function () {
var id = $(this).attr("data-id");
var username = $(this).parent().siblings().eq(1).text();
$.ajax({
type: "post",
url: "/admin/role/getmenu.action",
data: { roleId: id },
dataType: "json",
success: function (json) {
if (json.result == 0) {
$("#menuTree").treeview({
data: getMenuData(json), // 数据源
levels: 1, //设置继承树默认展开的级别
showTags: true, //是否在每个节点右边显示tags标签。tag值必须在每个列表树的data结构中给出
showCheckbox: true,
onNodeChecked: function (event, node) { //选中节点
var selectNodes = getChildNodeIdArr(node); //获取所有子节点
if (selectNodes) { //子节点不为空,则选中所有子节点
$('#menuTree').treeview('checkNode', [selectNodes, { silent: true }]);
}
var parentNode = $("#menuTree").treeview("getNode", node.parentId);
if (parentNode) {
$('#menuTree').treeview('checkNode', [parentNode, { silent: true }]);
}
},
onNodeUnchecked: function (event, node) { //取消选中节点
var selectNodes = getChildNodeIdArr(node); //获取所有子节点
if (selectNodes) { //子节点不为空,则取消选中所有子节点
$('#menuTree').treeview('uncheckNode', [selectNodes, { silent: true }]);
}
}
});
// $(".indent").parent("li").attr('display','inline');
$("#roleId").val(id);
$("#name2").val(username);
$("#roleModal").modal('show');
} else {
$("#tipMsg").text("获取信息出错");
$("#tipModal").modal('show');
}
}
});
});
}
},
};
function getMenuData(json) {
var parentMenu = "";
for (var index = 0; index < json.list.length; index++) {
var parent = json.list[index];
var sonMenu = "";
if (parent.sonList != null) {
for (var index1 = 0; index1 < parent.sonList.length; index1++) {
var son = parent.sonList[index1];
sonMenu += "{text: '" + son.name + "'," +
"menuId:'" + son.id + "'," +
"state:{checked:" + son.check + "}," +
"color:'#2f2424;display:inline-table '" +
"},";
}
}
if (sonMenu != "") {
sonMenu = sonMenu.substring(0, sonMenu.length - 1);
}
parentMenu += "{" +
"text: '" + parent.name + "'," +
"menuId:'" + parent.id + "'," +
"state:{checked:" + parent.check + ",expanded:" + parent.check + "}," +
"nodes: [" + sonMenu + "]" +
"},";
}
if (parentMenu != "") {
parentMenu = parentMenu.substring(0, parentMenu.length - 1);
}
var menuData = "[ " + parentMenu + "]";
return eval('(' + menuData + ')');
}
function getChildNodeIdArr(node) {
var ts = [];
if (node.nodes) {
let x, j;
for (x in node.nodes) {
ts.push(node.nodes[x].nodeId);
if (node.nodes[x].nodes) {
var getNodeDieDai = getChildNodeIdArr(node.nodes[x]);
for (j in getNodeDieDai) {
ts.push(getNodeDieDai[j]);
}
}
}
} else {
ts.push(node.nodeId);
}
return ts;
}
</script>
<style scoped>
.list-group-item {
padding: 2px 1px;
border: 0px solid #ddd;
}
</style>

View File

@@ -0,0 +1,326 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<!-- .content -->
<section class="content">
<div id="table"></div>
<div id="toolbar">
<button id="sysConf-add" class="btn btn-default">
<i class="glyphicon glyphicon-plus"></i>增加
</button>
<button id="sysConf-multiDel" class="btn btn-default">
<i class="glyphicon glyphicon-wrench"></i>批量删除
</button>
<!--<button id="sysConf-load" class="btn btn-default">-->
<!--<i class="glyphicon glyphicon-wrench"></i>加载-->
<!--</button>-->
</div>
</section><!-- .content -->
</div>
</div>
</section>
<div class="modal fade" id="sysConfModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="modalLabel">字典信息</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" id="sysConfForm">
<div class="form-group">
<label for="configId" class="col-sm-2 control-label">id</label>
<div class="col-sm-10">
<input type="text" class="form-control validate[required]" name="configId" id="configId">
</div>
</div>
<div class="form-group">
<label for="configName" class="col-sm-2 control-label">名称</label>
<div class="col-sm-10">
<input type="text" class="form-control validate[required]" name="configName"
id="configName">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">状态</label>
<div class="col-sm-10">
<label class="radio-inline"><input type="radio" name="configStatus" value="1"
checked>有效</label>
<label class="radio-inline"><input type="radio" name="configStatus" value="2">无效</label>
</div>
</div>
<div class="form-group">
<label for="configValue" class="col-sm-2 control-label"></label>
<div class="col-sm-10">
<input type="text" class="form-control" name="configValue" id="configValue">
</div>
</div>
<div class="form-group">
<label for="nameSpace" class="col-sm-2 control-label">命名空间</label>
<div class="col-sm-10">
<input type="text" class="form-control validate[required]" name="nameSpace" id="nameSpace">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="save">保存</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="tipModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">提示信息</h4>
</div>
<div class="modal-body" id="tipMsg"></div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "SysconfAdminView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{ field: 'tmp', title: 'ID', align: 'center', checkbox: true },
{ field: 'configId', title: 'id', align: 'center', width: '20%' },
{ field: 'configName', title: '名称', align: 'center', width: '25%' },
{ field: 'configValue', title: '值', align: 'center', width: '20%' },
{
field: 'configStatus', title: '状态', align: 'center', width: '5%', formatter: function (val, row, index) {
if (val == 1) {
return '有效';
}
else if (val == 2) {
return '无效';
}
}
},
{ field: 'nameSpace', title: '命名空间', align: 'center', width: '5%' },
{
field: 'configId', title: '操作', align: 'center', width: '25%', formatter: function (val, row, index) {
return '<button class="btn btn-sm btn-success opt-edit" data-id=' + val + '>' +
'<i class="glyphicon glyphicon-edit"></i>编辑</button>' +
'&nbsp;&nbsp;<button class="btn btn-sm btn-danger opt-remove" data-id=' + val +
'><i class="glyphicon glyphicon-remove"></i>删除</button>';
}
}
],
cache: false,
striped: true,
showRefresh: true,
pagination: false,
search: false,
sidePagination: "server", //表示服务端请求
//设置为undefined可以获取pageNumberpageSizesearchTextsortNamesortOrder
//设置为limit可以获取limit, offset, search, sort, order
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageNumber: params.pageNumber,
pageSize: params.pageSize,
searchText: params.searchText
};
return param;
},
toolbar: '#toolbar',
url: '/admin/sysConf/getList.action',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
$("#table").addClass("table_line");
$("td,th").addClass("td_center");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
});
$("#table").on("click", '.opt-remove', function () {
var id = $(this).attr("data-id");
if (id == 'undefined') {
$("#tipMsg").text("id参数有误");
$("#tipModal").modal('show');
return;
}
if (confirm("你确认删除该记录吗?" +
"\r\n删除后再也不能找回请谨慎操作")) {
$.ajax({
type: 'post',
url: "/admin/sysConf/del.action",
data: { 'ids': JSON.stringify([id]) },
dataType: "json",
success: function (json) {
if (json.success == 'true') {
$("#tipMsg").text("删除成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("删除失败");
$("#tipModal").modal('show');
}
}
});
}
});
$("#sysConf-add").click(function () {
// 打开编辑弹窗
$("#sysConfModal").modal('show');
$("#sysConfForm")[0].reset();
$("#configId").val('');
$("#configId").attr('readonly', false);
});
$("#sysConf-multiDel").click(function () {
var rows = $("#table").bootstrapTable("getSelections");
if (rows.length == 0) {
alert("请先选择要删除的记录");
return;
}
console.log("rows: " + rows.length);
var idArr = [];
for (var i = 0; i < rows.length; i++) {
idArr.push(rows[i]['configId']);
}
console.log(idArr);
if (confirm("你确认批量删除该记录吗?" +
"\r\n删除后再也不能找回请谨慎操作")) {
$.ajax({
type: 'post',
url: "/admin/sysConf/del.action",
data: { 'ids': JSON.stringify(idArr) },
dataType: "json",
success: function (json) {
if (json.success == 'true') {
$("#tipMsg").text("删除成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("删除失败");
$("#tipModal").modal('show');
}
}
});
}
});
$("#cancel").click(function () {
TableHelper.unCheckAll("#table");
});
$("#table").on("click", '.opt-edit', function () {
$("#configId").attr('readonly', true);
var id = $(this).attr("data-id");
$.ajax({
type: "get",
url: "/admin/sysConf/get.action",
data: { id: id },
dataType: "json",
success: function (json) {
if (json.entity) {
$("#configId").val(json.entity.configId);
$("#configName").val(json.entity.configName);
$("#configValue").val(json.entity.configValue);
$("#nameSpace").val(json.entity.nameSpace);
var status = json.entity.configStatus - 1;
$("input:radio[name='configStatus']")[status].checked = true;
// 打开编辑弹窗
$("#sysConfModal").modal('show');
} else {
$("#tipMsg").text("获取菜单信息出错");
$("#tipModal").modal('show');
}
}
});
});
$("#save").click(function () {
if ($("#sysConfForm").validationEngine('validate')) {
$.ajax({
type: "post",
url: "/admin/sysConf/save.action",
data: $('#sysConfForm').serialize(),
dataType: "json",
success: function (json) {
if (json.success == 'true') {
$("#sysConfModal").modal('hide');
$("#tipMsg").text("保存成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("保存失败");
$("#tipModal").modal('show');
}
}
});
}
});
});
// $("#sysConf-load").click(function(){
// $.ajax({
// type: 'post',
// url: "/admin/sysConf/loadList.action",
// dataType: "json",
// success: function (json) {
// if(json.success == 'true')
// {
// $("#tipMsg").text("删除成功");
// $("#tipModal").modal('show');
// TableHelper.doRefresh("#table");
// } else {
// $("#tipMsg").text("删除失败");
// $("#tipModal").modal('show');
// }
// }
// });
// });
}
},
};
</script>
<style scoped>
.table_line {
word-break: break-all;
}
.td_center {
vertical-align: middle !important;
}
.table_line {
word-break: break-all;
}
.td_center {
vertical-align: middle !important;
}</style>

View File

@@ -0,0 +1,565 @@
<template>
<!-- Content Header (Page header) -->
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<!-- .content -->
<section class="content">
<div id="userTable"></div>
<div id="toolbar">
<button id="add" class="btn btn-default">
<i class="glyphicon glyphicon-plus"></i>增加
</button>
</div>
</section>
<!-- .content -->
<div class="modal fade" id="userModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="modalLabel">用户信息</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" id="userForm">
<input type="hidden" name="id" id="id" />
<input type="hidden" name="optUid" id="optUid" />
<div class="form-group">
<label for="username" class="col-sm-3 control-label"><span
style="color: red; ">*</span>姓名:</label>
<div class="col-sm-8">
<input type="text" class="form-control validate[required]" name="username" id="username">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">头像</label>
<div class="col-sm-8">
<img src="" id="imgUrl" style="width:120px;" />
<input type="file" id="uploadFile" name="uploadFile">
<button class="btn btn-success" type="button" id="uploadBtn">上传</button>
<input type="hidden" id="headImg" name="headimg" class="form-control validate[required]" />
</div>
</div>
<div class="form-group">
<label for="email" class="col-sm-3 control-label">邮箱:</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="email" id="email">
</div>
</div>
<div class="form-group">
<label for="phone" class="col-sm-3 control-label"><span
style="color: red; ">*</span>手机号码:</label>
<div class="col-sm-8">
<input type="text" class="form-control validate[required]" name="phone" id="phone">
</div>
</div>
<div class="form-group">
<label for="qq" class="col-sm-3 control-label">QQ号码:</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="qq" id="qq">
</div>
</div>
<div class="form-group" id="passwordDiv">
<label for="newPassword" class="col-sm-3 control-label"><span
style="color: red; ">*</span>密码:</label>
<div class="col-sm-8">
<input type="text" class="form-control validate[required]" name="newPassword"
id="newPassword">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="save">保存</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="roleModal" tabindex="-1" role="dialog" aria-labelledby="modalLabe2">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="modalLabe2">授权角色</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" id="roleForm">
<input type="hidden" name="uid" id="uid" />
<div class="form-group">
<label for="username" class="col-sm-3 control-label">姓名:</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="username" id="username2" disabled="disabled">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">角色选项</label>
<div class="col-sm-8" id="roles">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="save2">保存</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="tipModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">提示信息</h4>
</div>
<div class="modal-body" id="tipMsg"></div>
</div>
</div>
</div>
<div class="modal fade" id="confirmModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel"
data-backdrop="static">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">确认信息</h4>
</div>
<div class="modal-body" id="confirmMsg"></div>
</div>
</div>
</div>
<div class="modal fade" id="roleModalMenu" tabindex="-1" role="dialog" aria-labelledby="modalLabe3">
<div class="modal-dialog" role="document">
<div class="modal-content" style="width: 700px;">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="modalLabe3">查看授权</h4>
</div>
<div class="modal-body">
<form class="form-horizontal">
<div class="form-group" style="margin-left: -110px;">
<label for="name2" class="col-sm-3 control-label" style="font-size: 14px;">角色名称:</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="name" id="name2" readonly="true">
</div>
</div>
<div id="menuTree"></div>
</form>
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
var isEdit = false;
export default {
name: "UserAdminView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('#userTable').bootstrapTable('destroy');
$('#userTable').bootstrapTable({
columns: [
{ field: 'id', title: 'ID', align: 'center', width: '3%' },
// {field: 'optUid', title: '类型', align: 'center', visible: false},
{ field: 'username', title: '姓名', align: 'center', width: '8%' },
{ field: 'password', title: '密码', align: 'center', width: '5%', visible: false },
{
field: 'headimg',
title: '头像',
align: 'center',
width: '8%',
formatter: function (val, row, index) {
return "<img src='" + val + "' width='70' height='60'>";
}
},
{
field: 'status',
title: '状态',
align: 'center',
width: '5%',
formatter: function (val, row, index) {
if (val) {
return "有效";
} else {
return "无效";
}
}
},
{ field: 'email', title: '邮箱', align: 'center', width: '8%' },
{ field: 'phone', title: '手机号码', align: 'center', width: '8%' },
{ field: 'qq', title: 'QQ', align: 'center', width: '8%' },
{
field: 'lastlogin',
title: '最后登录',
align: 'center',
width: '8%',
formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format("yyyy-MM-dd hh:mm:ss");
} else {
return '-';
}
}
},
{
field: 'createtime',
title: '创建时间',
align: 'center',
width: '10%',
formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format("yyyy-MM-dd hh:mm:ss");
} else {
return '-';
}
}
},
{
field: 'id',
title: '操作',
align: 'center',
width: '10%',
formatter: function (val, row, index) {
var str = '<div><button class="btn btn-sm btn-success opt-edit" data-id=' + val + '>' +
'<i class="glyphicon glyphicon-edit"></i>&#12288;编辑&#12288;</button>' +
'&nbsp;&nbsp;&nbsp;<button class="btn btn-sm btn-warning opt-role" data-id=' + val +
'><i class="glyphicon glyphicon-user"></i>授权角色</button></div><div style="margin-top: 2px;">' +
'&nbsp;&nbsp;&nbsp;<button class="btn btn-sm btn-info opt-role-menu" data-id=' + val +
'><i class="glyphicon glyphicon-user"></i>查看授权</button>&nbsp;&nbsp;&nbsp;';
if (!row.status) {
str += '<button class="btn btn-sm btn-primary opt-thaw" data-id=' + val +
'><i class="glyphicon glyphicon-remove"></i>&#12288;解冻&#12288;</button>';
}
str += '<button class="btn btn-sm btn-danger opt-remove" data-id=' + val +
'><i class="glyphicon glyphicon-remove"></i>&#12288;删除&#12288;</button></div>';
return str;
}
}
],
cache: false,
striped: true,
showRefresh: true,
pageSize: 10,
pagination: true,
pageList: [10, 20, 30, 50],
search: true,
sidePagination: "server", //表示服务端请求
//设置为undefined可以获取pageNumberpageSizesearchTextsortNamesortOrder
//设置为limit可以获取limit, offset, search, sort, order
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageNumber: params.pageNumber,
pageSize: params.pageSize,
searchText: params.searchText
};
return param;
},
uniqueId: 'id',
toolbar: '#toolbar',
url: '/admin/user/getlist.action',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
});
$("#userTable").on("click", '.opt-remove', function () {
var id = $(this).attr("data-id");
if (confirm("你确认删除【" + TableHelper.getRowByUniqueId("#userTable", id).username + "】吗?" +
"\r\n删除后再也不能找回请谨慎操作")) {
$.ajax({
type: 'post',
url: "/admin/user/del.action",
data: { 'id': id },
dataType: "json",
success: function (json) {
if (json.result == 1) {
$("#tipMsg").text("删除成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#userTable");
} else {
$("#tipMsg").text("删除失败,错误码:" + json.result);
$("#tipModal").modal('show');
}
}
});
}
});
$("#userTable").on("click", '.opt-thaw', function () {
var id = $(this).attr("data-id");
if (confirm("你确认解冻【" + TableHelper.getRowByUniqueId("#userTable", id).username + "】吗?")) {
$.ajax({
type: 'post',
url: "/admin/user/thaw.action",
data: { 'id': id },
dataType: "json",
success: function (json) {
if (json.result == 1) {
$("#tipMsg").text("解冻成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#userTable");
} else {
$("#tipMsg").text("解冻失败,错误码:" + json.result);
$("#tipModal").modal('show');
}
}
});
}
});
$("#userTable").on("click", '.opt-edit', function () {
var id = $(this).attr("data-id");
isEdit = true;
$.ajax({
type: "post",
url: "/admin/user/getone.action",
data: { uid: id },
dataType: "json",
success: function (json) {
if (json.entity) {
$("#id").val(json.entity.id);
$("#optUid").val(json.entity.optUid);
$("#username").val(json.entity.username);
$("#imgUrl").attr("src", json.entity.headimg);
$("#headImg").val(json.entity.headimg);
$("#email").val(json.entity.email);
$("#phone").val(json.entity.phone);
$("#qq").val(json.entity.qq);
$("#userModal").modal('show');
$("#passwordDiv").hide();
} else {
$("#tipMsg").text("获取信息出错");
$("#tipModal").modal('show');
}
}
});
});
$("#userTable").on("click", '.opt-role', function () {
var id = $(this).attr("data-id");
var username = $(this).parent().parent().siblings().eq(1).text();
$.ajax({
type: "post",
url: "/admin/user/getrole.action",
data: { uid: id },
dataType: "json",
success: function (json) {
if (json.result == 0) {
var html = '';
$.each(json.list, function (n, en) {
if (en.role) {
html += '<input type="checkbox" name="roles" value="' + en.id + '" checked="checked">' + en.name + '&nbsp;&nbsp; ';
} else {
html += '<input type="checkbox" name="roles" value="' + en.id + '">' + en.name + '&nbsp;&nbsp; ';
}
});
$('#roles').html(html);
$("#uid").val(id);
console.log(username);
$("#username2").val(username);
$("#roleModal").modal('show');
} else {
$("#tipMsg").text("获取信息出错");
$("#tipModal").modal('show');
}
}
});
});
$('#add').click(function () {
$("#imgUrl").attr("src", "");
isEdit = false;
$("#userForm")[0].reset();
$("#id").val(0);
$("#optUid").val(0);
$("#userModal").modal('show');
$("#passwordDiv").show();
});
$('#save').click(function () {
var newPassword = $("#newPassword").val();
if (!isEdit && (newPassword == "" || newPassword == null)) {
$("#tipMsg").text("请输入密码");
$("#tipModal").modal('show');
}
else {
if ($("#userForm").validationEngine('validate')) {
$.ajax({
type: "post",
url: "/admin/user/save.action?isEdit=" + isEdit,
data: $('#userForm').serialize(),
dataType: "json",
success: function (json) {
if (json.result == 1) {
$("#userModal").modal('hide');
$("#tipMsg").text("保存成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#userTable");
} else {
$("#tipMsg").text("保存失败,错误码:" + json.result);
$("#tipModal").modal('show');
}
}
});
}
}
});
$('#save2').click(function () {
$.ajax({
type: "post",
url: "/admin/user/role/save.action",
data: $('#roleForm').serialize(),
dataType: "json",
success: function (json) {
if (json.result == 1) {
$("#roleModal").modal('hide');
$("#tipMsg").text("保存成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#userTable");
} else {
$("#tipMsg").text("保存失败,错误码:" + json.result);
$("#tipModal").modal('show');
}
}
});
});
$('#uploadBtn').click(function () {
var options = {
type: 'post',
url: '/admin/user/headimg.action',
dataType: 'json',
success: function (json) {
if (json.path) {
$('#headImg').val(json.path);
$('#imgUrl').attr("src", json.path);
} else {
$("#tipMsg").text(json.msg);
$("#tipModal").modal('show');
}
}
};
$("#userForm").ajaxSubmit(options);
});
$("#userTable").on("click", '.opt-role-menu', function () {
var id = $(this).attr("data-id");
var username = $(this).parent().siblings().eq(1).text();
$.ajax({
type: "post",
url: "/admin/user/role/getmenu.action",
data: { userId: id },
dataType: "json",
success: function (json) {
if (json.result == 0) {
$("#menuTree").treeview({
data: getMenuData(json), // 数据源
levels: 1, //设置继承树默认展开的级别
showTags: true, //是否在每个节点右边显示tags标签。tag值必须在每个列表树的data结构中给出
showCheckbox: true,
onNodeUnchecked: function (event, node) {
$('#menuTree').treeview('checkNode', [node.nodeId, { silent: true }]);
}
});
var roleNames = "";
$.each(json.roleList, function (n, en) {
roleNames += en.name + '';
})
if (roleNames != "") {
roleNames = roleNames.substring(0, roleNames.length - 1);
}
$("#name2").val(roleNames);
$("#roleModalMenu").modal('show');
} else {
$("#tipMsg").text("获取信息出错");
$("#tipModal").modal('show');
}
}
});
});
});
}
},
};
function getMenuData(json) {
var parentMenu = "";
for (var index = 0; index < json.list.length; index++) {
var parent = json.list[index];
var sonMenu = "";
if (parent.sonList != null) {
for (var index1 = 0; index1 < parent.sonList.length; index1++) {
var son = parent.sonList[index1];
sonMenu += "{text: '" + son.name + "'," +
"menuId:'" + son.id + "'," +
"state:{checked:" + son.check + "}," +
"color:'#2f2424;display:inline-table;pointer-events: none '" +
"},";
}
}
if (sonMenu != "") {
sonMenu = sonMenu.substring(0, sonMenu.length - 1);
}
parentMenu += "{" +
"text: '" + parent.name + "'," +
"menuId:'" + parent.id + "'," +
"state:{checked:" + parent.check + ",expanded:" + parent.check + "}," +
"nodes: [" + sonMenu + "]" +
"},";
}
if (parentMenu != "") {
parentMenu = parentMenu.substring(0, parentMenu.length - 1);
}
var menuData = "[ " + parentMenu + "]";
return eval('(' + menuData + ')');
}
</script>
<style scoped>
.list-group-item {
padding: 2px 1px;
border: 0px solid #ddd;
}
#name2 {
font-size: 13px;
width: 110%;
}
.opt-edit {
margin-left: 7px;
}
</style>

View File

@@ -0,0 +1,88 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1 id="itemTitle"></h1>
<h5 style="color:red ">温馨提示:修复多个时请用,隔开平台号</h5>
</section>
<br />
<section class="content">
<div id="table"></div>
<div id="toolbar">
单个或多个66用户修复: <input style="width:500px" type="text" class="input-sm validate[required]"
name="erbanNo" id="erbanNo">
<button id="fixSingle" class="btn btn-sm btn-primary">修复</button>
<br />
<br />
<br />
此方式请谨慎使用:
<button id="fixAll" class="btn btn-sm btn-primary">修复全部用户</button>
</div>
</section>
</div>
</div>
</section>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "UserLevelCharmAdminView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$("#fixSingle").on("click", function () {
var erbanNo = $("#erbanNo").val();
if (erbanNo == "" || erbanNo == null) {
$("#tipMsg").text('平台号不能为空');
$("#tipModal").modal('show');
}
else {
$.ajax({
type: 'get',
url: '/admin/user/level/fix/single.action',
data: {
erbanNo: erbanNo
},
dataType: 'json',
success: function (json) {
console.log(json);
$("#tipMsg").text(json.message);
$("#tipModal").modal('show');
$("#erbanNo").val("");
}
});
}
});
$("#fixAll").on("click", function () {
$.ajax({
type: 'get',
url: '/admin/user/level/fix/all.action',
dataType: 'json',
success: function (json) {
console.log(json);
$("#tipMsg").text(json.message);
$("#tipModal").modal('show');
$("#erbanNo").val("");
}
});
});
});
}
},
};
</script>
<style scoped></style>

View File

@@ -0,0 +1,649 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<!-- .content -->
<section class="content">
<div id="table"></div>
<div id="toolbar">
<div class="col-sm-12">
<label for="version" class="qry_col control-label">跳转类型:</label>
<div class="col-sm-2">
<select name="os" id="os_query" class="form-control" data-btn-class="btn-warning"
onchange="setSelectOption('platform_query',this)">
<option value="">全部</option>
<option value="iOS">IOS</option>
<option value="android">安卓</option>
</select>
</div>
<label for="version" class="qry_col control-label">渠道:</label>
<div class="col-sm-2">
<select name="platform" id="platform_query" class="form-control"
data-btn-class="btn-warning"></select>
</div>
<label for="version" class="qry_col control-label">版本号:</label>
<div class="col-sm-2"><input type="text" class="form-control" name="version" id="version_query">
</div>
</div>
<div class="col-sm-12">
<button id="search" class="btn btn-default">
<i class="glyphicon glyphicon-search"></i>搜索
</button>
<button id="add" class="btn btn-default">
<i class="glyphicon glyphicon-plus"></i>增加
</button>
<button id="multiDel" class="btn btn-default">
<i class="glyphicon glyphicon-plus"></i>批量删除
</button>
<button id="resetSuggeestUpdate" class="btn btn-default">
<i class="glyphicon glyphicon-wrench"></i>置为建议更新
</button>
<button id="resetForceUpdate" class="btn btn-default">
<i class="glyphicon glyphicon-wrench"></i>置为强制更新
</button>
<button id="resetOnline" class="btn btn-default">
<i class="glyphicon glyphicon-wrench"></i>置为线上版本
</button>
<!--<button class="btn btn-danger" id='sendVersionMsg'>推送强更全服广播</button>-->
</div>
</div>
</section><!-- .content -->
</div>
</div>
</section>
<div class="modal fade" id="versionModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content" style="width: 800px;">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="modalLabel">版本信息</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" id="versionForm">
<input type="hidden" name="versionId" id="versionId" />
<div class="form-group">
<label for="os" class="col-sm-2 control-label">系统:</label>
<div class="col-sm-10">
<select name="os" id="os" data-btn-class="btn-warning" class="form-control"
onchange="setSelectOption('platform',this)">
<option value="ios">IOS</option>
<option value="android">安卓</option>
</select>
</div>
</div>
<div class="form-group">
<label for="platform" class="col-sm-2 control-label">渠道:</label>
<div class="col-sm-10">
<input type="hidden" name="old_platform" id="old_platform" />
<select name="platform" id="platform" class="form-control selectpicker show-tick"
data-live-search="false" data-btn-class="btn-warning"></select>
</div>
</div>
<div class="form-group">
<label for="version" class="col-sm-2 control-label">版本:</label>
<div class="col-sm-10">
<input type="text" class="form-control validate[required]" name="version" id="version">
</div>
</div>
<div class="form-group">
<label for="status" class="col-sm-2 control-label">状态:</label>
<div class="col-sm-10">
<select name="status" id="status" class="form-control" data-btn-class="btn-warning">
<option value="1" selected="selected">线上版本</option>
<option value="2">未上线版本</option>
<option value="3">强制更新版本</option>
<option value="4">建议更新版本</option>
<option value="5">已删除版本</option>
</select>
</div>
</div>
<!--<div class="form-group">
<label for="isFilter" class="col-sm-2 control-label">过滤数据</label>
<div class="col-sm-10">
<select name="isFilter" id="isFilter" data-btn-class="btn-warning">
<option value="0">不过滤</option>
<option value="1">过滤</option>
</select>
</div>
</div>-->
<div class="form-group">
<label for="versionDesc" class="col-sm-2 control-label">更新说明:</label>
<div class="col-sm-10">
<textarea name="versionDesc" id="versionDesc" class="form-control" rows="3"
placeholder="Enter ..."></textarea>
</div>
</div>
<div class="form-group">
<label for="publishTime" class="col-sm-2 control-label">发布时间</label>
<div class="col-sm-10">
<input id="publishTime" type="date" name="publishTime"
class="form-control validate[required]">
</div>
</div>
<div class="form-group">
<label for="downloadLink" class="col-sm-2 control-label">下载链接:</label>
<div class="col-sm-10">
<textarea autoHeight="true" id="downloadLink" name="downloadLink"
class="form-control"></textarea>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="save">保存</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="tipModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">提示信息</h4>
</div>
<div class="modal-body" id="tipMsg"></div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
import ComboboxHelper from '@/assets/plugins/bootstrap-combobox/js/bootstrap-combobox-helper';
import { showLoading, hideLoading } from '@/utils/maintainer';
var publishTimePicker = $('#publishTime').datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
autoclose: true,
startDate: new Date()
})
//ComboboxHelper.build(null,'#status');
export default {
name: "VersionAdminView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('#platform').selectpicker({
'selectedText': 'cat'
})
$('#table').bootstrapTable('destroy');
initTable();
/**增加搜索功能*/
$('#search').on('click', function () {
$('#table').bootstrapTable('destroy');
initTable();
});
setSelectOption("platform_query", $("#os_query"));
$("#table").on("click", '.opt-remove', function () {
var id = $(this).attr("data-id");
if (id == 'undefined') {
$("#tipMsg").text("id参数有误");
$("#tipModal").modal('show');
return;
}
if (confirm("你确认删除该记录吗?" +
"\r\n删除后再也不能找回请谨慎操作")) {
$.ajax({
type: 'post',
url: "/admin/version/del.action",
data: { 'ids': JSON.stringify([id]) },
dataType: "json",
success: function (json) {
if (json.success == 'true') {
$("#tipMsg").text("删除成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("删除失败");
$("#tipModal").modal('show');
}
}
});
}
});
$("#add").click(function () {
// 打开编辑弹窗
$("#versionModal").modal('show');
$("#versionForm")[0].reset();
$("#versionId").val("");
$("#id").val(0);
$("#old_platform").val("");
$("#downloadLink").val("");
$("#os").removeAttr("disabled", "disabled");
$("#version").removeAttr("disabled", "disabled");
$("#platform").removeAttr("disabled", "disabled");
$('#save').attr("disabled", false);
setSelectOption("platform", $("#os"));
});
$("#multiDel").click(function () {
var rows = $("#table").bootstrapTable("getSelections");
if (rows.length == 0) {
alert("请先选择要删除的记录");
return;
}
console.log("rows: " + rows.length);
var idArr = [];
for (var i = 0; i < rows.length; i++) {
idArr.push(rows[i]['versionId']);
}
console.log(idArr);
if (confirm("你确认批量删除该记录吗?" +
"\r\n删除后再也不能找回请谨慎操作")) {
$.ajax({
type: 'post',
url: "/admin/version/del.action",
data: { 'ids': JSON.stringify(idArr) },
dataType: "json",
success: function (json) {
if (json.success == 'true') {
$("#tipMsg").text("删除成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("删除失败");
$("#tipModal").modal('show');
}
}
});
}
});
$("#resetSuggeestUpdate").click(function () {
var rows = $("#table").bootstrapTable("getSelections");
if (rows.length == 0) {
alert("请先选择要更新的记录");
return;
}
console.log("rows: " + rows.length);
var idArr = [];
for (var i = 0; i < rows.length; i++) {
idArr.push(rows[i]['versionId']);
}
console.log(idArr);
if (confirm("你确认重置所选记录的状态为[建议更新版本]吗?")) {
reqUpdateStatus(idArr, 4);
}
})
$("#resetForceUpdate").click(function () {
// 要置换的版本状态值
var rows = $("#table").bootstrapTable("getSelections");
if (rows.length == 0) {
alert("请先选择要更新的记录");
return;
}
console.log("rows: " + rows.length);
var idArr = [];
for (var i = 0; i < rows.length; i++) {
idArr.push(rows[i]['versionId']);
}
console.log(idArr);
if (confirm("你确认重置所选记录的状态为[强制更新版本]吗?")) {
reqUpdateStatus(idArr, 3);
}
})
$("#resetOnline").click(function () {
// 要置换的版本状态值
var rows = $("#table").bootstrapTable("getSelections");
if (rows.length == 0) {
alert("请先选择要更新的记录");
return;
}
console.log("rows: " + rows.length);
var idArr = [];
for (var i = 0; i < rows.length; i++) {
idArr.push(rows[i]['versionId']);
}
console.log(idArr);
if (confirm("你确认重置所选记录的状态为[线上版本]吗?")) {
reqUpdateStatus(idArr, 1);
}
})
function reqUpdateStatus(idArr, type) {
$.ajax({
type: 'post',
url: "/admin/version/resetStatus.action",
data: { 'ids': JSON.stringify(idArr), 'type': type },
dataType: "json",
success: function (json) {
if (json.success == 'true') {
$("#tipMsg").text("重置成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text(json.message);
$("#tipModal").modal('show');
}
}
});
}
$("#cancel").click(function () {
TableHelper.unCheckAll("#table");
});
$("#table").on("click", '.opt-reset', function () {
var id = $(this).attr("data-id");
if (id == 'undefined') {
$("#tipMsg").text("id参数有误");
$("#tipModal").modal('show');
return;
}
if (confirm("你确认设置此记录为审核中版本吗?")) {
$.ajax({
type: 'post',
url: "/admin/version/resetAudit.action",
data: { 'id': id },
dataType: "json",
success: function (json) {
if (json.success == 'true') {
$("#tipMsg").text("设置成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("设置失败, 原因是:" + json.msg);
$("#tipModal").modal('show');
}
}
});
}
});
$("#table").on("click", '.opt-edit', function () {
console.log("btnEdit");
$("#os").attr("disabled", "disabled");
$("#version").attr("disabled", "disabled");
$("#platform").attr("disabled", "disabled");
$("#old_platform").val("");
var id = $(this).attr("data-id");
$.ajax({
type: "get",
url: "/admin/version/get.action",
data: { id: id },
dataType: "json",
success: function (json) {
if (json.entity) {
var publishDate = new Date(json.entity.publishTime).format("yyyy-MM-dd hh:mm:ss");
$("#versionId").val(json.entity.versionId);
$("#os").val(json.entity.os.toLowerCase());
$("#version").val(json.entity.version);
$("#old_platform").val(json.entity.platform);
$("#versionDesc").val(json.entity.versionDesc);
$("#description").val(json.entity.description);
$("#status").val(json.entity.status);
ComboboxHelper.setDef("#status", json.entity.status);
setSelectOption("platform", $("#os"));
$("#publishTime").val(publishDate);
$("#downloadLink").val(json.entity.downloadLink);
$("#fileMd5").val(json.entity.fileMd5);
// 打开编辑弹窗
$("#versionModal").modal('show');
} else {
$("#tipMsg").text("获取菜单信息出错");
$("#tipModal").modal('show');
}
}
});
});
$("#save").click(function () {
if ($("#versionForm").validationEngine('validate')) {
//checkFile();
$("#os").removeAttr("disabled", "disabled");
$("#version").removeAttr("disabled", "disabled");
$("#platform").removeAttr("disabled", "disabled");
showLoading()
$.ajax({
type: "post",
url: "/admin/version/save.action",
data: $('#versionForm').serialize(),
dataType: "json",
success: function (json) {
hideLoading();
if (json.success == 'true') {
$("#versionModal").modal('hide');
$("#tipMsg").text("保存成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("保存失败,原因: " + json.msg);
$("#tipModal").modal('show');
}
}
});
}
});
/*$("#sendVersionMsg").click(function(){
if (confirm("你确认要推送强制更新全服广播吗?")) {
$.ajax({
type: 'post',
url: "/admin/version/sendVersionMsg.action",
dataType: "json",
success: function (json) {
if (json.success == 'true') {
$("#tipMsg").text("推送成功");
$("#tipModal").modal('show');
} else {
$("#tipMsg").text("推送失败,错误信息:" + json.msg);
$("#tipModal").modal('show');
}
}
});
}
});*/
});
}
},
};
function setSelectOption(id, obj) {
var os = $(obj).val();
var channel = $("#old_" + id).val();
$.ajax({
type: "get",
url: '/admin/version/getPlatform.action',
data: {
os: os
},
dataType: 'json',
success: function (json) {
if (json.data) {
makeOption(id, json.data, channel);
if (channel != '' && channel != 'undefined') {
$('.selectpicker').selectpicker('val', channel);
} else {
$('.selectpicker').selectpicker('val', '');
}
$('.selectpicker').selectpicker('refresh');
}
}
})
}
function makeOption(id, data, channel) {
console.log("id=" + id + ",channel=" + channel);
var str = "";
if (id.indexOf("_query") > -1) {
str = '<option value=""> 全部' + '</option>'
}
for (var i = 0; i < data.length; i++) {
str += '<option value="' + data[i] + '">' + data[i] + '</option>';
}
$('#' + id).html(str);
$('#' + id).val(channel);
}
function initTable() {
$('#table').bootstrapTable({
columns: [
{ field: 'tmp', title: 'ID', align: 'center', checkbox: true },
{ field: 'versionId', title: 'id', align: 'center', width: '5%' },
{ field: 'os', title: '系统', align: 'center', width: '5%' },
{ field: 'version', title: '版本号', align: 'center', width: '10%' },
{ field: 'platform', title: '渠道', align: 'center', width: '10%' },
{
field: 'status', title: '状态', align: 'center', width: '15%', formatter: function (val, row, index) {
if (val == 1) {
return '<color="green">线上版本</color>';
}
else if (val == 2) {
return '未上线版本';
}
else if (val == 3) {
return '<color="red">强制更新版本</color>';
}
else if (val == 4) {
return '<color="yellow">建议更新版本</color>';
}
else if (val == 5) {
return '已删除版本';
}
}
},
{ field: 'downloadLink', title: '跳转链接', align: 'center', width: '15%' },
{
field: 'publishTime', title: '发布时间', align: 'center', width: '10%', formatter: function (val, row, index) {
var newDate = new Date();
newDate.setTime(val);
return newDate.toLocaleString();
}
},
{
field: 'createTime', title: '创建时间', align: 'center', width: '10%', formatter: function (val, row, index) {
var newDate = new Date();
newDate.setTime(val);
return newDate.toLocaleString();
}
},
{
field: 'updateTime', title: '更新时间', align: 'center', width: '10%', formatter: function (val, row, index) {
var newDate = new Date();
newDate.setTime(val);
return newDate.toLocaleString();
}
},
{
field: 'versionId', title: '操作', align: 'center', width: '25%', formatter: function (val, row, index) {
return '<button class="btn btn-sm btn-success opt-edit" data-id=' + val + '><i class="glyphicon glyphicon-edit"></i>编辑</button>&nbsp;&nbsp;' +
'<button class="btn btn-sm btn-danger opt-remove" data-id=' + val + '><i class="glyphicon glyphicon-remove"></i>删除</button>&nbsp;&nbsp;';
/*+ '<button class="btn btn-sm btn-success opt-reset" data-id=' + val + '><i class="glyphicon glyphicon-remove"></i>置为审核中</button>';*/
}
}
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 20,
pagination: true,
pageList: [1, 20, 50, 100, 200],
search: false,
sidePagination: "server", //表示服务端请求
//设置为undefined可以获取pageNumberpageSizesearchTextsortNamesortOrder
//设置为limit可以获取limit, offset, search, sort, order
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageNumber: params.pageNumber,
pageSize: params.pageSize,
os: $("#os_query").val(),
platform: $("#platform_query").val(),
version: $("#version_query").val(),
};
return param;
},
toolbar: '#toolbar',
url: '/admin/version/getList.action',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
});
}
function checkFile() {
var src = $('#uploadFile').val();
if (src != '') {
var files = $('#uploadFile').prop('files');//获取到文件列表
for (var index = 0; index < files.length; index++) {
var type = (files[index].name.substr(files[index].name.lastIndexOf("."))).toLowerCase();
if (!(type == ".apk" || type == ".APK" || type == ".ipa" || type == ".IPA")) {
alert("您上传文件的类型不符合");
return;
}
}
var tips = '';
var selectPlatform = $('.selectpicker').selectpicker('val');
for (var i = 0; i < selectPlatform.length; i++) {
var platform = selectPlatform[i];
var flag = false;
for (var j = 0; j < files.length; j++) {
var filename = files[j].name.substr(0, files[j].name.lastIndexOf("."));
if (filename.endsWith(platform)) {
flag = true;
break;
}
}
if (!flag) {
tips += "未上传渠道【" + platform + "】对应安装包\n";
}
}
if (tips != '') {
alert(tips);
}
}
}
String.prototype.endsWith = function (suffix) {
if (this.length < suffix.length) {
return false;
}
var temp = this.substring(this.length - suffix.length);
return temp == suffix;
};
</script>
<style scoped>
.qry_col {
float: left;
}
</style>

View File

@@ -0,0 +1,449 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<!-- .content -->
<section class="content">
<div id="table"></div>
<div id="toolbar">
<div class="col-sm-12">
<label for="searchConfigId" class="qry_col control-label">id:</label>
<div class="col-sm-2">
<input type="text" class="form-control" name="searchConfigId" id="searchConfigId">
</div>
<label for="searchConfigName" class="qry_col control-label">名称:</label>
<div class="col-sm-2">
<input type="text" class="form-control" name="configName" id="searchConfigName">
</div>
<label for="searchConfigValue" class="qry_col control-label">:</label>
<div class="col-sm-2">
<input type="text" class="form-control" name="searchConfigValue" id="searchConfigValue">
</div>
<label for="searchNameSpace" class="qry_col control-label">命名空间:</label>
<div class="col-sm-2">
<input type="text" class="form-control" name="searchNameSpace" id="searchNameSpace">
</div>
</div>
<div class="col-sm-12">
<button id="searchForm" class="btn btn-default">
<i class="glyphicon glyphicon-search"></i>搜索
</button>
<button id="sysConf-add" class="btn btn-default">
<i class="glyphicon glyphicon-plus"></i>增加
</button>
<button id="sysConf-multiDel" class="btn btn-default">
<i class="glyphicon glyphicon-trash"></i>批量删除
</button>
<button id="sysConf-multi-edit" class="btn btn-default">
<i class="glyphicon glyphicon-wrench"></i>批量编辑
</button>
</div>
</div>
</section><!-- .content -->
</div>
</div>
</section>
<div class="modal fade" id="sysConfModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="modalLabel">字典信息</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" id="sysConfForm">
<div class="form-group">
<label for="configId" class="col-sm-2 control-label">id</label>
<div class="col-sm-10">
<input type="text" class="form-control validate[required]" name="configId" id="configId">
</div>
</div>
<div class="form-group">
<label for="configName" class="col-sm-2 control-label">名称</label>
<div class="col-sm-10">
<input type="text" class="form-control validate[required]" name="configName"
id="configName">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">状态</label>
<div class="col-sm-10">
<label class="radio-inline"><input type="radio" name="configStatus" value="1"
checked>有效</label>
<label class="radio-inline"><input type="radio" name="configStatus" value="2">无效</label>
</div>
</div>
<div class="form-group">
<label for="configValue" class="col-sm-2 control-label"></label>
<div class="col-sm-10">
<input type="text" class="form-control" name="configValue" id="configValue">
</div>
</div>
<div class="form-group">
<label for="nameSpace" class="col-sm-2 control-label">命名空间</label>
<div class="col-sm-10">
<input type="text" class="form-control validate[required]" name="nameSpace" id="nameSpace">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="save">保存</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="batchEditModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="modalLabe2">批量编辑字典信息</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" id="batchEditForm">
<div class="form-group">
<label for="rowCount" class="col-sm-2 control-label">记录数:</label>
<div class="col-sm-10" style="margin-top: 5px;font-weight: bold;font-size: 15px;">
<span id="rowCount"></span>
</div>
</div>
<div class="form-group">
<label for="selectRow" class="col-sm-2 control-label"></label>
<div class="col-sm-10">
<textarea autoHeight="true" style="width: 412px;" disabled="disabled" id="selectRow" />
</div>
</div>
<div class="form-group">
<label for="batchEditConfigValue" class="col-sm-2 control-label">:</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="configValue" id="batchEditConfigValue">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="batchSave">保存</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="tipModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">提示信息</h4>
</div>
<div class="modal-body" id="tipMsg"></div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "VersionConfigAdminView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('#table').bootstrapTable('destroy');
initTable();
/**增加搜索功能*/
$('#searchForm').on('click', function () {
$('#table').bootstrapTable('destroy');
initTable();
});
function initTable() {
$('#table').bootstrapTable({
columns: [
{ field: 'tmp', title: 'ID', align: 'center', checkbox: true },
{ field: 'configId', title: 'id', align: 'center', width: '20%' },
{ field: 'configName', title: '名称', align: 'center', width: '25%' },
{ field: 'configValue', title: '值', align: 'center', width: '20%' },
{
field: 'configStatus',
title: '状态',
align: 'center',
width: '5%',
formatter: function (val, row, index) {
if (val == 1) {
return '有效';
}
else if (val == 2) {
return '无效';
}
}
},
{ field: 'nameSpace', title: '命名空间', align: 'center', width: '5%' },
{
field: 'configId',
title: '操作',
align: 'center',
width: '25%',
formatter: function (val, row, index) {
return '<button class="btn btn-sm btn-success opt-edit" data-id=' + val + '>' +
'<i class="glyphicon glyphicon-edit"></i>编辑</button>' +
'&nbsp;&nbsp;<button class="btn btn-sm btn-danger opt-remove" data-id=' + val +
'><i class="glyphicon glyphicon-remove"></i>删除</button>';
}
}
],
cache: false,
striped: true,
showRefresh: true,
pagination: false,
search: false,
sidePagination: "server", //表示服务端请求
//设置为undefined可以获取pageNumberpageSizesearchTextsortNamesortOrder
//设置为limit可以获取limit, offset, search, sort, order
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageNumber: params.pageNumber,
pageSize: params.pageSize,
searchText: params.searchText,
configId: $("#searchConfigId").val(),
configValue: $("#searchConfigValue").val(),
nameSpace: $("#searchNameSpace").val(),
configName: $("#searchConfigName").val()
};
return param;
},
toolbar: '#toolbar',
url: '/admin/sysConf/getVersionConfigList.action',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
$("#table").addClass("table_line");
$("td,th").addClass("td_center");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
});
}
$("#table").on("click", '.opt-remove', function () {
var id = $(this).attr("data-id");
if (id == 'undefined') {
$("#tipMsg").text("id参数有误");
$("#tipModal").modal('show');
return;
}
if (confirm("你确认删除该记录吗?" +
"\r\n删除后再也不能找回请谨慎操作")) {
$.ajax({
type: 'post',
url: "/admin/sysConf/del.action",
data: { 'ids': JSON.stringify([id]) },
dataType: "json",
success: function (json) {
if (json.success == 'true') {
$("#tipMsg").text("删除成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("删除失败");
$("#tipModal").modal('show');
}
}
});
}
});
$("#sysConf-add").click(function () {
// 打开编辑弹窗
$("#sysConfModal").modal('show');
$("#sysConfForm")[0].reset();
$("#configId").val('');
$("#configId").attr('readonly', false);
});
$("#sysConf-multiDel").click(function () {
var rows = $("#table").bootstrapTable("getSelections");
if (rows.length == 0) {
alert("请先选择要删除的记录");
return;
}
console.log("rows: " + rows.length);
var idArr = [];
for (var i = 0; i < rows.length; i++) {
idArr.push(rows[i]['configId']);
}
console.log(idArr);
if (confirm("你确认批量删除该记录吗?" +
"\r\n删除后再也不能找回请谨慎操作")) {
$.ajax({
type: 'post',
url: "/admin/sysConf/del.action",
data: { 'ids': JSON.stringify(idArr) },
dataType: "json",
success: function (json) {
if (json.success == 'true') {
$("#tipMsg").text("删除成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("删除失败");
$("#tipModal").modal('show');
}
}
});
}
});
$("#sysConf-multi-edit").click(function () {
var rows = $("#table").bootstrapTable("getSelections");
if (rows.length == 0) {
alert("请先选择要编辑的记录");
return;
}
var params = "";
for (var i = 0; i < rows.length; i++) {
params += rows[i]['configId'] + "\n";
}
$("#rowCount").text(rows.length);
$("#batchEditConfigValue").val('');
$("#selectRow").val(params);
$("#selectRow").css('height', (25 * rows.length) + 'px');
$("#batchEditModal").modal('show');
});
$("#batchSave").click(function () {
var rows = $("#table").bootstrapTable("getSelections");
if (rows.length == 0) {
alert("请先选择要编辑的记录");
return;
}
var params = "";
for (var i = 0; i < rows.length; i++) {
params += "ids=" + rows[i]['configId'] + "&";
}
params += "configValue=" + $("#batchEditConfigValue").val();
if (confirm("你确认批量编辑所选记录吗?" +
"\r\n请仔细核对谨慎操作")) {
$.ajax({
type: 'post',
url: "/admin/sysConf/batch/edit.action",
data: params,
dataType: "json",
success: function (json) {
if (json.success == 'true') {
$("#tipMsg").text("成功编辑 " + json.msg + " 条记录");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
$("#batchEditModal").modal('hide');
} else {
$("#tipMsg").text("批量编辑失败");
$("#tipModal").modal('show');
}
}
});
}
});
$("#cancel").click(function () {
TableHelper.unCheckAll("#table");
});
$("#table").on("click", '.opt-edit', function () {
console.log("btnEdit");
$("#configId").attr('readonly', true);
var id = $(this).attr("data-id");
$.ajax({
type: "get",
url: "/admin/sysConf/get.action",
data: { id: id },
dataType: "json",
success: function (json) {
if (json.entity) {
$("#configId").val(json.entity.configId);
$("#configName").val(json.entity.configName);
$("#configValue").val(json.entity.configValue);
$("#nameSpace").val(json.entity.nameSpace);
var status = json.entity.configStatus - 1;
$("input:radio[name='configStatus']")[status].checked = true;
// 打开编辑弹窗
$("#sysConfModal").modal('show');
} else {
$("#tipMsg").text("获取菜单信息出错");
$("#tipModal").modal('show');
}
}
});
});
$("#save").click(function () {
if ($("#sysConfForm").validationEngine('validate')) {
// 判断configId是否存在错误的逗号逗号即批量
var configIdVal = $("#configId").val();
if (configIdVal.indexOf("") != -1) {
alert("请正确输入英文半角逗号:,");
} else {
$.ajax({
type: "post",
url: "/admin/sysConf/save.action",
data: $('#sysConfForm').serialize(),
dataType: "json",
success: function (json) {
if (json.success == 'true') {
$("#sysConfModal").modal('hide');
$("#tipMsg").text("保存成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("保存失败");
$("#tipModal").modal('show');
}
}
});
}
}
});
});
}
},
};
</script>
<style scoped>
.table_line {
word-break: break-all;
}
.td_center {
vertical-align: middle !important;
}
.qry_col {
float: left;
}
</style>

View File

@@ -0,0 +1,151 @@
<template>
<section class="content">
<div class="box box-primary">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<section class="content">
<div id="table"></div>
<div id="toolbar">
<div class="col-sm-12">
<form action="" id="searchForm" method="POST">
选择时间<input type="text" name="startDate" id="timeBegin" class="input-sm" placeholder="起始时间">
- <input type="text" name="endDate" id="timeEnd" class="input-sm" placeholder="结束时间">
平台号<input type="text" id="msNo" name="msNo" class="input-sm" placeholder="请输入平台号">
</form>
</div>
<div class="sol-sm-1">
<button id="searchBtn" class="btn btn-primary">查询</button>
</div>
</div>
</section>
</div>
</section>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "TarotChargeRecordView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
var picker1 = $('#timeBegin').datetimepicker({
format: 'yyyy-mm-dd hh:ii:ss',
autoclose: true,
endDate: new Date()
});
var picker2 = $('#timeEnd').datetimepicker({
format: 'yyyy-mm-dd hh:ii:ss',
autoclose: true,
endDate: new Date()
});
// 时间判断
picker1.on('changeDate', function () {
var date = $('#timeBegin').datetimepicker('getDate');
picker2.datepicker('setStartDate', date);
});
picker2.on('changeDate', function () {
var date = $('#timeEnd').datetimepicker('getDate');
picker1.datepicker('setEndDate', date);
});
$("#searchBtn").click(function () {
var msNo = $("#msNo").val();
if (msNo == '') {
$('#tipMsg').text('平台号不能为空')
$('#tipModal').modal('show');
return;
}
var startDate = $('#timeBegin').val();
var endDate = $('#timeEnd').val();
if (startDate == '' || endDate == '') {
$('#tipMsg').text('请选择查询日期')
$('#tipModal').modal('show');
return;
}
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{ field: 'uid', title: 'uid', align: 'center', valign: 'middle', width: '10%' },
{ field: 'erbanNo', title: '平台号', align: 'center', valign: 'middle', width: '10%' },
{ field: 'nick', title: '用户昵称', align: 'center', valign: 'middle', width: '10%' },
{
field: 'createTime', title: '抽牌时间', align: 'center', valign: 'middle', width: '20%', formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format('yyyy-MM-dd hh:mm:ss');
} else {
return '-';
}
}
},
{ field: 'selectdNo', title: '选择号码', align: 'center', valign: 'middle', width: '10%' },
{ field: 'drawNum', title: '中奖号码', align: 'center', valign: 'middle', width: '10%' },
{
field: 'drawStatus', title: '中奖状态', align: 'center', valign: 'middle', width: '10%', formatter: function (val, row, index) {
if (val == '1') {
return "支付未完成";
} else if (val == '2') {
return "中奖"
} else {
return '未中奖';
}
}
},
{ field: 'chargeMoney', title: '抽牌金额(元)', align: 'center', valign: 'middle', width: '10%' },
{ field: 'goldNum', title: '中奖额(种子)', align: 'center', valign: 'middle', width: '10%' }
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pagination: true,
pageList: [10, 20, 30, 50],
sidePagination: 'server',
queryParamsType: 'undefined',
queryParams: function queryParams(params) {
var param = {
pageSize: params.pageSize,
pageNum: params.pageNumber,
startDate: $('#timeBegin').val(),
endDate: $('#timeEnd').val(),
erbanNo: $('#msNo').val()
};
return param;
},
uniqueId: 'id',
toolbar: '#toolbar',
url: '/tarot/charge/admin/record/list',
onLOadSuccess: function () {
console.log('load success');
},
onLoadError: function () {
console.log('load fail');
}
});
});
})
}
},
};
</script>
<style scoped></style>

View File

@@ -0,0 +1,129 @@
<template>
<section class="content">
<div class="box box-primary">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<section class="content">
<div id="table"></div>
<div id="toolbar">
<div class="col-sm-12">
<form action="" id="searchForm" method="POST">
选择时间<input type="text" name="startDate" id="timeBegin" class="input-sm" placeholder="起始时间">
- <input type="text" name="endDate" id="timeEnd" class="input-sm" placeholder="结束时间">
平台号<input type="text" id="msNo" name="msNo" class="input-sm" placeholder="请输入平台号">
</form>
</div>
<div class="sol-sm-1">
<button id="searchBtn" class="btn btn-primary">查询</button>
</div>
</div>
</section>
</div>
</section>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "TarotChargeStatisView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
var picker1 = $('#timeBegin').datetimepicker({
format: 'yyyy-mm-dd hh:ii:ss',
autoclose: true,
endDate: new Date()
});
var picker2 = $('#timeEnd').datetimepicker({
format: 'yyyy-mm-dd hh:ii:ss',
autoclose: true,
endDate: new Date()
});
// 时间判断
picker1.on('changeDate', function () {
var date = $('#timeBegin').datetimepicker('getDate');
picker2.datepicker('setStartDate', date);
});
picker2.on('changeDate', function () {
var date = $('#timeEnd').datetimepicker('getDate');
picker1.datepicker('setEndDate', date);
});
$("#searchBtn").click(function () {
var startDate = $('#timeBegin').val();
var endDate = $('#timeEnd').val();
if (startDate == '' || endDate == '') {
$('#tipMsg').text('请选择查询日期')
$('#tipModal').modal('show');
return;
}
tableRefresh();
})
function tableRefresh() {
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{ field: 'uid', title: 'uid', align: 'center', valign: 'middle', width: '10%' },
{ field: 'erbanNo', title: '平台号', align: 'center', valign: 'middle', width: '10%' },
{ field: 'nick', title: '用户昵称', align: 'center', valign: 'middle', width: '10%' },
{ field: 'drawCount', title: '抽牌次数', align: 'center', valign: 'middle', width: '10%' },
{ field: 'winCount', title: '中奖次数', align: 'center', valign: 'middle', width: '10%' },
{ field: 'drawMoney', title: '抽牌总额(元)', align: 'center', valign: 'middle', width: '10%' },
{ field: 'winGold', title: '中奖总额(种子)', align: 'center', valign: 'middle', width: '10%' },
{ field: 'deviateGold', title: '偏差值(种子)', align: 'center', valign: 'middle', width: '10%' },
{ field: 'avgSelectNo', title: '平均选牌数', align: 'center', valign: 'middle', width: '10%' },
{ field: 'avgWinSelectNo', title: '中奖平均选牌数', align: 'center', valign: 'middle', width: '10%' }
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pagination: true,
pageList: [10, 20, 30, 50],
sidePagination: 'server',
queryParamsType: 'undefined',
queryParams: function queryParams(params) {
var param = {
pageSize: params.pageSize,
pageNum: params.pageNumber,
startDate: $('#timeBegin').val(),
endDate: $('#timeEnd').val(),
erbanNo: $('#msNo').val()
};
return param;
},
uniqueId: 'id',
toolbar: '#toolbar',
url: '/tarot/charge/admin/record/statis',
onLoadSuccess: function () {
console.log('load success');
},
onLoadError: function () {
console.log('load fail');
}
});
}
})
}
},
};
</script>
<style scoped></style>

View File

@@ -0,0 +1,192 @@
<template>
<section class="content">
<div class="box box-primary">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<section class="content">
<div id="toolbar">
<form action="" id="searchForm" method="POST">
选择时间<input type="text" name="timeBegin" id="timeBegin" class="input-sm" placeholder="起始时间">
- <input type="text" name="timeEnd" id="timeEnd" class="input-sm" placeholder="结束时间">
</form>
<div class="sol-sm-1">
<button id="searchBtn" class="btn btn-primary">查询</button>
</div>
<div class="tips">因数据量庞大默认不会显示每天的结果默认只展示平台总收益情况请先选择时间范围再搜索</div>
<div class="dataCount">
<p>
<span>抽牌总次数</span>
<span id="drawNum"></span>
</p>
<p>
<span>中奖总次数</span>
<span id="winNum"></span>
</p>
<p>
<span>抽牌总金额()</span>
<span id="drawMoney"></span>
</p>
<p>
<span>中奖总金额(种子)</span>
<span id="winGold"></span>
</p>
<p>
<span>盈亏比</span>
<span id="profitRation"></span>
</p>
<p>
<span>平均每次选择号码个数</span>
<span id="avgSelectNo"></span>
</p>
<p>
<span>中奖平均每次选择号码个数</span>
<span id="avgWinSelectNo"></span>
</p>
</div>
</div>
<div id="table"></div>
</section>
</div>
</section>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "TarotChargeTotalView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
var picker1 = $('#timeBegin').datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
todayBtn: true,
autoclose: true
});
var picker2 = $('#timeEnd').datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
todayBtn: true,
autoclose: true
});
// 时间判断
picker1.on('changeDate', function () {
var date = $('#timeBegin').datetimepicker('getDate');
picker2.datepicker('setStartDate', date);
});
picker2.on('changeDate', function () {
var date = $('#timeEnd').datetimepicker('getDate');
picker1.datepicker('setEndDate', date);
});
$('#searchBtn').on('click', function () {
$("#searchBtn").attr("disabled", true);
tableRefresh();
$("#searchBtn").attr("disabled", false);
});
function tableRefresh() {
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{
field: 'createTime',
title: '日期',
align: 'center',
valign: 'middle',
width: '20%',
formatter: function (val, rows, index) {
if (val) {
var date = new Date(val);
return date.format('yyyy-MM-dd')
} else {
return '-';
}
}
},
{ field: 'drawNum', title: '抽牌次数', align: 'center', valign: 'middle', width: '10%' },
{ field: 'winNum', title: '中奖次数', align: 'center', valign: 'middle', width: '10%' },
{ field: 'drawMoney', title: '抽牌金额(元)', align: 'center', valign: 'middle', width: '10%' },
{ field: 'winGold', title: '中奖总额(种子)', align: 'center', valign: 'middle', width: '10%' },
{ field: 'profitRation', title: '盈亏比', align: 'center', valign: 'middle', width: '10%' },
{ field: 'avgSelectNo', title: '平均每次选择号码个数', align: 'center', valign: 'middle', width: '10%' },
{ field: 'avgWinSelectNo', title: '中奖平均每次选择号码个数', align: 'center', valign: 'middle', width: '10%' }
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 20,
pagination: true,
pageList: [20],
sidePagination: 'server',
queryParamsType: 'undefined',
queryParams: function queryParams(params) {
return {
pageSize: params.pageSize,
pageNum: params.pageNumber,
startDate: $('#timeBegin').val(),
endDate: $('#timeEnd').val()
};
},
uniqueId: 'id',
toolbar: '#toolbar',
url: '/tarot/charge/admin/record/total',
onLoadSuccess: function (data) {
var $dataCount = $('.dataCount');
$dataCount.find('#drawNum').html(data.totalVo.drawNum);
$dataCount.find('#winNum').html(data.totalVo.winNum);
$dataCount.find('#drawMoney').html(data.totalVo.drawMoney);
$dataCount.find('#winGold').html(data.totalVo.winGold);
$dataCount.find('#profitRation').html(data.totalVo.profitRation);
$dataCount.find('#avgSelectNo').html(data.totalVo.avgSelectNo);
$dataCount.find('#avgWinSelectNo').html(data.totalVo.avgWinSelectNo);
},
onLOadError: function () {
console.log('load fail');
}
});
}
})
}
},
};
</script>
<style scoped>
.dataCount {
display: flex;
justify-content: flex-start;
align-items: center;
margin-top: 10px;
}
.dataCount>p {
padding: 5px;
border-radius: 5px;
background: #ccc;
margin-right: 10px;
}
.tips {
color: red;
font-size: 14px;
}
</style>

View File

@@ -0,0 +1,310 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<div id="toolbar">
<div class="col-sm-12">
<label for="name" class="col-sm-1 control-label">标题:</label>
<div class="col-sm-2"><input type="text" class="col-sm-2 form-control" name="name" id="name"
placeholder="请输入列表标题"></div>
<label for="status" class="col-sm-1 control-label">状态:</label>
<select name="status" id="status" class="col-sm-1" data-btn-class="btn-warning">
<option value="" selected="selected">全部</option>
<option value="1">展示</option>
<option value="0">隐藏</option>
</select>
<label for="startTime" class="col-sm-1 control-label">开始日期:</label>
<div class="col-sm-2"><input type="text" class="input-sm" name="startTime" id="startTime">
</div>
<label for="endTime" class="col-sm-1 control-label">结束日期:</label>
<div class="col-sm-2"><input type="text" class="input-sm" name="endTime" id="endTime"></div>
</div>
<div class="col-sm-12">
<button id="btnSearch" class="btn btn-default">
<i class="glyphicon glyphicon-search"></i>查询
</button>
<button id="btnAdd" class="btn btn-default">
<i class="glyphicon glyphicon-plus"></i>增加
</button>
</div>
</div>
</div>
<!-- .content -->
<div id="table"></div>
</div>
</section>
<div class="modal fade" id="titleModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="modalLabel">增加列表</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" id="addForm">
<input type="hidden" name="titleId" id="titleId" />
<div class="form-group">
<label for="titleName" class="col-sm-3 control-label">列表标题:</label>
<div class="col-sm-9">
<input type="text" class="form-control validate[required]" name="titleName" id="titleName">
</div>
</div>
<div class="form-group">
<label for="seqNo" class="col-sm-3 control-label">排序序号:</label>
<div class="col-sm-9">
<input type="text" class="form-control validate[required]" name="seqNo" id="seqNo">
</div>
</div>
<div class="form-group">
<span style="padding-left: 70px">*数字小的排前面必填</span>
</div>
<div class="form-group">
<label for="showStatus" class="col-sm-3 control-label">展示状态</label>
<div class="col-sm-9">
<select name="showStatus" id="showStatus" class="col-sm-3">
<option value="1">展示</option>
<option value="0">隐藏</option>
</select>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="add">确定</button>
</div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "TitleAdminView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{ field: 'id', title: '编号', align: 'center', width: '5%' },
{ field: 'name', title: '列表标题', align: 'center', width: '5%' },
{
field: 'status', title: '列表状态', align: 'center', valign: 'middle', width: '10%',
formatter: function (val, row, index) {
if (val) {
return '展示';
} else {
return '隐藏';
}
}
},
{ field: 'seqNo', title: '排序', align: 'center', width: '5%' },
{
field: 'createTime', title: '创建时间', align: 'center', valign: 'middle', width: '10%',
formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format('yyyy-MM-dd hh:mm:ss');
} else {
return '-';
}
}
},
{
field: 'id',
title: '操作',
align: 'center',
width: '5%',
formatter: function (val, row, index) {
return '<button id="btnEdit" name="btnEdit" class="btn btn-sm btn-success opt-edit" data-id=' + val + '>' +
'<i class="glyphicon glyphicon-edit"></i> 编辑</button>' +
'&nbsp;&nbsp;<button class="btn btn-sm btn-danger opt-remove" data-id=' + val +
'><i class="glyphicon glyphicon-remove"></i>删除</button>';
}
}
],
undefinedText: 0,
cache: false,
striped: true,
showRefresh: false,
pageSize: 20,
pagination: true,
pageList: [20, 50, 100, 200, 300, 500],
search: false,
sidePagination: "server", //表示服务端请求
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageNum: params.pageNumber,
pageSize: params.pageSize,
name: $('#name').val(),
status: $('#status').val(),
startTime: $('#startTime').val(),
endTime: $('#endTime').val()
};
return param;
},
toolbar: '#toolbar',
url: '/admin/title/list.action',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
});
// 查询刷新
$('#btnSearch').on('click', function () {
TableHelper.doRefresh('#table');
});
var chargeStart = $('#startTime').datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
autoclose: true
});
var chargeEnd = $('#endTime').datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
autoclose: true
});
//新建标题
$("#btnAdd").click(function () {
$("#titleId").val("");
$("#titleName").val("");
$("#seqNo").val("");
$("#titleModal").modal('show');
});
$("#add").click(function () {
var titleId = $("#titleId").val();
var titleName = $("#titleName").val();
var seqNo = $("#seqNo").val();
var showStatus = $("#showStatus").val();
if ($("#addForm").validationEngine('validate')) {
$.ajax({
type: "post",
url: "/admin/title/save.action",
data: {
id: titleId,
name: titleName,
seqNo: seqNo,
status: showStatus
},
dataType: "json",
success: function (json) {
if (json.success == 'true') {
$("#tipMsg").text("保存成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
$("#titleModal").modal('hide');
} else {
$("#tipMsg").text("保存失败." + json.msg);
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
$("#titleModal").modal('hide');
}
}
});
}
});
$("#table").on("click", '.opt-edit', function () {
var id = $(this).attr("data-id");
$.ajax({
type: "get",
url: "/admin/title/get.action",
data: { titleId: id },
dataType: "json",
success: function (json) {
if (json) {
$("#titleId").val(id);
$("#titleName").val(json.name);
$("#seqNo").val(json.seqNo);
if (json.status == true) {
$("#showStatus").val(1);
} else {
$("#showStatus").val(0);
}
// 打开编辑弹窗
$("#titleModal").modal('show');
$("#modalLabel").text("编辑列表");
} else {
$("#tipMsg").text("获取菜单信息出错");
$("#tipModal").modal('show');
}
}
});
});
$("#table").on("click", '.opt-remove', function () {
var id = $(this).attr("data-id");
if (id == 'undefined') {
$("#tipMsg").text("id参数有误");
$("#tipModal").modal('show');
return;
}
if (confirm("你确认删除该记录吗? \r\n 删除后再也不能找回,请谨慎操作!")) {
$.ajax({
type: 'post',
url: "/admin/title/delete.action",
data: { titleId: id },
dataType: "json",
success: function (json) {
if (json.success == 'true') {
$("#tipMsg").text("删除成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("删除失败");
$("#tipModal").modal('show');
}
}
});
}
});
});
}
},
};
</script>
<style scoped></style>

View File

@@ -0,0 +1,368 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<div id="toolbar">
<div class="col-sm-12">
<label for="name" class="col-sm-1 control-label">标题:</label>
<div class="col-sm-2"><input type="text" class="form-control" name="name" id="name"
placeholder="请输入列表标题"></div>
<label for="type" class="col-sm-1 control-label">分类:</label>
<select name="type" id="type" class="col-sm-1" data-btn-class="btn-warning">
<option value="" selected="selected">全部</option>
<option value="1">标签</option>
<option value="2">房间类型</option>
</select>
<label for="status" class="col-sm-1 control-label">状态:</label>
<select name="status" id="status" class="col-sm-1" data-btn-class="btn-warning">
<option value="" selected="selected">全部</option>
<option value="1">展示</option>
<option value="0">隐藏</option>
</select>
<label for="startTime" class="col-sm-1 control-label">开始日期:</label>
<div class="col-sm-2"><input type="text" class="input-sm" name="startTime" id="startTime">
</div>
<label for="endTime" class="col-sm-1 control-label">结束日期:</label>
<div class="col-sm-1"><input type="text" class="input-sm" name="endTime" id="endTime"></div>
</div>
<div class="col-sm-12">
<button id="btnSearch" class="btn btn-default">
<i class="glyphicon glyphicon-search"></i>查询
</button>
</div>
</div>
</div>
<!-- .content -->
<div id="table"></div>
</div>
</section>
<div class="modal fade" id="titleModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="modalLabel">配置分类</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" id="addForm">
<input type="hidden" name="titleId" id="titleId" />
<div class="form-group">
<label for="titleName" class="col-sm-3 control-label">列表标题:</label>
<div class="col-sm-9">
<input type="text" class="form-control validate[required]" readonly="true" name="titleName"
id="titleName">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">标签:</label>
<div class="col-sm-9">
<label class="radio-inline"><input type="radio" name="labelType" id="roomTag" value="1"
checked>标签</label>
<label class="radio-inline"><input type="radio" name="labelType" id="roomType"
value="2">房间类型</label>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">子分类:</label>
<div class="col-sm-9">
<div class="show" id="tagClass">
</div>
<div class="hidden" id="typeClass">
</div>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="add">确定</button>
</div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "TitleConfigView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{ field: 'id', title: '编号', align: 'center', width: '5%' },
{ field: 'name', title: '列表标题', align: 'center', width: '5%' },
{
field: 'status', title: '列表状态', align: 'center', valign: 'middle', width: '10%',
formatter: function (val, row, index) {
if (val) {
return '展示';
} else {
return '隐藏';
}
}
},
{
field: 'type',
title: '分类',
align: 'center',
width: '5%',
formatter: function (val, row, index) {
if (val) {
if (val == 1) {
return "标签";
} else if (val == 2) {
return "房间类型";
} else if (val == 3) {
return "指定房间";
}
} else {
return '-';
}
}
},
{
field: 'childClass',
title: '子分类',
align: 'center',
width: '15%',
formatter: function (val, row, index) {
if (val) {
return val;
} else {
return '-';
}
}
},
{ field: 'seqNo', title: '排序', align: 'center', width: '5%' },
{
field: 'operateTime', title: '操作时间', align: 'center', valign: 'middle', width: '10%',
formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format('yyyy-MM-dd hh:mm:ss');
} else {
return '-';
}
}
},
{
field: 'id',
title: '操作',
align: 'center',
width: '5%',
formatter: function (val, row, index) {
return '<button id="btnEdit" name="btnEdit" class="btn btn-sm btn-success opt-edit" data-id=' + val + '>' +
'<i class="glyphicon glyphicon-edit"></i> 配置分类</button>';
}
}
],
undefinedText: 0,
cache: false,
striped: true,
showRefresh: false,
pageSize: 20,
pagination: true,
pageList: [20, 50, 100, 200, 300, 500],
search: false,
sidePagination: "server", //表示服务端请求
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageNum: params.pageNumber,
pageSize: params.pageSize,
name: $('#name').val(),
status: $('#status').val(),
type: $('#type').val(),
startOperateTime: $('#startTime').val(),
endOperateTime: $('#endTime').val(),
isConfigList: true
};
return param;
},
toolbar: '#toolbar',
url: '/admin/title/list.action',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
});
// 查询刷新
$('#btnSearch').on('click', function () {
TableHelper.doRefresh('#table');
});
var chargeStart = $('#startTime').datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
autoclose: true
});
var chargeEnd = $('#endTime').datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
autoclose: true
});
$("#add").click(function () {
var titleId = $("#titleId").val();
var type = $('input[name="labelType"]:checked').val();
var operateTime = new Date().format('yyyy-MM-dd hh:mm:ss');
var childClass = "";
if (type == 1) {
$("#tagClass input[type='checkbox']").each(function () {
if ($(this).is(":checked")) {
childClass += $(this).val() + ",";
}
});
} else if (type == 2) {
$("#typeClass input[type='checkbox']").each(function () {
if ($(this).is(":checked")) {
childClass += $(this).val() + ",";
}
});
}
if (childClass == '' || childClass == null) {
$("#tipMsg").text("请选择子分类");
$("#tipModal").modal('show');
return;
}
if ($("#addForm").validationEngine('validate')) {
$.ajax({
type: "post",
url: "/admin/title/save.action",
data: {
id: titleId,
type: type,
childClass: childClass,
operateTime: operateTime
},
dataType: "json",
success: function (json) {
if (json.success == 'true') {
$("#tipMsg").text("保存成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
$("#titleModal").modal('hide');
} else {
$("#tipMsg").text("保存失败." + json.msg);
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
$("#titleModal").modal('hide');
}
}
});
}
});
$("#table").on("click", '.opt-edit', function () {
var id = $(this).attr("data-id");
$.ajax({
type: "get",
url: "/admin/title/getDetailInfo.action",
data: { titleId: id },
dataType: "json",
success: function (json) {
if (json) {
$("#titleId").val(json.titleId);
$("#titleName").val(json.titleName);
switch (json.type) {
case 1:
$("#roomTag").prop("checked", true);
$('#typeClass').attr('class', 'hidden');
$("#tagClass").attr('class', 'show');
break;
case 2:
$("#roomType").prop("checked", true);
$('#tagClass').attr('class', 'hidden');
$('#typeClass').attr('class', 'show');
break;
}
var roomTagHtml = '';
var roomTypeHtml = '';
$.each(json.roomTags, function (index, item) {
if (item.checked == true) {
roomTagHtml += '<label><input type="checkbox" value="' + item.id + '" checked="checked">' + item.name + '&nbsp;&nbsp;</label>';
} else {
roomTagHtml += '<label><input type="checkbox" value="' + item.id + '">' + item.name + '&nbsp;&nbsp;</label>';
}
});
$.each(json.roomTypes, function (index, item) {
if (item.checked == true) {
roomTypeHtml += '<label><input type="checkbox" value="' + item.id + '" checked="checked">' + item.name + '&nbsp;&nbsp;</label>';
} else {
roomTypeHtml += '<label><input type="checkbox" value="' + item.id + '">' + item.name + '&nbsp;&nbsp;</label>';
}
});
$("#tagClass").html(roomTagHtml);
$("#typeClass").html(roomTypeHtml);
// 打开编辑弹窗
$("#titleModal").modal('show');
} else {
$("#tipMsg").text("获取菜单信息出错");
$("#tipModal").modal('show');
}
}
});
});
$('input[name="labelType"]').change(function () {
if ($("#roomTag").is(":checked")) {
$('#typeClass').attr('class', 'hidden');
$("#tagClass").attr('class', 'show');
} else if ($("#roomType").is(":checked")) {
$('#tagClass').attr('class', 'hidden');
$("#typeClass").attr('class', 'show');
}
});
});
}
},
};
</script>
<style scoped></style>

View File

@@ -0,0 +1,627 @@
<template>
<section class="content">
<div class="box box-primary">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<section class="content">
<div id="toolbar">
<label for="searchTitle" class="control-label">搜索标题</label>
<input type="text" id="searchTitle" placeholder="输入标题">
<label for="searchTime" class="control-label">搜索时间</label>
<input type="text" id="searchTime" placeholder="输入开始时间">
<input type="text" id="searchEndTime" placeholder="输入结束时间">
<button id="searchBtn" class="btn btn-default">
<i class="glyphicon glyphicon-search"></i>查询
</button>
<button id="addBtn" class="btn btn-default">
<i class="glyphicon glyphicon-plus"></i>增加
</button>
</div>
<div id="table"></div>
<div id="userMessage">
<button type="button" id="deleteall" class="btn btn-primary">删除选中</button>
</div>
</section>
</div>
</section>
<div class="modal fade" id="addResource" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">x</span></button>
<h4 class="modal-title" id="modalLabel">添加头条</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" id="addTopLine" method="post" enctype="multipart/form-data">
<div class="form-group">
<input type="hidden" name="id" id="id" />
<label for="title" class="col-sm-3 control-label">标题</label>
<div class="col-sm-9">
<input type="text" name="title" id="title" class="form-control validate[required]"
placeholder="请输入标题内容" />
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">内容类型</label>
<div class="col-sm-9">
<label class="radio-inline">
<input type="radio" name="paramType" id="paramType" value="1" />
跳转链接
</label>
<label class="radio-inline">
<input type="radio" name="paramType" id="paramType" value="2" />
跳转房间
</label>
<label class="radio-inline">
<input type="radio" name="paramType" id="paramType" value="0" checked="checked" />
文本内容
</label>
<div class="pull-right">
<p class="form-control-static">跳转房间与链接,文本内容只能三选一</p>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-3 col-sm-9">
<input type="text" name="params" id="params" class="form-control"
placeholder="请输入跳转房间或者链接或者文本内容" />
</div>
</div>
<div class="form-group">
<label for="inputfile" class="col-sm-3 control-label">头条图片</label>
<div class="col-sm-9">
<label class="sr-only" for="inputfile">文件输入</label>
<input type="file" id="inputfile" name="inputfile">
</div>
</div>
<div class="form-group">
<label for="isPublish" class="col-sm-3 control-label">是否发布</label>
<div class="col-sm-9">
<label class="radio-inline">
<input type="radio" name="publish" value="true" />
</label>
<label class="radio-inline">
<input type="radio" name="publish" value="false" checked="checked" />
</label>
</div>
</div>
<div class="form-group">
<label for="publishTimeDate" class="col-sm-3 control-label">定时发布</label>
<div class="col-sm-9">
<input type="text" name="publishTimeDate" id="publishTimeDate" class="form-control"
placeholder="请选择发布时间" />
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" id="clean">重置</button>
<button type="button" class="btn btn-primary" id="save">保存</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="delcfmModel">
<div class="modal-dialog">
<div class="modal-content message_align">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">×</span></button>
<h4 class="modal-title">提示信息</h4>
</div>
<div class="modal-body">
<p>您确认要删除吗</p>
</div>
<div class="modal-footer">
<input type="hidden" id="url" />
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-primary" id="doDelete">确认</button>
</div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "ToplineAdminView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
var carGoodsObj = {};
getCarGoodsMsg();
function initTable() {
var picker = $('#publishTimeDate').datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
startDate: new Date(),
autoclose: true
});
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{ field: 'tmp1', title: 'id', align: 'center', checkbox: true, width: '5%' },
{ field: 'id', title: '编号', align: 'center', width: '5%', valign: 'center' },
// {field: 'users.erbanNo', title:'平台号', align: 'center', width: '10%',valign:'center'},
{ field: 'title', title: '标题', align: 'center', valign: 'center', width: '20%' },
{
field: 'img', title: '图片', align: 'center', width: '10%', valign: 'center', formatter: function (val, row, index) {
if (val) {
if (val.indexOf("https") == 0) {
return "<img src='" + val + "' width='60' height='106'>";
} else {
return val;
}
}
}
},
{
field: 'isPublish', title: '发布', align: 'center', width: '10%', valign: 'center', formatter: function (val, row, index) {
if (val) {
if (!val) {
return "否"
} else {
return "是"
}
} else {
return "否"
}
}
},
{
field: 'paramType', title: '跳转房间', align: 'center', width: '10%', valign: 'center', formatter: function (val, row, index) {
if (val) {
if (val == 2) {
return row['params']
} else {
return "否"
}
} else {
return "否"
}
}
},
{
field: 'paramType', title: '链接', align: 'center', width: '20%', valign: 'center', formatter: function (val, row, index) {
if (val) {
if (val == 1) {
return row['params']
} else {
return "否"
}
} else {
return "否"
}
}
},
{
field: 'paramType', title: '内容', align: 'center', width: '20%', valign: 'center', formatter: function (val, row, index) {
if (typeof (val) == "undefined") {
return "否";
} else {
if (val == 0) {
return row['params']
} else {
return "否"
}
}
}
},
{
field: 'publishTime', title: '发布时间', align: 'center', valign: 'center', formatter: function (val, row, index) {
if (val || val > 0) {
var date = new Date(val);
return date.format("yyyy-MM-dd hh:mm:ss");
} else {
return '-';
}
}
},
{
field: 'tmp2',
title: '操作',
align: 'center',
width: '15%',
valign: 'middle',
formatter: function (val, row, index) {
var key = row.id;
return "<button class='btn btn-sm btn-success opt-edit' data-id=" + key + ">编辑</button>&nbsp;&nbsp;" +
"<button class='btn btn-sm btn-success opt-del' data-id=" + key + " >删除</button>";
}
}
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 20,
pagination: true,
pageList: [10, 20, 30, 50, 100, 200],
search: false,
sidePagination: "server", //表示服务端请求
//设置为undefined可以获取pageNumberpageSizesearchTextsortNamesortOrder
//设置为limit可以获取limit, offset, search, sort, order
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
page: params.pageNumber,
pageSize: params.pageSize,
searchTime: $("#searchTime").val(),
searchTitle: $("#searchTitle").val(),
searchEndTime: $("#searchEndTime").val()
};
return param;
},
toolbar: '#toolbar',
url: '/admin/topline/query.action',
onLoadSuccess: function (data) { //加载成功时执行
console.log();
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
})
}
// var picker = $('#searchTime').datetimepicker({
// format: 'yyyy-mm-dd hh:00:00',
// startDate: new Date(0),
// autoclose: true
// });
// $('#searchEndTime').datetimepicker({
// format: 'yyyy-mm-dd hh:00:00',
// startDate: new Date(0),
// autoclose: true
// });
$("#searchTime").datetimepicker({
minView: "month",
language: 'zh-CN',
format: 'yyyy-mm-dd 00:00:00',
autoclose: true,
todayBtn: true,
pickerPosition: "bottom-left"
}).on('changeDate', function (ev) {
var starttime = $("#searchTime").val();
$("#searchEndTime").datetimepicker('setStartDate', starttime);
$("#searchTime").datetimepicker('hide');
});
$("#searchEndTime").datetimepicker({
minView: "month",
language: 'zh-CN',
format: 'yyyy-mm-dd 00:00:00',
autoclose: true,
todayBtn: true,
pickerPosition: "bottom-left"
}).on('changeDate', function (ev) {
var starttime = $("#searchTime").val();
var endtime = $("#searchEndTime").val();
$("#searchTime").datetimepicker('setEndDate', endtime);
$("#searchEndTime").datetimepicker('hide');
});
$('#addBtn').on('click', function () {
clearForm();
$('#addResource').modal('show');
});
$("#table").on("click", '.opt-edit', function () {
clearForm();
var id = $(this).attr("data-id");
$.ajax({
type: "POST",
url: "/admin/topline/" + id + ".action",
data: {},
dataType: "json",
success: function (json) {
console.log(json)
if (json.data) {
console.log(json.data)
$("#id").val(json.data.id);
$("#title").val(json.data.title);
var paramType = json.data.paramType;
$("input[type=radio][name='paramType'][value=" + paramType + "]").prop("checked", true);
$("#params").val(json.data.params);
if (json.data.isPublish == 1) {
$("input[type=radio][name='publish'][value='true']").prop("checked", true);
} else {
$("input[type=radio][name='publish'][value='false']").prop("checked", true);
}
var publishTime = json.data.publishTime
if (publishTime || publishTime > 0) {
var date = new Date(json.data.publishTime);
$("#publishTimeDate").val(date.format("yyyy-MM-dd hh:mm:ss"));
}
// 打开编辑弹窗
$('#addResource').modal('show');
} else {
$("#tipMsg").text("获取菜单信息出错");
$("#tipModal").modal('show');
}
}
});
});
$('#save').on('click', function () {
var form = new FormData($("#addTopLine")[0]);
$.ajax({
type: 'post',
url: "/admin/topline/add",
data: form,
dataType: 'json',
contentType: false,
processData: false,
success: function (res) {
if (res.code == 200) {
$('#addResource').modal('hide');
$("#tipMsg").text("添加成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
var msg = '';
if (res.code == 0) {
msg = "数据错误"
} else if (res.code == -1) {
msg = "提示标题限制35字内"
} else if (res.code == -4) {
msg = "房间id错误"
} else {
msg = "添加失败"
}
$("#tipMsg").text(msg);
$("#tipModal").modal('show');
}
}
})
});
$('#table').on('click', '.opt-del', function () {
var key = parseInt($(this).data('id'));
$("#doDelete").data('id', key);
$("#rowId").val(key);
$.ajax({
type: 'post',
url: '/admin/topline/toplinedelet.action',
data: { topLineId: $(this).data('id') },
dataType: 'json',
success: function (data) {
if (data == 1) {
$("#tipMsg").text("删除成功");
$("#tipModal").modal('show');
$('#delcfmModel').modal('hide');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("删除失败,错误码:" + data);
$("#tipModal").modal('show');
}
}
})
})
$("#deleteall").on("click", function () {
var $form = $('#addResource');
var ids = $.map($('#table').bootstrapTable('getSelections'), function (row) {
return row.id
});
if (ids.length > 0) {
var b = JSON.stringify(ids);
var url = "/admin/topline/batchdelete.action";
$.ajax({
dataType: "json",
data: { ids: b },
type: "post",
url: url,
success: function (data) {
if (data > 0) {
$("#tipMsg").text("删除成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("删除失败,错误");
$("#tipModal").modal('show');
}
},
error: function (data) {
$("#tipMsg").text("删除失败:");
$("#tipModal").modal('show');
}
});
}
})
$("#edit").click(function () {
if ($('#editResForm').validationEngine('validate')) {
$.ajax({
type: 'post',
url: '/admin/topline/update.action',
data: {
rowId: $("#rowId").val(),
nobleType: $("#nobleType").val(),
resType: $('#resType1').val(),
isDyn: $('#isDyn1').val(),
isDef: $('#isDef1').val(),
status: $("#status1").val(),
resName: $('#resName').val(),
res: $("#resType1").val() == 1 ? $("#res1").val() : $("#res2").val(),
preview: $("#resType1").val() == 1 ? $("#preview").val() : $("#preview1").val(),
seq: $('#editSeq').val()
},
dataType: 'json',
success: function (data) {
if (data == 1) {
$("#editResourceModal").modal('hide');
$("#tipMsg").text("修改成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("修改失败,错误码:" + data);
$("#tipModal").modal('show');
}
}
})
}
})
$('#searchBtn').on('click', function () {
// $('#table').bootstrapTable('destroy');
// TableHelper.doRefresh('#table');
initTable();
});
$('#clean').on('click', function () {
clearForm();
});
$('#sort').on('change', function () {
var val = parseInt($(this).val());
if (val == 1) {
$('#table').show();
$('#table2').hide();
TableHelper.doRefresh('#table');
} else if (val == 2) {
$('#table').hide();
$('#table2').show();
TableHelper.doRefresh('#table2');
}
});
function getCarGoodsMsg() {
initTable();
}
function isShow($ele) {
if ($ele.attr('display') == 'block') {
return true;
}
return false;
}
function renderSelect(data) {
var $select = $('#addCarId');
for (var i = 0; i < data.length; i++) {
var $option = $('<option value="' + data[i].id + '" />');
$option.html(data[i].name);
$select.append($option);
carGoodsObj[data[i].id] = data[i].name;
}
}
function clearForm() {
var $form = $('#addResource');
$form.find('input[type="text"]').val('');
$form.find('input[type="hidden"]').val('');
$("input[type=radio][name='paramType'][value=0]").prop("checked", true);
$("input[type=radio][name='publish'][value='false']").prop("checked", true);
$form.find('input[type="hidden"]').val('');
var file = $("#inputfile");
file.after(file.clone().val(""));
file.remove();
}
})
}
},
};
</script>
<style scoped>
#userMessage {
display: flex;
justify-content: flex-start;
align-items: center;
}
#userMessage .avatar {
width: 50px;
height: 50px;
}
#userMessage .avatar img {
width: 100%;
height: 100%;
}
#userMessage>div {
margin-right: 30px;
}
</style>

View File

@@ -0,0 +1,479 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<!-- Content Header (Page header) -->
<section class="content-header">
<div id="itemTitle"></div>
</section>
<!-- .content -->
<section>
<div id="table"></div>
</section>
<div id="toolbar">
<div class="col-sm-12">
<button id="btnAdd" class="btn btn-default">
<i class="glyphicon glyphicon-plus-sign"></i>添加
</button>
</div>
</div>
</div>
</div>
</section>
<div class="modal fade" id="editModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="modalLabel">添加</h4>
</div>
<div class="modal-body">
<form class="form-horizontal">
<input type="hidden" name="id" id="id" />
<input type="hidden" name="rewardId" id="rewardId" />
<input type="hidden" name="propIds" id="propIds" />
<input type="hidden" name="propNums" id="propNums" />
<div class="form-group">
<label for="type" class="col-sm-3 control-label">兑换类型</label>
<div class="col-sm-9">
<select name="type" id="type" class="form-control validate[required]" oninput="switchElf()">
<option value="1">精灵召唤</option>
<option value="2">碎片召唤</option>
</select>
</div>
</div>
<div class="form-group">
<label for="rewardType" class="col-sm-3 control-label">装饰类型</label>
<div class="col-sm-9">
<select name="rewardType" id="rewardType" class="form-control" oninput="getReward()">
<option value=""></option>
<option value="activityProps">活动道具</option>
<option value="gift">礼物</option>
<option value="namePlate">铭牌</option>
<option value="car">座驾</option>
<option value="headwear">头饰</option>
<option value="chatBubble">气泡</option>
<option value="infoCard">资料卡</option>
</select>
</div>
</div>
<div class="form-group">
<label for="seq" class="col-sm-3 control-label">前端排序</label>
<div class="col-sm-9">
<input type="text" class="form-control" id="seq">
</div>
</div>
<div class="form-group">
<label for="rewardName" class="col-sm-3 control-label">装饰ID</label>
<div class="col-sm-9" id="rewardDiv">
<input type="text" class="form-control" id="rewardName">
</div>
</div>
<div class="form-group">
<label for="expendNum" class="col-sm-3 control-label">消耗碎片数</label>
<div class="col-sm-9">
<input type="text" class="form-control" id="expendNum">
</div>
</div>
<div class="form-group">
<label for="effectDay" class="col-sm-3 control-label">有效期</label>
<div class="col-sm-9">
<input type="text" class="form-control" id="effectDay">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="save">确定</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="tipModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">提示信息</h4>
</div>
<div class="modal-body" id="tipMsg"></div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "SeizeTreasureConvertItemView",
setup() {
function getReward() {
var rewardId = $('#rewardId').val();
var rewardType = $('#rewardType').val();
var options = [];
$.ajax({
type: "get",
url: "/admin/seize-treasure/reward/list?rewardType=" + rewardType,
dataType: "json",
async: false,
success: function (json) {
if (json.success == 'true' || json.code == 200) {
var data = json.data;
for (var i = 0, len = data.length; i < len; i++) {
var reward = data[i];
options[i] = {
value: reward.id,
text: reward.name
};
}
}
}
});
$('#rewardName').remove();
if (options.length > 0) {
var $div = $('#rewardDiv');
var $select = $('<select/>');
$select.attr('class', 'form-control validate[required]');
$select.attr('id', 'rewardName');
for (let i = 0, len = options.length; i < len; i++) {
var option = options[i];
var $option = $('<option/>');
$option.attr('value', option.value);
$option.data('id', option.value);
$option.data('name', option.text);
if (rewardId && rewardId == option.value) {
$option.attr('selected', true);
}
$option.html(option.text);
$select.append($option);
}
}
}
function switchElf() {
var type = $('#type').val();
if (!type || type == 2) {
return;
}
var propIds = $('#propIds').val().split(',');
var propNums = $('#propNums').val().split(',');
var options = [];
$.ajax({
type: "get",
url: "/admin/seize-treasure/prop/list?type=3&level=3",
dataType: "json",
async: false,
success: function (json) {
if (json.success == 'true' || json.code == 200) {
var data = json.data;
for (var i = 0, len = data.length; i < len; i++) {
var prop = data[i];
options[i] = {
value: prop.id,
text: prop.name
};
}
}
}
});
if (options.length == 0) {
return;
}
var $form = $('#editModal .modal-body .form-horizontal');
for (let i = 0; i < options.length; i++) {
var propId = propIds[i];
var propNum = propNums[i];
var $formGroup = $('<div/>');
$formGroup.attr('class', 'form-group');
$formGroup.attr('id', 'elf' + i);
var $label = $('<label/>');
$label.attr('class', 'col-sm-3 control-label');
$label.html('消耗精灵' + (i + 1) + '');
var $div = $('<div/>');
$div.attr('class', 'col-sm-9');
var $select = $('<select/>');
$select.attr('class', 'form-control validate[required]');
$select.attr('id', 'elfId' + i);
for (let j = 0; j < options.length; j++) {
var option = options[j];
var $option = $('<option/>');
$option.attr('value', option.value);
$option.html(option.text);
if (propId && propId == option.value) {
$option.attr('selected', true);
}
$select.append($option);
$div.append($select);
}
var $input = $('<input/>');
$input.attr('type', 'text');
$input.attr('name', 'elfNum' + i);
$input.attr('id', 'elfNum' + i);
if (propNum) {
$input.attr('value', propNum);
}
$div.append($input);
$formGroup.append($div);
}
}
window.getReward = getReward;
window.switchElf = switchElf;
return {
getReward,
switchElf
};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
var elfArray = getElf();
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{ field: 'seq', title: '前端排序', align: 'center', width: '5%' },
{
field: 'type',
title: '兑换类型',
align: 'center',
width: '5%',
formatter: function (val, row, index) {
var value = '';
if (val == 1) {
value = '精灵召唤';
} else if (val == 2) {
value = '碎片召唤';
}
return value;
}
},
{
field: 'rewardType',
title: '类型',
align: 'center',
width: '5%',
formatter: function (val, row, index) {
var value = '';
if (val == 'activityProps') {
value = '活动道具';
} else if (val == 'gift') {
value = '礼物';
} else if (val == 'namePlate') {
value = '铭牌';
} else if (val == 'car') {
value = '座驾';
} else if (val == 'headwear') {
value = '头饰';
} else if (val == 'chatBubble') {
value = '气泡';
} else if (val == 'infoCard') {
value = '资料卡';
} else {
value = '-';
}
return value;
}
},
{ field: 'rewardRefId', title: 'ID', align: 'center', width: '5%' },
{ field: 'rewardName', title: '名称', align: 'center', width: '5%' },
{
field: 'effectDay',
title: '有效期',
align: 'center',
width: '5%',
formatter: function (val, row, index) {
var value = '';
if (val) {
value = val + '天';
} else {
value = '-';
}
return value;
}
},
{ field: 'expendNum', title: '消耗碎片数', align: 'center', width: '5%' },
{ field: 'rewardValue', title: '单价(钻)', align: 'center', width: '5%' },
{
field: 'id',
title: '操作',
align: 'center',
width: '5%',
valign: 'middle',
formatter: function (val, row, index) {
return '<button class="btn btn-sm btn-success opt-edit" data-index="' + index + '">编辑</button>';
}
}
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 20,
pagination: true,
pageList: [20, 50, 100],
search: false,
sidePagination: "server", //表示服务端请求
//设置为undefined可以获取pageNumberpageSizesearchTextsortNamesortOrder
//设置为limit可以获取limit, offset, search, sort, order
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
page: params.pageNumber,
pageSize: params.pageSize,
};
return param;
},
toolbar: '#toolbar',
url: '/admin/seize-treasure/convert/item/page',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
});
$('#btnAdd').on('click', function () {
for (let i = 0, len = elfArray.length; i < len; i++) {
$('#elf' + i).remove();
}
$("#id").val('');
$("#rewardId").val('');
$("#type").val('');
$("#seq").val('');
$("#rewardType").val('');
$("#rewardName").val('');
$('#expendNum').val('');
$("#effectDay").val('');
$("#propIds").val('');
$("#propNums").val('');
$("#editModal").modal('show');
});
$('#table').on('click', '.opt-edit', function () {
for (let i = 0, len = elfArray.length; i < len; i++) {
$('#elf' + i).remove();
}
const currentData = $('#table').bootstrapTable('getData')[$(this).data('index')];
var id = currentData.id;
var rewardId = currentData.rewardId;
var type = currentData.type;
var seq = currentData.seq;
var rewardType = currentData.rewardType;
var rewardName = currentData.rewardName;
var expendNum = currentData.expendNum
var effectDay = currentData.effectDay;
var propIds = currentData.propIds;
var propNums = currentData.propNums;
$("#id").val(id);
$("#rewardId").val(rewardId);
$("#type").val(type);
$("#seq").val(seq);
$("#rewardType").val(rewardType);
$('#rewardName').val(rewardName);
$("#expendNum").val(expendNum);
$("#effectDay").val(effectDay);
$("#propIds").val(propIds);
$("#propNums").val(propNums);
window.getReward();
$("#editModal").modal('show');
});
$("#save").click(function () {
const msg = '确定要保存吗?';
if (confirm(msg)) {
var id = $("#id").val();
var type = $('#type').val();
var seq = $('#seq').val();
var rewardType = $("#rewardType").val();
var rewardId = $("#rewardName").data('id');
var rewardName = $("#rewardName").data('name');
var expendNum = $("#expendNum").val();
var effectDay = $("#effectDay").val();
var propIds = [];
var propNums = [];
for (let i = 0, len = elfArray.length; i < len; i++) {
var propId = $('#elfId' + i).val();
var propNum = $('#elfNum' + i).val();
if (propId && propNum) {
propIds[i] = propId;
propNums[i] = propNum;
} else {
propIds[i] = 0;
propNums[i] = 0;
}
}
var data = {
type: type,
seq: seq,
rewardType: rewardType,
rewardId: rewardId,
rewardName: rewardName,
expendNum: expendNum,
effectDay: effectDay,
propIdsJson: JSON.stringify(propIds),
propNumsJson: JSON.stringify(propNums),
};
if (id) {
data.id = id;
}
$.ajax({
type: "post",
url: "/admin/seize-treasure/convert/item/save",
data: data,
dataType: "json",
success: function (json) {
if (json.success == 'true' || json.code == 200) {
$("#tipMsg").text("保存成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
$("#editModal").modal('hide');
} else {
$("#tipMsg").text("保存失败." + json.message);
$("#tipModal").modal('show');
$("#editModal").modal('hide');
}
}
});
}
});
});
}
},
};
function getElf() {
var options = [];
$.ajax({
type: "get",
url: "/admin/seize-treasure/prop/list?type=3&level=3",
dataType: "json",
async: false,
success: function (json) {
if (json.success == 'true' || json.code == 200) {
var data = json.data;
for (var i = 0, len = data.length; i < len; i++) {
var prop = data[i];
options[i] = {
value: prop.id,
text: prop.name
};
}
}
}
});
return options;
}
</script>
<style scoped></style>

View File

@@ -0,0 +1,123 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<!-- Content Header (Page header) -->
<section class="content-header">
<div id="itemTitle"></div>
</section>
<!-- .content -->
<section>
<div id="table"></div>
</section>
<div id="toolbar">
<div class="col-sm-12">
<label for="convertType" class="col-sm-3 control-label">召唤类型:</label>
<div class="col-sm-3">
<select name="convertType" id="convertType" data-btn-class="btn-warning" class="form-control">
<option value="1" selected>精灵召唤</option>
<option value="2">碎片召唤</option>
</select>
</div>
</div>
<div class="col-sm-12">
<button id="btnSearch" class="btn btn-default">
<i class="glyphicon glyphicon-search"></i>查询
</button>
</div>
</div>
</div>
</div>
</section>
<div class="modal fade" id="tipModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">提示信息</h4>
</div>
<div class="modal-body" id="tipMsg"></div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "SeizeTreasureConvertRecordView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{ field: 'erbanNo', title: '用户ID', align: 'center', width: '5%' },
{ field: 'nick', title: '用户昵称', align: 'center', width: '5%' },
{
field: 'convertType',
title: '召唤类型',
align: 'center',
width: '5%',
formatter: function (val, row, index) {
var value = '';
if (val == '1') {
value = '精灵召唤';
} else if (val == '2') {
value = '碎片召唤';
}
return value;
}
},
{ field: 'rewardName', title: '获得物品名称', align: 'center', width: '5%' },
{ field: 'rewardShowValue', title: '获得物品价值(钻)', align: 'center', width: '5%' },
{ field: 'createTime', title: '召唤时间', align: 'center', width: '5%' },
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 20,
pagination: true,
pageList: [20, 50, 100],
search: false,
sidePagination: "server", //表示服务端请求
//设置为undefined可以获取pageNumberpageSizesearchTextsortNamesortOrder
//设置为limit可以获取limit, offset, search, sort, order
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
page: params.pageNumber,
pageSize: params.pageSize,
convertType: $('#convertType').val()
};
return param;
},
toolbar: '#toolbar',
url: '/admin/seize-treasure/convert/record/page',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
});
$('#btnSearch').on('click', function () {
TableHelper.doRefresh('#table');
});
});
}
},
};
</script>
<style scoped></style>

View File

@@ -0,0 +1,276 @@
<template>
<section class="content">
<div class="box box-primary">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<section class="content">
<div id="toolbar">
<form class="form-horizontal" role="form">
<div class="form-group col-sm-3">
<label for="queryStartDate" class="control-label">开始时间</label>
<input type="text" class="input-sm datetime" id="queryStartDate" placeholder="开始时间">
</div>
<div class="form-group col-sm-3">
<label for="queryEndDate" class="control-label">结束时间</label>
<input type="text" class="input-sm datetime" id="queryEndDate" placeholder="结束时间">
</div>
<div class="form-group col-sm-3">
<label for="erbanNo" class="control-label">用户ID</label>
<input type="text" class="input-sm" name="erbanNo" id="erbanNo" placeholder="">
</div>
</form>
<div class="row"></div>
<div>
<button class="btn btn-primary" id="searchBtn">查询</button>
</div>
<div class="dataCount">
<p>
<span>参与用户数量</span>
<span id="drawPeopleNum"></span>
</p>
<p>
<span>抽奖次数</span>
<span id="drawCountNum"></span>
</p>
<p>
<span>投入总价值</span>
<span id="drawInputValue"></span>
</p>
<p>
<span>产出总价值</span>
<span id="drawOutputValue"></span>
</p>
<p>
<span>产出礼物总价值</span>
<span id="drawOutputGiftValue"></span>
</p>
<p>
<span>产出活动道具总价值</span>
<span id="drawOutputPropValue"></span>
</p>
</div>
</div>
<div id="table"></div>
</section>
</div>
</section>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "SeizeTreasureDataAdminView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$(".selectpicker").selectpicker({
noneSelectedText: '全部'//默认显示内容
});
let listQueryParams = {};
$("#queryStartDate").datetimepicker({
todayBtn: true,
format: 'yyyy-mm-dd hh:ii:00',
language: 'zh-CN',
autoclose: true
})
$("#queryEndDate").datetimepicker({
todayBtn: true,
useCurrent: true,
format: 'yyyy-mm-dd hh:ii:00',
language: 'zh-CN',
autoclose: true
})
var main = {
init: function () {
this.eventRegister();
//this.valueChange();
},
eventRegister: function () {
$('#searchBtn').on('click', function () {
var $dataCount = $('.dataCount');
var poolTypeList;
if ($("#poolTypeList").val() && $("#poolTypeList").val().length) {
poolTypeList = $("#poolTypeList").val().join();
}
var poolGroupList;
if ($("#poolGroupList").val() && $("#poolGroupList").val().length) {
poolGroupList = $("#poolGroupList").val().join();
}
var poolLevelList;
if ($("#poolLevelList").val() && $("#poolLevelList").val().length) {
poolLevelList = $("#poolLevelList").val().join();
}
$.get('/admin/seize-treasure/treasure/record/total', {
startTime: $('#queryStartDate').val(),
endTime: $('#queryEndDate').val(),
erbanNo: $('#erbanNo').val(),
poolTypeList: poolTypeList,
poolGroupList: poolGroupList,
poolLevelList: poolLevelList,
}, function (res) {
console.log(res);
if (res.code == 200) {
var data = res.data;
$dataCount.find('#drawPeopleNum').html(data.drawPeopleNum);
$dataCount.find('#drawCountNum').html(data.drawCountNum);
$dataCount.find('#drawInputValue').html(data.drawInputValue);
$dataCount.find('#drawOutputValue').html(data.drawOutputValue);
$dataCount.find('#drawOutputGiftValue').html(data.drawOutputGiftValue);
$dataCount.find('#drawOutputPropValue').html(data.drawOutputPropValue);
// TableHelper.doRefresh('#table');
tableRefresh();
} else {
console.log('数据错误,导致加载失败,' + res.code);
}
})
});
$('#table').on('click', '#details', function () {
console.log($(this).data('id'));
});
},
valueChange: function () {
var poolTypeList;
if ($("#poolTypeList").val() && $("#poolTypeList").val().length) {
poolTypeList = $("#poolTypeList").val().join();
}
var poolGroupList;
if ($("#poolGroupList").val() && $("#poolGroupList").val().length) {
poolGroupList = $("#poolGroupList").val().join();
}
var poolLevelList;
if ($("#poolLevelList").val() && $("#poolLevelList").val().length) {
poolLevelList = $("#poolLevelList").val().join();
}
var $dataCount = $('.dataCount');
$.get('/admin/seize-treasure/treasure/record/total', {
startTime: $('#queryStartDate').val(),
endTime: $('#queryEndDate').val(),
erbanNo: $('#erbanNo').val(),
poolTypeList: poolTypeList,
poolGroupList: poolGroupList,
poolLevelList: poolLevelList,
}, function (res) {
console.log(res);
if (res.code == 200) {
var data = res.data;
$dataCount.find('#drawPeopleNum').html(data.drawPeopleNum);
$dataCount.find('#drawCountNum').html(data.drawCountNum);
$dataCount.find('#drawInputValue').html(data.drawInputValue);
$dataCount.find('#drawOutputValue').html(data.drawOutputValue);
$dataCount.find('#drawOutputGiftValue').html(data.drawOutputGiftValue);
$dataCount.find('#drawOutputPropValue').html(data.drawOutputPropValue);
TableHelper.doRefresh('#table');
} else {
console.log('数据错误,导致加载失败,' + res.code);
}
})
}
};
main.init();
function tableRefresh() {
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{ field: 'dateStr', title: '日期', align: 'center', width: '5%' },
{ field: 'drawPeopleNum', title: '参与用户数量', align: 'center', valign: 'middle', width: '10%' },
{ field: 'drawCountNum', title: '抽奖次数', align: 'center', valign: 'middle', width: '10%' },
{ field: 'drawInputValue', title: '投入总价值', align: 'center', valign: 'middle', width: '10%' },
{ field: 'drawOutputValue', title: '产出总价值', align: 'center', valign: 'middle', width: '10%' },
{ field: 'drawOutputGiftValue', title: '产出礼物总价值', align: 'center', valign: 'middle', width: '10%' },
{ field: 'drawOutputPropValue', title: '产出活动道具总价值', align: 'center', valign: 'middle', width: '10%' },
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pagination: true,
pageList: [10, 20, 30, 50],
sidePagination: 'server',
queryParamsType: 'undefined',
queryParams: function queryParams(params) {
var poolTypeList;
if ($("#poolTypeList").val() && $("#poolTypeList").val().length) {
poolTypeList = $("#poolTypeList").val().join();
}
var poolGroupList;
if ($("#poolGroupList").val() && $("#poolGroupList").val().length) {
poolGroupList = $("#poolGroupList").val().join();
}
var poolLevelList;
if ($("#poolLevelList").val() && $("#poolLevelList").val().length) {
poolLevelList = $("#poolLevelList").val().join();
}
var param = {
page: params.pageNumber,
pageSize: params.pageSize,
startTime: $('#queryStartDate').val(),
endTime: $('#queryEndDate').val(),
erbanNo: $('#erbanNo').val(),
poolTypeList: poolTypeList,
poolGroupList: poolGroupList,
poolLevelList: poolLevelList,
};
listQueryParams = param;
return param;
},
uniqueId: 'id',
toolbar: '#toolbar',
url: '/admin/seize-treasure/treasure/record/day',
onLoadSuccess: function () {
console.log('load success');
},
onLOadError: function () {
console.log('load fail');
}
});
}
})
}
},
};
</script>
<style scoped>
.dataCount {
display: flex;
justify-content: flex-start;
align-items: center;
margin-top: 10px;
}
.dataCount>p {
padding: 5px;
border-radius: 5px;
background: #ccc;
margin-right: 10px;
}
</style>

View File

@@ -0,0 +1,141 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<!-- .content -->
<div id="table"></div>
<div id="toolbar">
<div class="col-sm-12">
<label for="startTime" class="col-sm-2 control-label">选择时间:</label>
<div class="col-sm-2"><input type="text" class="form-control" name="startTime" id="startTime"></div>
<label for="endTime" class="col-sm-1 control-label">-</label>
<div class="col-sm-2"><input type="text" class="form-control" name="endTime" id="endTime"></div>
<label for="erbanNo" class="col-sm-1 control-label">Peko号:</label>
<div class="col-sm-2"><input type="text" class="form-control" name="erbanNo" id="erbanNo"></div>
</div>
<div class="col-sm-12">
<button id="btnSearch" class="btn btn-default">
<i class="glyphicon glyphicon-search"></i>查询
</button>
</div>
</div>
</div>
</div>
</section>
<div class="modal fade" id="tipModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">提示信息</h4>
</div>
<div class="modal-body" id="tipMsg"></div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "SeizeTreasurePoolDrawRecordTotalView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{ field: 'uid', title: 'UID', align: 'center', width: '5%' },
{ field: 'erbanNo', title: '平台号', align: 'center', width: '5%' },
{ field: 'nick', title: '用户昵称', align: 'center', width: '5%' },
{ field: 'drawAmount', title: '历史抽奖总额', align: 'center', width: '5%' },
{ field: 'rewardAmount', title: '历史获奖平台价值', align: 'center', width: '5%' },
{
field: 'diffAmount',
title: '偏差值',
align: 'center',
width: '5%',
formatter: function (val, row, index) {
var value = '';
if (val > 0) {
value = '<span style="color:red;"> +' + val + '</span>';
} else {
value = '<span style="color:green;">' + val + '</span>';
}
return value;
}
},
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 20,
pagination: true,
pageList: [20, 50, 100],
search: false,
sidePagination: "server", //表示服务端请求
//设置为undefined可以获取pageNumberpageSizesearchTextsortNamesortOrder
//设置为limit可以获取limit, offset, search, sort, order
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
page: params.pageNumber,
pageSize: params.pageSize,
erbanNo: $('#erbanNo').val(),
startTime: $('#startTime').val(),
endTime: $('#endTime').val()
};
return param;
},
toolbar: '#toolbar',
url: '/admin/seize-treasure/pool/draw/record/totalPage',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
});
$('#btnSearch').on('click', function () {
TableHelper.doRefresh('#table');
});
var picker1 = $("#startTime").datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
todayBtn: true,
autoclose: true,
});
var picker2 = $("#endTime").datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
todayBtn: true,
autoclose: true
});
picker1.on('changeDate', function () {
var date = $('#startTime').datepicker('getDate');
picker2.datepicker('setStartDate', date);
});
picker2.on('changeDate', function () {
var date = $('#endTime').datepicker('getDate');
picker1.datepicker('setEndDate', date);
});
});
}
},
};
</script>
<style scoped></style>

View File

@@ -0,0 +1,183 @@
<template>
<section class="content">
<div class="box box-primary">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<section class="content">
<div id="toolbar">
<div class="form-group col-sm-3">
<label for="queryStartDate" class="control-label">开始时间</label>
<input type="text" class="input-sm datetime" id="queryStartDate" placeholder="开始时间">
</div>
<div class="form-group col-sm-3">
<label for="queryEndDate" class="control-label">结束时间</label>
<input type="text" class="input-sm datetime" id="queryEndDate" placeholder="结束时间">
</div>
<div class="form-group col-sm-3">
<label for="erbanNo" class="control-label">用户ID</label>
<input type="text" class="input-sm" name="erbanNo" id="erbanNo" placeholder="">
</div>
<div class="row"></div>
<div>
<button class="btn btn-primary" id="searchBtn">查询</button>
</div>
</div>
<div id="table"></div>
</section>
</div>
</section>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "SeizeTreasureRecordAdminView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
let listQueryParams = {};
$(".selectpicker").selectpicker({
noneSelectedText: '全部'//默认显示内容
});
$("#queryStartDate").datetimepicker({
todayBtn: true,
format: 'yyyy-mm-dd hh:ii:00',
language: 'zh-CN',
autoclose: true
})
$("#queryEndDate").datetimepicker({
todayBtn: true,
useCurrent: true,
format: 'yyyy-mm-dd hh:ii:00',
language: 'zh-CN',
autoclose: true
})
var main = {
init: function () {
this.eventRegister();
},
eventRegister: function () {
$('#searchBtn').on('click', function () {
tableRefresh();
});
$('#table').on('click', '#details', function () {
console.log($(this).data('id'));
});
},
};
main.init();
function tableRefresh() {
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{ field: 'id', title: 'id', align: 'center', valign: 'middle', width: '5%' },
{ field: 'erbanNo', title: 'erbanNo', align: 'center', valign: 'middle', width: '10%' },
{ field: 'userNick', title: '昵称', align: 'center', valign: 'middle', width: '10%' },
{ field: 'rewardId', title: '奖励id', align: 'center', valign: 'middle', width: '5%' },
{ field: 'rewardRefId', title: '奖励关联id', align: 'center', valign: 'middle', width: '8%' },
{ field: 'rewardType', title: '奖励类型', align: 'center', valign: 'middle', width: '8%' },
{ field: 'rewardName', title: '奖励名称', align: 'center', valign: 'middle', width: '8%' },
{ field: 'rewardNum', title: '奖励数量', align: 'center', valign: 'middle', width: '5%' },
{ field: 'rewardLevel', title: '奖励等级', align: 'center', valign: 'middle', width: '5%' },
{ field: 'rewardShowValue', title: '奖励价值', align: 'center', valign: 'middle', width: '5%' },
{
field: 'createTime',
title: '抽奖时间',
align: 'center',
valign: 'middle',
width: '20%',
formatter: function (val, row, index) {
var date = new Date(val);
return date.format("yyyy-MM-dd hh:mm:ss");
}
}
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pagination: true,
pageList: [10, 20, 30, 50],
sidePagination: 'server',
queryParamsType: 'undefined',
queryParams: function queryParams(params) {
var poolTypeList;
if ($("#poolTypeList").val() && $("#poolTypeList").val().length) {
poolTypeList = $("#poolTypeList").val().join();
}
var poolGroupList;
if ($("#poolGroupList").val() && $("#poolGroupList").val().length) {
poolGroupList = $("#poolGroupList").val().join();
}
var poolLevelList;
if ($("#poolLevelList").val() && $("#poolLevelList").val().length) {
poolLevelList = $("#poolLevelList").val().join();
}
var param = {
page: params.pageNumber,
pageSize: params.pageSize,
startTime: $('#queryStartDate').val(),
endTime: $('#queryEndDate').val(),
erbanNo: $('#erbanNo').val(),
poolTypeList: poolTypeList,
poolGroupList: poolGroupList,
poolLevelList: poolLevelList,
};
return param;
},
uniqueId: 'id',
toolbar: '#toolbar',
url: '/admin/seize-treasure/treasure/record',
onLoadSuccess: function () {
console.log('load success');
},
onLoadError: function () {
console.log('load fail');
}
});
}
})
}
},
};
</script>
<style scoped>
.dataCount {
display: flex;
justify-content: flex-start;
align-items: center;
margin-top: 10px;
}
.dataCount>p {
padding: 5px;
border-radius: 5px;
background: #ccc;
margin-right: 10px;
}
</style>

View File

@@ -0,0 +1,503 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<!-- Content Header (Page header) -->
<section class="content-header">
<div id="itemTitle"></div>
</section>
<!-- .content -->
<section>
<div id="table"></div>
</section>
<div id="toolbar">
<div class="col-sm-12">
<button id="btnAdd" class="btn btn-default">
<i class="glyphicon glyphicon-plus-sign"></i>新增
</button>
</div>
</div>
</div>
</div>
</section>
<div class="modal fade" id="editModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="modalLabel">奖品设置</h4>
</div>
<div class="modal-body">
<form class="form-horizontal">
<input type="hidden" name="id" id="id" />
<input type="hidden" name="rewardRefId" id="rewardRefId" />
<div class="form-group">
<label for="rewardType" class="col-sm-3 control-label">奖品类型</label>
<div class="col-sm-9">
<select name="rewardType" id="rewardType" class="form-control" oninput="getRewardRef()">
<option value=""></option>
<option value="activityProps">活动道具</option>
<option value="gift">礼物</option>
<option value="namePlate">铭牌</option>
<option value="car">座驾</option>
<option value="headwear">头饰</option>
<option value="chatBubble">气泡</option>
<option value="infoCard">资料卡</option>
</select>
</div>
</div>
<div class="form-group">
<label for="rewardName" class="col-sm-3 control-label">奖品名称</label>
<div class="col-sm-9" id="rewardDiv">
<input type="text" class="form-control" id="rewardName">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">奖品图片</label>
<div class="col-sm-9">
<img src="" id="rewardPicUrlImage" style="width:250px;height:90px;" alt="">
<input type="file" id="rewardPicUrlFile" name="file">
<button class="btn btn-success" type="button" id="rewardPicUrlUploadBtn">上传</button>
<input type="hidden" id="rewardPicUrl" name="rewardPicUrl" class="form-control" />
<span id="rewardPicUrlImgInfo" style="color:red;"></span>
</div>
</div>
<div class="form-group">
<label for="rewardNum" class="col-sm-3 control-label">奖品数量</label>
<div class="col-sm-9">
<input type="text" class="form-control" id="rewardNum">
</div>
</div>
<div class="form-group">
<label for="rewardUnit" class="col-sm-3 control-label">奖品单位</label>
<div class="col-sm-9">
<input type="text" class="form-control" id="rewardUnit">
</div>
</div>
<div class="form-group">
<label for="rewardValue" class="col-sm-3 control-label">奖品价值</label>
<div class="col-sm-9">
<input type="text" class="form-control" id="rewardValue">
</div>
</div>
<div class="form-group">
<label for="rewardShowValue" class="col-sm-3 control-label">奖品展示价值</label>
<div class="col-sm-9">
<input type="text" class="form-control" id="rewardShowValue">
</div>
</div>
<div class="form-group">
<label for="rewardLevel" class="col-sm-3 control-label">奖品等级</label>
<div class="col-sm-9">
<select name="rewardLevel" id="rewardLevel" class="form-control">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
</div>
</div>
<div class="form-group">
<label for="rewardOrder" class="col-sm-3 control-label">奖品排序</label>
<div class="col-sm-9">
<input type="text" class="form-control" id="rewardOrder">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-primary" id="save">确认编辑</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="tipModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">提示信息</h4>
</div>
<div class="modal-body" id="tipMsg"></div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "SeizeTreasureRewardView",
setup() {
function getRewardRef() {
var rewardType = $('#rewardType').val();
var rewardRefId = $('#rewardRefId').val();
var rewardName = $('#rewardName').val();
var options = [];
if (rewardType == 'activityProps') {
$.ajax({
type: "get",
url: "/admin/seize-treasure/prop/list",
dataType: "json",
async: false,
success: function (json) {
if (json.success == 'true' || json.code == 200) {
var data = json.data;
for (var i = 0, len = data.length; i < len; i++) {
var prop = data[i];
options[i] = {
value: prop.id,
text: prop.name
};
}
}
}
});
} else if (rewardType == 'gift') {
$.ajax({
type: "get",
url: "/admin/gift/all",
dataType: "json",
async: false,
success: function (list) {
for (var i = 0; i < list.length; i++) {
var gift = list[i];
options[i] = {
value: gift.oval,
text: gift.otxt
};
}
}
});
} else if (rewardType == 'namePlate') {
$.ajax({
type: "get",
url: "/admin/nameplate/total/list",
dataType: "json",
async: false,
success: function (json) {
if (json.success == 'true' || json.code == 200) {
var data = json.data;
for (var i = 0, len = data.length; i < len; i++) {
var nameplate = data[i];
options[i] = {
value: nameplate.id,
text: nameplate.name
};
}
}
}
});
} else if (rewardType == 'car') {
$.ajax({
type: "get",
url: "/admin/car/goods/total/list",
dataType: "json",
async: false,
success: function (json) {
if (json.success == 'true' || json.code == 200) {
var data = json.data;
for (var i = 0, len = data.length; i < len; i++) {
var car = data[i];
options[i] = {
value: car.id,
text: car.name
};
}
}
}
});
} else if (rewardType == 'headwear') {
$.ajax({
type: "get",
url: "/admin/headwear/total/list",
dataType: "json",
async: false,
success: function (json) {
if (json.success == 'true' || json.code == 200) {
var data = json.data;
for (var i = 0, len = data.length; i < len; i++) {
var headWear = data[i];
options[i] = {
value: headWear.headwearId,
text: headWear.name
};
}
}
}
});
} else if (rewardType == 'chatBubble') {
console.log(rewardType);
} else if (rewardType == 'infoCard') {
console.log(rewardType);
}
$('#rewardName').remove();
var $div = $('#rewardDiv');
console.log(options);
if (options.length > 0) {
var $select = $('<select/>');
$select.attr('class', 'form-control validate[required]');
$select.attr('id', 'rewardName');
for (let j = 0; j < options.length; j++) {
var option = options[j];
var $option = $('<option/>');
$option.attr('value', option.value);
$option.data('id', option.value);
$option.data('name', option.text);
if (rewardName && rewardName == option.text) {
$option.attr('selected', true);
}
$option.html(option.text);
$select.append($option);
}
$div.append($select);
} else {
var $input = $('<input/>');
$input.attr('type', 'text');
$input.attr('class', 'form-control');
$input.attr('id', 'rewardName');
if (rewardRefId && rewardName) {
$input.data('id', rewardRefId);
$input.data('name', rewardName);
$input.val(rewardName);
}
$div.append($input);
}
}
window.getRewardRef = getRewardRef;
return {
getRewardRef
};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{ field: 'id', title: '奖品ID', align: 'center', width: '5%' },
{
field: 'rewardType',
title: '奖品类型',
align: 'center',
width: '5%',
formatter: function (val, row, index) {
var value = '';
if (val == 'activityProps') {
value = '活动道具';
} else if (val == 'gift') {
value = '礼物';
} else if (val == 'namePlate') {
value = '铭牌';
} else if (val == 'car') {
value = '座驾';
} else if (val == 'headwear') {
value = '头饰';
} else if (val == 'chatBubble') {
value = '气泡';
} else if (val == 'infoCard') {
value = '资料卡';
} else {
value = '-';
}
return value;
}
},
{ field: 'rewardName', title: '奖品名称', align: 'center', width: '5%' },
{
field: 'rewardPicUrl',
title: '奖品图片',
align: 'center',
width: '5%',
formatter: function (val, row, index) {
return "<img src='" + val + "' width='40' height='40'>";
}
},
{ field: 'rewardNum', title: '奖品数量', align: 'center', width: '5%' },
{ field: 'rewardUnit', title: '奖品单位', align: 'center', width: '5%' },
{ field: 'rewardValue', title: '奖品价值', align: 'center', width: '5%' },
{ field: 'rewardShowValue', title: '奖品展示价值', align: 'center', width: '5%' },
{ field: 'rewardLevel', title: '奖品等级', align: 'center', width: '5%' },
{ field: 'rewardOrder', title: '奖品排序', align: 'center', width: '5%' },
{ field: 'createTime', title: '创建时间', align: 'center', width: '5%' },
{ field: 'updateTime', title: '更新时间', align: 'center', width: '5%' },
{
field: 'id',
title: '操作',
align: 'center',
width: '5%',
valign: 'middle',
formatter: function (val, row, index) {
return '<button class="btn btn-sm btn-success opt-edit" data-index="' + index + '">编辑</button>';
}
}
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 20,
pagination: true,
pageList: [20, 50, 100],
search: false,
sidePagination: "server", //表示服务端请求
//设置为undefined可以获取pageNumberpageSizesearchTextsortNamesortOrder
//设置为limit可以获取limit, offset, search, sort, order
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
page: params.pageNumber,
pageSize: params.pageSize,
};
return param;
},
toolbar: '#toolbar',
url: '/admin/seize-treasure/reward/page',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
});
$('#rewardPicUrlUploadBtn').on('click', function () {
$.ajaxFileUpload({
fileElementId: 'rewardPicUrlFile', //需要上传的文件域的ID即<input type="file">的ID。
url: '/admin/upload/img', //后台方法的路径
type: 'post', //当要提交自定义参数时这个参数要设置成post
dataType: 'json', //服务器返回的数据类型。可以为xml,script,json,html。如果不填写jQuery会自动判断。
secureuri: false, //是否启用安全提交默认为false。
async: true, //是否是异步
success: function (json) { //提交成功后自动执行的处理函数参数data就是服务器返回的数据。
if (json.path) {
$('#rewardPicUrl').val(json.path);
$('#rewardPicUrlImage').attr("src", json.path);
if (json.path != '') {
$("#rewardPicUrlImgInfo").html('已上传成功');
} else {
$("#rewardPicUrlImgInfo").html('未上传成功');
}
console.log(json.path);
} else {
$("#tipMsg").text(json.msg);
$("#tipModal").modal('show');
}
},
error: function (data, status, e) { //提交失败自动执行的处理函数。
console.error(e);
}
});
});
$('#btnAdd').on('click', function () {
$("#id").val('');
$("#rewardType").val('');
$("#rewardName").val('');
$('#rewardPicUrl').val('');
$('#rewardPicUrlImage').attr("src", '');
$('#rewardPicUrlImgInfo').val('');
$("#rewardNum").val('');
$("#rewardUnit").val('');
$("#rewardValue").val('');
$("#rewardShowValue").val('');
$("#rewardLevel").val('');
$("#rewardOrder").val('');
$("#editModal").modal('show');
});
$('#table').on('click', '.opt-edit', function () {
const currentData = $('#table').bootstrapTable('getData')[$(this).data('index')];
var id = currentData.id;
var rewardRefId = currentData.rewardRefId;
var rewardType = currentData.rewardType;
var rewardName = currentData.rewardName;
var rewardPicUrl = currentData.rewardPicUrl;
var rewardNum = currentData.rewardNum;
var rewardUnit = currentData.rewardUnit;
var rewardValue = currentData.rewardValue;
var rewardShowValue = currentData.rewardShowValue;
var rewardLevel = currentData.rewardLevel;
var rewardOrder = currentData.rewardOrder;
$("#id").val(id);
$("#rewardRefId").val(rewardRefId);
$("#rewardType").val(rewardType);
$("#rewardName").val(rewardName);
$('#rewardPicUrl').val(rewardPicUrl);
$('#rewardPicUrlImage').attr("src", rewardPicUrl);
$("#rewardNum").val(rewardNum);
$("#rewardUnit").val(rewardUnit);
$("#rewardValue").val(rewardValue);
$("#rewardShowValue").val(rewardShowValue);
$("#rewardLevel").val(rewardLevel);
$("#rewardOrder").val(rewardOrder);
window.getRewardRef();
$("#editModal").modal('show');
});
$("#save").click(function () {
const msg = '确定要保存吗?';
if (confirm(msg)) {
var id = $("#id").val();
var rewardType = $("#rewardType").val();
var rewardRefId = $("#rewardName").data('id');
var rewardName = $("#rewardName").data('name');
var rewardPicUrl = $('#rewardPicUrl').val();
var rewardNum = $("#rewardNum").val();
var rewardUnit = $("#rewardUnit").val();
var rewardValue = $("#rewardValue").val();
var rewardShowValue = $("#rewardShowValue").val();
var rewardLevel = $("#rewardLevel").val();
var rewardOrder = $("#rewardOrder").val();
var data = {
rewardType: rewardType,
rewardRefId: rewardRefId,
rewardName: rewardName,
rewardPicUrl: rewardPicUrl,
rewardNum: rewardNum,
rewardUnit: rewardUnit,
rewardValue: rewardValue,
rewardShowValue: rewardShowValue,
rewardLevel: rewardLevel,
rewardOrder: rewardOrder
};
if (id) {
data.id = id;
}
$.ajax({
type: "post",
url: "/admin/seize-treasure/reward/save",
data: data,
dataType: "json",
success: function (json) {
if (json.success == 'true' || json.code == 200) {
$("#tipMsg").text("保存成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
$("#editModal").modal('hide');
} else {
$("#tipMsg").text("保存失败." + json.message);
$("#tipModal").modal('show');
$("#editModal").modal('hide');
}
}
});
}
});
});
}
},
};
</script>
<style scoped></style>

View File

@@ -0,0 +1,156 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<!-- .content -->
<div id="table"></div>
<div id="toolbar">
<form id="searchForm" action="/admin/seize-treasure/user/prop/record/export" method="get"
target="_blank">
<div class="col-sm-12">
<label for="erbanNo" class="col-sm-1 control-label">Peko号:</label>
<div class="col-sm-2"><input type="text" class="form-control" name="erbanNo" id="erbanNo"></div>
<label for="startTime" class="col-sm-2 control-label">选择时间:</label>
<div class="col-sm-2"><input type="text" class="form-control" name="startTime" id="startTime">
</div>
<label for="endTime" class="col-sm-1 control-label"></label>
<div class="col-sm-2"><input type="text" class="form-control" name="endTime" id="endTime"></div>
</div>
</form>
<div class="col-sm-12">
<button id="btnSearch" class="btn btn-default">
<i class="glyphicon glyphicon-search"></i>查询
</button>
</div>
<button id="btnExport" class="btn btn-default">
<i class="glyphicon glyphicon-export"></i>导出
</button>
</div>
</div>
</div>
</section>
<div class="modal fade" id="tipModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">提示信息</h4>
</div>
<div class="modal-body" id="tipMsg"></div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "SeizeTreasureUserPropRecordView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{ field: 'erbanNo', title: '用户ID', align: 'center', width: '5%' },
{ field: 'nick', title: '用户昵称', align: 'center', width: '5%' },
{
field: 'expends',
title: '试炼素材',
align: 'center',
width: '5%',
formatter: function (val, row, index) {
var value = '';
if (val) {
for (let i = 0, len = val.length; i < len; i++) {
var expend = val[i];
value += expend.propName + '*' + expend.propNum;
if (i != len - 1) {
value += '<br/>';
}
}
}
return value;
}
},
{ field: 'propName', title: '试炼产出', align: 'center', width: '5%' },
{ field: 'createTime', title: '试炼时间', align: 'center', width: '5%' },
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 20,
pagination: true,
pageList: [20, 50, 100],
search: false,
sidePagination: "server", //表示服务端请求
//设置为undefined可以获取pageNumberpageSizesearchTextsortNamesortOrder
//设置为limit可以获取limit, offset, search, sort, order
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
page: params.pageNumber,
pageSize: params.pageSize,
erbanNo: $('#erbanNo').val(),
startTime: $('#startTime').val(),
endTime: $('#endTime').val()
};
return param;
},
toolbar: '#toolbar',
url: '/admin/seize-treasure/user/prop/record/page',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
});
$('#btnSearch').on('click', function () {
TableHelper.doRefresh('#table');
});
//导出功能
$("#btnExport").on('click', function () {
$("#searchForm").submit();
});
var picker1 = $("#startTime").datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
todayBtn: true,
autoclose: true,
});
var picker2 = $("#endTime").datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
todayBtn: true,
autoclose: true
});
picker1.on('changeDate', function () {
var date = $('#startTime').datepicker('getDate');
picker2.datepicker('setStartDate', date);
});
picker2.on('changeDate', function () {
var date = $('#endTime').datepicker('getDate');
picker1.datepicker('setEndDate', date);
});
});
}
},
};
</script>
<style scoped></style>

View File

@@ -0,0 +1,428 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<!-- .content -->
<div id="toolbar" class="clearfix">
<div class="col-sm-12">
<form id="searchForm" action="/admin/withdraw/block/export" method="get" target="_blank">
<label for="erbanNoList" class="col-sm-1 control-label">平台号:</label>
<div class="col-sm-2"><input type="text" class="form-control" name="erbanNoList"
id="erbanNoList"></div>
<label for="status" class="col-sm-1 control-label">状态:</label>
<div class="col-sm-2">
<select name="status" id="status" data-btn-class="btn-warning" class="form-control">
<option value="" selected="selected">全部</option>
<option value="1">已添加</option>
<option value="2">已移除</option>
</select>
</div>
<label for="startDate" class="col-sm-1 control-label">开始时间:</label>
<div class="col-sm-2"><input type="text" class="form-control" name="startDate" id="startDate">
</div>
<label for="endDate" class="col-sm-1 control-label">结束时间:</label>
<div class="col-sm-2"><input type="text" class="form-control" name="endDate" id="endDate"></div>
</form>
</div>
<div class="col-sm-12">
<button id="btnSearch" class="btn btn-default">
<i class="glyphicon glyphicon-search"></i>查询
</button>
<!-- <button id="btnImport" class="btn btn-default">
<i class="glyphicon glyphicon-import"></i>导入
</button> -->
<button id="btnExport" class="btn btn-default">
<i class="glyphicon glyphicon-export"></i>导出
</button>
<button class="btn btn-default batchBtn" data-batch="2">批量移除</button>
<button class="btn btn-default batchBtn" data-batch="1">批量恢复</button>
<button id="btnAddBlackList" class="btn btn-default">
<i class="glyphicon glyphicon-plus"></i>新增黑名单
</button>
</div>
</div>
<div id="table"></div>
</div>
</div>
</section>
<div class="modal fade" id="blackListModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="modalLabel">新增黑名单</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" id="applyForm">
<div class="form-group">
<label for="blackListErbanNo" class="col-sm-2 control-label">平台号</label>
<div class="col-sm-10">
<!-- <input type="text" class="form-control validate[required]" name="blackListErbanNo" id="blackListErbanNo"> -->
<textarea class="form-control validate[required]" id="blackListErbanNo" rows="4"
placeholder="多个平台号请用 , 隔开"></textarea>
</div>
</div>
<div class="form-group">
<label for="blackListRemark" class="col-sm-2 control-label">备注</label>
<div class="col-sm-10">
<textarea class="form-control" name="blackListRemark" id="blackListRemark"
rows="3"></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label"></label>
<div class="col-sm-10">
<div class="form-control" style="color: red; border-color: transparent;">
<p>已添加黑名单的平台号请直接搜索平台号进行更改</p>
</div>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="blackListApply">提交</button>
</div>
</div>
</div>
</div>
<!-- <div class="modal fade" id="importModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="modalLabel">导入黑名单</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" id="importForm">
<div class="form-group">
<label for="blackListFile" class="col-sm-2 control-label">上传文件</label>
<div class="col-sm-10">
<input type="file" accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel" class="form-control validate[required]" name="blackListFile" id="blackListFile">
</div>
</div>
<div class="form-group">
<label for="blackListFile" class="col-sm-2 control-label">上传文件</label>
<div class="col-sm-10">
<input type="file" accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel" class="form-control validate[required]" name="blackListFile" id="blackListFile">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">注意</label>
<div class="col-sm-10">
<div class="form-control" style="color: red; border-color: transparent;">
<div>每次导入最多支持500条数据</div>
</div>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="submitImport">提交</button>
</div>
</div>
</div>
</div> -->
<div class="modal fade" id="tipModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">提示信息</h4>
</div>
<div class="modal-body" id="tipMsg"></div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "BackListAdminView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
function blackModify(uids, status) {
$.ajax({
type: 'post',
dataType: 'json',
url: '/admin/withdraw/block/modify',
data: {
uids: uids,
status: status
},
success: function (json) {
isLoading = false;
if (json.code == 200) {
$("#tipMsg").text('操作成功!');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text('操作失败!');
}
$tipModal.modal('show');
},
error: function () {
isLoading = false;
}
});
}
var isLoading = false; // 是否请求接口中
var $table = $('#table');
var $blackListModal = $('#blackListModal');
var $form = $('#applyForm');
var $tipModal = $("#tipModal");
$table.bootstrapTable('destroy');
$table.bootstrapTable({
columns: [
//{field: 'recordId', title: 'id', align: 'center', width: '5%'},
{ field: 'id', title: '序号', align: 'center', checkbox: true, width: '5%' },
{ field: 'erbanNo', title: '平台号', align: 'center', width: '5%' },
{ field: 'remark', title: '备注', align: 'center', width: '5%' },
{
field: 'createTime',
title: '创建时间',
align: 'center',
width: '5%',
formatter: function (val, row, index) {
return new Date(val).format('yyyy-MM-dd hh:mm:ss')
}
},
{
field: 'updateTime',
title: '修改时间',
align: 'center',
width: '5%',
formatter: function (val, row, index) {
return new Date(val).format('yyyy-MM-dd hh:mm:ss')
}
},
{
field: 'status',
title: '状态',
align: 'center',
width: '5%',
formatter: function (val, row, index) {
var text = val == 1 ? '已添加' : '已移除';
return text;
}
},
{
field: 'status',
title: '操作',
align: 'center',
width: '5%',
formatter: function (val, row, index) {
var text = val == 1 ? '移除' : '恢复';
var className = val == 1 ? 'btn-danger' : 'btn-success';
return '<button class="btn btn-sm ' + className + ' opt-handle" data-index=' + index + '>' +
text +
'</button>';
}
}
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 20,
pagination: true,
pageList: [20, 50, 100, 200, 300, 500],
search: false,
sidePagination: "server", //表示服务端请求
//设置为undefined可以获取pageNumberpageSizesearchTextsortNamesortOrder
//设置为limit可以获取limit, offset, search, sort, order
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageNumber: params.pageNumber,
pageSize: params.pageSize,
erbanNoList: $('#erbanNoList').val(),
status: $('#status').val(),
startDate: $('#startDate').val(),
endDate: $('#endDate').val()
};
return param;
},
toolbar: '#toolbar',
url: '/admin/withdraw/block/list',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
isLoading = false;
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
isLoading = false;
}
});
// 开启验证
$form.validationEngine();
var picker1 = $("#startDate").datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
todayBtn: true,
autoclose: true,
});
var picker2 = $("#endDate").datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
todayBtn: true,
autoclose: true
});
picker1.on('changeDate', function () {
var date = $('#startDate').datetimepicker('getDate');
picker2.datetimepicker('setstartDate', date);
});
picker2.on('changeDate', function () {
var date = $('#endDate').datetimepicker('getDate');
picker1.datetimepicker('setendDate', date);
});
// 查询
$('#btnSearch').on('click', function () {
if (isLoading) {
return;
}
isLoading = true;
TableHelper.doRefresh('#table');
});
// 导入
// $('#btnImport').on('click', function () {
// $('#importForm')[0].reset();
// $('#importForm').validationEngine('hideAll');
// $('#importModal').modal('show');
// });
// $('#submitImport').on('click', function () {
// if ($('#importForm').validationEngine('validate')) {
// if (isLoading) {
// return;
// }
// isLoading = true;
// console.log('select')
// return;
// var options = {
// type: 'post',
// url: '',
// dataType: 'json',
// success: function (json) {
// isLoading = false;
// if (json.code == 200) {
// $('#importModal').modal('hide');
// $("#tipMsg").text('导入成功');
// TableHelper.doRefresh("#table");
// } else {
// $("#tipMsg").text('导入失败:' + json.message);
// }
// $tipModal.modal('show');
// },
// error: function () {
// isLoading = false;
// }
// }
// $('#importForm').ajaxSubmit(options);
// }
// });
//导出
$("#btnExport").on('click', function () {
$("#searchForm").submit();
});
// 批量操作
$('.batchBtn').on('click', function () {
var rows = $table.bootstrapTable('getSelections');
var status = $(this).data('batch');
var text = status == '1' ? '恢复' : '移除';
if (rows.length) {
if (confirm('你确认要批量' + text + '吗?')) {
var ids = [];
for (var i = 0; i < rows.length; i++) {
ids.push(rows[i].uid);
}
blackModify(ids.join(','), status);
}
} else {
alert('请先选择要' + text + '的用户!');
}
});
// 新增黑名单
$('#btnAddBlackList').on('click', function () {
$form[0].reset();
$form.validationEngine('hideAll');
$blackListModal.modal('show');
});
// 提交新增
$('#blackListApply').on('click', function () {
if ($form.validationEngine('validate')) {
if (isLoading) {
return;
}
isLoading = true;
$.ajax({
type: 'post',
url: '/admin/withdraw/block/add',
data: {
erbanNoList: $.trim($('#blackListErbanNo').val()),
remark: $('#blackListRemark').val()
},
dataType: 'json',
success: function (json) {
isLoading = false;
if (json.code === 200) {
$blackListModal.modal('hide');
$("#tipMsg").text("添加成功!");
// $tipModal.modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text('添加失败:' + json.message);
}
$tipModal.modal('show');
},
error: function () {
isLoading = false;
}
});
}
});
// table操作
$table.on('click', '.opt-handle', function () {
if (isLoading) {
return;
}
isLoading = true;
var currentData = $table.bootstrapTable('getData')[$(this).data('index')];
var text = currentData.status == 1 ? '移除' : '恢复';
var status = currentData.status == 1 ? 2 : 1;
if (confirm('你确认要' + text + '该用户吗?')) {
blackModify(currentData.uid, status);
} else {
isLoading = false;
}
});
});
}
},
};
</script>
<style scoped>.bootstrap-table .bars {
width: 100%;
}</style>

View File

@@ -0,0 +1,221 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<section class="content-body">
<form id="form" action="" method="post" target="_blank">
<input type="hidden" id="exportErbanNo" name="erbanNo">
<input type="hidden" id="exportBillType" name="billType">
<input type="hidden" id="exportStartTime" name="startDate">
<input type="hidden" id="exportEndTime" name="endDate">
</form>
<div id="toolbar">
<form class="form-inline">
<div class="form-group">
<label for="erbanNo">平台号</label>
<input type="text" class="form-control" name="erbanNo" id="erbanNo">
</div>
<div class="form-group">
<label for="billType">账单类型</label>
<select class="form-control" name="billType" id="billType"></select>
</div>
<div class="form-group">
<label for="startDate">开始时间</label>
<input type="text" class="form-control" name="startDate" id="startDate">
</div>
<div class="form-group">
<label for="endDate">结束时间</label>
<input type="text" class="form-control" name="endDate" id="endDate">
</div>
</form>
<div class="btn-group">
<button id="btnSearch" type="button" class="btn btn-default">查询</button>
<button id="btnExport" type="button" class="btn btn-default">导出</button>
</div>
</div>
<div id="table"></div>
</section>
</div>
</div>
</section>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "BillRecordAdminView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
// 所有账单类型
getObjTypes();
const now = new Date()
var picker1 = $("#startDate").datetimepicker({
format: "yyyy-mm-dd hh:ii:ss",
autoclose: true
})
picker1.datetimepicker("setDate", new Date(new Date(now.toLocaleDateString()).getTime()))
var picker2 = $('#endDate').datetimepicker({
format: "yyyy-mm-dd hh:ii:ss",
autoclose: true
})
picker2.datetimepicker("setDate", now)
picker1.on('changeDate', function () {
var date = $('#startDate').datetimepicker('getDate');
picker2.datetimepicker('setStartDate', date);
});
picker2.on('changeDate', function () {
var date = $('#endDate').datetimepicker('getDate');
picker1.datetimepicker('setEndDate', date);
});
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{ field: 'nick', title: '查询用户昵称', align: 'center', valign: 'middle', width: '10%' },
{ field: 'erbanNo', title: '查询用户平台号', align: 'center', valign: 'middle', width: '10%' },
{ field: 'targetNick', title: '对应对象昵称', align: 'center', valign: 'middle', width: '10%' },
{ field: 'targetErbanNo', title: '对应对象平台号', align: 'center', valign: 'middle', width: '10%' },
{ field: 'roomNick', title: '消费地点房主昵称', align: 'center', valign: 'middle', width: '10%' },
{ field: 'roomErbanNo', title: '房主平台号', align: 'center', valign: 'middle', width: '10%' },
{ field: 'giftName', title: '礼物名称', align: 'center', valign: 'middle', width: '5%' },
{ field: 'giftNum', title: '礼物数量', align: 'center', valign: 'middle', width: '5%' },
{ field: 'amount', title: '钻石/水晶/金币', align: 'center', valign: 'middle', width: '5%' },
{ field: 'country', title: '国家/地区', align: 'center', valign: 'middle', width: '5%' },
{ field: 'localCurrencyCode', title: '本地货币数', align: 'center', valign: 'middle', width: '5%' },
{ field: 'localAmount', title: '货币数', align: 'center', valign: 'middle', width: '5%' },
{ field: 'currencyDesc', title: '交易币种', align: 'center', valign: 'middle', width: '5%' },
{ field: 'billTypeDesc', title: '账单类型', align: 'center', valign: 'middle', width: '10%' },
{ field: 'objTypeDesc', title: '业务类型', align: 'center', valign: 'middle', width: '10%' },
{
field: 'createTime', title: '创建时间', align: 'center', valign: 'middle', width: '10%', formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format("yyyy-MM-dd hh:mm:ss");
} else {
return '-';
}
}
}
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pagination: true,
pageList: [10, 20, 30, 50],
sidePagination: "server", //表示服务端请求
//设置为undefined可以获取pageNumberpageSizesearchTextsortNamesortOrder
//设置为limit可以获取limit, offset, search, sort, order
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
return {
pageSize: params.pageSize,
pageNumber: params.pageNumber,
erbanNo: $('#erbanNo').val(),
billType: $('#billType').val(),
startDate: $('#startDate').val(),
endDate: $('#endDate').val()
};
},
uniqueId: 'erbanNo',
toolbar: '#toolbar',
url: '/admin/billRecordCheck/getList.action',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
})
$('#btnSearch').on('click', function () {
if (!$('#startDate').val() || !$('#endDate').val()) {
$("#tipMsg").text("请输入必填的信息");
$("#tipModal").modal('show');
return;
}
if ($('#startDate').val() && $('#endDate').val()) {
var dateStart = new Date($('#startDate').val().replace(/\-/g, "/"));
var dateEnd = new Date($('#endDate').val().replace(/\-/g, "/"));
var diffDays = parseInt((dateEnd.getTime() - dateStart.getTime()) / parseInt(1000 * 3600 * 24));
console.log(diffDays);
if (diffDays > 120) {
$("#tipMsg").text("开始时间与结束时间跨度不能超过3个月");
$("#tipModal").modal('show');
return;
}
}
TableHelper.doRefresh('#table');
})
// 导出excel
$('#btnExport').on('click', function () {
/*if(!$('#erbanNo').val() || !$('#startDate').val() || !$('#endDate').val()){
$("#tipMsg").text("请输入必填的信息");
$("#tipModal").modal('show');
return;
}*/
var dateStart = new Date($('#startDate').val().replace(/\-/g, "/"));
var dateEnd = new Date($('#endDate').val().replace(/\-/g, "/"));
var diffDays = parseInt((dateEnd.getTime() - dateStart.getTime()) / parseInt(1000 * 3600 * 24));
console.log(diffDays);
if (diffDays > 120) {
$("#tipMsg").text("开始时间与结束时间跨度不能超过3个月");
$("#tipModal").modal('show');
return;
}
var form = $("#form");
form.attr("action", "/admin/billRecordCheck/exportList.action");
$('#exportErbanNo').val($('#erbanNo').val());
$('#exportBillType').val($('#billType').val());
$('#exportStartTime').val($('#startDate').val());
$('#exportEndTime').val($('#endDate').val());
form.submit();
})
}
},
};
// 通过接口获取所有账单类型
function getObjTypes() {
$.ajax({
url: "/admin/billRecordCheck/objTypeList.action",
type: 'GET',
async: false,
datatype: 'json',
success: function (res) {
if (res) {
var data = res.data;
var options = [];
options.push('<option value="">全部</option>')
for (var i = 0, len = data.length; i < len; i++) {
var item = data[i];
//拼接成多个<option><option/>
options.push('<option value="' + item.value + '">' + item.desc + '</option>')
}
$("#billType").html(options.join(' ')); //填充到select标签中
}
},
error: function () {
alert('查询类型出错');
}
});
}
</script>
<style scoped></style>

View File

@@ -0,0 +1,161 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<section class="content-body">
<div id="toolbar">
<form class="form-inline">
<div class="form-group">
<label for="erbanNo">平台号</label>
<input type="text" class="form-control" name="erbanNo" id="erbanNo">
</div>
<div class="form-group">
<label for="billType">账单类型</label>
<select class="form-control" name="billType" id="billType"></select>
</div>
<div class="form-group">
<label for="startDate">开始时间</label>
<input type="text" class="form-control" name="startDate" id="startDate">
</div>
<div class="form-group">
<label for="endDate">结束时间</label>
<input type="text" class="form-control" name="endDate" id="endDate">
</div>
</form>
<div class="btn-group">
<button id="btnSearch" type="button" class="btn btn-default">查询</button>
<button id="btnExport" type="button" class="btn btn-default">导出</button>
</div>
</div>
<div id="table"></div>
</section>
</div>
</div>
</section>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "BillRecordGroupView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{ field: 'nick', title: '用户昵称', align: 'center', valign: 'middle', width: '10%' },
{ field: 'erbanNo', title: '用户平台号', align: 'center', valign: 'middle', width: '10%' },
{ field: 'totalAmount', title: '总价值', align: 'center', valign: 'middle', width: '5%' },
{ field: 'objType', title: '账单类型id', align: 'center', valign: 'middle', width: '10%' },
{ field: 'objTypeDesc', title: '账单类型描述', align: 'center', valign: 'middle', width: '10%' }
],
cache: false,
striped: true,
showRefresh: false,
sidePagination: "server", //表示服务端请求
//设置为undefined可以获取pageNumberpageSizesearchTextsortNamesortOrder
//设置为limit可以获取limit, offset, search, sort, order
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
return {
erbanNo: $('#erbanNo').val(),
startDate: $('#startDate').val(),
endDate: $('#endDate').val(),
billType: $('#billType').val()
};
},
uniqueId: 'erbanNo',
toolbar: '#toolbar',
url: '/admin/billRecordCheck/listGroup.action',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
})
$('#btnSearch').on('click', function () {
if (!$('#erbanNo').val() || !$('#startDate').val() || !$('#endDate').val()) {
$("#tipMsg").text("请输入必填的信息");
$("#tipModal").modal('show');
return;
}
var dateStart = new Date($('#startDate').val().replace(/\-/g, "/"));
var dateEnd = new Date($('#endDate').val().replace(/\-/g, "/"));
var diffDays = parseInt((dateEnd.getTime() - dateStart.getTime()) / parseInt(1000 * 3600 * 24));
console.log(diffDays);
if (diffDays > 120) {
$("#tipMsg").text("开始时间与结束时间跨度不能超过3个月");
$("#tipModal").modal('show');
return;
}
TableHelper.doRefresh('#table');
})
var picker1 = $("#startDate").datetimepicker({
format: 'yyyy-mm-dd hh:ii:ss',
autoclose: true
})
var picker2 = $('#endDate').datetimepicker({
format: 'yyyy-mm-dd hh:ii:ss',
autoclose: true
})
picker1.on('changeDate', function () {
var date = $('#startDate').datetimepicker('getDate');
picker2.datetimepicker('setStartDate', date);
});
picker2.on('changeDate', function () {
var date = $('#endDate').datetimepicker('getDate');
picker1.datetimepicker('setEndDate', date);
});
$(function () {
setSelectOption("billType");
})
}
},
};
function setSelectOption(id) {
$.ajax({
type: "get",
dataType: "json",
url: '/admin/billRecordCheck/objTypeList.action',
success: function (json) {
if (json.data) {
var data = json.data;
var options = [];
options.push('<option value="">全部</option>')
for (var i = 0, len = data.length; i < len; i++) {
var item = data[i];
//拼接成多个<option><option/>
options.push('<option value="' + item.value + '">' + item.desc + '</option>')
}
$('#' + id).html(options.join(' '));
}
}
})
}
</script>
<style scoped>
#erbanNo,
#billType,
#startDate,
#endDate {
margin-right: 4px;
}
</style>

View File

@@ -0,0 +1,536 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<section class="content">
<div id="table"></div>
<div id="toolbar">
封禁类型<select id="blockTypeSearch" name="blockType" class="input-sm">
<option value="0">全部</option>
<option value="1">平台号</option>
<option value="2">手机号</option>
<option value="3">设备号</option>
<option value="4">IP地址</option>
</select>
搜索内容<input type="text" class="input-sm" name="blockValue" id="blockValueSearch"
placeholder="平台号、手机号、设备号、IP地址">
<button id="btnSearch" class="btn btn-default">
<i class="glyphicon glyphicon-search"></i>搜索
</button>
<button id="add" class="btn btn-default">
<i class="glyphicon glyphicon-plus"></i>增加
</button>
</div>
</section>
</div>
</div>
</section>
<div class="modal fade" id="addAccountBlocked" tabindex="-1" role="dialog" aria-labelledby="modalLabel2">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">x</span></button>
<h4 class="modal-title" id="addModalLabel">新增封禁账户</h4>
</div>
<div class="modal-body">
<form id="addBlockForm" class="form-horizontal">
<div class="form-group">
<label for="blockType" class="col-sm-3 control-label">封禁类型</label>
<div class="col-sm-8">
<select name="blockTypeList" id="blockType" class="col-sm-4">
<option value="1">封禁平台号</option>
<option value="2">封禁手机号</option>
<option value="3">封禁设备</option>
<option value="4">封禁ip</option>
</select>
</div>
</div>
<div class="form-group">
<label for="blockValue" class="col-sm-3 control-label">封禁号码</label>
<div class="col-sm-8">
<input type="text" class="form-control validate[required]" name="blockValue" id="blockValue"
placeholder='多个号码请用,隔开'>
</div>
</div>
<div class="form-group">
<label for="blockDesc" class="col-sm-3 control-label">封禁原因</label>
<div class="col-sm-8">
<input type="text" class="form-control validate[required]" name="blockDesc" id="blockDesc">
</div>
</div>
<div class="form-group">
<label for="wallStatus" class="col-sm-3 control-label">是否上墙</label>
<div class="col-sm-8">
<select name="wallStatus" id="wallStatus" class="col-sm-4">
<option value="1">上墙</option>
<option value="0">不上墙</option>
</select>
</div>
</div>
</form>
<form class="form-horizontal">
<div class="form-group">
<label for="addStartDate" class="col-sm-3 control-label">起始时间</label>
<div class="col-sm-8">
<input id="addStartDate" type="date" name="startTime" disabled="disabled"
class="form-control validate[required]">
</div>
</div>
<div class="form-group">
<label for="addEndDate" class="col-sm-3 control-label">结束时间</label>
<div class="col-sm-8">
<input id="addEndDate" type="date" name="endTime"
class="form-control validate[required]">
</div>
</div>
<div class="form-group">
<label for="remark" class="col-sm-3 control-label">备注</label>
<div class="col-sm-8">
<input type="text" class="form-control validate[required]" name="remark" id="remark">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-primary" id="addSave">封禁</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="editModel" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">x</span></button>
<h4 class="modal-title" id="modalLabel"> 修改封禁信息</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" id="updateBlock">
<input type="hidden" name="row" id="rowId" />
<div class="form-group">
<label for="updateReason" class="col-sm-3 control-label">封禁原因:</label>
<div class="col-sm-8">
<input type="text" id="updateReason" name="updateReason" class="form-control">
</div>
</div>
<div class="form-group">
<label for="blockStatus1" class="col-sm-3 control-label">封禁状态:</label>
<div class="col-sm-8">
<select name="blockStatus1" id="blockStatus1" class="col-sm-4">
<option value="1">封禁中</option>
<option value="2">封禁结束</option>
</select>
</div>
</div>
<div class="form-group">
<label for="wallStatus1" class="col-sm-3 control-label">是否上墙</label>
<div class="col-sm-8">
<select name="wallStatus1" id="wallStatus1" class="col-sm-4">
<option value="1">上墙</option>
<option value="0">不上墙</option>
</select>
</div>
</div>
<form class="form-horizontal" id="updateFormTime">
<div class="form-group">
<label for="startDate" class="col-sm-3 control-label">起始时间:</label>
<div class="col-sm-8">
<input type="text" id="startDate" name="startValidTime" disabled="disabled"
class="form-control">
</div>
</div>
<div class="form-group">
<label for="endDate" class="col-sm-3 control-label">结束时间:</label>
<div class="col-sm-8">
<input type="text" id="endDate" name="endValidTime" class="form-control">
</div>
</div>
<div class="form-group">
<label for="remark1" class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<input type="text" id="remark1" name="remark1" class="form-control">
</div>
</div>
</form>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="saveUpdate">保存</button>
</div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "BlockedAdminView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
/*初始化*/
var picker3 = $('#addEndDate').datetimepicker({
format: 'yyyy-mm-dd hh:ii',
autoclose: true,
startDate: new Date()
})
var picker2 = $('#endDate').datetimepicker({
format: 'yyyy-mm-dd hh:ii',
autoclose: true,
startDate: new Date()
})
$(function () {//默认时间
var todayDate = new Date();
var minute = todayDate.getMinutes() < 10 ? "0" + todayDate.getMinutes() : todayDate.getMinutes();
var month = (todayDate.getMonth() + 1) < 10 ? "0" + (todayDate.getMonth() + 1) : (todayDate.getMonth() + 1);
var todayDateStr = todayDate.getFullYear() + "-" + month + "-" + todayDate.getDate() + " " + todayDate.getHours() + ":" + minute;
$("#addStartDate").val(todayDateStr);
$("#startDate").val(todayDateStr);
})
$(function () {
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{ field: 'blockValue', title: 'id', align: 'center', valign: 'middle', width: '0%' },
{
field: 'blockType',
title: '封禁类型',
align: 'center',
width: '10%',
valign: 'middle',
formatter: function (val, row, index) {
switch (val) {
case 1:
return '封禁平台号';
case 2:
return '封禁手机号';
case 3:
return "封禁设备";
case 4:
return "封禁IP";
}
}
},
{
field: 'blockStartTime',
title: '封禁开始时间',
align: 'center',
width: '10%',
valign: 'middle',
// formatter: function (val, row, index) {
// if (val) {
// var date = new Date(val);
// return date.format("yyyy-MM-dd hh:mm");
// } else {
// return '-';
// }
// }
},
{
field: 'blockEndTime',
title: '封禁结束时间',
align: 'center',
width: '10%',
valign: 'middle',
// formatter: function (val, row, index) {
// if (val) {
// var date = new Date(val);
// return date.format("yyyy-MM-dd hh:mm");
// } else {
// return '-';
// }
//
// }
},
{
field: 'blockStatus',
title: '封禁状态',
align: 'center',
width: '10%',
valign: 'middle',
formatter: function (val, row, index) {
switch (val) {
case 1:
return '封禁中';
case 2:
return '封禁结束';
}
}
},
{
field: 'wallStatus',
title: '是否上墙',
align: 'center',
width: '10%',
valign: 'middle',
formatter: function (val, row, index) {
if (val == true) {
return '上墙';
} else {
return '不上墙';
}
}
},
{ field: 'blockDesc', title: '封禁原因', align: 'center', width: '10%', valign: 'middle' },
{ field: 'adminName', title: '管理员', align: 'center', width: '10%', valign: 'middle' },
{
field: 'createTime',
title: '创建时间',
align: 'center',
width: '10%',
valign: 'middle',
// formatter: function (val, row, index) {
// if (val) {
// var date = new Date(val);
// return date.format("yyyy-MM-dd hh:mm");
// } else {
// return '-';
// }
// }
},
{
field: 'tmp',
title: '操作',
align: 'center',
width: '10%',
valign: 'middle',
formatter: function (val, row, index) {
var key = row.blockValue;
if (row.blockStatus == 1) {
return "<button class='btn btn-sm btn-success opt-release' data-id=" + key + ">解封</button>&nbsp;&nbsp;" +
"<button class='btn btn-sm btn-success opt-edit' data-id=" + key + " >编辑</button>";
} else {
return "<button class='btn btn-sm btn-success opt-edit' data-id=" + key + " >编辑</button>";
}
}
},
{ field: 'remark', title: '备注', align: 'center', width: '10%', valign: 'middle' }
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pagination: true,
pageList: [10, 20, 30, 50],
sidePagination: "server", //表示服务端请求
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageSize: params.pageSize,
pageNum: params.pageNumber,
type: $('#blockTypeSearch').val(),
blockValue: $('#blockValueSearch').val()
};
return param;
},
uniqueId: 'code',
toolbar: '#toolbar',
url: '/admin/block/list.action',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
})
})
/*查询刷新*/
$('#btnSearch').on('click', function () {
TableHelper.doRefresh('#table');
})
/*保存*/
$('#addSave').on('click', function () {
if ($('#addBlockForm').validationEngine('validate')) {
$("#tipMsg").text("正在封禁,请稍后");
$("#tipModal").modal('show');
$.ajax({
type: "post",
url: "/admin/block/save.action",
data: {
blockValue: $("#blockValue").val(),
blockDesc: $("#blockDesc").val(),
blockType: $("#blockType").val(),
blockStartTime: $('#addStartDate').val(),
blockEndTime: $('#addEndDate').val(),
wallStatus: $('#wallStatus').val(),
remark: $('#remark').val()
},
dataType: 'json',
success: function (json) {
if (json.data) {
$('#addAccountBlocked').modal('hide');
$("#tipMsg").text("保存成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("保存失败,错误码:" + json.message);
$("#tipModal").modal('show');
}
}
})
}
})
//增加
$('#add').on('click', function () {
$('#addBlockForm')[0].reset();
$('#addAccountBlocked').modal('show');
})
//解封
$('#table').on('click', '.opt-release', function () {
var key = $(this).data('id');
$.ajax({
type: 'post',
url: '/admin/block/delete.action',
data: { blockValue: key },
dataType: 'json',
success: function (json) {
if (json.data) {
$("#tipMsg").text("解封成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("解封失败,错误信息:" + json.message);
$("#tipModal").modal('show');
}
}
})
})
//编辑
$('#table').on('click', '.opt-edit', function () {
// var key = parseInt($(this).data('id'));
var key = $(this).data('id');
// 打开编辑弹窗
$('#addBlockForm')[0].reset();
$("#rowId").val(key);
$.ajax({
type: 'get',
url: '/admin/block/get.action',
data: { blockValue: key },
dataType: 'json',
success: function (res) {
if (res.data) {
// var endDay = res.data.endBlockTime;
// var time = endDay.format("yyyy-MM-dd hh:mm");
$("#updateReason").val(res.data.blockDesc);
// $("#endDate").val(res.data.endBlockTime);
$("#endDate").val(res.data.blockEndTime);
$("#blockStatus1").val(res.data.blockStatus);
$("#remark1").val(res.data.remark);
if (res.data.wallStatus == true) {
$("#wallStatus1").val(1);
} else {
$("#wallStatus1").val(0);
}
$("#editModel").modal('show');
}
}
})
})
//编辑弹窗保存
$("#saveUpdate").click(function () {
$.ajax({
type: 'post',
url: '/admin/block/update.action',
data: {
blockValue: $("#rowId").val(),
blockStatus: $("#blockStatus1").val(),
wallStatus: $("#wallStatus1").val(),
blockStartTime: $('#startDate').val(),
blockEndTime: $('#endDate').val(),
blockDesc: $('#updateReason').val(),
remark: $('#remark1').val()
},
dataType: 'json',
success: function (json) {
if (json.data) {
$("#editModel").modal('hide');
$("#tipMsg").text("修改成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("修改失败,错误码:" + json.message);
$("#tipModal").modal('show');
}
}
})
})
}
},
};
</script>
<style scoped>
.bar1,
.bar2 {
margin-bottom: 10px;
}
label.col-sm-1 {
padding: 0;
line-height: 30px;
text-align: right;
/*padding-right: 4px;*/
}
label.col-sm-1 {
padding: 0;
line-height: 30px;
text-align: right;
/*padding-right: 4px;*/
}
input,
select {
margin-left: 8px;
margin-right: 8px;
}
#btnSearch {
margin-left: 36px;
}
.record {
margin-top: 10px;
}
.record .title {
font-size: 16px;
}</style>

View File

@@ -0,0 +1,139 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<section class="content-body">
<div id="toolbar">
<div class="col-sm-12">
<div class="pull-left">
<form id="searchForm" class="col-sm-pull-12"
action="/admin/chargeRecord/exportCountryDetail" method="get" target="_blank">
<div class="col-sm-11">
<label for="beginDate" class="col-sm-2 control-label">开始日期:</label>
<div class="col-sm-4"><input type="text" class="form-control" name="beginDate"
id="beginDate" placeholder="必填"></div>
<label for="endDate" class="col-sm-2 control-label">结束日期:</label>
<div class="col-sm-4"><input type="text" class="form-control" name="endDate"
id="endDate" placeholder="必填"></div>
</div>
</form>
</div>
<div class="pull-right">
<button id="btnSearch" class="btn btn-default">
<i class="glyphicon glyphicon-search"></i>查询
</button>
<button id="btnExport" class="btn btn-default">
<i class="glyphicon glyphicon-export"></i>导出
</button>
</div>
</div>
</div>
<!-- .content -->
<div id="table"></div>
</section>
</div>
</div>
</section>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "ChargeRecordCountryStatisticsView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
var chargeStart = $('#beginDate').datepicker({
format: 'yyyy-mm-dd',
autoclose: true
});
chargeStart.datepicker("setDate", new Date(new Date() - 7 * 24 * 60 * 60 * 1000))
var chargeEnd = $('#endDate').datepicker({
format: 'yyyy-mm-dd',
autoclose: true
});
chargeEnd.datepicker("setDate", new Date())
chargeStart.on('changeDate', function () {
var date = $('#beginDate').datepicker('getDate');
chargeEnd.datepicker('setStartDate', date);
});
chargeEnd.on('changeDate', function () {
var date = $('#endDate').datepicker('getDate');
chargeStart.datepicker('setEndDate', date);
});
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{ field: 'country', title: '国家/地区', align: 'center', width: '25%' },
{ field: 'googleGold', title: 'google充值钻石', align: 'center', width: '25%' },
{ field: 'payermaxGold', title: 'payermax充值钻石', align: 'center', width: '25%' },
{ field: 'iosGold', title: 'ios充值钻石', align: 'center', width: '25%' },
{ field: 'totalGold', title: '总充值钻石', align: 'center', width: '25%' },
],
cache: false,
striped: true,
showRefresh: false,
pagination: false,
search: false,
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
beginDate: $('#beginDate').val(),
endDate: $('#endDate').val()
};
return param;
},
toolbar: '#toolbar',
url: '/admin/chargeRecord/countryDetail',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
});
// 导出EXCEL
$('#btnExport').on('click', function () {
if (!$('#beginDate').val() || !$('#endDate').val()) {
$("#tipMsg").text("请输入必填的信息");
$("#tipModal").modal('show');
return;
}
$("#searchForm").submit();
});
// 查询刷新
$('#btnSearch').on('click', function () {
if (!$('#beginDate').val() || !$('#endDate').val()) {
$("#tipMsg").text("请输入必填的信息");
$("#tipModal").modal('show');
return;
}
TableHelper.doRefresh('#table');
});
});
}
},
};
</script>
<style scoped></style>

View File

@@ -0,0 +1,209 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<div id="toolbar">
<form class="col-sm-12" id="searchForm" action="/admin/chargeRecord/dailyexport" method="get"
target="_blank">
</form>
<div class="col-sm-12 pull-left">
<h4>
今日充值数据<span class="totalAmount" style="color: red">0</span>总金额/
<span class="totalCount" style="color: red">0</span>总笔数
<span style="color: red">(单位美元)</span>
</h4>
</div>
<!-- <div class="col-sm-3 pull-right">
<button id="btnSearch" class="btn btn-default">
<i class="glyphicon glyphicon-search"></i>查询
</button>
<button id="btnExport" class="btn btn-default">
<i class="glyphicon glyphicon-export"></i>导出
</button>
</div>-->
</div>
<!-- .content -->
<div id="table"></div>
</div>
</div>
</section>
<div class="modal fade" id="recordDetail" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="modalLabel"></h4>
</div>
<div class="modal-body">
<div id="detailtable"></div>
</div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "ChargeRecordDailyStatisticsView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{ field: 'timeStr', title: '日期', align: 'center', width: '5%' },
/*{field: 'wxAmount', title: '微信支付', align: 'center', width: '5%'},
{field: 'wxWapAmount', title: '微信H5支付', align: 'center', width: '5%'},
{field: 'wxPubAmount', title: '微信公众号', align: 'center', width: '5%'},
{field: 'wxMicroMallPubAmount', title: '微商城公众号', align: 'center', width: '5%'},
{field: 'wxPub2Amount', title: '平台公众号', align: 'center', width: '5%'},
{field: 'wxPub2H5Amount', title: '平台公众号H5支付', align: 'center', width: '5%'},
{field: 'alipayAmount', title: '支付宝', align: 'center', width: '5%'},
{field: 'alipayWapAmount', title: '支付宝H5', align: 'center', width: '5%'},
{field: 'iosPayAmount', title: 'IOS支付', align: 'center', width: '5%'},
{field: 'wxMiniAppAmount', title: '小程序支付', align: 'center', width: '5%'},*/
{ field: 'googleAmount', title: 'google支付', align: 'center', width: '5%' },
{ field: 'payermaxAmount', title: 'payermax支付', align: 'center', width: '5%' },
{ field: 'iosPayAmount', title: 'ios支付', align: 'center', width: '5%' },
{ field: 'companyAccount', title: '充值打公账', align: 'center', width: '5%' },
{
field: 'time',
title: '操作',
align: 'center',
width: '5%',
formatter: function (val, row, index) {
return '<button id="btnDetail" name="btnDetail" class="btn btn-sm btn-success opt-detail" data-id=' + val + '>' +
'<i class="glyphicon glyphicon-edit"></i> 明细</button>';
}
}
],
undefinedText: 0,
cache: false,
striped: true,
showRefresh: false,
pageSize: 20,
pagination: true,
pageList: [20, 50, 100, 200, 300, 500],
search: false,
sidePagination: "client", //表示服务端请求
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageNum: params.pageNumber,
pageSize: params.pageSize
};
return param;
},
toolbar: '#toolbar',
url: '/admin/chargeRecord/dailylist.action',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
getTotalStatis();
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
});
// 导出EXCEL
$('#btnExport').on('click', function () {
$("#searchForm").submit();
});
// 查询刷新
$('#btnSearch').on('click', function () {
TableHelper.doRefresh('#table');
});
$("#table").on("click", '.opt-detail', function () {
$("#recordDetail").modal('show');
var time = $(this).attr("data-id");
var date = new Date().format("yyyy-MM-dd ");
$("#modalLabel").html(date + parseTime(time));
$('#detailtable').bootstrapTable('destroy');
$('#detailtable').bootstrapTable({
columns: [
{ field: 'channel', title: '渠道', align: 'center', width: '5%' },
{ field: 'amount', title: '充值金额', align: 'center', width: '5%' },
{ field: 'count', title: '充值笔数', align: 'center', width: '5%' }
],
undefinedText: 0,
height: 600,
cache: false,
striped: true,
showRefresh: false,
pageSize: 20,
pagination: false,
pageList: [20, 50, 100, 200, 300, 500],
search: false,
sidePagination: "client", //表示服务端请求
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageNum: params.pageNumber,
pageSize: params.pageSize,
time: time
};
return param;
},
url: '/admin/chargeRecord/dailydetail.action',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
});
});
});
}
},
};
function parseTime(val) {
if (val < 10) {
return '0' + val + ':00-0' + val + ':59';
} else {
return val + ':00-' + val + ':59';
}
}
function getTotalStatis() {
$.get('/admin/chargeRecord/dailytotal', function (res) {
if (res.code == 200) {
console.log(res.data);
if (res.data) {
$('.totalAmount').html(res.data.amount);
$('.totalCount').html(res.data.count);
}
}
})
}
</script>
<style scoped></style>

View File

@@ -0,0 +1,417 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<section class="content-body">
<form id="form2" action="" method="post" target="_blank">
<input type="hidden" name="erbanNo" id="exportErbanNo">
<input type="hidden" name="searchType" id="exportSearchType">
<input type="hidden" name="startDate" id="exportStartDate">
<input type="hidden" name="endDate" id="exportEndDate">
<input type="hidden" name="channel" id="exportChannel">
<input type="hidden" name="chargeRecordId" id="exportChargeRecordId">
</form>
<div id="toolbar">
<div id="userMessage">
<div class="avatar"><img src="" alt=""></div>
<div class="nick"></div>
<div class="erbanNo"></div>
</div>
<div class="search-wrapper">
<label for="erbanNo" class="control-label erbanNo-text">平台号:</label>
<input type="text" class="" name="erbanNo" id="erbanNo">
<label for="searchType">查询类型</label>
<select name="searchType" id="searchType" class="">
<option value="1">根据订单号</option>
<option value="2">根据平台号</option>
<option value="3">根据第三方订单号</option>
</select>
<label for="channel" class="channel-text">充值渠道</label>
<select name="channel" id="channel">
<option value="">全部</option>
<option value="google_play_billing">谷歌内购</option>
<option value="payermax">payermax</option>
</select>
<label for="chargeRecordId" class="chargeRecord-text">订单号:</label>
<input type="text" id="chargeRecordId" name="chargeRecordId">
开始时间<input type="text" name="startDate" id="startDate" class="input-sm">
结束时间<input type="text" name="endDate" id="endDate" class="input-sm">
</div>
<div class="btn-group">
<button id="btnSearch" class="btn btn-primary">查询</button>
<button id="btnExport" class="btn btn-primary">导出</button>
<button id="btnAddRecord" class="btn btn-default">新增</button>
</div>
</div>
<div id="table"></div>
</section>
</div>
</div>
</section>
<!-- 增加弹框 -->
<div class="modal fade" id="addModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="addModalLabel">新增</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" id="addModalForm">
<div class="form-group">
<label for="modal_account" class="col-sm-3 control-label">银行账号<font color="red">*</font>
</label>
<div class="col-sm-9">
<input type="text" class="form-control" name="account" id="modal_account" placeholder="">
</div>
</div>
<div class="form-group">
<label for="modal_erbanNo" class="col-sm-3 control-label">用户ID<font color="red">*</font>
</label>
<div class="col-sm-9">
<input type="text" class="form-control" name="erbanNo" id="modal_erbanNo" placeholder="">
</div>
</div>
<div class="form-group">
<label for="modal_channel" class="col-sm-3 control-label">充值渠道</label>
<div class="col-sm-9">
<input type="text" class="form-control" name="channel" id="modal_channel" placeholder="">
</div>
</div>
<div class="form-group">
<label for="modal_country" class="col-sm-3 control-label">国家/地区</label>
<div class="col-sm-9">
<input type="text" class="form-control" name="country" id="modal_country" placeholder="">
</div>
</div>
<div class="form-group">
<label for="modal_local_currency_code" class="col-sm-3 control-label">当地货币代码<font color="red">*
</font></label>
<div class="col-sm-9">
<input type="text" class="form-control" name="localCurrencyCode"
id="modal_local_currency_code" placeholder="">
</div>
</div>
<div class="form-group">
<label for="modal_local_amount" class="col-sm-3 control-label">当地货币交易数<font color="red">*
</font></label>
<div class="col-sm-9">
<input type="text" class="form-control" name="localAmount" id="modal_local_amount"
placeholder="">
</div>
</div>
<div class="form-group">
<label for="modal_total_gold" class="col-sm-3 control-label">钻石数<font color="red">*</font>
</label>
<div class="col-sm-9">
<input type="text" class="form-control" name="totalGold" id="modal_total_gold"
placeholder="">
</div>
</div>
<div class="form-group">
<label for="modal_status" class="col-sm-3 control-label">状态</label>
<div class="col-sm-9">
<select class="form-control" name="status" id="modal_status">
<option value="2">已支付</option>
<option value="1">未支付</option>
</select>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="btnAddModalConfirm">确定</button>
</div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
import { serverError } from '@/utils/maintainer';
export default {
name: "ChargeRecordManualAdminView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{ field: 'chargeRecordId', title: '充值订单号', align: 'center', valign: 'middle', width: '20%' },
{ field: 'chargeApp', title: '银行账号', align: 'center', valign: 'middle', width: '20%' },
{ field: 'erbanNo', title: '平台id', align: 'center', valign: 'middle' },
{ field: 'nick', title: '昵称', align: 'center', valign: 'middle' },
{
field: 'channel', title: '充值渠道', align: 'center', valign: 'middle', width: '10%', formatter: function (val, row, index) {
if (val) {
switch (val) {
case "exchange":
return "兑换";
case "alipay":
return "支付宝APP";
case "wx":
return "微信APP";
case "alipay_wap":
return "支付宝H5";
case "ios_pay":
return "苹果内购";
case "wx_wap":
return "微信H5";
case "fastpay":
return "汇聚快捷支付";
case "wx_mp":
return "微信小程序支付";/**/
case "wx_pub":
return "微信公众号";
default:
return val
}
} else {
return '-';
}
}
},
{ field: 'country', title: '地区', align: 'center', valign: 'middle' },
{ field: 'localCurrencyCode', title: '本地货币代码', align: 'center', valign: 'middle' },
{ field: 'localAmount', title: '本地金额', align: 'center', valign: 'middle' },
{ field: 'totalGold', title: '钻石', align: 'center', valign: 'middle' },
{
field: 'chargeStatus', title: '充值状态', align: 'center', valign: 'middle', width: '10%', formatter: function (val, row, inde) {
switch (val) {
case 1:
return "未完成";
case 2:
return "已支付";
}
}
},
{
field: 'newUser', title: '是否新用户', align: 'center', valign: 'middle', formatter: function (val, row, inde) {
return val ? "是" : "否"
}
},
{
field: 'firstCharge', title: '是否首充', align: 'center', valign: 'middle', formatter: function (val, row, inde) {
return val ? "是" : "否"
}
},
{
field: 'createTime', title: '账单创建时间', align: 'center', valign: 'middle', width: '20%', formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format("yyyy-MM-dd hh:mm:ss");
} else {
return '-';
}
}
},
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pagination: true,
pageList: [10, 20, 30, 50],
sidePagination: "server", //表示服务端请求
//设置为undefined可以获取pageNumberpageSizesearchTextsortNamesortOrder
//设置为limit可以获取limit, offset, search, sort, order
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageSize: params.pageSize,
pageNumber: params.pageNumber,
erbanNo: $('#erbanNo').val(),
searchType: $('#searchType').val(),
startDate: $('#startDate').val(),
endDate: $('#endDate').val(),
channel: $("#channel").val(),
chargeRecordId: $('#chargeRecordId').val()
};
return param;
},
uniqueId: 'code',
toolbar: '#toolbar',
url: '/admin/chargeRecord/manual/list.action',
onLoadSuccess: function (data) { //加载成功时执行
console.log("load success");
console.log(data);
if (data.users) {
var $user = $('#userMessage');
$user.find('.avatar img').attr('src', data.users.avatar);
$user.find('.nick').html('昵称:' + data.users.nick);
$user.find('.erbanNo').html('平台号:' + data.users.erbanNo);
}
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
})
$('#btnSearch').on('click', function () {
if ((!$('#erbanNo').val() && $('#searchType').val() == "2")
|| (!$('#chargeRecordId').val() && $('#searchType').val() == "3")
|| ($('#searchType').val() == "1" && !$('#chargeRecordId').val())) {
$("#tipMsg").text("请输入必填的信息");
$("#tipModal").modal('show');
return;
}
TableHelper.doRefresh('#table');
})
// 导出excel
$('#btnExport').on('click', function () {
var form = $("#form2");
form.attr("action", "/admin/chargeRecord/manual/export.action");
$('#exportErbanNo').val($('#erbanNo').val());
$('#exportSearchType').val($('#searchType').val());
$('#exportStartDate').val($('#startDate').val());
$('#exportEndDate').val($('#endDate').val());
$('#exportChannel').val($('#channel').val());
$('#exportChargeRecordId').val($('#chargeRecordId').val());
form.submit();
})
var picker1 = $("#startDate").datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
autoclose: true
})
var picker2 = $('#endDate').datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
autoclose: true
})
picker1.on('changeDate', function () {
var date = $('#startDate').datetimepicker('getDate');
picker2.datetimepicker('setStartDate', date);
});
picker2.on('changeDate', function () {
var date = $('#endDate').datetimepicker('getDate');
picker1.datetimepicker('setEndDate', date);
});
$('#searchType').on('change', function () {
if ($(this).val() == '2') {
// 根据平台号
$('.erbanNo-text').show();
$('#erbanNo').show();
$('.channel-text').show();
$('#channel').show();
$('#startDate').show();
$('#endDate').show();
$('#chargeRecordId').hide();
$('.chargeRecord-text').hide();
} else {
// 根据充值记录id
$('.erbanNo-text').hide();
$('#erbanNo').hide();
$('.channel-text').hide();
$('#channel').hide();
$('#startDate').hide();
$('#endDate').hide();
$('#chargeRecordId').show();
$('.chargeRecord-text').show();
}
});
// 添加打开弹窗
$("#btnAddRecord").on('click', function () {
//清除数据
$('#addModal').find('input').val('');
$('#addModal').find('textarea').val('');
$('#addModal').modal('show');
});
// 添加
$("#btnAddModalConfirm").click(function () {
if ($("#addModalForm").validationEngine('validate')) {
$.ajax({
type: "post",
url: "/admin/chargeRecord/manual/add.action",
data: {
account: $("#modal_account").val(),
erbanNo: $("#modal_erbanNo").val(),
channel: $("#modal_channel").val(),
country: $("#modal_country").val(),
localCurrencyCode: $("#modal_local_currency_code").val(),
localAmount: $("#modal_local_amount").val(),
totalGold: $("#modal_total_gold").val(),
status: $("#modal_status").val(),
},
dataType: "json",
success: function (json) {
if (apiResult(json)) {
$("#tipMsg").text("保存成功");
$("#tipModal").modal('show');
$("#addModal").modal('hide');
TableHelper.doRefresh('#table');
} else {
$("#tipMsg").text("保存失败." + json.data.msg);
$("#tipModal").modal('show');
$("#addModal").modal('hide');
}
},
error: function (req) {
serverError(req);
}
});
}
});
}
},
};
function apiResult(json) {
if (json.code == 200 && json.message == 'success') {
return true;
}
$("#tipMsg").text("请求失败,错误信息:" + json.message);
$("#tipModal").modal('show');
return false;
}
</script>
<style scoped>
#userMessage {
display: flex;
justify-content: flex-start;
align-items: center;
}
#userMessage .avatar {
width: 50px;
height: 50px;
}
#userMessage .avatar img {
width: 100%;
height: 100%;
}
#userMessage>div {
margin-right: 30px;
}
.erbanNo-text,
#erbanNo,
.channel-text,
#channel,
#startDate,
#endDate {
display: none;
}</style>

View File

@@ -0,0 +1,282 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<section class="content-body">
<form id="form2" action="" method="post" target="_blank">
<input type="hidden" name="erbanNo" id="exportErbanNo">
<input type="hidden" name="searchType" id="exportSearchType">
<input type="hidden" name="startDate" id="exportStartDate">
<input type="hidden" name="endDate" id="exportEndDate">
<input type="hidden" name="channel" id="exportChannel">
<input type="hidden" name="chargeRecordId" id="exportChargeRecordId">
</form>
<div id="toolbar">
<div id="userMessage">
<div class="avatar"><img src="" alt=""></div>
<div class="nick"></div>
<div class="erbanNo"></div>
</div>
<div class="search-wrapper">
<label for="erbanNo" class="control-label erbanNo-text">平台号:</label>
<input type="text" class="" name="erbanNo" id="erbanNo">
<label for="searchType">查询类型</label>
<select name="searchType" id="searchType" class="">
<option value="1">根据订单号</option>
<option value="2">根据平台号</option>
<option value="3">根据第三方订单号</option>
</select>
<label for="channel" class="channel-text">充值渠道</label>
<select name="channel" id="channel">
<option value="">全部</option>
<option value="google_play_billing">谷歌内购</option>
<option value="payermax">payermax</option>
</select>
<label for="chargeRecordId" class="chargeRecord-text">订单号:</label>
<input type="text" id="chargeRecordId" name="chargeRecordId">
开始时间<input type="text" name="startDate" id="startDate" class="input-sm">
结束时间<input type="text" name="endDate" id="endDate" class="input-sm">
</div>
<div class="btn-group">
<button id="btnSearch" class="btn btn-primary">查询</button>
<button id="btnExport" class="btn btn-default">导出</button>
</div>
</div>
<div id="table"></div>
</section>
</div>
</div>
</section>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "ChargeRecordPersonalAdminView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{ field: 'chargeRecordId', title: '充值订单号', align: 'center', valign: 'middle', width: '20%' },
{ field: 'pingxxChargeId', title: '第三方订单号', align: 'center', valign: 'middle', width: '20%' },
{ field: 'erbanNo', title: '平台id', align: 'center', valign: 'middle' },
{ field: 'nick', title: '昵称', align: 'center', valign: 'middle' },
{
field: 'channel', title: '充值渠道', align: 'center', valign: 'middle', width: '10%', formatter: function (val, row, index) {
if (val) {
switch (val) {
case "exchange":
return "兑换";
case "alipay":
return "支付宝APP";
case "wx":
return "微信APP";
case "alipay_wap":
return "支付宝H5";
case "ios_pay":
return "苹果内购";
case "wx_wap":
return "微信H5";
case "fastpay":
return "汇聚快捷支付";
case "wx_mp":
return "微信小程序支付";
case "wx_pub":
return "微信公众号";
default:
return val
}
} else {
return '-';
}
}
},
{ field: 'country', title: '地区', align: 'center', valign: 'middle' },
{ field: 'localCurrencyCode', title: '本地货币代码', align: 'center', valign: 'middle' },
{ field: 'localAmount', title: '本地金额', align: 'center', valign: 'middle' },
{ field: 'totalGold', title: '钻石', align: 'center', valign: 'middle' },
{
field: 'chargeStatus', title: '充值状态', align: 'center', valign: 'middle', width: '10%', formatter: function (val, row, inde) {
switch (val) {
case 1:
return "未完成";
case 2:
return "已支付";
}
}
},
{ field: 'clientIp', title: 'ip', align: 'center', valign: 'middle' },
{
field: 'newUser', title: '是否新用户', align: 'center', valign: 'middle', formatter: function (val, row, inde) {
return val ? "是" : "否"
}
},
{
field: 'firstCharge', title: '是否首充', align: 'center', valign: 'middle', formatter: function (val, row, inde) {
return val ? "是" : "否"
}
},
{
field: 'createTime', title: '账单创建时间', align: 'center', valign: 'middle', width: '20%', formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format("yyyy-MM-dd hh:mm:ss");
} else {
return '-';
}
}
},
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pagination: true,
pageList: [10, 20, 30, 50],
sidePagination: "server", //表示服务端请求
//设置为undefined可以获取pageNumberpageSizesearchTextsortNamesortOrder
//设置为limit可以获取limit, offset, search, sort, order
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageSize: params.pageSize,
pageNumber: params.pageNumber,
erbanNo: $('#erbanNo').val(),
searchType: $('#searchType').val(),
startDate: $('#startDate').val(),
endDate: $('#endDate').val(),
channel: $("#channel").val(),
chargeRecordId: $('#chargeRecordId').val()
};
return param;
},
uniqueId: 'code',
toolbar: '#toolbar',
url: '/admin/chargeRecord/personal/list.action',
onLoadSuccess: function (data) { //加载成功时执行
console.log("load success");
console.log(data);
if (data.users) {
var $user = $('#userMessage');
$user.find('.avatar img').attr('src', data.users.avatar);
$user.find('.nick').html('昵称:' + data.users.nick);
$user.find('.erbanNo').html('平台号:' + data.users.erbanNo);
}
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
})
$('#btnSearch').on('click', function () {
if ((!$('#erbanNo').val() && $('#searchType').val() == "2")
|| (!$('#chargeRecordId').val() && $('#searchType').val() == "3")
|| ($('#searchType').val() == "1" && !$('#chargeRecordId').val())) {
$("#tipMsg").text("请输入必填的信息");
$("#tipModal").modal('show');
return;
}
TableHelper.doRefresh('#table');
})
// 导出excel
$('#btnExport').on('click', function () {
var form = $("#form2");
form.attr("action", "/admin/chargeRecord/personal/export.action");
$('#exportErbanNo').val($('#erbanNo').val());
$('#exportSearchType').val($('#searchType').val());
$('#exportStartDate').val($('#startDate').val());
$('#exportEndDate').val($('#endDate').val());
$('#exportChannel').val($('#channel').val());
$('#exportChargeRecordId').val($('#chargeRecordId').val());
form.submit();
})
var picker1 = $("#startDate").datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
autoclose: true
})
var picker2 = $('#endDate').datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
autoclose: true
})
picker1.on('changeDate', function () {
var date = $('#startDate').datetimepicker('getDate');
picker2.datetimepicker('setStartDate', date);
});
picker2.on('changeDate', function () {
var date = $('#endDate').datetimepicker('getDate');
picker1.datetimepicker('setEndDate', date);
});
$('#searchType').on('change', function () {
if ($(this).val() == '2') {
// 根据平台号
$('.erbanNo-text').show();
$('#erbanNo').show();
$('.channel-text').show();
$('#channel').show();
$('#startDate').show();
$('#endDate').show();
$('#chargeRecordId').hide();
$('.chargeRecord-text').hide();
} else {
// 根据充值记录id
$('.erbanNo-text').hide();
$('#erbanNo').hide();
$('.channel-text').hide();
$('#channel').hide();
$('#startDate').hide();
$('#endDate').hide();
$('#chargeRecordId').show();
$('.chargeRecord-text').show();
}
});
}
},
};
</script>
<style scoped>
#userMessage {
display: flex;
justify-content: flex-start;
align-items: center;
}
#userMessage .avatar {
width: 50px;
height: 50px;
}
#userMessage .avatar img {
width: 100%;
height: 100%;
}
#userMessage>div {
margin-right: 30px;
}
.erbanNo-text,
#erbanNo,
.channel-text,
#channel,
#startDate,
#endDate {
display: none;
}</style>

View File

@@ -0,0 +1,228 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<div id="toolbar">
<div class="col-sm-12">
<div class="pull-left">
<form id="searchForm" class="col-sm-pull-12" action="/admin/chargeRecord/totalexport"
method="get" target="_blank">
<div class="col-sm-11">
<label for="beginDate" class="col-sm-2 control-label">开始日期:</label>
<div class="col-sm-4"><input type="text" class="form-control" name="beginDate"
id="beginDate" placeholder="必填">
</div>
<label for="endDate" class="col-sm-2 control-label">结束日期:</label>
<div class="col-sm-4"><input type="text" class="form-control" name="endDate"
id="endDate" placeholder="必填"></div>
</div>
</form>
</div>
<div class="pull-right">
<button id="btnSearch" class="btn btn-default">
<i class="glyphicon glyphicon-search"></i>查询
</button>
<button id="btnExport" class="btn btn-default">
<i class="glyphicon glyphicon-export"></i>导出
</button>
<span style="color: red">(单位美元)</span>
</div>
</div>
</div>
<!-- .content -->
<div id="table"></div>
</div>
</div>
</section>
<div class="modal fade" id="recordDetail" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="modalLabel"></h4>
</div>
<div class="modal-body">
<div id="detailtable"></div>
</div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "ChargeRecordTotalStatisticsView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{ field: 'timeStr', title: '日期', align: 'center', width: '5%' },
/*{field: 'wxAmount', title: '微信支付', align: 'center', width: '5%'},
{field: 'wxWapAmount', title: '微信H5支付', align: 'center', width: '5%'},
{field: 'wxPubAmount', title: '微信公众号', align: 'center', width: '5%'},
{field: 'alipayAmount', title: '支付宝', align: 'center', width: '5%'},
{field: 'alipayV2Amount', title: '支付宝V2', align: 'center', width: '5%'},
{field: 'wxMicroMallPubAmount', title: '微商城公众号', align: 'center', width: '5%'},
{field: 'wxPub2Amount', title: '平台公众号', align: 'center', width: '5%'},
{field: 'wxPub2H5Amount', title: '平台公众号H5支付', align: 'center', width: '5%'},
{field: 'alipayWapAmount', title: '支付宝H5', align: 'center', width: '5%'},
{field: 'iosPayAmount', title: 'IOS支付', align: 'center', width: '5%'},
{field: 'wxMiniAppAmount', title: '小程序支付', align: 'center', width: '5%'},*/
{ field: 'googleAmount', title: 'google支付', align: 'center', width: '5%' },
{ field: 'payermaxAmount', title: 'payermax支付', align: 'center', width: '5%' },
{ field: 'iosPayAmount', title: 'ios支付', align: 'center', width: '5%' },
{ field: 'companyAccount', title: '充值打公账', align: 'center', width: '5%' },
{ field: 'totalAmount', title: '总计充值金额数', align: 'center', width: '5%' },
{
field: 'timeStr',
title: '操作',
align: 'center',
width: '5%',
formatter: function (val, row, index) {
return '<button id="btnDetail" name="btnDetail" class="btn btn-sm btn-success opt-detail" data-id=' + val + '>' +
'<i class="glyphicon glyphicon-edit"></i> 明细</button>';
}
}
],
undefinedText: 0,
cache: false,
striped: true,
showRefresh: false,
pageSize: 20,
pagination: true,
pageList: [20, 50, 100, 200, 300, 500],
search: false,
sidePagination: "server", //表示服务端请求
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageNum: params.pageNumber,
pageSize: params.pageSize,
beginDate: $('#beginDate').val(),
endDate: $('#endDate').val()
};
return param;
},
toolbar: '#toolbar',
url: '/admin/chargeRecord/totallist.action',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
});
// 导出EXCEL
$('#btnExport').on('click', function () {
if (!$('#beginDate').val() || !$('#endDate').val()) {
$("#tipMsg").text("请输入必填的信息");
$("#tipModal").modal('show');
return;
}
$("#searchForm").submit();
});
// 查询刷新
$('#btnSearch').on('click', function () {
if (!$('#beginDate').val() || !$('#endDate').val()) {
$("#tipMsg").text("请输入必填的信息");
$("#tipModal").modal('show');
return;
}
TableHelper.doRefresh('#table');
});
var chargeStart = $('#beginDate').datepicker({
format: 'yyyy-mm-dd',
autoclose: true
});
var chargeEnd = $('#endDate').datepicker({
format: 'yyyy-mm-dd',
autoclose: true
});
chargeStart.on('changeDate', function () {
var date = $('#beginDate').datepicker('getDate');
chargeEnd.datepicker('setStartDate', date);
});
chargeEnd.on('changeDate', function () {
var date = $('#endDate').datepicker('getDate');
chargeStart.datepicker('setEndDate', date);
});
$("#table").on("click", '.opt-detail', function () {
$("#recordDetail").modal('show');
var time = $(this).attr("data-id");
$("#modalLabel").html(time);
$('#detailtable').bootstrapTable('destroy');
$('#detailtable').bootstrapTable({
columns: [
{ field: 'channel', title: '渠道', align: 'center', width: '5%' },
{ field: 'amount', title: '充值金额', align: 'center', width: '5%' },
{ field: 'count', title: '充值笔数', align: 'center', width: '5%' }
],
undefinedText: 0,
height: 600,
cache: false,
striped: true,
showRefresh: false,
pageSize: 20,
pagination: false,
pageList: [20, 50, 100, 200, 300, 500],
search: false,
sidePagination: "client", //表示服务端请求
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageNum: params.pageNumber,
pageSize: params.pageSize,
time: time
};
return param;
},
url: '/admin/chargeRecord/totaldetail.action',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
});
});
});
}
},
};
</script>
<style scoped></style>

View File

@@ -0,0 +1,430 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<!-- .content -->
<div id="table"></div>
<div id="toolbar" style="height: auto;">
<form id="searchForm" class="col-sm-12" action="/admin/user/diamond/give/detailListExport" method="post"
target="_blank">
<div class="col-sm-12">
<label for="fromErbanNo" class="col-sm-1 control-label">转赠ID:</label>
<div class="col-sm-2">
<input type="text" class="input-sm" name="fromErbanNo" id="fromErbanNo">
</div>
<label for="type" class="col-sm-1 control-label">转赠类型:</label>
<div class="col-sm-1">
<select id="type" name="type" class="form-control">
<option value="">请选择...</option>
<option value="0">钻石</option>
<option value="1">背包礼物</option>
</select>
</div>
<label class="col-sm-2 control-label">统计时间:</label>
<div class="col-sm-2"><input type="text" class="form-control" name="beginTime" id="beginTime">
</div><span class="col-sm-1"></span>
<div class="col-sm-2"><input type="text" class="form-control" name="endTime" id="endTime"></div>
</div>
</form>
<div class="col-sm-12">
<button id="btnSearch" class="btn btn-default">
<i class="glyphicon glyphicon-search"></i>查询
</button>
<button id="btnReset" class="btn btn-default">
<i class="glyphicon glyphicon-remove"></i>重置
</button>
<button id="exportBtn" class="btn btn-default">
<i class="glyphicon glyphicon-export"></i>导出
</button>
</div>
<div class="summary col-sm-12">
<div class="col-sm-3">
<span>总转增钻石</span>
<span class="totalDiamondNum"></span>
</div>
</div>
<div class="summary col-sm-12">
<div class="col-sm-3">
<span>礼物总价值</span>
<span class="totalGiftGoldNum"></span>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- 查看弹框
<div class="modal fade" id="editModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content" style="width: 1000px;margin-left: -25%;">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="editModalLabel"></h4>
</div>
<div class="modal-body" style="width: 1000px;">
<form id="form2" action="" method="post" target="_blank">
</form>
<div id="toolbar2">
<input type="hidden" name="uid" id="fromUid">
<div class="col-sm-12">
<label for="beginTime" class="col-sm-2 control-label">开始时间:</label>
<div class="col-sm-3">
<input type="text" class="form-control" name="editStartTime" id="editStartTime">
</div>
<label for="endTime" class="col-sm-2 control-label">结束时间:</label>
<div class="col-sm-3">
<input type="text" class="form-control" name="editEndTime" id="editEndTime">
</div>
</div>
<div class="col-sm-12">
<button id="btnSearch2" class="btn btn-sm btn-primary">查询</button>
</div>
<div class="summary col-sm-12">
<div class="col-sm-3">
<span>总转增钻石</span>
<span class="totalSendDiamondNum"></span>
</div>
</div>
</div>
<div id="table2"></div>
</div>
</div>
</div>
</div>
-->
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
var picker1 = $("#beginTime").datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
autoclose: true,
todayBtn: true,
});
var picker2 = $("#endTime").datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
autoclose: true,
todayBtn: true
});
var picker3 = $('#editEndTime').datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
autoclose: true
})
var picker4 = $('#editStartTime').datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
autoclose: true
})
/*picker1.on('changeDate', function () {
var date = $('#beginDate').datetimepicker('getDate');
picker2.datetimepicker('setStartDate', date);
});
picker2.on('changeDate', function () {
var date = $('#endDate').datetimepicker('getDate');
picker1.datetimepicker('setEndDate', date);
});*/
export default {
name: "DiamondGiveHistoryView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{ field: 'erbanNo', title: '转赠人ID', align: 'center', width: '5%' },
{ field: 'nick', title: '转赠人昵称', align: 'center', width: '5%' },
{ field: 'targetErbanNo', title: '获赠人ID', align: 'center', width: '5%' },
{ field: 'targetNick', title: '获赠人昵称', align: 'center', width: '5%' },
{
field: 'type', title: '转赠类型', align: 'center', width: '5%',
formatter: function (val, row, index) {
if (row.type == 0) {
return '钻石'
} else {
return '背包礼物';
}
}
},
{
field: 'diamondNum', title: '转赠钻石数', align: 'center', width: '5%',
formatter: function (val, row, index) {
if (row.type == 1) {
return '-'
}
return val;
}
},
{
field: 'rate', title: '手续费', align: 'center', width: '5%',
formatter: function (val, row, index) {
if (row.type == 1) {
return '-'
}
return val * 100 + "%";
}
},
{
field: 'realDiamondNum', title: '实际总消耗砖石', align: 'center', width: '5%',
formatter: function (val, row, index) {
if (row.type == 1) {
return '-'
}
return val;
}
},
{
field: 'giftName', title: '礼物名称', align: 'center', width: '5%',
formatter: function (val, row, index) {
if (row.type == 0) {
return '-'
}
return val;
}
},
{
field: 'giftNum', title: '礼物个数', align: 'center', width: '5%',
formatter: function (val, row, index) {
if (row.type == 0) {
return '-'
}
return val;
}
},
{
field: 'totalGiftGoldNum', title: '礼物总价值', align: 'center', width: '5%',
formatter: function (val, row, index) {
if (row.type == 0) {
return '-'
}
return val;
}
},
{ field: 'createTime', title: '时间', align: 'center', width: '5%', formatter: formatTime },
// {field: 'erbanNo', title: '平台ID', align: 'center', width: '5%'},
// {field: 'nick', title: '昵称', align: 'center', width: '5%'},
// {field: 'totalSendDiamondNum', title: '总转增钻石数', align: 'center', width: '5%'},
/*{
field: 'uid',
title: '操作',
align: 'center',
width: '10%',
formatter: function (val, row, index) {
return '<button id="btnView" name="btnView" class="btn btn-sm btn-success opt-edit" data-id=' + val + '>' +
'<i class="glyphicon glyphicon-edit"></i>明细</button>';
}
}*/
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pagination: true,
pageList: [10, 20, 50, 100],
search: false,
sidePagination: "server", //表示服务端请求
//设置为undefined可以获取pageNumberpageSizesearchTextsortNamesortOrder
//设置为limit可以获取limit, offset, search, sort, order
queryParamsType: "-",
queryParams: function queryParams(params) { //设置查询参数
var param = {
fromErbanNo: $('#fromErbanNo').val(),
beginTime: $('#beginTime').val(),
endTime: $('#endTime').val(),
type: $('#type').val(),
pageSize: params.pageSize,
pageNumber: params.pageNumber
};
return param;
},
toolbar: '#toolbar',
ajax: function (request) { //使用ajax请求
$.ajax({
type: "GET",
url: '/admin/user/diamond/give/detailList.action',
contentType: 'application/json;charset=utf-8',
dataType: 'json',
data: request.data,
success: function (res) {
request.success({
rows: res.rows,
total: res.total,
});
//设置其他统计信息
$('.totalDiamondNum').html((res.totalDiamondNum == undefined || res.totalDiamondNum == null) ? 0 : res.totalDiamondNum);
$('.totalGiftGoldNum').html((res.totalGiftGoldNum == undefined || res.totalGiftGoldNum == null) ? 0 : res.totalGiftGoldNum);
},
})
},
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
});
// 查询刷新
$('#btnSearch').on('click', function () {
TableHelper.doRefresh('#table');
});
// 查询刷新
$('#btnSearch2').on('click', function () {
TableHelper.doRefresh('#table2');
});
//重置
$('#btnReset').on('click', function () {
$('#fromErbanNo').val("");
$('#beginTime').val("");
$('#endTime').val("");
});
// 查看组员信息
$("#table").on("click", '.opt-edit', function () {
let uid = $(this).attr("data-id");
$("#fromUid").val(uid);
let startTime = $("#beginTime").val();
let endTime = $("#endTime").val();
if (!isEmpty(startTime)) {
$("#editStartTime").val(startTime)
}
if (!isEmpty(endTime)) {
$("#editEndTime").val(endTime)
}
$('#table2').bootstrapTable('destroy');
$('#table2').bootstrapTable({
columns: [
{ field: 'erbanNo', title: '转赠人ID', align: 'center', width: '5%' },
{ field: 'nick', title: '转赠人昵称', align: 'center', width: '5%' },
{ field: 'diamondNum', title: '转赠钻石数', align: 'center', width: '5%' },
{
field: 'rate', title: '手续费', align: 'center', width: '5%',
formatter: function (val, row, index) {
return val * 100 + "%";
}
},
{ field: 'realDiamondNum', title: '实际总消耗砖石', align: 'center', width: '5%' },
{ field: 'targetErbanNo', title: '获赠人ID', align: 'center', width: '5%' },
{ field: 'targetNick', title: '获赠人昵称', align: 'center', width: '5%' },
{ field: 'createTime', title: '时间', align: 'center', width: '5%', formatter: formatTime },
],
undefinedText: "-",
cache: false,
striped: true,
showRefresh: false,
pageSize: 20,
pageList: [20, 50, 100],
pagination: true,
search: false,
sidePagination: "server", //表示服务端请求
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
uid: uid,
beginTime: $('#editStartTime').val(),
endTime: $('#editEndTime').val(),
pageSize: params.pageSize,
pageNumber: params.pageNumber
};
return param;
},
ajax: function (request) { //使用ajax请求
$.ajax({
type: "GET",
url: '/admin/user/diamond/give/detailList.action',
contentType: 'application/json;charset=utf-8',
dataType: 'json',
data: request.data,
success: function (res) {
request.success({
rows: res.rows,
total: res.total,
});
//设置标题信息
var headTxt = '转赠统计-明细';
//设置其他统计信息
$('.totalSendDiamondNum').html((res.totalSendDiamondNum == undefined || res.totalSendDiamondNum == null) ? 0 : res.totalSendDiamondNum.sum);
$('#editModalLabel').text(headTxt);
$("#editModal").modal('show');
},
})
},
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
});
})
// 导出EXCEL
$('#exportBtn').on('click', function () {
$("#searchForm").submit();
});
});
}
},
};
//判断空值
function isEmpty(data) {
if (data == null || data == undefined || data == "") {
return true;
}
return false;
}
function formatTime(val) {
if (val) {
var date = new Date(val);
return date.format('yyyy-MM-dd hh:mm:ss');
} else {
return '';
}
}
function serverError(req) {
$("#tipMsg").text(req.responseJSON.message);
$("#tipModal").modal('show');
}
function formatHourLength(val) {
if (val > 24) {
return (val - val % 24) / 24 + '天' + val % 24 + '时'
}
return val + '时'
}
</script>
<style scoped></style>

View File

@@ -0,0 +1,127 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<section class="content">
<div id="table"></div>
<div id="toolbar">
用户uid: <input type="text" name="uid" id="uid" class="input-sm">
选择时间: <input type="text" name="beginDate" id="beginDate" class="input-sm">
<input type="endDate" id="endDate" class="input-sm">
<button id="btnSearch" class="btn btn-sm btn-primary">查询</button>
</div>
</section>
</div>
</div>
</section>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "FeedbackAdminView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{ field: 'uid', title: '用户uid', align: 'center', width: '10%' },
{
field: 'feedbackDesc', title: '反馈信息', align: 'center', width: '20%',
formatter: function (val, row, index) {
return val ? val.replace('<', '《').replace('>', '》') : '';
}
},
{ field: 'imgUrl', title: '反馈截图', align: 'center', width: '10%' },
{ field: 'contact', title: '摘要', align: 'center', width: '10%' },
{
field: 'createTime', title: '生成时间', align: 'center',
formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format("yyyy-MM-dd hh:mm:ss");
} else {
return '-';
}
}
}
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pagination: true,
sidePagination: "server", //表示服务端请求
//设置为undefined可以获取pageNumberpageSizesearchTextsortNamesortOrder
//设置为limit可以获取limit, offset, search, sort, order
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageSize: params.pageSize,
pageNum: params.pageNumber,
uid: $('#uid').val(),
beginDate: $('#beginDate').val(),
endDate: $('#endDate').val()
};
return param;
},
uniqueId: 'code',
toolbar: '#toolbar',
url: '/admin/feedback/list.action',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
})
$('#btnSearch').on('click', function () {
TableHelper.doRefresh('#table');
})
var picker1 = $("#beginDate").datepicker({
format: 'yyyy-mm-dd',
todayBtn: true,
autoclose: true,
startDate: "2016-01-01"
});
var picker2 = $("#endDate").datepicker({
format: 'yyyy-mm-dd',
todayBtn: true,
autoclose: true
});
picker1.on('changeDate', function () {
var date = $('#beginDate').datepicker('getDate');
picker2.datepicker('setStartDate', date);
});
picker2.on('changeDate', function () {
var date = $('#endDate').datepicker('getDate');
picker1.datepicker('setEndDate', date);
});
})
}
},
};
</script>
<style scoped>
#btnSearch {
margin-left: 8px;
}
#uid {
margin-right: 4px;
}</style>

View File

@@ -0,0 +1,313 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<section class="content">
<div id="table"></div>
<div id="toolbar">
平台号:<input type="text" class="input-sm validate[required]" name="erbanNo" id="erbanNum">
<button id="btnSearch" class="btn btn-sm btn-primary">查询</button>
<button id="add" class="btn btn-default">
<i class="glyphicon glyphicon-plus"></i>增加
</button>
</div>
</section>
</div>
</div>
</section>
<div class="modal fade" id="addUserFrozen" tabindex="-1" role="dialog" aria-labelledby="modalLabel2">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">x</span></button>
<h4 class="modal-title" id="addModalLabel">新增冻结账户</h4>
</div>
<div class="modal-body">
<form id="addFrozenForm" class="form-horizontal">
<div class="form-group">
<label for="erbanNo" class="col-sm-3 control-label"><span
style="color: red; ">*</span>平台号</label>
<div class="col-sm-8">
<input type="text" class="form-control validate[required]" name="erbanNo" id="erbanNo"
placeholder='多个平台号请用-隔开'>
</div>
</div>
<div class="form-group">
<label for="frozenReason" class="col-sm-3 control-label"><span
style="color: red; ">*</span>冻结原因</label>
<div class="col-sm-8">
<input type="text" class="form-control validate[required]" name="reason" id="frozenReason">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-primary" id="addSave">冻结</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="editModel" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">x</span></button>
<h4 class="modal-title" id="modalLabel"> 修改封禁信息</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" id="updateBlock">
<input type="hidden" name="row" id="rowId" />
<div class="form-group">
<label for="updateReason" class="col-sm-3 control-label">封禁原因:</label>
<div class="col-sm-8">
<input type="text" id="updateReason" name="updateReason" class="form-control">
</div>
</div>
<div class="form-group">
<label for="blockStatus1" class="col-sm-3 control-label">封禁状态:</label>
<div class="col-sm-8">
<select name="blockStatus1" id="blockStatus1" class="col-sm-4">
<option value="1">封禁中</option>
<option value="2">封禁结束</option>
</select>
</div>
</div>
<form class="form-horizontal" id="updateFormTime">
<div class="form-group">
<label for="startDate" class="col-sm-3 control-label">起始时间:</label>
<div class="col-sm-8">
<input type="text" id="startDate" name="startValidTime" disabled="disabled"
class="form-control">
</div>
</div>
<div class="form-group">
<label for="endDate" class="col-sm-3 control-label">结束时间:</label>
<div class="col-sm-8">
<input type="text" id="endDate" name="endValidTime" class="form-control">
</div>
</div>
</form>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="saveUpdate">保存</button>
</div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "FrozenAdminView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{ field: 'uid', title: 'UID', align: 'center', valign: 'middle', visible: false, width: '20%' },
{ field: 'erbanNo', title: '平台号', align: 'center', valign: 'middle', width: '5%' },
{ field: 'nick', title: '昵称', align: 'center', valign: 'middle', width: '5%' },
{
field: 'status',
title: '状态',
align: 'center',
width: '5%',
valign: 'middle',
formatter: function (val, row, index) {
switch (val) {
case 0:
return '正常';
case 1:
return '冻结';
}
}
},
{
field: 'operateTime',
title: '操作时间',
align: 'center',
width: '10%',
valign: 'middle',
formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format("yyyy-MM-dd hh:mm");
} else {
return '-';
}
}
},
{
field: 'tmp',
title: '操作',
align: 'center',
width: '10%',
valign: 'middle',
formatter: function (val, row, index) {
var key = row.erbanNo;
return "<button class='btn btn-sm btn-success opt-release' data-id=" + key + ">解冻</button>&nbsp;&nbsp;";
}
}
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pagination: true,
pageList: [10, 20, 30, 50],
sidePagination: "server", //表示服务端请求
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageSize: params.pageSize,
pageNumber: params.pageNumber,
erbanNo: $('#erbanNum').val()
};
console.log("")
return param;
},
uniqueId: 'erbanNo',
toolbar: '#toolbar',
url: '/admin/user/frozen/list',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
})
/*查询刷新*/
$('#btnSearch').on('click', function () {
TableHelper.doRefresh('#table');
})
/*保存*/
$('#addSave').on('click', function () {
if ($('#addFrozenForm').validationEngine('validate')) {
$("#tipMsg").text("正在处理,请稍后");
$("#tipModal").modal('show');
$.ajax({
type: "post",
url: "/admin/user/frozen/save",
data: {
erbanNo: $("#erbanNo").val(),
reason: $("#frozenReason").val()
},
dataType: 'json',
success: function (data) {
if (data.code == 200) {
$('#addUserFrozen').modal('hide');
$("#tipMsg").text("保存成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("保存失败,错误码:" + data.message);
$("#tipModal").modal('show');
}
}
})
}
})
//增加冻结用户
$('#add').on('click', function () {
console.log("add")
$('#addFrozenForm')[0].reset();
$('#addUserFrozen').modal('show');
})
//解封
$('#table').on('click', '.opt-release', function () {
var key = parseInt($(this).data('id'));
console.log(key, typeof key);
if (confirm("确定要解冻平台号:" + key + "吗?")) {
$.ajax({
type: 'post',
url: '/admin/user/frozen/delete',
data: { 'erbanNo': key },
dataType: 'json',
success: function (data) {
if (data.code == 200) {
$("#tipMsg").text("解冻成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("解封失败,错误信息:" + data.message);
$("#tipModal").modal('show');
}
}
});
}
})
})
}
},
};
</script>
<style scoped>
.bar1,
.bar2 {
margin-bottom: 10px;
}
label.col-sm-1 {
padding: 0;
line-height: 30px;
text-align: right;
/*padding-right: 4px;*/
}
label.col-sm-1 {
padding: 0;
line-height: 30px;
text-align: right;
/*padding-right: 4px;*/
}
input,
select {
margin-left: 8px;
margin-right: 8px;
}
#btnSearch {
margin-left: 36px;
}
.record {
margin-top: 10px;
}
.record .title {
font-size: 16px;
}</style>

View File

@@ -0,0 +1,114 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<div id="toolbar">
<div class="col-sm-12">
<label for="erbanNo" class="col-sm-4 control-label">冻结平台号:</label>
<div class="col-sm-3">
<input type="text" class="input-sm" name="erbanNo" id="erbanNo" placeholder="请输入用户平台号">
</div>
</div>
<div class="col-sm-12">
<button class="btn btn-default" id="search">
<i class="glyphicon glyphicon-wrench"></i>查询
</button>
</div>
</div>
</div>
<!-- .content -->
<div id="table"></div>
</div>
</section>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "FrozenRecordAdminView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{ field: 'id', title: 'ID', align: 'center', valign: 'middle', width: '10%' },
{ field: 'erbanNo', title: '被冻结用户平台号', align: 'center', valign: 'middle', width: '10%' },
{ field: 'nick', title: '被冻结用户昵称', align: 'center', valign: 'middle', width: '20%' },
{
field: 'operateTime', title: '操作时间', align: 'center', valign: 'middle', width: '10%', formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format('yyyy-MM-dd hh:mm:ss');
} else {
return '-';
}
}
},
{ field: 'adminName', title: '操作人', align: 'center', valign: 'middle', width: '20%' },
{ field: 'operateReason', title: '冻结原因', align: 'center', valign: 'middle', width: '20%' },
{
field: 'status', title: '状态', align: 'center', valign: 'middle', width: '20%', formatter: function (val, row, index) {
switch (val) {
case 0:
return '操作为正常';
case 1:
return '操作为冻结';
}
}
}
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pagination: true,
pageList: [10, 20, 30, 50],
sidePagination: 'server',
queryParamsType: 'undefined',
queryParams: function queryParams(params) {
var param = {
pageSize: params.pageSize,
pageNumber: params.pageNumber,
erbanNo: $('#erbanNo').val()
};
return param;
},
uniqueId: 'id',
toolbar: '#toolbar',
url: '/admin/user/frozen/record',
onLoadSuccess: function () {
console.log('load success');
},
onLoadError: function () {
console.log('load fail');
}
});
$("#search").on('click', function () {
TableHelper.doRefresh('#table');
});
});
}
},
};
</script>
<style scoped></style>

View File

@@ -0,0 +1,438 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<div id="toolbar">
<div class="col-sm-12">
<form id="searchForm" method="get" target="_blank">
账号类型:
<select name="defUser" id="defUser" class="input-m">
<option value="">--全部--</option>
<option value="4">工会账号</option>
<option value="5">大头账号</option>
</select>
&nbsp;&nbsp;&nbsp;
操作时间
<input type="text" name="startTime" id="startTime" class="input-sm" placeholder="请选择开始时间">
- <input type="text" name="endTime" id="endTime" class="input-sm" placeholder="请选择结束时间">
</form>
<button id="btnSearch" class="btn btn-primary">
<i class="glyphicon glyphicon-search"></i>查询
</button>
<button class="btn btn-success" id='addBtn'>
<i class="glyphicon glyphicon-plus"></i>生成账号
</button>
<button id="btnExport" class="btn btn-default">
<i class="glyphicon glyphicon-export"></i>导出
</button>
</div>
</div>
<!-- .content -->
<div id="table"></div>
</div>
</div>
</section>
<div class="modal fade" id="genAccountModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="modalLabel">生成账号</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" id="addForm">
<div class="form-group">
<label for="nick" class="col-sm-3 control-label">昵称:</label>
<div class="col-sm-9">
<input type="text" class="form-control" name="nick" id="nick" placeholder='不填写默认“Peko小新”'>
</div>
</div>
<div class="form-group">
<label for="gender" class="col-sm-3 control-label">性别:</label>
<div class="col-sm-9">
<select name="gender" id="gender" class="form-control">
<option value="1"></option>
<option value="2"></option>
</select>
</div>
</div>
<div class="form-group">
<label for="avatar" class="col-sm-3 control-label">头像:</label>
<div class="col-sm-9">
<img src="" id="picUrl" style="width:40px;height:40px;" alt="">
<input type="file" id="uploadAvatarFile" name="uploadAvatarFile"
accept="image/gif,image/jpeg,image/jpg,image/png,image/svg">
<button class="btn btn-success" type="button" id="uploadPicBtn">上传</button>
<input type="hidden" class="form-control validate[required]" name="avatar" id="avatar"
style="width:40px"><span>不上传将使用默认头像</span>
</div>
</div>
<div class="form-group">
</div>
<div class="form-group">
<label for="size" class="col-sm-3 control-label">数量:</label>
<div class="col-sm-9">
<input type="text" class="form-control" name="size" id="size" placeholder='一次生成最多不超过20个'
oninput="value=value.replace(/[^\d]/g,'')">
</div>
</div>
<div class="form-group">
<label for="remark" class="col-sm-3 control-label">备注:</label>
<div class="col-sm-9">
<input type="text" class="form-control" name="remark" id="remark" value="仅供后台记录用"
placeholder="请输入备注50字内">
</div>
</div>
<div class="form-group">
<label for="genDefUser" class="col-sm-3 control-label">帐号类型:</label>
<div class="col-sm-9">
<select name="defUser" id="genDefUser" class="form-control validate[required]">
<option value="4">工会账号</option>
<option value="5">大头账号</option>
</select>
</div>
</div>
<div id="header_block" style="display: none;">
<div class="form-group">
<label for="phone" class="col-sm-3 control-label">手机号:</label>
<div class="col-sm-9">
<input type="text" class="form-control validate[required, maxlength: 20]" name="phone"
id="phone" placeholder='请输入手机号,必填'>
</div>
</div>
<div class="form-group">
<label for="realName" class="col-sm-3 control-label">实际姓名:</label>
<div class="col-sm-9">
<input type="text" class="form-control validate[required] validate[maxlength: 20]"
name="realName" id="realName" placeholder='请输入身份证上的姓名,必填'>
</div>
</div>
<div class="form-group">
<label for="idCardNum" class="col-sm-3 control-label">身份证号:</label>
<div class="col-sm-9">
<input type="text" class="form-control validate[required] validate[maxlength: 30]"
name="idCardNum" id="idCardNum" placeholder='请输入身份证号码,必填'>
</div>
</div>
<div class="form-group">
<label for="alipayAccount" class="col-sm-3 control-label">支付宝账号:</label>
<div class="col-sm-9">
<input type="text" class="form-control validate[required] validate[maxlength: 60]"
name="alipayAccount" id="alipayAccount" placeholder='请输入支付宝帐号,必填'>
</div>
</div>
<div class="form-group">
<label for="alipayAccountName" class="col-sm-3 control-label">支付宝姓名:</label>
<div class="col-sm-9">
<input type="text" class="form-control validate[required] validate[maxlength: 60]"
name="alipayAccountName" id="alipayAccountName" placeholder='请输入支付宝姓名'>
</div>
</div>
<div class="form-group">
<label for="bankCardNum" class="col-sm-3 control-label">银行卡号:</label>
<div class="col-sm-9">
<input type="text" class="form-control validate[required] validate[maxlength: 30]"
name="bankCardNum" id="bankCardNum" placeholder='请输入银行卡号'>
</div>
</div>
<div class="form-group">
<label for="bankCardName" class="col-sm-3 control-label">持卡人:</label>
<div class="col-sm-9">
<input type="text" class="form-control validate[required] validate[maxlength: 20]"
name="bankCardName" id="bankCardName" placeholder='请输入银行卡-持卡人姓名'>
</div>
</div>
<div class="form-group">
<label for="paymentPwd" class="col-sm-3 control-label">支付密码:</label>
<div class="col-sm-9">
<input type="text"
class="form-control validate[required] validate[minlength: 6] validate[maxlength: 20]"
name="paymentPwd" id="paymentPwd" placeholder='请输入6位数字的支付密码必填'>
</div>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="add">确定</button>
</div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
import { showLoading, hideLoading } from '@/utils/maintainer';
var picker1 = $('#startTime').datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
autoclose: true,
endDate: new Date()
});
var picker2 = $('#endTime').datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
autoclose: true
});
picker1.on('changeDate', function () {
var date = $('#startTime').datetimepicker('getDate');
picker2.datepicker('setStartDate', date);
});
picker2.on('changeDate', function () {
var date = $('#endTime').datetimepicker('getDate');
picker1.datepicker('setEndDate', date);
});
export default {
name: "GenAccountView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{ field: 'uid', title: 'UID', align: 'center', width: '5%' },
{ field: 'erbanNo', title: 'ID', align: 'center', width: '5%' },
{ field: 'nick', title: '昵称', align: 'center', width: '5%' },
{
field: 'defUser', title: '账号类型', align: 'center', width: '5%',
formatter: function (val, row, index) {
if (val == null) {
return '-';
}
if (val == 1) {
return '普通账号';
} else if (val == 2) {
return '官方账号';
} else if (val == 3) {
return '机器账号';
} else if (val == 4) {
return '工会账户';
} else if (val == 5) {
return '大头账号';
}
return val;
}
},
{ field: 'remark', title: '备注', align: 'center', width: '5%' },
{ field: 'operator', title: '操作人', align: 'center', width: '5%' },
{
field: 'createTime', title: '操作时间', align: 'center', valign: 'middle', width: '10%',
formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format('yyyy-MM-dd hh:mm:ss');
} else {
return '-';
}
}
}
],
undefinedText: '-',
cache: false,
striped: true,
showRefresh: false,
pageSize: 20,
pagination: true,
pageList: [20, 50, 100, 200, 300, 500],
search: false,
sidePagination: "server", //表示服务端请求
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageNum: params.pageNumber,
pageSize: params.pageSize,
defUser: $('#defUser').val(),
startTime: $('#startTime').val(),
endTime: $('#endTime').val()
};
return param;
},
toolbar: '#toolbar',
url: '/admin/gen/account/list.action',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
});
$('#addBtn').on('click', function () {
$("#addForm")[0].reset();
$('#addForm').validationEngine('hideAll');
$('#picUrl').attr('src', '');
$('#genDefUser').val(4);
$('#header_block').attr('style', 'display:none;');
$('#genAccountModal').modal('show');
});
// 查询刷新
$('#btnSearch').on('click', function () {
TableHelper.doRefresh('#table');
});
$('#uploadPicBtn').on('click', function () {
var options = {
type: 'post',
url: '/admin/gen/account/headImg.action',
dataType: 'json',
success: function (json) {
if (json.path) {
$('#avatar').val(json.path);
$('#picUrl').attr('src', json.path);
} else {
$('#tipMsg').text(json.msg);
$('#tipModal').modal('show');
}
}
}
$('#addForm').ajaxSubmit(options);
});
$("#add").click(function () {
if ($('#addForm').validationEngine('validate')) {
var size = $('#size').val();
if (!size) {
$("#tipMsg").text("请填写数量");
$("#tipModal").modal('show');
return;
}
if (size > 20) {
$("#tipMsg").text("一次只允许生成20个账号");
$("#tipModal").modal('show');
return;
}
if (!$('#gender').val()) {
$("#tipMsg").text("请选择性别");
$("#tipModal").modal('show');
return;
}
if ($('#remark').val().length > 50) {
$("#tipMsg").text("备注不能超过50字");
$("#tipModal").modal('show');
return;
}
if ($('#genDefUser').val() == 5) {
// 验证手机号
var phoneReg = /^1[0-9]{10}$/;
if (!phoneReg.test($('#phone').val())) {
$("#tipMsg").text("手机号不正确");
$("#tipModal").modal('show');
return;
}
// 验证身份证号
var idCardNumReg = /(^\d{15}$)|(^\d{17}(\d|X|x)$)/;
if (!idCardNumReg.test($('#idCardNum').val())) {
$("#tipMsg").text("身份证号不正确");
$("#tipModal").modal('show');
return;
}
// 验证银行卡号
var bankCardNumReg = /^\d{10,30}$/;
if (!bankCardNumReg.test($('#bankCardNum').val())) {
$("#tipMsg").text("银行卡号不正确");
$("#tipModal").modal('show');
return;
}
// 验证支付密码
var paymentPwdReg = /^\d{6}$/;
if (!paymentPwdReg.test($('#paymentPwd').val())) {
$("#tipMsg").text("支付密码不正确必须为6位数字");
$("#tipModal").modal('show');
return;
}
}
showLoading();
$.ajax({
type: "post",
url: "/admin/gen/account/add.action",
data: $('#addForm').serialize(),
dataType: 'json',
success: function (json) {
if (json.success == 'true') {
$("#genAccountModal").modal('hide');
$("#tipMsg").text(json.msg);
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
hideLoading();
} else {
$("#tipMsg").text("保存失败,错误信息:" + json.msg);
$("#tipModal").modal('show');
hideLoading();
}
}
})
}
});
$('#genDefUser').on('change', function () {
var defUser = $('#genDefUser').val();
if (defUser == 4) {
$('#header_block').attr('style', 'display:none;');
} else if (defUser == 5) {
$('#header_block').removeAttr('style');
}
});
//导出
$('#btnExport').on('click', function () {
var startTime = $('#startTime').val();
var endTime = $('#endTime').val();
if (null == startTime || startTime.trim() == '') {
$("#tipMsg").text("开始日期不能为空");
$("#tipModal").modal('show');
return;
}
if (null == endTime || endTime.trim() == '') {
$("#tipMsg").text("结束日期不能为空");
$("#tipModal").modal('show');
return;
}
if (startTime > endTime) {
$("#tipMsg").text("开始日期不能大于结束日期");
$("#tipModal").modal('show');
return;
}
var form = $("#searchForm");
form.attr("action", "/admin/gen/account/export");
form.submit();
});
});
}
},
};
</script>
<style scoped></style>

View File

@@ -0,0 +1,171 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<section class="content">
<div id="toolbar">
<div class="bar1 col-sm-12">
<label for="uid" class="col-sm-1">赠送人Uid: </label><input type="number" class="input-sm col-sm-2"
id="uid">
<label for="targetuid" class="col-sm-1">被赠送人Uid: </label><input type="number"
class="input-sm col-sm-2" id="targetuid">
<label for="roomuid" class="col-sm-1">房间roomUid: </label><input type="number"
class="input-sm col-sm-2" id="roomuid">
</div>
<div class="bar2 col-sm-12">
<label for="giftNum" class="col-sm-1">礼物数:</label><input type="number" class="input-sm col-sm-2"
id="giftNum">
<label for="gift" class="col-sm-1">赠送礼物类型:</label><select name="gift" id="gift"
class="input-m col-sm-2">
</select>
</div>
<button id="btnSearch" class="btn btn-sm btn-primary">赠送</button>
</div>
<div class="record">
<div class="title">操作记录</div>
<table class="recordTable">
<thead>
<tr>
<th>受赠人uid</th>
<th>受赠人金币</th>
<th>受赠人钻石</th>
<th>操作时间</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</section>
</div>
</div>
</section>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "GiftAdminView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
setSelectOption();
$('#btnSearch').on('click', function () {
var searchObj = {
uid: $('#uid').val(),
targetUid: $('#targetuid').val(),
roomUid: $('#roomuid').val(),
giftId: $('#gift').val(),
giftNum: $('#giftNum').val()
}
$.ajax({
type: 'post',
url: '/admin/gift/repairdiamond',
data: searchObj,
dataType: 'json',
success: function (res) {
console.log(res);
if (res.code == 200) {
$("#tipMsg").text("赠送成功");
$("#tipModal").modal('show');
$('.recordTable').show();
var $tbody = $('.recordTable tbody');
var $tr = $('<tr />');
var str = '<td>' + res.data.uid + '</td><td>' + res.data.goldNum + '</td><td>' + res.data.diamondNum + '</td><td>' + new Date(res.data.updateTime).format('yyyy-MM-dd hh:mm:ss') + '</td>';
$tr.html(str);
$tbody.append($tr);
} else {
$("#tipMsg").text("参数错误");
$("#tipModal").modal('show');
}
}
})
})
})
}
},
};
function setSelectOption() {
$.ajax({
type: 'post',
url: '/admin/gift/getAll',
dataType: 'json',
data: {
consumeType: 1
},
success: function (res) {
if (res.code == 200) {
var data = res.data;
makeOption(data);
}
}
})
function makeOption(data) {
var str = '';
for (var i = 0; i < data.length; i++) {
str += '<option value="' + data[i].giftId + '">' + data[i].giftName + '</option>';
}
$('#gift').html(str);
}
}
</script>
<style scoped>
.bar1,
.bar2 {
margin-bottom: 10px;
}
label.col-sm-1 {
padding: 0;
line-height: 30px;
text-align: right;
/*padding-right: 4px;*/
}
label.col-sm-1 {
padding: 0;
line-height: 30px;
text-align: right;
/*padding-right: 4px;*/
}
input,
select {
margin-left: 8px;
margin-right: 8px;
}
#btnSearch {
margin-left: 36px;
}
.record {
margin-top: 10px;
}
.record .title {
font-size: 16px;
}
table {
width: 50%;
display: none;
margin-top: 10px;
}</style>

View File

@@ -0,0 +1,315 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<div id="toolbar">
<div class="col-sm-12">
<button id="btnAdd" class="btn btn-default">
<i class="glyphicon glyphicon-plus"></i>增加
</button>
</div>
</div>
</div>
<!-- .content -->
<div id="table"></div>
</div>
</section>
<div class="modal fade" id="roomTagModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="modalLabel">新增</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" id="addForm">
<input type="hidden" name="id" id="id" />
<div class="form-group" id="txtBox">
<label for="giftId" class="col-sm-3 control-label">礼物id<font color="red">*</font></label>
<div class="col-sm-9">
<input type="text" class="form-control validate[required]" name="giftId" id="giftId"
placeholder="请输入对应的id">
</div>
</div>
<div class="form-group">
<label for="orderNo" class="col-sm-3 control-label">展示排序<font color="red">*</font></label>
<div class="col-sm-9">
<input type="text" class="form-control validate[required]" name="orderNo" id="orderNo"
placeholder="数字小的排前面,必填">
</div>
</div>
<div class="form-group">
<label for="serviceNotice" class="col-sm-3 control-label">是否全服通知:</label>
<div class="col-sm-9">
<select name="serviceNotice" id="serviceNotice">
<option value="1"></option>
<option value="0"></option>
</select>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="add">确定</button>
</div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
import { serverError } from '@/utils/maintainer';
export default {
name: "GiftCompoundView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{ field: 'id', title: 'ID', align: 'center', valign: 'middle', width: '10%' },
{ field: 'giftId', title: '礼物id', align: 'center', valign: 'middle', width: '10%' },
{ field: 'goldPrice', title: '礼物价值', align: 'center', valign: 'middle', width: '10%' },
{ field: 'giftName', title: '礼物名称', align: 'left', valign: 'middle', width: '10%' },
{ field: 'orderNo', title: '显示排序', align: 'center', valign: 'middle', width: '10%' },
{
field: 'serviceNotice',
title: '是否全服通知',
align: 'center',
width: '5%',
valign: 'middle',
formatter: function (val, row, index) {
if (val == 1) {
return "是";
} else {
return '否';
}
}
},
{
field: 'id',
title: '操作',
align: 'center',
width: '10%',
formatter: function (val, row, index) {
return '<button id="btnEdit" name="btnEdit" class="btn btn-sm btn-success opt-edit" data-id=' + val + '>' +
'<i class="glyphicon glyphicon-edit"></i> 编辑</button>' +
'&nbsp;&nbsp;<button class="btn btn-sm btn-danger opt-remove" data-id=' + val + ' data-new-status=' + 2 +
'><i class="glyphicon glyphicon-remove"></i>删除</button>';
}
}
],
undefinedText: "-",
cache: false,
striped: true,
showRefresh: false,
pageSize: 50,
pagination: true,
pageList: [20, 50, 100, 200, 300, 500],
search: false,
sidePagination: "server", //表示服务端请求
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageNum: params.pageNumber,
pageSize: params.pageSize
};
return param;
},
ajax: function (request) { //使用ajax请求
$.ajax({
type: "GET",
url: '/admin/gift/compound/list.action',
contentType: 'application/json;charset=utf-8',
dataType: 'json',
data: request.data,
success: function (res) {
apiResult(res);
request.success({
rows: res.data.rows,
total: res.data.total,
});
},
error: function (req) {
serverError(req);
}
})
},
toolbar: '#toolbar',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
});
// 查询刷新
$('#btnSearch').on('click', function () {
TableHelper.doRefresh('#table');
});
//新建标签
$("#btnAdd").click(function () {
clearModal();
$("#roomTagModal").modal('show');
});
$("#add").click(function () {
var id = $("#id").val();
var giftId = $('#giftId').val();
var giftName = $("#giftName").val();
var orderNo = $('#orderNo').val();
var serviceNotice = $('#serviceNotice').val();
if ($("#addForm").validationEngine('validate')) {
$.ajax({
type: "post",
url: "/admin/gift/compound/saveReward.action",
data: {
id: id,
giftId: giftId,
giftName: giftName,
orderNo: orderNo,
serviceNotice: serviceNotice,
rewardType: 1,
},
dataType: "json",
success: function (json) {
if (json.code == 200) {
$("#tipMsg").text("保存成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
$("#roomTagModal").modal('hide');
} else {
$("#tipMsg").text("保存失败." + json.message);
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
$("#roomTagModal").modal('hide');
}
}
});
}
});
$("#table").on("click", '.opt-edit', function () {
var id = $(this).attr("data-id");
clearModal();
$.ajax({
type: "get",
url: "/admin/gift/compound/getById.action",
data: { id: id },
dataType: "json",
success: function (res) {
var json = res.data;
if (json) {
$("#id").val(id);
$('#giftId').val(json.giftId);
$('#orderNo').val(json.orderNo);
$('#serviceNotice').val(json.serviceNotice);
// 打开编辑弹窗
$("#roomTagModal").modal('show');
$("#modalLabel").text("编辑");
} else {
$("#tipMsg").text("获取信息出错");
$("#tipModal").modal('show');
}
}
});
});
$("#table").on("click", '.opt-remove', function () {
var id = $(this).attr("data-id");
console.log("data-id", id)
if (confirm("你确认删除该记录吗? \r\n 删除后再也不能找回,请谨慎操作!")) {
const requestParam = {
id: id
}
$.ajax({
type: "get",
url: "/admin/gift/compound/deleteReward",
data: requestParam,
dataType: "json",
contentType: 'application/json',
success: function (json) {
if (json.code == 200) {
$("#tipMsg").text("修改成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("修改失败." + json.message);
$("#tipModal").modal('show');
}
}
});
}
});
function apiResult(json) {
if (json.code == 200 && json.message == 'success') {
return true;
}
$("#tipMsg").text("请求失败,错误信息:" + json.message);
$("#tipModal").modal('show');
return false;
}
function clearModal() {
$('#iconImgUrl').attr('src', '');
$('#addForm').find('input[type=text],input[type=hidden],input[type=file]').each(function () {
$(this).val('');
})
$('#type').val(1);
}
$("#type").change(function () {
var optVal = $(this).val();
});
});
}
},
};
</script>
<style scoped></style>

View File

@@ -0,0 +1,372 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<div id="toolbar">
<div class="col-sm-12">
奖池<select name="qLuckyBagId" id="qLuckyBagId"></select>
<button id="btnSearch" class="btn btn-sm btn-primary">查询</button>
<button id="btnAdd" class="btn btn-default">
<i class="glyphicon glyphicon-plus"></i>增加
</button>
</div>
<div class="col-sm-4">
<span>期望值</span>
<span class="sumExpectValue"></span>
</div>
</div>
</div>
<!-- .content -->
<div id="table"></div>
</div>
</section>
<div class="modal fade" id="roomTagModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="modalLabel">新增</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" id="addForm">
<input type="hidden" name="id" id="id" />
<div class="form-group">
<label for="modal_luckyBagId" class="col-sm-3 control-label">奖池id<font color="red">*</font>
</label>
<div class="col-sm-9">
<select name="luckyBagId" id="modal_luckyBagId" class="form-control" disabled="disabled">
</select>
</div>
</div>
<div class="form-group" id="txtBox">
<label for="giftId" class="col-sm-3 control-label">礼物id<font color="red">*</font></label>
<div class="col-sm-9">
<input type="text" class="form-control validate[required]" name="giftId" id="giftId"
placeholder="请输入对应的id">
</div>
</div>
<div class="form-group">
<label for="rate" class="col-sm-3 control-label">概率<font color="red">*</font></label>
<div class="col-sm-9">
<input type="text" class="form-control validate[required]" name="rate" id="rate"
placeholder="概率数字">
</div>
</div>
<div class="form-group">
<label for="serviceNotice" class="col-sm-3 control-label">是否全服通知:</label>
<div class="col-sm-9">
<select name="serviceNotice" id="serviceNotice">
<option value="0"></option>
<option value="1"></option>
</select>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="add">确定</button>
</div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
import { serverError } from '@/utils/maintainer';
export default {
name: "GiftLimitCompoundPoolView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
getLuckyBagGift();
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{ field: 'id', title: 'ID', align: 'center', valign: 'middle', width: '10%' },
{ field: 'giftId', title: '礼物id', align: 'center', valign: 'middle', width: '10%' },
{ field: 'goldPrice', title: '礼物价值', align: 'center', valign: 'middle', width: '10%' },
{ field: 'giftName', title: '礼物名称', align: 'left', valign: 'middle', width: '10%' },
{ field: 'giftRate', title: '合成礼物概率', align: 'center', valign: 'middle', width: '10%' },
{ field: 'expendValue', title: '合成消耗', align: 'center', valign: 'middle', width: '10%' },
{ field: 'expectValue', title: '期望值 ', align: 'center', valign: 'middle', width: '10%' },
{
field: 'serviceNotice',
title: '是否全服通知',
align: 'center',
width: '5%',
valign: 'middle',
formatter: function (val, row, index) {
if (val == 1) {
return "是";
} else {
return '否';
}
}
},
{
field: 'id',
title: '操作',
align: 'center',
width: '10%',
formatter: function (val, row, index) {
if (row.giftId == null) {
return;
}
return '<button id="btnEdit" name="btnEdit" class="btn btn-sm btn-success opt-edit" data-id=' + val + '>' +
'<i class="glyphicon glyphicon-edit"></i> 编辑</button>' +
'&nbsp;&nbsp;<button class="btn btn-sm btn-danger opt-remove" data-id=' + val + ' data-new-status=' + 2 +
'><i class="glyphicon glyphicon-remove"></i>删除</button>';
}
}
],
undefinedText: "-",
cache: false,
striped: true,
showRefresh: false,
pageSize: 50,
pagination: true,
pageList: [20, 50, 100, 200, 300, 500],
search: false,
sidePagination: "server", //表示服务端请求
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageNum: params.pageNumber,
pageSize: params.pageSize,
rewardId: $('#qLuckyBagId').val(),
};
return param;
},
ajax: function (request) { //使用ajax请求
$.ajax({
type: "GET",
url: '/admin/gift/compound/limtList.action',
contentType: 'application/json;charset=utf-8',
dataType: 'json',
data: request.data,
success: function (res) {
apiResult(res);
$('.sumExpectValue').html(res.data.sumExpectValue)
request.success({
rows: res.data.rows,
total: res.data.total,
});
},
error: function (req) {
serverError(req);
}
})
},
toolbar: '#toolbar',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
});
// 查询刷新
$('#btnSearch').on('click', function () {
TableHelper.doRefresh('#table');
$("#modal_luckyBagId").val($('#qLuckyBagId').val())
});
//新建标签
$("#btnAdd").click(function () {
clearModal();
$("#roomTagModal").modal('show');
});
$("#add").click(function () {
var id = $("#id").val();
var giftId = $('#giftId').val();
var rate = $('#rate').val();
var orderNo = $('#orderNo').val();
var serviceNotice = $('#serviceNotice').val();
if ($("#addForm").validationEngine('validate')) {
$.ajax({
type: "post",
url: "/admin/gift/compound/saveRewardPool.action",
data: {
id: id,
giftId: giftId,
rate: rate,
orderNo: orderNo,
serviceNotice: serviceNotice,
rewardId: $("#modal_luckyBagId").val(),
rewardType: 2,
},
dataType: "json",
success: function (json) {
if (json.code == 200) {
$("#tipMsg").text("保存成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
$("#roomTagModal").modal('hide');
} else {
$("#tipMsg").text("保存失败." + json.message);
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
$("#roomTagModal").modal('hide');
}
}
});
}
});
$("#table").on("click", '.opt-edit', function () {
var id = $(this).attr("data-id");
clearModal();
$.ajax({
type: "get",
url: "/admin/gift/compound/getByLimitId.action",
data: { id: id },
dataType: "json",
success: function (res) {
var json = res.data;
if (json) {
$("#id").val(id);
$('#giftId').val(json.giftId);
$('#rate').val(json.giftRate);
$('#serviceNotice').val(json.serviceNotice);
// 打开编辑弹窗
$("#roomTagModal").modal('show');
$("#modalLabel").text("编辑");
} else {
$("#tipMsg").text("获取信息出错");
$("#tipModal").modal('show');
}
}
});
});
$("#table").on("click", '.opt-remove', function () {
var id = $(this).attr("data-id");
console.log("data-id", id)
if (confirm("你确认删除该记录吗? \r\n 删除后再也不能找回,请谨慎操作!")) {
const requestParam = {
rewardPoolId: id
}
$.ajax({
type: "get",
url: "/admin/gift/compound/deleteRewardPool",
data: requestParam,
dataType: "json",
contentType: 'application/json',
success: function (json) {
if (json.code == 200) {
$("#tipMsg").text("修改成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("修改失败." + json.message);
$("#tipModal").modal('show');
}
}
});
}
});
function apiResult(json) {
if (json.code == 200 && json.message == 'success') {
return true;
}
$("#tipMsg").text("请求失败,错误信息:" + json.message);
$("#tipModal").modal('show');
return false;
}
function clearModal() {
$('#iconImgUrl').attr('src', '');
$('#addForm').find('input[type=text],input[type=hidden],input[type=file]').each(function () {
$(this).val('');
})
$('#type').val(1);
}
//查询刷新
$('#btnSearch').on('click', function () {
TableHelper.doRefresh('#table');
});
$("#type").change(function () {
var optVal = $(this).val();
});
});
}
},
};
// 获取所有福袋礼物
function getLuckyBagGift() {
$.ajax({
type: "get",
url: "/admin/gift/compound/getPoolItem.action",
data: {
pageNum: 1,
pageSize: 100
},
dataType: "json",
async: false,
success: function (res) {
console.log(res);
if (res) {
var data = res.rows;
var options = [];
for (var i = 0, len = data.length; i < len; i++) {
var item = data[i];
//拼接成多个<option><option/>
options.push('<option value="' + item.id + '">' + item.giftName + '</option>')
}
$("#qLuckyBagId").html(options.join(' ')); //填充到select标签中
$("#modal_luckyBagId").html(options.join(' ')); //填充到select标签中
}
},
error: function () {
alert('查询奖池出错');
}
});
}
</script>
<style scoped></style>

View File

@@ -0,0 +1,296 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<div id="toolbar">
<div class="col-sm-12">
<button id="btnAdd" class="btn btn-default">
<i class="glyphicon glyphicon-plus"></i>增加
</button>
</div>
</div>
</div>
<!-- .content -->
<div id="table"></div>
</div>
</section>
<div class="modal fade" id="roomTagModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="modalLabel">新增</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" id="addForm">
<input type="hidden" name="id" id="id" />
<div class="form-group" id="txtBox">
<label for="giftId" class="col-sm-3 control-label">礼物id<font color="red">*</font></label>
<div class="col-sm-9">
<input type="text" class="form-control validate[required]" name="giftId" id="giftId"
placeholder="请输入对应的id">
</div>
</div>
<div class="form-group">
<label for="orderNo" class="col-sm-3 control-label">展示排序<font color="red">*</font></label>
<div class="col-sm-9">
<input type="text" class="form-control validate[required]" name="orderNo" id="orderNo"
placeholder="数字小的排前面,必填">
</div>
</div>
<div class="form-group">
<label for="expendValue" class="col-sm-3 control-label">合成消耗<font color="red">*</font></label>
<div class="col-sm-9">
<input type="text" class="form-control validate[required]" name="expendValue"
id="expendValue" placeholder="数字小的排前面,必填">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="add">确定</button>
</div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
import { serverError } from '@/utils/maintainer';
export default {
name: "GiftLimitCompoundView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{ field: 'id', title: 'ID', align: 'center', valign: 'middle', width: '10%' },
{ field: 'giftId', title: '礼物id', align: 'center', valign: 'middle', width: '10%' },
{ field: 'goldPrice', title: '礼物价值', align: 'center', valign: 'middle', width: '10%' },
{ field: 'expendValue', title: '合成消耗', align: 'center', valign: 'middle', width: '10%' },
{ field: 'giftName', title: '礼物名称', align: 'left', valign: 'middle', width: '10%' },
{ field: 'orderNo', title: '显示排序', align: 'center', valign: 'middle', width: '10%' },
{
field: 'id',
title: '操作',
align: 'center',
width: '10%',
formatter: function (val, row, index) {
return '<button id="btnEdit" name="btnEdit" class="btn btn-sm btn-success opt-edit" data-id=' + val + '>' +
'<i class="glyphicon glyphicon-edit"></i> 编辑</button>' +
'&nbsp;&nbsp;<button class="btn btn-sm btn-danger opt-remove" data-id=' + val + ' data-new-status=' + 2 +
'><i class="glyphicon glyphicon-remove"></i>删除</button>';
}
}
],
undefinedText: "-",
cache: false,
striped: true,
showRefresh: false,
pageSize: 50,
pagination: true,
pageList: [20, 50, 100, 200, 300, 500],
search: false,
sidePagination: "server", //表示服务端请求
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageNum: params.pageNumber,
pageSize: params.pageSize
};
return param;
},
ajax: function (request) { //使用ajax请求
$.ajax({
type: "GET",
url: '/admin/gift/compound/getLimitGiftList.action',
contentType: 'application/json;charset=utf-8',
dataType: 'json',
data: request.data,
success: function (res) {
apiResult(res);
request.success({
rows: res.data.rows,
total: res.data.total,
});
},
error: function (req) {
serverError(req);
}
})
},
toolbar: '#toolbar',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
});
// 查询刷新
$('#btnSearch').on('click', function () {
TableHelper.doRefresh('#table');
});
//新建标签
$("#btnAdd").click(function () {
clearModal();
$("#txtBox").show();
$("#roomTagModal").modal('show');
});
$("#add").click(function () {
var id = $("#id").val();
var giftId = $('#giftId').val();
var expendValue = $("#expendValue").val();
var orderNo = $('#orderNo').val();
if ($("#addForm").validationEngine('validate')) {
$.ajax({
type: "post",
url: "/admin/gift/compound/saveReward.action",
data: {
id: id,
giftId: giftId,
expendValue: expendValue,
orderNo: orderNo,
rewardType: 2,
},
dataType: "json",
success: function (json) {
if (json.code == 200) {
$("#tipMsg").text("保存成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
$("#roomTagModal").modal('hide');
} else {
$("#tipMsg").text("保存失败." + json.message);
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
$("#roomTagModal").modal('hide');
}
}
});
}
});
$("#table").on("click", '.opt-edit', function () {
var id = $(this).attr("data-id");
clearModal();
$("#txtBox").hide();
$.ajax({
type: "get",
url: "/admin/gift/compound/getLimitGtifById.action",
data: { id: id },
dataType: "json",
success: function (res) {
var json = res.data;
if (json) {
$("#id").val(id);
$('#giftId').val(json.giftId);
$('#orderNo').val(json.orderNo);
$('#expendValue').val(json.expendValue);
// 打开编辑弹窗
$("#roomTagModal").modal('show');
$("#modalLabel").text("编辑");
} else {
$("#tipMsg").text("获取信息出错");
$("#tipModal").modal('show');
}
}
});
});
$("#table").on("click", '.opt-remove', function () {
var id = $(this).attr("data-id");
console.log("data-id", id)
if (confirm("你确认删除该记录吗? \r\n 删除后再也不能找回,请谨慎操作!")) {
const requestParam = {
id: id
}
$.ajax({
type: "get",
url: "/admin/gift/compound/deleteReward",
data: requestParam,
dataType: "json",
contentType: 'application/json',
success: function (json) {
if (json.code == 200) {
$("#tipMsg").text("修改成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("修改失败." + json.message);
$("#tipModal").modal('show');
}
}
});
}
});
function apiResult(json) {
if (json.code == 200 && json.message == 'success') {
return true;
}
$("#tipMsg").text("请求失败,错误信息:" + json.message);
$("#tipModal").modal('show');
return false;
}
function clearModal() {
$('#iconImgUrl').attr('src', '');
$('#addForm').find('input[type=text],input[type=hidden],input[type=file]').each(function () {
$(this).val('');
})
$('#type').val(1);
}
$("#type").change(function () {
var optVal = $(this).val();
});
});
}
},
};
</script>
<style scoped></style>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,324 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<!-- .content -->
<section class="content">
<div id="table"></div>
<div id="toolbar">
<button id="giftNotifyConfig-add" class="btn btn-default">
<i class="glyphicon glyphicon-plus"></i>增加
</button>
<button id="giftNotifyConfig-multiDel" class="btn btn-default">
<i class="glyphicon glyphicon-wrench"></i>批量删除
</button>
</div>
</section><!-- .content -->
</div>
</div>
</section>
<div class="modal fade" id="giftNotifyConfigModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="modalLabel">全服通知配置管理</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" id="giftNotifyConfigForm">
<input type="hidden" name="notifyConfigId" id="notifyConfigId" />
<div class="form-group">
<label for="notifyLevelId" class="col-sm-2 control-label">通知等级</label>
<div class="col-sm-4">
<select class="form-control validate[required]" name="notifyLevelId" id="notifyLevelId"
data-btn-class="btn-warning">
</select>
</div>
</div>
<div id="giftForm" class="form-group" style="display:none">
<label for="giftId" class="col-sm-2 control-label">礼物id</label>
<div class="col-sm-4">
<select class="form-control combobox validate[required]" name="giftId" id="giftId"></select>
</div>
</div>
<div id="goldForm" class="form-group">
<label for="minGold" class="col-sm-2 control-label">触发金额</label>
<div class="col-sm-4">
<input type="text" class="form-control validate[required]" name="minGold" id="minGold">
</div>
<div class="col-sm-4">
<input type="text" class="form-control validate[required]" name="maxGold" id="maxGold">
</div>
</div>
<div class="form-group">
<label for="notifyTriggerType" class="col-sm-2 control-label">触发类型</label>
<div id="notifyTriggerType" class="col-sm-10">
<label><input type="radio" name="notifyTriggerType" value="1" checked />金额触发</label>
<label><input type="radio" name="notifyTriggerType" value="2" />指定礼物触发</label>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="save">保存</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="tipModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">提示信息</h4>
</div>
<div class="modal-body" id="tipMsg"></div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
import ComboboxHelper from '@/assets/plugins/bootstrap-combobox/js/bootstrap-combobox-helper';
// ComboboxHelper.build('/admin/giftNotifyLevel/getAll.action','#notifyLevelId',"0");
// ComboboxHelper.build('/admin/gift/all.action','#giftId',"0");
export default {
name: "GiftNotifyConfigAdminView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
getSelectData();
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{ field: 'tmp', title: 'ID', align: 'center', checkbox: true },
{ field: 'notifyConfigId', title: '通知配置id', align: 'center', width: '5%' },
{ field: 'notifyLevelId', title: '全服等级id', align: 'center', width: '5%' },
{
field: 'notifyLevelHomeShow', title: '是否房间外展示', align: 'center', width: '5%', formatter: function (val, row, index) {
return val ? '是' : '否';
}
},
{
field: 'notifyTriggerType', title: '通知触发类型', align: 'center', width: '5%', formatter: function (val, row, index) {
if (val == 1) {
return '金额触发';
} else {
return '指定礼物触发'
}
}
},
{ field: 'giftId', title: '礼物id', align: 'center', width: '5%' },
{ field: 'giftName', title: '礼物名称', align: 'center', width: '10%' },
{ field: 'minGold', title: '最小金额', align: 'center', width: '5%' },
{ field: 'maxGold', title: '最大金额', align: 'center', width: '5%' },
{
field: 'createTime', title: '创建时间', align: 'center', width: '10%', formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format("yyyy-MM-dd hh:mm");
} else {
return '-';
}
}
},
{
field: 'notifyConfigId', title: '操作', align: 'center', width: '25%', formatter: function (val, row, index) {
return '&nbsp;&nbsp;<button class="btn btn-sm btn-danger opt-remove" data-id=' + val +
'><i class="glyphicon glyphicon-remove"></i>删除</button>';
}
}
],
cache: false,
striped: true,
showRefresh: true,
pageSize: 10,
pagination: true,
pageList: [1, 10, 20, 30, 50],
search: false,
sidePagination: "server", //表示服务端请求
//设置为undefined可以获取pageNumberpageSizesearchTextsortNamesortOrder
//设置为limit可以获取limit, offset, search, sort, order
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageNumber: params.pageNumber,
pageSize: params.pageSize,
searchText: params.searchText
};
return param;
},
toolbar: '#toolbar',
url: '/admin/giftNotifyConfig/getList.action',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
});
$("#table").on("click", '.opt-remove', function () {
var id = $(this).attr("data-id");
if (id == 'undefined') {
$("#tipMsg").text("id参数有误");
$("#tipModal").modal('show');
return;
}
if (confirm("你确认删除该记录吗?" +
"\r\n删除后再也不能找回请谨慎操作")) {
$.ajax({
type: 'post',
url: "/admin/giftNotifyConfig/del.action",
data: { 'ids': JSON.stringify([id]) },
dataType: "json",
success: function (json) {
if (json.success == 'true') {
$("#tipMsg").text("删除成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("删除失败");
$("#tipModal").modal('show');
}
}
});
}
});
$("#giftNotifyConfig-add").click(function () {
// 打开编辑弹窗
$("#giftNotifyConfigModal").modal('show');
$("#giftNotifyConfigForm")[0].reset();
$("#notifyConfigId").val('');
$("#giftForm").hide();
$("#goldForm").show();
});
$("#giftNotifyConfig-multiDel").click(function () {
var rows = $("#table").bootstrapTable("getSelections");
if (rows.length == 0) {
alert("请先选择要删除的记录");
return;
}
console.log("rows: " + rows.length);
var idArr = [];
for (var i = 0; i < rows.length; i++) {
idArr.push(rows[i]['notifyConfigId']);
}
console.log(idArr);
if (confirm("你确认批量删除该记录吗?" +
"\r\n删除后再也不能找回请谨慎操作")) {
$.ajax({
type: 'post',
url: "/admin/giftNotifyConfig/del.action",
data: { 'ids': JSON.stringify(idArr) },
dataType: "json",
success: function (json) {
if (json.success == 'true') {
$("#tipMsg").text("删除成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("删除失败");
$("#tipModal").modal('show');
}
}
});
}
});
$("input:radio[name='notifyTriggerType']").change(function () {
var val = $("input[name='notifyTriggerType']:checked").val();
if (val == 1) {
$("#giftForm").hide();
$("#goldForm").show();
} else {
$("#giftForm").show();
$("#goldForm").hide();
}
$("#minGold").val('');
$("#maxGold").val('');
ComboboxHelper.setDef("#giftId", '0');
});
$("#cancel").click(function () {
TableHelper.unCheckAll("#table");
});
$("#save").click(function () {
if ($("#giftNotifyConfigForm").validationEngine('validate')) {
$.ajax({
type: "post",
url: "/admin/giftNotifyConfig/save.action",
data: $('#giftNotifyConfigForm').serialize(),
dataType: "json",
success: function (json) {
if (json.success == 'true') {
$("#giftNotifyConfigModal").modal('hide');
$("#tipMsg").text("保存成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("保存失败,原因是: " + json.msg);
$("#tipModal").modal('show');
}
}
});
}
});
});
}
},
};
function getSelectData() {
$.ajax({
type: 'post',
url: '/admin/giftNotifyLevel/getAll.action',
dataType: 'json',
success: function (list) {
var options = '';
for (var i = 0; i < list.length; i++) {
options += "<option value='" + list[i].oval + "'>" + list[i].otxt + "</option>";
}
$('#notifyLevelId').append(options);
}
});
$.ajax({
type: 'post',
url: '/admin/gift/all.action',
dataType: 'json',
success: function (list) {
var options = '';
for (var i = 0; i < list.length; i++) {
options += "<option value='" + list[i].oval + "'>" + list[i].otxt + "</option>";
}
$('#giftId').append(options);
$('#giftId').combobox();
$('#giftId').data('combobox').toggle();
}
});
}
</script>
<style scoped></style>

View File

@@ -0,0 +1,204 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<div id="table"></div>
<form>
</form>
<form id="searchForm" method="get" target="_blank">
<div id="toolbar">
送礼用户id<input type="text" name="senderErbanNo" id="senderErbanNo" class="input-sm" />
收礼用户id<input type="text" name="receiverErbanNo" id="receiverErbanNo" class="input-sm" />
礼物类型
<select name="giftType" id="giftType">
<option value="">全部</option>
<option value="0">背包礼物</option>
<option value="2">普通礼物</option>
<option value="5">福袋奖池礼物</option>
<option value="7">贵族礼物</option>
<option value="8">周星榜礼物</option>
</select>
礼物名称<input type="text" name="giftName" id="giftName" class="input-sm" />
送礼时间<input type="text" name="startTime" id="startTime" class="input-sm">
- <input type="text" name="endTime" id="endTime" class="input-sm">
<button id="btnSearch" class="btn btn-sm btn-primary">查询</button>
<button id="btnExport" class="btn btn-sm btn-primary">导出</button>
</div>
</form>
</div>
</div>
</section>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "GiftSendRecordView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
let tableLoaded = false;
let currParams = {};
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{ field: 'senderErbanNo', title: '送礼用户id', align: 'center', width: '8%' },
{ field: 'senderNick', title: '送礼用户昵称', align: 'center', width: '16%' },
{ field: 'receiverErbanNo', title: '收礼用户id', align: 'center', width: '8%' },
{ field: 'receiverNick', title: '收礼用户昵称', align: 'center', width: '16%' },
{ field: 'giftType', title: '礼物类型', align: 'center', width: '16%' },
{ field: 'giftName', title: '礼物名称', align: 'center', width: '10%' },
{ field: 'giftNum', title: '礼物数量', align: 'center', width: '6%' },
{ field: 'totalGoldNum', title: '礼物总价值(钻)', align: 'center', width: '10%' },
{
field: 'createTime',
title: '送礼时间',
align: 'center',
valign: 'middle',
width: '10%',
formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format("yyyy-MM-dd hh:mm:ss");
} else {
return '-';
}
}
}
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pagination: true,
pageList: [10, 20, 30, 50],
sidePagination: "server", //表示服务端请求
//设置为undefined可以获取pageNumberpageSizesearchTextsortNamesortOrder
//设置为limit可以获取limit, offset, search, sort, order
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageSize: params.pageSize,
page: params.pageNumber,
senderErbanNo: $("#senderErbanNo").val(),
receiverErbanNo: $("#receiverErbanNo").val(),
giftType: $("#giftType").val(),
giftName: $("#giftName").val(),
startTime: $("#startTime").val(),
endTime: $("#endTime").val(),
};
currParams = param;
console.log(currParams);
return param;
},
uniqueId: 'code',
toolbar: '#toolbar',
url: '/admin/giftSendRecord/list',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
tableLoaded = true;
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
tableLoaded = false;
}
})
$('#btnSearch').on('click', function () {
// if(!$('#senderErbanNo').val() || !$('#startTime').val() || !$('#endTime').val()){
// $("#tipMsg").text("请输入必填的信息");
// $("#tipModal").modal('show');
// return;
// }
console.debug('ASDFASDF')
// if ($('#startTime').val() && $('#endTime').val()) {
// var dateStart = new Date($('#startTime').val().replace(/\-/g, "/"));
// var dateEnd = new Date($('#endTime').val().replace(/\-/g, "/"));
// var diffDays = parseInt((dateEnd.getTime() - dateStart.getTime()) / parseInt(1000 * 3600 * 24));
// console.log(diffDays);
// if (diffDays > 120) {
// $("#tipMsg").text("开始时间与结束时间跨度不能超过3个月");
// $("#tipModal").modal('show');
// return;
// }
// }
if (tableLoaded || currParams.pageNumber > 1) {
TableHelper.doRefreshAndToPage1('#table');
} else {
TableHelper.doRefresh('#table');
}
})
var picker1 = $("#startTime").datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
autoclose: true
})
var picker2 = $('#endTime').datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
autoclose: true
})
picker1.on('changeDate', function () {
var date = $('#startTime').datetimepicker('getDate');
picker2.datetimepicker('setStartTime', date);
});
picker2.on('changeDate', function () {
var date = $('#endTime').datetimepicker('getDate');
picker1.datetimepicker('setEndTime', date);
});
// 导出excel
$('#btnExport').on('click', function () {
var startDate = $('#startTime').val();
var endDate = $('#endTime').val();
if (null == startDate || startDate.trim() == '') {
$("#tipMsg").text("开始日期不能为空");
$("#tipModal").modal('show');
return;
}
if (null == endDate || endDate.trim() == '') {
$("#tipMsg").text("结束日期不能为空");
$("#tipModal").modal('show');
return;
}
if (startDate > endDate) {
$("#tipMsg").text("开始日期不能大于结束日期");
$("#tipModal").modal('show');
return;
}
const senderErbanNo = $("#senderErbanNo").val();
const receiverErbanNo = $("#receiverErbanNo").val();
const giftType = $("#giftType").val();
const giftName = $("#giftName").val();
const startTime = $("#startTime").val();
const endTime = $("#endTime").val();
console.log("--------", senderErbanNo, receiverErbanNo, giftType, giftName, startTime, endTime);
window.location.href = `/admin/giftSendRecord/export?senderErbanNo=${senderErbanNo}&receiverErbanNo=${receiverErbanNo}&giftType=${giftType}&giftName=${giftName}&startTime=${startTime}&endTime=${endTime}`
})
}
},
};
</script>
<style scoped>
#senderErbanNo,
#giftType,
#startTime,
#endTime {
margin-right: 4px;
}
</style>

View File

@@ -0,0 +1,137 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<!-- .content -->
<div id="table"></div>
<div id="toolbar">
<form id="searchForm" action="/admin/gift/export" method="get" target="_blank">
<div class="col-sm-12">
<label for="receivedId" class="col-sm-1 control-label">平台号:</label>
<div class="col-sm-2"><input type="text" class="form-control" name="receivedId" id="receivedId">
</div>
<label for="giftId" class="col-sm-1 control-label">礼物ID:</label>
<div class="col-sm-2"><input type="text" class="form-control" name="giftId" id="giftId"></div>
<label for="giftName" class="col-sm-1 control-label">礼物名称:</label>
<div class="col-sm-2"><input type="text" class="form-control" name="giftName" id="giftName">
</div>
</div>
<div class="col-sm-12">
<label for="beginDate" class="col-sm-1 control-label">开始日期:</label>
<div class="col-sm-2"><input type="text" class="form-control" name="beginDate" id="beginDate">
</div>
<label for="endDate" class="col-sm-1 control-label">结束日期:</label>
<div class="col-sm-2"><input type="text" class="form-control" name="endDate" id="endDate"></div>
</div>
</form>
<div class="col-sm-12">
<button id="btnSearch" class="btn btn-default">
<i class="glyphicon glyphicon-search"></i>查询
</button>
<button id="btnExport" class="btn btn-default">
<i class="glyphicon glyphicon-export"></i>导出
</button>
</div>
</div>
</div>
</div>
</section>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "GiftStatisticsView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{ field: 'tmp', title: 'id', align: 'center', checkbox: true, width: '5%' },
{ field: 'createTime', title: '日期', align: 'center', width: '5%' },
{ field: 'giftId', title: '礼物ID', align: 'center', width: '5%' },
{ field: 'giftName', title: '礼物名称', align: 'center', width: '5%' },
{ field: 'totalNum', title: '礼物金额(金币)', align: 'center', width: '5%' },
{ field: 'giftStatus', title: '礼物状态', align: 'center', width: '5%' },
{ field: 'receivedGiftNum', title: '收到礼物数量', align: 'center', width: '5%' },
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 20,
pagination: true,
pageList: [20, 50, 100, 200, 300, 500],
search: false,
sidePagination: "server", //表示服务端请求
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageNum: params.pageNumber,
pageSize: params.pageSize,
receivedId: $('#receivedId').val(),
giftId: $('#giftId').val(),
giftName: $('#giftName').val(),
beginDate: $('#beginDate').val(),
endDate: $('#endDate').val(),
};
return param;
},
toolbar: '#toolbar',
url: '/admin/gift/statisticsGift.action',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
});
// 导出EXCEL
$('#btnExport').on('click', function () {
$("#searchForm").submit();
});
// 查询刷新
$('#btnSearch').on('click', function () {
TableHelper.doRefresh('#table');
});
var picker1 = $("#beginDate").datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
todayBtn: true,
autoclose: true,
});
var picker2 = $("#endDate").datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
todayBtn: true,
autoclose: true
});
picker1.on('changeDate', function () {
var date = $('#beginDate').datepicker('getDate');
picker2.datepicker('setStartDate', date);
});
picker2.on('changeDate', function () {
var date = $('#endDate').datepicker('getDate');
picker1.datepicker('setEndDate', date);
});
});
}
},
};
</script>
<style scoped></style>

View File

@@ -0,0 +1,166 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<div id="toolbar">
邀请码:<input type="text" class="input-sm" name="inviteCode" id="qInviteCode" , placeholder="多个用,隔开">
使用者手机号:<input type="text" class="input-sm" name="inviteCode" id="qPhone" , placeholder="多个用,隔开">
使用者平台号:<input type="text" class="input-sm" name="erbanNo" id="qErbanNo" , placeholder="多个用,隔开">
<!--应用:<select name="appSelector" id="appSelector" data-btn-class="btn-warning">
<option value="">全部</option>
<option value="PlanetStar">66星球</option>
<option value="yinyou">平台</option>
</select>-->
时间段:<input type="text" class="input-sm datetime" name="startTime" id="qStartTime">
-<input type="text" class="input-sm datetime" name="endTime" id="qEndTime">
<button id="btnSearch" class="btn btn-sm btn-primary">查询</button>
<button id="btnExport" class="btn btn-sm btn-primary">导出</button>
</div>
</div>
<!-- .content -->
<div id="table"></div>
</div>
</section>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "InviteCodeStatView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('.datetime').datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
autoclose: true
});
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{ field: 'inviteCode', title: '邀请码', align: 'center', width: '5%' },
{ field: 'erbanNo', title: '使用者平台号', align: 'center', width: '8%' },
{ field: 'nick', title: '使用者昵称', align: 'center', width: '8%' },
{ field: 'phone', title: '使用者手机号', align: 'center', width: '8%' },
{ field: 'inviteRegisterUserAmount', title: '邀请新注册人数', align: 'center', width: '5%' },
{ field: 'inviteDeviceAmount', title: '邀请新增设备数', align: 'center', width: '5%' },
{ field: 'inviteChargeUserAmount', title: '邀请充值人数', align: 'center', width: '5%' },
{ field: 'inviteChargeTime', title: '邀请充值次数', align: 'center', width: '5%' },
{ field: 'inviteChargeAmount', title: '邀请充值金额(美元)', align: 'center', valign: 'middle', width: '5%' },
{ field: 'inviteGiftSendUserAmount', title: '邀请送礼人数', align: 'center', valign: 'middle', width: '5%' },
{ field: 'inviteGiftSendAmount', title: '邀请送礼钻石数', align: 'center', valign: 'middle', width: '5%' },
],
undefinedText: "",
cache: false,
striped: true,
showRefresh: false,
pageSize: 20,
pagination: true,
pageList: [20, 50, 100, 200, 300, 500],
search: false,
sidePagination: "server", //表示服务端请求
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
page: params.pageNumber,
pageSize: params.pageSize,
inviteCode: $('#qInviteCode').val(),
phone: $('#qPhone').val(),
erbanNo: $('#qErbanNo').val(),
startTime: $('#qStartTime').val(),
endTime: $('#qEndTime').val(),
app: $('#appSelector').val(),
};
console.log(param);
return param;
},
ajax: function (request) { //使用ajax请求
$.ajax({
type: "GET",
url: '/admin/inviteCode/stats/listInviteCodeStats.action',
contentType: 'application/json;charset=utf-8',
dataType: 'json',
data: request.data,
success: function (res) {
console.log(res);
request.success({
rows: res.data.rows,
total: res.data.total
});
},
error: function (error) {
console.log(error);
}
})
},
toolbar: '#toolbar',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
});
// 查询刷新
$('#btnSearch').on('click', function () {
TableHelper.doRefresh('#table');
});
function cleanArray(actual) {
const newArray = []
for (let i = 0; i < actual.length; i++) {
if (actual[i]) {
newArray.push(actual[i])
}
}
return newArray
}
function param(json) {
if (!json) return ''
return cleanArray(Object.keys(json).map(key => {
if (json[key] === undefined) return ''
return encodeURIComponent(key) + '=' +
encodeURIComponent(json[key])
})).join('&')
}
function getQueryParams() {
var param = {
inviteCode: $('#qInviteCode').val(),
phone: $('#qPhone').val(),
erbanNo: $('#qErbanNo').val(),
startTime: $('#qStartTime').val(),
endTime: $('#qEndTime').val(),
};
return param;
}
// 导出
$('#btnExport').on('click', function () {
window.location.href = `/admin/inviteCode/stats/export?${param(getQueryParams())}`
})
});
}
},
};
</script>
<style scoped></style>

View File

@@ -0,0 +1,137 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<div id="toolbar">
<form id="searchForm" action="/admin/inviteCode/export" method="get" target="_blank">
邀请码:<input type="text" class="input-sm" name="inviteCode" id="qInviteCode" , placeholder="多个可用,隔开">
平台号:<input type="text" class="input-sm" name="erbanNo" id="qErbanNo" , placeholder="多个可用,隔开">
使用时间:<input type="text" class="input-sm datetime" name="startTime" id="qStartTime">
-<input type="text" class="input-sm datetime" name="endTime" id="qEndTime">
</form>
<button id="btnSearch" class="btn btn-sm btn-primary">查询</button>
<button id="btnExport" class="btn btn-default">导出</button>
</div>
</div>
<!-- .content -->
<div id="table"></div>
</div>
</section>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "InviteCodeView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('.datetime').datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
autoclose: true
});
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{ field: 'inviteCode', title: '邀请码', align: 'center', width: '5%' },
{ field: 'uid', title: '受邀用户uid', align: 'center', width: '5%' },
{ field: 'erbanNo', title: '受邀用户平台号', align: 'center', width: '8%' },
{ field: 'nick', title: '受邀用户昵称', align: 'center', width: '5%' },
{ field: 'inviterUid', title: '邀请用户uid', align: 'center', width: '5%' },
{ field: 'inviterErbanNo', title: '邀请用户平台号', align: 'center', width: '8%' },
{ field: 'inviterNick', title: '邀请用户昵称', align: 'center', width: '5%' },
{ field: 'createTime', title: '使用时间', align: 'center', valign: 'middle', width: '10%', formatter: formatTime },
],
undefinedText: "",
cache: false,
striped: true,
showRefresh: false,
pageSize: 20,
pagination: true,
pageList: [20, 50, 100, 200, 300, 500],
search: false,
sidePagination: "server", //表示服务端请求
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
page: params.pageNumber,
pageSize: params.pageSize,
inviteCode: $('#qInviteCode').val(),
erbanNo: $('#qErbanNo').val(),
startTime: $('#qStartTime').val(),
endTime: $('#qEndTime').val(),
};
console.log(param);
return param;
},
ajax: function (request) { //使用ajax请求
$.ajax({
type: "GET",
url: '/admin/inviteCode/list.action',
contentType: 'application/json;charset=utf-8',
dataType: 'json',
data: request.data,
success: function (res) {
console.log(res);
request.success({
rows: res.data.rows,
total: res.data.total
});
},
error: function (error) {
console.log(error);
}
})
},
toolbar: '#toolbar',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
});
// 查询刷新
$('#btnSearch').on('click', function () {
TableHelper.doRefresh('#table');
});
//导出功能
$("#btnExport").on('click', function () {
$("#searchForm").submit();
});
function formatTime(val) {
if (val) {
var date = new Date(val);
return date.format('yyyy-MM-dd hh:mm:ss');
} else {
return '';
}
}
});
}
},
};
</script>
<style scoped></style>

View File

@@ -0,0 +1,605 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<!-- .content -->
<section class="content">
<div id="table"></div>
<div id="toolbar">
<button id="gift-add" class="btn btn-default">
<i class="glyphicon glyphicon-plus"></i>增加
</button>
<button id="gift-multiDel" class="btn btn-default">
<i class="glyphicon glyphicon-wrench"></i>批量删除
</button>
<!--<button id="gift-version-reset" class="btn btn-default">-->
<!--<i class="glyphicon glyphicon-wrench"></i>设置礼物版本-->
<!--</button>-->
<select name="condition_type" id="condition_type" data-btn-class="btn-warning">
<option value="-1" selected="selected">全部</option>
<option value="1">有效</option>
<option value="2">无效</option>
</select>
<button id="gift-refresh" class="btn btn-default">
<i class="glyphicon glyphicon-wrench"></i>查询
</button>
</div>
</section><!-- .content -->
</div>
</div>
</section>
<!--<div class="modal fade" id="giftVersionModal" tabindex="-1" role="dialog" aria-labelledby="gift-modalLabel">-->
<!--<div class="modal-dialog" role="document">-->
<!--<div class="modal-content">-->
<!--<div class="modal-header">-->
<!--<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>-->
<!--<h4 class="modal-title" id="gift-modalLabel">版本信息</h4>-->
<!--</div>-->
<!--<div class="modal-body">-->
<!--<form class="form-horizontal" id="giftVersionForm">-->
<!--<div class="form-group">-->
<!--<label class="col-sm-4 control-label">当前礼物版本</label>-->
<!--<div class="col-sm-8">-->
<!--<input type="text" class="form-control" name="giftVersion" id="giftVersion" readonly="true">-->
<!--</div>-->
<!--</div>-->
<!--<div class="form-group">-->
<!--<label class="col-sm-4 control-label">新版本</label>-->
<!--<div class="col-sm-8">-->
<!--<input type="text" class="form-control validate[required]" name="configValue" id="newGiftVersion">-->
<!--</div>-->
<!--</div>-->
<!--<input type="hidden" name="configId" id="gift-configId"/>-->
<!--<input type="hidden" name="configName" id="gift-configName"/>-->
<!--<input type="hidden" name="nameSpace" id="gift-nameSpace"/>-->
<!--<input type="hidden" name="configStatus" id="gift-configStatus"/>-->
<!--<div class="modal-footer">-->
<!--<button type="button" class="btn btn-primary" id="gift-version-save">保存</button>-->
<!--</div>-->
<!--</form>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<div class="modal fade" id="giftModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="modalLabel">魔法表情</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" id="giftForm">
<input type="hidden" name="magicId" id="magicId" />
<div class="form-group">
<label for="magicName" class="col-sm-2 control-label">名称</label>
<div class="col-sm-10">
<input type="text" class="form-control validate[required]" name="magicName" id="magicName">
</div>
</div>
<div class="form-group">
<label for="magicPrice" class="col-sm-2 control-label">价格(金币)</label>
<div class="col-sm-10">
<input type="text" class="form-control validate[required]" name="magicPrice"
id="magicPrice">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">状态</label>
<div class="col-sm-10">
<label class="radio-inline"><input type="radio" name="status" value="1" checked>有效</label>
<label class="radio-inline"><input type="radio" name="status" value="2">无效</label>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">魔法图片:</label>
<div class="col-sm-10">
<img src="" id="picImage" style="width:250px;height:90px;" alt="">
<input type="file" id="picUploadFile" name="file"
accept="image/gif,image/jpeg,image/jpg,image/png,image/svga">
<button class="btn btn-success" type="button" id="picUploadBtn">上传</button>
<input type="hidden" id="magicIcon" name="magicIcon"
class="form-control validate[required]" />
<span id="picImgInfo" style="color:red;"></span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">魔法SVGA</label>
<div class="col-sm-10">
<input type="file" id="vggUploadFile" name="file2"
accept="image/gif,image/jpeg,image/jpg,image/png,image/svga">
<button class="btn btn-success" type="button" id="vggUploadBtn">上传</button>
<input type="text" id="magicSvgUrl" name="magicSvgUrl"
class="form-control validate[required]" />
<span id="vggImgInfo" style="color:red;"></span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">魔法动效</label>
<div class="col-sm-10">
<input type="file" id="effUploadFile" name="file2"
accept="image/gif,image/jpeg,image/jpg,image/png,image/svga">
<button class="btn btn-success" type="button" id="effUploadBtn">上传</button>
<input type="text" id="effectSvgUrl" name="effectSvgUrl" class="form-control" />
<span id="effImgInfo" style="color:red;"></span>
</div>
</div>
<div class="form-group">
<label for="impactValue" class="col-sm-2 control-label">伤害值:</label>
<div class="col-sm-10">
<input type="text" class="form-control validate[required]" name="impactValue"
id="impactValue">
</div>
</div>
<div class="form-group">
<label for="effectRate" class="col-sm-2 control-label">动态概率(以100为基数)</label>
<div class="col-sm-10">
<input type="text" class="form-control validate[required]" name="effectRate"
id="effectRate">
</div>
</div>
<div class="form-group">
<label for="playPosition" class="col-sm-2 control-label">是否中点播放:</label>
<div class="col-sm-10">
<select name="playPosition" id="playPosition" data-btn-class="btn-warning">
<option value=1>中点播放</option>
<option value=0>非中点播放</option>
</select>
</div>
</div>
<div class="form-group">
<label for="nobleId" class="col-sm-2 control-label">贵族等级</label>
<div class="col-sm-10">
<select name="nobleId" id="nobleId" data-btn-class="btn-warning">
<option value="0">&nbsp;&nbsp;</option>
<option value="1">男爵</option>
<option value="2">子爵</option>
<option value="3">伯爵</option>
<option value="4">侯爵</option>
<option value="5">公爵</option>
<option value="6">国王</option>
<option value="7">皇帝</option>
</select>
</div>
</div>
<input type="hidden" id="nobleName" name="nobleName">
<div class="form-group">
<label for="seq" class="col-sm-2 control-label">排序</label>
<div class="col-sm-10">
<input type="text" class="form-control validate[required]" name="seq" id="seq">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="save">保存</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="tipModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">提示信息</h4>
</div>
<div class="modal-body" id="tipMsg"></div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
import ComboboxHelper from '@/assets/plugins/bootstrap-combobox/js/bootstrap-combobox-helper';
ComboboxHelper.build(null, '#giftType');
ComboboxHelper.build(null, '#playPosition');
ComboboxHelper.build(null, '#condition_type');
ComboboxHelper.build(null, '#nobleId');
export default {
name: "MagicManageView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{ field: 'tmp', title: 'ID', align: 'center', checkbox: true },
{ field: 'magicName', title: '名称', align: 'center', width: '10%' },
{ field: 'magicPrice', title: '价格', align: 'center', width: '10%' },
{
field: 'status', title: '状态', align: 'center', width: '10%', formatter: function (val, row, index) {
if (val == 1) {
return '有效';
} else {
return '无效';
}
}
},
{
field: 'magicIcon', title: '图片', align: 'center', width: '10%', formatter: function (val, row, index) {
return "<img src='" + val + "' width='70' height='60'>";
}
},
{ field: 'magicSvgUrl', title: '表情SVGA', align: 'center', width: '10%' },
{ field: 'effectSvgUrl', title: '动效SVGA', align: 'center', width: '10%' },
{ field: 'effectRate', title: '动效概率', align: 'center', width: '5%' },
{
field: 'playPosition', title: '中点播放', align: 'center', width: '5%', formatter: function (val, row, index) {
if (val == 1) {
return '是';
} else {
return '否'
}
}
},
{ field: 'seq', title: '排序', align: 'center', width: '10%' },
{
field: 'magicId', title: '操作', align: 'center', width: '15%', formatter: function (val, row, index) {
return '<button class="btn btn-sm btn-success opt-edit" data-id=' + val + '>' +
'<i class="glyphicon glyphicon-edit"></i>编辑</button>' +
'&nbsp;&nbsp;<button class="btn btn-sm btn-danger opt-remove" data-id=' + val +
'><i class="glyphicon glyphicon-remove"></i>删除</button>';
}
}
],
cache: false,
striped: true,
showRefresh: true,
pageSize: 10,
pagination: true,
pageList: [1, 10, 20, 30, 50],
search: false,
sidePagination: "server", //表示服务端请求
//设置为undefined可以获取pageNumberpageSizesearchTextsortNamesortOrder
//设置为limit可以获取limit, offset, search, sort, order
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageNumber: params.pageNumber,
pageSize: params.pageSize,
searchText: params.searchText
};
return param;
},
toolbar: '#toolbar',
url: '/admin/magic/getList.action?type=' + ComboboxHelper.getSelected("#condition_type"),
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
});
$("#table").on("click", '.opt-remove', function () {
var id = $(this).attr("data-id");
if (id == 'undefined') {
$("#tipMsg").text("id参数有误");
$("#tipModal").modal('show');
return;
}
if (confirm("你确认删除该记录吗?" +
"\r\n删除后再也不能找回请谨慎操作")) {
$.ajax({
type: 'post',
url: "/admin/magic/del.action",
data: { 'ids': JSON.stringify([id]) },
dataType: "json",
success: function (json) {
if (json.success == 'true') {
$("#tipMsg").text("删除成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("删除失败");
$("#tipModal").modal('show');
}
}
});
}
});
$("#gift-add").click(function () {
// 打开编辑弹窗
$("#giftModal").modal('show');
$("#giftForm")[0].reset();
$('#picUrl').val('');
$('#picImage').attr("src", '');
$("#picImgInfo").html('');
$("#picUploadFile").val('');
$('#magicSvgUrl').val('');
$("#vggUploadFile").val('');
$("#vggImgInfo").html('');
$('#effectSvgUrl').val('');
$("#effUploadFile").val('');
$("#effImgInfo").html('');
$("#effectRate").val('');
$("#impactValue").val('');
$("#seq").val('');
$("#magicId").val('');
$("#magicName").attr('readonly', false);
$("#magicPrice").attr('readonly', false);
$("#nobleId").btComboBox('disable');
ComboboxHelper.setDef("#nobleId", '0');
ComboboxHelper.setDef("#playPosition", "0");
});
$("#nobleId").on('change', function () {
if (ComboboxHelper.getSelected("#nobleId") != 0) {
var nobleName = $("#nobleId").btComboBox('selectedOption')[1];
$("#nobleName").val(nobleName);
}
else {
$("#nobleName").val('');
}
})
$("#notNoble").on('change', function () {
ComboboxHelper.setDef("#nobleId", '0');
$("#nobleName").val('');
$("#nobleId").btComboBox('disable');
})
$("#isNoble").on('change', function () {
$("#nobleId").btComboBox('enable');
})
$("#gift-refresh").click(function () {
$("#table").bootstrapTable('refresh', { url: '/admin/magic/getList.action?type=' + ComboboxHelper.getSelected("#condition_type") });
})
$("#gift-multiDel").click(function () {
var rows = $("#table").bootstrapTable("getSelections");
if (rows.length == 0) {
alert("请先选择要删除的记录");
return;
}
console.log("rows: " + rows.length);
var idArr = [];
for (var i = 0; i < rows.length; i++) {
idArr.push(rows[i]['magicId']);
}
console.log(idArr);
if (confirm("你确认批量删除该记录吗?" +
"\r\n删除后再也不能找回请谨慎操作")) {
$.ajax({
type: 'post',
url: "/admin/magic/del.action",
data: { 'ids': JSON.stringify(idArr) },
dataType: "json",
success: function (json) {
if (json.success == 'true') {
$("#tipMsg").text("删除成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("删除失败");
$("#tipModal").modal('show');
}
}
});
}
});
$('#picUploadBtn').on('click', function () {
$.ajaxFileUpload({
fileElementId: 'picUploadFile', //需要上传的文件域的ID即<input type="file">的ID。
url: '/admin/magic/upload', //后台方法的路径
type: 'post', //当要提交自定义参数时这个参数要设置成post
dataType: 'json', //服务器返回的数据类型。可以为xml,script,json,html。如果不填写jQuery会自动判断。
secureuri: false, //是否启用安全提交默认为false。
async: true, //是否是异步
success: function (json) { //提交成功后自动执行的处理函数参数data就是服务器返回的数据。
if (json.path) {
$('#magicIcon').val(json.path);
$('#picImage').attr("src", json.path);
if (json.path != '') {
$("#picImgInfo").html('已上传成功');
} else {
$("#picImgInfo").html('未上传成功');
}
} else {
$("#tipMsg").text(json.msg);
$("#tipModal").modal('show');
}
},
error: function (data, status, e) { //提交失败自动执行的处理函数。
console.error(e);
}
});
})
$('#vggUploadBtn').on('click', function () {
$.ajaxFileUpload({
url: '/admin/magic/upload2',//后台请求地址
type: 'post',//请求方式 当要提交自定义参数时这个参数要设置成post
secureuri: false,//是否启用安全提交默认为false。
fileElementId: 'vggUploadFile',// 需要上传的文件域的ID即<input type="file">的ID。
dataType: 'json',//服务器返回的数据类型。可以为xml,script,json,html。如果不填写jQuery会自动判断。如果json返回的带pre,这里修改为json即可解决。
success: function (json, status) {//提交成功后自动执行的处理函数参数data就是服务器返回的数据。
console.log(json);
if (json.path) {
$('#magicSvgUrl').val(json.path);
if (json.path != '') {
$("#vggImgInfo").html('已上传成功');
} else {
$("#vggImgInfo").html('未上传成功');
}
console.log(json.path);
} else {
$("#tipMsg").text(json.msg);
$("#tipModal").modal('show');
}
}
});
});
$('#effUploadBtn').on('click', function () {
$.ajaxFileUpload({
url: '/admin/magic/upload2',//后台请求地址
type: 'post',//请求方式 当要提交自定义参数时这个参数要设置成post
secureuri: false,//是否启用安全提交默认为false。
fileElementId: 'effUploadFile',// 需要上传的文件域的ID即<input type="file">的ID。
dataType: 'json',//服务器返回的数据类型。可以为xml,script,json,html。如果不填写jQuery会自动判断。如果json返回的带pre,这里修改为json即可解决。
success: function (json, status) {//提交成功后自动执行的处理函数参数data就是服务器返回的数据。
console.log(json);
if (json.path) {
$('#effectSvgUrl').val(json.path);
if (json.path != '') {
$("#effImgInfo").html('已上传成功');
} else {
$("#effImgInfo").html('未上传成功');
}
console.log(json.path);
} else {
$("#tipMsg").text(json.msg);
$("#tipModal").modal('show');
}
}
});
});
$("#cancel").click(function () {
TableHelper.unCheckAll("#table");
});
function parseNum(val) {
if (val == undefined || val == 'false' || val == 0) {
return 0;
}
else {
return 1;
}
}
$("#table").on("click", '.opt-edit', function () {
console.log("btnEdit");
var id = $(this).attr("data-id");
$.ajax({
type: "get",
url: "/admin/magic/get.action",
data: { id: id },
dataType: "json",
success: function (json) {
if (json.entity) {
$("#magicId").val(json.entity.magicId);
$("#magicName").attr('readonly', true);
$("#magicPrice").attr('readonly', true);
$("#magicName").val(json.entity.magicName);
$("#magicPrice").val(json.entity.magicPrice);
$("#seq").val(json.entity.seq);
$("#effectRate").val(json.entity.effectRate);
$("#impactValue").val(json.entity.impactValue);
ComboboxHelper.setDef("#playPosition", json.entity.playPosition + "");
ComboboxHelper.setDef("#nobleId", '0');
$("#nobleId").btComboBox('disable');
$("#nobleName").val('');
// 礼物状态的值跟其他不同, 1为有效 2为无效
if (json.entity.status == 1) {
$("input:radio[name='status']")[0].checked = true;
} else {
$("input:radio[name='status']")[1].checked = true;
}
// 设置礼物图片
$("#picUploadFile").val('');
$('#magicIcon').val(json.entity.magicIcon);
$('#picImage').attr("src", json.entity.magicIcon);
if (json.entity.magicIcon != '') {
$("#picImgInfo").html('已上传');
} else {
$("#picImgInfo").html('未上传');
}
// 设置vgg图片
$("#vggUploadFile").val('');
$('#magicSvgUrl').val(json.entity.magicSvgUrl);
if (json.entity.magicSvgUrl != '') {
$("#vggImgInfo").html('已上传');
} else {
$("#vggImgInfo").html('未上传');
}
// 设置动效vgg图片
$("#effUploadFile").val('');
$('#effectSvgUrl').val(json.entity.effectSvgUrl);
if (json.entity.effectSvgUrl != '') {
$("#effImgInfo").html('已上传');
} else {
$("#effImgInfo").html('未上传');
}
// 打开编辑弹窗
$("#giftModal").modal('show');
} else {
$("#tipMsg").text("获取菜单信息出错");
$("#tipModal").modal('show');
}
}
});
});
$("#save").click(function () {
if ($("#giftForm").validationEngine('validate')) {
$.ajax({
type: "post",
url: "/admin/magic/save.action",
data: $('#giftForm').serialize(),
dataType: "json",
success: function (json) {
if (json.success == 'true') {
$("#giftModal").modal('hide');
$("#tipMsg").text("保存成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("保存失败." + json.msg);
$("#tipModal").modal('show');
}
}
});
}
});
});
}
},
};
</script>
<style scoped></style>

View File

@@ -0,0 +1,587 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<section class="content">
<div id="table"></div>
<div id="toolbar">消息类型:<select name="msgType" id="type" class="input-m">
<option value="0">文本</option>
<option value="1">图片</option>
<option value="100">图文</option>
</select>
<label for="erbanNum" class="col-sm-2 control-label">平台号:</label>
<div class="col-sm-3">
<span><input type="text" class="form-control validate[required]" name="erbanNo"
id="erbanNum"></span>
</div>
<button id="btnSearch" class="btn btn-sm btn-primary">查询</button>
<button id="add" class="btn btn-default">
<i class="glyphicon glyphicon-plus"></i>增加
</button>
</div>
</section>
</div>
</div>
</section>
<div class="modal fade" id="addSendMessage" tabindex="-1" role="dialog" aria-labelledby="modalLabel2">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">x</span></button>
<h4 class="modal-title" id="addModalLabel">新增消息</h4>
</div>
<div class="modal-body">
<form id="addMsgForm" class="form-horizontal">
<div class="form-group">
<label for="receiver" class="col-sm-3 control-label">接收者</label>
<div class="col-sm-8">
<select name="receivers" id="receiver" class="col-sm-3">
<option value=1>所有用户</option>
<option value=0>指定用户</option>
</select>
</div>
</div>
<div class="form-group" id="appIdDiv">
<label for="appId" class="col-sm-3 control-label">渠道</label>
<div class="col-sm-8">
<select name="appId" id="appId" class="col-sm-3">
<option value="">全部</option>
<option value="official">安卓官方包</option>
<option value="google">安卓谷歌包</option>
<option value="peko_Enterprise">ios企业包</option>
<option value="youmi_appstore">ios商店包</option>
</select>
</div>
</div>
<div class="form-group">
<label for="msgType" class="col-sm-3 control-label">消息类型</label>
<div class="col-sm-8">
<select name="msgTypeList" id="msgType" class="col-sm-3">
<option value="0">文本</option>
<option value="1">图片</option>
<option value="100">图文</option>
</select>
</div>
</div>
<div class="form-group" id="skipUrlDiv">
<label for="skip" class="col-sm-3 control-label">跳转来源</label>
<div class="col-sm-8">
<select name="skip" id="skip" class="col-sm-3">
<option value=""></option>
<option value="2">跳H5页面</option>
<option value="1" id="skipRoomType">跳转房间</option>
</select>
</div>
<div class="col-sm-6">
<input type="text" class="form-control" name="skipUri" id="skipUrlContent">
</div>
</div>
<div class="form-group" id="mmm">
<label for="aimErbanNo" class="col-sm-3 control-label">请输入指定平台号多个平台号用逗号隔开</label>
<div class="col-sm-8">
<input class="form-control validate[required]" name="aimErbanNo" id="aimErbanNo">
</div>
</div>
<div class="form-group" id="nnn">
<label for="words" class="col-sm-3 control-label">文本</label>
<div class="col-sm-8">
<input class="form-control validate[required]" name="words" id="words">
</div>
</div>
<div class="form-group" id="ppp">
<label for="pic" class="col-sm-3 control-label">图片</label>
<div class="col-sm-8">
<img src="" id="imgUrl" style="width:250px;height:90px;" alt="">
<input type="file" id="uploadFile" name="uploadFile"
accept="image/gif,image/jpeg,image/jpg,image/png,image/svg">
<button class="btn btn-success" type="button" id="uploadBtn">上传</button>
<span class="attention">注意:图片尺寸请注意在750*250,选择图片后请点击上传按钮</span>
<input type="hidden" id="pic" name="pic" class="form-control validate[required]" />
</div>
</div>
<div class="form-group" id="ooo">
<label for="wordsAndPic1" class="col-sm-3 control-label">图文</label>
<div class="col-sm-8">
标题:<input class="form-control validate[required]" name="title" id="title">
内容:<input class="form-control validate[required]" name="desc" id="desc">
<!--封面图-->
<img src="" id="imgUrl1" style="width:250px;height:90px;" alt="">
<input type="file" id="uploadFile1" name="uploadFile"
accept="image/gif,image/jpeg,image/jpg,image/png,image/svg">
<button class="btn btn-success" type="button" id="uploadBtn1">上传</button>
封面图:<span class="attention">尺寸小于750*250,选择图片后请点击上传按钮</span>
<input type="hidden" id="wordsAndPic1" name="wordsAndPic1"
class="form-control validate[required]" />
</div>
</div>
<div class="form-group">
<label for="pushTime" class="col-sm-3 control-label">推送时间(非必填)</label>
<div class="col-sm-9">
<input type="text" class="input-sm form-control datetime" name="pushTime" id="pushTime">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-primary" id="addSave">保存</button>
</div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "MessageAdminView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{ field: 'recordId', title: 'id', align: 'center', valign: 'middle', width: '0%' },
{ field: 'fromAccid', title: '发送人', align: 'center', valign: 'middle', width: '10%' },
{ field: 'toAccids', title: '接收人', align: 'center', valign: 'middle', width: '10%' },
{
field: 'appId', title: 'app', align: 'center', valign: 'middle', width: '5%',
formatter: function (val, row, index) {
if ("tutu" == val) {
return "66";
} else if ("qingxun" == val) {
return "66";
} else {
return '-';
}
}
},
{
field: 'msgType',
title: '消息类型',
align: 'center',
width: '10%',
valign: 'middle',
formatter: function (val, row, index) {
switch (val) {
case 0:
return '文本';
case 1:
return '图片';
case 100:
return '图文';
}
}
},
{
field: 'toObjType', title: '指定对象', align: 'center', width: '10%', valign: 'middle',
formatter: function (val, row, index) {
switch (val) {
case 1:
return '所有人';
case 0:
return '指定用户';
}
}
},
{ field: 'toErbanNos', title: '指定平台号', align: 'center', width: '10%', valign: 'middle' },
{ field: 'title', title: '标题', align: 'center', width: '10%', valign: 'middle' },
{ field: 'webUrl', title: '点击查看URL', align: 'center', width: '10%', valign: 'middle' },
{ field: 'picUrl', title: '图片', align: 'center', width: '10%', valign: 'middle' },
{ field: 'msgDesc', title: '消息内容', align: 'center', width: '10%', valign: 'middle' },
{
field: 'skipType', title: '跳转类型', align: 'center', valign: 'middle',
formatter: function (val, row, index) {
switch (val) {
case 1:
return '跳app页面';
case 2:
return '跳聊天室';
case 3:
return '跳h5页面';
}
}
},
{ field: 'skipUri', title: '跳转链接', align: 'center', width: '10%', valign: 'middle' },
{
field: 'crateTime',
title: '创建时间',
align: 'center',
width: '10%',
valign: 'middle',
formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format("yyyy-MM-dd hh:mm");
} else {
return '-';
}
}
},
{
field: 'pushTime',
title: '发送时间',
align: 'center',
width: '10%',
valign: 'middle',
formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format("yyyy-MM-dd hh:mm");
} else {
return '-';
}
}
},
{
field: 'pushStatus',
title: '状态',
align: 'center',
width: '10%',
valign: 'middle',
formatter: function (val, row, index) {
if (val == 0) {
return '未推送';
} else if (val == 1) {
return '已推送';
} else if (val == 2) {
return '已撤回';
}
}
},
{
field: 'tmp',
title: '操作',
align: 'center',
width: '12%',
valign: 'middle',
formatter: function (val, row, index) {
var key = row.recordId;
var pushTime = row.pushTime;
var date = new Date(pushTime);
let format = date.format("yyyy-MM-dd hh:mm");
let now = new Date().format("yyyy-MM-dd hh:mm");
console.log("format: " + format)
console.log("now: " + now)
let condition = format > now;
console.log("condition: " + condition)
if (condition && row.pushStatus == 0) {
var str = "<button class='btn btn-sm btn-danger opt-del' data-id=" + key + ">撤销</button>";
return str;
} else {
return '-';
}
}
}
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pagination: true,
pageList: [10, 20, 30, 50],
sidePagination: "server", //表示服务端请求
queryParamsType: "undefined",
queryParams: function queryParams(params) {
var param = {
pageSize: params.pageSize,
pageNumber: params.pageNumber,
erbanNOs: $('#erbanNum').val(),
msgType: $('#type').val()
};
return param;
},
uniqueId: 'code',
toolbar: '#toolbar',
url: '/admin/msgAdmin/getMsgList.action',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
})
/*查询刷新*/
$('#btnSearch').on('click', function () {
TableHelper.doRefresh('#table');
})
/*保存*/
$('#addSave').on('click', function () {
if ($('#addMsgForm').validationEngine('validate')) {
if ($("#msgType").val() == 100 && ($("#skipUrlContent").val() == undefined || $("#skipUrlContent").val().length <= 0)) {
alert("未填写跳转链接");
} else {
$('#addSave').attr("disabled", true);
if ($("#msgType").val() == 1) {
$('#skipUrlContent').val('');
}
$.ajax({
type: "post",
url: "/admin/messageAdmin/saveMessage.action",
data: {
erbanNos: $("#aimErbanNo").val(),
msgType: $("#msgType").val(),
toObjType: $('#receiver').val(),
words: $('#words').val(),
pic: $('#pic').val(),
title: $('#title').val(),
desc: $('#desc').val(),
picUrl: $('#wordsAndPic1').val(),
skipType: $('#skip').val(),
skipContent: $('#skipUrlContent').val(),
appId: $("#appId").val(),
pushTime: $("#pushTime").val()
},
dataType: 'json',
success: function (data) {
if (data == 1) {
$('#addSendMessage').modal('hide');
$("#tipMsg").text("保存成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else if (data == 2) {
$('#addSendMessage').modal('hide');
$("#tipMsg").text("您已掉线,请重新登录");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("保存失败,错误码:" + data);
$("#tipModal").modal('show');
}
$('#addSave').attr("disabled", false);
}
})
}
}
})
// 撤销
$('#table').on('click', '.opt-del', function () {
var recordId = $(this).attr("data-id");
console.log('recordId', recordId)
if (recordId == 'undefined' || !recordId) {
return;
}
if (confirm("确认撤销?")) {
$.ajax({
type: 'post',
url: "/admin/messageAdmin/recall.action",
data: JSON.stringify({
'recordId': recordId
}),
dataType: "json",
contentType: "application/json",
success: function (res) {
if (res.code == 200) {
$("#tipMsg").text("撤销成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("撤销失败,错误码:" + res.code + ", 错误信息: " + res.message);
$("#tipModal").modal('show');
}
}
});
}
})
//增加
$('#add').on('click', function () {
clear();
$('#addMsgForm')[0].reset();
$("#skipUrlDiv").show();
$('#addSendMessage').modal('show');
$('#addSave').attr("disabled", false);
})
$(document).ready(function () {
$("#mmm").hide();
$("#ppp").hide();
$("#ooo").hide();
}
);
$('#receiver').on('change', function (e) {
var selected = $('#receiver').val();
if (selected == 1) {
$("#mmm").hide();
}
if (selected == 0) {
$("#mmm").show();
$("#appIdDiv").hide();
$("#appId").val('');
e.stopPropagation();
}
}
)
$('#msgType').on('change', function (e) {
var msgType = $('#msgType').val();
if (msgType == 0) {
$("#skipUrlDiv").show();
$("#skipRoomType").show();
$("#nnn").show();
$("#ppp").hide();
$("#ooo").hide();
}
if (msgType == 1) {
$("#skipUrlDiv").hide();
$("#skipUrlDiv").val('');
$("#skipRoomType").hide();
$("#ppp").show();
$("#nnn").hide();
$("#ooo").hide();
}
if (msgType == 100) {
$("#skipUrlDiv").show();
$("#skipRoomType").hide();
$("#ooo").show();
$("#ppp").hide();
$("#nnn").hide();
e.stopPropagation();
}
}
);
$('#uploadBtn').on('click', function () {
var options = {
type: 'post',
url: '/admin/msg/headimg.action',
dataType: 'json',
success: function (json) {
if (json.path) {
$('#pic').val(json.path);
$('#imgUrl').attr("src", json.path);
console.log(json.path);
} else {
$("#tipMsg").text(json.msg);
$("#tipModal").modal('show');
}
}
}
$("#addMsgForm").ajaxSubmit(options);
})
$('#uploadBtn1').on('click', function () {
var options = {
type: 'post',
url: '/admin/msg/headimg.action',
dataType: 'json',
success: function (json) {
if (json.path) {
$('#wordsAndPic1').val(json.path);
$('#imgUrl1').attr('src', json.path);
console.log(json.path);
} else {
$('#tipMsg').text(json.msg);
$('#tipModal').modal('show');
}
}
}
$('#addMsgForm').ajaxSubmit(options);
})
$('#pushTime').datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
autoclose: true
});
})
}
},
};
function clear() {
$('#imgUrl').attr('src', '');
$('#imgUrl1').attr('src', '');
$('#imgUrl2').attr('src', '');
$("#nnn").show();
$("#mmm").hide();
$("#ppp").hide();
$("#ooo").hide();
$("#appIdDiv").show();
}
</script>
<style scoped>
.bar1,
.bar2 {
margin-bottom: 10px;
}
label.col-sm-1 {
padding: 0;
line-height: 30px;
text-align: right;
/*padding-right: 4px;*/
}
label.col-sm-1 {
padding: 0;
line-height: 30px;
text-align: right;
/*padding-right: 4px;*/
}
input,
select {
margin-left: 8px;
margin-right: 8px;
}
#btnSearch {
margin-left: 36px;
}
.record {
margin-top: 10px;
}
.record .title {
font-size: 16px;
}
#waKaKa {
display: none;
}</style>

View File

@@ -0,0 +1,125 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<section class="content">
<div id="table"></div>
<div id="toolbar">
<input name="erbanNo" id="erbanNo" placeholder="请输入平台号" />
<button id="btnSearch" class="btn btn-sm btn-primary">查询</button>
</div>
</section>
</div>
</div>
</section>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "PasswordLockAdminView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('#table').bootstrapTable("destroy");
$('#table').bootstrapTable({
columns: [
{ field: 'erbanNo', title: '用户平台号', align: 'center', width: '20%' },
{ field: 'nick', title: '用户昵称', align: 'center', width: '30%' },
{ field: 'loginPwdCount', title: '登录密码错误次数', align: 'center', width: '15%' },
{ field: 'payPwdCount', title: '支付密码错误次数', align: 'center', width: '15%' },
{
field: 'uid',
title: '操作',
align: 'center',
width: '20%',
formatter: function (val, row, index) {
var key = row.uid;
return '<button class="btn btn-sm btn-warning opt-login" data-id=' + key + '>登录解锁</button>' +
'<button class="btn btn-sm btn-warning opt-pay" data-id=' + key + '>支付解锁</button>';
}
}
],
cache: false,
striped: true,
showRefresh: true,
pageSize: 10,
pagination: true,
pageList: [1, 10, 20, 30, 50],
search: false,
sidePagination: "server", //表示服务端请求
//设置为undefined可以获取pageNumberpageSizesearchTextsortNamesortOrder
//设置为limit可以获取limit, offset, search, sort, order
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
erbanNo: $('#erbanNo').val()
};
return param;
},
toolbar: '#toolbar',
url: '/admin/pwdLock/getUser.action',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
});
$('#btnSearch').on('click', function () {
TableHelper.doRefresh('#table');
});
$("#table").on('click', '.opt-login', function () {
debugger;
var id = $(this).attr("data-id");
releaseLock(id, 1);
});
$("#table").on('click', '.opt-pay', function () {
var id = $(this).attr("data-id");
releaseLock(id, 2);
});
})
}
},
};
function releaseLock(uid, type) {
if (confirm("确认解除锁定吗?")) {
$.ajax({
type: "post",
url: "/admin/pwdLock/release.action",
data: {
uid: uid,
type: type
},
dataType: "json",
success: function (json) {
if (json.code == 200) {
$("#tipMsg").text("成功解除锁定");
$("#tipModal").modal("show");
} else {
$("#tipMsg").text("解除锁定失败");
$("#tipModal").modal("show");
}
}
})
}
}
</script>
<style scoped></style>

View File

@@ -0,0 +1,378 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<!-- .content -->
<div id="table"></div>
<div id="toolbar" style="height: auto;">
<form id="searchForm" action="/admin/phone/auth/apply/exportRecord.action" class="col-sm-12"
target="_blank">
<div class="col-sm-12">
<label for="phone" class="col-sm-1 control-label">手机号</label>
<div class="col-sm-2"><input type="text" class="form-control" name="phone" id="phone"></div>
<label for="authCode" class="col-sm-1 control-label">授权码</label>
<div class="col-sm-2"><input type="text" class="form-control" name="authCode" id="authCode">
</div>
<label for="status" class="col-sm-1 control-label">授权状态</label>
<div class="col-sm-2">
<select name="status" id="status" data-btn-class="btn-warning" class="form-control">
<option value="" selected="selected">全部</option>
<option value="1">待审核</option>
<option value="2">通过</option>
<option value="3">拒绝</option>
</select>
</div>
</div>
<div class="col-sm-12">
<label class="col-sm-1 control-label">申请时间</label>
<div class="col-sm-2"><input type="text" class="form-control" name="beginDate" id="beginDate">
</div><span class="col-sm-1"></span>
<div class="col-sm-2"><input type="text" class="form-control" name="endDate" id="endDate"></div>
</div>
</form>
<div class="col-sm-12">
<button id="btnSearch" class="btn btn-default">
<i class="glyphicon glyphicon-search"></i>查询
</button>
<button id="btnReset" class="btn btn-default">
<i class="glyphicon glyphicon-remove"></i>重置
</button>
<button id="exportBtn" class="btn btn-default">
<i class="glyphicon glyphicon-remove"></i>导出
</button>
</div>
</div>
</div>
</div>
</section>
<div class="modal fade" id="messageModel" tabindex="-2" role="dialog" aria-labelledby="modalLabel2">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">x</span></button>
<h4 class="modal-title" id="channelModelModalLabel">编辑备注</h4>
</div>
<div class="modal-body">
<form id="messageForm" class="form-inline">
<input type="hidden" id="id" />
<div class="form-group">
<div class="col-sm-8">
<textarea class="form-control validate[required]" name="remark" id="remark"
placeholder="备注" />
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="create">新建</button>
</div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
var picker1 = $("#beginDate").datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
autoclose: true,
todayBtn: true
});
var picker2 = $("#endDate").datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
autoclose: true,
todayBtn: true
});
// picker1.on('changeDate', function () {
// var date = $('#beginDate').datetimepicker('getDate');
// picker2.datetimepicker('setStartDate', date);
// });
// picker2.on('changeDate', function () {
// var date = $('#endDate').datetimepicker('getDate');
// picker1.datetimepicker('setEndDate', date);
// });
export default {
name: "PhoneAuthApplyAdminView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{
field: 'phoneAreaCode', title: '申请区号', align: 'center', width: '5%',
formatter: function (val, row, index) {
return "+ " + val;
}
},
{ field: 'phone', title: '申请手机号', align: 'center', width: '5%' },
{ field: 'authCode', title: '授权码', align: 'center', width: '5%' },
{
field: 'status',
title: '授权状态',
align: 'center',
width: '5%',
formatter: function (val, row, index) {
if (val == 1) {
return "未处理";
} else if (val == 2) {
return "通过";
} else if (val == 3) {
return "拒绝";
} else {
return "-";
}
}
},
{
field: 'createTime',
title: '申请时间',
align: 'center',
width: '5%',
valign: 'middle',
formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format("yyyy-MM-dd hh:mm:ss");
} else {
return '-';
}
}
},
{ field: 'remark', title: '备注', align: 'center', width: '5%' },
{ field: 'operator', title: '操作人', align: 'center', width: '5%' },
{
field: 'updateTime',
title: '更新授权时间',
align: 'center',
width: '5%',
valign: 'middle',
formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format("yyyy-MM-dd hh:mm:ss");
} else {
return '-';
}
}
},
{
field: 'id',
title: '操作',
align: 'center',
width: '5%',
formatter: function (val, row, index) {
var pass = '<button class="btn btn-sm btn-primary opt-pass" data-id=' + val + ' data-status=2>通&#12288;过</button>';
var noPass = '<button class="btn btn-sm btn-danger opt-not-pass" data-id=' + val + ' data-status=3>不通过</button>';
var remark = '<button class="btn btn-sm btn-primary opt-remark" data-remark=' + row.remark + ' + data-id=' + val + ' data-status=4>编辑备注</button>';
// var unshelve = '<button class="btn btn-sm btn-danger opt-not-pass" data-id=' + val + ' data-status=5>下&#12288;架</button>';
// console.log( "status = "+ row.status);
if (row.status == 1) {
// console.log( "status = "+ row.status + "true");
return pass + '</br>' + noPass + '</br>' + remark;
} else {
return remark;
}
}
},
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pagination: true,
pageList: [10, 20, 50, 100],
search: false,
sidePagination: "server", //表示服务端请求
//设置为undefined可以获取pageNumberpageSizesearchTextsortNamesortOrder
//设置为limit可以获取limit, offset, search, sort, order
queryParamsType: "-",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageNumber: params.pageNumber,
pageSize: params.pageSize,
phone: $('#phone').val(),
authCode: $('#authCode').val(),
status: $('#status').val(),
beginDate: $('#beginDate').val(),
endDate: $('#endDate').val(),
};
return param;
},
toolbar: '#toolbar',
url: '/admin/phone/auth/apply/list.action',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
});
// 查询刷新
$('#btnSearch').on('click', function () {
TableHelper.doRefresh('#table');
});
//重置
$('#btnReset').on('click', function () {
$('#phone').val("");
$('#authCode').val("");
$('#status').val("");
$('#beginDate').val("");
$('#endDate').val("");
});
//审核不通过/下架弹框
$("#table").on("click", '.opt-not-pass', function () {
var id = $(this).attr("data-id");
var status = $(this).attr("data-status");
if (id == 'undefined') {
$("#tipMsg").text("id参数有误");
$("#tipModal").modal('show');
return;
}
if (status == 'undefined') {
$("#tipMsg").text("状态参数有误");
$("#tipModal").modal('show');
return;
}
var text = "不通过";
if (confirm("你确认【" + text + "】该授权码申请吗?")) {
verify(text, id, status);
}
});
$("#table").on("click", '.opt-pass', function () {
var id = $(this).attr("data-id");
var status = $(this).attr("data-status");
if (id == 'undefined') {
$("#tipMsg").text("id参数有误");
$("#tipModal").modal('show');
return;
}
if (status == 'undefined') {
$("#tipMsg").text("状态参数有误");
$("#tipModal").modal('show');
return;
}
var text = "通过";
if (confirm("你确认【" + text + "】该授权码申请吗?")) {
verify(text, id, status);
}
});
// 导出EXCEL
$('#exportBtn').on('click', function () {
$("#searchForm").submit();
});
//备注
$('#table').on('click', '.opt-remark', function () {
var id = $(this).attr('data-id');
let remark = $(this).attr('data-remark');
$('#messageForm')[0].reset();
$('#id').val(id);
if (remark && !remark.match(/undefined/)) {
$('#remark').val(remark);
}
$('#messageModel').modal('show');
});
//审核不通过保存原因
$('#create').on('click', function () {
var id = $('#id').val();
var remark = $('#remark').val();
if ($("#messageForm").validationEngine('validate')) {
$.ajax({
type: 'post',
url: '/admin/phone/auth/apply/remark.action',
data: { id: id, remark: remark },
dataType: 'json',
success: function (res) {
if (res.success) {
$("#tipMsg").text("操作成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("操作失败," + res.message);
$("#tipModal").modal('show');
}
}
})
}
});
});
}
},
};
//判断空值
function isEmpty(data) {
if (data == null || data == undefined || data == "") {
return true;
}
return false;
}
//审核
function verify(text, id, status) {
//if (confirm("你确认【"+ text + "】该动态吗?")) {
// showLoading();
$.ajax({
type: 'post',
url: "/admin/phone/auth/apply/changeStatus.action",
data: {
id: id,
status: status
},
dataType: "json",
success: function (json) {
// hideLoading();
// if (status == 2 || status == 5) {
// $("#notPassModal").modal('hide');
// }
if (json.success == 'true') {
$("#tipMsg").text("操作成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text(json.msg);
$("#tipModal").modal('show');
}
}
});
//}
}
</script>
<style scoped></style>

View File

@@ -0,0 +1,281 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<div id="toolbar">
<div class="col-sm-12">
<label for="phonePrefix" class="col-sm-2 control-label">号段:</label>
<div class="col-sm-6">
<input type="text" class="form-control" name="phonePrefix" id="phonePrefix" placeholder="请输入号段">
</div>
</div>
<div class="col-sm-12">
<label for="interceptStatus" class="col-sm-2 control-label">注册状态:</label>
<div class="col-sm-4">
<select id="interceptStatus" name="interceptStatus" class="input-sm">
<option value="">全部</option>
<option value="1">禁止</option>
<option value="2">允许</option>
</select>
</div>
</div>
<div class="col-sm-12">
<button class="btn btn-default" id="search">
<i class="glyphicon glyphicon-wrench"></i>查询
</button>
<button class="btn btn-primary" id="add">
<i class="glyphicon glyphicon-plus"></i>增加
</button>
</div>
</div>
</div>
<!-- .content -->
<div id="table"></div>
</div>
</section>
<!-- 弹窗 -->
<div class="modal fade" id="addPhoneBlack" rabindex='-1' role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button class="close" type="button" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">x</span>
</button>
<div class="modal-title" id="userMuteModalLabel">新增号段</div>
</div>
<div class="modal-body">
<form action="" id="addForm" class="form-horizontal">
<div class="form-group">
<label for="modal_phonePrefix" class="col-sm-2 control-label">号段</label>
<div class="col-sm-6">
<input type="text"
class="form-control validate[required,custom[integer],minlength[7],maxlength[7]]"
name="phonePrefix" id="modal_phonePrefix" placeholder="需填入7位数">
</div>
</div>
<div class="form-group">
<label for="modal_interceptStatus" class="col-sm-2 control-label">注册状态:</label>
<div class="col-sm-4">
<select id="modal_interceptStatus" name="modal_interceptStatus" class="input-sm">
<option value="1">禁止</option>
<option value="2">允许</option>
</select>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-primary" data-primary="addSave" id="save">保存</button>
</div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "PhoneBlackAdminView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{
field: 'id', title: 'ID', align: 'center', valign: 'middle', width: '5%'
},
{
field: 'phonePrefix', title: '号段', align: 'center', valign: 'middle', width: '10%'
},
{
field: 'interceptStatus', title: '注册状态', align: 'center', valign: 'middle', width: '20%',
formatter: function (val, row, index) {
if (val == 1) {
return '禁止';
} else if (val == 2) {
return '允许';
} else {
return '-';
}
}
},
{ field: 'operator', title: '操作人', align: 'center', valign: 'middle', width: '20%' },
{
field: 'createTime', title: '配置时间', align: 'center', valign: 'middle', width: '20%', formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format('yyyy-MM-dd hh:mm:ss');
} else {
return '-';
}
}
},
{
field: 'interceptStatus', title: '操作', align: 'center', valign: 'middle', width: '20%',
formatter: function (val, row, index) {
const phoneBlackId = row.id;
const interceptStatus = row.interceptStatus
console.log('interceptStatus', interceptStatus)
let str = '';
if (interceptStatus == 1) {
str = '<button id="btnEdit" name="btnEdit" class= "btn btn-sm btn-success opt-edit" phoneBlackId =' + phoneBlackId + ' operateType=' + 1 + '>' +
'<i class="glyphicon glyphicon-edit"></i>允许</button>'
} else {
str = '<button id="btnEdit" name="btnEdit" class= "btn btn-sm btn-warning opt-edit" phoneBlackId =' + phoneBlackId + ' operateType=' + 2 + '>' +
'<i class="glyphicon glyphicon-edit"></i>禁止</button>'
}
return str +
'<button class="btn btn-sm btn-danger opt-remove" phoneBlackId =' + phoneBlackId + ' operateType=' + 3 +
'><i class="glyphicon glyphicon-remove"></i>删除</button>';
}
}
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pagination: true,
pageList: [10, 20, 30, 50],
sidePagination: 'server',
queryParamsType: 'undefined',
queryParams: function queryParams(params) {
var param = {
pageSize: params.pageSize,
page: params.pageNumber,
phonePrefix: $('#phonePrefix').val(),
interceptStatus: $('#interceptStatus').val()
};
return param;
},
uniqueId: 'id',
toolbar: '#toolbar',
url: '/admin/phoneBlack/list',
onLoadSuccess: function () {
console.log('load success');
},
onLoadError: function () {
console.log('load fail');
}
});
// 添加事件
$('#add').on('click', function () {
clearModal();
$('#addPhoneBlack').modal('show');
});
// 保存
$('#save').on('click', function () {
if ($('#addForm').validationEngine('validate')) {
var param = {};
param.phonePrefix = $('#modal_phonePrefix').val();
param.status = $('#modal_interceptStatus').val();
$.ajax({
type: 'get',
url: '/admin/phoneBlack/add',
data: param,
dataType: 'json',
success: function (res) {
if (res.code == 200) {
$('#userMuteModal').modal('hide');
$('#tipMsg').text('保存成功');
$('#tipModal').modal('show');
TableHelper.doRefresh('#table')
} else {
$('#tipMsg').text('保存失败,错误码:' + res.message);
$('#tipModal').modal('show');
}
}
})
}
});
$("#search").on('click', function () {
TableHelper.doRefresh('#table');
});
function clearModal() {
$('#addForm')[0].reset();
$('#addForm').validationEngine('hideAll');
}
$("#table").on("click", '.opt-remove', function () {
var phoneBlackId = $(this).attr("phoneBlackId");
var operateType = $(this).attr("operateType");
if (phoneBlackId == 'undefined') {
$("#tipMsg").text("id参数有误");
$("#tipModal").modal('show');
return;
}
if (confirm("是否删除该号段?")) {
updatePhoneBlack(phoneBlackId, operateType)
}
});
$("#table").on("click", '.opt-edit', function () {
console.log("this", $(this))
var phoneBlackId = $(this).attr("phoneBlackId");
var operateType = $(this).attr("operateType");
if (phoneBlackId == 'undefined') {
$("#tipMsg").text("id参数有误");
$("#tipModal").modal('show');
return;
}
console.log("operateType", operateType)
if (operateType == 1) {
if (confirm("是否允许该号段注册?")) {
updatePhoneBlack(phoneBlackId, operateType);
}
} else {
if (confirm("是否禁止该号段注册?")) {
updatePhoneBlack(phoneBlackId, operateType);
}
}
});
function updatePhoneBlack(id, operateType) {
$.ajax({
type: 'get',
url: "/admin/phoneBlack/update.action",
data: {
id: id,
operateType: operateType
},
dataType: "json",
success: function (json) {
if (json.code == 200) {
$("#tipMsg").text("操作成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("操作失败");
$("#tipModal").modal('show');
}
}
});
}
});
}
},
};
</script>
<style scoped></style>

View File

@@ -0,0 +1,207 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<div id="toolbar">
<div class="col-sm-12">
<label for="erbanNo" class="col-sm-1 control-label">平台号:</label>
<div class="col-sm-3"><input type="text" class="form-control" name="erbanNo" id="erbanNo"
placeholder="输入平台号"></div>
<label for="inviteCode" class="col-sm-1 control-label">邀请码:</label>
<div class="col-sm-3"><input type="text" class="form-control" name="inviteCode" id="inviteCode"
placeholder="输入邀请码"></div>
</div>
<div class="col-sm-12">
<button id="btnSearch" class="btn btn-default">
<i class="glyphicon glyphicon-search"></i>查询
</button>
<button id="addBtn" class="btn btn-default">
<i class="glyphicon glyphicon-plus"></i>新增
</button>
</div>
</div>
</div>
<!-- .content -->
<div id="table"></div>
</div>
</section>
<div class="modal fade" id="addClanModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="modalLabel">新增</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" id="addForm">
<div class="form-group">
<label for="editErbanNo" class="col-sm-3 control-label">平台号</label>
<div class="col-sm-9">
<input type="text" class="form-control validate[required]" name="editErbanNo"
id="editErbanNo">
</div>
</div>
<div class="form-group">
<label for="editInviteCode" class="col-sm-3 control-label">邀请码</label>
<div class="col-sm-9">
<input type="text"
class="form-control validate[required,custom[onlyLetterNumber],minSize[4]]"
name="editInviteCode" id="editInviteCode">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="save">确定</button>
</div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "SpecialInviteCodeAdminView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{ field: 'erbanNo', title: '平台号', align: 'center', width: '5%' },
{ field: 'inviteCode', title: '邀请码', align: 'center', width: '5%' },
{
field: 'genScene', title: '创建来源', align: 'center', width: '5%',
formatter(val) {
if (val === 2) {
return '自用后台'
} else if (val === 3) {
return '小组后台'
}
}
},
{
field: 'creator', title: '创建人', align: 'center', width: '5%',
formatter(val) {
if (val) {
return val;
} else {
return '-';
}
}
},
{
field: 'createTime', title: '创建时间', align: 'center', width: '5%',
formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format("yyyy-MM-dd hh:mm:ss");
} else {
return '-';
}
}
},
],
undefinedText: 0,
cache: false,
striped: true,
showRefresh: false,
pageSize: 20,
pagination: true,
pageList: [20, 50, 100, 200, 300, 500],
search: false,
sidePagination: "server", //表示服务端请求
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
page: params.pageNumber,
pageSize: params.pageSize,
erbanNo: $('#erbanNo').val(),
inviteCode: $('#inviteCode').val()
};
return param;
},
toolbar: '#toolbar',
url: '/admin/inviteCode/listSpecial.action',
onLoadSuccess: function (data) { //加载成功时执行
console.log("load success", data);
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
});
// 查询刷新
$('#btnSearch').on('click', function () {
TableHelper.doRefresh('#table');
});
//新建标签
$("#addBtn").click(function () {
$('#editErbanNo').val(''),
$('#editInviteCode').val(''),
$("#addClanModal").modal('show');
});
// 新增
$("#save").click(function () {
if ($("#addForm").validationEngine('validate')) {
const requestParam = {
erbanNo: $('#editErbanNo').val(),
inviteCode: $('#editInviteCode').val(),
}
console.debug('------requestParam', requestParam);
$.ajax({
type: "post",
url: "/admin/inviteCode/addUserSpecialInviteCode.action",
data: JSON.stringify(requestParam),
dataType: "json",
contentType: 'application/json',
success: function (json) {
if (json.success) {
$("#tipMsg").text("保存成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
$("#addClanModal").modal('hide');
} else {
$("#tipMsg").text("保存失败." + json.message);
$("#tipModal").modal('show');
}
}
});
}
});
});
}
},
};
</script>
<style scoped></style>

View File

@@ -0,0 +1,275 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<div id="toolbar">
<div class="col-sm-12">
<label for="status" class="col-sm-4 control-label">状态:</label>
<div class="col-sm-8">
<select id="status" name="status" class="form-control">
<option value="0">已删除</option>
<option value="1" selected="selected">有效</option>
<option value="2">无效</option>
</select>
</div>
</div>
<div class="col-sm-12">
<button class="btn btn-default" id="search">
<i class="glyphicon glyphicon-wrench"></i>查询
</button>
<button class="btn btn-primary" id="add">
<i class="glyphicon glyphicon-plus"></i>增加
</button>
</div>
</div>
</div>
<!-- .content -->
<div id="table"></div>
</div>
</section>
<!-- 弹窗 -->
<div class="modal fade" id="topicBoxItemModal" rabindex='-1' role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button class="close" type="button" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">x</span>
</button>
<div class="modal-title" id="topicBoxItemModalLabel"></div>
</div>
<div class="modal-body">
<form action="" id="addForm" class="form-horizontal">
<input type="hidden" id="modal_id" name="id" />
<div class="form-group">
<label for="modal_content" class="col-sm-3 control-label">话题内容</label>
<div class="col-sm-8">
<input type="text" class="form-control validate[required,maxSize[15]]" name="content"
id="modal_content" placeholder="请输入内容限定15个字符内">
</div>
</div>
<div class="form-group">
<label for="modal_seqNo" class="col-sm-3 control-label">排序</label>
<div class="col-sm-8">
<input type="text" class="form-control validate[required,custom[integer]]" name="seqNo"
id="modal_seqNo" placeholder="请输入排序编号,升序排序">
</div>
</div>
<div class="form-group">
<label for="modal_content" class="col-sm-3 control-label">状态</label>
<div class="col-sm-8">
<select id="modal_status" name="status" class="form-control validate[required]">
<option value="">请选择...</option>
<option value="1">有效</option>
<option value="2">无效</option>
</select>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-primary" data-primary="addSave" id="save">保存</button>
</div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "TopicBoxItemAdminView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{ field: 'id', title: 'ID', align: 'center', valign: 'middle', width: '10%' },
{ field: 'content', title: '内容', align: 'left', valign: 'middle', width: '20%' },
{ field: 'seqNo', title: '排序', align: 'center', valign: 'middle', width: '10%' },
{
field: 'status', title: '状态', align: 'center', valign: 'middle', width: '10%', formatter: function (val, row, index) {
if (val == 0) {
return '已删除';
} else if (val == 1) {
return '有效';
} else if (val == 2) {
return '无效';
} else {
return val;
}
}
},
{
field: 'createTime', title: '创建时间', align: 'center', valign: 'middle', width: '20%', formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format('yyyy-MM-dd hh:mm:ss');
} else {
return '-';
}
}
},
{ field: 'operator', title: '操作人', align: 'center', valign: 'middle', width: '20%' },
{
field: 'tmp', title: '操作', align: 'center', valign: 'middle', width: '20%', formatter: function (val, row, index) {
var str = '';
if (row.status != 0) {
str += '<button class="btn btn-primary btn-sm opt-edit" data-id="' + row.id + '">编辑</button>&nbsp;&nbsp;'
str += '<button class="btn btn-danger btn-sm opt-remove" data-id="' + row.id + '">删除</button>&nbsp;&nbsp;';
}
return str;
}
}
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pagination: true,
pageList: [10, 20, 30, 50],
sidePagination: 'server',
queryParamsType: 'undefined',
queryParams: function queryParams(params) {
var status = $('#status').val();
if (null == status || status == '') {
status = 1;
}
var param = {
pageSize: params.pageSize,
pageNumber: params.pageNumber,
status: status
};
return param;
},
uniqueId: 'id',
toolbar: '#toolbar',
url: '/admin/user/topicBoxItem/list.action',
onLoadSuccess: function () {
console.log('load success');
},
onLoadError: function () {
console.log('load fail');
}
});
// 编辑按钮点击事件
$('#table').on('click', '.opt-edit', function () {
clearModal();
var id = $(this).data('id');
$.ajax({
type: "get",
url: "/admin/user/topicBoxItem/getById.action",
data: { id: id },
dataType: "json",
success: function (json) {
if (json && json.code == 200) {
var data = json.data;
$('#modal_content').val(data.content);
$('#modal_id').val(data.id);
$('#modal_seqNo').val(data.seqNo);
$('#modal_status').val(data.status);
}
}
});
$('#topicBoxItemModalLabel').text('编辑话题');
$('#topicBoxItemModal').modal('show');
});
$("#table").on("click", '.opt-remove', function () {
var id = $(this).attr("data-id");
if (id == 'undefined') {
$("#tipMsg").text("id参数有误");
$("#tipModal").modal('show');
return;
}
if (confirm("你确认删除该记录吗? \r\n 删除后再也不能找回,请谨慎操作!")) {
$.ajax({
type: 'post',
url: "/admin/user/topicBoxItem/delete.action",
data: { id: id },
dataType: "json",
success: function (json) {
if (json.code == 200) {
$("#tipMsg").text("删除成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("删除失败");
$("#tipModal").modal('show');
}
}
});
}
});
// 添加事件
$('#add').on('click', function () {
clearModal();
$('#topicBoxItemModalLabel').text('新增话题');
$('#topicBoxItemModal').modal('show');
});
// 保存
$('#save').on('click', function () {
if ($('#addForm').validationEngine('validate')) {
var param = {};
param.status = $('#modal_status').val();
param.content = $('#modal_content').val();
param.seqNo = $('#modal_seqNo').val();
param.id = $('#modal_id').val();
$.ajax({
type: 'post',
url: '/admin/user/topicBoxItem/save',
data: param,
dataType: 'json',
success: function (res) {
if (res.code == 200) {
$('#topicBoxItemModal').modal('hide');
$('#tipMsg').text('保存成功');
$('#tipModal').modal('show');
TableHelper.doRefresh('#table')
} else {
$('#tipMsg').text('保存失败,错误码:' + res.message);
$('#tipModal').modal('show');
}
}
})
}
});
$("#search").on('click', function () {
TableHelper.doRefresh('#table');
});
function clearModal() {
$('#addForm')[0].reset();
$('#addForm').validationEngine('hideAll');
$('#modal_id').val('');
}
});
}
},
};
</script>
<style scoped></style>

View File

@@ -0,0 +1,131 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<div id="toolbar">
<div class="col-sm-12">
<label for="erbanNo" class="col-sm-4 control-label">用户平台号:</label>
<div class="col-sm-4">
<input type="text" class="input-sm" name="erbanNo" id="erbanNo" placeholder="请输入用户平台号">
</div>
</div>
<div class="col-sm-12">
<button class="btn btn-default" id="search">
<i class="glyphicon glyphicon-wrench"></i>查询
</button>
<button class="btn btn-primary" id="exportBtn">
<i class="glyphicon glyphicon-wrench"></i>导出
</button>
</div>
</div>
</div>
<!-- .content -->
<div id="table"></div>
</div>
</section>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "UserBackpackAdminView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{ field: 'erbanNo', title: '用户平台号', align: 'center', valign: 'middle', width: '10%' },
{ field: 'nick', title: '用户昵称', align: 'center', valign: 'middle', width: '10%' },
{ field: 'giftName', title: '礼物名称', align: 'center', valign: 'middle', width: '10%' },
{
field: 'consumeType', title: '礼物类型', align: 'center', valign: 'middle', width: '10%',
formatter: function (val, row, index) {
if (row.giftType == 4) {
return '特殊礼物';
}
if (val == 1) {
return '金币礼物';
} else if (val == 2) {
return '萝卜礼物';
} else {
return '-';
}
}
},
{ field: 'count', title: '礼物数量(个)', align: 'center', valign: 'middle', width: '10%' },
{
field: 'goldPrice', title: '礼物单价', align: 'center', valign: 'middle', width: '10%',
formatter: function (val, row, index) {
if (row.giftType == 4) {
return '-';
}
return val;
}
},
{
field: 'createTime', title: '创建时间', align: 'center', valign: 'middle', width: '10%',
formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format('yyyy-MM-dd hh:mm:ss');
} else {
return '-';
}
}
}
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pagination: true,
pageList: [10, 20, 30, 50],
sidePagination: 'server',
queryParamsType: 'undefined',
queryParams: function queryParams(params) {
var param = {
pageSize: params.pageSize,
pageNumber: params.pageNumber,
erbanNo: $('#erbanNo').val()
};
return param;
},
uniqueId: 'id',
toolbar: '#toolbar',
url: '/admin/user/backpack/list',
onLoadSuccess: function () {
console.log('load success');
},
onLoadError: function () {
console.log('load fail');
}
});
$("#search").on('click', function () {
TableHelper.doRefresh('#table');
});
$("#exportBtn").on('click', function () {
window.open("/admin/user/backpack/export.action?erbanNo=" + $('#erbanNo').val());
})
});
}
},
};
</script>
<style scoped></style>

View File

@@ -0,0 +1,328 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body user-bank">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<!-- .content -->
<div id="table"></div>
<div id="toolbar" class="clearfix">
<div class="col-sm-8">
<form id="searchForm">
<label for="erbanNo" class="col-sm-2 control-label">平台号:</label>
<div class="col-sm-4"><input type="text" class="form-control" name="erbanNo" id="erbanNo"></div>
</form>
</div>
<div class="col-sm-4 text-right">
<button id="btnAdd" class="btn btn-default">
<i class="glyphicon glyphicon-plus"></i>新增
</button>
<button id="btnSearch" class="btn btn-default">
<i class="glyphicon glyphicon-search"></i>查询
</button>
</div>
</div>
</div>
</div>
</section>
<div class="modal fade" id="addModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="modalLabel">银行卡信息</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" id="applyForm">
<div class="form-group">
<label for="addErbanNo" class="col-sm-3 control-label">平台号</label>
<div class="col-sm-9">
<input type="text" class="form-control validate[required]" name="addErbanNo"
id="addErbanNo">
</div>
</div>
<div class="form-group">
<label for="bankCardNum" class="col-sm-3 control-label">银行卡号码</label>
<div class="col-sm-9">
<input type="text" class="form-control validate[required]" name="bankCardNum"
id="bankCardNum">
</div>
</div>
<div class="form-group">
<label for="bankCardName" class="col-sm-3 control-label">持卡人姓名</label>
<div class="col-sm-9">
<input type="text" class="form-control validate[required]" name="bankCardName"
id="bankCardName">
</div>
</div>
<div class="form-group">
<label for="bankName" class="col-sm-3 control-label">银行名字</label>
<div class="col-sm-9">
<input type="text" class="form-control validate[required]" name="bankName" id="bankName">
</div>
</div>
<div class="form-group">
<label for="bankBranch" class="col-sm-3 control-label">银行支行信息</label>
<div class="col-sm-9">
<input type="text" class="form-control" name="bankBranch" id="bankBranch">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="apply">提交</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="tipModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">提示信息</h4>
</div>
<div class="modal-body" id="tipMsg"></div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "UserBankAdminView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
var isLoading = false;
var isAdd = false;
var changeId, changeUid;
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
//{field: 'id', title: 'id', align: 'center', width: '5%'},
{ field: 'tmp', title: 'id', align: 'center', checkbox: true, width: '5%' },
{ field: 'id', title: 'id', align: 'center', width: '5%' },
{ field: 'erbanNo', title: '平台号', align: 'center', width: '5%' },
{ field: 'nick', title: '昵称', align: 'center', width: '5%' },
{ field: 'bankCardNum', title: '银行卡号', align: 'center', width: '5%' },
{ field: 'bankCardName', title: '持卡人姓名', align: 'center', width: '5%' },
{ field: 'bankName', title: '银行名字', align: 'center', width: '5%' },
{ field: 'bankBranch', title: '银行支行信息', align: 'center', width: '5%' },
{
field: 'createTime',
title: '创建时间',
align: 'center',
width: '5%',
valign: 'middle',
formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format("yyyy-MM-dd hh:mm:00");
} else {
return '-';
}
}
},
{
field: 'updateTime',
title: '修改时间',
align: 'center',
width: '5%',
valign: 'middle',
formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format("yyyy-MM-dd hh:mm:00");
} else {
return '-';
}
}
},
{
field: 'id',
title: '操作',
align: 'center',
width: '5%',
valign: 'middle',
formatter: function (val, row, index) {
var actions = [];
actions.push('<button class="btn btn-sm btn-success opt-change" data-index="' + index + '">修改</button> ');
actions.push('<button class="btn btn-danger btn-sm opt-remove" data-id="' + row.id + '">删除</button> ');
return actions.join('');
}
}
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 20,
pagination: true,
pageList: [20, 50, 100, 200, 300, 500],
search: false,
sidePagination: "server", //表示服务端请求
//设置为undefined可以获取pageNumberpageSizesearchTextsortNamesortOrder
//设置为limit可以获取limit, offset, search, sort, order
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageNumber: params.pageNumber,
pageSize: params.pageSize,
erbanNo: $('#erbanNo').val()
};
return param;
},
toolbar: '#toolbar',
url: '/admin/user/bank/account/list',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
isLoading = false;
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
isLoading = false;
}
});
// 查询刷新
$('#btnSearch').on('click', function () {
if (isLoading) {
return;
}
isLoading = true;
TableHelper.doRefresh('#table');
});
// 修改
$('#table').on('click', '.opt-change', function () {
var currentData = $('#table').bootstrapTable('getData')[$(this).data('index')];
isAdd = false;
changeId = currentData.id;
changeUid = currentData.uid;
$('#applyForm').validationEngine('hideAll');
$('#applyForm')[0].reset();
$('#bankCardNum').val(currentData.bankCardNum);
$('#bankCardName').val(currentData.bankCardName);
$('#bankName').val(currentData.bankName);
$('#bankBranch').val(currentData.bankBranch);
$('#addErbanNo').val(currentData.erbanNo).attr('disabled', true);
$("#addModal").modal('show');
});
// 新增
$("#btnAdd").click(function () {
isAdd = true;
$('#applyForm').validationEngine('hideAll');
$('#applyForm')[0].reset();
$('#addErbanNo').removeAttr('disabled');
$("#addModal").modal('show');
});
// 删除
$("#table").on("click", '.opt-remove', function () {
var id = $(this).attr("data-id");
if (id == 'undefined') {
$("#tipMsg").text("id参数有误");
$("#tipModal").modal('show');
return;
}
if (confirm("你确认删除该记录吗? \r\n 删除后再也不能找回,请谨慎操作!")) {
$.ajax({
type: 'post',
url: "/admin/user/bank/account/delete",
data: { recordId: id },
dataType: "json",
success: function (json) {
if (json.code == 200) {
$("#tipMsg").text("删除成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("删除失败");
$("#tipModal").modal('show');
}
}
});
}
});
$("#apply").click(function () {
var bankCardNum = $('#bankCardNum').val();
var bankCardName = $('#bankCardName').val();
var bankName = $('#bankName').val();
var bankBranch = $('#bankBranch').val();
var erbanNo = $('#addErbanNo').val();
var userBankAccountVo = {
bankCardNum: bankCardNum,
bankCardName: bankCardName,
bankName: bankName,
bankBranch: bankBranch,
erbanNo: erbanNo
};
if (!isAdd) {
userBankAccountVo.id = changeId;
userBankAccountVo.uid = changeUid;
}
if ($('#applyForm').validationEngine('validate')) {
updateUserBankInfo(userBankAccountVo);
}
});
function updateUserBankInfo(userBankAccountVo) {
if (isLoading) {
return;
}
isLoading = true;
$.ajax({
type: "post",
url: "/admin/user/bank/account/update",
//data: $('#rejectForm').serialize(),
data: userBankAccountVo,
dataType: "json",
success: function (json) {
isAdd = false;
if (json.code == 200) {
$("#tipMsg").text("保存成功");
$("#tipModal").modal('show');
$("#addModal").modal('hide');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("保存失败:" + json.message);
$("#tipModal").modal('show');
// TableHelper.doRefresh("#table");
}
isLoading = false;
},
error: function () {
isLoading = false;
}
});
}
});
}
},
};
</script>
<style scoped>
.user-bank .fixed-table-toolbar {
overflow: hidden;
}
.user-bank .fixed-table-toolbar .bars {
width: 100%;
}</style>

View File

@@ -0,0 +1,449 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<!-- .content -->
<section class="content">
<div id="table"></div>
<div id="toolbar">
<div class="col-sm-12">
<label for="searchUid" class="qry_col control-label">uid:</label>
<div class="col-sm-2">
<input type="text" class="form-control" name="searchUid" id="searchUid">
</div>
<label for="searchErbanNo" class="qry_col control-label">平台号:</label>
<div class="col-sm-2">
<input type="text" class="form-control" name="searchErbanNo" id="searchErbanNo">
</div>
<label for="searchPhone" class="qry_col control-label">手机号:</label>
<div class="col-sm-2">
<input type="text" class="form-control" name="searchPhone" id="searchPhone">
</div>
</div>
<div class="col-sm-12">
<button id="searchForm" class="btn btn-default">
<i class="glyphicon glyphicon-search"></i>搜索
</button>
<button id="sysConf-add" class="btn btn-default">
<i class="glyphicon glyphicon-plus"></i>注销用户
</button>
</div>
</div>
</section><!-- .content -->
</div>
</div>
</section>
<div class="modal fade" id="sysConfModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="modalLabel">注销用户</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" id="sysConfForm">
<div class="form-group">
<label for="erbanNo" class="col-sm-2 control-label"><span
style="color: red; ">*</span>平台号</label>
<div class="col-sm-10">
<input type="text" class="form-control validate[required]" name="erbanNo" id="erbanNo">
</div>
</div>
<div class="form-group">
<label for="phone" class="col-sm-2 control-label">接收信息手机号</label>
<div class="col-sm-10">
<input type="text" class="form-control validate[required]" name="phone" id="phone">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="save">注销</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="tipModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">提示信息</h4>
</div>
<div class="modal-body" id="tipMsg"></div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
import { showLoading, hideLoading } from '@/utils/maintainer';
export default {
name: "UserCancelView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('#table').bootstrapTable('destroy');
initTable();
/**增加搜索功能*/
$('#searchForm').on('click', function () {
$('#table').bootstrapTable('destroy');
initTable();
});
function initTable() {
$('#table').bootstrapTable({
cache: false,
striped: true,
showRefresh: false,
pageSize: 15,
pagination: true,
pageList: [15],
sidePagination: "server", //表示服务端请求
//设置为undefined可以获取pageNumberpageSizesearchTextsortNamesortOrder
//设置为limit可以获取limit, offset, search, sort, order
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageSize: params.pageSize,
pageNumber: params.pageNumber,
uid: $("#searchUid").val(),
phone: $("#searchPhone").val(),
erbanNo: $("#searchErbanNo").val()
};
return param;
},
uniqueId: 'erbanNo',
toolbar: '#toolbar',
url: '/admin/userCancel/getlist.action',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
},
columns: [
{ field: 'erbanNo', title: '平台号', align: 'center', valign: 'middle' },
{
field: 'avatar',
title: '头像',
align: 'center',
valign: 'middle',
formatter: function (val, row, index) {
return "<img src='" + val + "' width='40' height='40'>";
}
},
{ field: 'uid', title: 'Uid', align: 'center', valign: 'middle' },
{ field: 'nick', title: '用户昵称', align: 'center', valign: 'middle' },
/*{field:'userDesc',title:'简介',align:'center',valign:'middle'},*/
{
field: '', title: '是否实名认证', align: 'center', valign: 'middle',
formatter: function (val, row, index) {
if (row.idCardNum && row.realName) {
return '是';
} else {
return '否';
}
}
},
/*{
field:'privatePhoto',
title:'相册',
align:'center',
width:'10%',
valign:'middle',
formatter:function (val,row,index) {
var photoUrl='';
val.forEach(function(item, index) {
photoUrl +="<img src='"+item.photoUrl+"' width='70' height='70'>";
});
return photoUrl;
}
},*/
{ field: 'userPurseVo.diamondNum', title: '钻石数', align: 'center', valign: 'middle' },
{ field: 'userPurseVo.goldNum', title: '金币数', align: 'center', valign: 'middle' },
// {field:'account.phone',title:'手机电话',align:'center',valign:'middle'},
{
field: 'birth',
title: '用户出生日期',
align: 'center',
valign: 'middle',
formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format("yyyy-MM-dd");
} else {
return '-';
}
}
},
{
field: 'gender',
title: '性别',
align: 'center',
valign: 'middle',
formatter: function (val, row, index) {
if (val == 1) {
return '男';
} else {
return '女';
}
}
},
{ field: 'alipayAccount', title: '支付宝账号', align: 'center', valign: 'middle' },
{ field: 'alipayAccountName', title: '支付宝账户名', align: 'center', valign: 'middle' },
/*{
field:'defUser',
title:'账号类型',
align: 'center',
valign: 'middle',
formatter:function (val,row,index) {
switch (val){
case 1:
return '普通账号';
break;
case 2:
return '官方账号';
break;
case 3:
return '机器账号';
break;
}
}
},*/
{ field: 'phone', title: '注册手机号', align: 'center', valign: 'middle' },
{ field: 'cancelPhone', title: '接收注销信息手机号', align: 'center', valign: 'middle' },
{
field: 'createTime',
title: '注册时间',
align: 'center',
valign: 'middle',
formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format("yyyy-MM-dd hh:mm:ss");
} else {
return '-';
}
}
},
{
field: 'updateTime',
title: '注销时间',
align: 'center',
valign: 'middle',
formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format("yyyy-MM-dd hh:mm:ss");
} else {
return '-';
}
}
},
{
field: 'tmp',
title: '操作',
align: 'center',
width: '10%',
valign: 'middle',
formatter: function (val, row, index) {
var key = row.uid;
if (!row.isRecover) {
return "<button class='btn btn-sm btn-info opt-recover' data-id=" + key + ">恢复注销</button>";
}
}
}
]
});
}
$("#table").on("click", '.opt-remove', function () {
var id = $(this).attr("data-id");
if (id == 'undefined') {
$("#tipMsg").text("id参数有误");
$("#tipModal").modal('show');
return;
}
if (confirm("你确认删除该记录吗?" +
"\r\n删除后再也不能找回请谨慎操作")) {
$.ajax({
type: 'post',
url: "/admin/sysConf/del.action",
data: { 'ids': JSON.stringify([id]) },
dataType: "json",
success: function (json) {
if (json.success == 'true') {
$("#tipMsg").text("删除成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("删除失败");
$("#tipModal").modal('show');
}
}
});
}
});
$("#sysConf-add").click(function () {
// 打开编辑弹窗
$("#sysConfModal").modal('show');
$("#sysConfForm")[0].reset();
$("#configId").val('');
$("#configId").attr('readonly', false);
});
$("#sysConf-multiDel").click(function () {
var rows = $("#table").bootstrapTable("getSelections");
if (rows.length == 0) {
alert("请先选择要删除的记录");
return;
}
console.log("rows: " + rows.length);
var idArr = [];
for (var i = 0; i < rows.length; i++) {
idArr.push(rows[i]['configId']);
}
console.log(idArr);
if (confirm("你确认批量删除该记录吗?" +
"\r\n删除后再也不能找回请谨慎操作")) {
$.ajax({
type: 'post',
url: "/admin/sysConf/del.action",
data: { 'ids': JSON.stringify(idArr) },
dataType: "json",
success: function (json) {
if (json.success == 'true') {
$("#tipMsg").text("删除成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("删除失败");
$("#tipModal").modal('show');
}
}
});
}
});
$("#cancel").click(function () {
TableHelper.unCheckAll("#table");
});
$("#table").on("click", '.opt-edit', function () {
console.log("btnEdit");
$("#configId").attr('readonly', true);
var id = $(this).attr("data-id");
$.ajax({
type: "get",
url: "/admin/sysConf/get.action",
data: { id: id },
dataType: "json",
success: function (json) {
if (json.entity) {
$("#configId").val(json.entity.configId);
$("#configName").val(json.entity.configName);
$("#configValue").val(json.entity.configValue);
$("#nameSpace").val(json.entity.nameSpace);
var status = json.entity.configStatus - 1;
$("input:radio[name='configStatus']")[status].checked = true;
// 打开编辑弹窗
$("#sysConfModal").modal('show');
} else {
$("#tipMsg").text("获取菜单信息出错");
$("#tipModal").modal('show');
}
}
});
});
$("#save").click(function () {
showLoading();
$.ajax({
type: "post",
url: "/admin/userCancel/add.action",
data: $('#sysConfForm').serialize(),
dataType: "json",
success: function (json) {
hideLoading();
if (json.code == 200) {
$("#sysConfModal").modal('hide');
$("#tipMsg").text("注销成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text(json.message);
$("#tipModal").modal('show');
}
}
});
});
//注销恢复
$("#table").on("click", '.opt-recover', function () {
var uid = $(this).attr("data-id");
$.ajax({
type: 'post',
url: "/admin/userCancel/recover.action",
data: {
uid: uid
},
dataType: "json",
success: function (json) {
if (json.code == 200) {
$("#tipMsg").text("操作成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("操作失败:" + json.message);
$("#tipModal").modal('show');
}
}
});
});
});
}
},
};
</script>
<style scoped>
.table_line {
word-break: break-all;
}
.td_center {
vertical-align: middle !important;
}
.qry_col {
float: left;
}
</style>

View File

@@ -0,0 +1,201 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<section class="content">
<div id="table"></div>
<div id="toolbar">
身份证号<input type="text" name="idCardNum" id="idCardNum" class="input-sm" />
状态
<select id="bindStatus" name="bindStatus" class="input-sm">
<option value="">全部</option>
<option value="-1">未绑定</option>
<option value="0">未完成</option>
<option value="1">绑定失败</option>
<option value="2">已绑定</option>
<option value="3">已删除</option>
</select>
<button id="btnSearch" class="btn btn-sm btn-primary">查询</button>
<button id="btnReset" class="btn btn-sm btn-warning">重置</button>
<button id="btnBatchDel" class="btn btn-sm btn-danger">批量删除</button>
</div>
</section>
</div>
</div>
</section>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "UserCertifyAdminView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{ field: 'temId', title: 'ID', align: 'center', valign: 'middle', width: '10%', checkbox: true },
{ field: 'recordId', title: '序号', align: 'center', valign: 'middle', width: '10%' },
{ field: 'idCardNum', title: '身份证号', align: 'center', valign: 'middle', width: '20%' },
{ field: 'name', title: '姓名', align: 'center', valign: 'middle', width: '10%' },
{ field: 'phone', title: '手机号', align: 'center', valign: 'middle', width: '10%' },
{ field: 'erbanNo', title: '平台号', align: 'center', valign: 'middle', width: '10%' },
{
field: 'createTime', title: '绑定时间', align: 'center', valign: 'middle', width: '10%', formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format("yyyy-MM-dd hh:mm:ss");
} else {
return '-';
}
}
},
{
field: 'bindStatus', title: '状态', align: 'center', valign: 'middle', width: '10%',
formatter: function (val, row, index) {
if (val == -1) {
return '未绑定';
} else if (val == 0) {
return '未完成';
} else if (val == 1) {
return '绑定失败';
} else if (val == 2) {
return '已绑定';
} else if (val == 3) {
return '已删除';
}
return val;
}
},
{
field: 'tmp', title: '操作', align: 'center', valign: 'middle', width: '10%',
formatter: function (val, row, index) {
var key = row.recordId;
var status = row.status;
var str = '';
if (row.bindStatus == 2) {
str += '<button class="btn btn-danger btn-sm opt-remove" data-id="' + key + '">删除</button>';
}
return str;
}
}
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pagination: true,
pageList: [10, 20, 30, 50],
sidePagination: "server", //表示服务端请求
//设置为undefined可以获取pageNumberpageSizesearchTextsortNamesortOrder
//设置为limit可以获取limit, offset, search, sort, order
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageSize: params.pageSize,
pageNumber: params.pageNumber,
bindStatus: $('#bindStatus').val(),
idCardNum: $('#idCardNum').val()
};
return param;
},
uniqueId: 'code',
toolbar: '#toolbar',
url: '/admin/certify/record/list',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
})
$('#btnSearch').on('click', function () {
TableHelper.doRefresh('#table');
})
$('#btnReset').on('click', function () {
$('#idCardNum').val('');
$('#bindStatus').val('');
});
$("#table").on("click", '.opt-remove', function () {
var id = $(this).attr("data-id");
if (id == 'undefined') {
$("#tipMsg").text("id参数有误");
$("#tipModal").modal('show');
return;
}
if (confirm("你确认删除该记录吗? \r\n 删除后再也不能找回,请谨慎操作!")) {
$.ajax({
type: 'post',
url: "/admin/certify/record/delete",
data: { recordId: id },
dataType: "json",
success: function (json) {
if (json.code == 200) {
$("#tipMsg").text("删除成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("删除失败");
$("#tipModal").modal('show');
}
}
});
}
});
$("#btnBatchDel").click(function () {
var rows = $("#table").bootstrapTable("getSelections");
if (rows.length == 0) {
alert("请先选择要删除的记录");
return;
}
console.log("rows: " + rows.length);
var idArr = [];
for (var i = 0; i < rows.length; i++) {
idArr.push(rows[i]['recordId']);
}
console.log(idArr);
if (confirm("你确认批量删除该记录吗?" +
"\r\n删除后再也不能找回请谨慎操作")) {
$.ajax({
type: 'post',
url: "/admin/certify/record/deleteBatch",
data: { 'ids': JSON.stringify(idArr) },
dataType: "json",
success: function (json) {
if (json.code == 200) {
$("#tipMsg").text("删除成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("删除失败");
$("#tipModal").modal('show');
}
}
});
}
});
}
},
};
</script>
<style scoped>
#erbanNo,
#billType,
#startDate,
#endDate {
margin-right: 4px;
}</style>

View File

@@ -0,0 +1,537 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<section class="content">
<div id="table"></div>
<div id="toolbar">
<div style="margin-bottom: 6px">
<button id="btnSearch" class="btn btn-sm btn-primary">查询</button>
搜索根源
<select name="checkType" id="checkType">
<option value="1">平台号</option>
<option value="2">手机号</option>
<option value="4">uid</option>
</select>
</div>
<textarea name="erbanNoList" id="erbanNoList" placeholder="多个搜索号请用逗号隔开"></textarea>
</div>
</section>
</div>
</div>
</section>
<div class="modal fade" id="editModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel2">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">x</span></button>
<h4 class="modal-title" id="addModalLabel">编辑用户信息</h4>
</div>
<div class="modal-body">
<form id="editUser" class="form-horizontal">
<input type="hidden" name="uid" id="editUid">
<input type="hidden" name="app" id="app">
<div class="form-group">
<label for="editNick" class="col-sm-3 control-label">昵称:</label>
<div class="col-sm-7">
<input type="text" class="form-control validate[required]" name="nick" id="editNick">
</div>
<button class="btn btn-warning col-sm-2" type="button" id="default_nick">恢复默认</button>
</div>
<div class="form-group">
<label for="editGender" class="col-sm-3 control-label">性别:</label>
<div class="col-sm-8">
<select name="gender" id="editGender">
<option value="1"></option>
<option value="2"></option>
</select>
</div>
</div>
<div class="form-group">
<label for="editPhone" class="col-sm-3 control-label">手机:</label>
<div class="col-sm-8 control-label">
<p id="editPhone"></p>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">用户头像图:</label>
<div class="col-sm-8">
<img src="" id="addImgUrl" style="width:70px;height:70px;" alt="">
<input type="file" id="addUploadFile" name="uploadFile"
accept="image/gif,image/jpeg,image/jpg,image/png,image/svg">
<button class="btn btn-success" type="button" id="editUploadBtn">上传</button>
<button class="btn btn-warning" type="button" id="default_avatar">恢复默认</button>
<input type="hidden" id="editAvatar" name="avatar"
class="form-control validate[required]" />
</div>
</div>
<div class="form-group">
<label for="userDesc" class="col-sm-3 control-label">简介:</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="userDesc" id="userDesc">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">相册:</label>
<table class="table table-bordered table-hover" id="photoTable">
<tbody id="photoTbody">
</tbody>
</table>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">添加相册:</label>
<div class="col-sm-8">
<img src="" id="picUrl" style="width:70px;height:70px;" alt="">
<input type="file" id="uploadPhotoFile" name="uploadPhotoFile"
accept="image/gif,image/jpeg,image/jpg,image/png,image/svg">
<button class="btn btn-success" type="button" id="uploadPicBtn">上传</button>
<input type="hidden" class="form-control validate[required]" name="imgUrl" id="imgUrl"
style="width:400px">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">是否发送通知:</label>
<div class="col-sm-9">
<label class="radio-inline"><input type="radio" name="sendMsg" id="needSend" value="1"
checked></label>
<label class="radio-inline"><input type="radio" name="sendMsg" id="notSend"
value="0"></label>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label"> </label>
<div class="col-sm-9" id="msgDiv">
<textarea type="text" class="form-control" name="msg" id="msg" maxlength="100"
placeholder="请填写通知内容100字符内"></textarea>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="editSave">保存</button>
</div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "UserCheckAdminBaseView",
setup() {
function delPhoto(obj) {
var tr = $(obj).parent().parent();
tr.remove();
}
window.delPhoto = delPhoto;
return {
delPhoto
};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pagination: true,
pageList: [10, 20, 30, 50],
sidePagination: "client", //表示服务端请求
//设置为undefined可以获取pageNumberpageSizesearchTextsortNamesortOrder
//设置为limit可以获取limit, offset, search, sort, order
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageSize: params.pageSize,
pageNumber: params.pageNumber,
erbanNoList: $('#erbanNoList').val(),
type: $('#checkType').val()
};
// console.log(param);
return param;
},
uniqueId: 'code',
toolbar: '#toolbar',
url: '/admin/userCheckAdmin/getlist.action',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
},
columns: [
{ field: 'account.erbanNo', title: '平台号', align: 'center', valign: 'middle' },
{
field: 'users.avatar',
title: '头像',
align: 'center',
valign: 'middle',
formatter: function (val, row, index) {
return "<img src='" + val + "' width='40' height='40'>";
}
},
{ field: 'account.uid', title: 'Uid', align: 'center', valign: 'middle' },
{ field: 'users.nick', title: '用户昵称', align: 'center', valign: 'middle' },
{ field: 'users.userDesc', title: '简介', align: 'center', valign: 'middle' },
{
field: '', title: '是否实名认证', align: 'center', valign: 'middle',
formatter: function (val, row, index) {
if (row.users.idCardNum && row.users.realName) {
return '是';
} else {
return '否';
}
}
},
{
field: 'privatePhoto',
title: '相册',
align: 'center',
width: '10%',
valign: 'middle',
formatter: function (val, row, index) {
var photoUrl = '';
val.forEach(function (item, index) {
photoUrl += "<img src='" + item.photoUrl + "' width='70' height='70'>";
});
return photoUrl;
}
},
{ field: 'userPurseVo.diamonds', title: '钻石数', align: 'center', valign: 'middle' },
{ field: 'userPurseVo.golds', title: '金币数', align: 'center', valign: 'middle' },
// {field:'account.phone',title:'手机电话',align:'center',valign:'middle'},
{
field: 'users.birth',
title: '用户出生日期',
align: 'center',
valign: 'middle',
formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format("yyyy-MM-dd");
} else {
return '-';
}
}
},
{
field: 'users.gender',
title: '性别',
align: 'center',
valign: 'middle',
formatter: function (val, row, index) {
if (val == 1) {
return '男';
} else {
return '女';
}
}
},
{
field: 'users.defUser',
title: '账号类型',
align: 'center',
valign: 'middle',
formatter: function (val, row, index) {
switch (val) {
case 1:
return '普通账号';
case 2:
return '官方账号';
case 3:
return '机器账号';
}
}
},
{
field: 'users.createTime',
title: '创建时间',
align: 'center',
valign: 'middle',
formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format("yyyy-MM-dd hh:mm:ss");
} else {
return '-';
}
}
},
{ field: 'users.inviteCode', title: '所属邀请码', align: 'center', valign: 'middle' },
{
field: 'tmp',
title: '操作',
align: 'center',
width: '20%',
valign: 'middle',
formatter: function (val, row, index) {
var key = row.account.uid;
var result = "<button class='btn btn-sm btn-success opt-edit' data-id=" + key + ">编辑</button>";
return result;
}
}
]
})
$('#btnSearch').on('click', function () {
TableHelper.doRefresh('#table');
})
$('#uploadPicBtn').on('click', function () {
if (!$('#uploadPhotoFile').val()) {
$("#tipMsg").text("请选择上传图片");
$("#tipModal").modal('show');
return;
}
var options = {
type: 'post',
url: '/admin/userCheckAdmin/upload/photo.action',
dataType: 'json',
success: function (json) {
if (json.path) {
$('#imgUrl').val(json.path);
$('#picUrl').attr('src', json.path);
var trHtml = '<tr><td style="text-align:center;"><img src="' + json.path + '" width="100" height="100" class="photoImgUrl"></td>' +
'<td><button class="btn btn-danger" type="button" onclick="delPhoto(this)">删除</button></td></tr>';
$('#photoTbody').append(trHtml);
} else {
$('#tipMsg').text(json.msg);
$('#tipModal').modal('show');
}
}
}
$("#editUser").ajaxSubmit(options);
});
$('#table').on('click', '.opt-edit', function () {
$('#imgUrl').val('');
$('#picUrl').attr('src', '');
$('#uploadPhotoFile').val('');
$("#needSend").prop("checked", true);
$('#msg').val('');
$('#msgDiv').show();
$.ajax({
url: '/admin/userCheckAdmin/getOne',
type: 'post',
data: {
uid: $(this).data('id')
},
dataType: 'json',
success: function (res) {
if (res.code == 200) {
var users = res.data.users;
var account = res.data.account;
var nick = users ? users.nick : '';
var avatar = users ? users.avatar : '';
var gender = users ? users.gender : 1;
$('#editNick').val(nick);
$('#editPhone').html(account.phone);
$('#addImgUrl').attr('src', avatar);
$('#editAvatar').val(avatar);
$('#editPhone').val(account.phone);
$('#editGender').val(gender);
$('#editUid').val(account.uid);
$("#app").val(users.currentApp);
$("#userDesc").val(users.userDesc);
var privatePhoto = res.data.privatePhoto;
var $photos = $('#photoTbody');
$photos.html("");
$.each(privatePhoto, function (i, item) {
var $photo = $('<tr><td style="text-align:center;"><img src="' + item.photoUrl + '" width="100" height="100" class="photoImgUrl"></td>' +
'<td><button class="btn btn-danger" type="button" onclick="delPhoto(this)">删除</button></td></tr>');
$photos.append($photo);
});
}
$('#editModal').modal('show');
}
})
})
$('#editSave').on('click', function () {
var userDesc = $("#userDesc").val();
if (userDesc && userDesc.length > 60) {
$("#tipMsg").text("简介文字过长");
$("#tipModal").modal('show');
return;
}
var photoUrls = '';
var list = $('#photoTable').find($('.photoImgUrl'));
var size = list ? list.length : 0;
if (size > 8) {
$("#tipMsg").text("最多只能上传8张照片");
$("#tipModal").modal('show');
return;
}
for (var i = 0; i < size; i++) {
photoUrls += list[i].src + ',';
}
var sendMsg = $('input[name="sendMsg"]:checked').val();
if (sendMsg == 1 && !$("#msg").val()) {
$("#tipMsg").text("请填写通知内容");
$("#tipModal").modal('show');
return;
}
if ($('#editUser').validationEngine('validate')) {
$.ajax({
type: "post",
url: "/admin/userCheckAdmin/saveUser.action",
data: {
nick: $('#editNick').val(),
gender: $('#editGender').val(),
avatar: $('#editAvatar').val(),
uid: $('#editUid').val(),
userDesc: $("#userDesc").val(),
photoUrls: photoUrls,
msg: $("#msg").val(),
sendMsg: sendMsg
},
dataType: 'json',
success: function (res) {
if (res.code == 200) {
// $('#erbanNoList').val('');
$("#editModal").modal('hide');
$("#tipMsg").text("保存成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else if (res.code == 1600) {
$("#tipMsg").text("保存失败,错误码:" + res.code + ",无法寻找用户资料,请确认该用户资料是否补全或存在");
$("#tipModal").modal('show');
} else if (res.code == 999) {
$("#tipMsg").text("保存失败,错误码:" + res.code + ",该平台号已被占用");
$("#tipModal").modal('show');
} else if (res.code == 4002) {
$("#tipMsg").text("保存失败,错误码:" + res.code + ",该手机号已被占用");
$("#tipModal").modal('show');
} else {
$("#tipMsg").text("保存失败,错误码:" + res.code);
$("#tipModal").modal('show');
}
}
})
}
})
$('#editUploadBtn').on('click', function () {
//判断图片的大小
var file = $('#addUploadFile')[0];
if (file != undefined && file != "") {
var fileSize = file.files[0].size; //获得文件大小;
console.log(fileSize);
if (fileSize > 5242880) {
$("#tipMsg").text("当前图片大于5M,请重新选择");
$("#tipModal").modal('show');
return
}
}
var options = {
fileElementId: 'addUploadFile', //需要上传的文件域的ID即<input type="file">的ID。
type: 'post',
url: '/admin/upload/img',
dataType: 'json',
success: function (json) {
if (json.path) {
$('#editAvatar').val(json.path);
$('#addImgUrl').attr("src", json.path);
console.log(json.path);
} else {
$("#tipMsg").text(json.msg);
$("#tipModal").modal('show');
}
}
}
$("#editUser").ajaxSubmit(options);
})
$('#default_nick').on('click', function () {
$.ajax({
type: "post",
url: "/admin/userCheckAdmin/getDefaultNick.action",
data: {
app: $('#app').val()
},
dataType: 'json',
success: function (res) {
if (res.code == 200) {
$("#editNick").val(res.data);
}
}
})
})
$('#default_avatar').on('click', function () {
$.ajax({
type: "post",
url: "/admin/userCheckAdmin/getDefaultAvatar.action",
data: {
app: $('#app').val()
},
dataType: 'json',
success: function (res) {
if (res.code == 200) {
$("#addImgUrl").attr("src", res.data);
$("#editAvatar").val(res.data);
}
}
})
})
$('input[name="sendMsg"]').change(function () {
if ($("#needSend").is(":checked")) {
$('#msgDiv').show();
} else if ($("#notSend").is(":checked")) {
$('#msgDiv').hide();
}
});
})
}
},
};
</script>
<style scoped>
#toolbar textarea {
overflow: hidden;
resize: none;
width: 100%;
box-sizing: border-box;
padding: 4px;
height: 100px;
line-height: 20px;
}
#btnSearch {
margin-right: 12px;
}</style>

View File

@@ -0,0 +1,889 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<section class="content">
<div id="table"></div>
<div id="toolbar">
<div style="margin-bottom: 6px">
<button id="btnSearch" class="btn btn-sm btn-primary">查询</button>
搜索根源
<select name="checkType" id="checkType">
<option value="1">平台号</option>
<option value="2">手机号</option>
<option value="3">支付宝账号</option>
<option value="4">uid</option>
</select>
</div>
<textarea name="erbanNoList" id="erbanNoList" placeholder="多个搜索号请用逗号隔开"></textarea>
</div>
</section>
</div>
</div>
</section>
<div class="modal fade" id="detailModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">x</span></button>
<h4 class="modal-title" id="modalLabel">用户详细信息</h4>
</div>
<div class="modal-body">
<div class="detail">
<div class="part form-group">
<div class="nick">昵称: <span></span></div>
<div class="erbanNo">平台号: <span></span></div>
<div class="uid">UID: <span></span></div>
<div class="avatar">头像<img src="" alt="" width="70px" height="70px"></div>
</div>
<div class="part form-group">
<div class="gender">性别: <span></span></div>
<div class="phone">手机: <span></span></div>
<div class="birth">出生日期: <span></span></div>
<div class="email">email: <span></span></div>
</div>
<div class="part form-group">
<div class="sign">签名: <span></span></div>
<div class="userDesc">自我描述: <span></span></div>
</div>
<div class="part form-group">
<div class="diamondNum">钻石数: <span></span></div>
<div class="crystalNum">水晶数: <span></span></div>
<div class="goldNum">金币数: <span></span></div>
</div>
<div class="part form-group">
<div class="followNum">关注数: <span></span></div>
<div class="fansNum">粉丝数: <span></span></div>
<div class="defUser">账号类型: <span></span></div>
</div>
<div class="part form-group">
<div class="fortune">财富值: <span></span></div>
<div class="channelType">下载渠道类型: <span></span></div>
</div>
<div class="part form-group">
<div class="alipayAccount">支付宝: <span></span></div>
<div class="alipayAccountName">支付宝账户名: <span></span></div>
</div>
<div class="part form-group">
<div class="ispType">运营商: <span></span></div>
<div class="netType">网络类型: <span></span></div>
<div class="model">手机型号: <span></span></div>
</div>
<div class="part form-group">
<div class="deviceID">设备号: <span></span></div>
<div class="appVersion">版本号: <span></span></div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="editModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel2">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">x</span></button>
<h4 class="modal-title" id="addModalLabel">编辑用户信息</h4>
</div>
<div class="modal-body">
<form id="editUser" class="form-horizontal">
<input type="hidden" name="uid" id="editUid">
<input type="hidden" name="app" id="app">
<div class="form-group">
<label for="editNick" class="col-sm-3 control-label">昵称:</label>
<div class="col-sm-7">
<input type="text" class="form-control validate[required]" name="nick" id="editNick">
</div>
<button class="btn btn-warning col-sm-2" type="button" id="default_nick">恢复默认</button>
</div>
<div class="form-group">
<label for="editGender" class="col-sm-3 control-label">性别:</label>
<div class="col-sm-8">
<select name="gender" id="editGender">
<option value="1"></option>
<option value="2"></option>
</select>
</div>
</div>
<div class="form-group">
<label for="editPhone" class="col-sm-3 control-label">手机:</label>
<div class="col-sm-8 control-label">
<input type="text" class="form-control" name="editPhone" id="editPhone">
<a href="javascript:void(0)" id="removePhone">解绑</a>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">用户头像图:</label>
<div class="col-sm-8">
<img src="" id="addImgUrl" style="width:70px;height:70px;" alt="">
<input type="file" id="addUploadFile" name="uploadFile"
accept="image/gif,image/jpeg,image/jpg,image/png,image/svg">
<button class="btn btn-success" type="button" id="editUploadBtn">上传</button>
<button class="btn btn-warning" type="button" id="default_avatar">恢复默认</button>
<input type="hidden" id="editAvatar" name="avatar"
class="form-control validate[required]" />
</div>
</div>
<div class="form-group">
<label for="alipayAccount" class="col-sm-3 control-label">支付宝账号 :</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="alipayAccount" id="alipayAccount">
</div>
</div>
<div class="form-group">
<label for="alipayAccountName" class="col-sm-3 control-label">支付宝账户名:</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="alipayAccountName" id="alipayAccountName">
</div>
</div>
<div class="form-group">
<label for="editDefUser" class="col-sm-3 control-label">账号类型:</label>
<div class="col-sm-8">
<select name="defUser" id="editDefUser">
<option value="1">普通账号</option>
<option value="2">官方账号</option>
</select>
</div>
</div>
<div class="form-group">
<label for="alipayAccountName" class="col-sm-3 control-label">简介:</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="userDesc" id="userDesc">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">相册:</label>
<table class="table table-bordered table-hover" id="photoTable">
<tbody id="photoTbody">
</tbody>
</table>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">添加相册:</label>
<div class="col-sm-8">
<img src="" id="picUrl" style="width:70px;height:70px;" alt="">
<input type="file" id="uploadPhotoFile" name="uploadPhotoFile"
accept="image/gif,image/jpeg,image/jpg,image/png,image/svg">
<button class="btn btn-success" type="button" id="uploadPicBtn">上传</button>
<input type="hidden" class="form-control validate[required]" name="imgUrl" id="imgUrl"
style="width:400px">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">是否发送通知:</label>
<div class="col-sm-9">
<label class="radio-inline"><input type="radio" name="sendMsg" id="needSend" value="1"
checked></label>
<label class="radio-inline"><input type="radio" name="sendMsg" id="notSend"
value="0"></label>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label"> </label>
<div class="col-sm-9" id="msgDiv">
<textarea type="text" class="form-control" name="msg" id="msg" maxlength="100"
placeholder="请填写通知内容100字符内"></textarea>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="editSave">保存</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="resetPasswdModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel2">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">x</span></button>
<h4 class="modal-title">重置密码</h4>
</div>
<div class="modal-body">
<form id="resetPasswdForm" class="form-horizontal">
<input type="hidden" name="uid" id="resetPasswdUid">
<div class="form-group">
<label for="resetPasswdNick" class="col-sm-3 control-label">昵称:</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="nick" id="resetPasswdNick" disabled>
</div>
</div>
<div class="form-group">
<label for="resetPasswdErbanNo" class="col-sm-3 control-label">平台号:</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="erbanNo" id="resetPasswdErbanNo" disabled>
</div>
</div>
<div class="form-group">
<label for="resetPasswdNewPasswd" class="col-sm-3 control-label">新密码 :</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="password" id="resetPasswdNewPasswd">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="resetPasswdSave">保存</button>
</div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "UserCheckAdminView",
setup() {
function delPhoto(obj) {
var tr = $(obj).parent().parent();
tr.remove();
}
window.delPhoto = delPhoto;
return {
delPhoto
};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pagination: true,
pageList: [10, 20, 30, 50],
sidePagination: "client", //表示服务端请求
//设置为undefined可以获取pageNumberpageSizesearchTextsortNamesortOrder
//设置为limit可以获取limit, offset, search, sort, order
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageSize: params.pageSize,
pageNumber: params.pageNumber,
erbanNoList: $('#erbanNoList').val(),
type: $('#checkType').val()
};
// console.log(param);
return param;
},
uniqueId: 'code',
toolbar: '#toolbar',
url: '/admin/userCheckAdmin/getlist.action',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
},
columns: [
{ field: 'account.erbanNo', title: '平台号', align: 'center', valign: 'middle' },
{
field: 'users.avatar',
title: '头像',
align: 'center',
valign: 'middle',
formatter: function (val, row, index) {
return "<img src='" + val + "' width='40' height='40'>";
}
},
{ field: 'account.uid', title: 'Uid', align: 'center', valign: 'middle' },
{ field: 'users.nick', title: '用户昵称', align: 'center', valign: 'middle' },
{ field: 'users.userDesc', title: '简介', align: 'center', valign: 'middle' },
{
field: '', title: '是否实名认证', align: 'center', valign: 'middle',
formatter: function (val, row, index) {
if (row.users.idCardNum && row.users.realName) {
return '是';
} else {
return '否';
}
}
},
{
field: 'privatePhoto',
title: '相册',
align: 'center',
width: '10%',
valign: 'middle',
formatter: function (val, row, index) {
var photoUrl = '';
val.forEach(function (item, index) {
photoUrl += "<img src='" + item.photoUrl + "' width='70' height='70'>";
});
return photoUrl;
}
},
{ field: 'userPurseVo.diamonds', title: '钻石数', align: 'center', valign: 'middle' },
{ field: 'userPurseVo.golds', title: '金币数', align: 'center', valign: 'middle' },
// {field:'account.phone',title:'手机电话',align:'center',valign:'middle'},
{
field: 'users.birth',
title: '用户出生日期',
align: 'center',
valign: 'middle',
formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format("yyyy-MM-dd");
} else {
return '-';
}
}
},
{
field: 'users.gender',
title: '性别',
align: 'center',
valign: 'middle',
formatter: function (val, row, index) {
if (val == 1) {
return '男';
} else {
return '女';
}
}
},
{ field: 'users.alipayAccount', title: '支付宝账号', align: 'center', valign: 'middle' },
{ field: 'users.alipayAccountName', title: '支付宝账户名', align: 'center', valign: 'middle' },
{
field: 'users.defUser',
title: '账号类型',
align: 'center',
valign: 'middle',
formatter: function (val, row, index) {
switch (val) {
case 1:
return '普通账号';
case 2:
return '官方账号';
case 3:
return '机器账号';
}
}
},
{
field: 'users.createTime',
title: '创建时间',
align: 'center',
valign: 'middle',
formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format("yyyy-MM-dd hh:mm:ss");
} else {
return '-';
}
}
},
{ field: 'users.inviteCode', title: '所属邀请码', align: 'center', valign: 'middle' },
{
field: 'tmp',
title: '操作',
align: 'center',
width: '20%',
valign: 'middle',
formatter: function (val, row, index) {
var key = row.account.uid;
var parentMode = row.users.parentMode;
var result = "<button class='btn btn-sm btn-success opt-edit' data-id=" + key + ">编辑</button>"
+ "<button class='btn btn-sm btn-warning opt-detail' data-id=" + key + ">明细</button>"
+ "<button class='btn btn-sm btn-warning opt-resetPasswd' data-id=" + key + ">重置密码</button>";
if (parentMode) {
result += "<button class='btn btn-sm btn-warning opt-closeParentMode' data-id=" + key + " data-password=" + row.users.parentModePwd + ">关闭青少年模式</button>";
}
return result;
}
}
]
})
$('#btnSearch').on('click', function () {
TableHelper.doRefresh('#table');
})
$('#table').on('click', '.opt-detail', function () {
console.log($(this).data('id'));
clearDetailModal();
//清除个人相册
$("#userpriphos").val("");
$.ajax({
url: '/admin/userCheckAdmin/getOne',
type: 'post',
data: {
uid: $(this).data('id')
},
dataType: 'json',
success: function (res) {
if (res.code == 200) {
var purse = res.data.userPurseVo;
var users = res.data.users;
var loginRecord = res.data.accountLoginRecord;
if (users) {
$('.nick span').html(users.nick);
$('.erbanNo span').html(users.erbanNo);
$('.uid span').html(users.uid);
if (users.gender == 1) {
$('.gender span').html('男');
} else {
$('.gender span').html('女');
}
$('.avatar img').attr('src', users.avatar);
$('.phone span').html(users.phone);
var birthDate = users.birth ? new Date(users.birth).format('yyyy-MM-dd') : '';
$('.birth span').html(birthDate);
$('.email span').html(users.email);
$('.sign span').html(users.signture);
$('.userVoice span').html(users.userVoice);
$('.userDesc span').html(users.userDesc);
$('.diamondNum span').html(purse.diamonds);
$('.crystalNum span').html(purse.crystals);
$('.goldNum span').html(purse.golds);
$('.followNum span').html(users.followNum);
$('.fansNum span').html(users.fansNum);
switch (users.defUser) {
case 1:
$('.defUser span').html('普通账号');
break;
case 2:
$('.defUser span').html('官方账号');
break;
case 3:
$('.defUser span').html('机器账号');
break;
}
$('.fortune span').html(users.fortune);
$('.channelType span').html(users.channel);
$('.alipayAccount span').html(users.alipayAccount);
$('.alipayAccountName span').html(users.alipayAccountName);
if (loginRecord) {
$('.ispType span').html(loginRecord.ispType);
$('.netType span').html(loginRecord.netType);
$('.model span').html(loginRecord.model);
$('.deviceID span').html(loginRecord.deviceId);
$('.appVersion span').html(loginRecord.appVersion);
} else {
$('.ispType span').html(users.ispType);
$('.netType span').html(users.netType);
$('.model span').html(users.model);
$('.deviceID span').html(users.deviceId);
$('.appVersion span').html(users.appVersion);
}
$('#detailModal').modal('show');
} else {
$("#tipMsg").text("不存在用户详细信息,原因:该用户资料未补全");
$("#tipModal").modal('show');
}
}
}
})
})
function clearDetailModal() {
$('#detailModal span').html('');
}
$('#uploadPicBtn').on('click', function () {
if (!$('#uploadPhotoFile').val()) {
$("#tipMsg").text("请选择上传图片");
$("#tipModal").modal('show');
return;
}
var options = {
type: 'post',
url: '/admin/userCheckAdmin/upload/photo.action',
dataType: 'json',
success: function (json) {
if (json.path) {
$('#imgUrl').val(json.path);
$('#picUrl').attr('src', json.path);
var trHtml = '<tr><td style="text-align:center;"><img src="' + json.path + '" width="100" height="100" class="photoImgUrl"></td>' +
'<td><button class="btn btn-danger" type="button" onclick="delPhoto(this)">删除</button></td></tr>';
$('#photoTbody').append(trHtml);
} else {
$('#tipMsg').text(json.msg);
$('#tipModal').modal('show');
}
}
}
$("#editUser").ajaxSubmit(options);
});
$('#table').on('click', '.opt-edit', function () {
$('#imgUrl').val('');
$('#picUrl').attr('src', '');
$('#uploadPhotoFile').val('');
$("#needSend").prop("checked", true);
$('#msg').val('');
$('#msgDiv').show();
$.ajax({
url: '/admin/userCheckAdmin/getOne',
type: 'post',
data: {
uid: $(this).data('id')
},
dataType: 'json',
success: function (res) {
if (res.code == 200) {
var users = res.data.users;
var account = res.data.account;
var nick = users ? users.nick : '';
var avatar = users ? users.avatar : '';
var gender = users ? users.gender : 1;
var defUser = users ? users.defUser : 1;
$('#editNick').val(nick);
$('#editPhone').val(account.phone);
$('#addImgUrl').attr('src', avatar);
$('#editAvatar').val(avatar);
$('#editGender').val(gender);
$('#editUid').val(account.uid);
$('#editDefUser').val(defUser);
$("#alipayAccount").val(users.alipayAccount);
$("#alipayAccountName").val(users.alipayAccountName);
$("#app").val(users.currentApp);
$("#userDesc").val(users.userDesc);
var privatePhoto = res.data.privatePhoto;
var $photos = $('#photoTbody');
$photos.html("");
$.each(privatePhoto, function (i, item) {
var $photo = $('<tr><td style="text-align:center;"><img src="' + item.photoUrl + '" width="100" height="100" class="photoImgUrl"></td>' +
'<td><button class="btn btn-danger" type="button" onclick="delPhoto(this)">删除</button></td></tr>');
$photos.append($photo);
});
}
$('#editModal').modal('show');
}
})
})
/**
* 重置密码
*/
$('#table').on('click', '.opt-resetPasswd', function () {
$('#resetPasswdUid').val($(this).data('id'));
$('#resetPasswdNick').val('');
$('#resetPasswdErbanNo').val('');
$('#resetPasswdNewPasswd').val('');
$.ajax({
url: '/admin/userCheckAdmin/getOne',
type: 'post',
data: {
uid: $(this).data('id')
},
dataType: 'json',
success: function (res) {
if (res.code == 200) {
var users = res.data.users;
var nick = users ? users.nick : '';
var erbanNo = users ? users.erbanNo : '';
$('#resetPasswdNick').val(nick);
$('#resetPasswdErbanNo').val(erbanNo);
}
$('#resetPasswdModal').modal('show');
}
})
})
/**
* 关闭青少年模式
*/
$('#table').on('click', '.opt-closeParentMode', function () {
debugger;
$.ajax({
url: '/admin/userCheckAdmin/closeUserParentModeByAdmin',
type: 'get',
data: {
uid: $(this).data('id'),
password: $(this).data('password'),
status: 0,
},
dataType: 'json',
success: function (res) {
if (res.code == 200) {
$("#tipMsg").text("操作成功");
} else {
$("#tipMsg").text("操作失败");
}
$("#tipModal").modal('show');
}
})
})
$('#resetPasswdSave').on('click', function () {
if ($('#resetPasswdForm').validationEngine('validate')) {
if (!/^(?=.*\d)(?=.*[A-z]).{6,16}$/.test($('#resetPasswdNewPasswd').val())) {
$("#tipMsg").text("保存失败密码必须包括字母和数字长度为6到16");
$("#tipModal").modal('show');
return;
}
$.ajax({
type: "post",
url: "/admin/account/resetPassword.action",
data: {
uid: $('#resetPasswdUid').val(),
password: $('#resetPasswdNewPasswd').val()
},
dataType: 'json',
success: function (res) {
if (res.code == 200) {
$("#resetPasswdModal").modal('hide');
$("#tipMsg").text("保存成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("保存失败,错误码:" + res.code);
$("#tipModal").modal('show');
}
}
})
}
})
$('#removePhone').on('click', function () {
$.ajax({
type: "post",
url: "/admin/userCheckAdmin/removePhone.action",
data: {
uid: $('#editUid').val()
},
dataType: 'json',
success: function (res) {
if (res.code == 200) {
$("#tipMsg").text("解绑成功");
$("#tipModal").modal('show');
$('#editPhone').html(res.data.phone);
TableHelper.doRefresh('#table');
} else {
$("#tipMsg").text("解绑失败");
$("#tipModal").modal('show');
}
}
})
})
$('#editSave').on('click', function () {
var userDesc = $("#userDesc").val();
if (userDesc && userDesc.length > 60) {
$("#tipMsg").text("简介文字过长");
$("#tipModal").modal('show');
return;
}
var photoUrls = '';
var list = $('#photoTable').find($('.photoImgUrl'));
var size = list ? list.length : 0;
if (size > 8) {
$("#tipMsg").text("最多只能上传8张照片");
$("#tipModal").modal('show');
return;
}
for (var i = 0; i < size; i++) {
photoUrls += list[i].src + ',';
}
var sendMsg = $('input[name="sendMsg"]:checked').val();
if (sendMsg == 1 && !$("#msg").val()) {
$("#tipMsg").text("请填写通知内容");
$("#tipModal").modal('show');
return;
}
if ($('#editUser').validationEngine('validate')) {
$.ajax({
type: "post",
url: "/admin/userCheckAdmin/saveUser.action",
data: {
nick: $('#editNick').val(),
gender: $('#editGender').val(),
avatar: $('#editAvatar').val(),
uid: $('#editUid').val(),
phone: $('#editPhone').val(),
defUser: $('#editDefUser').val(),
alipayAccount: $('#alipayAccount').val(),
alipayAccountName: $('#alipayAccountName').val(),
userDesc: $("#userDesc").val(),
photoUrls: photoUrls,
msg: $("#msg").val(),
sendMsg: sendMsg
},
dataType: 'json',
success: function (res) {
if (res.code == 200) {
// $('#erbanNoList').val('');
$("#editModal").modal('hide');
$("#tipMsg").text("保存成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else if (res.code == 1600) {
$("#tipMsg").text("保存失败,错误码:" + res.code + ",无法寻找用户资料,请确认该用户资料是否补全或存在");
$("#tipModal").modal('show');
} else if (res.code == 999) {
$("#tipMsg").text("保存失败,错误码:" + res.code + ",该平台号已被占用");
$("#tipModal").modal('show');
} else if (res.code == 4002) {
$("#tipMsg").text("保存失败,错误码:" + res.code + ",该手机号已被占用");
$("#tipModal").modal('show');
} else {
$("#tipMsg").text("保存失败,错误码:" + res.code);
$("#tipModal").modal('show');
}
}
})
}
})
$('#editUploadBtn').on('click', function () {
//判断图片的大小
var file = $('#addUploadFile')[0];
if (file != undefined && file != "") {
var fileSize = file.files[0].size; //获得文件大小;
console.log(fileSize);
if (fileSize > 5242880) {
$("#tipMsg").text("当前图片大于5M,请重新选择");
$("#tipModal").modal('show');
return
}
}
var options = {
fileElementId: 'addUploadFile', //需要上传的文件域的ID即<input type="file">的ID。
type: 'post',
url: '/admin/upload/img',
dataType: 'json',
success: function (json) {
if (json.path) {
$('#editAvatar').val(json.path);
$('#addImgUrl').attr("src", json.path);
console.log(json.path);
} else {
$("#tipMsg").text(json.msg);
$("#tipModal").modal('show');
}
}
}
$("#editUser").ajaxSubmit(options);
})
$('#default_nick').on('click', function () {
$.ajax({
type: "post",
url: "/admin/userCheckAdmin/getDefaultNick.action",
data: {
app: $('#app').val()
},
dataType: 'json',
success: function (res) {
if (res.code == 200) {
$("#editNick").val(res.data);
}
}
})
})
$('#default_avatar').on('click', function () {
$.ajax({
type: "post",
url: "/admin/userCheckAdmin/getDefaultAvatar.action",
data: {
app: $('#app').val()
},
dataType: 'json',
success: function (res) {
if (res.code == 200) {
$("#addImgUrl").attr("src", res.data);
$("#editAvatar").val(res.data);
}
}
})
})
$('input[name="sendMsg"]').change(function () {
if ($("#needSend").is(":checked")) {
$('#msgDiv').show();
} else if ($("#notSend").is(":checked")) {
$('#msgDiv').hide();
}
});
})
}
},
};
</script>
<style scoped>
.pull-left {
width: 100%;
}
#toolbar textarea {
overflow: hidden;
resize: none;
width: 100%;
box-sizing: border-box;
padding: 4px;
height: 100px;
line-height: 20px;
}
#detailModal .part {
display: flex;
justify-content: space-between;
align-items: center;
}
#removePhone,
#editPhone {
display: block;
text-align: left;
}
#btnSearch {
margin-right: 12px;
}</style>

View File

@@ -0,0 +1,409 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<form id="formOuter" action="" method="post" target="_blank">
<input type="hidden" name="state" id="exportState">
<input type="hidden" name="erbanNo" id="exporErbanNo">
<input type="hidden" name="acceptTimeStart" id="exportAcceptTimeStart">
<input type="hidden" name="acceptTimeEnd" id="exportAcceptTimeEnd">
</form>
<div id="toolbar">
<div class="col-sm-12">
<div class="col-sm-3">
<label htmlFor="mgList" class="col-sm-4 control-label">关系状态:</label>
<div class="col-sm-6">
<select name="state" id="state" class="form-control validate[required]">
<option value=""></option>
<option value="2">CP中</option>
<option value="4">解除中</option>
<option value="5">已解除</option>
</select>
</div>
</div>
<div class="col-sm-3">
<label htmlFor="erbanNo" class="col-sm-4 control-label">用户平台号:</label>
<div class="col-sm-6">
<input type="text" class="input-sm form-control" name="erbanNo" id="erbanNo">
</div>
</div>
<div class="col-sm-3">
<label class="col-sm-4 control-label">关系开始时间:</label>
<div class="col-sm-6">
<input type="text" class="input-sm datetime" name="acceptTimeStart" id="acceptTimeStart">
</div>
</div>
<div class="col-sm-3">
<label class="col-sm-4 control-label">关系结束时间:</label>
<div class="col-sm-6">
<input type="text" class="input-sm datetime" name="acceptTimeEnd" id="acceptTimeEnd">
</div>
</div>
</div>
<div class="col-sm-12">
<button id="btnSearch" class="btn btn-default">
<i class="glyphicon glyphicon-search"></i>查询
</button>
<button id="btnExport" class="btn btn-sm btn-primary">导出</button>
</div>
<div class="summary col-sm-12">
<div class="col-sm-2">
<span>CP关系总数量</span>
<span class="cpTotalNum"></span>
</div>
<div class="col-sm-2">
<span>CP关系维持中数量</span>
<span class="cpStateTotalNum"></span>
</div>
<div class="col-sm-2">
<span>关系解除中数量</span>
<span class="waitUnboundTotalNum"></span>
</div>
<div class="col-sm-2">
<span>关系已解除数量</span>
<span class="unboundTotalNum"></span>
</div>
<div class="col-sm-2">
<span>送礼总额</span>
<span class="sendTotalGoldNum"></span>
</div>
</div>
</div>
</div>
<!-- .content -->
<div id="table"></div>
</div>
</section>
<!-- 编辑弹框 -->
<div class="modal fade" id="editModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="editModalLabel">详情列表</h4>
</div>
<div class="modal-body">
<form id="form" action="" method="post" target="_blank">
<input type="hidden" name="id" id="exportId">
<input type="hidden" name="state" id="exportDetailState">
<input type="hidden" name="erbanNo" id="exportDetailErbanNo">
<input type="hidden" name="acceptTimeStart" id="exportDetailAcceptTimeStart">
<input type="hidden" name="acceptTimeEnd" id="exportDetailAcceptTimeEnd">
</form>
<div id="toolbar2">
<div class="col-sm-12">
<!--时间<input type="text" class="input-sm datetime" name="queryStartDate" id="queryDetailStartDate">
-<input type="text" class="input-sm datetime" name="queryDetailEndDate" id="queryDetailEndDate">-->
<button id="btnSearch2" class="btn btn-sm btn-primary">查询</button>
<button id="btnExportDetail" class="btn btn-sm btn-primary">导出</button>
</div>
</div>
<div id="table2"></div>
</div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "UserCoupleStatisticsAdminView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('.datetime').datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
autoclose: true
});
$("#acceptTimeStart").datetimepicker({
minView: "month",
language: 'zh-CN',
todayBtn: 1,
autoclose: 1
}).on("changeDate", function (event) {
$("#acceptTimeEnd").datetimepicker('setStartDate', event.date);
});
$("#acceptTimeEnd").datetimepicker({
minView: "month",
language: 'zh-CN',
todayBtn: 1,
autoclose: 1,
useCurrent: false
}).on("changeDate", function (event) {
$("#acceptTimeStart").datetimepicker('setEndDate', event.date);
});
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{ field: 'id', title: '序号', align: 'center', width: '5%' },
{ field: 'inviteErbanNo', title: '发起者平台号', align: 'center', width: '10%' },
{ field: 'inviteNick', title: '发起者昵称', align: 'center', width: '10%' },
{ field: 'acceptErbanNo', title: '接收者平台号', align: 'center', width: '10%' },
{ field: 'acceptNick', title: '接收者昵称', align: 'center', width: '10%' },
{ field: 'levelSeq', title: '关系等级', align: 'center', width: '5%' },
{ field: 'acceptTime', title: '建立关系时间', align: 'center', width: '10%', formatter: formatTime },
{ field: 'unboundTime', title: '解除关系时间', align: 'center', width: '10%', formatter: formatTime },
{ field: 'state', title: '关系状态', align: 'center', width: '10%' },
{ field: 'sendGoldNum', title: '送礼总额', align: 'center', width: '5%' },
{
field: 'id',
title: '其他',
align: 'center',
width: '10%',
formatter: function (val, row, index) {
if (row.state == '解绑中') {
return '<button id="btnEdit" name="btnEdit" class="btn btn-sm btn-success opt-edit" data-id=' + val + '>' +
'<i class="glyphicon glyphicon-edit"></i>送礼明细</button>' +
'&nbsp;&nbsp;<button class="btn btn-sm btn-default opt-remove" data-id=' + val + ' data-new-status=' + 2 +
'><i class="glyphicon glyphicon-remove"></i>立即解除</button>';
} else {
return '<button id="btnEdit" name="btnEdit" class="btn btn-sm btn-success opt-edit" data-id=' + val + '>' +
'<i class="glyphicon glyphicon-edit"></i>送礼明细</button>';
}
}
}
],
undefinedText: "-",
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pagination: true,
pageList: [10, 20, 50, 100],
search: false,
sidePagination: "server", //表示服务端请求
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var mgId = $('#mgList').val();
var param = {
state: $('#state').val(),
erbanNo: $('#erbanNo').val(),
acceptTimeStart: $('#acceptTimeStart').val(),
acceptTimeEnd: $('#acceptTimeEnd').val(),
pageNum: params.pageNumber,
pageSize: params.pageSize
};
return param;
},
ajax: function (request) { //使用ajax请求
$.ajax({
type: "GET",
url: '/admin/couple/statistical/statisticsList.action',
contentType: 'application/json;charset=utf-8',
dataType: 'json',
data: request.data,
success: function (res) {
apiResult(res);
request.success({
rows: res.data.rows,
total: res.data.total,
});
$('.cpTotalNum').html(res.data.totalDto.cpTotalNum);
$('.cpStateTotalNum').html(res.data.totalDto.cpStateTotalNum);
$('.waitUnboundTotalNum').html(res.data.totalDto.waitUnboundTotalNum);
$('.unboundTotalNum').html(res.data.totalDto.unboundTotalNum);
$('.sendTotalGoldNum').html(res.data.totalDto.sendTotalGoldNum);
},
error: function (req) {
serverError(req);
}
})
},
toolbar: '#toolbar',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
});
// 查询刷新
$('#btnSearch').on('click', function () {
TableHelper.doRefresh('#table');
});
// 查询刷新
$('#btnSearch2').on('click', function () {
TableHelper.doRefresh('#table2');
});
// 编辑获取信息
$("#table").on("click", '.opt-edit', function () {
let id = $(this).attr("data-id");
$('#exportId').val(id);
var acceptTimeStart = $('#acceptTimeStart').val();
var acceptTimeEnd = $('#acceptTimeEnd').val();
$('#table2').bootstrapTable('destroy');
$('#table2').bootstrapTable({
columns: [
{ field: 'createTime', title: '时间', align: 'center', width: '5%', formatter: formatTime },
{ field: 'totalGoldNum', title: '送礼金额', align: 'center', width: '5%' }
],
undefinedText: "0",
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pageList: [10, 20, 50, 100],
pagination: true,
search: false,
sidePagination: "server", //表示服务端请求
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
id: id,
acceptTimeStart: acceptTimeStart,
acceptTimeEnd: acceptTimeEnd,
pageSize: params.pageSize,
pageNum: params.pageNumber
};
return param;
},
ajax: function (request) { //使用ajax请求
$.ajax({
type: "GET",
url: '/admin/couple/statistical/cpSendDetailList.action',
contentType: 'application/json;charset=utf-8',
dataType: 'json',
data: request.data,
success: function (res) {
apiResult(res);
request.success({
rows: res.data.rows,
total: res.data.total,
});
// 打开编辑弹窗
$("#editModal").modal('show');
},
error: function (req) {
serverError(req);
}
})
},
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
});
})
// 立即解绑
$("#table").on("click", '.opt-remove', function () {
let id = $(this).attr("data-id");
if (confirm("确认立即解绑? ")) {
$.ajax({
type: "post",
url: "/admin/couple/statistical/immediateUnbound.action",
data: {
id: id
},
dataType: "json",
success: function (json) {
if (json.code == 200) {
$("#tipMsg").text("解绑成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
$("#roomTagModal").modal('hide');
} else {
$("#tipMsg").text("解绑失败." + json.message);
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
$("#roomTagModal").modal('hide');
}
}
});
}
})
function formatTime(val) {
if (val) {
var date = new Date(val);
return date.format('yyyy-MM-dd hh:mm:ss');
} else {
return '';
}
}
function serverError(req) {
$("#tipMsg").text(req.responseJSON.message);
$("#tipModal").modal('show');
}
function apiResult(json) {
if (json.code == 200 && json.message == 'success') {
return true;
}
$("#tipMsg").text("请求失败,错误信息:" + json.message);
$("#tipModal").modal('show');
return false;
}
// 导出excel
$('#btnExport').on('click', function () {
var form = $("#formOuter");
form.attr("action", "/admin/couple/statistical/exportStatisticsCpList.action");
$('#exportState').val($('#state').val());
$('#exporErbanNo').val($('#erbanNo').val());
$('#exportAcceptTimeStart').val($('#acceptTimeStart').val());
$('#exportAcceptTimeEnd').val($('#acceptTimeEnd').val());
form.submit();
})
// 详情导出
$('#btnExportDetail').on('click', function () {
var form = $("#form");
form.attr("action", "/admin/couple/statistical/exportCpSendDetai.action");
$('#exportDetailState').val($('#state').val());
$('#exportDetailErbanNo').val($('#erbanNo').val());
$('#exportDetailAcceptTimeStart').val($('#acceptTimeStart').val());
$('#exportDetailAcceptTimeEnd').val($('#acceptTimeEnd').val());
form.submit();
})
});
}
},
};
</script>
<style scoped></style>

View File

@@ -0,0 +1,450 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<!-- .content -->
<section class="content">
<div id="table"></div>
<div id="toolbar">
<button id="userDrawProd-add" class="btn btn-default">
<i class="glyphicon glyphicon-plus"></i>增加
</button>
<button id="userDrawProd-multiDel" class="btn btn-default">
<i class="glyphicon glyphicon-wrench"></i>批量删除
</button>
怪兽id: <input type="text" name="cond_monsterId" id="cond_monsterId" />
<button id="prod-refresh" class="btn btn-default">
<i class="glyphicon glyphicon-wrench"></i>查询
</button>
</div>
</section><!-- .content -->
</div>
</div>
</section>
<div class="modal fade" id="userDrawProdModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="modalLabel">奖励配置管理</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" id="userDrawProdForm">
<input type="hidden" name="prodId" id="prodId" />
<div class="form-group">
<label for="drawId" class="col-sm-2 control-label">怪兽id</label>
<div class="col-sm-10">
<input type="text" class="form-control validate[required]" name="drawId" id="drawId">
</div>
</div>
<div class="form-group">
<label for="drawName" class="col-sm-2 control-label">抽奖名称</label>
<div class="col-sm-10">
<input type="text" class="form-control validate[required]" name="drawName" id="drawName">
</div>
</div>
<div class="form-group">
<label for="drawType" class="col-sm-2 control-label">抽奖类型</label>
<div class="col-sm-10">
<select name="drawType" id="drawType" data-btn-class="btn-warning">
<option value="1">打怪夺宝</option>
</select>
</div>
</div>
<div class="form-group">
<label for="prodType" class="col-sm-2 control-label">奖品类型</label>
<div class="col-sm-10">
<select name="prodType" id="prodType" data-btn-class="btn-warning">
<option value="1">金币</option>
<option value="2">靓号</option>
<option value="3">座驾</option>
<option value="4">实物</option>
</select>
</div>
</div>
<div class="form-group">
<label for="prodName" class="col-sm-2 control-label">奖品名称</label>
<div class="col-sm-10">
<input type="text" class="form-control validate[required]" name="prodName" id="prodName">
</div>
</div>
<div class="form-group">
<label for="prodDesc" class="col-sm-2 control-label">奖品描述</label>
<div class="col-sm-10">
<input type="text" class="form-control validate[required]" name="prodDesc" id="prodDesc">
</div>
</div>
<div class="form-group">
<div class="tips">* 注意座驾填座驾ID金币填金币数量靓号填具体靓号实物填实物价值</div>
<label for="prodValue" class="col-sm-2 control-label">奖品值</label>
<div class="col-sm-10">
<input type="text" class="form-control validate[required]" name="prodValue" id="prodValue">
</div>
</div>
<div class="form-group" id="expireDaysDiv">
<label for="expireDays" class="col-sm-2 control-label">有效天数</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="expireDays" id="expireDays">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">奖品图片:</label>
<div class="col-sm-10">
<img src="" id="prodImg" style="width:250px;height:90px;" alt="">
<input type="file" id="prodUploadFile" name="uploadFile"
accept="image/gif,image/jpeg,image/jpg,image/png,image/svga">
<button class="btn btn-success" type="button" id="prodUploadBtn">上传</button>
<input type="hidden" id="prodImage" name="prodImage"
class="form-control validate[required]" />
<span id="prodImgInfo" style="color:red;"></span>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="save">保存</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="tipModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">提示信息</h4>
</div>
<div class="modal-body" id="tipMsg"></div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
import ComboboxHelper from '@/assets/plugins/bootstrap-combobox/js/bootstrap-combobox-helper';
ComboboxHelper.build(null, '#prodType');
ComboboxHelper.build(null, '#drawType');
export default {
name: "UserDrawProdAdminView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{ field: 'tmp', title: 'ID', align: 'center', checkbox: true },
{ field: 'prodId', title: '奖品id', align: 'center', width: '5%' },
{ field: 'drawId', title: '怪兽id', align: 'center', width: '5%' },
{ field: 'monsterKindName', title: '怪兽名称', align: 'center', width: '10%' },
{ field: 'drawName', title: '抽奖名称', align: 'center', width: '15%' },
{
field: 'drawType', title: '抽奖类型', align: 'center', width: '10%', formatter: function (val, row, index) {
if (val == 1) {
return "打怪夺宝";
} else {
return "";
}
}
},
{ field: 'prodName', title: '奖品名称', align: 'center', width: '15%' },
{
field: 'prodType', title: '奖品类型', align: 'center', width: '10%', formatter: function (val, row, index) {
if (val == 1) {
return "金币";
} else if (val == 2) {
return "靓号";
} else if (val == 3) {
return "座驾";
} else if (val == 4) {
return "实体";
}
}
},
{ field: 'prodValue', title: '奖品值', align: 'center', width: '5%' },
{ field: 'expireDays', title: '有效期', align: 'center', width: '5%' },
{
field: 'prodId', title: '操作', align: 'center', width: '20%', formatter: function (val, row, index) {
return '<button class="btn btn-sm btn-success opt-edit" data-id=' + val + '>' +
'<i class="glyphicon glyphicon-edit"></i>编辑</button>' +
'&nbsp;&nbsp;<button class="btn btn-sm btn-danger opt-remove" data-id=' + val +
'><i class="glyphicon glyphicon-remove"></i>删除</button>';
}
}
],
cache: false,
striped: true,
showRefresh: true,
pageSize: 20,
pagination: true,
pageList: [20, 50, 100],
search: false,
sidePagination: "server", //表示服务端请求
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageNumber: params.pageNumber,
pageSize: params.pageSize,
searchText: params.searchText
};
return param;
},
toolbar: '#toolbar',
url: '/admin/userDrawProd/getList.action',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
});
$("#table").on("click", '.opt-remove', function () {
var id = $(this).attr("data-id");
if (id == 'undefined') {
$("#tipMsg").text("id参数有误");
$("#tipModal").modal('show');
return;
}
if (confirm("你确认删除该记录吗?" +
"\r\n删除后再也不能找回请谨慎操作")) {
$.ajax({
type: 'post',
url: "/admin/userDrawProd/del.action",
data: { 'ids': JSON.stringify([id]) },
dataType: "json",
success: function (json) {
if (json.success == 'true') {
$("#tipMsg").text("删除成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("删除失败");
$("#tipModal").modal('show');
}
}
});
}
});
$("#userDrawProd-add").click(function () {
// 打开编辑弹窗
$("#userDrawProdModal").modal('show');
$("#userDrawProdForm")[0].reset();
$("#prodId").val('');
$("#drawId").val('');
$("#drawName").val('');
$("#drawType").val('');
$("#prodType").val('');
$("#prodName").val('');
$("#prodValue").val('');
$("#prodDesc").val('');
$("#expireDays").val('');
$('#prodImage').val('');
$('#prodImg').attr("src", '');
$("#prodImgInfo").html('');
$("#prodUploadFile").val('');
$('#expireDaysDiv').hide();
});
$("#prod-refresh").click(function () {
$("#table").bootstrapTable('refresh', { url: '/admin/userDrawProd/getList.action?drawId=' + $("#cond_monsterId").val() });
});
$('#prodUploadBtn').on('click', function () {
$('#prodUploadBtn').attr('disabled', "true");
$.ajaxFileUpload({
fileElementId: 'prodUploadFile', //需要上传的文件域的ID即<input type="file">的ID。
url: '/admin/upload/img', //后台方法的路径
type: 'post', //当要提交自定义参数时这个参数要设置成post
dataType: 'json', //服务器返回的数据类型。可以为xml,script,json,html。如果不填写jQuery会自动判断。
secureuri: false, //是否启用安全提交默认为false。
async: true, //是否是异步
success: function (json) { //提交成功后自动执行的处理函数参数data就是服务器返回的数据.
$('#prodUploadBtn').removeAttr("disabled");
if (json.path) {
$('#prodImage').val(json.path);
$('#prodImg').attr("src", json.path);
if (json.path != '') {
$("#prodImgInfo").html('已上传成功');
} else {
$("#prodImgInfo").html('未上传成功');
}
console.log(json.path);
} else {
$("#tipMsg").text(json.msg);
$("#tipModal").modal('show');
}
},
error: function (data, status, e) { //提交失败自动执行的处理函数。
$('#prodUploadBtn').removeAttr("disabled");
console.error(e);
}
});
});
$("#userDrawProd-multiDel").click(function () {
var rows = $("#table").bootstrapTable("getSelections");
if (rows.length == 0) {
alert("请先选择要删除的记录");
return;
}
console.log("rows: " + rows.length);
var idArr = [];
for (var i = 0; i < rows.length; i++) {
idArr.push(rows[i]['prodId']);
}
console.log(idArr);
if (confirm("你确认批量删除该记录吗?" +
"\r\n删除后再也不能找回请谨慎操作")) {
$.ajax({
type: 'post',
url: "/admin/userDrawProd/del.action",
data: { 'ids': JSON.stringify(idArr) },
dataType: "json",
success: function (json) {
if (json.success == 'true') {
$("#tipMsg").text("删除成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("删除失败");
$("#tipModal").modal('show');
}
}
});
}
});
$("#cancel").click(function () {
TableHelper.unCheckAll("#table");
});
$("#table").on("click", '.opt-edit', function () {
console.log("btnEdit");
var id = $(this).attr("data-id");
$.ajax({
type: "get",
url: "/admin/userDrawProd/get.action",
data: { id: id },
dataType: "json",
success: function (json) {
if (json.entity) {
$("#prodId").val(json.entity.prodId);
$("#drawId").val(json.entity.drawId);
$("#drawName").val(json.entity.drawName);
$("#prodName").val(json.entity.prodName);
$("#prodValue").val(json.entity.prodValue);
$("#prodDesc").val(json.entity.prodDesc);
$("#expireDays").val(json.entity.expireDays);
ComboboxHelper.setDef("#drawType", json.entity.drawType);
ComboboxHelper.setDef("#prodType", json.entity.prodType);
// 设置礼物图片
$("#prodUploadFile").val('');
$('#prodImage').val(json.entity.prodImage);
$('#prodImg').attr("src", json.entity.prodImage);
if (json.entity.prodImage != '') {
$("#prodImgInfo").html('已上传');
} else {
$("#prodImgInfo").html('未上传');
}
// 打开编辑弹窗
$("#userDrawProdModal").modal('show');
} else {
$("#tipMsg").text("获取菜单信息出错");
$("#tipModal").modal('show');
}
}
});
});
$("#save").click(function () {
if ($("#userDrawProdForm").validationEngine('validate')) {
// 如果是座驾则进行判断名称
if (ComboboxHelper.getSelected("#prodType") == 3) {
if ($("#prodName").val().length > 5) {
$('#save').removeAttr("disabled");
alert("座驾名称不能大于5个字");
return;
}
}
var drawId = parseInt($("#drawId").val());
if (isNaN(drawId)) {
alert("怪兽id必须为数字");
return;
}
var prodValue = parseInt($("#prodValue").val());
if (isNaN(prodValue)) {
alert("奖品值必须为数字");
return;
}
$('#save').attr('disabled', "true");
$.ajax({
type: "post",
url: "/admin/userDrawProd/save.action",
data: $('#userDrawProdForm').serialize(),
dataType: "json",
success: function (json) {
$('#save').removeAttr("disabled");
if (json.success == 'true') {
$("#userDrawProdModal").modal('hide');
$("#tipMsg").text("保存成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("保存失败");
$("#tipModal").modal('show');
}
},
error: function (data, status, e) { //提交失败自动执行的处理函数。
$('#save').removeAttr("disabled");
}
});
}
});
$('#prodType').on('change', function () {
console.log($(this));
var val = $('#prodType-hid').val();
if (val == 1 || val == 4) {
$('#expireDaysDiv').hide();
} else if (val == 2 || val == 3) {
$('#expireDaysDiv').show();
}
})
});
}
},
};
</script>
<style scoped>
.tips {
padding-left: 75px;
color: red;
}
</style>

View File

@@ -0,0 +1,642 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<section class="content">
<div id="table"></div>
<div id="toolbar">
平台号:<input type="text" class="input-sm validate[required]" name="targetErbanNo" id="targetErbanNo">
日期<input type="text" name="startDate" id="timeBegin" class="input-sm datetime" placeholder="起始时间">
- <input type="text" name="endDate" id="timeEnd" class="input-sm datetime" placeholder="结束时间">
举报来源:<select id="sourceSelect" class="input-sm">
</select>
<button id="btnSearch" class="btn btn-sm btn-primary">查询</button>
</div>
</section>
</div>
</div>
</section>
<div class="modal fade" id="hisHandleModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel2">
<div class="modal-dialog" role="document" style="width:65%">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">x</span></button>
<h4 class="modal-title" id="addModalLabel">历史处理记录</h4>
</div>
<div class="modal-body">
<div id="hisHandleTable"></div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="reportPicModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel3">
<div class="modal-dialog" role="document" style="width:65%">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">x</span></button>
<h4 class="modal-title" id="reportPicLabel">举报截图</h4>
</div>
<div class="modal-body">
<div id="reportPicTable"></div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="historyMsgModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel2">
<div class="modal-dialog" role="document" style="width:40%">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">x</span></button>
<input id="historyMsgModal_id" type="hidden">
<h4 class="modal-title" id="historyMsgModalLabel">历史聊天记录</h4>
<div class="box box-primary direct-chat direct-chat-primary">
<div class="box-body">
<div class="direct-chat-messages" style="height: 480px;" id="chatMessages">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="imgMask"><img src="" alt=""></div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
//历史消息记录
var sendFrom;
var sendTo;
var sendBeginTime;
var sendEndTime;
var hasNextMsg = true;
export default {
name: "UserImpeachAdminView",
setup() {
function historyMsgModalShow(id, from, to) {
sendFrom = from;
sendTo = to;
hasNextMsg = false;
sendBeginTime = null;
sendEndTime = null;
$('#chatMessages').html('');
querySessionMsg(sendFrom, sendTo, sendBeginTime, sendEndTime);
$('#historyMsgModal_id').val(id);
$('#historyMsgModal').modal('show');
}
window.historyMsgModalShow = historyMsgModalShow;
return {
historyMsgModalShow,
};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('.datetime').datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
autoclose: true
});
$('#table').bootstrapTable('destroy');
setSelectOption();
$('#table').bootstrapTable({
columns: [
{ field: 'id', title: '编号', align: 'center', valign: 'middle', width: '5%' },
{ field: 'reason', title: '举报原因', align: 'center', valign: 'middle', width: '10%' },
{
field: '', title: '被举报人信息', align: 'center', valign: 'middle', width: '10%', formatter: function (val, row, index) {
if (row) {
var str = '昵称:' + (row.targetNick == null ? '-' : row.targetNick) + '<br/>' +
'ID:' + (row.targetErbanNo == null ? '-' : row.targetErbanNo) + '<br/>' +
'性别:' + ((row.targetGender == null ? '-' : (parseInt(row.targetGender) == 1) ? '男' : '女')) + '<br/>' +
'注册时间:' + (row.targetSignUpTime == null ? '-' : new Date(row.targetSignUpTime).format('yyyy-MM-dd hh:mm:ss'));
return str;
}
}
},
{ field: 'impeachedCount', title: '被举报次数', align: 'center', valign: 'middle', width: '10%' },
{
field: 'createTime', title: '举报时间', align: 'center', valign: 'middle', width: '10%', formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format('yyyy-MM-dd hh:mm:ss');
} else {
return '-';
}
}
},
{
field: 'tmp1',
title: '举报截图',
align: 'center',
width: '5%',
valign: 'middle',
formatter: function (val, row, index) {
var key = row.id;
return "<button class='btn btn-sm btn-success opt-checkPic' data-id=" + key + ">查看</button>";
}
},
{ field: 'sourceCn', title: '举报来源', align: 'center', valign: 'middle', width: '10%' },
{ field: 'handleResultDesc', title: '处理结果', align: 'center', valign: 'middle', width: '10%' },
{
field: 'tmp',
title: '操作',
align: 'center',
width: '20%',
valign: 'middle',
formatter: function (val, row, index) {
var key = row.id;
return "<button class='btn btn-sm btn-success opt-ignore' data-id=" + key + ">忽略</button>" +
"<button class='btn btn-sm btn-success opt-warn' data-id=" + key + ">警告</button><br/>" +
"<button class='btn btn-sm btn-success opt-block24Hours' data-id=" + key + ">封号24小时</button>" +
"<button class='btn btn-sm btn-success opt-blockPermanent' data-id=" + key + ">永久封号</button><br/>" +
"<button class='btn btn-sm btn-success opt-hisHandle' data-id=" + key + " >历史处理记录</button>";
}
}
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pagination: true,
pageList: [10, 20, 30, 50],
sidePagination: "server", //表示服务端请求
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageSize: params.pageSize,
pageNumber: params.pageNumber,
targetErbanNo: $('#targetErbanNo').val(),
startDate: $('#timeBegin').val(),
endDate: $('#timeEnd').val(),
source: $("#sourceSelect").val()
};
return param;
},
uniqueId: 'id',
toolbar: '#toolbar',
url: '/admin/user/impeach/listLatestTargetUser.action?type=1',
onLoadSuccess: function () { //加载成功时执行
$('#btnSearch').attr('disabled', false);
console.log("load success");
},
onLoadError: function () { //加载失败时执行
$('#btnSearch').attr('disabled', false);
console.log("load fail");
}
})
/*查询刷新*/
$('#btnSearch').on('click', function () {
$('#btnSearch').attr('disabled', true);
TableHelper.doRefresh('#table');
})
$('#table').on('click', '.opt-ignore', function () {
var $btn = $(this);
var id = parseInt($btn.data('id'));
if (confirm('确定忽略该条记录?')) {
$btn.attr('disabled', true);
$.ajax({
type: 'post',
url: '/admin/user/impeach/updateHandleResult.action',
data: { 'recordId': id, 'handleResult': 1 },
dataType: 'json',
success: function (data) {
$btn.attr('disabled', false);
if (data.code == 200) {
$("#tipMsg").text("操作成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("操作失败,错误信息:" + data.message);
$("#tipModal").modal('show');
}
}
})
}
});
$('#table').on('click', '.opt-warn', function () {
var $btn = $(this);
var id = parseInt($btn.data('id'));
if (confirm('确定警告该用户?')) {
$btn.attr('disabled', true);
$.ajax({
type: 'post',
url: '/admin/user/impeach/updateHandleResult.action',
data: { 'recordId': id, 'handleResult': 2 },
dataType: 'json',
success: function (data) {
$btn.attr('disabled', false);
if (data.code == 200) {
$("#tipMsg").text("操作成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("操作失败,错误信息:" + data.message);
$("#tipModal").modal('show');
}
}
})
}
});
$('#table').on('click', '.opt-block24Hours', function () {
var $btn = $(this);
var id = parseInt($btn.data('id'));
if (confirm('确定封号24小时?')) {
$btn.attr('disabled', true);
$.ajax({
type: 'post',
url: '/admin/user/impeach/block24Hours.action',
data: { 'recordId': id },
dataType: 'json',
success: function (data) {
$btn.attr('disabled', false);
if (data.code == 200) {
$("#tipMsg").text("操作成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("操作失败,错误信息:" + data.message);
$("#tipModal").modal('show');
}
}
})
}
});
$('#table').on('click', '.opt-blockPermanent', function () {
var $btn = $(this);
var id = parseInt($btn.data('id'));
if (confirm('确定永久封号?')) {
$btn.attr('disabled', true);
$.ajax({
type: 'post',
url: '/admin/user/impeach/blockPermanent.action',
data: { 'recordId': id },
dataType: 'json',
success: function (data) {
$btn.attr('disabled', false);
if (data.code == 200) {
$("#tipMsg").text("操作成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("操作失败,错误信息:" + data.message);
$("#tipModal").modal('show');
}
}
})
}
});
$('#table').on('click', '.opt-hisHandle', function () {
var id = parseInt($(this).data('id'));
var data = $('#table').bootstrapTable('getRowByUniqueId', id);
$('#hisHandleTable').bootstrapTable('destroy');
$('#hisHandleTable').bootstrapTable({
columns: [
{ field: 'id', title: '编号', align: 'center', valign: 'middle', width: '5%' },
{ field: 'reason', title: '举报原因', align: 'center', valign: 'middle', width: '10%' },
{
field: '', title: '举报人信息', align: 'center', valign: 'middle', width: '10%', formatter: function (val, row, index) {
if (row) {
var str = '昵称:' + row.nick + '<br/>' +
'ID:' + row.erbanNo;
return str;
}
}
},
{
field: '', title: '近7天IM记录', align: 'center', valign: 'middle', width: '10%', formatter: function (val, row, index) {
return '<a href="#" onclick="historyMsgModalShow(' + row.id + ',' + row.targetUid + ',' + row.uid + ')">查看</a>';
}
},
{
field: 'picture',
title: '举报截图',
align: 'center',
valign: 'middle',
width: '10%',
formatter: function (val, row, index) {
if (!val) {
return '无'
}
if (!val.match(',')) {
return '<p style="width: 50px; height: 50px"><a href="' + val + '" target="blank"><img style="width:100%; height: 100%; margin: 0 5px;" src=" ' +
val + '" alt=""></a></p>';
}
var arr = val.split(',');
var str = '';
for (var i = 0; i < arr.length; i++) {
str += '<p style="width: 50px; height: 50px; display: inline-block; margin: 0 5px;"><a href="' + val + '" target="blank"><img style="width: 100%;height: 100%;" src=" ' + arr[i] +
'" alt=""></a></p>';
}
return str;
}
},
{ field: 'handleResultDesc', title: '处理结果', align: 'center', valign: 'middle', width: '10%' },
{
field: 'createTime', title: '举报时间', align: 'center', valign: 'middle', width: '10%', formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format('yyyy-MM-dd hh:mm:ss');
} else {
return '-';
}
}
},
{ field: 'sourceCn', title: '举报来源', align: 'center', valign: 'middle', width: '10%' }
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pagination: true,
pageList: [10, 20, 30, 50],
sidePagination: "server", //表示服务端请求
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageSize: params.pageSize,
pageNum: params.pageNumber,
targetUid: data.targetUid,
currentRecordId: id
};
return param;
},
uniqueId: 'id',
url: '/admin/user/impeach/listHisHandleRecordByTargetUid.action',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
})
$('#hisHandleModal').modal('show');
});
$('#table').on('click', '.opt-checkPic', function () {
var recordId = parseInt($(this).data('id'));
var data = $('#table').bootstrapTable('getRowByUniqueId', recordId);
$('#reportPicTable').bootstrapTable('destroy');
$('#reportPicTable').bootstrapTable({
columns: [
{
field: 'picture',
title: '举报图片',
align: 'center',
valign: 'middle',
width: '10%',
formatter: function (val, row, index) {
if (!val) {
return '无'
}
if (!val.match(',')) {
return '<div class="pimg"><img style="width:100%; height: 100%; margin: 0 5px;" src=" ' +
val + '" alt=""></div>';
}
var arr = val.split(',');
var str = '';
for (var i = 0; i < arr.length; i++) {
str += '<div class="pimg"><img style="width: 100%;height: 100%;" src=" ' + arr[i] +
'" alt=""></div>';
}
return str;
}
}
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pagination: true,
pageList: [10, 20, 30, 50],
sidePagination: "server", //表示服务端请求
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
recordId: recordId
};
return param;
},
uniqueId: 'id',
url: '/admin/user/impeach/getReportImgUrl.action',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
})
$('#reportPicModal').modal('show');
});
$("#chatMessages").scroll(function () {
var nDivHight = $("#chatMessages").height();
var nScrollHight = $(this)[0].scrollHeight;
var nScrollTop = $(this)[0].scrollTop;
var paddingBottom = parseInt($(this).css('padding-bottom'));
var paddingTop = parseInt($(this).css('padding-top'));
if (nScrollTop + paddingBottom + paddingTop + nDivHight >= nScrollHight) {
if (hasNextMsg) {
//本次的sendBeginTime为下一次请求的endTime
querySessionMsg(sendFrom, sendTo, null, sendBeginTime);
}
}
});
})
}
},
};
function querySessionMsg(from, to, beginTime, endTime) {
$.ajax({
type: "get",
url: "/admin/netEase/querySessionMsg",
data: {
from: from,
to: to,
beginTime: beginTime,
endTime: endTime,
limit: 20
},
dataType: "json",
success: function (json) {
if (json.code == 200) {
var data = json.data;
if (null == data || data.msgs.length == 0) {
hasNextMsg = false;
$('#chatMessages').append(historyMessageTips('无历史聊天记录!'));
return;
}
var html = '';
var len = data.msgs.length;
var users = data.users;
for (var i = 0; i < len; i++) {
var msg = data.msgs[i];
var body = msg.body;
var sendTime = new Date(msg.sendtime).format('yyyy-MM-dd hh:mm:ss');
//倒序排序第一条为endTime最后一条为beginTime下一次请求的endTime为上一次的beginTime
if (i == 0) {
sendEndTime = msg.sendtime;
}
if (i == len - 1) {
sendBeginTime = msg.sendtime;
}
var user = users[msg.from];
//文字消息
if (msg.type == 0) {
var message = body.msg.replace(/'/g, '\\\'');
if (from == msg.from) {
html += '<div class="direct-chat-msg">' +
'<div class="direct-chat-info clearfix">' +
' <span class="direct-chat-name pull-left">' + user.nick + '</span>' +
' <span class="direct-chat-timestamp pull-right">' + sendTime + '</span>' +
'</div>' +
'<img class="direct-chat-img" src="' + user.avatar + '" alt="Message User Image">' +
'<div class="direct-chat-text">' +
message +
'</div>' +
'</div>';
} else {
html += '<div class="direct-chat-msg right">' +
' <div class="direct-chat-info clearfix">' +
' <span class="direct-chat-name pull-right">' + user.nick + '</span>' +
' <span class="direct-chat-timestamp pull-left">' + sendTime + '</span>' +
' </div>' +
' <img class="direct-chat-img" src="' + user.avatar + '" alt="Message User Image">' +
' <div class="direct-chat-text">' +
message +
' </div>' +
'</div>';
}
}
//图片消息
else if (msg.type == 1) {
if (from == msg.from) {
html += '<div class="direct-chat-msg">' +
'<div class="direct-chat-info clearfix">' +
' <span class="direct-chat-name pull-left">' + user.nick + '</span>' +
' <span class="direct-chat-timestamp pull-right">' + sendTime + '</span>' +
'</div>' +
'<img class="direct-chat-img" src="' + user.avatar + '" alt="Message User Image">' +
'<div class="direct-chat-text">' +
' <a href="' + body.url + '" target="blank"><img src="' + body.url + '" style="width: 60px; height: 60px;" alt=""/></a>' +
'</div>' +
'</div>';
} else {
html += '<div class="direct-chat-msg right">' +
' <div class="direct-chat-info clearfix">' +
' <span class="direct-chat-name pull-right">' + user.nick + '</span>' +
' <span class="direct-chat-timestamp pull-left">' + sendTime + '</span>' +
' </div>' +
' <img class="direct-chat-img" src="' + user.avatar + '" alt="Message User Image">' +
' <div class="direct-chat-text">' +
' <a href="' + body.url + '" target="blank"><img src="' + body.url + '" style="width: 60px; height: 60px;" alt=""/></a>' +
' </div>' +
'</div>';
}
}
}
if (html == '') {
html = historyMessageTips('无历史聊天记录!');
}
hasNextMsg = true;
$('#chatMessages').append(html);
} else {
$('#chatMessages').append(historyMessageTips('获取历史聊天记录失败,请稍后重试!'));
return;
}
}
});
}
function historyMessageTips(tips) {
var html = '<div class="direct-chat-msg">' +
'<div class="direct-chat-info clearfix">' +
' <span class="direct-chat-name pull-left"></span>' +
' <span class="direct-chat-timestamp pull-right"></span>' +
'</div>' +
'<div class="direct-chat-text">' +
tips +
'</div>' +
'</div>';
return html;
}
function setSelectOption() {
$.ajax({
type: "get",
url: '/admin/user/impeach/get/source.action',
dataType: 'json',
success: function (json) {
if (json.data) {
makeOption(json.data);
}
}
})
}
function makeOption(data) {
var str = '<option value=""> 全部' + '</option>';
for (var i = 0; i < data.length; i++) {
str += '<option value="' + data[i].value + '">' + data[i].key + '</option>';
}
$("#sourceSelect").html(str);
}
</script>
<style scoped>
#imgMask {
position: absolute;
top: 0;
left: 0;
width: 200px;
height: 200px;
padding: 4px;
background: #fff;
z-index: 1000;
display: none;
}
#imgMask img {
width: 100%;
height: 100%;
vertical-align: top;
}
input,
select {
margin-left: 8px;
margin-right: 8px;
}
#btnSearch {
margin-left: 36px;
}</style>

View File

@@ -0,0 +1,638 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<section class="content">
<div id="table"></div>
<div id="toolbar">
平台号:<input type="text" class="input-sm validate[required]" name="targetErbanNo" id="targetErbanNo">
日期<input type="text" name="startDate" id="timeBegin" class="input-sm datetime" placeholder="起始时间">
- <input type="text" name="endDate" id="timeEnd" class="input-sm datetime" placeholder="结束时间">
举报来源:<select id="sourceSelect" class="input-sm">
</select>
<button id="btnSearch" class="btn btn-sm btn-primary">查询</button>
</div>
</section>
</div>
</div>
</section>
<div class="modal fade" id="hisHandleModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel2">
<div class="modal-dialog" role="document" style="width:65%">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">x</span></button>
<h4 class="modal-title" id="addModalLabel">历史处理记录</h4>
</div>
<div class="modal-body">
<div id="hisHandleTable"></div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="reportPicModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel3">
<div class="modal-dialog" role="document" style="width:65%">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">x</span></button>
<h4 class="modal-title" id="reportPicLabel">举报截图</h4>
</div>
<div class="modal-body">
<div id="reportPicTable"></div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="historyMsgModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel2">
<div class="modal-dialog" role="document" style="width:40%">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">x</span></button>
<input id="historyMsgModal_id" type="hidden">
<h4 class="modal-title" id="historyMsgModalLabel">历史聊天记录</h4>
<div class="box box-primary direct-chat direct-chat-primary">
<div class="box-body">
<div class="direct-chat-messages" style="height: 480px;" id="chatMessages">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="imgMask"><img src="" alt=""></div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
//历史消息记录
var sendFrom;
var sendTo;
var sendBeginTime;
var sendEndTime;
var hasNextMsg = true;
export default {
name: "UserImpeachSearchView",
setup() {
function historyMsgModalShow(id, from, to) {
sendFrom = from;
sendTo = to;
hasNextMsg = false;
sendBeginTime = null;
sendEndTime = null;
$('#chatMessages').html('');
querySessionMsg(sendFrom, sendTo, sendBeginTime, sendEndTime);
$('#historyMsgModal_id').val(id);
$('#historyMsgModal').modal('show');
}
return {
historyMsgModalShow,
};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('.datetime').datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
autoclose: true
});
$('#table').bootstrapTable('destroy');
setSelectOption();
$('#table').bootstrapTable({
columns: [
{ field: 'id', title: '编号', align: 'center', valign: 'middle', width: '5%' },
{ field: 'reason', title: '举报原因', align: 'center', valign: 'middle', width: '10%' },
{
field: '', title: '被举报人信息', align: 'center', valign: 'middle', width: '10%', formatter: function (val, row, index) {
if (row) {
var str = '昵称:' + (row.targetNick == null ? '-' : row.targetNick) + '<br/>' +
'ID:' + (row.targetErbanNo == null ? '-' : row.targetErbanNo) + '<br/>' +
'性别:' + ((row.targetGender == null ? '-' : (parseInt(row.targetGender) == 1) ? '男' : '女')) + '<br/>' +
'注册时间:' + (row.targetSignUpTime == null ? '-' : new Date(row.targetSignUpTime).format('yyyy-MM-dd hh:mm:ss'));
return str;
}
}
},
{ field: 'impeachedCount', title: '被举报次数', align: 'center', valign: 'middle', width: '10%' },
{
field: 'createTime', title: '举报时间', align: 'center', valign: 'middle', width: '10%', formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format('yyyy-MM-dd hh:mm:ss');
} else {
return '-';
}
}
},
{
field: 'tmp1',
title: '举报截图',
align: 'center',
width: '5%',
valign: 'middle',
formatter: function (val, row, index) {
var key = row.id;
return "<button class='btn btn-sm btn-success opt-checkPic' data-id=" + key + ">查看</button>";
}
},
{ field: 'sourceCn', title: '举报来源', align: 'center', valign: 'middle', width: '10%' },
{ field: 'handleResultDesc', title: '处理结果', align: 'center', valign: 'middle', width: '10%' },
{
field: 'tmp',
title: '操作',
align: 'center',
width: '20%',
valign: 'middle',
formatter: function (val, row, index) {
var key = row.id;
return "<button class='btn btn-sm btn-success opt-hisHandle' data-id=" + key + " >历史处理记录</button>";
}
}
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pagination: true,
pageList: [10, 20, 30, 50],
sidePagination: "server", //表示服务端请求
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageSize: params.pageSize,
pageNumber: params.pageNumber,
targetErbanNo: $('#targetErbanNo').val(),
startDate: $('#timeBegin').val(),
endDate: $('#timeEnd').val(),
source: $("#sourceSelect").val()
};
return param;
},
uniqueId: 'id',
toolbar: '#toolbar',
url: '/admin/user/impeach/listLatestTargetUser.action?type=2',
onLoadSuccess: function () { //加载成功时执行
$('#btnSearch').attr('disabled', false);
console.log("load success");
},
onLoadError: function () { //加载失败时执行
$('#btnSearch').attr('disabled', false);
console.log("load fail");
}
})
/*查询刷新*/
$('#btnSearch').on('click', function () {
$('#btnSearch').attr('disabled', true);
TableHelper.doRefresh('#table');
})
$('#table').on('click', '.opt-ignore', function () {
var $btn = $(this);
var id = parseInt($btn.data('id'));
if (confirm('确定忽略该条记录?')) {
$btn.attr('disabled', true);
$.ajax({
type: 'post',
url: '/admin/user/impeach/updateHandleResult.action',
data: { 'recordId': id, 'handleResult': 1 },
dataType: 'json',
success: function (data) {
$btn.attr('disabled', false);
if (data.code == 200) {
$("#tipMsg").text("操作成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("操作失败,错误信息:" + data.message);
$("#tipModal").modal('show');
}
}
})
}
});
$('#table').on('click', '.opt-warn', function () {
var $btn = $(this);
var id = parseInt($btn.data('id'));
if (confirm('确定警告该用户?')) {
$btn.attr('disabled', true);
$.ajax({
type: 'post',
url: '/admin/user/impeach/updateHandleResult.action',
data: { 'recordId': id, 'handleResult': 2 },
dataType: 'json',
success: function (data) {
$btn.attr('disabled', false);
if (data.code == 200) {
$("#tipMsg").text("操作成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("操作失败,错误信息:" + data.message);
$("#tipModal").modal('show');
}
}
})
}
});
$('#table').on('click', '.opt-block24Hours', function () {
var $btn = $(this);
var id = parseInt($btn.data('id'));
if (confirm('确定封号24小时?')) {
$btn.attr('disabled', true);
$.ajax({
type: 'post',
url: '/admin/user/impeach/block24Hours.action',
data: { 'recordId': id },
dataType: 'json',
success: function (data) {
$btn.attr('disabled', false);
if (data.code == 200) {
$("#tipMsg").text("操作成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("操作失败,错误信息:" + data.message);
$("#tipModal").modal('show');
}
}
})
}
});
$('#table').on('click', '.opt-blockPermanent', function () {
var $btn = $(this);
var id = parseInt($btn.data('id'));
if (confirm('确定永久封号?')) {
$btn.attr('disabled', true);
$.ajax({
type: 'post',
url: '/admin/user/impeach/blockPermanent.action',
data: { 'recordId': id },
dataType: 'json',
success: function (data) {
$btn.attr('disabled', false);
if (data.code == 200) {
$("#tipMsg").text("操作成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("操作失败,错误信息:" + data.message);
$("#tipModal").modal('show');
}
}
})
}
});
$('#table').on('click', '.opt-hisHandle', function () {
var id = parseInt($(this).data('id'));
var data = $('#table').bootstrapTable('getRowByUniqueId', id);
$('#hisHandleTable').bootstrapTable('destroy');
$('#hisHandleTable').bootstrapTable({
columns: [
{ field: 'id', title: '编号', align: 'center', valign: 'middle', width: '5%' },
{ field: 'reason', title: '举报原因', align: 'center', valign: 'middle', width: '10%' },
{
field: '', title: '举报人信息', align: 'center', valign: 'middle', width: '10%', formatter: function (val, row, index) {
if (row) {
var str = '昵称:' + row.nick + '<br/>' +
'ID:' + row.erbanNo;
return str;
}
}
},
{
field: '', title: '近7天IM记录', align: 'center', valign: 'middle', width: '10%', formatter: function (val, row, index) {
return '<a href="#" onclick="historyMsgModalShow(' + row.id + ',' + row.targetUid + ',' + row.uid + ')">查看</a>';
}
},
{
field: 'picture',
title: '举报截图',
align: 'center',
valign: 'middle',
width: '10%',
formatter: function (val, row, index) {
if (!val) {
return '无'
}
if (!val.match(',')) {
return '<p style="width: 50px; height: 50px"><a href="' + val + '" target="blank"><img style="width:100%; height: 100%; margin: 0 5px;" src=" ' +
val + '" alt=""></a></p>';
}
var arr = val.split(',');
var str = '';
for (var i = 0; i < arr.length; i++) {
str += '<p style="width: 50px; height: 50px; display: inline-block; margin: 0 5px;"><a href="' + val + '" target="blank"><img style="width: 100%;height: 100%;" src=" ' + arr[i] +
'" alt=""></a></p>';
}
return str;
}
},
{ field: 'handleResultDesc', title: '处理结果', align: 'center', valign: 'middle', width: '10%' },
{
field: 'createTime', title: '举报时间', align: 'center', valign: 'middle', width: '10%', formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format('yyyy-MM-dd hh:mm:ss');
} else {
return '-';
}
}
},
{ field: 'sourceCn', title: '举报来源', align: 'center', valign: 'middle', width: '10%' }
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pagination: true,
pageList: [10, 20, 30, 50],
sidePagination: "server", //表示服务端请求
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageSize: params.pageSize,
pageNum: params.pageNumber,
targetUid: data.targetUid,
currentRecordId: id
};
return param;
},
uniqueId: 'id',
url: '/admin/user/impeach/listHisHandleRecordByTargetUid.action',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
})
$('#hisHandleModal').modal('show');
});
$('#table').on('click', '.opt-checkPic', function () {
var recordId = parseInt($(this).data('id'));
var data = $('#table').bootstrapTable('getRowByUniqueId', recordId);
$('#reportPicTable').bootstrapTable('destroy');
$('#reportPicTable').bootstrapTable({
columns: [
{
field: 'picture',
title: '举报图片',
align: 'center',
valign: 'middle',
width: '10%',
formatter: function (val, row, index) {
if (!val) {
return '无'
}
if (!val.match(',')) {
return '<p style="width: 250px; height: 250px"><img style="width:100%; height: 100%; margin: 0 5px;" src=" ' +
val + '" alt=""></p>';
}
var arr = val.split(',');
var str = '';
for (var i = 0; i < arr.length; i++) {
str += '<p style="width: 250px; height: 250px; display: inline-block; margin: 0 5px;"><img style="width: 100%;height: 100%;" src=" ' + arr[i] +
'" alt=""></p>';
}
return str;
}
}
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pagination: true,
pageList: [10, 20, 30, 50],
sidePagination: "server", //表示服务端请求
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
recordId: recordId
};
return param;
},
uniqueId: 'id',
url: '/admin/user/impeach/getReportImgUrl.action',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
})
$('#reportPicModal').modal('show');
});
$("#chatMessages").scroll(function () {
var nDivHight = $("#chatMessages").height();
var nScrollHight = $(this)[0].scrollHeight;
var nScrollTop = $(this)[0].scrollTop;
var paddingBottom = parseInt($(this).css('padding-bottom'));
var paddingTop = parseInt($(this).css('padding-top'));
if (nScrollTop + paddingBottom + paddingTop + nDivHight >= nScrollHight) {
if (hasNextMsg) {
//本次的sendBeginTime为下一次请求的endTime
querySessionMsg(sendFrom, sendTo, null, sendBeginTime);
}
}
});
})
}
},
};
function querySessionMsg(from, to, beginTime, endTime) {
$.ajax({
type: "get",
url: "/admin/netEase/querySessionMsg",
data: {
from: from,
to: to,
beginTime: beginTime,
endTime: endTime,
limit: 20
},
dataType: "json",
success: function (json) {
if (json.code == 200) {
var data = json.data;
if (null == data || data.msgs.length == 0) {
hasNextMsg = false;
$('#chatMessages').append(historyMessageTips('无历史聊天记录!'));
return;
}
var html = '';
var len = data.msgs.length;
var users = data.users;
for (var i = 0; i < len; i++) {
var msg = data.msgs[i];
var body = msg.body;
var sendTime = new Date(msg.sendtime).format('yyyy-MM-dd hh:mm:ss');
//倒序排序第一条为endTime最后一条为beginTime下一次请求的endTime为上一次的beginTime
if (i == 0) {
sendEndTime = msg.sendtime;
}
if (i == len - 1) {
sendBeginTime = msg.sendtime;
}
var user = users[msg.from];
//文字消息
if (msg.type == 0) {
var message = body.msg.replace(/'/g, '\\\'');
if (from == msg.from) {
html += '<div class="direct-chat-msg">' +
'<div class="direct-chat-info clearfix">' +
' <span class="direct-chat-name pull-left">' + user.nick + '</span>' +
' <span class="direct-chat-timestamp pull-right">' + sendTime + '</span>' +
'</div>' +
'<img class="direct-chat-img" src="' + user.avatar + '" alt="Message User Image">' +
'<div class="direct-chat-text">' +
message +
'</div>' +
'</div>';
} else {
html += '<div class="direct-chat-msg right">' +
' <div class="direct-chat-info clearfix">' +
' <span class="direct-chat-name pull-right">' + user.nick + '</span>' +
' <span class="direct-chat-timestamp pull-left">' + sendTime + '</span>' +
' </div>' +
' <img class="direct-chat-img" src="' + user.avatar + '" alt="Message User Image">' +
' <div class="direct-chat-text">' +
message +
' </div>' +
'</div>';
}
}
//图片消息
else if (msg.type == 1) {
if (from == msg.from) {
html += '<div class="direct-chat-msg">' +
'<div class="direct-chat-info clearfix">' +
' <span class="direct-chat-name pull-left">' + user.nick + '</span>' +
' <span class="direct-chat-timestamp pull-right">' + sendTime + '</span>' +
'</div>' +
'<img class="direct-chat-img" src="' + user.avatar + '" alt="Message User Image">' +
'<div class="direct-chat-text">' +
' <a href="' + body.url + '" target="blank"><img src="' + body.url + '" style="width: 60px; height: 60px;" alt=""/></a>' +
'</div>' +
'</div>';
} else {
html += '<div class="direct-chat-msg right">' +
' <div class="direct-chat-info clearfix">' +
' <span class="direct-chat-name pull-right">' + user.nick + '</span>' +
' <span class="direct-chat-timestamp pull-left">' + sendTime + '</span>' +
' </div>' +
' <img class="direct-chat-img" src="' + user.avatar + '" alt="Message User Image">' +
' <div class="direct-chat-text">' +
' <a href="' + body.url + '" target="blank"><img src="' + body.url + '" style="width: 60px; height: 60px;" alt=""/></a>' +
' </div>' +
'</div>';
}
}
}
if (html == '') {
html = historyMessageTips('无历史聊天记录!');
}
hasNextMsg = true;
$('#chatMessages').append(html);
} else {
$('#chatMessages').append(historyMessageTips('获取历史聊天记录失败,请稍后重试!'));
return;
}
}
});
}
function historyMessageTips(tips) {
var html = '<div class="direct-chat-msg">' +
'<div class="direct-chat-info clearfix">' +
' <span class="direct-chat-name pull-left"></span>' +
' <span class="direct-chat-timestamp pull-right"></span>' +
'</div>' +
'<div class="direct-chat-text">' +
tips +
'</div>' +
'</div>';
return html;
}
function setSelectOption() {
$.ajax({
type: "get",
url: '/admin/user/impeach/get/source.action',
dataType: 'json',
success: function (json) {
if (json.data) {
makeOption(json.data);
}
}
})
}
function makeOption(data) {
var str = '<option value=""> 全部' + '</option>';
for (var i = 0; i < data.length; i++) {
str += '<option value="' + data[i].value + '">' + data[i].key + '</option>';
}
$("#sourceSelect").html(str);
}
</script>
<style scoped>
#imgMask {
position: absolute;
top: 0;
left: 0;
width: 200px;
height: 200px;
padding: 4px;
background: #fff;
z-index: 1000;
display: none;
}
#imgMask img {
width: 100%;
height: 100%;
vertical-align: top;
}
input,
select {
margin-left: 8px;
margin-right: 8px;
}
#btnSearch {
margin-left: 36px;
}</style>

View File

@@ -0,0 +1,209 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<div id="toolbar">
<div class="col-sm-12">
<label for="erbanNo" class="col-sm-4 control-label">用户平台号:</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="erbanNo" id="erbanNo" placeholder="请输入用户平台号">
</div>
</div>
<div class="col-sm-12">
<button class="btn btn-default" id="search">
<i class="glyphicon glyphicon-wrench"></i>查询
</button>
<button class="btn btn-primary" id="add">
<i class="glyphicon glyphicon-plus"></i>增加
</button>
</div>
</div>
</div>
<!-- .content -->
<div id="table"></div>
</div>
</section>
<!-- 弹窗 -->
<div class="modal fade" id="userMuteModal" rabindex='-1' role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button class="close" type="button" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">x</span>
</button>
<div class="modal-title" id="userMuteModalLabel">新增管理员</div>
</div>
<div class="modal-body">
<form action="" id="addForm" class="form-horizontal">
<div class="form-group">
<label for="modal_erbanNo" class="col-sm-3 control-label">用户平台号</label>
<div class="col-sm-8">
<input type="text" class="form-control validate[required,custom[integer],min[1]]"
name="erbanNo" id="modal_erbanNo" placeholder="请输入用户平台号">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-primary" data-primary="addSave" id="save">保存</button>
</div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "UserMuteAdminView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{ field: 'id', title: 'ID', align: 'center', valign: 'middle', width: '20%' },
{ field: 'erbanNo', title: '用户平台号', align: 'center', valign: 'middle', width: '20%' },
{ field: 'nick', title: '用户昵称', align: 'center', valign: 'middle', width: '20%' },
{ field: 'roomId', title: '房间id', align: 'center', valign: 'middle', visible: false },
{ field: 'roomErbanNo', title: '房主平台号', align: 'center', valign: 'middle', visible: false },
{
field: 'createTime', title: '配置时间', align: 'center', valign: 'middle', width: '20%', formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format('yyyy-MM-dd hh:mm:ss');
} else {
return '-';
}
}
},
{ field: 'operator', title: '操作人', align: 'center', valign: 'middle', width: '20%' },
{
field: 'tmp', title: '操作', align: 'center', valign: 'middle', width: '10%', formatter: function (val, row, index) {
var key = row.id;
var status = row.status;
var str = '<button class="btn btn-danger btn-sm opt-remove" data-id="' + key + '">删除</button>';
return str;
}
}
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pagination: true,
pageList: [10, 20, 30, 50],
sidePagination: 'server',
queryParamsType: 'undefined',
queryParams: function queryParams(params) {
var param = {
pageSize: params.pageSize,
pageNumber: params.pageNumber,
erbanNo: $('#erbanNo').val(),
status: 1
};
return param;
},
uniqueId: 'id',
toolbar: '#toolbar',
url: '/admin/user/mute/list',
onLoadSuccess: function () {
console.log('load success');
},
onLoadError: function () {
console.log('load fail');
}
});
$("#table").on("click", '.opt-remove', function () {
var id = $(this).attr("data-id");
if (id == 'undefined') {
$("#tipMsg").text("id参数有误");
$("#tipModal").modal('show');
return;
}
if (confirm("你确认删除该记录吗? \r\n 删除后再也不能找回,请谨慎操作!")) {
$.ajax({
type: 'post',
url: "/admin/user/mute/delete.action",
data: { id: id },
dataType: "json",
success: function (json) {
if (json.code == 200) {
$("#tipMsg").text("删除成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("删除失败");
$("#tipModal").modal('show');
}
}
});
}
});
// 添加事件
$('#add').on('click', function () {
clearModal();
$('#userMuteModal').modal('show');
});
// 保存
$('#save').on('click', function () {
if ($('#addForm').validationEngine('validate')) {
var param = {};
param.erbanNo = $('#modal_erbanNo').val();
$.ajax({
type: 'post',
url: '/admin/user/mute/save',
data: param,
dataType: 'json',
success: function (res) {
if (res.code == 200) {
$('#userMuteModal').modal('hide');
$('#tipMsg').text('保存成功');
$('#tipModal').modal('show');
TableHelper.doRefresh('#table')
} else {
$('#tipMsg').text('保存失败,错误码:' + res.message);
$('#tipModal').modal('show');
}
}
})
}
});
$("#search").on('click', function () {
TableHelper.doRefresh('#table');
});
function clearModal() {
$('#addForm')[0].reset();
$('#addForm').validationEngine('hideAll');
}
});
}
},
};
</script>
<style scoped></style>

View File

@@ -0,0 +1,240 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<div id="toolbar">
<div class="col-sm-12">
<label for="erbanNo" class="col-sm-2 control-label">被禁用户平台号:</label>
<div class="col-sm-3">
<input type="text" class="input-sm" name="erbanNo" id="erbanNo" placeholder="请输入用户平台号">
</div>
<label for="erbanNo" class="col-sm-2 control-label">禁言时间:</label>
<div class="col-sm-5">
<input type="text" class="input-sm" name="startTime" id="startTime">
<input type="text" class="input-sm" name="endTime" id="endTime">
</div>
</div>
<div class="col-sm-12">
<button class="btn btn-default" id="search">
<i class="glyphicon glyphicon-wrench"></i>查询
</button>
</div>
</div>
</div>
<!-- .content -->
<div id="table"></div>
</div>
</section>
<div class="modal fade" id="releaseModal" rabindex='-1' role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button class="close" type="button" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">x</span>
</button>
<div class="modal-title" id="releaseModalLabel"></div>
</div>
<div class="modal-body">
<form action="" id="addForm" class="form-horizontal">
<input type="hidden" id="modal_id" name="id" />
<div class="form-group">
<label for="modal_reason" class="col-sm-3 control-label">原因</label>
<div class="col-sm-8">
<input type="text" class="form-control validate[required,maxSize[50]]" name="reason"
id="modal_reason" placeholder="请输入解禁原因限定50个字符内">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-primary" data-primary="addSave" id="save">保存</button>
</div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
var picker1 = $('#startTime').datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
autoclose: true
});
var picker2 = $('#endTime').datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
autoclose: true
});
picker1.on('changeDate', function () {
var date = $('#startTime').datetimepicker('getDate');
picker2.datetimepicker('setStartDate', date);
});
picker2.on('changeDate', function () {
var date = $('#endTime').datetimepicker('getDate');
picker1.datetimepicker('setEndDate', date);
});
export default {
name: "UserMuteRecordAdminView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{ field: 'id', title: 'ID', align: 'center', valign: 'middle', width: '10%' },
{ field: 'erbanNo', title: '被禁用户平台号', align: 'center', valign: 'middle', width: '10%' },
{ field: 'nick', title: '被禁用户昵称', align: 'center', valign: 'middle', width: '20%' },
{ field: 'roomId', title: '房间id', align: 'center', valign: 'middle', visible: false },
{
field: 'createTime', title: '禁言时间', align: 'center', valign: 'middle', width: '10%', formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format('yyyy-MM-dd hh:mm:ss');
} else {
return '-';
}
}
},
{ field: 'operator', title: '操作人', align: 'center', valign: 'middle', width: '10%' },
{ field: 'muteTime', title: '禁言时长', align: 'center', valign: 'middle', width: '10%', formatter: formatMuteTime },
{ field: 'reason', title: '禁言原因', align: 'center', valign: 'middle', width: '20%' },
{
field: 'tmp', title: '状态', align: 'center', valign: 'middle', width: '10%', formatter: function (val, row, index) {
if (row.status == 2) {
return '已过期';
}
var now = new Date().getTime();
var createTime = row.createTime;
if (now - createTime < row.muteTime * 1000) {
return '生效中';
} else {
return '已过期';
}
}
},
{
field: 'operate', title: '操作', align: 'center', valign: 'middle', width: '10%',
formatter: function (val, row, index) {
if (row.status == 2) {
return '-';
}
var now = new Date().getTime();
var createTime = row.createTime;
if (now - createTime < row.muteTime * 1000) {
var key = row.id;
var str = '<button class="btn btn-danger btn-sm opt-release" data-id="' + key + '">解禁</button>';
return str;
} else {
return '-';
}
}
}
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pagination: true,
pageList: [10, 20, 30, 50],
sidePagination: 'server',
queryParamsType: 'undefined',
queryParams: function queryParams(params) {
var param = {
pageSize: params.pageSize,
pageNumber: params.pageNumber,
erbanNo: $('#erbanNo').val(),
startTime: $('#startTime').val(),
endTime: $('#endTime').val()
};
return param;
},
uniqueId: 'id',
toolbar: '#toolbar',
url: '/admin/user/mute/record/list',
onLoadSuccess: function () {
console.log('load success');
},
onLoadError: function () {
console.log('load fail');
}
});
$("#search").on('click', function () {
TableHelper.doRefresh('#table');
});
// 编辑按钮点击事件
$('#table').on('click', '.opt-release', function () {
var id = $(this).attr("data-id");
$('#modal_id').val(id);
$('#modal_reason').val('');
$('#releaseModalLabel').text('解除禁言');
$('#releaseModal').modal('show');
});
// 保存
$('#save').on('click', function () {
if ($('#addForm').validationEngine('validate')) {
var param = {};
param.id = $('#modal_id').val();
param.reason = $('#modal_reason').val();
$.ajax({
type: 'post',
url: '/admin/user/mute/record/release',
data: param,
dataType: 'json',
success: function (res) {
if (res.code == 200) {
$('#releaseModal').modal('hide');
$('#tipMsg').text('保存成功');
$('#tipModal').modal('show');
TableHelper.doRefresh('#table')
} else {
$('#tipMsg').text('保存失败,' + res.message);
$('#tipModal').modal('show');
}
}
})
}
});
});
}
},
};
function formatMuteTime(muteTime) {
if (muteTime >= 2592000) {
return parseInt(muteTime / 2592000) + '个月';
} else if (muteTime >= 86400) {
return parseInt(muteTime / 86400) + '天';
} else if (muteTime >= 3600) {
return parseInt(muteTime / 3600) + '小时';
} else if (muteTime >= 60) {
return parseInt(muteTime / 60) + '分';
} else {
return parseInt(muteTime) + '秒';
}
}
</script>
<style scoped></style>

View File

@@ -0,0 +1,92 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<section class="content">
原密码:<input type="text" name="password" id="password" class="input-sm " placeholder="必填" />
新密码:<input type="text" name="newPassword" id="newPassword" class="input-sm " placeholder="必填" />
确认密码:<input type="text" name="confirmPassword" id="confirmPassword" class="input-sm "
placeholder="必填" />
<button id="btnModify" class="btn btn-sm btn-primary">修改</button>
</section>
</div>
</div>
</section>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "UserPasswordModifyView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$('#btnModify').on('click', function () {
var password = $('#password').val();
var newPassword = $('#newPassword').val();
var confirmPassword = $('#confirmPassword').val();
if (!password) {
$("#tipMsg").text("原密码不能为空");
$("#tipModal").modal('show');
}
else if (!newPassword) {
$("#tipMsg").text("新密码不能为空");
$("#tipModal").modal('show');
}
else if (!confirmPassword) {
$("#tipMsg").text("确认密码不能为空");
$("#tipModal").modal('show');
}
else if (password == newPassword) {
$("#tipMsg").text("新旧密码不能一致");
$("#tipModal").modal('show');
}
else if (newPassword != confirmPassword) {
$("#tipMsg").text("新密码与确认密码不一致");
$("#tipModal").modal('show');
}
else {
$.ajax({
type: "post",
url: "/admin/userPassword/modify.action",
data:
{
password: password,
newPassword: newPassword,
confirmPassword: confirmPassword
},
dataType: 'json',
success: function (data) {
console.log(data);
if (data.success == 'true') {
$("#tipMsg").text(data.msg);
$("#tipModal").modal('show');
$('#password').val("");
$('#newPassword').val("");
$('#confirmPassword').val("");
window.location.href = "/login/logout.action"
} else {
$("#tipMsg").text(data.msg);
$("#tipModal").modal('show');
}
}
})
}
})
}
},
};
</script>
<style scoped></style>

View File

@@ -0,0 +1,118 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<section class="content">
<div id="table"></div>
<div id="toolbar">
<textarea name="erbanNoList" id="erbanNoList" placeholder="请输入平台号,多个平台号请用逗号隔开"></textarea>
<button id="btnSearch" class="btn btn-sm btn-primary">查询</button>
</div>
</section>
</div>
</div>
</section>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "UserPurseAdminView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('#table').bootstrapTable("destroy");
$('#table').bootstrapTable({
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pagination: true,
pageList: [10, 20, 30, 50],
sidePagination: "client", //表示服务端请求
//设置为undefined可以获取pageNumberpageSizesearchTextsortNamesortOrder
//设置为limit可以获取limit, offset, search, sort, order
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageSize: params.pageSize,
pageNumber: params.pageNumber,
erbanNoList: $('#erbanNoList').val()
};
// console.log(param);
return param;
},
uniqueId: 'code',
toolbar: '#toolbar',
url: '/admin/userPurse/getList.action',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
},
columns: [
{ field: 'uid', title: '用户uid', align: 'center', valign: 'middle', width: '8%' },
{ field: 'erbanNo', title: '平台号', align: 'center', valign: 'middle', width: '8%' },
{ field: 'nick', title: '昵称', align: 'center', valign: 'middle', width: '10%' },
{ field: 'diamonds', title: '钻石', align: 'center', valign: 'middle', width: '8%' },
{ field: 'crystals', title: '水晶', align: 'center', valign: 'middle', width: '8%' },
{ field: 'golds', title: '金币', align: 'center', valign: 'middle', width: '8%' },
{
field: 'firstCharge', title: '首充资格', align: 'center', valign: 'middle', width: '2%', formatter: function (val, row, index) {
if (val) {
return '有';
} else {
return '无';
}
}
},
{
field: 'updateTime', title: '钱包更新时间', align: 'center', valign: 'middle', width: '8%', formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format("yyyy-MM-dd hh:mm:ss");
} else {
return '-';
}
}
}
]
})
$('#btnSearch').on('click', function () {
TableHelper.doRefresh('#table');
})
})
}
},
};
</script>
<style scoped>
.pull-left {
width: 100%;
}
#toolbar textarea {
overflow: hidden;
resize: none;
width: 100%;
box-sizing: border-box;
padding: 4px;
height: 100px;
line-height: 20px;
}
</style>

View File

@@ -0,0 +1,145 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<section class="content">
<div id="table"></div>
<div id="toolbar">
<div style="margin-bottom: 6px">
<button id="btnSearch" class="btn btn-sm btn-primary">查询</button>
搜索根源
<select name="checkType" id="checkType">
<option value="1">平台号</option>
<option value="2">手机号</option>
<option value="3">uid</option>
</select>
</div>
<textarea name="erbanNoList" id="erbanNoList" placeholder="多个搜索号请用逗号隔开"></textarea>
</div>
</section>
</div>
</div>
</section>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "UserRealNameAdminView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pagination: true,
pageList: [10, 20, 30, 50],
sidePagination: "client", //表示服务端请求
//设置为undefined可以获取pageNumberpageSizesearchTextsortNamesortOrder
//设置为limit可以获取limit, offset, search, sort, order
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageSize: params.pageSize,
pageNumber: params.pageNumber,
erbanNoList: $('#erbanNoList').val(),
type: $('#checkType').val()
};
// console.log(param);
return param;
},
uniqueId: 'code',
toolbar: '#toolbar',
url: '/admin/userRealName/getlist.action',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
},
columns: [
{ field: 'uid', title: 'uid', align: 'center', valign: 'middle' },
{ field: 'erbanNo', title: '平台号', align: 'center', valign: 'middle' },
{ field: 'nick', title: '用户昵称', align: 'center', valign: 'middle' },
{
field: 'realName', title: '真实姓名', align: 'center', valign: 'middle',
formatter: function (val, row, index) {
if (row.realName && row.realName) {
return row.realName;
} else {
return '未实名';
}
}
},
{
field: 'birth',
title: '身份证出生日期',
align: 'center',
valign: 'middle',
formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format("yyyy-MM-dd");
} else {
return '-';
}
}
},
]
})
$('#btnSearch').on('click', function () {
TableHelper.doRefresh('#table');
})
})
}
},
};
</script>
<style scoped>
.pull-left {
width: 100%;
}
#toolbar textarea {
overflow: hidden;
resize: none;
width: 100%;
box-sizing: border-box;
padding: 4px;
height: 100px;
line-height: 20px;
}
#detailModal .part {
display: flex;
justify-content: space-between;
align-items: center;
}
#removePhone,
#editPhone {
display: block;
text-align: left;
}
#btnSearch {
margin-right: 12px;
}</style>

View File

@@ -0,0 +1,207 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<section class="content">
<div id="table"></div>
<div id="toolbar">
平台号:<input type="text" class="input-sm validate[required]" name="erbanNo" id="erbanNo">
手机号:<input type="text" class="input-sm validate[required]" name="phone" id="phone">
设备号:<input type="text" class="input-sm validate[required]" name="deviceId" id="deviceId">
查询类型:<select name="loginType" id="loginType" class="input-sm">
<option value="">---全部---</option>
<option value="1">微信登录</option>
<option value="2">qq登录</option>
<option value="3">手机号登录</option>
<option value="4">一键登录</option>
<option value="5">苹果登录</option>
<option value="6">ticket登录</option>
</select>
<button id="btnSearch" class="btn btn-sm btn-primary">查询</button>
</div>
</section>
</div>
</div>
</section>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "UserRecordAdminView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{ field: 'recordId', title: 'recordId', align: 'center', valign: 'middle', width: '5%' },
{ field: 'phone', title: '手机号', align: 'center', valign: 'middle', width: '5%' },
{ field: 'erbanNo', title: '平台号', align: 'center', valign: 'middle', width: '5%' },
{
field: 'loginType',
title: '登录类型',
align: 'center',
width: '10%',
valign: 'middle',
formatter: function (val, row, index) {
switch (val) {
case 1:
return '微信登录';
case 2:
return 'QQ登录';
case 3:
return '手机登录或者平台号登录';
}
}
},
{
field: 'loginIp',
title: '登录IP',
align: 'center',
width: '10%',
valign: 'middle'
},
/*{
field: 'weixinOpenid',
title: '微信号',
align: 'center',
width: '10%',
valign: 'middle'
},
{field: 'qqOpenid',
title: 'qq号',
align: 'center', width: '10%',
valign: 'middle'
},*/
{
field: 'os',
title: '系统类型',
align: 'center',
width: '5%',
valign: 'middle'
},
{ field: 'osversion', title: '系统版本', align: 'center', width: '5%', valign: 'middle' },
{ field: 'ispType', title: '运营商类型', align: 'center', width: '5%', valign: 'middle' },
{ field: 'deviceId', title: '设备号', align: 'center', width: '10%', valign: 'middle' },
{ field: 'model', title: '手机型号', align: 'center', width: '10%', valign: 'middle' },
{
field: 'createTime',
title: '创建时间',
align: 'center',
width: '10%',
valign: 'middle',
formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format("yyyy-MM-dd hh:mm:ss");
} else {
return '-';
}
}
}
/*{
field: 'tmp',
title: '操作',
align: 'center',
width: '20%',
valign: 'middle',
formatter: function (val, row, index) {
var key = row.blockId;
return "<button class='btn btn-sm btn-success opt-release' data-id=" + key + ">解封</button>&nbsp;&nbsp;"+
"<button class='btn btn-sm btn-success opt-edit' data-id=" + key + " >编辑</button>";
}
}*/
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pagination: true,
pageList: [10, 20, 30, 50],
sidePagination: "server", //表示服务端请求
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageSize: params.pageSize,
pageNum: params.pageNumber,
phone: $('#phone').val(),
erbanNo: $('#erbanNo').val(),
deviceId: $('#deviceId').val(),
loginType: $('#loginType').val(),
};
return param;
},
uniqueId: 'code',
toolbar: '#toolbar',
url: '/admin/accountLoginRecord/list.action',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
})
/*查询刷新*/
$('#btnSearch').on('click', function () {
TableHelper.doRefresh('#table');
})
})
}
},
};
</script>
<style scoped>
.bar1,
.bar2 {
margin-bottom: 10px;
}
label.col-sm-1 {
padding: 0;
line-height: 30px;
text-align: right;
/*padding-right: 4px;*/
}
label.col-sm-1 {
padding: 0;
line-height: 30px;
text-align: right;
/*padding-right: 4px;*/
}
input,
select {
margin-left: 8px;
margin-right: 8px;
}
#btnSearch {
margin-left: 36px;
}
.record {
margin-top: 10px;
}
.record .title {
font-size: 16px;
}</style>

View File

@@ -0,0 +1,513 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<div id="toolbar">
<div class="col-sm-12">
<button id="btnSearch" class="btn btn-default">
<i class="glyphicon glyphicon-search"></i>查询
</button>
<button id="btnAdd" class="btn btn-default">
<i class="glyphicon glyphicon-plus"></i>增加
</button>
</div>
</div>
</div>
<!-- .content -->
<div id="table"></div>
</div>
</section>
<div class="modal fade" id="roomTagModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="modalLabel">新增</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" id="addForm">
<input type="hidden" name="id" id="id" />
<div class="form-group">
<label for="relationType" class="col-sm-3 control-label">关系<font color="red">*</font></label>
<div class="col-sm-9">
<select name="relationType" id="relationType" class="form-control validate[required]">
<option value="1">CP</option>
</select>
</div>
</div>
<div class="form-group">
<label for="levelSeq" class="col-sm-3 control-label">等级<font color="red">*</font></label>
<div class="col-sm-9">
<select name="levelSeq" id="levelSeq" class="form-control validate[required]">
<option value=""></option>
<option value="1">Lv.1</option>
<option value="2">Lv.2</option>
<option value="3">Lv.3</option>
<option value="4">Lv.4</option>
<option value="5">Lv.5</option>
<option value="6">Lv.6</option>
<option value="7">Lv.7</option>
<option value="8">Lv.8</option>
<option value="9">Lv.9</option>
<option value="10">Lv.10</option>
</select>
</div>
</div>
<div class="form-group">
<label for="secretVal" class="col-sm-3 control-label">所需亲密值<font color="red">*</font></label>
<div class="col-sm-9">
<input type="text" class="form-control validate[required]" name="secretVal" id="secretVal"
value="520" disabled placeholder="所需亲密值">
</div>
</div>
<div class="form-group">
<label for="type" class="col-sm-3 control-label">特权类型<font color="red">*</font></label>
<div class="col-sm-9">
<select name="type" id="type" class="form-control validate[required]">
<option value="1">铭牌</option>
<option value="2">头饰</option>
<option value="3">CP位</option>
</select>
</div>
</div>
<div class="form-group">
<label for="gender" class="col-sm-3 control-label">性别<font color="red">*</font></label>
<div class="col-sm-9">
<select name="gender" id="gender" class="form-control validate[required]">
<option value="0"></option>
<option value="1"></option>
<option value="2"></option>
</select>
</div>
</div>
<div class="form-group" id="txtBox">
<label for="privilegeProp" class="col-sm-3 control-label">特权值填写<font color="red">*</font>
</label>
<div class="col-sm-9">
<input type="text" class="form-control validate[required]" name="privilegeProp"
id="privilegeProp" placeholder="特权值填写">
</div>
</div>
<!--底部配置-->
<div class="form-group" id="imgBox">
<label class="col-sm-3 control-label"></label>
<div class="col-sm-8">
<img src="" id="iconImgUrl" style='width:108px;height:45px;' alt="">
<input type="file" id="iconFile" name='uploadFile'
accept='image/gif,image/jpeg,image/jpg,image/png,image/svg'>
<button class="btn btn-success" type='button' id="iconBtn">上传</button>
<input type="hidden" id="iconUrl" name='alertWinPic'
class="form-control validate[required]">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="add">确定</button>
</div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
import { serverError } from '@/utils/maintainer';
export default {
name: "UserRelationPrivilegeAdminView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('.datetime').datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
autoclose: true
});
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{
field: 'relationType', title: '关系', align: 'center', valign: 'middle', width: '10%',
formatter: function (val, row, index) {
if (val == 1) {
return 'CP'
} else {
return val;
}
}
},
{
field: 'levelSeq', title: '关系等级', align: 'center', valign: 'middle', width: '10%',
formatter: function (val, row, index) {
return 'Lv.' + val;
}
},
{ field: 'secretVal', title: '所需亲密值', align: 'center', width: '5%' },
{
field: 'type', title: '特权类型', align: 'center', valign: 'middle', width: '10%',
formatter: function (val, row, index) {
if (val == 1) {
return '铭牌'
} else if (val == 2) {
return '头饰'
} else if (val == 3) {
return 'CP位'
} {
return val;
}
}
},
{
field: 'privilegeProp', title: '特权信息', align: 'center', valign: 'middle', width: '10%',
formatter: function (val, row, index) {
if (row.type == 3) {
return "<img src='" + val + "' width='60' height='50'>";
} else {
return val;
}
}
},
{
field: 'createTime', title: '创建时间', align: 'center', valign: 'middle', width: '10%',
formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format('yyyy-MM-dd hh:mm:ss');
} else {
return '-';
}
}
},
{
field: 'id',
title: '操作',
align: 'center',
width: '10%',
formatter: function (val, row, index) {
return '<button id="btnEdit" name="btnEdit" class="btn btn-sm btn-success opt-edit" data-id=' + val + '>' +
'<i class="glyphicon glyphicon-edit"></i> 编辑</button>' +
'&nbsp;&nbsp;<button class="btn btn-sm btn-danger opt-remove" data-id=' + val + ' data-new-status=' + 2 +
'><i class="glyphicon glyphicon-remove"></i>删除</button>';
}
}
],
undefinedText: "-",
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pagination: true,
pageList: [20, 50, 100, 200, 300, 500],
search: false,
sidePagination: "server", //表示服务端请求
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageNum: params.pageNumber,
pageSize: params.pageSize
};
return param;
},
ajax: function (request) { //使用ajax请求
$.ajax({
type: "GET",
url: '/admin/relation/privilege/privilegeList.action',
contentType: 'application/json;charset=utf-8',
dataType: 'json',
data: request.data,
success: function (res) {
apiResult(res);
request.success({
rows: res.data.rows,
total: res.data.total,
});
},
error: function (req) {
serverError(req);
}
})
},
toolbar: '#toolbar',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
});
// 查询刷新
$('#btnSearch').on('click', function () {
TableHelper.doRefresh('#table');
});
//新建标签
$("#btnAdd").click(function () {
clearModal();
$("#roomTagModal").modal('show');
});
$("#add").click(function () {
var id = $("#id").val();
var relationType = $("#relationType").val();
var levelSeq = $("#levelSeq").val();
var type = $("#type").val();
var gender = $("#gender").val();
var privilegeProp = $("#privilegeProp").val();
if (type == 3) {
gender = 0;
privilegeProp = $("#iconUrl").val();
}
if (type == 3 && (privilegeProp == null || privilegeProp == '')) {
$("#tipMsg").text("保存失败,请先上传图片!");
$("#tipModal").modal('show');
return;
}
if ($("#addForm").validationEngine('validate')) {
$.ajax({
type: "post",
url: "/admin/relation/privilege/savePrivilege.action",
data: {
id: id,
relationType: relationType,
levelSeq: levelSeq,
type: type,
gender: gender,
privilegeProp: privilegeProp
},
dataType: "json",
success: function (json) {
if (json.code == 200) {
$("#tipMsg").text("保存成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
$("#roomTagModal").modal('hide');
} else {
$("#tipMsg").text("保存失败." + json.message);
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
$("#roomTagModal").modal('hide');
}
}
});
}
});
$("#table").on("click", '.opt-edit', function () {
var id = $(this).attr("data-id");
clearModal();
$.ajax({
type: "get",
url: "/admin/relation/privilege/getPrivilegeInfo.action",
data: { id: id },
dataType: "json",
success: function (res) {
debugger
var json = res.data;
if (json) {
$("#id").val(id);
$('#relationType').val(json.relationType);
$('#levelSeq').val(json.levelSeq);
$('#secretVal').val(json.secretVal);
$('#type').val(json.type);
$('#gender').val(json.gender);
if (json.type == 3) {
$('#iconUrl').val(json.privilegeProp);
$('#iconImgUrl').attr('src', json.privilegeProp);
$('#gender').attr("disabled", true);
$("#imgBox").show();
$("#txtBox").hide();
} else {
$('#privilegeProp').val(json.privilegeProp);
$("#imgBox").hide();
$("#txtBox").show();
}
// 打开编辑弹窗
$("#roomTagModal").modal('show');
$("#modalLabel").text("编辑房间标签");
} else {
$("#tipMsg").text("获取信息出错");
$("#tipModal").modal('show');
}
}
});
});
$("#table").on("click", '.opt-remove', function () {
var id = $(this).attr("data-id");
if (confirm("你确认删除该记录吗? \r\n 删除后再也不能找回,请谨慎操作!")) {
const requestParam = {
id: id
}
$.ajax({
type: "get",
url: "/admin/relation/privilege/delPrivilege",
data: requestParam,
dataType: "json",
contentType: 'application/json',
success: function (json) {
if (json.code == 200) {
$("#tipMsg").text("修改成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("修改失败." + json.message);
$("#tipModal").modal('show');
}
}
});
}
});
function apiResult(json) {
if (json.code == 200 && json.message == 'success') {
return true;
}
$("#tipMsg").text("请求失败,错误信息:" + json.message);
$("#tipModal").modal('show');
return false;
}
$('#iconBtn').on('click', function () {
if ($('#iconFile').val() == '') {
$('#tipMsg').text('上传图片为空');
$('#tipModal').modal('show');
return;
}
$.ajaxFileUpload({
fileElementId: 'iconFile', //需要上传的文件域的ID即<input type="file">的ID。
url: '/admin/upload/img', //后台方法的路径
type: 'post', //当要提交自定义参数时这个参数要设置成post
dataType: 'json', //服务器返回的数据类型。可以为xml,script,json,html。如果不填写jQuery会自动判断。
secureuri: false, //是否启用安全提交默认为false。
async: true, //是否是异步
success: function (json) { //提交成功后自动执行的处理函数参数data就是服务器返回的数据。
if (json.path) {
$('#iconUrl').val(json.path);
$('#iconImgUrl').attr("src", json.path);
console.log(json.path);
} else {
$("#tipMsg").text(json.msg);
$("#tipModal").modal('show');
}
},
error: function (data, status, e) { //提交失败自动执行的处理函数。
console.error(e);
}
});
})
function clearModal() {
$('#iconImgUrl').attr('src', '');
$('#iconSelectedImgUrl').attr('src', '');
$('#addForm').find('input[type=text],input[type=hidden],input[type=file]').each(function () {
$(this).val('');
})
$('#type').val(1);
$("#imgBox").hide();
}
$("#type").change(function () {
var optVal = $(this).val();
if (optVal == 3) {
$('#privilegeProp').val('');
$('#gender').val('');
$('#gender').attr("disabled", true);
$("#imgBox").show();
$("#txtBox").hide();
} else {
$('#iconImgUrl').attr('src', '');
$('#iconSelectedImgUrl').attr('src', '');
$('#gender').attr("disabled", false);
$("#imgBox").hide();
$("#txtBox").show();
}
});
$("#levelSeq").change(function () {
var levelSeq = $(this).val();
$.ajax({
type: "get",
url: "/admin/relation/privilege/getSecretValByLevelSeq.action",
data: { levelSeq: levelSeq },
dataType: "json",
success: function (res) {
if (res.code == 200) {
$("#secretVal").val(res.data);
} else {
$("#tipMsg").text("获取亲密信息出错");
$("#tipModal").modal('show');
}
}
});
});
});
}
},
};
</script>
<style scoped></style>

View File

@@ -0,0 +1,419 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<div id="toolbar">
<div class="col-sm-12">
<button id="btnSearch" class="btn btn-default">
<i class="glyphicon glyphicon-search"></i>查询
</button>
<button id="btnAdd" class="btn btn-default">
<i class="glyphicon glyphicon-plus"></i>增加
</button>
</div>
</div>
</div>
<!-- .content -->
<div id="table"></div>
</div>
</section>
<div class="modal fade" id="roomTagModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="modalLabel">新增</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" id="addForm">
<input type="hidden" name="id" id="id" />
<div class="form-group">
<label for="name" class="col-sm-3 control-label">道具名称<font color="red">*</font></label>
<div class="col-sm-9">
<input type="text" class="form-control validate[required]" name="name" id="name"
placeholder="道具名称">
</div>
</div>
<!--底部配置-->
<div class="form-group">
<label for="price" class="col-sm-3 control-label">道具价格<font color="red">*</font></label>
<div class="col-sm-9">
<input type="text" class="form-control validate[required]" name="price" id="price"
placeholder="道具价格">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label"></label>
<div class="col-sm-8">
<img src="" id="iconImgUrl" style='width:108px;height:45px;' alt="">
<input type="file" id="iconFile" name='uploadFile'
accept='image/gif,image/jpeg,image/jpg,image/png,image/svg'>
<button class="btn btn-success" type='button' id="iconBtn">上传</button>
<input type="hidden" id="iconUrl" name='alertWinPic'
class="form-control validate[required]">
</div>
</div>
<div class="form-group">
<label for="type" class="col-sm-3 control-label">适用关系<font color="red">*</font></label>
<div class="col-sm-9">
<select name="type" id="type" class="form-control validate[required]">
<option value="1">CP</option>
</select>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="add">确定</button>
</div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
import { serverError } from '@/utils/maintainer';
export default {
name: "UserRelationPropsAdminView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('.datetime').datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
autoclose: true
});
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{ field: 'id', title: '序号', align: 'center', width: '5%' },
{ field: 'name', title: '道具名称', align: 'center', width: '5%' },
{ field: 'price', title: '道具价格', align: 'center', width: '10%' },
{
field: 'img',
title: '道具图片',
align: 'center',
width: '10%',
formatter: function (val, row, index) {
return "<img src='" + val + "' width='60' height='50'>";
}
},
{
field: 'type', title: '适用关系', align: 'center', valign: 'middle', width: '10%',
formatter: function (val, row, index) {
if (val == 1) {
return 'CP'
} else {
return val;
}
}
},
{
field: 'status', title: '状态', align: 'center', valign: 'middle', width: '10%',
formatter: function (val, row, index) {
if (val == 0) {
return '删除'
} else if (val == 1) {
return '启用'
} else if (val == 2) {
return '停用'
} else {
return val;
}
}
},
{
field: 'createTime', title: '开始时间', align: 'center', valign: 'middle', width: '10%',
formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format('yyyy-MM-dd hh:mm:ss');
} else {
return '-';
}
}
},
{
field: 'id',
title: '操作',
align: 'center',
width: '10%',
formatter: function (val, row, index) {
if (row.isDefault) return '';
if (row.status == 1) {
return '<button id="btnEdit" name="btnEdit" class="btn btn-sm btn-success opt-edit" data-id=' + val + '>' +
'<i class="glyphicon glyphicon-edit"></i> 编辑</button>' +
'&nbsp;&nbsp;<button class="btn btn-sm btn-warning opt-remove" data-id=' + val + ' data-new-status=' + 2 +
'><i class="glyphicon glyphicon-remove"></i>停用</button>';
} else if (row.status == 2) {
return '<button id="btnEdit" name="btnEdit" class="btn btn-sm btn-success opt-edit" data-id=' + val + '>' +
'<i class="glyphicon glyphicon-edit"></i> 编辑</button>' +
'&nbsp;&nbsp;<button class="btn btn-sm btn-info opt-remove" data-id=' + val + ' data-new-status=' + 1 +
'><i class="glyphicon glyphicon-remove"></i>启用</button>';
} else {
return '<button id="btnEdit" name="btnEdit" class="btn btn-sm btn-success opt-edit" data-id=' + val + '>' +
'<i class="glyphicon glyphicon-edit"></i> 编辑</button>';
}
}
}
],
undefinedText: "-",
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pagination: true,
pageList: [20, 50, 100, 200, 300, 500],
search: false,
sidePagination: "server", //表示服务端请求
queryParamsType: "undefined",
/*queryParams: function queryParams(params) { //设置查询参数
var param = {
pageNum: params.pageNumber,
pageSize: params.pageSize
};
return param;
},*/
ajax: function (request) { //使用ajax请求
$.ajax({
type: "GET",
url: '/admin/relation/props/propsList.action',
contentType: 'application/json;charset=utf-8',
dataType: 'json',
data: request.data,
success: function (res) {
apiResult(res);
request.success({
rows: res.data.rows,
//total: res.data.total,
});
},
error: function (req) {
serverError(req);
}
})
},
toolbar: '#toolbar',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
});
// 查询刷新
$('#btnSearch').on('click', function () {
TableHelper.doRefresh('#table');
});
//新建标签
$("#btnAdd").click(function () {
clearModal();
$("#roomTagModal").modal('show');
});
$("#add").click(function () {
var id = $("#id").val();
var name = $("#name").val();
var price = $("#price").val();
var img = $("#iconUrl").val();
var type = $("#type").val();
if (img == null || img == '') {
$("#tipMsg").text("保存失败,请先上传图片!");
$("#tipModal").modal('show');
return;
}
if ($("#addForm").validationEngine('validate')) {
$.ajax({
type: "post",
url: "/admin/relation/props/saveProps.action",
data: {
id: id,
name: name,
price: price,
img: img,
type: type
},
dataType: "json",
success: function (json) {
if (json.code == 200) {
$("#tipMsg").text("保存成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
$("#roomTagModal").modal('hide');
} else {
$("#tipMsg").text("保存失败." + json.message);
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
$("#roomTagModal").modal('hide');
}
}
});
}
});
$("#table").on("click", '.opt-edit', function () {
var id = $(this).attr("data-id");
clearModal();
$.ajax({
type: "get",
url: "/admin/relation/props/getPropsInfo.action",
data: { id: id },
dataType: "json",
success: function (res) {
var json = res.data;
if (json) {
$("#id").val(id);
$("#name").val(json.name);
$("#price").val(json.price);
$('#type').val(json.type);
$('#iconUrl').val(json.img);
$('#iconImgUrl').attr('src', json.img);
// 打开编辑弹窗
$("#roomTagModal").modal('show');
$("#modalLabel").text("编辑房间标签");
} else {
$("#tipMsg").text("获取信息出错");
$("#tipModal").modal('show');
}
}
});
});
$("#table").on("click", '.opt-remove', function () {
var id = $(this).attr("data-id");
const status = $(this).attr('data-new-status');
let action = ""
if (status == 2) {
action = `确定停用?`
} else if (status == 1) {
action = `确定启用?`
}
if (confirm(action)) {
const requestParam = {
id: id,
status: status
}
$.ajax({
type: "get",
url: "/admin/relation/props/statusSwitch",
data: requestParam,
dataType: "json",
contentType: 'application/json',
success: function (json) {
if (json.code == 200) {
$("#tipMsg").text("修改成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("修改失败." + json.message);
$("#tipModal").modal('show');
}
}
});
}
});
function apiResult(json) {
if (json.code == 200 && json.message == 'success') {
return true;
}
$("#tipMsg").text("请求失败,错误信息:" + json.message);
$("#tipModal").modal('show');
return false;
}
$('#iconBtn').on('click', function () {
if ($('#iconFile').val() == '') {
$('#tipMsg').text('上传图片为空');
$('#tipModal').modal('show');
return;
}
$.ajaxFileUpload({
fileElementId: 'iconFile', //需要上传的文件域的ID即<input type="file">的ID。
url: '/admin/upload/img', //后台方法的路径
type: 'post', //当要提交自定义参数时这个参数要设置成post
dataType: 'json', //服务器返回的数据类型。可以为xml,script,json,html。如果不填写jQuery会自动判断。
secureuri: false, //是否启用安全提交默认为false。
async: true, //是否是异步
success: function (json) { //提交成功后自动执行的处理函数参数data就是服务器返回的数据。
if (json.path) {
$('#iconUrl').val(json.path);
$('#iconImgUrl').attr("src", json.path);
console.log(json.path);
} else {
$("#tipMsg").text(json.msg);
$("#tipModal").modal('show');
}
},
error: function (data, status, e) { //提交失败自动执行的处理函数。
console.error(e);
}
});
})
function clearModal() {
$('#iconImgUrl').attr('src', '');
$('#iconSelectedImgUrl').attr('src', '');
$('#addForm').find('input[type=text],input[type=hidden],input[type=file]').each(function () {
$(this).val('');
})
}
});
}
},
};
</script>
<style scoped></style>

View File

@@ -0,0 +1,584 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<!-- .content -->
<div id="table"></div>
<div id="toolbar">
<form id="searchForm" action="/admin/withdraw/export" method="get" target="_blank">
<div class="col-sm-12">
<label for="erbanNo" class="col-sm-1 control-label">平台号:</label>
<div class="col-sm-2"><input type="text" class="form-control" name="erbanNo" id="erbanNo"></div>
<label for="erbanNo" class="col-sm-1 control-label">手机号码:</label>
<div class="col-sm-2"><input type="text" class="form-control" name="phone" id="phone"></div>
<label for="account" class="col-sm-1 control-label">支付宝账号:</label>
<div class="col-sm-2"><input type="text" class="form-control" name="account" id="account"></div>
<label for="accountName" class="col-sm-1 control-label">支付宝名称:</label>
<div class="col-sm-2"><input type="text" class="form-control" name="accountName"
id="accountName"></div>
</div>
<div class="col-sm-12">
<label for="beginDate" class="col-sm-1 control-label">开始时间:</label>
<div class="col-sm-2"><input type="text" class="form-control" name="beginDate" id="beginDate">
</div>
<label for="endDate" class="col-sm-1 control-label">结束时间:</label>
<div class="col-sm-2"><input type="text" class="form-control" name="endDate" id="endDate"></div>
<label for="status" class="col-sm-1 control-label">状态:</label>
<div class="col-sm-2">
<select name="status" id="status" data-btn-class="btn-warning" class="form-control">
<option value="-1" selected="selected">全部</option>
<option value="0">已作废</option>
<option value="1">申请中</option>
<option value="2">已批准</option>
<option value="3">已驳回</option>
</select>
</div>
<label for="payStatus" class="col-sm-1 control-label">支付状态:</label>
<div class="col-sm-2">
<select name="payStatus" id="payStatus" data-btn-class="btn-warning" class="form-control">
<option value="all" selected="selected">全部</option>
<option value="scheduled">计划中</option>
<option value="pending">申请中</option>
<option value="paid">支付成功</option>
<option value="failed">支付失败</option>
</select>
</div>
</div>
<div class="col-sm-12">
<label for="blockStatus" class="col-sm-1 control-label">用户状态:</label>
<div class="col-sm-2">
<select name="blockStatus" id="blockStatus" data-btn-class="btn-warning"
class="form-control">
<option value="0" selected="selected">全部</option>
<option value="2">正常</option>
<option value="1">黑名单</option>
</select>
</div>
<label for="accountType" class="col-sm-1 control-label">账号类型:</label>
<div class="col-sm-2">
<select name="accountType" id="accountType" data-btn-class="btn-warning"
class="form-control">
<option value="0" selected="selected">全部</option>
<option value="1">支付宝</option>
<option value="3">银行卡</option>
</select>
</div>
</div>
</form>
<div class="pull-left">
<button id="btnSearch" class="btn btn-default">
<i class="glyphicon glyphicon-search"></i>查询
</button>
<button id="btnExport" class="btn btn-default">
<i class="glyphicon glyphicon-export"></i>导出
</button>
<button id="btnMultiApprove" class="btn btn-default">
<i class="glyphicon glyphicon-certificate"></i>批量批准
</button>
<button id="btnMultiTransfer" class="btn btn-default">
<i class="glyphicon glyphicon-bitcoin"></i>批量付款
</button>
<button id="btnMultiReject" class="btn btn-default">
<i class="glyphicon glyphicon-bitcoin"></i>批量驳回
</button>
<div class="pull-right">
<h4 id="totalNum"></h4>
</div>
</div>
</div>
</div>
</div>
</section>
<div class="modal fade" id="withdrawModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="modalLabel">提现申请审批</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" id="rejectForm">
<input type="hidden" name="withdrawId" id="withdrawId" />
<div class="form-group">
<label for="remark" class="col-sm-2 control-label">驳回原因</label>
<div class="col-sm-10">
<input type="text" class="form-control validate[required]" name="remark" id="remark">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="reject">保存</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="tipModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">提示信息</h4>
</div>
<div class="modal-body" id="tipMsg"></div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "WithdrawAdminView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
//{field: 'id', title: 'id', align: 'center', width: '5%'},
{ field: 'tmp', title: 'id', align: 'center', checkbox: true, width: '5%' },
{ field: 'erbanNo', title: '平台号', align: 'center', width: '5%' },
{
field: 'accountType',
title: '账号类型',
align: 'center',
width: '5%',
formatter: function (val, row, index) {
return val ? ['支付宝', '微信', '银行卡'][val - 1] : '-';
}
},
{ field: 'account', title: '账号', align: 'center', width: '5%' },
{ field: 'accountName', title: '账号名', align: 'center', width: '5%' },
{ field: 'money', title: '折现金额', align: 'center', width: '5%' },
{ field: 'tax', title: '税额', align: 'center', width: '5%' },
{ field: 'phone', title: '手机号', align: 'center', width: '5%' },
{
field: 'status',
title: '提现状态',
align: 'center',
width: '5%',
formatter: function (val, row, index) {
if (val == 0) {
return "作废";
} else if (val == 1) {
return "申请中";
} else if (val == 2) {
return "已批准";
} else if (val == 3) {
return "已驳回";
} else {
return "未知状态";
}
}
},
{
field: 'withDrawBlockStatus',
title: '用户黑名单状态',
align: 'center',
width: '5%',
formatter: function (val, row, index) {
return val == 2 ? '正常' : '黑名单';
}
},
{ field: 'remark', title: '备注', align: 'center', width: '10%' },
{
field: 'payStatus',
title: '支付状态',
align: 'center',
width: '5%',
formatter: function (val, row, index) {
if (val == 'pending') {
return "申请中";
} else if (val == 'paid') {
return "支付成功";
} else if (val == 'failed') {
return "支付失败";
} else {
return "-";
}
}
},
{ field: 'payResult', title: '支付结果', align: 'center', width: '5%' },
{
field: 'createTime',
title: '申请时间',
align: 'center',
width: '5%',
valign: 'middle',
formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format("yyyy-MM-dd hh:mm:00");
} else {
return '-';
}
}
},
{
field: 'id',
title: '操作',
align: 'center',
width: '15%',
formatter: function (val, row, index) {
var disabledText = row.withDrawBlockStatus == 2 ? '' : 'disabled';
var actions = [];
if (row.status == 1) {
actions.push('<button id="btnApprove" ' + disabledText + ' name="btnApprove" class="btn btn-sm btn-success opt-approve" data-id=' + val + '>' +
'<i class="glyphicon glyphicon-edit"></i> 批准</button> ');
actions.push('<button id="btnReject" name="btnReject" class="btn btn-sm btn-success opt-reject" data-id=' + val + '>' +
'<i class="glyphicon glyphicon-warning-sign"></i> 驳回</button> ');
} else if (row.status == 2) {
actions.push('<button id="btnTransfer" ' + disabledText + ' name="btnTransfer" class="btn btn-sm btn-success opt-transfer" data-id=' + val + '>' +
'<i class="glyphicon glyphicon-transfer"></i> 付款</button> ');
actions.push('<button id="btnTransferSearch" ' + disabledText + ' name="btnTransferSearch" class="btn btn-sm btn-success opt-transfer-search" data-id=' + val + '>' +
'<i class="glyphicon glyphicon-search"></i> 查询</button> ');
}
return actions.join('');
}
}
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 20,
pagination: true,
pageList: [20, 50, 100, 200, 300, 500],
search: false,
sidePagination: "server", //表示服务端请求
//设置为undefined可以获取pageNumberpageSizesearchTextsortNamesortOrder
//设置为limit可以获取limit, offset, search, sort, order
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageNum: params.pageNumber,
pageSize: params.pageSize,
account: $('#account').val(),
accountName: $('#accountName').val(),
nick: $('#nick').val(),
phone: $('#phone').val(),
status: $('#status').val(),
payStatus: $('#payStatus').val(),
erbanNo: $('#erbanNo').val(),
beginDate: $('#beginDate').val(),
endDate: $('#endDate').val(),
blockStatus: $('#blockStatus').val(),
accountType: $('#accountType').val()
};
return param;
},
toolbar: '#toolbar',
url: '/admin/withdraw/list.action',
onLoadSuccess: function (json) { //加载成功时执行
var totalNum = json.totalNum;
if (totalNum != undefined) {
$("#totalNum").html('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' + '合计金额:' + '&nbsp;&nbsp;&nbsp;&nbsp;' + totalNum);
}
console.log(json);
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
});
// 导出EXCEL
$('#btnExport').on('click', function () {
$("#searchForm").submit();
});
// 查询刷新
$('#btnSearch').on('click', function () {
TableHelper.doRefresh('#table');
});
var picker1 = $("#beginDate").datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
todayBtn: true,
autoclose: true,
});
var picker2 = $("#endDate").datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
todayBtn: true,
autoclose: true
});
picker1.on('changeDate', function () {
var date = $('#beginDate').datepicker('getDate');
picker2.datepicker('setStartDate', date);
});
picker2.on('changeDate', function () {
var date = $('#endDate').datepicker('getDate');
picker1.datepicker('setEndDate', date);
});
// 批准提现申请
$("#table").on('click', '.opt-approve', function () {
var id = $(this).attr("data-id");
if (id == 'undefined') {
$("#tipMsg").text("id参数有误");
$("#tipModal").modal('show');
return;
}
if (confirm("确认批准提现吗?")) {
console.log("id: " + id);
$.ajax({
type: "post",
url: "/admin/withdraw/approve.action",
//data: $('#withdrawForm').serialize(),
data: { id: id },
dataType: "json",
success: function (json) {
if (json.success == 'true') {
$("#withdrawModal").modal('hide');
$("#tipMsg").text("已批准提现申请");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("保存失败[" + id + "]," + json.msg);
$("#tipModal").modal('show');
}
}
});
}
});
// 批量批准提现申请
$('#btnMultiApprove').on('click', function () {
var rows = $("#table").bootstrapTable("getSelections");
if (rows.length == 0) {
alert("请先选择要批准的记录");
return;
}
console.log("rows: " + rows.length);
var idArr = [];
for (var i = 0; i < rows.length; i++) {
idArr.push(rows[i]['id']);
}
console.log(idArr);
if (confirm("你确认批量批准提现吗?")) {
$.ajax({
type: 'post',
url: "/admin/withdraw/batchApprove.action",
data: { 'ids': JSON.stringify(idArr) },
dataType: "json",
success: function (json) {
if (json.success == 'true') {
$("#tipMsg").text("已批准提现申请");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("操作失败");
$("#tipModal").modal('show');
}
}
});
}
});
// 转账
$("#table").on('click', '.opt-transfer', function () {
var id = $(this).attr("data-id");
if (id == 'undefined') {
$("#tipMsg").text("id参数有误");
$("#tipModal").modal('show');
return;
}
if (confirm("确认转账吗?")) {
$.ajax({
type: "post",
url: "/admin/withdraw/transfer.action",
//data: $('#withdrawForm').serialize(),
data: { id: id },
dataType: "json",
success: function (json) {
console.log(json);
if (json.success == 'true') {
$("#tipMsg").text("已转账成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("转账失败[withdrawId=" + id + "]: " + json.msg);
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
}
},
error: function (json) {
if (json.status == 200) {
var result = JSON.parse(json.responseText.replace(/\n/, ""));
console.log(result);
if (result.success == 'true') {
$("#tipMsg").text("已转账成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("转账失败[withdrawId=" + id + "]: " + result.msg);
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
}
}
}
});
}
});
// 转账
$("#table").on('click', '.opt-transfer-search', function () {
var id = $(this).attr("data-id");
if (id == 'undefined') {
$("#tipMsg").text("id参数有误");
$("#tipModal").modal('show');
return;
}
$.ajax({
type: "post",
url: "/admin/withdraw/transfer/search.action",
data: { id: id },
dataType: "json",
success: function (json) {
console.log(json);
if (json.success == 'true') {
$("#tipMsg").text("查询成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("查询失败[withdrawId=" + id + "]: " + json.msg);
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
}
}
});
});
// 批量转账
$('#btnMultiTransfer').on('click', function () {
var rows = $("#table").bootstrapTable("getSelections");
if (rows.length == 0) {
alert("请先选择要转账的记录");
return;
}
var idArr = [];
for (var i = 0; i < rows.length; i++) {
idArr.push(rows[i]['id']);
}
if (confirm("你确认批量转账吗?")) {
$.ajax({
type: 'post',
url: "/admin/withdraw/batchTransfer.action",
data: { 'ids': JSON.stringify(idArr) },
dataType: "json",
success: function (json) {
if (json.success == 'true') {
$("#tipMsg").text("已批量转账成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("操作失败" + json.msg);
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
}
}
});
}
});
// 批量驳回
$('#btnMultiReject').on('click', function () {
var rows = $("#table").bootstrapTable("getSelections");
if (rows.length == 0) {
alert("请先选择要驳回的记录");
return;
}
var idArr = [];
for (var i = 0; i < rows.length; i++) {
idArr.push(rows[i]['id']);
}
if (confirm("你确认批量驳回吗?")) {
$.ajax({
type: 'post',
url: "/admin/withdraw/batchReject",
data: { 'ids': JSON.stringify(idArr) },
dataType: "json",
success: function (json) {
if (json.success == 'true') {
$("#tipMsg").text("已批量驳回成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("操作失败" + json.msg);
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
}
}
});
}
});
// 驳回申请
$("#table").on("click", '.opt-reject', function () {
var id = $(this).attr("data-id");
$("#withdrawId").val(id);
$("#remark").val("");
$("#withdrawModal").modal('show');
});
$("#reject").click(function () {
var withdrawId = $('#withdrawId').val();
var remark = $('#remark').val();
if ($("#rejectForm").validationEngine('validate')) {
$.ajax({
type: "post",
url: "/admin/withdraw/reject.action",
//data: $('#rejectForm').serialize(),
data: { withdrawId: withdrawId, remark: remark },
dataType: "json",
success: function (json) {
if (json.success == 'true') {
$("#tipMsg").text("保存成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
$("#withdrawModal").modal('hide');
} else {
$("#tipMsg").text("保存失败." + json.msg);
$("#tipModal").modal('show');
}
}
});
}
});
});
}
},
};
</script>
<style scoped></style>