<div class="layui-fluid layui-anim febs-anim" id="febs-comment-child" lay-title="评论">
|
<div class="layui-row febs-container">
|
<div class="layui-col-md12">
|
<div class="layui-card">
|
<div class="layui-card-body febs-table-full">
|
|
<form class="layui-form layui-table-form" lay-filter="comment-table-form">
|
<div class="layui-row">
|
<div class="layui-col-md2 layui-col-sm12 layui-col-xs12 table-action-area">
|
<div class="layui-btn layui-btn-sm layui-btn-primary febs-button-blue-plain table-action" id="query">
|
<i class="layui-icon"></i>
|
</div>
|
</div>
|
</div>
|
</form>
|
<table lay-filter="commentChild" lay-data="{id: 'commentChild'}"></table>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
|
<script type="text/html" id="showStateSwitch">
|
{{# if(d.showState === 1) { }}
|
<input type="checkbox" value={{d.commentId}} lay-text="显示|隐藏" checked lay-skin="switch" lay-filter="showStateSwitch">
|
{{# } else { }}
|
<input type="checkbox" value={{d.commentId}} lay-text="显示|隐藏" lay-skin="switch" lay-filter="showStateSwitch">
|
{{# } }}
|
</script>
|
<script data-th-inline="none" type="text/javascript">
|
layui.use(['dropdown', 'jquery', 'laydate', 'form', 'table', 'febs', 'treeSelect' ,'eleTree'], function () {
|
var $ = layui.jquery,
|
laydate = layui.laydate,
|
febs = layui.febs,
|
form = layui.form,
|
table = layui.table,
|
treeSelect = layui.treeSelect,
|
dropdown = layui.dropdown,
|
$view = $('#febs-comment-child'),
|
$query = $view.find('#query'),
|
sortObject = {field: 'createTime', type: null},
|
tableIns,
|
createTimeFrom,
|
createTimeTo;
|
|
form.render();
|
|
// 查询按钮
|
$query.on('click', function () {
|
tableIns.reload({where: null, page: {curr: 1}});
|
});
|
|
form.on('switch(showStateSwitch)', function (data) {
|
console.log(data.value);
|
if (data.elem.checked) {
|
showStateSwitch(data.value,1);
|
} else {
|
showStateSwitch(data.value,0);
|
}
|
})
|
function showStateSwitch(id,state) {
|
febs.get(ctx + 'admin/clothesType/showStateSwitch/' + id+'/' + state, null, function (data) {
|
febs.alert.success(data.message);
|
$query.click();
|
});
|
}
|
|
initCommentTable();
|
|
function initCommentTable() {
|
tableIns = febs.table.init({
|
elem: $view.find('table'),
|
id: 'commentChild',
|
url: ctx + 'admin/clothesType/socialComment?parentId=1',
|
cols: [[
|
{field: 'commentId', title: '评论ID', minWidth: 80,align:'center'},
|
{field: 'showState', title: '是否显示', templet: '#showStateSwitch', minWidth: 130,align:'center'},
|
{field: 'memberName', title: '昵称', minWidth: 150,align:'center'},
|
{field: 'comment', title: '内容', minWidth: 150,align:'left'},
|
{field: 'createdTime', title: '时间', minWidth: 150,align:'left'},
|
]]
|
});
|
}
|
|
})
|
</script>
|