main
kgdxpr 1 year ago
parent 3eee22c87c
commit 4916035030

@ -130,6 +130,13 @@
</div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label" style="width: 100px !important;"></label>
<div class="layui-input-block" style="margin-left: 90px !important;">
<i class="layui-icon layui-icon-app" style="color: #16BAAA;"></i> <a id="sheetSet"
href="javascript:void(0)" style="cursor: pointer;color: #16BAAA;">设置不同阶段学校填报模板</a>
</div>
</div>
</div>
</div>
@ -336,7 +343,7 @@
table.reloadData('groupTable', {
scrollPos: false
});
}
}
form.on('submit(publish)', function (data) {
@ -450,6 +457,17 @@
});
}
$("#sheetSet").click(function () {
layer.open({
type: 1,
area: ['420px', '240px'], // 宽高
title: false, // 不显示标题栏
closeBtn: 0,
shadeClose: true, // 点击遮罩关闭层
content: './sheet_set.html?job_id=' + jobId
});
});
function GetQueryString(name, istop) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg);

@ -0,0 +1,78 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>点击单元格变色</title>
<link rel="stylesheet" href="../../../component/layui/css/layui.css" />
</head>
<body>
<table class="layui-table" id="myTable">
</table>
<script src="../../../component/layui/layui.js"></script>
<script>
layui.use(function () {
var $ = layui.jquery;
var table = layui.table;
var jobId = GetQueryString("job_id");
table.render({
elem: '#myTable',
url: '/QingLong/collect/getSheetStage?job_id=' + jobId,
height: 'full-60',
cols: [[
{ title: '模板', field: 'sheet_name', align: 'center' },
{ title: '小学', templet: '<div class="xx" id="a{{= d.id }}">&nbsp;</div>', align: 'center', width: "15%", style: 'cursor: pointer;' },
{ title: '初中', templet: '<div class="cz" id="a{{= d.id }}">&nbsp;</div>', align: 'center', width: "15%", style: 'cursor: pointer;' },
{ title: '高中', templet: '<div class="gz" id="a{{= d.id }}">&nbsp;</div>', align: 'center', width: "15%", style: 'cursor: pointer;' }
]],
// skin: 'line',
defaultToolbar: [],
done: function (res, curr, count) {
// $('.layui-table').on('click', 'td', function (obj) {
// if (obj.currentTarget.cellIndex > 2) {
// console.log(obj)
// if ($(this).css('background-color') == "rgba(0, 0, 0, 0)") {
// $(this).css('background-color', '#5FB878');
// } else {
// $(this).css('background-color', 'rgba(0, 0, 0, 0)');
// }
// }
// });
// $("#a1").css('background-color', '#5FB878');
$(".xx").click(function () {
if ($(this).css('background-color') == "rgba(0, 0, 0, 0)") {
$(this).css('background-color', '#D6F2F3');
} else {
$(this).css('background-color', 'rgba(0, 0, 0, 0)');
}
// console.log($(this).attr('id'));
});
}
});
function GetQueryString(name, istop) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg);
if (typeof (istop) != "undefined") r = top.location.search.substr(1).match(reg);
if (r != null) return unescape(r[2]);
return null;
}
});
</script>
</body>
</html>
Loading…
Cancel
Save