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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:layout="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" layout:decorator="MasterPage/Layout.Empty">
<head>
    <meta charset="UTF-8" />
    <title th:text="${systemName}"></title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport" />
    <link rel="stylesheet" th:href="@{${pubzyWebRoot} + 'BootStrap4/expand/plugins/portlet/css/portlet.css'}" />
    <script th:src="@{${pubzyWebRoot} + 'BootStrap4/expand/plugins/portlet/portlet.js'}"></script>
    <script th:src="@{${pubzyWebRoot} + 'media/js/jquery.form-3.51.0.js'}"></script>
    <script th:src="@{${pubzyWebRoot} + 'media/js/validation/jquery.validate.min.js'}" type="text/javascript"></script>
    <script th:src="@{${pubzyWebRoot} + 'media/js/validation/messages_zh.js'}" type="text/javascript"></script>
    <script th:src="@{${pubzyWebRoot} + 'media/js/validation/additional-methods.min.js'}" type="text/javascript"></script>
    <script th:src="@{${pubzyWebRoot} + 'media/js/yanzhen.js'}" type="text/javascript"></script>
    <style>
        body {
            background-color: white;
            box-sizing: border-box;
            overflow-x: hidden;
        }
 
        .form-control {
            padding: 0.3rem 0.7rem;
            height: 34px;
            display: inline-block;
        }
 
        .control-label {
            padding-top: 0 !important;
            width: 94px;
            float: left;
            line-height: 30px;
            padding-right: 1.2em;
            text-align: right;
        }
 
        .control-group {
            margin-bottom: 1em;
        }
 
        .controls {
            margin-left: 94px;
        }
 
        .row {
            margin-left: 0;
            margin-right: 0;
        }
 
        .col-sm-3,
        .col-sm-6,
        .col-sm-12 {
            padding-left: 0;
            padding-right: 0;
        }
 
        .fade {
            display: none;
        }
 
        .in.fade {
            display: block;
        }
 
        .control-group error {
            border-color: #b94a48;
        }
 
        #button {
            color: #fff !important;
            background-color: #039cfd !important;
            border-color: #039cfd !important;
        }
 
        img {
            cursor: pointer;
        }
 
        .nav-tabs > .active > a, .nav-tabs > .active > a:hover, .nav-tabs > .active > a:focus {
            color: #555;
            cursor: default;
            background-color: #fff;
            border: 1px solid #ddd;
            border-bottom-color: transparent;
        }
    </style>
