<div class="basitop">
<div class="baserchbox">
<input type="text" placeholder="请输入" class="jsserchs" name="" id="" value="" /><span class="jssub"></span>
</div>
<form style="display: none" class="formadd" target="frame1" enctype="multipart/form-data" method="post" action="">
<input type="submit" class="submitaddbtn" value="导入" />
<input type="file" name="file" class="fileinp"/>
</form>
<span class="to2">导出</span>
<iframe class="iframecon" name="frame1" frameborder="0" height="0" width="0"></iframe>
</div>
<div class="tabs" style="height: calc(100% - 70px);">
<table id="test" lay-filter="test"></table>
</div>
<div class="pap" style="margin-top: 10px;">
<div class="pages">
<div value="1 0"></div>
<div id="withinpage" class="page_div"></div>
</div>
</div>
<!--<div class="withbox tablebigbox" style="width: calc( 100% - 29px);overflow-x: auto;">
<table style="width: 300%;" border="" cellspacing="" cellpadding="" class="withtable renttab jsbatable villagetable">
<thead>
<tr>
<th rowspan="2">详细</th>
<th rowspan="2">日期</th>
<th colspan="2">主键信息</th>
<th colspan="10">位置信息</th>
<th colspan="5">小区类型</th>
<th colspan="11">覆盖区域</th>
<th colspan="11">天线信息</th>
<th rowspan="2">CI</th>
<th rowspan="2">流量(MB)</th>
<th rowspan="2">话务量(Erl)</th>
</tr>
<tr>
<th>小区编号 </th>
<th>扇区中文名 </th>
<th>省 </th>
<th>城市 </th>
<th>行政区 </th>
<th>分局 </th>
<th>经度 </th>
<th>纬度 </th>
<th>物理站点编号 </th>
<th>归属物理站点名称 </th>
<th>铁塔编号 </th>
<th>铁塔名称 </th>
<th>网络类型 </th>
<th>基站类型 </th>
<th>是否拉远 </th>
<th>频率 </th>
<th>厂家 </th>
<th>区域类型 </th>
<th>高速名称 </th>
<th>高铁名称 </th>
<th>校园名称 </th>
<th>景区 </th>
<th>是否地铁小区 </th>
<th>隧道/站台 </th>
<th>地铁线路 </th>
<th>隧道/站台名称 </th>
<th>是否边界基站 </th>
<th>对应城市名称 </th>
<th>天线编号</th>
<th>是否与800M共天线 </th>
<th>是否与1.8G共天线 </th>
<th>是否与2.1G共天线 </th>
<th>是否与CDMA共天线 </th>
<th>方向类型 </th>
<th>方位角(度) </th>
<th>电子下倾角(度) </th>
<th>机械下倾角(度) </th>
<th>天线高度(米) </th>
<th>海拔高度(米) </th>
</tr>
</thead>
<tbody>
<tr>
<td>加载中</td>
</tr>
</tbody>
</table>
</div>-->
<div class="pap">
<div class="pages">
<div value="1 0"></div>
<div id="withinpage" class="page_div"></div>
</div>
</div>
<div class="shadeb" style="display: none;">
<p>
<span>小区编号:</span>
<b class="fshow1 w150 ddd"></b>
</p>
<p>
<span>扇区中文名:</span>
<b class="fshow2 w150 ddd"></b>
</p>
<p>
<span>分局:</span>
<input type="text" name="substation" placeholder="请输入"/>
</p>
</div>
<script type="text/html" id="barDemo">
<p class="messagebtn"><span class="layui-btn layui-btn-xs" lay-event="messs" title="详情"></span></p>
</script>
<script>
var heig = $(".tabs").height();
var arr1=[];
var arr2=[];
pagesize = Math.floor(($(".main").height() - 156) / 24)
var withindata = {
'city': Git.withid,
'type': Git.type,
'zType': Git.zType,
'cityCode':Git.citycode,
'pageSize': pagesize,
'cityName':Git.withid,
"queryCol":Git.hk,
"token":localStorage.token,
"username":localStorage.username
}
if(withindata.vType == 0){
delete withindata.vType
}
// if(SDHF.islogin()) {
showinitwithin(withindata);
// } else {
// }
if(Git.workorder==1){//从地图上面直接点过来
// showtable();
}
var dataarr=[];
//city: "成都" city: "成都"
//cityCode: undefined cityCode: undefined
//cityName: "成都" cityName: "成都"
//pageSize: 5 currentPage: 1
//queryCol: "unfill_village_num" pageSize: 5
//token: "00a9809c45a7bd57887d5219fa458ad3" queryCol: "unfill_village_num"
//type: "1" searchCondition: "CD00095910H"
//username: "15881141230" token: "00a9809c45a7bd57887d5219fa458ad3"
//zType: "2" type: "1"
// username: "15881141230"
// zType: "2"
function showinitwithin(withindata) {
console.log(withindata);
arr1=[];
arr2=[];
// {field:'flow_mb',align:'center', title: '流量(MB)',width:103,rowspan:2},
// {field:'traffic_volume_erl',align:'center', title: '话务量(Erl)',width:103,rowspan:2},
var colsdata;
if(Git.hk=='village_num'){//在网小区数
colsdata = [
[
{field:'date',align:'center', title: '日期',rowspan:2},
{align:'center', title: '主键信息 ',colspan:2},
{align:'center', title: '位置信息',colspan:10},
{align:'center', title: '小区类型',width:103,colspan:5},
{align:'center', title: '覆盖区域 ',width:103,colspan:11},
{align:'center', title: '天线信息',colspan:11},
{field:'ci',align:'center', title: 'CI',rowspan:2},
{align:'center', title: '详细',fixed:'right', toolbar: '#barDemo',rowspan:2}
],
[
{field:'village_id',align:'center', title: '小区编号'},
{field:'sector_name_cn',align:'center', title: '扇区中文名'},
{field:'province_name',align:'center', title: '省'},
{field:'city_name',align:'center', title: '城市'},
{field:'county_name',align:'center', title: '行政区'},
{field:'village_substation',align:'center', title: '分局'},
{field:'lon',align:'center', title: '经度'},
{field:'lat',align:'center', title: '纬度'},
{field:'tower_id',align:'center', title: '物理站点编号'},
{field:'tower_name',align:'center', title: '归属物理站点名称'},
{field:'physics_id',align:'center', title: '铁塔编号'},
{field:'attribution_physics_site_name',align:'center', title: '铁塔名称'},
{field:'network_type',align:'center', title: '网络类型'},
{field:'base_station_type',align:'center', title: '基站类型'},
{field:'is_pull_far',align:'center', title: '是否拉远'},
{field:'frequency',align:'center', title: '频率'},
{field:'manufactor',align:'center', title: '厂家'},
{field:'regional_type',align:'center', title: '区域类型'},
{field:'expressways_name',align:'center', title: '高速名称'},
{field:'high_speed_name',align:'center', title: '高铁名称'},
{field:'school_name',align:'center', title: '校园名称'},
{field:'scenic_spot',align:'center', title: '景区'},
{field:'is_metro_district',align:'center', title: '是否地铁小区'},
{field:'tunnel_or_platform',align:'center', title: '隧道/站台 '},
{field:'metro_line',align:'center', title: '地铁线路'},
{field:'tunnel_or_platform_name',align:'center', title: '隧道/站台名称'},
{field:'is_boundary_base_station',align:'center', title: '是否边界基站'},
{field:'opposite_city_name',align:'center', title: '对应城市名称'},
{field:'antenna_id',align:'center', title: '天线编号'},
{field:'is_antennai_800',align:'center', title: '是否与800M共天线'},
{field:'is_antennai_18',align:'center', title: '是否与1.8G共天线'},
{field:'is_antennai_21',align:'center', title: '是否与2.1G共天线'},
{field:'is_antennai_cdma',align:'center', title: '是否与CDMA共天线'},
{field:'direction_type',align:'center', title: '方向类型'},
{field:'azimuth',align:'center', title: '方位角(度)'},
{field:'electron_dip_angle',align:'center', title: '电子下倾角(度)'},
{field:'mechanical_downdip',align:'center', title: '机械下倾角(度)'},
{field:'antenna_height',align:'center', title: '天线高度(米)'},
{field:'altitude',align:'center', title: '海拔高度(米)'},
]
]
for(var i=0,len=colsdata[1].length;i<len;i++){
arr1.push(colsdata[1][i].title)
arr2.push(colsdata[1][i].field)
}
arr1.unshift('日期')
arr1.push('CI')
arr2.unshift('date')
arr2.push('ci')
}else if(Git.hk=='reduce_village_num'){//减少小区数
colsdata = [
[
{field:'date',align:'center', title: '日期',rowspan:2},
{align:'center', title: '主键信息 ',colspan:2},
{align:'center', title: '位置信息',colspan:10},
{align:'center', title: '小区类型',width:103,colspan:5},
{align:'center', title: '覆盖区域 ',width:103,colspan:11},
{align:'center', title: '天线信息',colspan:11} ,
{field:'ci',align:'center', title: 'CI',rowspan:2},
],
[
{field:'village_id',align:'center', title: '小区编号'},
{field:'sector_name_cn',align:'center', title: '扇区中文名'},
{field:'province_name',align:'center', title: '省'},
{field:'city_name',align:'center', title: '城市'},
{field:'county_name',align:'center', title: '行政区'},
{field:'village_substation',align:'center', title: '分局'},
{field:'lon',align:'center', title: '经度'},
{field:'lat',align:'center', title: '纬度'},
{field:'tower_id',align:'center', title: '物理站点编号'},
{field:'tower_name',align:'center', title: '归属物理站点名称'},
{field:'physics_id',align:'center', title: '铁塔编号'},
{field:'attribution_physics_site_name',align:'center', title: '铁塔名称'},
{field:'network_type',align:'center', title: '网络类型'},
{field:'base_station_type',align:'center', title: '基站类型'},
{field:'is_pull_far',align:'center', title: '是否拉远'},
{field:'frequency',align:'center', title: '频率'},
{field:'manufactor',align:'center', title: '厂家'},
{field:'regional_type',align:'center', title: '区域类型'},
{field:'expressways_name',align:'center', title: '高速名称'},
{field:'high_speed_name',align:'center', title: '高铁名称'},
{field:'school_name',align:'center', title: '校园名称'},
{field:'scenic_spot',align:'center', title: '景区'},
{field:'is_metro_district',align:'center', title: '是否地铁小区'},
{field:'tunnel_or_platform',align:'center', title: '隧道/站台'},
{field:'metro_line',align:'center', title: '地铁线路'},
{field:'tunnel_or_platform_name',align:'center', title: '隧道/站台名称'},
{field:'is_boundary_base_station',align:'center', title: '是否边界基站'},
{field:'opposite_city_name',align:'center', title: '对应城市名称'},
{field:'antenna_id',align:'center', title: '天线编号'},
{field:'is_antennai_800',align:'center', title: '是否与800M共天线'},
{field:'is_antennai_18',align:'center', title: '是否与1.8G共天线'},
{field:'is_antennai_21',align:'center', title: '是否与2.1G共天线'},
{field:'is_antennai_cdma',align:'center', title: '是否与CDMA共天线'},
{field:'direction_type',align:'center', title: '方向类型'},
{field:'azimuth',align:'center', title: '方位角(度)'},
{field:'electron_dip_angle',align:'center', title: '电子下倾角(度)'},
{field:'mechanical_downdip',align:'center', title: '机械下倾角(度)'},
{field:'antenna_height',align:'center', title: '天线高度(米)'},
{field:'altitude',align:'center', title: '海拔高度(米)'},
{field:'',align:'center', title: '详细',fixed:'right', toolbar: '#barDemo',rowspan:2}
]
]
for(var i=0,len=colsdata[1].length;i<len;i++){
arr1.push(colsdata[1][i].title)
arr2.push(colsdata[1][i].field)
}
arr1.unshift('日期')
arr1.push('CI')
arr2.unshift('date')
arr2.push('ci')
}else if(Git.hk=='unfill_village_num'){//信息缺失
colsdata = [
[
{field:'date',align:'center', title: '日期',rowspan:2},
{align:'center', title: '主键信息 ',colspan:2},
{align:'center', title: '位置信息',colspan:10},
{align:'center', title: '小区类型',width:103,colspan:5},
{align:'center', title: '覆盖区域 ',width:103,colspan:11},
{align:'center', title: '天线信息',colspan:11},
{field:'ci',align:'center', title: 'CI',rowspan:2},
{field:'',align:'center', title: '详细',fixed:'right', toolbar: '#barDemo',rowspan:2},
],
[
{field:'village_id',align:'center', title: '小区编号'},
{field:'sector_name_cn',align:'center', title: '扇区中文名'},
{field:'province_name',align:'center', title: '省'},
{field:'city_name',align:'center', title: '城市'},
{field:'county_name',align:'center', title: '行政区'},
{field:'village_substation',align:'center', title: '分局'},
{field:'lon',align:'center', title: '经度'},
{field:'lat',align:'center', title: '纬度'},
{field:'tower_id',align:'center', title: '物理站点编号'},
{field:'tower_name',align:'center', title: '归属物理站点名称'},
{field:'physics_id',align:'center', title: '铁塔编号'},
{field:'attribution_physics_site_name',align:'center', title: '铁塔名称'},
{field:'network_type',align:'center', title: '网络类型'},
{field:'base_station_type',align:'center', title: '基站类型'},
{field:'is_pull_far',align:'center', title: '是否拉远'},
{field:'frequency',align:'center', title: '频率'},
{field:'manufactor',align:'center', title: '厂家'},
{field:'regional_type',align:'center', title: '区域类型'},
{field:'expressways_name',align:'center', title: '高速名称'},
{field:'high_speed_name',align:'center', title: '高铁名称'},
{field:'school_name',align:'center', title: '校园名称'},
{field:'scenic_spot',align:'center', title: '景区'},
{field:'is_metro_district',align:'center', title: '是否地铁小区'},
{field:'tunnel_or_platform',align:'center', title: '隧道/站台'},
{field:'metro_line',align:'center', title: '地铁线路'},
{field:'tunnel_or_platform_name',align:'center', title: '隧道/站台名称'},
{field:'is_boundary_base_station',align:'center', title: '是否边界基站'},
{field:'opposite_city_name',align:'center', title: '对应城市名称'},
{field:'antenna_id',align:'center', title: '天线编号'},
{field:'is_antennai_800',align:'center', title: '是否与800M共天线'},
{field:'is_antennai_18',align:'center', title: '是否与1.8G共天线'},
{field:'is_antennai_21',align:'center', title: '是否与2.1G共天线'},
{field:'is_antennai_cdma',align:'center', title: '是否与CDMA共天线'},
{field:'direction_type',align:'center', title: '方向类型'},
{field:'azimuth',align:'center', title: '方位角(度)'},
{field:'electron_dip_angle',align:'center', title: '电子下倾角(度)'},
{field:'mechanical_downdip',align:'center', title: '机械下倾角(度)'},
{field:'antenna_height',align:'center', title: '天线高度(米)'},
{field:'altitude',align:'center', title: '海拔高度(米)'}
]
]
for(var i=0,len=colsdata[1].length;i<len;i++){
arr1.push(colsdata[1][i].title)
arr2.push(colsdata[1][i].field)
}
arr1.unshift('日期')
arr1.push('CI')
arr2.unshift('date')
arr2.push('ci')
}else if(Git.hk=='lon_lat_village_num'){//经纬度偏差
colsdata = [
[
{field:'date',align:'center', title: '日期',rowspan:2},
{align:'center', title: '主键信息',colspan:2},
{align:'center', title: '位置信息',colspan:10},
{align:'center', title: '小区类型',width:103,colspan:5},
{align:'center', title: '覆盖区域 ',width:103,colspan:11},
{align:'center', title: '天线信息',colspan:11},
{field:'ci',align:'center', title: 'CI',rowspan:2},
// {field:'flow_mb',align:'center', title: '流量(MB)',width:103,rowspan:2},
// {field:'traffic_volume_erl',align:'center', title: '话务量(Erl)',width:103,rowspan:2},
{field:'',align:'center', title: '详细',fixed:'right', toolbar: '#barDemo',rowspan:2},
],
[
{field:'village_id',align:'center', title: '小区编号'},
{field:'sector_name_cn',align:'center', title: '扇区中文名'},
{field:'province_name',align:'center', title: '省'},
{field:'city_name',align:'center', title: '城市'},
{field:'county_name',align:'center', title: '行政区'},
{field:'village_substation',align:'center', title: '分局'},
{field:'lon',align:'center', title: '经度'},
{field:'lat',align:'center', title: '纬度'},
{field:'tower_id',align:'center', title: '物理站点编号'},
{field:'tower_name',align:'center', title: '归属物理站点名称'},
{field:'physics_id',align:'center', title: '铁塔编号'},
{field:'attribution_physics_site_name',align:'center', title: '铁塔名称'},
{field:'network_type',align:'center', title: '网络类型'},
{field:'base_station_type',align:'center', title: '基站类型'},
{field:'is_pull_far',align:'center', title: '是否拉远'},
{field:'frequency',align:'center', title: '频率'},
{field:'manufactor',align:'center', title: '厂家'},
{field:'regional_type',align:'center', title: '区域类型'},
{field:'expressways_name',align:'center', title: '高速名称'},
{field:'high_speed_name',align:'center', title: '高铁名称'},
{field:'school_name',align:'center', title: '校园名称'},
{field:'scenic_spot',align:'center', title: '景区'},
{field:'is_metro_district',align:'center', title: '是否地铁小区'},
{field:'tunnel_or_platform',align:'center', title: '隧道/站台'},
{field:'metro_line',align:'center', title: '地铁线路'},
{field:'tunnel_or_platform_name',align:'center', title: '隧道/站台名称'},
{field:'is_boundary_base_station',align:'center', title: '是否边界基站'},
{field:'opposite_city_name',align:'center', title: '对应城市名称'},
{field:'antenna_id',align:'center', title: '天线编号'},
{field:'is_antennai_800',align:'center', title: '是否与800M共天线'},
{field:'is_antennai_18',align:'center', title: '是否与1.8G共天线'},
{field:'is_antennai_21',align:'center', title: '是否与2.1G共天线'},
{field:'is_antennai_cdma',align:'center', title: '是否与CDMA共天线'},
{field:'direction_type',align:'center', title: '方向类型'},
{field:'azimuth',align:'center', title: '方位角(度)'},
{field:'electron_dip_angle',align:'center', title: '电子下倾角(度)'},
{field:'mechanical_downdip',align:'center', title: '机械下倾角(度)'},
{field:'antenna_height',align:'center', title: '天线高度(米)'},
{field:'altitude',align:'center', title: '海拔高度(米)'}
// {field:'a',align:'center', title: '计算经度'}
// {field:'a',align:'center', title: '计算纬度'}
]
]
for(var i=0,len=colsdata[1].length;i<len;i++){
arr1.push(colsdata[1][i].title)
arr2.push(colsdata[1][i].field)
}
arr1.unshift('日期')
arr1.push('CI')
arr2.unshift('date')
arr2.push('ci')
}else if(Git.hk=='zero_village_num'){//0业务
colsdata = [
[
{field:'date',align:'center', title: '日期',rowspan:2,width:150},
{align:'center', title: '主键信息 ',colspan:2,width:150},
{align:'center', title: '位置信息',colspan:6,width:100},
{field:'',align:'center', title: '详细',fixed:'right', toolbar: '#barDemo',rowspan:2},
],
[
{field:'village_id',align:'center', title: '小区编号',width:130},
{field:'sector_name_cn',align:'center', title: '扇区中文名',width:500},
{field:'province_name',align:'center', title: '省',width:100},
{field:'city_name',align:'center', title: '城市',width:100},
{field:'county_name',align:'center', title: '行政区',width:100},
{field:'village_substation',align:'center', title: '分局',width:100},
{field:'lon',align:'center', title: '经度',width:100},
{field:'lat',align:'center', title: '纬度',width:100},
]
]
for(var i=0,len=colsdata[1].length;i<len;i++){
arr1.push(colsdata[1][i].title)
arr2.push(colsdata[1][i].field)
}
arr1.unshift('日期')
arr2.unshift('date')
}else if(Git.hk=='coverage_anomaly'){//覆盖异常
colsdata = [
[
{field:'date',align:'center', title: '日期',rowspan:2,width:150},
{align:'center', title: '主键信息 ',colspan:2,width:150},
{align:'center', title: '位置信息',colspan:6,width:100},
{field:'wirless_cover_flag',align:'center', title: '异常类型',rowspan:2},
{field:'',align:'center', title:'详细',fixed:'right', toolbar: '#barDemo',rowspan:2},
],
[
{field:'village_id',align:'center', title: '小区编号',width:130},
{field:'sector_name_cn',align:'center', title: '扇区中文名',width:500},
{field:'province_name',align:'center', title: '省',width:100},
{field:'city_name',align:'center', title: '城市',width:100},
{field:'county_name',align:'center', title: '行政区',width:100},
{field:'village_substation',align:'center', title: '分局',width:100},
{field:'lon',align:'center', title: '经度',width:100},
{field:'lat',align:'center', title: '纬度',width:100},
// {field:'lat',align:'center', title: '异常覆盖',width:100},
]
]
for(var i=0,len=colsdata[1].length;i<len;i++){
arr1.push(colsdata[1][i].title)
arr2.push(colsdata[1][i].field)
}
arr1.unshift('日期')
arr2.unshift('date')
}else if(Git.hk=='degradation'){//性能劣化
colsdata = [
[
{field:'date',align:'center', title: '日期',rowspan:2,width:150},
{align:'center', title: '主键信息 ',colspan:2,width:150},
{align:'center', title: '位置信息',colspan:6,width:100},
{field:'drop_word_rate',align:'center', title: '掉话',width:100,rowspan:2},
{field:'access_success_rate',align:'center', title: '接入',width:100,rowspan:2},
{field:'drop_line_rate',align:'center', title: '掉线',width:100,rowspan:2},
{field:'con_success_rate',align:'center', title: '连接',width:100,rowspan:2},
{field:'',align:'center', title: '详细',fixed:'right', toolbar: '#barDemo',rowspan:2},
],
[
{field:'village_id',align:'center', title: '小区编号 ',width:130},
{field:'sector_name_cn',align:'center', title: '扇区中文名',width:500},
{field:'province_name',align:'center', title: '省',width:100},
{field:'city_name',align:'center', title: '城市',width:100},
{field:'county_name',align:'center', title: '行政区',width:100},
{field:'village_substation',align:'center', title: '分局',width:100},
{field:'lon',align:'center', title: '经度',width:100},
{field:'lat',align:'center', title: '纬度',width:100},
]
]
for(var i=0,len=colsdata[1].length;i<len;i++){
arr1.push(colsdata[1][i].title)
arr2.push(colsdata[1][i].field)
}
arr1.unshift('日期');arr1.push('掉话');arr1.push('接入');arr1.push('掉线');arr1.push('连接');
arr2.unshift('date');arr2.push('drop_word_rate');arr2.push('access_success_rate');arr2.push('drop_line_rate');arr2.push('con_success_rate');
}
layui.use('table', function(){
var table = layui.table;
table.render({
height:heig
,size:'sm'
,elem: '#test'
,method: 'post' //如果无需自定义HTTP类型,可不加该参数
,url: url + "baseDataManage/getVillageBaseNew"
,contentType: 'application/json'
,where: withindata //如果无需传递额外参数,可不加该参数
,cellMinWidth: 80 //全局定义常规单元格的最小宽度,layui 2.2.1 新增
,parseData: function(data){ //res 即为原始返回的数据
console.log(data);
if(data.data.totalPage>1){
$("#withinpage").show();
$("#withinpage").paging({
pageNo:data.data.currentPage,
totalPage: data.data.totalPage,
callback: function(num) {
withindata.currentPage=num
showinitwithin(withindata);
}
})
}else{
// data.code=0
$("#withinpage").hide();
}
return {
"code": data.code, //解析接口状态
"msg": data.msg, //解析提示文本
"count": data.data.total, //解析数据长度
"data": data.data.rows //解析数据列表
};
},
cols: colsdata,
done : function(res, curr, count){
tableList=res.data;
// $('th').css({'background-color': '#F2F2F7', 'color': '#333','font-weight':'600'})
$('th').css({ 'color': '#333','font-weight':'600'})
$('.layui-form,td,th').css({'border-color':'#b4cdff'})
$('.layui-table-header').css({'border-bottom':'1px solid #b4cdff'})
$('th').css({'border-color':'red !important'})
$('.layui-table-fixed-r th').css({'height':'60px'})
}
});
//以复选框事件为例
//监听行工具事件
table.on('tool(test)', function(obj){
var data = obj.data;
if(obj.event === 'messs'){
if(Git.isgong==1){
window.open('index.html?id=Basicsinformation&withid=&idtowerid='+data.tower_id+'&lon='+data.lon+'&lat='+data.lat+'&islogin=1&workorder=1');
}else{
window.open('index.html?id=Basicsinformation&withid=&idtowerid='+data.tower_id+'&lon='+data.lon+'&lat='+data.lat);
}
layer.close(index);
}
});
});
}
/*导出*/
var a=0;
var st;
$(".main").on("click", ".to2", function() {
withindata.headers=arr1;
withindata.fields=arr2;
// $('#test').next().find('.layui-table-box>.layui-table-header th').each(function(){
// console.log($(this).attr('vl'));
// if(!$(this).attr('colspan')){
// a.push($(this).find('span').text());
// b.push($(this).attr('data-field'));
// }
// })
windowOpen(url+'baseDataManage/exportVillageBaseNew',withindata)
})
function getstate() {
$.ajax({
type: "post",
url: url + "baseDataManage/flushProgress",
contentType: "application/json",
async: true,
dataType:"json",
data: JSON.stringify({
city_name:Git.withid,
type:Git.type,
vType:Git.vType,
token:localStorage.token,
username:localStorage.username
}),
success: function(data) {
layer.msg("下载时间约为"+data+"分钟",{icon:0,time:4000});
}
});
}
/*导入*/
$(".formadd").attr('action',url+'baseDataManage/import');
$(".main").on("change",".fileinp",function(){
// gettotle_showtime();
var form = new FormData($(".formadd")[0]);
$.ajax({
url: url+"baseDataManage/import",
type: "post",
data: form,
dataType: "json",
processData: false,
contentType: false,
async: false,
success: function (data) {
if(data.code==0){
if(data.data == 1){
layui.use('layer', function() {
layer.msg("导入成功",{icon:6,time:2000});
})
withindata.currentPage = 1;
showinitwithin(withindata)
}else{
layui.use('layer', function() {
layer.msg("导入失败了!",{icon:0,time:2000});
})
}
$(".fileinp").val('');
}else if(data.code==-1){
layer.msg("导入失败了!",{icon:0,time:2000});
$(".fileinp").val('');
}
}
})
})
//搜索
//$(".main").on("keyup",".jsserchs",function(event){
// if(event.keyCode ==13){
// var name = $('.jsserchs').val();
// withindata.searchCondition = name;
// withindata.currentPage = 1;
// showinitwithin(withindata)
// }
// });
$(".main").on("click",".jssub",function(){
var name = $('.jsserchs').val();
withindata.searchCondition = name;
withindata.currentPage = 1;
// console.log(withindata);
showinitwithin(withindata)
})
// 修改
$(".main").on("click",".jschange",function(){
$(".shadeb p input[type=text]").val('');
var village_id=$(this).parents('tr').attr('idvillage_id');
var _this=$(this);
layer.open({
type: 1,
title:'修改',
skin:'sd',
area:['auto', 'auto'],
content:$('.shadeb'),
btn:['保存','取消'],
btn1: function (index,layero) {
var basicdata={};
basicdata.village_id=village_id
basicdata.village_substation=$('input[name=substation]').val();
basicchange(basicdata)
layer.close(index);
},
btn2:function (index,layero) {
layer.close(index);
}
});
for(var i=0,len=dataarr.length;i<len;i++){
if(village_id == dataarr[i].village_id){
$('.fshow1').text(dataarr[i].village_id);$('.fshow1').attr('title',dataarr[i].village_id);
$('.fshow2').text(dataarr[i].sector_name_cn);$('.fshow2').attr('title',dataarr[i].sector_name_cn);
$('input[name=substation]').val(dataarr[i].village_substation);
}
}
})
function basicchange(basicdata){
$.ajax({
type: "post",
url: url + "baseDataManage/updateVillage",
contentType: "application/json",
async: true,
dataType:"json",
data: JSON.stringify(basicdata),
success: function(data) {
if(data.code==200){
if(data.data==1){
withindata.currentPage = 1;
showinitwithin(withindata)
layer.msg("修改成功",{icon:6,time:2000});
}else if(data.data==0){
layer.msg("修改失败",{icon:0,time:2000});
}
}
}
});
}
</script>