123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- <!--<管块查询>-->
- <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='gkTypes' class="layui-form-item">
- <label class="layui-form-label">选择宽×高</label>
- <div class="layui-input-block"></div>
- </div>
- <div class="layui-form-item">
- <div class="layui-input-block" style="text-align: right;">
- <button id="query" 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;
- let 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);
- }
- const czs = CONST_VALUES.GX_GK;
- let radioStr = "<input type='radio' name='GUANKUAI' title='THETITLE' id='THEID'>";
- for (let index = 0; index < czs.length; index++) {
- const cz = czs[index];
- let dom = radioStr.replace('THETITLE', cz);
- dom = dom.replace('THEID', cz);
- $("#gkTypes .layui-input-block").append(dom);
- }
- $("#s_cz_div #query").click(function(obj) {
- //debugger;
- let cz = $('input[name="GUANKUAI"]:checked').val();
- if (cz == undefined) {
- layer.msg('请选择一种管径!', {
- icon: 7
- });
- return;
- }
- cz = $('input[name="GUANKUAI"]:checked')[0].id;
- let layers = $("#layers input:checked");
- if (layers.length == 0) {
- layer.msg('请至少选择一个图层!', {
- icon: 7
- });
- return;
- }
- for (let index = 0; index < layers.length; index++) {
- let checked = layers[index].checked;
- if (!checked)
- continue;
- let ws = layers[index].attributes.dataSourceName.value;
- let dataSetName = layers[index].attributes.dataSetName.value;
- //debugger;
- let sql = "SmID > 0"
- if (cz !== "全部") {
- let wh = cz.split('×');
- let w = wh[0];
- let h = wh[1];
- sql += " AND SSPIPEWIDTH = " + w + " AND SSPIPEHEIGHT " + h;
- }
- query(layers[index].title, dataSetName, ws, sql);
- }
- });
- let query = function(subtitleP, dataSetNameP, wsP, sqlP) {
- let thatsubtitleP = subtitleP;
- let dataSource = wsP;
- let urlTmp = CONST_VALUES.GX_Datas_BaseUrl + "/datasources/" + wsP +
- "/datasets/" + dataSetNameP + "/features.json";
- $.get(urlTmp, function(e) {
- const count = e.featureCount;
- //console.info("e.featureCount" + e.featureCount);
- Q.queryBySql(dataSetNameP, wsP, sqlP, 0, 2000, function(rs) {
- if (rs.result == undefined) return;
- panels.createResultPanelWithDataGrid({
- subTitle: thatsubtitleP,
- features: rs.result.features.features,
- title: "按管块查询结果",
- count: count,
- dataSetName: dataSetNameP,
- dataSourceName: dataSource
- },
- function() {
- //debugger;
- });
- });
- });
- }
- </script>
|