sgworld = window.external.createSgworld();
|
var form = null;
|
var element = null;
|
var lc = new leftCenterDatlog();
|
new CusScrollBar({
|
contentSelector: '.scroll_cont1', //滚动内容区
|
barSelector: '.scroll_bar1', //滚动条
|
sliderSelector: '.scroll_slider1' //滚动滑块
|
});
|
//注意:折叠面板 依赖 element 模块,否则无法进行功能性操作
|
layui.use(['element', 'form'], function () {
|
element = layui.element;
|
form = layui.form;
|
var title = decodeURI(getUrlParam("title")); //localStorage.getItem("typeName");
|
$(".ttitle").empty();
|
$(".ttitle").append(title);
|
GetColor();
|
form.on('checkbox(pYc)', function (data) {
|
window.event.stopPropagation();
|
});
|
});
|
|
var skFirst = [];
|
//获取一级菜单选中事件
|
var qxF = false;
|
function qx1() {
|
if (qxF == false) {
|
qxF = true;
|
var checkItem = $("input:checkbox[name='title']");
|
checkItem.each(function (index, item) {
|
$(item).attr('checked', true);
|
});
|
form.render();
|
} else {
|
qxF = false;
|
var checkItem = $("input:checkbox[name='title']");
|
checkItem.each(function (index, item) {
|
$(item).removeAttr('checked');
|
});
|
form.render();
|
}
|
}
|
|
//获取二级菜单选中事件
|
var qxS = false;
|
var skSecond = [];
|
function qx2() {
|
if (qxS == false) {
|
qxS = true;
|
var checkItem = $("input:checkbox[name='message']");
|
checkItem.each(function (index, item) {
|
$(item).attr('checked', true);
|
//var tname = $(item).attr('title');
|
//skSecond.push(tname);
|
});
|
form.render();
|
} else {
|
qxS = false;
|
var checkItem = $("input:checkbox[name='message']");
|
checkItem.each(function (index, item) {
|
$(item).removeAttr('checked');
|
});
|
form.render();
|
}
|
}
|
|
|
var url = getRootPath();
|
//确定菜单
|
|
|
function sure() {
|
if (temID != null) {
|
sgworld.ProjectTree.DeleteItem(temID);
|
temID = null;
|
}
|
var second = "";
|
var whereSecond = "";
|
var checkSecond = $("input:checkbox[name='message']:checked");
|
$.each(checkSecond, function (index, value) {
|
second += value.title + "*";
|
whereSecond += ("SJBM='" + value.getAttribute("data-code") + "' AND ");
|
});
|
|
second=second.substring(0, second.length - 1);
|
if (second == "") {
|
window.external.closeDialog("右中");
|
|
} else {
|
window.external.createPmDialogDock("右中", url + "legend.html?sk=" + second + "&type=" + getUrlParam("Type"), lc.width, lc.height, lc.top, lc.left, lc.bottom, lc.right);
|
}
|
|
if (whereSecond == "") {
|
alert("请选择二级分类");
|
return false;
|
}
|
|
var ThisLayer = sgworld.ProjectTree.FindItem(localStorage.getItem("pathName")+"\\"+CurrentYear);
|
var LayerObj = sgworld.ProjectTree.GetObject(sgworld.ProjectTree.GetNextItem(ThisLayer, 11));
|
LayerObj.load();
|
LayerObj.Filter = whereSecond.substring(0, whereSecond.length - 4);
|
LayerObj.Refresh();
|
|
|
}
|
|
|
//获取文本框数值
|
function GetColor() {
|
;
|
var TableName = getUrlParam("Type");//localStorage.getItem("type");
|
var TableColor = GetCmpareTable(TableName);
|
$.ajax({
|
url: "../../../Ashx/DataQH.ashx",
|
type: "post",
|
data: { Action: "GetColor", colorTable: TableColor },
|
dataType: "json",
|
async: false,
|
success: function (result) {
|
var html = "";
|
var h1 = "";
|
|
$.each(result, function (index, value) {
|
|
if (value.Type == "parent") {
|
if (html == "") {
|
html += '<div class="layui-collapse layui-form"><div class="layui-colla-item"><div class="layui-colla-title">' +
|
'<div class="lct"><input checked type="checkbox" data-code="' + value.Code + '" name="title" lay-skin="primary" title="' + value.Name + '" lay-filter="pYc"' +
|
'value="rgb(' + value.R + ',' + value.G + ',' + value.B + ')"></div><div><img src="img/加号.png" /></div></div><div class="layui-colla-content">' +
|
'<div class="layui-form-item"><div class="layui-input-block">';
|
} else {
|
html += '</div></div></div></div></div><div class="layui-collapse layui-form"><div class="layui-colla-item"><div class="layui-colla-title">' +
|
'<div class="lct"><input type="checkbox" data-code="' + value.Code + '" name="title" lay-skin="primary" title="' + value.Name + '" lay-filter="pYc"' +
|
'value="rgb(' + value.R + ',' + value.G + ',' + value.B + ')"></div><div><img src="img/加号.png" /></div></div><div class="layui-colla-content">' +
|
'<div class="layui-form-item"><div class="layui-input-block">';
|
}
|
} else if (value.Type == "Gparent") {
|
return;
|
} else {
|
html += '<input type="checkbox" name="message" data-code="' + value.Code + '" lay-skin="primary" title="' + value.Name + '" value="rgb(' + value.R + ',' + value.G + ',' + value.B + ')">';
|
}
|
|
if (result.length - 1 == index) {
|
html += '</div></div></div></div></div>';
|
}
|
|
|
|
})
|
// alert(html);
|
$(".scroll_cont1").empty();
|
$(".scroll_cont1").append(html);
|
form.render();
|
element.render();
|
}
|
});
|
|
}
|
|
//加载影像数据
|
var CurrentYear = "";
|
function GetYX(year) {
|
sgworld.ProjectTree.SetVisibility("",false);
|
if (year == "") {
|
return false;
|
} else {
|
CurrentYear = year;
|
var ThisId = sgworld.ProjectTree.FindItem(localStorage.getItem("pathName") + "\\" + year);
|
//alert(localStorage.getItem("pathName") + "\\" + year);
|
if (ThisId == "") {
|
return false;
|
} else {
|
var alpah = localStorage.getItem("alpha");
|
if (alpah == null) {
|
alpah = 70;
|
}
|
var childId = sgworld.ProjectTree.GetNextItem(ThisId, 11);
|
var dd = Number(alpah) / 100;
|
var layer = sgworld.ProjectTree.GetObject(childId);
|
layer.FeatureGroups.Item(0).SetProperty("Fill Opacity", dd);
|
sgworld.ProjectTree.SetVisibility(ThisId,true);
|
}
|
}
|
}
|
|
function closeCurrent() {
|
window.external.closeDialog("右中");
|
window.external.closeDialog("左下");
|
window.external.closeDialog("右上");
|
window.external.closeDialog("右下");
|
window.external.InvokeScript("左上", "ReFresh", "");
|
//关闭图层
|
sgworld.ProjectTree.SetVisibility("", false);
|
sgworld.ProjectTree.SetVisibility(sgworld.ProjectTree.FindItem("qinghai"), true);
|
}
|