优化导出数据
This commit is contained in:
parent
c44e292747
commit
07558b9594
@ -34,7 +34,7 @@
|
||||
layui.pageTable = table.render({
|
||||
elem: '#test',
|
||||
title: '文章列表',
|
||||
toolbar: '#toolbarDemo',
|
||||
defaultToolbar: false,
|
||||
url: "/article/index/index", //数据接口
|
||||
cellMinWidth: 360,
|
||||
page: true, //开启分页
|
||||
|
@ -46,6 +46,7 @@
|
||||
elem: '#test',
|
||||
title: '文章列表',
|
||||
toolbar: '#toolbarDemo',
|
||||
defaultToolbar: false,
|
||||
url: "/article/index/list", //数据接口
|
||||
cellMinWidth: 300,
|
||||
page: true, //开启分页
|
||||
|
@ -47,6 +47,7 @@
|
||||
elem: '#document',
|
||||
title: '文档列表',
|
||||
toolbar: '#toolbarDemo',
|
||||
defaultToolbar: false,
|
||||
cellMinWidth: 240,
|
||||
url: "/project/document/index",
|
||||
page: true, //开启分页
|
||||
|
@ -21,8 +21,9 @@
|
||||
layui.pageTable = table.render({
|
||||
elem: '#projectList',
|
||||
toolbar: '#toolbarDemo',
|
||||
defaultToolbar:['filter', {title:'导出EXCEL',layEvent: 'LAYTABLE_EXCEL',icon: 'layui-icon-export'}],
|
||||
title: '项目列表',
|
||||
cellMinWidth: 220,
|
||||
cellMinWidth: 80,
|
||||
page: true, //开启分页
|
||||
limit: 20,
|
||||
height: 'full-24',
|
||||
@ -59,12 +60,20 @@
|
||||
|
||||
//触发事件
|
||||
table.on('toolbar(project)', function(obj){
|
||||
var checkStatus = table.checkStatus(obj.config.id);
|
||||
switch(obj.event){
|
||||
case 'add':
|
||||
tool.side('/project/index/add');
|
||||
break;
|
||||
};
|
||||
if(obj.event === 'LAYTABLE_EXCEL'){
|
||||
$.ajax({
|
||||
url: '/project/index/index',
|
||||
data: {limit:99999},
|
||||
success:function(res){
|
||||
table.exportFile('projectList', res.data,'xls');
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
else if(obj.event === 'add'){
|
||||
tool.side('/project/index/add');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
@ -10,7 +10,7 @@
|
||||
{block name="body"}
|
||||
<div id="taskList" class="p-3">
|
||||
<div class="gg-form-bar border-t border-x">
|
||||
<form id="taskForm" class="layui-form">
|
||||
<form id="taskForm" class="layui-form" lay-filter="barsearchform">
|
||||
<div class="layui-input-inline" style="width:100px;">
|
||||
<select name="flow_status" lay-filter="status">
|
||||
<option value="">任务状态</option>
|
||||
@ -80,7 +80,8 @@
|
||||
elem: '#task',
|
||||
title: '任务列表',
|
||||
toolbar: '#toolbarDemo',
|
||||
cellMinWidth: 200,
|
||||
defaultToolbar:['filter', {title:'导出EXCEL',layEvent: 'LAYTABLE_EXCEL',icon: 'layui-icon-export'}],
|
||||
cellMinWidth: 80,
|
||||
url: "/project/task/index", //数据接口
|
||||
page: true, //开启分页
|
||||
limit: 20,
|
||||
@ -144,12 +145,22 @@
|
||||
|
||||
//触发事件
|
||||
table.on('toolbar(task)', function(obj){
|
||||
var checkStatus = table.checkStatus(obj.config.id);
|
||||
switch(obj.event){
|
||||
case 'add':
|
||||
tool.side('/project/task/add');
|
||||
break;
|
||||
};
|
||||
if(obj.event === 'LAYTABLE_EXCEL'){
|
||||
var formSelect = form.val('barsearchform');
|
||||
formSelect.limit=99999;
|
||||
$.ajax({
|
||||
url: '/project/task/index',
|
||||
data: formSelect,
|
||||
success:function(res){
|
||||
table.exportFile('task', res.data,'xls');
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
else if(obj.event === 'add'){
|
||||
tool.side('/project/task/add');
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
//查看模式
|
||||
|
@ -7,7 +7,7 @@
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
<div class="p-3">
|
||||
<form class="layui-form gg-form-bar border-x border-t">
|
||||
<form class="layui-form gg-form-bar border-x border-t" lay-filter="barsearchform">
|
||||
<div id="barDate" class="layui-input-inline">
|
||||
<div class="layui-input-inline" style="width:120px;">
|
||||
<input type="text" class="layui-input" id="start_time" placeholder="选择时间区间" readonly name="start_time">
|
||||
@ -79,11 +79,13 @@
|
||||
layui.scheduleTable = table.render({
|
||||
elem: '#test'
|
||||
,toolbar: '#toolbarDemo'
|
||||
,defaultToolbar:['filter', {title:'导出EXCEL',layEvent: 'LAYTABLE_EXCEL',icon: 'layui-icon-export'}]
|
||||
,title:'工时列表'
|
||||
,url: "/project/task/task_time"
|
||||
,page: true //开启分页
|
||||
,limit: 20
|
||||
,cellMinWidth: 80
|
||||
,height: 'full-88'
|
||||
,cols: [[ //表头
|
||||
{field: 'id', title: '序号',fixed: 'left', width:80, align:'center'}
|
||||
,{field: 'labor_type_string', title: '工作类型', align:'center',width:90,templet:function(d){
|
||||
@ -119,6 +121,22 @@
|
||||
}}
|
||||
]]
|
||||
});
|
||||
|
||||
//触发事件
|
||||
table.on('toolbar(test)', function(obj){
|
||||
if(obj.event === 'LAYTABLE_EXCEL'){
|
||||
var formSelect = form.val('barsearchform');
|
||||
formSelect.limit=99999;
|
||||
$.ajax({
|
||||
url: '/project/task/task_time',
|
||||
data: formSelect,
|
||||
success:function(res){
|
||||
table.exportFile('test', res.data,'xls');
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
//更改工时
|
||||
table.on('tool(test)', function(obj){
|
||||
|
Loading…
x
Reference in New Issue
Block a user