You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

101 lines
4.0 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<!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]-->
</head>
<body>
<div class="weadmin-body">
<table class="layui-table" lay-filter="demo" id="idTest"></table>
<script type="text/html" id="barDemo">
<a class="layui-btn layui-btn-sm subscribe" lay-event="subscribe" id={{d.appid}}>订阅</a>
</script>
<script type="text/html" id="subcount">
<div>已订阅{{d.subcount}}</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','form'], function () {
var $ = layui.jquery,
admin = layui.admin,
form = layui.form,
table = layui.table;
var appid=GetQueryString('appid');
table.render({
elem: '#idTest'
, url: '/FengHuang/share/SubscribeSettingList'
,where:{
'appid':appid
}
, cols: [[
{field: '', title: '序号', align: 'center', type: 'numbers'}
, {field: 'system_type_name', title: '系统分类', align: 'center'}
, {field: 'appid', title: 'appid', align: 'center',hide:true}
, {field: 'appname', title: '应用系统名称', align: 'center',width:'30%'}
, {field: 'allowsubcount', title: '可订阅项数量', align: 'center'}
, {field: 'subcount', title: '订阅情况', align: 'center',templet:'#subcount'}
, {fixed: 'right', title: '操作', toolbar: '#barDemo', align: 'center'}
]]
,height:'full-60'
,page:true
, done: function (res, page, count) {
$("[data-field='appid']").children().each(function () {
if ($(this).text() == appid) {
$('.subscribe[id="'+appid+'"]').removeClass('layui-btn').removeClass('layui-btn-sm').text('--');
$('.subscribe[id="'+appid+'"]').parent().parent().prev().find("div").text('--');
}
})
$("[data-field='allowsubcount']").children().each(function () {
if ($(this).text() == 0) {
$(this).parent().next().find('div').text('--');
$(this).parent().next().next().find('a').removeClass('layui-btn').removeClass('layui-btn-sm').text('--');
}
})
}
});
table.on('tool(demo)', function (obj) {
var data = obj.data;
// console.log(data);
if (obj.event === 'subscribe') {
// WeAdminEdit('订阅', './getItemList.html',data.appid, 640, 530)
WeAdminShow('订阅','./getItemList.html?appid='+appid+'&publish_appid='+data.appid,640,350);
}
});
window.closeDialog=function () {
var index=parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
parent.layui.table.reload('idTest', {
page: {
curr: 1
}
});
}
})
</script>
</body>
</html>