From 1c3c68d3dc45e4d519088de17001284858de5eb9 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期六, 06 六月 2020 10:50:02 +0800
Subject: [PATCH] #导出
---
src/main/webapp/static/js/matCode/matCode.js | 65 ++++++++++++++------------------
1 files changed, 29 insertions(+), 36 deletions(-)
diff --git a/src/main/webapp/static/js/matCode/matCode.js b/src/main/webapp/static/js/matCode/matCode.js
index ee89ed4..a5b5337 100644
--- a/src/main/webapp/static/js/matCode/matCode.js
+++ b/src/main/webapp/static/js/matCode/matCode.js
@@ -169,44 +169,23 @@
});
}
break;
+ // 瀵煎嚭
case 'exportData':
- layer.confirm('纭畾瀵煎嚭Excel鍚�', function(){
- var titles=[];
- var fields=[];
- obj.config.cols[0].map(function (col) {
- if (col.type === 'normal' && col.hide === false && col.toolbar == null) {
- titles.push(col.title);
- fields.push(col.field);
- }
- });
- var exportData = {};
- $.each($('#search-box [name]').serializeArray(), function() {
- exportData[this.name] = this.value;
- });
- var param = {
- 'matCode': exportData,
- 'fields': fields
- };
- $.ajax({
- url: baseUrl+"/matCode/export/auth",
- headers: {'token': localStorage.getItem('token')},
- data: JSON.stringify(param),
- dataType:'json',
- contentType:'application/json;charset=UTF-8',
- method: 'POST',
- success: function (res) {
- layer.closeAll();
- if (res.code === 200) {
- table.exportFile(titles,res.data,'xls');
- } else if (res.code === 403) {
- top.location.href = baseUrl;
- } else {
- layer.msg(res.msg)
- }
- }
- });
- });
+ layer.open({
+ type: 1,
+ title: '鏁版嵁瀵煎嚭',
+ shadeClose: true,
+ content: $('#exportDataDiv'),
+ success: function(layero, index){
+
+ },
+ end: function () {
+ $("#exportFileName").val("");
+ $("#exportRowCount").val("");
+ }
+ })
break;
+ // 瀵煎叆
case 'intoData':
layer.open({
type: 1,
@@ -215,12 +194,26 @@
content: $('#importDataDiv'),
success: function(layero, index){
uploader.reload();
+ },
+ end: function () {
+ $('#uploadDesc').show();
+ $('#uploadDemoView').hide();
+ $('#fileMame').html("");
}
});
break;
}
});
+ // 瀵煎嚭excel
+ form.on('submit(exportDo)', function(data) {
+ layer.closeAll();
+ layer.load(1, {shade: [0.1,'#fff']});
+ location.href = baseUrl + "/matCode/export/auth?fileName="+$("#exportFileName").val()+"&rowCount="+$("#exportRowCount").val();
+ layer.closeAll('loading');
+ return false;
+ });
+
// 瀵煎叆excel
var uploader = upload.render({
elem: '#uploadEx'
--
Gitblit v1.9.1