2
13693261870
2022-09-16 653761a31dfeb50dd3d007e892d69c90bf0cdafc
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:layout="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" th:href="@{${pubzyWebRoot} + 'BootStrap4/assets/css/style.css'}"/>
    <script th:src="@{${pubzyWebRoot} + 'BootStrap4/assets/js/jquery.min.js'}"></script>
    <title>图形样式</title>
</head>
<style>
    .chart-list-panel {
        margin: 30px 0px 30px 18px;
    }
 
    .chart-list-panel h3 {
        margin-bottom: 20px;
    }
 
    .row {
        margin-right: -15px;
        margin-left: -15px;
        flex-wrap: wrap;
    }
 
    .chart-list-panel .chart {
        width: 100%;
        max-width: 230px;
        margin: 9px;
        margin-bottom: 30px;
        -webkit-border-radius: 2px;
        border-radius: 2px;
        background-color: #f9f9f9;
        -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    }
 
    .chart-list-panel .chart .chart-link {
        position: relative;
        display: block;
    }
 
    .chart-list-panel .chart .chart-link .chart-title {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        padding: 10px 10px 2px 10px;
        margin: 0;
        font-weight: normal;
        font-size: 16px;
    }
 
    .chart-list-panel .chart .chart-link .chart-area {
        width: 100%;
        height: 100%;
        padding: 8px;
    }
 
    a {
        color: #337ab7;
        text-decoration: none;
    }
 
    a:hover {
        text-decoration: underline;
        background-color: #eee;
 
    }
 
</style>
<body>
<input type="hidden" id="settype" th:value="${settype}"/>
<div class="chart-list-panel" id="Chart">
 
</div>
 
</body>
<script th:inline="javascript">
    function Layclose(text, typeId) {
        var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
        parent.$('#type').val(text);
        parent.$('#typeId').val(typeId);
        var type = parent.$("#typeId").val();
        var jsonname = parent.$("#jsonname").val();
        var resourceid = parent.$("#resMainInfoId").val();
        var moduleid = parent.$("#moduleid").val();
        $.ajax({
            url: '/res/common/getEchartsCode',
            data: {
                echartsid: type,
                jsonname: jsonname,
                resourceid: resourceid,
                moduleid: moduleid,
                settype:settype
            },
            type: 'get',
            dataType: 'text',
            success: function (data) {
                parent.$("#option").val(data);
                parent.do_js_beautify("option");
            },
            error: function (e) {
                parent.$("#option").val("");
            }
        })
        parent.layer.close(index);
    }
    var settype;
    $(function () {
        settype = $("#settype").val();
        $.ajax({
            url: "/res/common/getChartTemplatList?settype="+settype,
            type: 'post',
            dataType: 'text',
            data: {},
            success: function (data) {
                var json = eval('(' + data + ')');
                var table = json.topics;
                var html = "";
                var zhexiantu = "<h3 class=\"chart-type-head\">折线图</h3><div class=\"row\">";
                var binzhuangtu="<h3 class=\"chart-type-head\">饼状图</h3><div class=\"row\">";
                var zhuzhuangtu="<h3 class=\"chart-type-head\">柱状图</h3><div class=\"row\">";
                for (var i = 0; i < table.length; i++) {
                    if (table[i].echartstype == "折线图") {
 
                        zhexiantu += "<div class=\"\">\n" +
                            "<div class=\"chart\" >\n" +
                            "<span style=\"cursor:pointer\" onclick=\"Layclose('" + table[i].echartstitle + "','"+table[i].echartsid +"')\">\n" +
                            "<a target=\"_blank\" class=\"chart-link\">\n" +
                            "<h4 class=\"chart-title\">" + table[i].echartstitle + "</h4>\n" +
                            "<img class=\"chart-area\" src=\""+table[i].echartsUrl+"\"\n" +
                            "style=\"display: inline;\">\n" +
                            "</a>\n" +
                            "</span>\n" +
                            "</div>\n" +
                            "</div>";
                    }
                    if (table[i].echartstype == "柱状图") {
                        zhuzhuangtu+="<div class=\"\">\n" +
                            "<div class=\"chart\">\n" +
                            "<span style=\"cursor:pointer\" onclick=\"Layclose('"+table[i].echartstitle+"','"+table[i].echartsid +"')\">\n" +
                            "<a target=\"_blank\" class=\"chart-link\">\n" +
                            "<h4 class=\"chart-title\">"+table[i].echartstitle+"</h4>\n" +
                            "<img class=\"chart-area\" src=\""+table[i].echartsUrl+"\"\n" +
                            "style=\"display: inline;\">\n" +
                            "</a>\n" +
                            "</span>\n" +
                            "</div>\n" +
                            "</div>"
                    }
                    if (table[i].echartstype == "饼状图") {
                        binzhuangtu +="<div class=\"\">\n" +
                            "<div class=\"chart\">\n" +
                            "<span style=\"cursor:pointer\" onclick=\"Layclose('"+table[i].echartstitle+"','"+table[i].echartsid +"')\">\n" +
                            "<a target=\"_blank\" class=\"chart-link\">\n" +
                            "<h4 class=\"chart-title\">"+table[i].echartstitle+"</h4>\n" +
                            "<img class=\"chart-area\" src=\""+table[i].echartsUrl+"\"\n" +
                            "style=\"display: inline;\">\n" +
                            "</a>\n" +
                            "</span>\n" +
                            "</div>\n" +
                            "</div>";
                    }
 
                }
                zhexiantu += "</div>";
                binzhuangtu += "</div>";
                zhuzhuangtu+="</div>";
                html+=zhexiantu+binzhuangtu+zhuzhuangtu;
                $("#Chart").append(html);
 
            },
            error: function (e) {
                alert(e.message);
            }
        })
    })
 
 
</script>
 
</html>