代码提交
This commit is contained in:
parent
0d8d25d482
commit
3639f8ac60
|
|
@ -0,0 +1,84 @@
|
|||
let table, layer, form;
|
||||
layui.use(['layer', 'table', 'form'], function () {
|
||||
layer = layui.layer;
|
||||
table = layui.table;
|
||||
form = layui.form;
|
||||
// 响应成功后的拦截器
|
||||
$.ajaxSetup({
|
||||
beforeSend: function (xhr, options) {
|
||||
var originalSuccess = options.success
|
||||
options.success = function (data, textStatus, jqXhr) {
|
||||
data = modifyResponseData(data);
|
||||
// success(data,textStatus, jqXhr);
|
||||
originalSuccess.apply(this, arguments)
|
||||
}
|
||||
}
|
||||
})
|
||||
initTable(1, parent.$('#bidPro').val());
|
||||
});
|
||||
|
||||
/* 切换数据 */
|
||||
function changeData(that, type) {
|
||||
const bidCode = parent.$('#bidPro').val();
|
||||
$(".ul-box li").each(function () {
|
||||
if ($(this).hasClass("check")) {
|
||||
$(this).removeClass("check").addClass("nocheck");
|
||||
}
|
||||
});
|
||||
var tableElem = $('#demo2').parents('.layui-table-view');
|
||||
tableElem.remove();
|
||||
$(that).removeClass("nocheck").addClass("check");
|
||||
if (type === 1 || type === 2 || type === 3 || type === 6 || type === 12) {
|
||||
initTable(type, bidCode);
|
||||
$('#right-table-box').removeAttr('style');
|
||||
$('#no-data-box').css({ 'display': 'none' });
|
||||
$('#right-box').css({ 'display': 'none' });
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function initTable(type, bidCode) {
|
||||
const url = commonUrl + "screen/largeScreen/dataAnalysis/getEngqualityAnalysis";
|
||||
table.render({
|
||||
elem: '#demo2',
|
||||
url: url,
|
||||
skin: 'line',
|
||||
page: true,
|
||||
height: 'full-100',
|
||||
headers: {
|
||||
"decrypt": "decrypt",
|
||||
"Authorization": token
|
||||
},
|
||||
where: {
|
||||
bidCode: bidCode,
|
||||
type: type
|
||||
},
|
||||
cols: [setCols(type)],
|
||||
initComplete: function () {
|
||||
// 在表格渲染完成后,重新渲染序号列
|
||||
var that = this.elem.next();
|
||||
var tool = that.children('.layui-table-box').children('.layui-table-fixed').children('.layui-table-body').children('.layui-table');
|
||||
tool.find("tr").each(function (index, item) {
|
||||
$(this).find('td[data-field="LAY_TABLE_INDEX"]').text(index + 1);
|
||||
});
|
||||
},
|
||||
done: function (res, curr, count, origin) {
|
||||
// console.log(res);
|
||||
}
|
||||
})
|
||||
|
||||
function setCols(type) {
|
||||
if (type === 1) { // 工程质量分析
|
||||
return [
|
||||
{ type: 'numbers', title: '序号', width: '10%' }, // 添加序号列
|
||||
{ field: 'projectName', title: '工程名称', align: 'center', width: '15%' },
|
||||
{ field: 'projectNumber', title: '工程编号', align: 'center', width: '15%' },
|
||||
{ field: 'projectAddress', title: '项目地址', align: 'center', width: '15%' },
|
||||
{ field: 'contractorName', title: '合同编号', align: 'center', width: '15%' },
|
||||
{ field: 'qualityLevel', title: '质量等级', align: 'center', width: '15%' },
|
||||
{ field: 'isContract', title: '是否签订合同', align: 'center', width: '15%' },
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
<script src="../../js/publics/jquery-3.6.0.min.js" type="text/javascript"></script>
|
||||
<script src="../../js/publics/public.js"></script>
|
||||
<script src="../../plugin/scroll/jquery.nicescroll.min.js"></script>
|
||||
<script src="../../js/publics/echarts.js"></script>
|
||||
<!--<!– <script src="../../js/publics/echarts.js"></script>–>-->
|
||||
<script src="../../plugin/layui-v2.9.7/layui/layui.js"></script>
|
||||
<script src="../../js/publics/aescbc.js"></script>
|
||||
<script src="../../js/publics/sm3.js"></script>
|
||||
|
|
@ -28,11 +28,15 @@
|
|||
// watermark.load({ watermark_txt: text });
|
||||
</script>
|
||||
<body>
|
||||
<table id="demo2" lay-filter="test"></table>
|
||||
</body>
|
||||
<style>
|
||||
.layui-table-init {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
#demo2{
|
||||
margin-top: 26px;
|
||||
}
|
||||
</style>
|
||||
<script src="../../js/pages/newDataAnalysis/proQualityAnalysis.js" type="text/javascript"></script>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue