...
|
...
|
@@ -296,16 +296,20 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function |
|
|
}
|
|
|
}
|
|
|
, {
|
|
|
field: 'userTotal', title: '订阅人数', align: 'right', sort: true, width: 120,
|
|
|
field: 'userTotal', title: '订阅者', align: 'right', sort: true, width: 120,
|
|
|
templet: function (d) {
|
|
|
if (d.userTotal != '0') {
|
|
|
/*if (d.userTotal != '0') {
|
|
|
return `<div><span data-id="${d.subId}" class="layui-table-link view-alarmsubscribe-users-total">${d.userTotal}</span></div>`;
|
|
|
} else {
|
|
|
return d.userTotal;
|
|
|
}
|
|
|
}*/
|
|
|
return `<div>
|
|
|
<span data-id="${d.subId}" class="layui-table-link view-alarmsubscribe-users-total" lay-tips="用户">${d.userTotal}</span> /
|
|
|
<span data-id="${d.subId}" class="layui-table-link view-alarmsubscribe-org-total" lay-tips="部门">${d.orgTotal}</span> /
|
|
|
<span data-id="${d.subId}" class="layui-table-link view-alarmsubscribe-user-group-total" lay-tips="用户组">${d.userGroupTotal}</span>
|
|
|
</div>`;
|
|
|
}
|
|
|
}
|
|
|
, {field: 'times', title: '允许通知时间段', align: 'center', sort: true, width: 180}
|
|
|
, {
|
|
|
field: 'syncFlag', title: '同步状态', align: 'center', sort: true, width: 120,
|
|
|
templet: function (d) {
|
...
|
...
|
@@ -315,7 +319,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function |
|
|
return ' <button type="button" class="layui-btn layui-bg-green layui-btn-radius layui-btn-xs p-0-15">已同步</button>';
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}, {field: 'times', title: '允许通知时间段', align: 'center', sort: true, width: 180}
|
|
|
, {
|
|
|
title: '操作', align: 'center', minWidth: 460, fixed: 'right', toolbar:
|
|
|
'<div>' +
|
...
|
...
|
@@ -389,8 +393,13 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function |
|
|
});
|
|
|
});
|
|
|
|
|
|
//订阅人
|
|
|
// 订阅人
|
|
|
$(".view-alarmsubscribe-users-total").on("click", function () {
|
|
|
if ($(this).text() == '0') {
|
|
|
layer.msg('暂无订阅人,请先订阅!', {icon: 7, time: 3000});
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
var id = $(this).data("id");
|
|
|
admin.req({
|
|
|
url: domainName + '/api-web/alarmsubscribe/users'
|
...
|
...
|
@@ -399,8 +408,8 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function |
|
|
if (res.data && res.data.length > 0) {
|
|
|
var trs = '';
|
|
|
$.each(res.data, function (i, v) {
|
|
|
trs += `<tr style="text-align: center"><td>${i + 1}</td><td>${v.username}</td><td>${v.nickname}</td><td>${v.email != 'undefined'?v.email:''}</td>
|
|
|
<td>${v.phone != 'undefined'?v.phone:''}</td><td>${v.operator != 'undefined'?v.operator:''}</td><td>${v.resTotal}</td><td>${v.bizTotal}</td></tr>`;
|
|
|
trs += `<tr style="text-align: center"><td>${i + 1}</td><td>${v.username}</td><td>${v.nickname}</td><td>${v.email != 'undefined' && v.email != null?v.email:''}</td>
|
|
|
<td>${v.phone != 'undefined' && v.phone != null?v.phone:''}</td><td>${v.operator != 'undefined' && v.operator != null?v.operator:''}</td><td>${v.resTotal}</td><td>${v.bizTotal}</td></tr>`;
|
|
|
});
|
|
|
var tb = `<div class="layui-form" style="padding: 0 10px;">
|
|
|
<table class="layui-table">
|
...
|
...
|
@@ -424,6 +433,84 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function |
|
|
});
|
|
|
|
|
|
});
|
|
|
// 订阅部门
|
|
|
$(".view-alarmsubscribe-org-total").on("click", function () {
|
|
|
if ($(this).text() == '0') {
|
|
|
layer.msg('暂无订阅部门,请先订阅!', {icon: 7, time: 3000});
|
|
|
return false;
|
|
|
}
|
|
|
var id = $(this).data("id");
|
|
|
admin.req({
|
|
|
url: domainName + '/api-web/alarmsubscribe/userOrg'
|
|
|
, data: {subId: id}
|
|
|
, done: function (res) {
|
|
|
if (res.data && res.data.length > 0) {
|
|
|
var trs = '';
|
|
|
$.each(res.data, function (i, v) {
|
|
|
trs += `<tr style="text-align: center"><td>${i + 1}</td><td>${v.username}</td><td>${v.nickname}</td><td>${v.orgName}</td><td>${v.email != 'undefined' && v.email != null?v.email:''}</td>
|
|
|
<td>${v.phone != 'undefined' && v.phone != null?v.phone:''}</td><td>${v.operator != 'undefined' && v.operator != null?v.operator:''}</td><td>${v.resTotal}</td><td>${v.bizTotal}</td></tr>`;
|
|
|
});
|
|
|
var tb = `<div class="layui-form" style="padding: 0 10px;">
|
|
|
<table class="layui-table">
|
|
|
<thead>
|
|
|
<tr> <th>序号</th><th>用户名</th><th>昵称</th><th>部门</th><th>邮箱</th><th>手机号</th>
|
|
|
<th>运营商</th><th>负责资源数</th><th>负责业务</th> </tr>
|
|
|
</thead>
|
|
|
<tbody> ${trs} </tbody>
|
|
|
</table>
|
|
|
</div>`;
|
|
|
layer.open({
|
|
|
type: 1
|
|
|
, title: "部门用户列表"
|
|
|
, shade: 0.8
|
|
|
, area: ['80%', '90%']
|
|
|
, id: 'alarm_subscribe_users' //设定一个id,防止重复弹出
|
|
|
, content: tb
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
});
|
|
|
// 订阅组
|
|
|
$(".view-alarmsubscribe-user-group-total").on("click", function () {
|
|
|
if ($(this).text() == '0') {
|
|
|
layer.msg('暂无订阅组,请先订阅!', {icon: 7, time: 3000});
|
|
|
return false;
|
|
|
}
|
|
|
var id = $(this).data("id");
|
|
|
admin.req({
|
|
|
url: domainName + '/api-web/alarmsubscribe/userGroup'
|
|
|
, data: {subId: id}
|
|
|
, done: function (res) {
|
|
|
if (res.data && res.data.length > 0) {
|
|
|
var trs = '';
|
|
|
$.each(res.data, function (i, v) {
|
|
|
trs += `<tr style="text-align: center"><td>${i + 1}</td><td>${v.username}</td><td>${v.nickname}</td><td>${v.userGroupName}</td><td>${v.email != 'undefined' && v.email != null?v.email:''}</td>
|
|
|
<td>${v.phone != 'undefined' && v.phone != null?v.phone:''}</td><td>${v.operator != 'undefined' && v.operator != null?v.operator:''}</td><td>${v.resTotal}</td><td>${v.bizTotal}</td></tr>`;
|
|
|
});
|
|
|
var tb = `<div class="layui-form" style="padding: 0 10px;">
|
|
|
<table class="layui-table">
|
|
|
<thead>
|
|
|
<tr> <th>序号</th><th>用户名</th><th>昵称</th><th>用户组</th><th>邮箱</th><th>手机号</th>
|
|
|
<th>运营商</th><th>负责资源数</th><th>负责业务</th> </tr>
|
|
|
</thead>
|
|
|
<tbody> ${trs} </tbody>
|
|
|
</table>
|
|
|
</div>`;
|
|
|
layer.open({
|
|
|
type: 1
|
|
|
, title: "用户组用户列表"
|
|
|
, shade: 0.8
|
|
|
, area: ['80%', '90%']
|
|
|
, id: 'alarm_subscribe_users' //设定一个id,防止重复弹出
|
|
|
, content: tb
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
});
|
|
|
|
|
|
//设置同步
|
|
|
form.on('switch(switchSyncalarmsubscribe)', function (obj) {
|
...
|
...
|
|