From 04a22f3f691e76c1449969048b502f80a19a06ec Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期六, 06 一月 2024 10:03:01 +0800 Subject: [PATCH] 添加网格接口 --- JiangSu/index.html | 42 +++++++++++++++++++++++++++++++++++++++--- 1 files changed, 39 insertions(+), 3 deletions(-) diff --git a/JiangSu/index.html b/JiangSu/index.html index 775e60f..f353162 100644 --- a/JiangSu/index.html +++ b/JiangSu/index.html @@ -42,6 +42,33 @@ return JSON.stringify(model); } + function InsertGrid() { + var data = getGrid(); + + ajax("Grid/Insert", "POST", data, null, null, function (rs) { + console.log(rs); + alert(rs); + }); + } + + function UpdateGridById() { + var data = getGrid(); + + ajax("Grid/UpdateById", "POST", data, null, null, function (rs) { + console.log(rs); + alert(rs); + }); + } + + function getGrid() { + var model = { + id: $("#gid").val(), + json: $("#gjson").val() + }; + + return JSON.stringify(model); + } + function ajax(url, type, data, dataType, contentType, fn) { $.ajax({ url: url, @@ -60,13 +87,13 @@ </script> </head> <body> - <a href="http://localhost/JiangSu/Values/Get">Test</a> <br /> + <a href="http://localhost/JiangSu/Values/Get">Test</a> <br /> <br /> <a href="http://localhost/JiangSu/Op/SelectByPage?pageSize=10&pageIndex=1&name=">SelectByPage?pageSize=10&pageIndex=1&name=</a> <br /> <a href="http://localhost/JiangSu/Op/SelectById?id=1">SelectById?id=1</a> <br /> - <a href="http://localhost/JiangSu/Op/DeleteByIds?ids=13&ids=14">DeleteByIds?ids=13&ids=14</a> <br /> + <a href="http://localhost/JiangSu/Op/DeleteByIds?ids=47&ids=14">DeleteByIds?ids=47&ids=14</a> <br /> <br /> <form> id: <input id="id" name="id" value="3" /> <br /> @@ -74,7 +101,16 @@ json: <input id="json" name="json" value="{}" /> <br /> <input type="button" value="Insert" onclick="Insert();" /> - <input type="button" value="UpdateById" onclick="UpdateById();" /><br /> + <input type="button" value="UpdateById" onclick="UpdateById();" /><br /> <br /> + + 缃戞牸锛�<a href="http://localhost/JiangSu/Grid/SelectAll">SelectAll</a> + <a href="http://localhost/JiangSu/Grid/SelectById?id=1">SelectById?id=1</a> + <a href="http://localhost/JiangSu/Grid/DeleteByIds?ids=12&ids=13">DeleteByIds?ids=12&ids=13</a> <br /> + + id: <input id="gid" value="12" /> <br /> + json: <textarea id="gjson" style="width: 1024px;height: 70px;">{ "type": "Feature", "properties": { "ID": "12", "NAME": "Area8", "REMARK": "" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 120.24179180542139, 32.005615085853492, 13.770 ], [ 120.24175240823769, 32.005610442630996, 13.770 ], [ 120.24173428512847, 32.005722106674966, 13.770 ], [ 120.24177368235908, 32.005726749902777, 13.770 ], [ 120.24179180542139, 32.005615085853492, 13.770 ] ] ] } }</textarea> <br /> + <input type="button" value="InsertGrid" onclick="InsertGrid();" /> + <input type="button" value="UpdateGridById" onclick="UpdateGridById();" /><br /> <br /> </form> </body> </html> -- Gitblit v1.9.3