@ -14,20 +14,22 @@
< label class = "layui-form-label" > 应用管理:< / label >
< div class = "layui-input-block" >
< input type = "text" name = "studentClientLinkTitle" autocomplete = "off" placeholder = "请输入检索条件"
class="layui-input" >
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" >
< 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" >
< input type = "text" name = "studentClientLinkStatus" id = "studentClientLinkStatus" value = "1"
autocomplete="off" placeholder="请输入检索条件" class="layui-input">
< / div >
< / div >
< / div >
@ -53,44 +55,44 @@
var laydate = layui.laydate;
var table = layui.table;
var resourcesApplicationTable = null;
var view ={
init:function(){
var view = {
init: function () {
this.initTable();
this.initSearchForm();
this.initToolBar();
window.dataReload = function(){
Lib.doSearchForm($("#searchForm"),resourcesApplicationTable)
window.dataReload = function () {
Lib.doSearchForm($("#searchForm"), resourcesApplicationTable)
}
},
initTable:function(){
initTable: function () {
resourcesApplicationTable = table.render({
elem : '#resourcesApplicationTable',
height : Lib.getTableHeight(),
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 : [ [ // 表头
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',
type: 'checkbox',
fixed: 'left',
},
{
field : 'studentClientLinkTitle',
title : '应用名称',align:"center",width:300
field: 'studentClientLinkTitle',
title: '应用名称', align: "center", width: 300
},
{
field : 'studentClientLinkContent',
title : '应用链接',align:"center"
},{
field : 'studentClientLinkImg',
title : '应用图片',align:"center",
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+'" / > "'+
@ -98,54 +100,61 @@
// }
},
{
field : 'studentClientLinkDesc',
title : '应用描述',align:"center"
field: 'studentClientLinkDesc',
title: '应用描述', align: "center"
},
{
field : 'orgIdText',
title : '来源',align:"center"
field: 'orgIdText',
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 > ';
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){
table.on('checkbox(resourcesApplicationTable)', function (obj) {
var resourcesApplication = obj.data;
if(obj.checked){
if (obj.checked) {
//按钮逻辑Lib.buttonEnable()
}else{
} else {
}
})
},
initSearchForm:function(){
Lib.initSearchForm( $("#searchForm"),resourcesApplicationTable,form);
initSearchForm: function () {
Lib.initSearchForm($("#searchForm"), resourcesApplicationTable, form);
},
initToolBar:function(){
initToolBar: function () {
toolbar = {
add : function() { // 获取选中数据
add: function () { // 获取选中数据
var url = "/jlw/studentClientLink/add.do?sign=5";
Common.openDlg(url,"第三方应用管理/新增应用");
Common.openDlg(url, "第三方应用管理/新增应用");
},
refresh: function () {//刷新
searchForm.reset();
Lib.doSearchForm($("#searchForm"), resourcesApplicationTable, 1);
},
search:function () {
search: function () {
Lib.doSearchForm($("#searchForm"), resourcesApplicationTable, 1);
},allDel:function (){
}, allDel: function () {
var checkStatus = table.checkStatus('resourcesApplicationTable')
,data = checkStatus.data,ids = Common.concatBatchId(data, "studentClientLinkId");
, data = checkStatus.data, ids = Common.concatBatchId(data, "studentClientLinkId");
if($.isEmpty(ids)){
if ($.isEmpty(ids)) {
layer.msg("请选择需要删除的应用!", {
offset: ['50%'],
icon: 2,
@ -156,40 +165,40 @@
deleteInfo(ids);
}
};
$('.ext-toolbar').on('click', function() {
$('.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"){
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 ={
} 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": "" //缩略图地址
}
]
{
"alt": "图片名",
"pid": 666, //图片id
"src": Common.ctxPath + data.studentClientLinkImg, //原图地址
"thumb": "" //缩略图地址
}
]
}
layer.photos({
photos: json
,anim: 5 //0-6的选择, 指定弹出图片动画类型, 默认随机( 请注意, 3.0之前的版本用shift参数)
, anim: 5 //0-6的选择, 指定弹出图片动画类型, 默认随机( 请注意, 3.0之前的版本用shift参数)
});
}
})
}
function deleteInfo(ids){
function deleteInfo(ids) {
layer.confirm('是否确定删除应用?', function (index) {
var ret = Common.postAjax("/jlw/studentClientLink/delete.json", {ids: ids});
layer.msg(ret.code == 0 ? "删除成功!" : ret.msg, {