|
|
|
@ -0,0 +1,165 @@
|
|
|
|
|
<!--#layout("/common/layout.html",{"jsBase":"/js/jlw/resourcesApplication/"}){ -->
|
|
|
|
|
<style>
|
|
|
|
|
/* 分页确定按钮*/
|
|
|
|
|
.layui-laypage-btn {
|
|
|
|
|
color: white !important;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.layui-table a {
|
|
|
|
|
margin-right: 10px;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
<layui:searchForm formId="searchForm" searchList="" condition="${search}">
|
|
|
|
|
</layui:searchForm>
|
|
|
|
|
|
|
|
|
|
<div class="layui-btn-group">
|
|
|
|
|
<!-- <layui:accessButton function="resourcesApplication.query" id="searchFormSearch" action="search"><i class="layui-icon"></i>搜索</layui:accessButton>-->
|
|
|
|
|
<layui:accessButton function="resourcesApplication.add" action="add"><i class="layui-icon"></i>新增
|
|
|
|
|
</layui:accessButton>
|
|
|
|
|
<layui:accessButton function="resourcesApplication.add" action="allDel" class="layui-btn-danger"><i
|
|
|
|
|
class="layui-icon"></i>批量删除
|
|
|
|
|
</layui:accessButton>
|
|
|
|
|
<layui:accessButton function="resourcesApplication.query" action="refresh"><i class="layui-icon"></i>刷新
|
|
|
|
|
</layui:accessButton>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<table id="resourcesApplicationTable" lay-filter="resourcesApplicationTable"></table>
|
|
|
|
|
<!--#} -->
|
|
|
|
|
<script>
|
|
|
|
|
|
|
|
|
|
layui.use(['form', 'laydate', 'table'], function () {
|
|
|
|
|
var form = layui.form;
|
|
|
|
|
var laydate = layui.laydate;
|
|
|
|
|
var table = layui.table;
|
|
|
|
|
var resourcesApplicationTable = null;
|
|
|
|
|
var view ={
|
|
|
|
|
init:function(){
|
|
|
|
|
this.initTable();
|
|
|
|
|
this.initSearchForm();
|
|
|
|
|
this.initToolBar();
|
|
|
|
|
window.dataReload = function(){
|
|
|
|
|
Lib.doSearchForm($("#searchForm"),resourcesApplicationTable)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
initTable:function(){
|
|
|
|
|
resourcesApplicationTable = table.render({
|
|
|
|
|
elem : '#resourcesApplicationTable',
|
|
|
|
|
height : Lib.getTableHeight(),
|
|
|
|
|
cellMinWidth: 100,
|
|
|
|
|
even:true,
|
|
|
|
|
method : 'post',
|
|
|
|
|
size:"lg",
|
|
|
|
|
url : Common.ctxPath + '/jlw/resourcesApplication/list.json' // 数据接口
|
|
|
|
|
,page : Lib.tablePage // 开启分页
|
|
|
|
|
,limit : 10,
|
|
|
|
|
cols : [ [ // 表头
|
|
|
|
|
{
|
|
|
|
|
type : 'checkbox',
|
|
|
|
|
fixed:'left',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field : 'resourcesApplicationId',
|
|
|
|
|
title : '序号',
|
|
|
|
|
width : 60,align:"center"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
field : 'applicationName',
|
|
|
|
|
title : '应用名称',align:"center",width:300
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
field : 'applicationLink',
|
|
|
|
|
title : '应用链接',align:"center"
|
|
|
|
|
},{
|
|
|
|
|
field : 'linkSecretKey',
|
|
|
|
|
title : '应用秘钥',align:"center"
|
|
|
|
|
},{
|
|
|
|
|
field : 'userId',title : '操作',align:"center", width:150,templet: function (d) {
|
|
|
|
|
var htm = '<a class="layui-table-link" lay-event="edit">编辑</a>';
|
|
|
|
|
htm += '<a class="layui-table-link" lay-event="del">删除</a>';
|
|
|
|
|
return htm;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
] ]
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
table.on('checkbox(resourcesApplicationTable)', function(obj){
|
|
|
|
|
var resourcesApplication = obj.data;
|
|
|
|
|
if(obj.checked){
|
|
|
|
|
//按钮逻辑Lib.buttonEnable()
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
initSearchForm:function(){
|
|
|
|
|
Lib.initSearchForm( $("#searchForm"),resourcesApplicationTable,form);
|
|
|
|
|
},
|
|
|
|
|
initToolBar:function(){
|
|
|
|
|
toolbar = {
|
|
|
|
|
add : function() { // 获取选中数据
|
|
|
|
|
var url = "/jlw/resourcesApplication/add.do";
|
|
|
|
|
Common.openDlg(url,"应用管理/新增应用");
|
|
|
|
|
},
|
|
|
|
|
refresh: function () {//刷新
|
|
|
|
|
searchForm.reset();
|
|
|
|
|
Lib.doSearchForm($("#searchForm"), resourcesApplicationTable, 1);
|
|
|
|
|
},
|
|
|
|
|
search:function () {
|
|
|
|
|
Lib.doSearchForm($("#searchForm"), resourcesApplicationTable, 1);
|
|
|
|
|
},allDel:function (){
|
|
|
|
|
var checkStatus = table.checkStatus('resourcesApplicationTable')
|
|
|
|
|
,data = checkStatus.data,ids="";
|
|
|
|
|
for(var i = 0;i<data.length;i++){
|
|
|
|
|
ids += data[i].resourcesApplicationId;
|
|
|
|
|
if(i < data.length - 1){
|
|
|
|
|
ids += ",";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if($.isEmpty(ids)){
|
|
|
|
|
layer.msg("请选择需要删除的应用!", {
|
|
|
|
|
offset: ['50%'],
|
|
|
|
|
icon: 2,
|
|
|
|
|
time: 1500 //2秒关闭(如果不配置,默认是3秒)
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
deleteInfo(ids);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
$('.ext-toolbar').on('click', function() {
|
|
|
|
|
var type = $(this).data('type');
|
|
|
|
|
toolbar[type] ? toolbar[type].call(this) : '';
|
|
|
|
|
});
|
|
|
|
|
}, initTableTool: table.on('tool(resourcesApplicationTable)', function (obj) {
|
|
|
|
|
var data = obj.data;
|
|
|
|
|
if (obj.event === 'edit') {
|
|
|
|
|
var url = "/jlw/resourcesApplication/add.do?resourcesApplicationId="+data.resourcesApplicationId;
|
|
|
|
|
Common.openDlg(url,"应用管理/编辑应用");
|
|
|
|
|
}else if(obj.event === "del"){
|
|
|
|
|
deleteInfo(data.resourcesApplicationId);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function deleteInfo(ids){
|
|
|
|
|
layer.confirm('是否确定删除应用?', function (index) {
|
|
|
|
|
var ret = Common.postAjax("/jlw/resourcesApplication/delete.json", {ids: ids});
|
|
|
|
|
layer.msg(ret.code == 0 ? "删除成功!" : ret.msg, {
|
|
|
|
|
offset: ['50%'],
|
|
|
|
|
icon: ret.code == 0 ? 1 : 2,
|
|
|
|
|
time: 1500 //2秒关闭(如果不配置,默认是3秒)
|
|
|
|
|
}, function () {
|
|
|
|
|
if (ret.code == 0) {
|
|
|
|
|
Lib.tableRefresh();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
view.init();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
</script>
|