2025-01-10 14:42:38 +08:00
|
|
|
{extend name="../../admin/view/table"}
|
|
|
|
{block name="button"}
|
|
|
|
<!--{if auth("add")}-->
|
2025-01-10 19:26:59 +08:00
|
|
|
<button data-modal='{:url("add")}' data-title="添加携转检测数据" class='layui-btn layui-btn-sm layui-btn-primary'>添加携转检测数据</button>
|
2025-01-10 14:42:38 +08:00
|
|
|
<!--{/if}-->
|
|
|
|
{/block}
|
|
|
|
|
|
|
|
{block name="content"}
|
|
|
|
|
|
|
|
<!--<div class="layui-tab layui-tab-card think-bg-white table-block">-->
|
|
|
|
|
|
|
|
<!-- <div class="layui-tab-content think-box-shadow table-block table-block">-->
|
|
|
|
<div class="think-box-shadow">
|
|
|
|
|
|
|
|
{include file='mobile_mnp/index_search'}
|
|
|
|
<div class="think-box-shadow">
|
|
|
|
<table id="MobileMnpData" data-target-search="form.form-search"></table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- </div>-->
|
|
|
|
<!--</div>-->
|
|
|
|
{/block}
|
|
|
|
|
|
|
|
{block name='script'}
|
|
|
|
<script>
|
|
|
|
$(function () {
|
|
|
|
// 定义运营商映射对象
|
|
|
|
var ispMap = {
|
|
|
|
1: '移动',
|
|
|
|
2: '联通',
|
|
|
|
3: '电信'
|
|
|
|
};
|
|
|
|
var mnpMap = {
|
|
|
|
1: '已携转',
|
|
|
|
0: '未携转'
|
|
|
|
};
|
|
|
|
var statusMap = {
|
|
|
|
1: '正常',
|
|
|
|
0: '禁用'
|
|
|
|
};
|
|
|
|
|
|
|
|
// 动态创建 layui.table 表格
|
|
|
|
$('#MobileMnpData').layTable({
|
|
|
|
url: '{:sysuri()}',
|
|
|
|
// toolbar: '#toolbar',
|
|
|
|
// console: console.log(),
|
|
|
|
even: true, height: 'full',
|
|
|
|
sort: {field: 'id', type: 'desc'},
|
|
|
|
cols: [[
|
|
|
|
{checkbox: true},
|
|
|
|
{field: 'id', title: 'ID', width: 80, sort: true, align: 'center'},
|
|
|
|
{field: 'mobile', title: '手机号', minWidth: 100, align: 'center'},
|
|
|
|
|
|
|
|
{
|
|
|
|
field: 'old_isp',
|
|
|
|
title: '原运营商',
|
|
|
|
minWidth: 120,
|
|
|
|
templet: function(d) {
|
|
|
|
return ispMap[d.old_isp] || '未知';
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'new_isp',
|
|
|
|
title: '现运营商',
|
|
|
|
minWidth: 120,
|
|
|
|
templet: function(d) {
|
|
|
|
return ispMap[d.new_isp] || '未知';
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'is_mnp',
|
|
|
|
title: '是否携转',
|
|
|
|
minWidth: 120,
|
|
|
|
templet: function(d) {
|
|
|
|
return mnpMap[d.is_mnp] || '未知';
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{field: 'desc', title: '描述', minWidth: 120},
|
|
|
|
{field: 'status', title: '状态', minWidth: 100, templet: function(d) {
|
|
|
|
return statusMap[d.status] || '未知';
|
|
|
|
}},
|
|
|
|
{field: 'create_at', title: '操作时间', minWidth: 170, align: 'center', sort: true},
|
|
|
|
{toolbar: '#toolbar', title: '操作面板', align: 'center', fixed: 'right'}
|
|
|
|
]],
|
|
|
|
|
|
|
|
error: function(error) {
|
|
|
|
console.error('请求失败:', error);
|
|
|
|
alert('请求失败,请稍后再试');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
// 监听原 layui.table 的 toolbar 事件
|
|
|
|
$('#MobileMnpData').trigger('toolbar', function (item) {
|
|
|
|
// 对应 layui.table 写法 layui.table.on('toolbar(OplogData)',function(){ })
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<script type="text/html" id="toolbar">
|
|
|
|
<!--{if auth('remove')}-->
|
|
|
|
<a data-action='{:url("remove")}' data-value="id#{{d.id}}" data-confirm="确认要删除这条记录吗?" class="layui-btn layui-btn-sm layui-btn-danger">删 除</a>
|
|
|
|
<!--{/if}-->
|
|
|
|
</script>
|
|
|
|
{/block}
|