管道基础大数据平台系统开发-【CS】-ExportMap
13693261870
2024-09-07 8d7a67ab1d635cb954337d8a767878ae526dd3dc
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>江苏交控智慧高速项目</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="Scripts/jquery-1.7.1.min.js"></script>
  <script>
    $(function () {
      //
    });
 
    function Insert() {
      var data = getModel();
 
      ajax("Op/Insert", "POST", data, null, null, function (rs) {
        console.log(rs);
        alert(rs);
      });
    }
 
    function UpdateById() {
      var data = getModel();
 
      ajax("Op/UpdateById", "POST", data, null, null, function (rs) {
        console.log(rs);
        alert(rs);
      });
    }
 
    function getModel() {
      var model = {
        id: $("#id").val(),
        name: $("#name").val(),
        json: $("#json").val()
      };
 
      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 InsertImg() {
      var data = getImg();
 
      ajax("Img/Insert", "POST", data, null, null, function (rs) {
        console.log(rs);
        alert(rs);
      });
    }
 
    function UpdateImgById() {
      var data = getImg();
 
      ajax("Img/UpdateById", "POST", data, null, null, function (rs) {
        console.log(rs);
        alert(rs);
      });
    }
 
    function getImg() {
      var model = {
        id: $("#iid").val(),
        name: $("#iname").val(),
        path: $("#ipath").val(),
        json: $("#ijson").val()
      };
 
      return JSON.stringify(model);
    }
 
    function UploadImg() {
      var formData = new FormData();
      var fs = document.getElementById("imgs");
      for (var i = 0, c = fs.files.length; i < c; i++) {
        formData.append(fs.files[i].name, fs.files[i]); // name, file
      }
 
      $.ajax("Img/Upload", {
        type: "POST",
        data: formData,
        async: true,
        cache: false,
        processData: false,
        contentType: false,
        success: function (rs) {
          console.log(rs);
          alert(JSON.stringify(rs));
        },
        error: function (e) {
          console.error(e);
          alert("上传文件失败!");
        }
      });
    }
 
    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);
        }
      });
    }
  </script>
</head>
<body>
  <a href="http://localhost/JiangSu/Values/Get">Test</a>
  <span style="width: 50px;">&nbsp;</span>
  <a href="http://localhost/JiangSu/Img/GetGps">GetGps</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=47&ids=14">DeleteByIds?ids=47&ids=14</a> <br /> <br />
 
  <form>
    id: <input id="id" name="id" value="3" /> <br />
    name: <input id="name" name="name" value="A" /> <br />
    json: <input id="json" name="json" value="{}" /> <br />
 
    <input type="button" value="Insert" onclick="Insert();" />
    <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 />
 
    &nbsp;&nbsp; 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 />
 
    
    图片:<a href="http://localhost/JiangSu/Img/SelectByPage?pageSize=10&pageIndex=1&name=">SelectByPage?pageSize=10&pageIndex=1&name=</a> <span style="width: 50px;">&nbsp;</span>
    <a href="http://localhost/JiangSu/Img/SelectById?id=1">SelectById?id=1</a> <span style="width: 50px;">&nbsp;</span>
    <a href="http://localhost/JiangSu/Img/DeleteByIds?ids=3&ids=0">DeleteByIds?ids=3&ids=0</a> <br />
 
    &nbsp;&nbsp; id: <input id="iid" value="1" /> <br />
    name: <input id="iname" value="1.jpg"/> <br />
    path: <input id="ipath" value="Images/1.jpg"/> <br />
    json: <input id="ijson" value="{}"/> <br />
    <input type="button" value="InsertImg" onclick="InsertImg();" />
    <input type="button" value="UpdateImgById" onclick="UpdateImgById();" />
    <label for="apifiles">选择图片:</label>
    <input id="imgs" type="file" multiple="multiple" accept=".jpg,.png" />
    <input value="UploadImg" type="button" onclick="UploadImg();" />
    <br /> <br />
  </form>
</body>
</html>