管道基础大数据平台系统开发-【CS】-ExportMap
1
13693261870
2022-11-12 3e707d56a647c29055e1e64800a9300e9c1aa091
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
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title></title>
  <script src="js/jquery.1.12.4.js"></script>
  <script>
    var token = "a5cca7ad-bfe6-43bd-aa62-e19f2ffac6bd";
 
    function ajax(url, type, data, dataType, contentType, fn) {
      $.ajax({
        url: url,
        type: type,
        data: data,
        dataType: dataType || "json", // html、json、jsonp、script、text
        contentType: contentType || "application/json", // "application/x-www-form-urlencoded"
        success: function (data) {
          fn(data);
        },
        error: function (e) {
          console.error(e);
          fn();
        }
      });
    }
 
    function exportMap1() {
      var page = $("#selectPage").find("option:selected").text();
      var data = {
        token: token,
        title: "管道基础大数据平台(DW1-01)",
        pageSize: page,
        province: "河北省",
        scale: "1:5万",
        resolution: "5米",
        date: "2022.11.09",
        layers: "阀室,管道中心线,矢量注记,矢量图",
        rotation: 0,
        xmin: 103.394023,
        ymin: 30.690466,
        ymax: 37.871048,
        xmax: 112.534648
      };
 
      ajax("Export/Start", "POST", JSON.stringify(data), null, null, function (rs) {
        alert("code = " + rs.code + ", msg = " + rs.msg + ", result = " + rs.result);
        console.log(rs);
      });
    }
 
    function exportMap2() {
      var page = $("#selectPage").find("option:selected").text();
      var data = {
        token: token,
        title: "管道基础大数据平台(DW1-02)",
        pageSize: page,
        province: "山东省",
        scale: "1:20万",
        resolution: "20米",
        date: "2022.11.10",
        layers: "站场,管道中心线,高德影像注记,高德影像",
        rotation: 0,
        xmin: 103.394023,
        ymin: 30.690466,
        ymax: 37.871048,
        xmax: 112.534648
      };
 
      ajax("Export/Start", "POST", JSON.stringify(data), null, null, function (rs) {
        alert("code = " + rs.code + ", msg = " + rs.msg + ", result = " + rs.result);
        console.log(rs);
      });
    }
  </script>
</head>
<body>
  <h2>出图测试</h2>
  <select id="selectPage">
    <option>A0</option>
    <option>A1</option>
    <option>A2</option>
    <option>A3</option>
    <option selected="selected">A4</option>
    <option>A5</option>
    <option>A6</option>
  </select>
  <input type="button" value="出图-1" onclick="exportMap1()" />
  <input type="button" value="出图-2" onclick="exportMap2()" />
</body>
</html>