修改写法
This commit is contained in:
@@ -163,9 +163,6 @@ export default {
|
||||
setup() {
|
||||
return {};
|
||||
},
|
||||
beforeCreate() {
|
||||
$('#toolbar').remove();
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(function () {
|
||||
this.initTable();
|
||||
@@ -177,139 +174,142 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
initTable() {
|
||||
$('#table').bootstrapTable('destroy');
|
||||
$('#table').bootstrapTable({
|
||||
columns: [
|
||||
{
|
||||
field: 'poolType',
|
||||
title: '奖池类型',
|
||||
align: 'center',
|
||||
width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
var value = '';
|
||||
if (val == '1') {
|
||||
value = '密藏奖池';
|
||||
} else if (val == '2') {
|
||||
value = '幸运值奖池';
|
||||
} else if (val == '3') {
|
||||
value = '森林奖池';
|
||||
} else if (val == '4') {
|
||||
value = '合成奖池';
|
||||
$(function () {
|
||||
$('#table').bootstrapTable('destroy');
|
||||
$('#table').bootstrapTable({
|
||||
columns: [
|
||||
{
|
||||
field: 'poolType',
|
||||
title: '奖池类型',
|
||||
align: 'center',
|
||||
width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
var value = '';
|
||||
if (val == '1') {
|
||||
value = '密藏奖池';
|
||||
} else if (val == '2') {
|
||||
value = '幸运值奖池';
|
||||
} else if (val == '3') {
|
||||
value = '森林奖池';
|
||||
} else if (val == '4') {
|
||||
value = '合成奖池';
|
||||
}
|
||||
return value;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'poolGroup',
|
||||
title: '奖池分组',
|
||||
align: 'center',
|
||||
width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
var value = '';
|
||||
if (val == '1') {
|
||||
value = '基础奖池';
|
||||
} else if (val == '2') {
|
||||
value = '高级奖池';
|
||||
},
|
||||
{
|
||||
field: 'poolGroup',
|
||||
title: '奖池分组',
|
||||
align: 'center',
|
||||
width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
var value = '';
|
||||
if (val == '1') {
|
||||
value = '基础奖池';
|
||||
} else if (val == '2') {
|
||||
value = '高级奖池';
|
||||
}
|
||||
return value;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'poolLevel',
|
||||
title: '奖池等级',
|
||||
align: 'center',
|
||||
width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
var value = '';
|
||||
if (val == '1') {
|
||||
value = '基础奖池';
|
||||
} else if (val == '2') {
|
||||
value = '中级奖池';
|
||||
} else if (val == '3') {
|
||||
value = '高级奖池';
|
||||
},
|
||||
{
|
||||
field: 'poolLevel',
|
||||
title: '奖池等级',
|
||||
align: 'center',
|
||||
width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
var value = '';
|
||||
if (val == '1') {
|
||||
value = '基础奖池';
|
||||
} else if (val == '2') {
|
||||
value = '中级奖池';
|
||||
} else if (val == '3') {
|
||||
value = '高级奖池';
|
||||
}
|
||||
return value;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
},
|
||||
{ field: 'rewardName', title: '奖品名称', align: 'center', width: '5%' },
|
||||
{ field: 'rewardValue', title: '平台价值', align: 'center', width: '5%' },
|
||||
{ field: 'rewardShowValue', title: '平台展示价值', align: 'center', width: '5%' },
|
||||
{ field: 'poolNum', title: '个数', align: 'center', width: '5%' },
|
||||
{
|
||||
field: 'totalRewardValue',
|
||||
title: '总价值',
|
||||
align: 'center',
|
||||
width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
return row.rewardValue * row.poolNum;
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'ratio',
|
||||
title: '概率',
|
||||
align: 'center',
|
||||
width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
let value = 0;
|
||||
if (val) {
|
||||
value = (val / 1000000 * 100).toFixed(4);
|
||||
},
|
||||
{ field: 'rewardName', title: '奖品名称', align: 'center', width: '5%' },
|
||||
{ field: 'rewardValue', title: '平台价值', align: 'center', width: '5%' },
|
||||
{ field: 'rewardShowValue', title: '平台展示价值', align: 'center', width: '5%' },
|
||||
{ field: 'poolNum', title: '个数', align: 'center', width: '5%' },
|
||||
{
|
||||
field: 'totalRewardValue',
|
||||
title: '总价值',
|
||||
align: 'center',
|
||||
width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
return row.rewardValue * row.poolNum;
|
||||
}
|
||||
return value + '%';
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'showRatio',
|
||||
title: '展示概率',
|
||||
align: 'center',
|
||||
width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
let value = 0;
|
||||
if (val) {
|
||||
value = (val / 1000 * 100).toFixed(4);
|
||||
},
|
||||
{
|
||||
field: 'ratio',
|
||||
title: '概率',
|
||||
align: 'center',
|
||||
width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
let value = 0;
|
||||
if (val) {
|
||||
value = (val / 1000000 * 100).toFixed(4);
|
||||
}
|
||||
return value + '%';
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'showRatio',
|
||||
title: '展示概率',
|
||||
align: 'center',
|
||||
width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
let value = 0;
|
||||
if (val) {
|
||||
value = (val / 1000 * 100).toFixed(4);
|
||||
}
|
||||
return value + '%';
|
||||
}
|
||||
},
|
||||
{ field: 'itemIndex', title: '显示位置', align: 'center', width: '5%' },
|
||||
{ field: 'itemOrder', title: '排序', align: 'center', width: '5%' },
|
||||
{
|
||||
field: 'handle',
|
||||
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>';
|
||||
}
|
||||
return value + '%';
|
||||
}
|
||||
],
|
||||
cache: false,
|
||||
striped: true,
|
||||
showRefresh: false,
|
||||
pageSize: 20,
|
||||
pagination: true,
|
||||
pageList: [20, 50, 100],
|
||||
search: false,
|
||||
sidePagination: "server",
|
||||
queryParamsType: "undefined",
|
||||
queryParams: function queryParams(params) {
|
||||
var param = {
|
||||
page: params.pageNumber,
|
||||
pageSize: params.pageSize,
|
||||
poolType: 1,
|
||||
poolGroup: $('#searchPoolGroup').val(),
|
||||
};
|
||||
return param;
|
||||
},
|
||||
{ field: 'itemIndex', title: '显示位置', align: 'center', width: '5%' },
|
||||
{ field: 'itemOrder', title: '排序', align: 'center', width: '5%' },
|
||||
{
|
||||
field: 'handle',
|
||||
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>';
|
||||
}
|
||||
toolbar: '#toolbar',
|
||||
url: '/admin/seize-treasure/pool/item/page',
|
||||
onLoadSuccess: function () {
|
||||
console.log("load success");
|
||||
},
|
||||
onLoadError: function () {
|
||||
console.log("load fail");
|
||||
}
|
||||
],
|
||||
cache: false,
|
||||
striped: true,
|
||||
showRefresh: false,
|
||||
pageSize: 20,
|
||||
pagination: true,
|
||||
pageList: [20, 50, 100],
|
||||
search: false,
|
||||
sidePagination: "server",
|
||||
queryParamsType: "undefined",
|
||||
queryParams: function queryParams(params) {
|
||||
var param = {
|
||||
page: params.pageNumber,
|
||||
pageSize: params.pageSize,
|
||||
poolType: 1,
|
||||
poolGroup: $('#searchPoolGroup').val(),
|
||||
};
|
||||
return param;
|
||||
},
|
||||
toolbar: '#toolbar',
|
||||
url: '/admin/seize-treasure/pool/item/page',
|
||||
onLoadSuccess: function () {
|
||||
console.log("load success");
|
||||
},
|
||||
onLoadError: function () {
|
||||
console.log("load fail");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
},
|
||||
btnSearch() {
|
||||
TableHelper.doRefresh('#table');
|
||||
|
Reference in New Issue
Block a user