在线Roll/angle

This commit is contained in:
cwchen 2025-12-23 16:21:56 +08:00
parent f93169984c
commit b68388963f
2 changed files with 133 additions and 46 deletions

View File

@ -2,7 +2,11 @@ var form, layer, table, tableIns,formSelects;
// 应用类别下拉选 // 应用类别下拉选
var baleNumList; var baleNumList;
var pageNum = 1, limitSize = 10; // 默认第一页分页数量为10 var pageNum = 1, limitSize = 10; // 默认第一页分页数量为10
const isOnline = localStorage.getItem("online");
layui.use(['form', 'layer', 'table', 'laydate'], function () { layui.use(['form', 'layer', 'table', 'laydate'], function () {
if(isOnline === '0'){
$('.baleNum').removeAttr('style');
}
form = layui.form; form = layui.form;
layer = layui.layer; layer = layui.layer;
table = layui.table; table = layui.table;
@ -71,6 +75,7 @@ layui.use(['form', 'layer', 'table', 'laydate'], function () {
$("#reset").click(function () { $("#reset").click(function () {
$("#baleNum").val(""); $("#baleNum").val("");
$("#operateTime").val(""); $("#operateTime").val("");
query();
form.render(); form.render();
}); });
}); });
@ -126,44 +131,7 @@ function initTable(dataList, limit, page) {
data: dataList, data: dataList,
limit: limit, limit: limit,
cols: [ cols: [
[ setTableField(page,limit)
{
title: order_number,
width: 180,
rowspan: 2,
unresize: true,
align: "center",
style: "word-break: break-all;",
templet: function (d) {
return (page - 1) * limit + d.LAY_INDEX + 1;
}
},
{ field: 'baleNum',width: 180,align: "center", title: packet_number,
templet: function (d) {
var html = '';
if(d.baleNum=="" || d.baleNum=="null" || d.baleNum==null){
return '';
}
html += "<a style='color: #3E689A;font-weight: bold;' onclick='getBaleNum("+d.baleNum+")'>"+d.baleNum+"</a>";
return html;
}
},
{ field: 'specification',width: 225,align: "center", title: specifications },
{ field: 'bambooMaxProportion', width: 240,align: "center",title: mean_curl_ratio },
{ field: 'bambooMinProportion',width: 240,align: "center", title: maximum_curl_ratio },
{ field: 'bambooAvgProportion',width: 240,align: "center", title: minimum_curl_ratio },
{ field: 'imgNum', width: 225,align: "center",title: photo_number,
templet: function (d) {
var html = '';
if(d.id=="" || d.imgNum=="" || d.imgNum=="null" || d.imgNum==null){
return '';
}
html += "<a style='color: #3E689A;font-weight: bold;' onclick='getImgNum("+d.id+")'>"+d.imgNum+"</a>";
return html;
}
},
{ field: 'createTime', width: 225,align: "center",title: test_date },
],
], ],
done: function (res, curr, count) { done: function (res, curr, count) {
layer.close(loadingMsg); layer.close(loadingMsg);
@ -174,6 +142,87 @@ function initTable(dataList, limit, page) {
}); });
} }
function setTableField(page,limit){
let cols = [];
if(isOnline === '0'){
cols = [
{
title: order_number,
width: 180,
rowspan: 2,
unresize: true,
align: "center",
style: "word-break: break-all;",
templet: function (d) {
return (page - 1) * limit + d.LAY_INDEX + 1;
}
},
{ field: 'baleNum',width: 180,align: "center", title: packet_number,
templet: function (d) {
var html = '';
if(d.baleNum=="" || d.baleNum=="null" || d.baleNum==null){
return '';
}
html += "<a style='color: #3E689A;font-weight: bold;' onclick='getBaleNum("+d.baleNum+")'>"+d.baleNum+"</a>";
return html;
}
},
{ field: 'specification',width: 225,align: "center", title: specifications },
{ field: 'bambooMaxProportion', width: 240,align: "center",title: mean_curl_ratio },
{ field: 'bambooMinProportion',width: 240,align: "center", title: maximum_curl_ratio },
{ field: 'bambooAvgProportion',width: 240,align: "center", title: minimum_curl_ratio },
{ field: 'imgNum', width: 225,align: "center",title: photo_number,
templet: function (d) {
var html = '';
if(d.id=="" || d.imgNum=="" || d.imgNum=="null" || d.imgNum==null){
return '';
}
html += "<a style='color: #3E689A;font-weight: bold;' onclick='getImgNum("+d.id+")'>"+d.imgNum+"</a>";
return html;
}
},
{ field: 'createTime', width: 225,align: "center",title: test_date },
]
}else{
cols = [
{
title: order_number,
width: '5%',
rowspan: 2,
unresize: true,
align: "center",
style: "word-break: break-all;",
templet: function (d) {
return (page - 1) * limit + d.LAY_INDEX + 1;
}
},
{ field: 'bambooMaxProportion',width: '15%',align: "center",title: mean_curl_ratio },
{ field: 'bambooMinProportion',width: '15%',align: "center", title: maximum_curl_ratio },
{ field: 'bambooAvgProportion',width: '15%',align: "center", title: minimum_curl_ratio },
{ field: 'imgNum', width: '20%',align: "center",title: photo_number,
templet: function (d) {
var html = '';
if(d.id=="" || d.imgNum=="" || d.imgNum=="null" || d.imgNum==null){
return '';
}
html += "<a style='color: #3E689A;font-weight: bold;' onclick='getImgNum("+d.id+")'>"+d.imgNum+"</a>";
return html;
}
},
{ field: 'createTime', width: '20%',align: "center",title: test_date },
{
title: operate,
width: '10%',
align: "center",
templet: function(d) {
return "<a style='color: #E70E4E;font-weight: bold;' onclick=\"delData('" + d.id + "')\">"+delete_button+"</a>";
}
}
]
}
return cols;
}
function getBaleNum(baleNum) { function getBaleNum(baleNum) {
var param = { var param = {
@ -250,4 +299,36 @@ function exportData() {
window.URL.revokeObjectURL(url) window.URL.revokeObjectURL(url)
}; };
xhr.send(); xhr.send();
}
/*删除数据*/
function delData(id) {
layer.confirm(delete_tip, {
move: false,
title:message, // 设置弹框标题
btn:([confirm, cancel]), // 设置按钮内容
}, function (index) {
// 在这里设置按钮内容和标题
let loadingMsg = layer.msg(delete_tip2, {icon: 16, scrollbar: false, time: 0});
let url = dataUrl + "/dayDefectRate/delTowsData";
let params = {
id
}
params={
encryptedData:encryptCBC(JSON.stringify(params))
}
ajaxRequest(url, "POST", params, true, function () {
}, function (result) {
layer.close(loadingMsg); // 关闭提示层
if (result.code === 200) {
parent.layer.msg(result.msg, {icon: 1})
reloadData();
} else if (result.code === 500) {
layer.alert(result.msg, {icon: 2})
}
}, function (xhr) {
layer.close(loadingMsg); // 关闭提示层
error(xhr)
});
})
} }

View File

@ -21,17 +21,14 @@
<form class="layui-form basic-form" onclick="return false;"> <form class="layui-form basic-form" onclick="return false;">
<div class="layui-form-item"> <div class="layui-form-item">
<div class="layui-inline" style="padding: 0 0 0 10px;"> <div class="layui-inline" style="padding: 0 0 0 10px;">
<div class="layui-input-inline"> <div class="layui-input-inline baleNum" style="display: none">
<select class="layui-select" id="baleNum" lay-search ></select> <select class="layui-select" id="baleNum" lay-search ></select>
</div> </div>
</div>
<div class="layui-inline"> <div class="layui-inline">
<div class="layui-input-inline"> <div class="layui-input-inline">
<input type="text" class="layui-input" id="operateTime" readonly th:placeholder="#{date_prompt}"> <input type="text" class="layui-input" id="operateTime" readonly th:placeholder="#{date_prompt}">
</div>
</div> </div>
</div> </div>
<div class="layui-inline btns"> <div class="layui-inline btns">
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm btn-1" onclick="query(1)">[[#{query_button}]] <button type="button" class="layui-btn layui-btn-normal layui-btn-sm btn-1" onclick="query(1)">[[#{query_button}]]
@ -90,6 +87,15 @@
let number_of_cuts=[[#{number_of_cuts}]];//切断个数 let number_of_cuts=[[#{number_of_cuts}]];//切断个数
let cut_off_area=[[#{cut_off_area}]];//切断面积 let cut_off_area=[[#{cut_off_area}]];//切断面积
let proportion_of_cutting_area=[[#{proportion_of_cutting_area}]];//切断面积占比 let proportion_of_cutting_area=[[#{proportion_of_cutting_area}]];//切断面积占比
let operate =[[#{operate}]]; // 操作
let delete_button =[[#{delete_button}]]; // 删除
let delete_tip =[[#{delete_tip}]]; // 删除提示
let message =[[#{message}]];
let confirm =[[#{confirm}]];
let cancel =[[#{cancel}]];
let delete_tip2 =[[#{delete_tip2}]];
</script> </script>
</body> </body>
</html> </html>