|
@@ -12,7 +12,9 @@
|
|
|
background-color:rgba(255,255,255,0);
|
|
|
height:100%;
|
|
|
}
|
|
|
+ .ztree li span{
|
|
|
|
|
|
+ }
|
|
|
</style>
|
|
|
<script type="text/javascript">
|
|
|
// 确认对话框
|
|
@@ -59,26 +61,26 @@
|
|
|
<table:sortColumn id="orderBy" name="orderBy" value="${page.orderBy}" callback="sortOrRefresh();"/><!-- 支持排序 -->
|
|
|
|
|
|
<div class="commonQuery">
|
|
|
- <div class="layui-item query athird">
|
|
|
+ <div class="layui-item query athird" style="width: 25%">
|
|
|
<label class="layui-form-label">编号:</label>
|
|
|
<div class="layui-input-block with-icon">
|
|
|
<form:input path="number" value="${help.number}" htmlEscape="false" maxlength="64" class=" form-control layui-input"/>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="layui-item query athird">
|
|
|
+ <div class="layui-item query athird" style="width: 25%">
|
|
|
<label class="layui-form-label">功能:</label>
|
|
|
<div class="layui-input-block with-icon">
|
|
|
<form:input path="features" value="${help.features}" htmlEscape="false" maxlength="64" class=" form-control layui-input"/>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="layui-item query athird">
|
|
|
+ <div class="layui-item query athird" style="width: 25%">
|
|
|
<label class="layui-form-label">描述:</label>
|
|
|
<div class="layui-input-block with-icon">
|
|
|
<form:input path="description" value="${help.description}" htmlEscape="false" maxlength="128" class=" form-control layui-input"/>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <div class="layui-item athird fr">
|
|
|
+ <div class="layui-item athird" style="width: 25%">
|
|
|
<div class="input-group">
|
|
|
<div class="layui-btn-group search-spacing">
|
|
|
<button id="searchQuery" class="layui-btn layui-btn-sm layui-bg-blue" onclick="search()">查询</button>
|
|
@@ -113,7 +115,7 @@
|
|
|
</div>
|
|
|
<script src="${ctxStatic}/layer-v2.3/layui/layui.all.js" charset="utf-8"></script>
|
|
|
<script>
|
|
|
- layui.use('table', function(){
|
|
|
+ layui.use(['table','form'], function(){
|
|
|
layui.table.render({
|
|
|
limit:${ page.pageSize }
|
|
|
,elem: '#contentTable'
|
|
@@ -135,6 +137,18 @@
|
|
|
,{field:'description', align:'center',title: '描述', minWidth :200,templet:function(d){
|
|
|
return "<span title='"+ d.description +"'>" + d.description + "</span>";
|
|
|
}}
|
|
|
+ ,{field: 'enable', title: '状态', width: 85, templet: function (data) {
|
|
|
+ if (data.enable == 1) {
|
|
|
+ return '<div> <input type="checkbox" checked="" name="enable" lay-skin="switch" id="enable" lay-filter="switchTest" switchId=' + data.id + '' +
|
|
|
+ ' lay-text="启用|已禁用" value=' + data.enable + '></div>';
|
|
|
+ }
|
|
|
+ return '<div> <input type="checkbox" lay-skin="switch" name="enable" switchId=' + data.id + ' lay-filter="switchTest"' +
|
|
|
+ 'lay-text="启用|已禁用" value=' + data.enable + '></div>';
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
,{field:'op',align:'center',title:"操作",width:100,templet:function(d){
|
|
|
////对操作进行初始化
|
|
|
var xml = "<div class=\"layui-btn-group\">";
|
|
@@ -157,12 +171,16 @@
|
|
|
,"menuName":"${help.menuName}"
|
|
|
,"features":"${help.features}"
|
|
|
,"description":"${help.description}"
|
|
|
+ ,"enable":"${help.enable}"
|
|
|
<shiro:hasPermission name="sys:role:edit">
|
|
|
,"candelete1":"1"
|
|
|
</shiro:hasPermission>
|
|
|
<shiro:hasPermission name="sys:role:del">
|
|
|
,"candelete2":"1"
|
|
|
</shiro:hasPermission>
|
|
|
+ <shiro:hasPermission name="sys:help:enable">
|
|
|
+ ,"canEnable":"1"
|
|
|
+ </shiro:hasPermission>
|
|
|
}
|
|
|
</c:forEach>
|
|
|
</c:if>
|
|
@@ -170,6 +188,60 @@
|
|
|
// ,even: true
|
|
|
// ,height: 315
|
|
|
});
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 监听开关 状态 操作
|
|
|
+ */
|
|
|
+ layui.form.on('switch(switchTest)', function (data) {
|
|
|
+ console.log(data)
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 禁用标签
|
|
|
+ * 状态 赋值为 0
|
|
|
+ */
|
|
|
+ var layerIndex = layer.load(3);
|
|
|
+
|
|
|
+ if ((this.checked ? 'true' : 'false') == 'false') {
|
|
|
+ $.ajax({
|
|
|
+ url: '${ctx}/sys/help/updateEnable',
|
|
|
+ data: {
|
|
|
+ enable: 0,
|
|
|
+ id: data.elem.getAttribute("switchId")
|
|
|
+ },
|
|
|
+ type: 'post', //HTTP请求类型
|
|
|
+ success: function (data) {
|
|
|
+ parent.layer.msg("禁用成功!", {icon: 1});
|
|
|
+
|
|
|
+ }, error: function () {
|
|
|
+ parent.layer.msg("禁用失败!", {icon: 5});
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ /**
|
|
|
+ * 启动标签
|
|
|
+ * 状态 赋值为 1
|
|
|
+ */
|
|
|
+ $.ajax({
|
|
|
+ url: '${ctx}/sys/help/updateEnable',
|
|
|
+ data: {
|
|
|
+ enable: 1,
|
|
|
+ id: data.elem.getAttribute("switchId")
|
|
|
+ },
|
|
|
+ type: 'post',
|
|
|
+ success: function (data) {
|
|
|
+ parent.layer.msg("启用成功!", {icon: 1});
|
|
|
+
|
|
|
+ }, error: function () {
|
|
|
+ parent.layer.msg("启用失败!", {icon: 5});
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+ }
|
|
|
+ layer.close(layerIndex);
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
})
|
|
|
resizeListTable();
|
|
|
</script>
|