管道基础大数据平台系统开发-【CS】-ExportMap
13693261870
2023-06-27 eb7ae609e499d5f1faa801299aa17a8cd05d676f
移动TB文件
已修改2个文件
38 ■■■■ 文件已修改
ExportMap/cs/TBUtils.cs 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ExportMap/export.html 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ExportMap/cs/TBUtils.cs
@@ -89,18 +89,27 @@
        /// </summary>
        private static void MoveFilesToTemp(string sourcePath, string targetPath)
        {
            string imgPath = Path.Combine(targetPath, "img");
            //if (!Directory.Exists(imgPath)) Directory.CreateDirectory(imgPath);
            CopyFolder(Path.Combine(sourcePath, "数字正射影像图"), Path.Combine(targetPath, "img"));
            CopyFolder(Path.Combine(sourcePath, "数字高程模型"), Path.Combine(targetPath, "dem"));
            CopyFolder(Path.Combine(sourcePath, "中线裁剪范围"), Path.Combine(targetPath, "shp"));
        }
            string demPath = Path.Combine(targetPath, "dem");
            //if (!Directory.Exists(demPath)) Directory.CreateDirectory(demPath);
        /// <summary>
        /// 复制目录
        /// </summary>
        private static void CopyFolder(string sourcePath, string targetPath)
        {
            if (!Directory.Exists(targetPath)) Directory.CreateDirectory(targetPath);
            string shpPath = Path.Combine(targetPath, "shp");
            //if (!Directory.Exists(shpPath)) Directory.CreateDirectory(shpPath);
            DirectoryInfo di = new DirectoryInfo(sourcePath);
            File.Move(Path.Combine(sourcePath, "数字正射影像图"), imgPath);
            File.Move(Path.Combine(sourcePath, "数字高程模型"), demPath);
            File.Move(Path.Combine(sourcePath, "中线裁剪范围"), shpPath);
            FileInfo[] files = di.GetFiles();
            if (null == files || 0 == files.Length) return;
            foreach (FileInfo fi in files)
            {
                File.Move(fi.FullName, Path.Combine(targetPath, fi.Name));
            }
        }
        /// <summary>
ExportMap/export.html
@@ -10,7 +10,7 @@
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <script src="js/jquery.1.12.4.js"></script>
  <script>
    var token = "2b03248b-b00c-4bf3-b497-7d8708445495";
    var token = "673e4e0f-5a6e-49e6-bb04-d5991cbc3b7f";
    // Ajax
    function ajax(url, type, data, dataType, contentType, fn) {
@@ -160,6 +160,14 @@
        console.log(rs);
      });
    }
    // 生成Mpt
    function createMpt() {
      ajax("TB/CreateMpt" + "?token=" + token + "&path=" + encodeURIComponent("D:\\LF\\data\\ANTU\\测绘(ESV)"), "GET", null, null, null, function (rs) {
        alert("code = " + rs.code + ", msg = " + rs.msg + ", result = " + rs.result);
        console.log(rs);
      });
    }
  </script>
</head>
<body>
@@ -184,5 +192,6 @@
  <input type="button" value="测试OSGB" onclick="toOsgb();" />
  <input type="button" value="测试Las" onclick="toLas();" />
  <input type="button" value="测试Laz" onclick="toLaz();" />
  <input type="button" value="生成Mpt" onclick="createMpt();" />
</body>
</html>