管道基础大数据平台系统开发-【CS】-ExportMap
1
13693261870
2022-11-16 66699d8e7f2ea458094ba06eb21166d735be94f2
1
已添加1个文件
已修改1个文件
99 ■■■■■ 文件已修改
ExportMap/ExportMap.csproj 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ExportMap/up.html 97 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ExportMap/ExportMap.csproj
@@ -111,12 +111,14 @@
    <Content Include="js\jquery.1.12.4.js" />
    <Content Include="js\rollups.js" />
    <Content Include="js\rsa.min.js" />
    <Content Include="lf.html" />
    <Content Include="Sources\logo.png" />
    <Content Include="Sources\render.py" />
    <Content Include="Sources\shps\SITEPOINT.shp.xml" />
    <Content Include="Sources\shps\STATIONSERIES.shp.xml" />
    <Content Include="Sources\shps\VALVEHOUSEPOINT.shp.xml" />
    <Content Include="Test.html" />
    <Content Include="up.html" />
    <Content Include="Web.config">
      <SubType>Designer</SubType>
    </Content>
ExportMap/up.html
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,97 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>上传接口测试</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <script src="js/jquery.1.12.4.js"></script>
  <script>
    var url = "http://127.0.0.1:12316/";
    var token = "a5cca7ad-bfe6-43bd-aa62-e19f2ffac6bd";
    $(function () {
      $("#tokenSpan").html(token);
    });
    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 getUrl(method) {
      return url + method + "?token=" + token;
    }
    function downloadMap(guid) {
      var a = document.createElement('a'); // åˆ›å»ºa标签
      a.style.display = 'none'; // è®¾ç½®ä¸å¯è§
      a.href = getUrl("mark/downloadFile") + "&guid=" + guid;
      document.body.appendChild(a); // åŠ å…¥
      a.click(); // è§¦å‘点击
      document.body.removeChild(a); // é‡Šæ”¾
    }
    // ä¸Šä¼ æ•°æ®
    function uploadData() {
      var formData = new FormData();
      var fs = document.getElementById("file1");
      for (var i = 0, c = fs.files.length; i < c; i++) {
        formData.append(fs.files[i].name, fs.files[i]); // fs.files[i].name,file
      }
      formData.append("name", "测试");
      formData.append("dirid", "10");
      formData.append("depid", "1");
      formData.append("verid", "1");
      formData.append("type", "gdb");
      formData.append("cs", "CGCS 2000");
      formData.append("scale", "1:1000");
      formData.append("resolution", "0.5m");
      formData.append("gather", "2022-10-03 15:00:00");
      formData.append("descr", "");
      $.ajax(getUrl("uploader/uploadData"), {
        type: "post",
        data: formData,
        async: true,
        cache: false,
        processData: false,
        contentType: false,
        success: function (rs) {
          alert("code = " + rs.code + ", msg = " + rs.msg + ", result = " + rs.result);
          console.log(rs);
        },
        error: function (e) {
          console.error(e);
        }
      });
    }
    function uploadFiles() {
      var url = getUrl("uploader/");
    }
  </script>
</head>
<body>
  <form id="upForm" name="upForm" method="post" enctype="multipart/form-data" action="http://127.0.0.1:12316/file/upload">
    å½“前令牌:<span id="tokenSpan"></span><br />
    è¯·é€‰æ‹©æ–‡ä»¶ï¼š
    <input id="file1" name="file1" type="file" multiple="multiple" />
    <input id="btnUp" value="上传文件" type="button" onclick="uploadFiles();" />
  </form>
  <br />
  <br />
</body>
</html>