123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- <form id="s_cz_div" class="layui-form">
- <div id='layers' class="layui-form-item">
- <label class="layui-form-label">选择图层</label>
- <div class="layui-input-block"></div>
- </div>
- <div id='segCount' class="layui-form-item">
- <label class="layui-form-label">选择分段数</label>
- <div class="layui-input-block">
- <input type="radio" name="segs" value="5" title="5段">
- <input type="radio" name="segs" value="10" title="10段" checked>
- </div>
- </div>
- <div class="layui-form-item">
- <div class="layui-input-block" style="text-align: right;">
- <button id="tj" type="button" class="layui-btn layui-btn-normal">统 计</button>
- <button type="reset" class="layui-btn layui-btn-primary">重 置</button>
- </div>
- </div>
- </form>
- <script type="text/javascript">
- let lyrs = CONST_VALUES.GX_Datas;
- //debugger;
- let checkboxStr = "<input type='checkbox' name='THENAME' title='THETITLE' id='THEID' lay-skin='primary' dataSetName='THEDATASETNAME' dataSourceName='THEWS'>";
- for (let index = 0; index < lyrs.length; index++) {
- const lyr = lyrs[index];
- //debugger;
- if (lyr.name.indexOf("管线") < 0)
- continue;
- var dom = checkboxStr.replace('THENAME', lyr.name);
- dom = dom.replace('THETITLE', lyr.name);
- dom = dom.replace('THEID', lyr.id);
- dom = dom.replace('THEWS', lyr.dataSourceName);
- dom = dom.replace('THEDATASETNAME', lyr.dataSetName);
- //debugger;
- $("#layers .layui-input-block").append(dom);
- }
- $("#s_cz_div #tj").click(function(obj) {
- const layers = $("#layers input:checked");
- const seg = $("#segCount input:checked").val();
- if (layers.length == 0) {
- layer.msg('请至少选择一个图层!', {
- icon: 7
- });
- return;
- }
- let selectLayers = "";
- let xAxis = [];
- for (let index = 0; index < layers.length; index++) {
- var checked = layers[index].checked;
- if (!checked)
- continue;
- selectLayers += mapDatas.getLayerNameByCaption(layers[index].name) + ","
- xAxis.push(layers[index].name);
- }
- $.ajax({
- url: "statistics/spatialstatistics/segs/gj?tbNames=" + selectLayers + "&segCount=" + seg,
- success: function(result) {
- panels.createResultPanelWithChart(xAxis, /**/
- result, "按管径统计", "单位:米", "管径", "长度", "bar",
- function() {
- //debugger;
- });
- },
- error: function() {
- layer.msg('统计报错!', {
- icon: 7
- });
- }
- });
- });
- </script>
|