From b68388963f1cc65f2d8d5c073dcae0db84bd38ab Mon Sep 17 00:00:00 2001 From: cwchen <1048842385@qq.com> Date: Tue, 23 Dec 2025 16:21:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8=E7=BA=BFRoll/angle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../static/js/defectStatistics/proportion.js | 157 +++++++++++++----- .../pages/defectStatistics/proportion.html | 22 ++- 2 files changed, 133 insertions(+), 46 deletions(-) diff --git a/src/main/resources/static/js/defectStatistics/proportion.js b/src/main/resources/static/js/defectStatistics/proportion.js index 67904f2..d57a2f5 100644 --- a/src/main/resources/static/js/defectStatistics/proportion.js +++ b/src/main/resources/static/js/defectStatistics/proportion.js @@ -2,7 +2,11 @@ var form, layer, table, tableIns,formSelects; // 应用类别下拉选 var baleNumList; var pageNum = 1, limitSize = 10; // 默认第一页,分页数量为10 +const isOnline = localStorage.getItem("online"); layui.use(['form', 'layer', 'table', 'laydate'], function () { + if(isOnline === '0'){ + $('.baleNum').removeAttr('style'); + } form = layui.form; layer = layui.layer; table = layui.table; @@ -71,6 +75,7 @@ layui.use(['form', 'layer', 'table', 'laydate'], function () { $("#reset").click(function () { $("#baleNum").val(""); $("#operateTime").val(""); + query(); form.render(); }); }); @@ -126,44 +131,7 @@ function initTable(dataList, limit, page) { data: dataList, limit: limit, 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 += ""+d.baleNum+""; - 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 += ""+d.imgNum+""; - return html; - } - }, - { field: 'createTime', width: 225,align: "center",title: test_date }, - ], + setTableField(page,limit) ], done: function (res, curr, count) { 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 += ""+d.baleNum+""; + 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 += ""+d.imgNum+""; + 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 += ""+d.imgNum+""; + return html; + } + }, + { field: 'createTime', width: '20%',align: "center",title: test_date }, + { + title: operate, + width: '10%', + align: "center", + templet: function(d) { + return ""+delete_button+""; + } + } + ] + } + return cols; +} + function getBaleNum(baleNum) { var param = { @@ -250,4 +299,36 @@ function exportData() { window.URL.revokeObjectURL(url) }; 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) + }); + }) } \ No newline at end of file diff --git a/src/main/resources/static/pages/defectStatistics/proportion.html b/src/main/resources/static/pages/defectStatistics/proportion.html index 12a4f8b..5c4a925 100644 --- a/src/main/resources/static/pages/defectStatistics/proportion.html +++ b/src/main/resources/static/pages/defectStatistics/proportion.html @@ -21,17 +21,14 @@