|
|
<!DOCTYPE html>
|
|
|
<html>
|
|
|
|
|
|
<head>
|
|
|
<meta charset="UTF-8">
|
|
|
<title>集成设置列表</title>
|
|
|
<meta name="renderer" content="webkit">
|
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
|
|
<link rel="stylesheet" href="../../static/css/font.css">
|
|
|
<link rel="stylesheet" href="../../static/css/weadmin.css">
|
|
|
<!-- 让IE8/9支持媒体查询,从而兼容栅格 -->
|
|
|
<!--[if lt IE 9]>
|
|
|
<script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
|
|
|
<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
|
|
|
<![endif]-->
|
|
|
<style>
|
|
|
/*.layui-table-cell {*/
|
|
|
/*width: 100px!important;*/
|
|
|
|
|
|
/*}*/
|
|
|
/*.layui-table-cell img {*/
|
|
|
/*width: 100%!important;*/
|
|
|
/*}*/
|
|
|
|
|
|
</style>
|
|
|
</head>
|
|
|
|
|
|
<body>
|
|
|
<div class="weadmin-nav">
|
|
|
<span class="layui-breadcrumb">
|
|
|
<a href="">首页</a>
|
|
|
<a href="">集成设置</a>
|
|
|
<a>
|
|
|
<cite>接入集成设置</cite></a>
|
|
|
</span>
|
|
|
<a class="layui-btn layui-btn-sm" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
|
|
|
<i class="layui-icon layui-icon-refresh-3" style="line-height:30px"></i></a>
|
|
|
</div>
|
|
|
<div class="weadmin-body">
|
|
|
<div class="layui-row hide">
|
|
|
<form class="layui-form layui-col-md12 we-search">
|
|
|
系统名称:
|
|
|
<div class="layui-inline">
|
|
|
<input type="text" name="username" placeholder="请输入系统名称" autocomplete="off" class="layui-input">
|
|
|
</div>
|
|
|
<button class="layui-btn" lay-submit="" lay-filter="sreach"><i class="layui-icon"></i></button>
|
|
|
</form>
|
|
|
</div>
|
|
|
<div class="weadmin-block">
|
|
|
<button class="layui-btn layui-btn-danger delBtn" data-type="getCheckLength"><i class="layui-icon"></i>批量删除</button>
|
|
|
<button class="layui-btn" onclick="addList();"><i class="layui-icon"></i>添加</button>
|
|
|
</div>
|
|
|
<table class="layui-table" lay-filter="demo" id="idTest"></table>
|
|
|
<script type="text/html" id="barDemo">
|
|
|
<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
|
|
|
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
|
|
|
</script>
|
|
|
<script type="text/html" id="imgTpl">
|
|
|
<div><img src="/FengHuang/uploadPic/{{d.pic}}"></div>
|
|
|
</script>
|
|
|
</div>
|
|
|
|
|
|
<script src="../../lib/layui/layui.js"></script>
|
|
|
<script src="../../lib/persist-min.js"></script>
|
|
|
<script>
|
|
|
layui.extend({
|
|
|
admin: '{/}../../static/js/admin'
|
|
|
});
|
|
|
layui.use(['jquery','admin','table'],function () {
|
|
|
var $=layui.jquery,
|
|
|
admin=layui.admin,
|
|
|
table=layui.table;
|
|
|
var store = new Persist.Store('store_name');
|
|
|
|
|
|
table.render({
|
|
|
elem: '#idTest'
|
|
|
,url:'/FengHuang/integrated/getIntegratedSystemList'
|
|
|
,cols: [[
|
|
|
{type: 'checkbox', fixed: 'left',align:'center'}
|
|
|
,{field:'integrated_system_id', title:'序号',align:'center',type:'numbers',width:80}
|
|
|
// ,{field:'integrated_system_id', title:'系统ID',align:'center'}
|
|
|
,{field:'integrated_system_name', title:'系统名称',align:'center'}
|
|
|
,{field:'pic', title:'系统图标',align:'center',templet:'<div><img src="/FengHuang/uploadPic/{{d.pic}}"></div>'}
|
|
|
,{field:'system_type_id', title:'分类',align:'center'}
|
|
|
,{field:'callback_url', title:'访问地址',align:'center'}
|
|
|
,{field:'sort_id', title:'排序号',align:'center'}
|
|
|
,{fixed: 'right', title:'操作', toolbar: '#barDemo',align:'center'}
|
|
|
]]
|
|
|
,page: true
|
|
|
,done:function(res,page,count){
|
|
|
hoverOpenImg();//显示大图
|
|
|
$("[data-field='system_type_id']").children().each(function(){
|
|
|
if($(this).text()=='1'){
|
|
|
$(this).text("教学类")
|
|
|
}else if($(this).text()=='2'){
|
|
|
$(this).text("管理类")
|
|
|
}else if($(this).text()=='3'){
|
|
|
$(this).text("研修类")
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
});
|
|
|
function hoverOpenImg(){
|
|
|
var img_show = null;
|
|
|
$('td img').hover(function(){
|
|
|
var img = "<img class='img_msg' src='"+$(this).attr('src')+"' style='width:100%;' />";
|
|
|
img_show = layer.tips(img, this,{ tips:[2, 'rgba(41,41,41,.5)'] ,area: ['200px'] });
|
|
|
},function(){
|
|
|
layer.close(img_show);
|
|
|
});
|
|
|
// $('td img').attr('style','max-width:12%');
|
|
|
$('td img').css({
|
|
|
'max-width':"12%",
|
|
|
"cursor":"pointer"
|
|
|
})
|
|
|
}
|
|
|
|
|
|
function del(id){
|
|
|
$.ajax({
|
|
|
type: "post",
|
|
|
url: "/FengHuang/integrated/deleteIntegratedSystem",
|
|
|
data: {
|
|
|
integrated_system_ids:id
|
|
|
},
|
|
|
dataType: 'json',
|
|
|
success: function (data) {
|
|
|
if(data.success){
|
|
|
layer.closeAll();
|
|
|
layer.msg(data.message, {icon: 1, time: 2000, shade: 0.1});
|
|
|
layui.table.reload('idTest', {
|
|
|
page: {
|
|
|
curr: 1
|
|
|
}
|
|
|
});
|
|
|
}else{
|
|
|
layer.alert(data.message, {icon:0});
|
|
|
}
|
|
|
}
|
|
|
|
|
|
})
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
table.on('tool(demo)', function(obj){
|
|
|
var data = obj.data;
|
|
|
if(obj.event === 'del'){
|
|
|
layer.confirm('确定删除'+data.integrated_system_name+'系统吗?',{icon:0}, function(index){
|
|
|
del(data.integrated_system_id);
|
|
|
});
|
|
|
} else if(obj.event === 'edit'){
|
|
|
|
|
|
WeAdminEdit('编辑','./edit.html',data.integrated_system_id, 800,650)
|
|
|
|
|
|
}
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
var active = {
|
|
|
getCheckLength: function(){ //获取选中数目
|
|
|
var checkStatus = table.checkStatus('idTest')
|
|
|
,data = checkStatus.data;
|
|
|
console.log(data);
|
|
|
if(data.length==0){
|
|
|
layer.alert("请选择系统", {
|
|
|
icon: 6
|
|
|
})
|
|
|
}else if(data.length>0){
|
|
|
var systemIds="";
|
|
|
for (var i=0;i<data.length;i++){
|
|
|
if(i==data.length-1){
|
|
|
systemIds+=data[i].integrated_system_id;
|
|
|
}else{
|
|
|
systemIds+=data[i].integrated_system_id+",";
|
|
|
}
|
|
|
}
|
|
|
if(data.length==1){
|
|
|
layer.alert('确定删除'+data[0].integrated_system_name+'系统吗?', {
|
|
|
icon: 7
|
|
|
}, function(){
|
|
|
del(systemIds);
|
|
|
});
|
|
|
}else{
|
|
|
layer.alert('确定要批量删除'+data.length+'个系统吗?', {
|
|
|
icon: 7
|
|
|
}, function(){
|
|
|
del(systemIds);
|
|
|
});
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
|
|
|
$('.delBtn').on('click', function(){
|
|
|
var type = $(this).data('type');
|
|
|
active[type] ? active[type].call(this) : '';
|
|
|
});
|
|
|
|
|
|
// 添加集成系统
|
|
|
window.addList=function () {
|
|
|
// WeAdminShow('添加','./add.html',850,580);
|
|
|
layer.open({
|
|
|
type: 2,
|
|
|
area: ['850px', '580px'],
|
|
|
fix: false, //不固定
|
|
|
maxmin: true,
|
|
|
shadeClose: false,
|
|
|
shade: 0.4,
|
|
|
title: '添加',
|
|
|
content: './add.html',
|
|
|
cancel:function () {
|
|
|
store.set("data",'');
|
|
|
store.set("city",'');
|
|
|
store.set("org",'');
|
|
|
store.set("district",'');
|
|
|
store.set("picName",'');
|
|
|
store.set("range",'');
|
|
|
store.set("stages",'');
|
|
|
}
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
</script>
|
|
|
</body>
|
|
|
|
|
|
</html> |