var form = "";
|
var rb = new rightBottomDatlog();
|
new CusScrollBar({
|
contentSelector: '.scroll_cont1', //滚动内容区
|
barSelector: '.scroll_bar1', //滚动条
|
sliderSelector: '.scroll_slider1' //滚动滑块
|
});
|
layui.use('form', function () {
|
form = layui.form;
|
GetLakeMessage();
|
form.on('checkbox(hupo)', function (data) {
|
var name = "";
|
$("input:checkbox[name='hupo']:checked").each(function (i) {
|
name += $(this).val() + "*";
|
});
|
if (name == "") {
|
$(".timeYear").empty();
|
return false;
|
}
|
GetLakeYear(name.substring(0, name.length - 1));
|
});
|
|
});
|
|
function GetLakeMessage() {
|
$.ajax({
|
url: "../../Ashx/DataLake.ashx",
|
type: "post",
|
data: { Action: "GetLakeMessage", type: "SSHP" },//81258c6425be4694af2575731f4e8831
|
dataType: "json",
|
async: false,
|
success: function (result) {
|
var htmlStr = '<div class="layui-form-item"><label class="layui-form-label">湖泊:</label><div class="layui-input-block">';
|
$.each(result, function (index, value) {
|
if (value.tname.indexOf("青海湖") > -1) {
|
//<input type="checkbox" name="like[hupo]" title="青海湖" lay-skin="primary">
|
htmlStr += '<input type="checkbox" name="hupo" lay-skin="primary" lay-filter="hupo" value="青海湖" title="青海湖" data-lake="' + value.tname + '" data-url="' + value.rtname + '\\' + value.fname + '\\' + value.sname + '\\' + value.tname + '">';
|
}
|
|
if (value.tname.indexOf("哈拉湖") > -1) {
|
htmlStr += '<input type="checkbox" name="hupo" lay-skin="primary" lay-filter="hupo" value="哈拉湖" title="哈拉湖" data-lake="' + value.tname + '" data-url="' + value.rtname + '\\' + value.fname + '\\' + value.sname + '\\' + value.tname + '">';
|
}
|
if (value.tname.indexOf("库赛湖") > -1) {
|
htmlStr += '<input type="checkbox" name="hupo" lay-skin="primary" lay-filter="hupo" value="库赛湖" title="库赛湖" data-lake="' + value.tname + '" data-url="' + value.rtname + '\\' + value.fname + '\\' + value.sname + '\\' + value.tname + '">';
|
}
|
if (value.tname.indexOf("扎陵湖-鄂陵湖") > -1) {
|
htmlStr += '<input type="checkbox" name="hupo" lay-skin="primary" lay-filter="hupo" value="扎陵湖-鄂陵湖" title="扎陵湖-鄂陵湖" data-lake="' + value.tname + '" data-url="' + value.rtname + '\\' + value.fname + '\\' + value.sname + '\\' + value.tname + '">';
|
}
|
if (value.tname.indexOf("星星海") > -1) {
|
htmlStr += '<input type="checkbox" name="hupo" lay-skin="primary" lay-filter="hupo" value="星星海" title="星星海" data-lake="' + value.tname + '" data-url="' + value.rtname + '\\' + value.fname + '\\' + value.sname + '\\' + value.tname + '">';
|
}
|
if (value.tname.indexOf("可可西里盐湖") > -1) {
|
htmlStr += '<input type="checkbox" name="hupo" lay-skin="primary" lay-filter="hupo" value="可可西里盐湖" title="可可西里盐湖" data-lake="' + value.tname + '" data-url="' + value.rtname + '\\' + value.fname + '\\' + value.sname + '\\' + value.tname + '">';
|
}
|
})
|
$(".tmessageLake").empty();
|
$(".tmessageLake").append(htmlStr + "</div></div>");
|
form.render();
|
}
|
})
|
}
|
//获取年份
|
function GetLakeYear(simName) {
|
$.ajax({
|
url: "../../Ashx/DataLake.ashx",
|
type: "post",
|
data: { Action: "GetHPyear", simName: simName },
|
dataType: "json",
|
async: false,
|
success: function (result) {
|
var html = "";
|
$.each(result, function (index, value) {
|
html += '<input type="checkbox" name="year" value="' + value.time + '" title="' + value.time + '" lay-skin="primary">'
|
});
|
$(".timeYear").empty();
|
$(".timeYear").append(html);
|
form.render();
|
},
|
error: function () {
|
|
}
|
})
|
}
|
|
function sure() {
|
var type = "";
|
var arrYear = new Array();
|
var arrName = new Array();
|
var arrSigName = new Array();
|
var arrtitle = new Array();
|
$("input:checkbox[name='year']:checked").each(function (i) {
|
arrYear[i] = $(this).val();
|
});
|
$("input:checkbox[name='hupo']:checked").each(function (i) {
|
arrSigName[i] = $(this).attr("data-lake");
|
arrName[i] = $(this).attr("data-url");
|
arrtitle[i] = $(this).attr("title");
|
});
|
|
if (arrYear.length == 0) {
|
alert("请选择年份");
|
return false;
|
}
|
if (arrName.length == 0) {
|
alert("请选择湖泊");
|
return false;
|
}
|
|
//单年单选
|
if (arrYear.length == 1 & arrName.length == 1) {
|
type = "simYearSimName";
|
}
|
//单年多选
|
if (arrYear.length == 1 & arrName.length > 1) {
|
type = "simYearManyName";
|
}
|
//多年单选
|
if (arrYear.length > 1 & arrName.length == 1) {
|
type = "manyYearSimName";
|
}
|
|
//多年多选
|
if (arrYear.length > 1 & arrName.length > 1) {
|
type = "manyYearManyName";
|
}
|
|
//关闭所有的图层
|
// sgworld.ProjectTree.SetVisibility("", false);
|
//定义所需要的json对象存储内容
|
var lakeUrl = [];
|
//循坏打开需要打开的图层
|
for (var i = 0; i < arrName.length; i++) {
|
for (var j = 0; j < arrYear.length; j++) {
|
var path = arrName[i] + "\\" + arrYear[j] + "\\" + arrYear[j];
|
//var layerId = sgworld.ProjectTree.FindItem(path);
|
////关闭其他图层
|
//sgworld.ProjectTree.SetVisibility(layerId, true);
|
var obj = new ObjLake(arrSigName[i], arrYear[j], arrtitle[i]);
|
lakeUrl.push(obj);
|
}
|
}
|
//存储到持久化机制里面
|
localStorage.setItem("openShp", JSON.stringify(lakeUrl));
|
//获取文件的路径
|
var url = getRootPath();
|
|
|
window.external.closeDialog("右下");
|
window.external.createPmDialogDock("右下", url + "/chart/chartSSHP.html?Type=" + type, rb.width, rb.height, rb.top, rb.left, rb.bottom, rb.right);
|
}
|
|
function closeCurrent() {
|
window.external.closeDialog("右上");
|
window.external.closeDialog("右下");
|
}
|
|
|
function ObjLake(name, year, titleName) {
|
this.name = name;
|
this.year = year;
|
this.titleName = titleName;
|
}
|