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