Skip to content

Commit

Permalink
修复数据表格点击重置按钮后不按类型加载数据问题和添加刷新按钮 (#281)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaohu2002 authored Jan 19, 2025
1 parent 8447768 commit f37e79c
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 10 deletions.
17 changes: 14 additions & 3 deletions admin/systemlog/template/lyear/list.htm
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
<table class="layui-hide" id="table" lay-filter="table"></table>
<script type="text/html" id="toolbar">
<div class="layui-btn-container">
<button type="button" class="layui-btn layui-btn-normal" lay-event="getCheckData">获取选中行数据</button>
<button type="button" class="layui-btn layui-btn-normal" lay-event="getCheckData">获取选中行数据</button>
<button type="button" class="layui-btn layui-btn-normal" lay-event="get">刷新</button>
</div>
</script>
<script type="text/html" id="barDemo">
Expand All @@ -44,12 +45,14 @@
</main>
<script src="static/lyear/js/layui/layui.js"></script>
<script>
var operation = '{$_GET['operation']}';
layui.use('table', function(){
var table = layui.table;
table.render({
elem: '#table',
url: '{MOD_URL}&do=getinfo',
toolbar: '#toolbar',
where: {operation: operation},
title: '系统日志数据表格',
text: {
none: '暂无相关数据'
Expand Down Expand Up @@ -111,6 +114,14 @@
btn: ['确定']
});
break;
case 'get':
layui.table.reload('table', {
where: {operation: operation}, // 清空搜索参数
page: {
curr: 1 //重新从第 1 页开始
}
});
break;
};
});
//监听工具条
Expand Down Expand Up @@ -165,7 +176,7 @@
$('#keyword').val('');
// 刷新表格
table.reload('table', {
where: {}, // 清空搜索参数
where: {operation: operation}, // 清空搜索参数
page: {
curr: 1 //重新从第 1 页开始
}
Expand All @@ -178,7 +189,7 @@
// 为当前点击的按钮添加 active 类
$(this).addClass('active');
// 获取当前的 type 值
operation = $(this).data('operation');
operation = $(this).data('operation');
$('#keyword').val('');
// 刷新表格并传递 operation 参数
table.reload('table', {
Expand Down
2 changes: 1 addition & 1 deletion core/core_version.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
if(!defined('CORE_VERSION')) {
define('CORE_VERSION', '2.3.2');
define('CORE_RELEASE', '20250101');
define('CORE_FIXBUG' , '21000000');
define('CORE_FIXBUG' , '23200000');
}
14 changes: 12 additions & 2 deletions dzz/comment/template/list.htm
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<div class="layui-btn-container">
<button type="button" class="layui-btn layui-btn-normal" lay-event="getCheckData">获取选中行数据</button>
<button type="button" class="layui-btn layui-btn-danger" lay-event="delete">{lang delete}</button>
<button type="button" class="layui-btn layui-btn-normal" lay-event="get">刷新</button>
</div>
</script>
<script type="text/html" id="barDemo">
Expand All @@ -44,6 +45,7 @@
</main>
<script src="static/lyear/js/layui/layui.js"></script>
<script>
var type = '';
layui.use('table', function(){
var table = layui.table;
table.render({
Expand Down Expand Up @@ -160,6 +162,14 @@
});
});
break;
case 'get':
layui.table.reload('table', {
where: {type: type}, // 清空搜索参数
page: {
curr: 1 //重新从第 1 页开始
}
});
break;
};
});
//监听工具条
Expand Down Expand Up @@ -250,7 +260,7 @@
$('#keyword').val('');
// 刷新表格
table.reload('table', {
where: {}, // 清空搜索参数
where: {type: type}, // 清空搜索参数
page: {
curr: 1 //重新从第 1 页开始
}
Expand All @@ -268,7 +278,7 @@
type = $(this).data('type');
// 刷新表格并传递 operation 参数
table.reload('table', {
where: {type: type },
where: {type: type},
page: {
curr: 1 //重新从第 1 页开始
}
Expand Down
12 changes: 11 additions & 1 deletion dzz/filemanage/template/lyear/list.htm
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
<div class="layui-btn-container">
<button type="button" class="layui-btn layui-btn-normal" lay-event="getCheckData">获取选中行数据</button>
<button type="button" class="layui-btn layui-btn-danger" lay-event="delete">{lang delete}</button>
<button type="button" class="layui-btn layui-btn-normal" lay-event="get">刷新</button>
</div>
</script>
<script type="text/html" id="barDemo">
Expand All @@ -76,6 +77,7 @@
</main>
<script src="static/lyear/js/layui/layui.js"></script>
<script>
var type = '';
layui.use('table', function(){
var table = layui.table;
table.render({
Expand Down Expand Up @@ -201,6 +203,14 @@
});
});
break;
case 'get':
layui.table.reload('table', {
where: {type: type}, // 清空搜索参数
page: {
curr: 1 //重新从第 1 页开始
}
});
break;
};
});
//监听工具条
Expand Down Expand Up @@ -327,7 +337,7 @@
$('#orgid_{$org[orgid]}_Menu').text('$org[depart]');
// 刷新表格
table.reload('table', {
where: {}, // 清空搜索参数
where: {type: type}, // 清空搜索参数
page: {
curr: 1 //重新从第 1 页开始
}
Expand Down
16 changes: 13 additions & 3 deletions dzz/share/template/lyear/share.htm
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@
<table class="layui-hide" id="table" lay-filter="table"></table>
<script type="text/html" id="toolbar">
<div class="layui-btn-container">
<button type="button" class="layui-btn layui-btn-normal" lay-event="getCheckData">获取选中行数据</button>
<button type="button" class="layui-btn layui-btn-normal" lay-event="getCheckData">获取选中行数据</button>
<button type="button" class="layui-btn layui-btn-danger" lay-event="delete">{lang del_share}</button>
<!--{if $_G['adminid']}--><button type="button" class="layui-btn layui-bg-orange" lay-event="forbidden">{lang screen_share}</button>
<button type="button" class="layui-btn layui-bg-blue" lay-event="allow">{lang cancel_shielding}</button><!--{/if}-->
<button type="button" class="layui-btn layui-btn-normal" lay-event="get">刷新</button>
</div>
</script>
<script type="text/html" id="barDemo">
Expand All @@ -52,6 +53,7 @@
</main>
<script src="static/lyear/js/layui/layui.js"></script>
<script>
var type = '';
layui.use('table', function(){
var table = layui.table;
table.render({
Expand Down Expand Up @@ -235,6 +237,14 @@
});
});
break;
case 'get':
layui.table.reload('table', {
where: {type: type}, // 清空搜索参数
page: {
curr: 1 //重新从第 1 页开始
}
});
break;
};
});
//监听工具条
Expand Down Expand Up @@ -319,7 +329,7 @@
$('#keyword').val('');
// 刷新表格
table.reload('table', {
where: {}, // 清空搜索参数
where: {type: type}, // 清空搜索参数
page: {
curr: 1 //重新从第 1 页开始
}
Expand All @@ -338,7 +348,7 @@
type = $(this).data('type');
// 刷新表格并传递 operation 参数
table.reload('table', {
where: {type: type },
where: {type: type},
page: {
curr: 1 //重新从第 1 页开始
}
Expand Down

0 comments on commit f37e79c

Please sign in to comment.