<div class="header-container">
|
<header class="header navbar navbar-expand-sm">
|
<a href="javascript:void(0);" class="sidebarCollapse" data-placement="bottom"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-menu"><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="18" x2="21" y2="18"></line></svg></a>
|
<div class="nav-logo align-self-center" style ="margin: auto">
|
<a class="navbar-brand" href=""> <span class="navbar-brand-name" style="font-size:44px;text-align:center;font-family: STHeiti;" id="headTitle"></span></a>
|
</div>
|
</header>
|
</div>
|
<script>
|
$(document).ready(function(){
|
var title=""
|
$.ajax({
|
async : false, //同步的
|
type : "POST",
|
url : "/hxzkoa/getSysSetting_list.do",
|
data : {
|
|
},
|
dataType : "json",
|
success:function(data){
|
title = data[0].title
|
var obj = document.getElementById("headTitle");
|
console.log("head:",title)
|
obj.innerText= title;
|
},
|
});
|
|
|
//添加地图选项下拉框
|
$.ajax({
|
async:false,
|
type:"POST",
|
url:"/hxzkoa/qiehuanditu_option.do",
|
dataType:'json',
|
data:{},
|
success:function(data){
|
console.log("data", data);
|
for(var i=0;i<data.length;i++){
|
var option="<option value=\""+data[i].mapname+"\"";
|
option += ">"+data[i].mapname+"</option>";
|
btn = document.getElementById("qiehuanditu");
|
btn.options.add(new Option(data[i].mapname,data[i].mapname));
|
};
|
},
|
});
|
|
//设置地图选中标示
|
var current_map = getMapNow();
|
set_select_checked("qiehuanditu", current_map);
|
});
|
|
function getMapNow(){
|
var map;
|
$.ajax({
|
async:false,
|
type:"POST",
|
url:"/hxzkoa/qiehuanditu_get.do",
|
dataType:'json',
|
data:{},
|
success:function(data){
|
console.log("qiehuanditu_get",data);
|
map=data[0];
|
},
|
})
|
return map
|
};
|
|
function set_select_checked(selectId, checkValue){
|
var select = document.getElementById(selectId);
|
|
for (var i = 0; i < select.options.length; i++){
|
if (select.options[i].value == checkValue){
|
select.options[i].selected = true;
|
break;
|
}
|
}
|
};
|
|
|
|
</script>
|
|
<!-- Modal -->
|
<div class="modal fade register-modal" id="profileModal" tabindex="-1" role="dialog" aria-labelledby="profileModalLabel" aria-hidden="true">
|
<div class="modal-dialog modal-sm" role="document">
|
<div class="modal-content">
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
<span aria-hidden="true">×</span>
|
</button>
|
<div class="modal-body text-center">
|
<select class="form-control form-control-lg" id="qiehuanditu">
|
<option value="百度地图">百度地图</option>
|
</select>
|
</div>
|
<div class="modal-footer justify-content-center mb-4">
|
<a href="/hxzkoa/show.do"><button type="button" class="btn" onclick=changemap()>切换</button></a>
|
</div>
|
</div>
|
</div>
|
</div>
|
|
<script>
|
function changemap(){
|
var map_now = document.getElementById("qiehuanditu").value;
|
console.log(map_now);
|
$.ajax({
|
async:false,
|
type:"POST",
|
url:"/hxzkoa/qiehuanditu_save.do",
|
dataType:'json',
|
data:{
|
map_now:map_now
|
},
|
success:function(data){
|
},
|
});
|
}
|
</script>
|