修改模板 动表头前备份
This commit is contained in:
@ -106,8 +106,8 @@
|
||||
</div>
|
||||
|
||||
</form>
|
||||
<form class="layui-form" style="height:100%;width:100%" id="tablepanel">
|
||||
<div class="layui-panel" id="gridpanel" >
|
||||
<form class="layui-form" style="height:100%;width:100%;" id="tablepanel">
|
||||
<div class="layui-panel" id="gridpanel" style="height:100%;width:100%;overflow:scroll;">
|
||||
<div id="result"></div>
|
||||
</div>
|
||||
</form>
|
||||
@ -124,9 +124,10 @@
|
||||
</script>
|
||||
<script>
|
||||
|
||||
layui.use(["layer", "laytpl", "element", "form", "slider", "laydate", "rate", "colorpicker", "carousel", "upload", "formField", "numberInput", "iconPicker", "cron", "labelGeneration"],
|
||||
layui.use(["table", "layer", "laytpl", "element", "form", "slider", "laydate", "rate", "colorpicker", "carousel", "upload", "formField", "numberInput", "iconPicker", "cron", "labelGeneration"],
|
||||
function () {
|
||||
var $ = layui.jquery,
|
||||
table = layui.table,
|
||||
layer = layui.layer,
|
||||
laytpl = layui.laytpl,
|
||||
setter = layui.cache,
|
||||
@ -355,37 +356,41 @@
|
||||
|
||||
// 合并单元格
|
||||
handler.mergeTable(workbook, true);
|
||||
staticToLayTable();
|
||||
completeLoading();
|
||||
},
|
||||
|
||||
// csv 数据转换为 table
|
||||
csv2table(csv, showTab = false) {
|
||||
var html = "<table class=\"layui-table\" lay-even=\"\" lay-skin=\"row\">";
|
||||
var html = "<table lay-filter = \"tdemo\" class=\"layui-table\" lay-even=\"\" lay-skin=\"row\">";
|
||||
var rows = csv.split("\n");
|
||||
debugger;
|
||||
rows.pop(); // 最后一行没用的
|
||||
html += "<tbody>";
|
||||
rows.forEach(function (row, idx) {
|
||||
var columns = row.split(",");
|
||||
if (showTab) {
|
||||
columns.unshift(idx + 1); // 添加行索引
|
||||
if (idx == 0) {
|
||||
// 添加列索引
|
||||
html += "<tr>";
|
||||
for (var i = 0; i < columns.length; i++) {
|
||||
html +=
|
||||
"<th>" +
|
||||
//(i == 0 ? "" : String.fromCharCode(65 + i - 1)) +
|
||||
(i == 0 ? "" : i.toString()) +
|
||||
"</th>";
|
||||
}
|
||||
html += "</tr>";
|
||||
}
|
||||
}
|
||||
//if (showTab) {
|
||||
// columns.unshift(idx + 1); // 添加行索引
|
||||
// if (idx == 0) {
|
||||
// // 添加列索引
|
||||
// html += "<tr>";
|
||||
// for (var i = 1; i < columns.length; i++) {
|
||||
// html +=
|
||||
// "<th>" +
|
||||
// //(i == 0 ? "" : String.fromCharCode(65 + i - 1)) +
|
||||
// (i == 0 ? "" : i.toString()) +
|
||||
// "</th>";
|
||||
// }
|
||||
// html += "</tr>";
|
||||
// }
|
||||
//}
|
||||
html += "<tr>";
|
||||
columns.forEach(function (column) {
|
||||
html += "<td align=center>" + column + "</td>";
|
||||
});
|
||||
html += "</tr>";
|
||||
});
|
||||
html += "</tbody>";
|
||||
html += "</table>";
|
||||
return html;
|
||||
},
|
||||
@ -402,11 +407,11 @@
|
||||
let baiseAdd = hasTab ? 1 : 0;
|
||||
|
||||
mergeInfo.forEach((item) => {
|
||||
let start_r = item.s.r + baiseAdd;
|
||||
let end_r = item.e.r + baiseAdd;
|
||||
let start_r = item.s.r + baiseAdd-1;
|
||||
let end_r = item.e.r + baiseAdd-1;
|
||||
|
||||
let start_c = item.s.c + baiseAdd;
|
||||
let end_c = item.e.c + baiseAdd;
|
||||
let start_c = item.s.c + baiseAdd-1;
|
||||
let end_c = item.e.c + baiseAdd-1;
|
||||
|
||||
for (let i = start_r; i <= end_r; i++) {
|
||||
let row = document.querySelectorAll("#result tr")[i];
|
||||
@ -438,6 +443,18 @@
|
||||
}
|
||||
};
|
||||
|
||||
function staticToLayTable()
|
||||
{
|
||||
var table = layui.table;
|
||||
|
||||
//转换静态表格
|
||||
table.init('tdemo', {
|
||||
//height: 315 //设置高度
|
||||
//, limit: 10 //注意:请务必确保 limit 参数(默认:10)是与你服务端限定的数据条数一致
|
||||
//支持所有基础参数
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function dataURLToFile(dataUrl, fileName) {
|
||||
const dataArr = dataUrl.split(',');
|
||||
|
BIN
HT.Cloud.Web/wwwroot/report/Report20230322154508.xlsx
Normal file
BIN
HT.Cloud.Web/wwwroot/report/Report20230322154508.xlsx
Normal file
Binary file not shown.
BIN
HT.Cloud.Web/wwwroot/report/Report20230322154541.xlsx
Normal file
BIN
HT.Cloud.Web/wwwroot/report/Report20230322154541.xlsx
Normal file
Binary file not shown.
BIN
HT.Cloud.Web/wwwroot/report/Report20230322154920.xlsx
Normal file
BIN
HT.Cloud.Web/wwwroot/report/Report20230322154920.xlsx
Normal file
Binary file not shown.
BIN
HT.Cloud.Web/wwwroot/report/Report20230322155021.xlsx
Normal file
BIN
HT.Cloud.Web/wwwroot/report/Report20230322155021.xlsx
Normal file
Binary file not shown.
BIN
HT.Cloud.Web/wwwroot/report/Report20230323104713.xlsx
Normal file
BIN
HT.Cloud.Web/wwwroot/report/Report20230323104713.xlsx
Normal file
Binary file not shown.
BIN
HT.Cloud.Web/wwwroot/report/Report20230323104757.xlsx
Normal file
BIN
HT.Cloud.Web/wwwroot/report/Report20230323104757.xlsx
Normal file
Binary file not shown.
BIN
HT.Cloud.Web/wwwroot/report/Report20230323105032.xlsx
Normal file
BIN
HT.Cloud.Web/wwwroot/report/Report20230323105032.xlsx
Normal file
Binary file not shown.
BIN
HT.Cloud.Web/wwwroot/report/Report20230323105506.xlsx
Normal file
BIN
HT.Cloud.Web/wwwroot/report/Report20230323105506.xlsx
Normal file
Binary file not shown.
BIN
HT.Cloud.Web/wwwroot/report/Report20230323105527.xlsx
Normal file
BIN
HT.Cloud.Web/wwwroot/report/Report20230323105527.xlsx
Normal file
Binary file not shown.
BIN
HT.Cloud.Web/wwwroot/report/Report20230323105608.xlsx
Normal file
BIN
HT.Cloud.Web/wwwroot/report/Report20230323105608.xlsx
Normal file
Binary file not shown.
BIN
HT.Cloud.Web/wwwroot/report/Report20230323110004.xlsx
Normal file
BIN
HT.Cloud.Web/wwwroot/report/Report20230323110004.xlsx
Normal file
Binary file not shown.
BIN
HT.Cloud.Web/wwwroot/report/Report20230323110439.xlsx
Normal file
BIN
HT.Cloud.Web/wwwroot/report/Report20230323110439.xlsx
Normal file
Binary file not shown.
BIN
HT.Cloud.Web/wwwroot/report/Report20230323111301.xlsx
Normal file
BIN
HT.Cloud.Web/wwwroot/report/Report20230323111301.xlsx
Normal file
Binary file not shown.
BIN
HT.Cloud.Web/wwwroot/report/Report20230323111342.xlsx
Normal file
BIN
HT.Cloud.Web/wwwroot/report/Report20230323111342.xlsx
Normal file
Binary file not shown.
BIN
HT.Cloud.Web/wwwroot/report/Report20230323111754.xlsx
Normal file
BIN
HT.Cloud.Web/wwwroot/report/Report20230323111754.xlsx
Normal file
Binary file not shown.
BIN
HT.Cloud.Web/wwwroot/report/Report20230323111814.xlsx
Normal file
BIN
HT.Cloud.Web/wwwroot/report/Report20230323111814.xlsx
Normal file
Binary file not shown.
BIN
HT.Cloud.Web/wwwroot/report/Report20230323112519.xlsx
Normal file
BIN
HT.Cloud.Web/wwwroot/report/Report20230323112519.xlsx
Normal file
Binary file not shown.
BIN
HT.Cloud.Web/wwwroot/report/Report20230323112610.xlsx
Normal file
BIN
HT.Cloud.Web/wwwroot/report/Report20230323112610.xlsx
Normal file
Binary file not shown.
BIN
HT.Cloud.Web/wwwroot/report/Report20230323134220.xlsx
Normal file
BIN
HT.Cloud.Web/wwwroot/report/Report20230323134220.xlsx
Normal file
Binary file not shown.
BIN
HT.Cloud.Web/wwwroot/report/Report20230323134313.xlsx
Normal file
BIN
HT.Cloud.Web/wwwroot/report/Report20230323134313.xlsx
Normal file
Binary file not shown.
BIN
HT.Cloud.Web/wwwroot/report/Report20230323134359.xlsx
Normal file
BIN
HT.Cloud.Web/wwwroot/report/Report20230323134359.xlsx
Normal file
Binary file not shown.
BIN
HT.Cloud.Web/wwwroot/report/Report20230323135035.xlsx
Normal file
BIN
HT.Cloud.Web/wwwroot/report/Report20230323135035.xlsx
Normal file
Binary file not shown.
Binary file not shown.
BIN
HT.Cloud.Web/wwwroot/report/报表预设模板带厂名.xlsx
Normal file
BIN
HT.Cloud.Web/wwwroot/report/报表预设模板带厂名.xlsx
Normal file
Binary file not shown.
Reference in New Issue
Block a user