parent
af05a0f235
commit
ba678973c9
@ -0,0 +1,65 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>模板内容构建</title>
|
||||
<link href="./layui/css/layui.css" rel="stylesheet">
|
||||
<script src="./layui/layui.js"></script>
|
||||
<!--引用新版本Jquery-->
|
||||
<script type="text/javascript" src="../../js/jquery-3.6.0.min.js"></script>
|
||||
<script type="text/javascript" src="../../js/jquery_Extend.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<table class="layui-table" lay-filter="idTest" id="idTest"></table>
|
||||
<script type="text/html" id="barDemo">
|
||||
{{#if(d.filled){ }}
|
||||
<a class="layui-btn layui-btn-xs layui-btn-normal" lay-event="modify">修改</a>
|
||||
{{#}else{ }}
|
||||
<a class="layui-btn layui-btn-xs layui-btn" lay-event="modify">设置</a>
|
||||
{{#} }}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
layui.use(['layer', 'form', 'table'], function () {
|
||||
var layer = layui.layer;
|
||||
var form = layui.form;
|
||||
var table = layui.table;
|
||||
|
||||
//需要获取当前的url中参数module_id和page
|
||||
let module_id = $.getUrlParam('module_id');
|
||||
table.render({
|
||||
elem: '#idTest'
|
||||
, url: '/FengHuang/zjb/getModulePageFillInfo'
|
||||
, where: {
|
||||
module_id: module_id
|
||||
}
|
||||
, cols: [[
|
||||
{field: '', title: '序号', align: 'center', type: 'numbers', fixed: true, width: '5%'}
|
||||
, {field: 'json', title: '内容', align: 'center'}
|
||||
, {fixed: 'right', title: '操作', toolbar: '#barDemo', align: 'center', width: 480}
|
||||
]]
|
||||
, page: false
|
||||
, height: 'full'
|
||||
, done: function (res) {
|
||||
$("[data-field='json']").children().each(function () {
|
||||
if ($(this).text() == "[]") {
|
||||
$(this).text("未填写");
|
||||
} else {
|
||||
$(this).text("已填写");
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
table.on('tool(idTest)', function (obj) {
|
||||
var data = obj.data;
|
||||
if (obj.event === "modify") {
|
||||
window.location.href = "designModulePage.html?module_id=" + module_id + "&page=" + data.page;
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in new issue