fei.wang
2024-04-16 70223b3ef4df02622869425fed4ba9b290e1aa74
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
 
layui.use('table', function(){
    var table = layui.table;
    var layer = layui.layer;
    var laytpl = layui.laytpl;
    var form = layui.form;
 
    //告警汇总
    table.render({
        elem: '#mapShow'
        ,url: '/hxzkuwb/MapShow'
        ,size:'sm'
        ,height:650
 
        ,toolbar:'#toolbarDemo' //开启工具栏,此处显示默认图标,可以自定义模板,详见文档
        ,cols: [[ //表头
            {type:'checkbox',sort: true,fixed: "left"}
            ,{field: 'id', title: '序号', sort: true}
            ,{ field: 'type', title: '类型'}
            ,{ field: 'zhuti', title: '主题'}
            ,{ field: 'map', title: '地图'}
            ,{ field: 'yszuo', title: '三维原点坐标'}
            ,{ field: 'sjzuo', title: '实际原点坐标'}
            ,{ field: 'ishow', title: '是否显示'}
 
        ]]
    });
    table.on('toolbar(mapShow)', function(obj) {
        var checkStatus = table.checkStatus(obj.config.id);
        switch(obj.event) {
            case 'getshuaxin' :
                location.reload();
                break;
            case 'getUpdate':
                var data = checkStatus.data;
                if(data.length>1){
                    layer.alert("一次只能选中一个进行修改")
                }else if(data.length == 0){
                    layer.alert("请选中一条数据")
                }else{
                    if(data[0].type == "三维地图"){
                        $("#po1").show();
                        $("#po2").show();
                        $("#po3").show();
                        $("#po4").show();
                    }else{
                        $("#po1").hide();
                        $("#po2").hide();
                        $("#po3").hide();
                        $("#po4").hide();
                    }
                    $("#up1").val(data[0].id)
                    $("#up2").val(data[0].yszuo)
                    $("#up3").val(data[0].sjzuo)
                    $(".update").show();
                    $(".heimu").show();
                    console.log(data[0].ishow)
                    if (data[0].ishow == "显示"){
                        console.log("1111")
                        document.getElementById("isshow").checked = true;
                    }else{
                        document.getElementById("isshow").checked = false;
                    }
                    form.render();
                }
                break;
        }
    })
});