yzt
2023-05-26 de4278af2fd46705a40bac58ec01122db6b7f3d7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<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">&times;</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>