From 00a6c8af1df361cf3e4ad1ba75ddcb0de32d5a30 Mon Sep 17 00:00:00 2001 From: liaozetao <1107136310@qq.com> Date: Mon, 16 Oct 2023 15:43:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=86=99=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../treasure/SeizeTreasurePoolItemView.vue | 254 +++++++++--------- 1 file changed, 127 insertions(+), 127 deletions(-) diff --git a/src/views/treasure/SeizeTreasurePoolItemView.vue b/src/views/treasure/SeizeTreasurePoolItemView.vue index 803f8df..f0cf341 100644 --- a/src/views/treasure/SeizeTreasurePoolItemView.vue +++ b/src/views/treasure/SeizeTreasurePoolItemView.vue @@ -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 ''; } - 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 ''; - } + 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');