</head>
<body layout:fragment="content">
<form class="form-horizontal" id="TuXin" method="post" xmlns:th="http://www.w3.org/1999/xhtml">
    <div class="portlet box ltblue">
        <div class="portlet-title">
            图形设置
            <div class="caption">
                <i class="fa fa-reorder"></i>
            </div>
            <div class="tools">
                <!--<a class="collapse" onclick="portlet_body_ShowOrHide(this);"></a>-->
            </div>
        </div>
        <input type="hidden" id="resMainInfoId" name="resMainInfoId" th:value="${resourceid}"/>
        <input type="hidden" id="hangshu" name="resMainInfoId" th:value="${hangshu}"/>
        <div class="portlet-body">
            <div class="row">
                <div class="col-sm-6">
                    <div class="control-group">
                        <label class="control-label">图形样式<span style="color: red;">*</span></label>
                        <div class="controls input-icon">
                            <select id="type" name="type" class="form-control col-sm-11" required="" >
                                <option value="饼状图"  th:selected="${graphicStyle.type=='饼状图'}">饼状图</option>
                                <option value="柱状图"  th:selected="${graphicStyle.type=='柱状图'}">柱状图</option>
                                <option value="折线图"  th:selected="${graphicStyle.type=='折线图'}">折线图</option>
                            </select>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="control-group">
                        <label class="control-label">显示模式<span style="color: red;">*</span></label>
                        <div class="controls input-icon">
                            <select id="displayMode" name="displayMode" class="form-control col-sm-11" required="" >
                                <option value="按类别显示值"  th:selected="${graphicStyle.displayMode=='按类别显示值'}">按类别显示值</option>
                                <option value="按类别显示要素计数"  th:selected="${graphicStyle.displayMode=='按类别显示要素计数'}">按类别显示要素计数</option>
                            </select>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="control-group">
                        <label class="control-label">类别字段<span style="color: red;">*</span></label>
                        <div class="controls input-icon">
                            <select id="classfield" name="classfield" class="form-control col-sm-11" required="">
                                <option value="">--请选择--</option>
                                <option th:each="item:${list}" th:value="${item}" th:text="${item}" th:selected="(${item} == ${graphicStyle.classfield})?'true':'false'"></option>
                            </select>
                        </div>
                    </div>
                </div>
 
            </div>
            <div class="row YaoSuJiShu"  >
                <div class="col-sm-6">
                    <div class="control-group">
                        <label class="control-label">值字段<span style="color: red;">*</span></label>
                        <div class="controls input-icon">
                            <select id="ValueField" name="ValueField" class="form-control col-sm-11" required="">
                                <option value="">--请选择--</option>
                                <option th:each="item:${list}" th:value="${item}" th:text="${item}" th:selected="(${item} == ${graphicStyle.ValueField})?'true':'false'"></option>
                            </select>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row YaoSuJiShu"  >
                <div class="col-sm-6">
                    <div class="control-group">
                        <label class="control-label">统计方式</label>
                        <div class="controls input-icon">
                            <select id="StatisticalMethod" name="StatisticalMethod" class="form-control col-sm-11" required="" >
                                <option value="" >--请选择--</option>
                                <option value="求和" th:selected="${graphicStyle.StatisticalMethod=='求和'}">求和</option>
                                <option value="平均数" th:selected="${graphicStyle.StatisticalMethod=='平均数'}">平均数</option>
                            </select>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="form-actions navbar-fixed-bottom" style="z-index: 0;">
        <div style="float: left;">
            <button class="btn btn-primary" id="addSave" type="button">
                <i class="fa fa-check"></i> 保存
            </button>
            <button class="btn btn-warning" id="close" type="button">
                <i class="fa fa-remove"></i> 关闭
            </button>
        </div>
    </div>
</form>
 
<script>
    $(function () {
 
        cheackForm("ShuJuYuan");
        var displayMode=$("#displayMode").val()
        if(displayMode=="按类别显示要素计数"){
            $(".YaoSuJiShu").css('display','none');
            $("#StatisticalMethod").removeSelected();
            $("#ValueField").removeSelected();
 
        }else {
            $(".YaoSuJiShu").css('display','block')
        }
    });
    jQuery.fn.removeSelected = function() {
        this.val("");
    };
    $("#displayMode").change(function(){
        var displayMode=$("#displayMode").val()
        if(displayMode=="按类别显示要素计数"){
            $(".YaoSuJiShu").css('display','none');
            $("#StatisticalMethod").removeSelected();
            $("#ValueField").removeSelected();
        }else {
            $(".YaoSuJiShu").css('display','block');
 
        }
 
    });
 
    //保存
    $('#addSave').on('click', function () {
        var resMainInfoId = $("#resMainInfoId").val();
        var hangshu = $("#hangshu").val();
        if ($('#TuXin').valid()) {
            $('#TuXin').ajaxSubmit({
                url:  "/res/common/TuXingConfigAdd?resourceid="+resMainInfoId+"&hangshu="+hangshu,
                type: 'post',
                dataType: 'text',
                data: {},
                success: function (data) {
                    var json = eval('('+data+')');
                    if (json.count == "1") {
                        alert("保存成功!");
                        window.parent.location.reload(); //刷新父页面
                        var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
                        parent.layer.close(index);
                    } else {
                        alert("保存失败!");
                    }
                },
                error: function (e) {
                    alert(e.message);
                }
            });
        } else {
            // alert("您输入的信息存在错误,请更正后再提交!");
        }
    });
 
    $("#close").on("click",function () {
        var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
        parent.layer.close(index);
    })
</script>
 
</body>
</html>