补充5
This commit is contained in:
@@ -341,6 +341,125 @@ export default {
|
||||
}
|
||||
};
|
||||
main.init();
|
||||
|
||||
var isEdit = false;
|
||||
$('#table').bootstrapTable('destroy');
|
||||
$('#table').bootstrapTable({
|
||||
columns: [
|
||||
{ field: 'id', title: '编号', align: 'center', valign: 'middle', width: '10%' },
|
||||
{ field: 'prizeName', title: '奖品名称', align: 'center', valign: 'middle', width: '10%' },
|
||||
{
|
||||
field: 'prizeImgUrl', title: '奖品图片', align: 'center', valign: 'middle', width: '10%', formatter: function (val, row, index) {
|
||||
return '<img src="' + val + '" alt="" style="width: 30px; height: 30px;">';
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'prizeType', title: '奖品分类', align: 'center', valign: 'middle', width: '10%', formatter: function (val, row, index) {
|
||||
switch (val) {
|
||||
case 1:
|
||||
return '<p>金币</p>';
|
||||
|
||||
|
||||
case 2:
|
||||
return '<p>在线礼物</p>';
|
||||
|
||||
|
||||
case 3:
|
||||
return '<p>座驾</p>';
|
||||
|
||||
|
||||
case 4:
|
||||
return '<p>头饰</p>';
|
||||
|
||||
|
||||
case 5:
|
||||
return '<p>背景</p>';
|
||||
|
||||
|
||||
case 6:
|
||||
return '<p>实物</p>';
|
||||
|
||||
|
||||
case 7:
|
||||
return '<p>靓号</p>';
|
||||
|
||||
|
||||
case 15:
|
||||
return '<p>虚拟货币</p>';
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
{ field: 'prizeLevel', title: '奖品等级', align: 'center', valign: 'middle', width: '10%' },
|
||||
// {field: '', title: '现有奖品个数', align: 'center', valign: 'middle', width: '10%'},
|
||||
// {filed: '', title: '历史被抽中数量', align: 'center', valign: 'middle', width: '10%'},
|
||||
{ field: 'platformValue', title: '平台价值', align: 'center', valign: 'middle', width: '10%' },
|
||||
{ field: 'actualValue', title: '实际价值', align: 'center', valign: 'middle', width: '10%' },
|
||||
{
|
||||
field: 'tmp', title: '操作', align: 'center', valign: 'middle', width: '10%', formatter: function (val, row, index) {
|
||||
var key = row.id;
|
||||
var buttonStr = '';
|
||||
if (key == 0) {
|
||||
return '<button class="btn btn-primary btn -sm" disabled>编辑</button>'
|
||||
}
|
||||
if (row) {
|
||||
return '<button class="btn btn-primary btn-sm 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 giftKey = {
|
||||
'金币': 1,
|
||||
'在线礼物': 2,
|
||||
'座驾': 3,
|
||||
'头饰': 4,
|
||||
'背景': 5,
|
||||
'实体奖品': 6,
|
||||
'靓号': 7
|
||||
}
|
||||
var key = $('#prizeType').val();
|
||||
var param = {
|
||||
pageSize: params.pageSize,
|
||||
pageNumber: params.pageNumber,
|
||||
prizeName: $('#prizeName').val(),
|
||||
prizeType: giftKey[key],
|
||||
minPlatformValue: $('#priceStart').val(),
|
||||
maxPlatformValue: $('#priceEnd').val(),
|
||||
minActualValue: $('#actualStart').val(),
|
||||
maxActualValue: $('#actualEnd').val()
|
||||
};
|
||||
return param;
|
||||
},
|
||||
uniqueId: 'id',
|
||||
toolbar: '#toolbar',
|
||||
url: '/admin/prize/list',
|
||||
onLoadSuccess: function () {
|
||||
console.log('load success');
|
||||
},
|
||||
onLoadError: function () {
|
||||
console.log('load fail');
|
||||
}
|
||||
});
|
||||
|
||||
function clearModal() {
|
||||
$('#addForm').find('input[type=text],select,input[type=hidden]').each(function () {
|
||||
$(this).val('');
|
||||
});
|
||||
$('#addForm').find('img').attr('src', '');
|
||||
$('#addForm').find('.combobox-container').removeClass('combobox-selected');
|
||||
// $('#addForm').find('select option').attr('selected',false);
|
||||
|
||||
}
|
||||
|
||||
// 搜索按钮点击事件
|
||||
|
||||
$('#searchBtn').click(function () {
|
||||
@@ -767,126 +886,6 @@ export default {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
var isEdit = false;
|
||||
$('#table').bootstrapTable('destroy');
|
||||
$('#table').bootstrapTable({
|
||||
columns: [
|
||||
{ field: 'id', title: '编号', align: 'center', valign: 'middle', width: '10%' },
|
||||
{ field: 'prizeName', title: '奖品名称', align: 'center', valign: 'middle', width: '10%' },
|
||||
{
|
||||
field: 'prizeImgUrl', title: '奖品图片', align: 'center', valign: 'middle', width: '10%', formatter: function (val, row, index) {
|
||||
return '<img src="' + val + '" alt="" style="width: 30px; height: 30px;">';
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'prizeType', title: '奖品分类', align: 'center', valign: 'middle', width: '10%', formatter: function (val, row, index) {
|
||||
switch (val) {
|
||||
case 1:
|
||||
return '<p>金币</p>';
|
||||
|
||||
|
||||
case 2:
|
||||
return '<p>在线礼物</p>';
|
||||
|
||||
|
||||
case 3:
|
||||
return '<p>座驾</p>';
|
||||
|
||||
|
||||
case 4:
|
||||
return '<p>头饰</p>';
|
||||
|
||||
|
||||
case 5:
|
||||
return '<p>背景</p>';
|
||||
|
||||
|
||||
case 6:
|
||||
return '<p>实物</p>';
|
||||
|
||||
|
||||
case 7:
|
||||
return '<p>靓号</p>';
|
||||
|
||||
|
||||
case 15:
|
||||
return '<p>虚拟货币</p>';
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
{ field: 'prizeLevel', title: '奖品等级', align: 'center', valign: 'middle', width: '10%' },
|
||||
// {field: '', title: '现有奖品个数', align: 'center', valign: 'middle', width: '10%'},
|
||||
// {filed: '', title: '历史被抽中数量', align: 'center', valign: 'middle', width: '10%'},
|
||||
{ field: 'platformValue', title: '平台价值', align: 'center', valign: 'middle', width: '10%' },
|
||||
{ field: 'actualValue', title: '实际价值', align: 'center', valign: 'middle', width: '10%' },
|
||||
{
|
||||
field: 'tmp', title: '操作', align: 'center', valign: 'middle', width: '10%', formatter: function (val, row, index) {
|
||||
var key = row.id;
|
||||
var buttonStr = '';
|
||||
if (key == 0) {
|
||||
return '<button class="btn btn-primary btn -sm" disabled>编辑</button>'
|
||||
}
|
||||
if (row) {
|
||||
return '<button class="btn btn-primary btn-sm 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 giftKey = {
|
||||
'金币': 1,
|
||||
'在线礼物': 2,
|
||||
'座驾': 3,
|
||||
'头饰': 4,
|
||||
'背景': 5,
|
||||
'实体奖品': 6,
|
||||
'靓号': 7
|
||||
}
|
||||
var key = $('#prizeType').val();
|
||||
var param = {
|
||||
pageSize: params.pageSize,
|
||||
pageNumber: params.pageNumber,
|
||||
prizeName: $('#prizeName').val(),
|
||||
prizeType: giftKey[key],
|
||||
minPlatformValue: $('#priceStart').val(),
|
||||
maxPlatformValue: $('#priceEnd').val(),
|
||||
minActualValue: $('#actualStart').val(),
|
||||
maxActualValue: $('#actualEnd').val()
|
||||
};
|
||||
return param;
|
||||
},
|
||||
uniqueId: 'id',
|
||||
toolbar: '#toolbar',
|
||||
url: '/admin/prize/list',
|
||||
onLoadSuccess: function () {
|
||||
console.log('load success');
|
||||
},
|
||||
onLoadError: function () {
|
||||
console.log('load fail');
|
||||
}
|
||||
});
|
||||
|
||||
function clearModal() {
|
||||
$('#addForm').find('input[type=text],select,input[type=hidden]').each(function () {
|
||||
$(this).val('');
|
||||
});
|
||||
$('#addForm').find('img').attr('src', '');
|
||||
$('#addForm').find('.combobox-container').removeClass('combobox-selected');
|
||||
// $('#addForm').find('select option').attr('selected',false);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
Reference in New Issue
Block a user