<%--
|
Created by IntelliJ IDEA.
|
User: WuWeichao
|
Date: 2023/8/18
|
Time: 16:08
|
To change this template use File | Settings | File Templates.
|
--%>
|
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
<%
|
String path = request.getContextPath();
|
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
|
+ path + "/";
|
%>
|
<html>
|
<head>
|
<base href="<%=basePath%>">
|
<meta name="viewport" charset="width=device-width, initial-scale=1.0">
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
<title>拐点坐标编辑</title>
|
<link href="static/plugins/font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css">
|
<link href="static/plugins/jquery-easyui/themes/bootstrap/easyui.css" rel="stylesheet" type="text/css">
|
<link rel="stylesheet" href="static/styles/initialize.css" type="text/css">
|
<link rel="stylesheet" href="static/styles/common.css" type="text/css">
|
<link rel="stylesheet" href="static/plugins/layer/skin/default/layer.css" type="text/css">
|
|
<script type="text/javascript" src="static/plugins/jquery/jquery.min.js"></script>
|
<script type="text/javascript" src="static/plugins/jquery-easyui/jquery.easyui.min.js"></script>
|
<script type="text/javascript" src="static/plugins/jquery-easyui/locale/easyui-lang-zh_CN.js"></script>
|
<script type="text/javascript" src="static/scripts/easyuiExtend.js"></script>
|
<script type="text/javascript" src="static/scripts/jquery-extend.js"></script>
|
<script type="text/javascript" src="static/plugins/layer/layer.js"></script>
|
<script type="text/javascript" src="static/plugins/slimScroll/jquery.slimscroll.min.js"></script>
|
<script type="text/javascript" src="static/plugins/jquery-easyui-datagrid-dnd/datagrid-dnd.js"></script>
|
<script src="static/plugins/ace/src-noconflict/ace.js" type="text/javascript"></script>
|
<script src="static/plugins/jquery.redirect.js" type="text/javascript"></script>
|
|
<!-- 弹窗加载组件 -->
|
<script type="text/javascript" src="static/plugins/layer/layer.js"></script>
|
<script type="text/javascript" src="static/plugins/spinjs/spin.js"></script>
|
<script type="text/javascript" src="static/plugins/spinjs/jquery.spin.js"></script>
|
<script type="text/javascript" src="static/plugins/jquery.blockUI.js"></script>
|
<!-- wcp组件 -->
|
<script type="text/javascript" src="static/wcp/scripts/wcp.js"></script>
|
<script type="text/javascript" src="static/wcp/scripts/libs/wcp.layer.js"></script>
|
<script type="text/javascript" src="static/wcp/scripts/libs/wcp.blockUI.js"></script>
|
<script type="text/javascript" src="static/wcp/scripts/libs/wcp.spin.js"></script>
|
<script type="text/javascript" src="static/wcp/scripts/libs/wcp.jquery.js"></script>
|
|
<!--[if lt IE 9]>
|
<script type="text/javascript" src="static/plugins/json2.js"></script>
|
<![endif]-->
|
<script type="text/javascript" src="static/wcp/scripts/libs/wcp.infoPicker.js"></script>
|
<script type="text/javascript" src="static/scripts/ResizeScroll.js"></script>
|
<script type="text/javascript" src="static/scripts/gdmis/gdmis.js"></script>
|
|
<script>
|
var params = {
|
callBack: null,
|
haveSelected: ""
|
};
|
var index = 1;
|
$(function () {
|
new ResizeScroll({
|
"id": "#divData",
|
"height": "350"
|
});
|
})
|
|
function doClose() { //关闭按钮事件
|
var index = top.layer.getFrameIndex(window.name); //获取窗口索引
|
top.layer.close(index);
|
}
|
|
function doAdd() {
|
index++;
|
var tr = "tr_" + index;
|
var jd = "jd_" + index;
|
var jd_d = "jd_f_" + index;
|
var jd_f = "jd_f_" + index;
|
var jd_m = "jd_m" + index;
|
var wd = "wd_" + index;
|
var wd_d = "wd_f_" + index;
|
var wd_f = "wd_f_" + index;
|
var wd_m = "wd_m" + index;
|
var del_Tr = "del_" + index;
|
var htmlStr = "" +
|
"<tr id='" + tr + "'>\n" +
|
" <td class=\"tbtitle\" style=\"width: 70px;\">经度:</td>\n" +
|
" <td>" +
|
" <select id='" + jd + "' data-options=\"panelHeight:'auto'\" editable=\"false\" class=\"easyui-combobox\" style=\"width:60px\">\n" +
|
" <option value=\"E\" selected='true'>E</option>" +
|
" <option value=\"W\">W</option>" +
|
" </select></td>" +
|
" <td><input type=\"text\" value=\"\" id= '" + jd_d + "' class=\"easyui-textbox\" data-options=\"validType:['regCoord[\\'0_0\\']']\" style=\"width:60px\"/>度</td>" +
|
" <td><input type=\"text\" value=\"\" id= '" + jd_f + "' class=\"easyui-textbox\" data-options=\"validType:['regCoord[\\'0_1\\']']\" style=\"width:60px\"/>分</td>" +
|
" <td><input type=\"text\" value=\"\" id= '" + jd_m + "' class=\"easyui-textbox\" data-options=\"validType:['regCoord[\\'0_2\\']']\" style=\"width:60px\">秒</td>\n" +
|
" </td>" +
|
" <td class=\"tbtitle\" style=\"width: 70px;\">纬度:</td>\n" +
|
" <td>" +
|
" <select id='" + wd + "' data-options=\"panelHeight:'auto'\" editable=\"false\" class=\"easyui-combobox\" style=\"width:60px\">\n" +
|
" <option value=\"N\" selected='true'>N</option>" +
|
" <option value=\"S\">S</option>" +
|
" </select></td>" +
|
" <td><input type=\"text\" value=\"\" id= '" + wd_d + "' class=\"easyui-textbox\" data-options=\"validType:['regCoord[\\'1_0\\']']\" style=\"width:60px\"/>度</td>" +
|
" <td><input type=\"text\" value=\"\" id= '" + wd_f + "' class=\"easyui-textbox\" data-options=\"validType:['regCoord[\\'1_1\\']']\" style=\"width:60px\"/>分</td>" +
|
" <td><input type=\"text\" value=\"\" id= '" + wd_m + "' class=\"easyui-textbox\" data-options=\"validType:['regCoord[\\'1_2\\']']\" style=\"width:60px\"/>秒</td>\n" +
|
" </td>" +
|
" <td><a id='" + del_Tr + "' href='javascript:void(0)' onclick='deleteCoordinateTr(" + index + ")'><font color='red'><em class='fa fa-trash-o'></em>删除</font></a></td>" +
|
"</tr>";
|
$("#tbForm").append(htmlStr);
|
// if(index > 2)
|
// {
|
// var count = index - 1;
|
// var delTr = "del_" + count;
|
// $("#"+delTr+"").hide();
|
// }
|
$.parser.parse("#" + tr);
|
}
|
|
function deleteCoordinateTr(num) {
|
var tr = "tr_" + num;
|
$("#" + tr + "").remove();
|
// if(num > 2)
|
// {
|
// var count = num - 1;
|
// var delTr = "del_" + count;
|
// $("#"+delTr+"").show();
|
// }
|
// index -- ;
|
}
|
|
function doSave() {
|
var isValid = $('#formUser').form('validate');
|
if (!isValid) {
|
wcp.notify.warn('表单验证有误,请检查表单输入项!');
|
return false;
|
}
|
|
var selectCoordinate = "";
|
var firstCoordinate = "";
|
var lastCoordinate = "";
|
var error = "";
|
var i = 0;
|
$('table tr').each(function (rows, ele) {
|
i++;
|
var jd = "";
|
var jd_d = "";
|
var jd_f = "";
|
var jd_m = "";
|
var wd = "";
|
var wd_d = "";
|
var wd_f = "";
|
var wd_m = "";
|
var jd = $(this).children().eq(1).find('input').val();
|
var jd_d = $(this).children().eq(2).find('input').val();
|
var jd_f = $(this).children().eq(3).find('input').val();
|
var jd_m = $(this).children().eq(4).find('input').val();
|
var wd = $(this).children().eq(6).find('input').val();
|
var wd_d = $(this).children().eq(7).find('input').val();
|
var wd_f = $(this).children().eq(8).find('input').val();
|
var wd_m = $(this).children().eq(9).find('input').val();
|
switch (jd_d.length) {
|
case 0:
|
jd_d = "000";
|
break;
|
case 1:
|
jd_d = "00" + jd_d.toString();
|
break;
|
case 2:
|
jd_d = "0" + jd_d.toString();
|
break;
|
default :
|
break;
|
}
|
switch (jd_f.length) {
|
case 0:
|
jd_f = "00";
|
break;
|
case 1:
|
jd_f = "0" + jd_f.toString();
|
break;
|
default :
|
break;
|
}
|
switch (jd_m.length) {
|
case 0:
|
jd_m = "00";
|
break;
|
case 1:
|
jd_m = "0" + jd_m.toString();
|
break;
|
default :
|
break;
|
}
|
switch (wd_d.length) {
|
case 0:
|
wd_d = "00";
|
break;
|
case 1:
|
wd_d = "0" + wd_d.toString();
|
break;
|
default :
|
break;
|
}
|
switch (wd_f.length) {
|
case 0:
|
wd_f = "00";
|
break;
|
case 1:
|
wd_f = "0" + wd_f.toString();
|
break;
|
default :
|
break;
|
}
|
switch (wd_m.length) {
|
case 0:
|
wd_m = "00";
|
break;
|
case 1:
|
wd_m = "0" + wd_m.toString();
|
break;
|
default :
|
break;
|
}
|
selectCoordinate += jd + jd_d + jd_f + jd_m + "," + wd + wd_d + wd_f + wd_m + "$";
|
if (i == 1) {
|
firstCoordinate = jd + jd_d + jd_f + jd_m + "," + wd + wd_d + wd_f + wd_m;
|
}
|
if (i == $('table tr').length) {
|
lastCoordinate = jd + jd_d + jd_f + jd_m + "," + wd + wd_d + wd_f + wd_m;
|
}
|
});
|
selectCoordinate = selectCoordinate.substring(0, selectCoordinate.length - 1).trim();
|
//判断第一个坐标必须和最后一个一样,才可确定
|
if (firstCoordinate == lastCoordinate) {
|
if (params.callBack && i > 0) {
|
params.callBack(selectCoordinate);
|
}
|
doClose();
|
} else {
|
wcp.notify.error("第一个坐标必须和最后一个坐标相同");
|
}
|
}
|
|
function loadParams() {
|
if (params.haveSelected.length > 0) {
|
var coordinate = params.haveSelected.split('$');
|
var count = 0;
|
for (var i = 0; i < coordinate.length; i++) {
|
count = i + 1;
|
var coordinateStr = coordinate[i].toString();
|
var tr = "tr_" + count;
|
var jd = "jd_" + count;
|
var jd_d = "jd_d_" + count;
|
var jd_f = "jd_f_" + count;
|
var jd_m = "jd_m_" + count;
|
var wd = "wd_" + count;
|
var wd_d = "wd_d_" + count;
|
var wd_f = "wd_f_" + count;
|
var wd_m = "wd_m_" + count;
|
var del_Tr = "del_" + count;
|
if (count > 1) {
|
var htmlStr = "" +
|
"<tr id='" + tr + "'>\n" +
|
" <td class=\"tbtitle\" style=\"width: 70px;\">经度:</td>\n" +
|
" <td>" +
|
" <select id='" + jd + "' data-options=\"panelHeight:'auto'\" editable=\"false\" class=\"easyui-combobox\" style=\"width:60px\">\n" +
|
" <option value=\"E\" selected='true'>E</option>" +
|
" <option value=\"W\">W</option>" +
|
" </select></td>" +
|
" <td><input type=\"text\" value=\"\" id= '" + jd_d + "' class=\"easyui-textbox\" data-options=\"validType:['regCoord[\\'0_0\\']']\" style=\"width:60px\"/>度</td>" +
|
" <td><input type=\"text\" value=\"\" id= '" + jd_f + "' class=\"easyui-textbox\" data-options=\"validType:['regCoord[\\'0_1\\']']\" style=\"width:60px\"/>分</td>" +
|
" <td><input type=\"text\" value=\"\" id= '" + jd_m + "' class=\"easyui-textbox\" data-options=\"validType:['regCoord[\\'0_2\\']']\" style=\"width:60px\">秒</td>\n" +
|
" </td>" +
|
" <td class=\"tbtitle\" style=\"width: 70px;\">纬度:</td>\n" +
|
" <td>" +
|
" <select id='" + wd + "' data-options=\"panelHeight:'auto'\" editable=\"false\" class=\"easyui-combobox\" style=\"width:60px\">\n" +
|
" <option value=\"N\" selected='true'>N</option>" +
|
" <option value=\"S\">S</option>" +
|
" </select></td>" +
|
" <td><input type=\"text\" value=\"\" id= '" + wd_d + "' class=\"easyui-textbox\" data-options=\"validType:['regCoord[\\'1_0\\']']\" style=\"width:60px\"/>度</td>" +
|
" <td><input type=\"text\" value=\"\" id= '" + wd_f + "' class=\"easyui-textbox\" data-options=\"validType:['regCoord[\\'1_1\\']']\" style=\"width:60px\"/>分</td>" +
|
" <td><input type=\"text\" value=\"\" id= '" + wd_m + "' class=\"easyui-textbox\" data-options=\"validType:['regCoord[\\'1_2\\']']\" style=\"width:60px\"/>秒</td>\n" +
|
" </td>" +
|
" <td><a id='" + del_Tr + "' href='javascript:void(0)' onclick='deleteCoordinateTr(" + count + ")'><font color='red'><em class='fa fa-trash-o'></em>删除</font></a></td>" +
|
"</tr>";
|
$("#tbForm").append(htmlStr);
|
// if(count > 2)
|
// {
|
// var count = count - 1;
|
// var delTr = "del_" + count;
|
// $("#"+delTr+"").hide();
|
// }
|
var targetObj = $("#" + tr).innerHtml;
|
$.parser.parse(targetObj);
|
}
|
}
|
//给文本框赋值
|
for (var i = 0; i < coordinate.length; i++) {
|
count = i + 1;
|
var coordinateStr = coordinate[i].toString();
|
var tr = "tr_" + count;
|
var jd = "jd_" + count;
|
var jd_d = "jd_d_" + count;
|
var jd_f = "jd_f_" + count;
|
var jd_m = "jd_m_" + count;
|
var wd = "wd_" + count;
|
var wd_d = "wd_d_" + count;
|
var wd_f = "wd_f_" + count;
|
var wd_m = "wd_m_" + count;
|
var del_Tr = "del_" + count;
|
var jwdStr = coordinateStr.split(',');
|
var jdStr = jwdStr[0].toString();
|
$("#" + jd).combobox("setValue", jdStr.substring(0, 1));
|
$("#" + jd_d).textbox("setValue", jdStr.substring(1, 4));
|
$("#" + jd_f).textbox("setValue", jdStr.substring(4, 6));
|
$("#" + jd_m).textbox("setValue", jdStr.substring(6));
|
var wdStr = jwdStr[1].toString();
|
$("#" + wd + "").combobox("setValue", wdStr.substring(0, 1));
|
$("#" + wd_d + "").textbox("setValue", wdStr.substring(1, 3));
|
$("#" + wd_f + "").textbox("setValue", wdStr.substring(3, 5));
|
$("#" + wd_m + "").textbox("setValue", wdStr.substring(5));
|
}
|
index = coordinate.length;
|
}
|
}
|
</script>
|
</head>
|
<body id="body" style="height: 320px">
|
<h4 style="color: red;padding-top: 10px;padding-left: 50px">
|
请按照勘查证或任务书上的坐标顺序填写,且能闭合(第一个坐标和最后一个坐标相同)</h4>
|
<div class="pt-nav-list">
|
<div class="pt-form">
|
<form id="formUser" method="post">
|
<div class="ptbody" id="divData">
|
<table id="tbForm" style="width: 100%;">
|
<tr>
|
<td class="tbtitle" style="width: 70px;">经度:</td>
|
<td>
|
<select id='jd_1' data-options="panelHeight:'auto'" editable="false" class="easyui-combobox"
|
style="width:60px">
|
<option value="E" selected='true'>E</option>
|
<option value="W">W</option>
|
</select>
|
</td>
|
<td>
|
<input type="text" value="" id="jd_d_1" class="easyui-textbox"
|
data-options="validType:['regCoord[\'0_0\']']" style="width:60px"/>度
|
</td>
|
<td>
|
<input type="text" value="" id="jd_f_1" class="easyui-textbox"
|
data-options="validType:['regCoord[\'0_1\']']" style="width:60px"/>分
|
<td>
|
<input type="text" value="" id="jd_m_1" class="easyui-textbox"
|
data-options="validType:['regCoord[\'0_2\']']" style="width:60px"/>秒
|
</td>
|
<td class="tbtitle" style="width: 70px;">纬度:</td>
|
<td>
|
<select id='wd_1' data-options="panelHeight:'auto'" editable="false" class="easyui-combobox"
|
style="width:60px">
|
<option value="N" selected='true'>N</option>
|
<option value="S">S</option>
|
</select>
|
</td>
|
<td>
|
<input type="text" value="" id="wd_d_1" class="easyui-textbox"
|
data-options="validType:['regCoord[\'1_0\']']" style="width:60px"/>度
|
</td>
|
<td>
|
<input type="text" value="" id="wd_f_1" class="easyui-textbox"
|
data-options="validType:['regCoord[\'1_2\']']" style="width:60px"/>分
|
<td>
|
<input type="text" value="" id="wd_m_1" class="easyui-textbox"
|
data-options="validType:['regCoord[\'1_2\']']" style="width:60px"/>秒
|
</td>
|
<td style="width: 70px;"></td>
|
</tr>
|
</table>
|
|
</div>
|
</form>
|
<div class="pt-form-btn">
|
<div class="form-group">
|
<button id="btnAdd" class="pt-btn pt-btn-primary" onclick="doAdd()"><i class="fa fa-plus"></i>添加坐标
|
</button>
|
<button id="btnSave" class="pt-btn pt-btn-primary" onclick="doSave()"><i class="fa fa-save"></i>确定
|
</button>
|
<button id="btnClose" class="pt-btn pt-btn-danger" onclick="doClose()"><i class="fa fa-close"></i>关闭
|
</button>
|
</div>
|
</div>
|
</div>
|
</div>
|
</body>
|
</html>
|