//sgworld = window.external.createSgworld();
|
var form = null;
|
var element = null;
|
var rb = new rightBottomDatlog();
|
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;
|
|
form.on('checkbox(pYc)', function (data) {
|
window.event.stopPropagation();
|
});
|
//let CurrentRoot = YingYongDataSencond.filter(function (item) { return item.Type == TableName });
|
var title = "统计分析"; //CurrentRoot[0].sname;//localStorage.getItem("typeName");
|
$(".ttitle").empty();
|
$(".ttitle").attr("title", title);
|
$(".ttitle").append((title.length > 12) ? title.substring(0, 12) : title);
|
GetYear();
|
});
|
|
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);
|
|
});
|
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() {
|
var first = "", second = "", time = "", type = "";
|
//获取一级选中菜单
|
var checkFirst = $('input:checkbox[name="title"]:checked');
|
$.each(checkFirst, function (index, value) {
|
first += value.title + "*";
|
})
|
var checkSecond = $("input:checkbox[name='message']:checked");
|
$.each(checkSecond, function (index, value) {
|
second += value.title + "*";
|
})
|
var checkTime = $("input:checkbox[name='time']:checked");
|
$.each(checkTime, function (index, value) {
|
time += value.title + "*";
|
})
|
if (time == "") {
|
alert("请选择时间");
|
return false;
|
}
|
|
if (second == "" & first == "") {
|
alert("请选择图例");
|
return false;
|
}
|
|
|
window.external.closeDialog("右中");
|
window.external.closeDialog("左下");
|
window.external.closeDialog("右下");
|
if (second == "") {
|
window.external.createBorderDialog("右下", url + "../chart/chartDLChoose.html?first=" + first.substring(0, first.length - 1) +
|
"&second=" + second.substring(0, second.length - 1) + "&time=" + time.substring(0, time.length - 1), rb.width, rb.height, rb.top, rb.left, rb.bottom, rb.right);
|
} else {
|
window.external.createBorderDialog("右中", url + "../legend.html?sk=" + second.substring(0, second.length - 1), lc.width, lc.height, lc.top, lc.left, lc.bottom, lc.right);
|
window.external.createBorderDialog("右下", url + "../chart/chartDLChoose.html?first=" + first.substring(0, first.length - 1) +
|
"&second=" + second.substring(0, second.length - 1) + "&time=" + time.substring(0, time.length - 1), rb.width, rb.height, rb.top, rb.left, rb.bottom, rb.right);
|
}
|
|
|
|
|
}
|
|
var TableName = localStorage.getItem("type");
|
var TableColor = GetCmpareTable(TableName);
|
function GetYear() {
|
$.ajax({
|
url: "../../../Ashx/Secondcommon.ashx",
|
type: "post",
|
data: { Action: "GetYear", TableName: TableName },
|
dataType: "json",
|
async: false,
|
success: function (result) {
|
var html = '<div class="layui-form-item" pane=""><div class="layui-input-block" style="margin-left:7%;">';
|
$.each(result, function (index, value) {
|
html += '<input type="checkbox" name="time" value="rgb(95,184,120)" lay-skin="primary" title="' + value.Year + '" >';
|
});
|
$(".layui-form").empty();
|
$(".layui-form").append(html + "</div></div><hr />");
|
GetColor();
|
}
|
})
|
}
|
|
|
function GetColor() {
|
$.ajax({
|
url: "../../../Ashx/DataQH.ashx",
|
type: "post",
|
data: { Action: "GetColor", colorTable: TableColor },
|
dataType: "json",
|
async: true,
|
success: function (result) {
|
//判断使用一级菜单还是二级菜单
|
var ContainParent = false;
|
for (var i = 0; i < result.length; i++) {
|
if (result[i].Type == "parent") {
|
ContainParent = true;
|
break;
|
}
|
}
|
//初始化日期
|
var html = "";
|
var h1 = "";
|
if (ContainParent) {
|
$.each(result, function (index, value) {
|
if (value.Type == "parent") {
|
if (html == "") {
|
html += '<div class="layui-colla-item"><div class="layui-colla-title">' +
|
'<div class="lct"><input type="checkbox" name="title" data-code="' + value.Code + '" 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 class="layui-colla-item"><div class="layui-colla-title">' +
|
'<div class="lct"><input type="checkbox" name="title" data-code="' + value.Code + '" 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>';
|
}
|
})
|
|
$(".imgFirst").click(qx1);
|
$(".imgSecond").click(qx2);
|
FSLevel = false;
|
} else {
|
$.each(result, function (index, value) {
|
html += '<div class="layui-collapse layui-form"><div class="layui-colla-item"><div class="layui-colla-title">' +
|
'<div class="lct"><input type="checkbox" name="title" data-code="' + value.Code + '" lay-skin="primary" title="' + value.Name + '" lay-filter="pYc"' +
|
'value="rgb(' + value.R + ',' + value.G + ',' + value.B + ')"></div><div></div></div>';
|
})
|
html + '<div class="layui-collapse layui-form">' + html + '</div>';
|
$(".imgSecond").css("display", "none");
|
$(".imgFirst").click(qx1);
|
FSLevel = true;
|
};
|
// alert(html);
|
|
//$(".scroll_cont1").empty();
|
$(".layui-form").append(html);
|
form.render();
|
element.render();
|
}
|
});
|
}
|