| | |
| | | <html xmlns="http://www.w3.org/1999/xhtml"> |
| | | <head> |
| | | <title>LF接口测试</title> |
| | | <meta http-equiv="Expires" content="0" /> |
| | | <meta http-equiv="Cache" content="no-cache" /> |
| | | <meta http-equiv="Pragma" content="no-cache" /> |
| | | <meta http-equiv="Cache-control" content="no-cache" /> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> |
| | | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
| | | <script src="js/jquery.1.12.4.js"></script> |
| | | <script src="js/rsa.min.js"></script> |
| | | <script src="js/rollups.js"></script> |
| | | <script src="js/config.js"></script> |
| | | <script> |
| | | var url = "http://127.0.0.1:12316/server/"; |
| | | var token = "?token=9c62ba00-5c82-40c2-a210-6aecc33e8c96"; |
| | | // 项目,站场,管道中心线,战略通道,矢量图,影像注记,影像图 |
| | | |
| | | window.onload = function () { |
| | | getPublicKey(); |
| | | } |
| | |
| | | }; |
| | | |
| | | // JSON.stringify(data),"application/x-www-form-urlencoded" |
| | | ajax(url + "user/updateUsersPwd" + token, "POST", JSON.stringify(data), "json", null, function (rs) { |
| | | alert("code = " + rs.code + ", msg = " + rs.msg + ", result = " + rs.result); |
| | | console.log(rs); |
| | | }); |
| | | } |
| | | |
| | | function insertUser() { |
| | | var data = { |
| | | // |
| | | }; |
| | | ajax(url + "user/updateUsersPwd" + token, "POST", JSON.stringify(data), "json", null, function (rs) { |
| | | alert("code = " + rs.code + ", msg = " + rs.msg + ", result = " + rs.result); |
| | | console.log(rs); |
| | |
| | | }); |
| | | } |
| | | |
| | | function downloadShp() { |
| | | function downloadMarkShp() { |
| | | var data = [ |
| | | { id: 1, name: "Point-1", props: "{}", wkt: "POINT(95.80461853400004 34.13862467200005)" }, |
| | | { id: 2, name: "Linestring-1", props: "{}", wkt: "LINESTRING(04.98985101830993 37.43840773692756,104.99318913447104 37.43883729720358)" }, |
| | | { id: 3, name: "Polygon-1", props: "{}", wkt: "POLYGON((104.9907822932683 37.43532941961706,104.99088987736599 37.43532941961706,104.9908670336867 37.4349030213574,104.99078327712658 37.4349030213574,104.9907822932683 37.43532941961706))" } |
| | | { id: 1, name: "Point-1", bak: "{}", wkt: "POINT(95.80461853400004 34.13862467200005)" }, |
| | | { id: 2, name: "Linestring-1", bak: "{}", wkt: "LINESTRING(04.98985101830993 37.43840773692756,104.99318913447104 37.43883729720358)" }, |
| | | { id: 3, name: "Polygon-1", bak: "{}", wkt: "POLYGON((104.9907822932683 37.43532941961706,104.99088987736599 37.43532941961706,104.9908670336867 37.4349030213574,104.99078327712658 37.4349030213574,104.9907822932683 37.43532941961706))" } |
| | | ]; |
| | | |
| | | ajax(url + "mark/downloadShp" + token, "POST", JSON.stringify(data), "json", null, function (rs) { |
| | | ajax(url + "comprehensive/downloadShp" + token, "POST", JSON.stringify(data), "json", null, function (rs) { |
| | | alert("code = " + rs.code + ", msg = " + rs.msg + ", result = " + rs.result); |
| | | // 下载文件 |
| | | if (rs && rs.code == 200) { |
| | | var a = document.createElement('a'); // 创建一个a标签元素 |
| | | a.style.display = 'none'; // 设置元素不可见 |
| | | // http://127.0.0.1:12316/mark/downloadFile?guid=5ce046cc05b186332775c03ac6792caf |
| | | a.href = url + "mark/downloadFile" + token + "&guid=" + rs.result; |
| | | // http://127.0.0.1:12316/server/comprehensive/downloadFile?guid=5f0d5b61ca8cd79a07502f308c2f4dcc |
| | | a.href = url + "comprehensive/downloadFile" + token + "&guid=" + rs.result; |
| | | |
| | | document.body.appendChild(a); // 加入 |
| | | a.click(); // 触发点击,下载 |
| | |
| | | function downloadFile() { |
| | | var a = document.createElement('a'); // 创建一个a标签元素 |
| | | a.style.display = 'none'; // 设置元素不可见 |
| | | a.href = url + "mark/downloadFile" + token + "&guid=" + "5ce046cc05b186332775c03ac6792caf"; |
| | | a.href = url + "comprehensive/downloadFile" + token + "&guid=" + "5ce046cc05b186332775c03ac6792caf"; |
| | | |
| | | document.body.appendChild(a); // 加入 |
| | | a.click(); // 触发点击,下载 |
| | |
| | | return; |
| | | } |
| | | |
| | | $.ajax(url + "mark/uploadShp" + token, { |
| | | $.ajax(url + "comprehensive/uploadShp" + token, { |
| | | type: "post", |
| | | data: formData, |
| | | async: true, |
| | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | function pipeAnalysis() { |
| | | var data = { |
| | | gid: 24, |
| | | tabs: ["bd.dlg_25w_hydl", "bd.dlg_25w_lrdl", "bd.dlg_25w_lrrl", "bd.dlg_25w_hyda"] |
| | | }; |
| | | |
| | | $.ajax(url + "pipeline/selectPipeAnalysis" + token, { |
| | | type: "POST", |
| | | data: JSON.stringify(data), |
| | | async: true, |
| | | cache: false, |
| | | processData: false, |
| | | contentType: false, |
| | | success: function (rs) { |
| | | alert("code = " + rs.code + ", msg = " + rs.msg + ", result = " + ", " + JSON.stringify(rs.result)); |
| | | console.log(rs); |
| | | }, |
| | | error: function (e) { |
| | | console.error(e); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | function downloadPipeReq() { |
| | | var data = { |
| | | pwd: encrypt.encrypt("Test!321&456"), |
| | | gid: 24, |
| | | tabs: ["bd.dlg_25w_hydl", "bd.dlg_25w_lrdl", "bd.dlg_25w_lrrl", "bd.dlg_25w_hyda"] |
| | | }; |
| | | |
| | | $.ajax(url + "pipeline/downloadReq" + token, { |
| | | type: "POST", |
| | | data: JSON.stringify(data), |
| | | async: true, |
| | | cache: false, |
| | | processData: false, |
| | | contentType: false, |
| | | success: function (rs) { |
| | | alert("code = " + rs.code + ", msg = " + rs.msg + ", result = " + ", " + JSON.stringify(rs.result)); |
| | | console.log(rs); |
| | | }, |
| | | error: function (e) { |
| | | console.error(e); |
| | | } |
| | | }); |
| | | } |
| | | </script> |
| | | <script> |
| | | var url = "http://127.0.0.1:12316/"; |
| | | var token = "?token=a5cca7ad-bfe6-43bd-aa62-e19f2ffac6bd"; |
| | | |
| | | function exportMap1() { |
| | | var page = $("#selectPage").find("option:selected").text(); |
| | | var data = { |
| | |
| | | province: "河北省", |
| | | scale: "1:5万", |
| | | resolution: "5米", |
| | | date: "2022.11.09", |
| | | layers: "阀室,管道中心线,矢量注记,矢量图", |
| | | date: "2022.12.20", |
| | | layers: "项目,站场,管道中心线,矢量图", |
| | | rotation: 0, |
| | | xmin: 103.394023, |
| | | ymin: 30.690466, |
| | |
| | | scale: "1:20万", |
| | | resolution: "20米", |
| | | date: "2022.11.10", |
| | | layers: "站场,管道中心线,高德影像注记,高德影像", |
| | | layers: "项目,站场,管道中心线,影像注记,影像图", |
| | | rotation: 0, |
| | | xmin: 103.394023, |
| | | ymin: 30.690466, |
| | |
| | | <input type="button" value="Ajax上传" onclick="ajxUpload()" /> |
| | | <input type="button" value="uploadData" onclick="uploadData();" /> |
| | | <input type="button" value="uploadShpForWKT" onclick="uploadShpForWKT();" /> |
| | | <input type="button" value="uploadShp" onclick="downloadShp();" /> |
| | | <input type="button" value="downloadFile" onclick="downloadFile();" /> |
| | | <input type="button" value="downloadMarkShp" onclick="downloadMarkShp();" /> |
| | | <input type="button" value="uploadShpForMark" onclick="uploadShpForMark();" /> |
| | | <input type="button" value="管线分析" onclick="pipeAnalysis()" /> |
| | | <input type="button" value="管线分析下载" onclick="downloadPipeReq()" /> |
| | | <br /> |
| | | <br /> |
| | | |
| | |
| | | 文件上传: |
| | | <input id="file1" name="file1" type="file" multiple="multiple" /> |
| | | <input id="file2" name="file2" type="file" multiple="multiple" webkitdirectory /> |
| | | <input id="shpFiles" name="shpFiles" type="file" multiple="multiple" accept=".shp,.shx,.dbf,.prj" /> |
| | | shpFiles:<input id="shpFiles" name="shpFiles" type="file" multiple="multiple" accept=".shp,.shx,.dbf,.prj" /> |
| | | </form> |
| | | <br /> |
| | | |