|
|
<!--#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}">
|
|
|
<div class="layui-inline">
|
|
|
<label class="layui-form-label">应用管理:</label>
|
|
|
<div class="layui-input-block">
|
|
|
<input type="text" name="studentClientLinkTitle" autocomplete="off" placeholder="请输入检索条件"
|
|
|
class="layui-input">
|
|
|
</div>
|
|
|
</div>
|
|
|
<div style="display: none">
|
|
|
<div class="layui-inline">
|
|
|
<label class="layui-form-label">链接类型</label>
|
|
|
<div class="layui-input-inline">
|
|
|
<input type="text" name="studentClientLinkType" id="studentClientLinkType" value="THIRD_APPL"
|
|
|
autocomplete="off" placeholder="请输入检索条件" class="layui-input">
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="layui-inline">
|
|
|
<label class="layui-form-label">状态</label>
|
|
|
<div class="layui-input-inline">
|
|
|
<input type="text" name="studentClientLinkStatus" id="studentClientLinkStatus" value="1"
|
|
|
autocomplete="off" placeholder="请输入检索条件" class="layui-input">
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</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",
|
|
|
where: {studentClientLinkType: 'THIRD_APPL', studentClientLinkStatus: '1'},//第三方应用管理
|
|
|
url: Common.ctxPath + '/jlw/studentClientLink/list.json' // 数据接口
|
|
|
, page: Lib.tablePage // 开启分页
|
|
|
, limit: 10,
|
|
|
cols: [[ // 表头
|
|
|
{
|
|
|
type: 'checkbox',
|
|
|
fixed: 'left',
|
|
|
},
|
|
|
{
|
|
|
|
|
|
field: 'studentClientLinkTitle',
|
|
|
title: '应用名称', align: "center", width: 300
|
|
|
},
|
|
|
{
|
|
|
|
|
|
field: 'studentClientLinkContent',
|
|
|
title: '应用链接', align: "center"
|
|
|
}, {
|
|
|
field: 'studentClientLinkImg',
|
|
|
title: '应用图片', align: "center",
|
|
|
// templet: function (d) {
|
|
|
// return '<a class="layui-table-link" lay-event="photos">' +
|
|
|
// '<img src="'+Common.ctxPath + d.studentClientLinkImg+'" />"'+
|
|
|
// '</a>'
|
|
|
// }
|
|
|
},
|
|
|
{
|
|
|
field: 'studentClientLinkDesc',
|
|
|
title: '应用描述', align: "center"
|
|
|
},
|
|
|
{
|
|
|
field: 'orgIdText',
|
|
|
title: '来源', align: "center"
|
|
|
},
|
|
|
{
|
|
|
field: 'userId', title: '操作', align: "center", width: 150, templet: function (d) {
|
|
|
var htm = '';
|
|
|
if (d.isEdit) {
|
|
|
htm = '<a class="layui-table-link" lay-event="edit">编辑</a>';
|
|
|
htm += '<a class="layui-table-link" lay-event="del" >删除</a>';
|
|
|
} else {
|
|
|
htm = '<a class="layui-table-link layui-btn-disabled" style="color: #b1b1b1">编辑</a>';
|
|
|
htm += '<a class="layui-table-link layui-btn-disabled" style="color: #b1b1b1">删除</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/studentClientLink/add.do?sign=5";
|
|
|
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 = Common.concatBatchId(data, "studentClientLinkId");
|
|
|
|
|
|
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/studentClientLink/add.do?&sign=5&studentClientLinkId=" + data.studentClientLinkId;
|
|
|
Common.openDlg(url, "应用管理/编辑应用");
|
|
|
} else if (obj.event === "del") {
|
|
|
deleteInfo(data.studentClientLinkId);
|
|
|
} else if (obj.event === "photos") {
|
|
|
var json = {
|
|
|
"title": "", //相册标题
|
|
|
"id": 123, //相册id
|
|
|
"start": 0, //初始显示的图片序号,默认0
|
|
|
"data": [ //相册包含的图片,数组格式
|
|
|
{
|
|
|
"alt": "图片名",
|
|
|
"pid": 666, //图片id
|
|
|
"src": Common.ctxPath + data.studentClientLinkImg, //原图地址
|
|
|
"thumb": "" //缩略图地址
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
layer.photos({
|
|
|
photos: json
|
|
|
, anim: 5 //0-6的选择,指定弹出图片动画类型,默认随机(请注意,3.0之前的版本用shift参数)
|
|
|
});
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
|
|
|
function deleteInfo(ids) {
|
|
|
layer.confirm('是否确定删除应用?', function (index) {
|
|
|
var ret = Common.postAjax("/jlw/studentClientLink/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>
|