yzt
2023-09-27 726603df43447f8cfedfeaae4267209adbd01699
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
<div class="header-container">
 
</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);
            },
        });
 
 
        //添加地图选项下拉框
        $.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>