Commit ebfbf400 authored by 莫林毅's avatar 莫林毅

修改 ‘省份’ 为 全国

parent 308bcc9d
<%@tag pageEncoding="UTF-8"%> <%@tag pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="ctx" value="${pageContext.request.contextPath}" /> <c:set var="ctx" value="${pageContext.request.contextPath}"/>
<div id="timeLine" class="date"> <div id="timeLine" class="date">
<label for="">时间范围</label><!-- 最近3年 --> <label for="">时间范围</label><!-- 最近3年 -->
<input id="d1" class="Wdate" type="text" value="" onFocus="var d2=$dp.$('d2');WdatePicker({onpicked:function(){d2.focus();},minDate:'{%y-3}-%M-%d %H:%m:%s',maxDate:'#F{$dp.$D(\'d2\')||\'%y-%M-%d %H:%m:%s\'}'})"> <input id="d1" class="Wdate" type="text" value=""
onFocus="var d2=$dp.$('d2');WdatePicker({onpicked:function(){d2.focus();},minDate:'{%y-3}-%M-%d %H:%m:%s',maxDate:'#F{$dp.$D(\'d2\')||\'%y-%M-%d %H:%m:%s\'}'})">
-- --
<input id="d2" class="Wdate" type="text" value="" onFocus="WdatePicker({minDate:'#F{$dp.$D(\'d1\')||\'{%y-3}-%M-%d %H:%m:%s\'}',maxDate:'%y-%M-%d %H:%m:%s'})"> <input id="d2" class="Wdate" type="text" value=""
onFocus="WdatePicker({minDate:'#F{$dp.$D(\'d1\')||\'{%y-3}-%M-%d %H:%m:%s\'}',maxDate:'%y-%M-%d %H:%m:%s'})">
<%--<input id="d1" class="Wdate" type="text" style="width:137px;" value="" onFocus="var d2=$dp.$('d2');WdatePicker({onpicked:function(){d2.focus();},minDate:'{%y-3}-%M-%d %H:%m:%s',maxDate:'#F{$dp.$D(\'d2\')||\'%y-%M-%d %H:%m:%s\'}',dateFmt:'yyyy-MM-dd'})"> <%--<input id="d1" class="Wdate" type="text" style="width:137px;" value="" onFocus="var d2=$dp.$('d2');WdatePicker({onpicked:function(){d2.focus();},minDate:'{%y-3}-%M-%d %H:%m:%s',maxDate:'#F{$dp.$D(\'d2\')||\'%y-%M-%d %H:%m:%s\'}',dateFmt:'yyyy-MM-dd'})">
...@@ -49,8 +50,7 @@ ...@@ -49,8 +50,7 @@
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
function initStartTime() function initStartTime() {
{
var now = new Date(); var now = new Date();
var year = now.getFullYear(); //年 var year = now.getFullYear(); //年
...@@ -62,115 +62,115 @@ ...@@ -62,115 +62,115 @@
var clock = year + "-"; var clock = year + "-";
if(month < 10) if (month < 10)
clock += "0"; clock += "0";
clock += month + "-"; clock += month + "-";
if(day < 10) if (day < 10)
clock += "0"; clock += "0";
clock += day + " "; clock += day + " ";
if(hh < 10) if (hh < 10)
clock += "0"; clock += "0";
clock += hh + ":"; clock += hh + ":";
if (mm < 10) clock += '0'; if (mm < 10) clock += '0';
clock += mm; clock += mm;
clock += ":"+"00"; clock += ":" + "00";
return(clock); return (clock);
} }
function initEndTime() { function initEndTime() {
var date = new Date(); var date = new Date();
var daysInMonth = new Array([0],[31],[28],[31],[30],[31],[30],[31],[31],[30],[31],[30],[31]); var daysInMonth = new Array([0], [31], [28], [31], [30], [31], [30], [31], [31], [30], [31], [30], [31]);
var strYear = date.getFullYear(); var strYear = date.getFullYear();
var strDay = date.getDate(); var strDay = date.getDate();
var strMonth = date.getMonth()+1; var strMonth = date.getMonth() + 1;
var hh = date.getHours(); //时 var hh = date.getHours(); //时
var mm = date.getMinutes(); //分 var mm = date.getMinutes(); //分
if(strYear%4 == 0 && strYear%100 != 0){ if (strYear % 4 == 0 && strYear % 100 != 0) {
daysInMonth[2] = 29; daysInMonth[2] = 29;
} }
if(strMonth - 1 == 0) if (strMonth - 1 == 0) {
{
strYear -= 1; strYear -= 1;
strMonth = 12; strMonth = 12;
} }
else else {
{
strMonth -= 1; strMonth -= 1;
} }
strDay = daysInMonth[strMonth] >= strDay ? strDay : daysInMonth[strMonth]; strDay = daysInMonth[strMonth] >= strDay ? strDay : daysInMonth[strMonth];
if(strMonth<10) if (strMonth < 10) {
{ strMonth = "0" + strMonth;
strMonth="0"+strMonth;
} }
if(strDay<10) if (strDay < 10) {
{ strDay = "0" + strDay;
strDay="0"+strDay;
} }
var clock = strYear+"-"+strMonth+"-"+strDay; var clock = strYear + "-" + strMonth + "-" + strDay;
clock += " "; clock += " ";
if(hh < 10) if (hh < 10)
clock += "0"; clock += "0";
clock += hh + ":"; clock += hh + ":";
if (mm < 10) clock += '0'; if (mm < 10) clock += '0';
clock += mm; clock += mm;
clock += ":"+"00"; clock += ":" + "00";
return(clock); return (clock);
} }
//初始化时间控件的默认值,需要在页面加载时调用此初始化方法 //初始化时间控件的默认值,需要在页面加载时调用此初始化方法
function initDate(){ function initDate() {
$(".date #d1").val(initEndTime()); $(".date #d1").val(initEndTime());
$(".date #d2").val(initStartTime()); $(".date #d2").val(initStartTime());
} }
var detailProviderCheckedValues=$(".providerDetail:checked"); var detailProviderCheckedValues = $(".providerDetail:checked");
$("#allProviderDetail").click(function(){ $("#allProviderDetail").click(function () {
if($("#allProviderDetail").attr("checked") == "checked"){//全选 if ($("#allProviderDetail").attr("checked") == "checked") {//全选
$(".providerDetail").attr("checked","checked"); $(".providerDetail").attr("checked", "checked");
// $(".providerDetail").attr("disabled",true); // $(".providerDetail").attr("disabled",true);
detailProviderCheckedValues=$(".providerDetail:checked"); detailProviderCheckedValues = $(".providerDetail:checked");
//alert(getDetailChannelCheckedValuesString()); //alert(getDetailChannelCheckedValuesString());
detailProviderChange(); detailProviderChange();
}else{//不全选 } else {//不全选
$(".providerDetail").attr("checked",false); $(".providerDetail").attr("checked", false);
$(".providerDetail").attr("disabled",false); $(".providerDetail").attr("disabled", false);
detailProviderCheckedValues=$(".providerDetail:checked"); detailProviderCheckedValues = $(".providerDetail:checked");
// alert(getDetailChannelCheckedValuesString()); // alert(getDetailChannelCheckedValuesString());
detailProviderChange(); detailProviderChange();
} }
judge=false; judge = false;
}); });
$(".providerDetail").click(function(){ $(".providerDetail").click(function () {
var clickFlag=true;//是否全部选中 var clickFlag = true;//是否全部选中
$(".providerDetail").each(function(){ $(".providerDetail").each(function () {
if($(this).attr("checked") == null||$(this).attr("checked") == false){ clickFlag=false; } if ($(this).attr("checked") == null || $(this).attr("checked") == false) {
clickFlag = false;
}
}); });
$("#allProviderDetail").attr("checked",clickFlag); $("#allProviderDetail").attr("checked", clickFlag);
detailProviderCheckedValues=$(".providerDetail:checked"); detailProviderCheckedValues = $(".providerDetail:checked");
detailProviderChange(); detailProviderChange();
//alert(getDetailProviderCheckedValuesString()); //alert(getDetailProviderCheckedValuesString());
//alert(getDetailProviderCheckedTitles()); //alert(getDetailProviderCheckedTitles());
judge=false; judge = false;
}); });
//返回结果为一个数组,数组中包含选中的渠道类型 //返回结果为一个数组,数组中包含选中的渠道类型
function getDetailProviderCheckedValues(){ function getDetailProviderCheckedValues() {
var detailProviderArray=new Array(); var detailProviderArray = new Array();
var i=0; var i = 0;
detailProviderCheckedValues.each(function(){ detailProviderCheckedValues.each(function () {
detailProviderArray[i]=$(this).val(); detailProviderArray[i] = $(this).val();
i++; i++;
}); });
...@@ -178,9 +178,9 @@ ...@@ -178,9 +178,9 @@
} }
//返回结果为逗号分隔的ID字串 //返回结果为逗号分隔的ID字串
function getDetailProviderCheckedValuesString(){ function getDetailProviderCheckedValuesString() {
//var detailProviderStr=""; //var detailProviderStr="";
var detailProviderArray=getDetailProviderCheckedValues(); var detailProviderArray = getDetailProviderCheckedValues();
// detailProviderArray.join(","); // detailProviderArray.join(",");
// if($("#allProviderDetail").attr("checked") == "checked"){detailProviderArray.push("-1");} // if($("#allProviderDetail").attr("checked") == "checked"){detailProviderArray.push("-1");}
/* for(var i=0;i<detailProviderArray.length;i++){ /* for(var i=0;i<detailProviderArray.length;i++){
...@@ -195,35 +195,35 @@ ...@@ -195,35 +195,35 @@
//返回 关联维度 的 选择值 //返回 关联维度 的 选择值
function getDetailCheckeddDimension() { function getDetailCheckeddDimension() {
var checkedDimension=$("#xcdStatusSelect option:selected").val(); var checkedDimension = $("#xcdStatusSelect option:selected").val();
console.log("checkedDimension "+checkedDimension); console.log("checkedDimension " + checkedDimension);
return checkedDimension; return checkedDimension;
} }
//返回结果集成商名称集 //返回结果集成商名称集
function getDetailProviderCheckedTitles(){ function getDetailProviderCheckedTitles() {
var detailProviderArray=new Array(); var detailProviderArray = new Array();
var i=0; var i = 0;
detailProviderCheckedValues.each(function(){ detailProviderCheckedValues.each(function () {
detailProviderArray[i]=$(this).attr("title"); detailProviderArray[i] = $(this).attr("title");
i++; i++;
}); });
var detailProviderTitles=""; var detailProviderTitles = "";
for(i=0;i<detailProviderArray.length;i++){ for (i = 0; i < detailProviderArray.length; i++) {
if(i==detailProviderArray.length-1){ if (i == detailProviderArray.length - 1) {
detailProviderTitles+=detailProviderArray[i]; detailProviderTitles += detailProviderArray[i];
}else{ } else {
detailProviderTitles+=detailProviderArray[i]+" "; detailProviderTitles += detailProviderArray[i] + " ";
} }
} }
return detailProviderTitles; return detailProviderTitles;
} }
function detailProviderReset(){ function detailProviderReset() {
$("#allProviderDetail").attr("checked","checked"); $("#allProviderDetail").attr("checked", "checked");
$(".providerDetail").attr("checked","checked"); $(".providerDetail").attr("checked", "checked");
detailProviderCheckedValues=$(".providerDetail:checked"); detailProviderCheckedValues = $(".providerDetail:checked");
detailProviderChange(); detailProviderChange();
} }
...@@ -231,54 +231,57 @@ ...@@ -231,54 +231,57 @@
</script> </script>
<script type="text/javascript"> <script type="text/javascript">
var detailProvinceCheckedValues=$(".provinceDetail:checked"); var detailProvinceCheckedValues = $(".provinceDetail:checked");
//全选和不全选所有的省 //全选和不全选所有的省
$("#allProvinceDetail").click(function(){ $("#allProvinceDetail").click(function () {
if($("#allProvinceDetail").attr("checked") == "checked"){//全选 if ($("#allProvinceDetail").attr("checked") == "checked") {//全选
$(".provinceDetail").attr("checked","checked"); $(".provinceDetail").attr("checked", "checked");
detailProvinceCheckedValues=$(".provinceDetail:checked"); detailProvinceCheckedValues = $(".provinceDetail:checked");
}else{//不全选 } else {//不全选
$(".provinceDetail").attr("checked",false); $(".provinceDetail").attr("checked", false);
$(".provinceDetail").attr("disabled",false); $(".provinceDetail").attr("disabled", false);
detailProvinceCheckedValues=$(".provinceDetail:checked"); detailProvinceCheckedValues = $(".provinceDetail:checked");
} }
judge=false; judge = false;
}); });
//选中勾选了的省 //选中勾选了的省
$(".provinceDetail").click(function(){ $(".provinceDetail").click(function () {
var clickFlag=true;//是否全部选中 var clickFlag = true;//是否全部选中
$(".provinceDetail").each(function(){ $(".provinceDetail").each(function () {
if($(this).attr("checked") == null||$(this).attr("checked") == false){ clickFlag=false; } if ($(this).attr("checked") == null || $(this).attr("checked") == false) {
clickFlag = false;
}
}); });
$("#allProvinceDetail").attr("checked",clickFlag); $("#allProvinceDetail").attr("checked", clickFlag);
detailProvinceCheckedValues=$(".provinceDetail:checked"); detailProvinceCheckedValues = $(".provinceDetail:checked");
//alert(getDetailProvinceCheckedValueString()); //alert(getDetailProvinceCheckedValueString());
judge=false; judge = false;
}); });
//重置 //重置
function detailProvinceReset(){ function detailProvinceReset() {
$("#allProvinceDetail").attr("checked","checked"); $("#allProvinceDetail").attr("checked", "checked");
$(".provinceDetail").attr("checked","checked"); $(".provinceDetail").attr("checked", "checked");
detailProvinceCheckedValues=$(".provinceDetail"); detailProvinceCheckedValues = $(".provinceDetail");
} }
//返回结果为一个数组,数组中包含选中的省份 //返回结果为一个数组,数组中包含选中的省份
function getDetailProvinceCheckedValues(){ function getDetailProvinceCheckedValues() {
var provinceArray=new Array(); var provinceArray = new Array();
detailProvinceCheckedValues.each(function(){ detailProvinceCheckedValues.each(function () {
provinceArray.push($(this).val()); provinceArray.push($(this).val());
}); });
console.log("provinceArray "+provinceArray ); console.log("provinceArray " + provinceArray);
return provinceArray; return provinceArray;
} }
//获取 选择的省份 //获取 选择的省份
function getDetailProvinceCheckedValueString(){ function getDetailProvinceCheckedValueString() {
//var detailProvince = ""; //var detailProvince = "";
var provinceArray=getDetailProvinceCheckedValues(); var provinceArray = getDetailProvinceCheckedValues();
//provinceArray.join("-1"); //provinceArray.join("-1");
//if($("#allProvinceDetail").attr("checked") == "checked"){provinceArray.push("-1");} //if($("#allProvinceDetail").attr("checked") == "checked"){provinceArray.push("-1");}
/* for(var i=0;i<provinceArray.length;i++){ /* for(var i=0;i<provinceArray.length;i++){
...@@ -293,19 +296,19 @@ ...@@ -293,19 +296,19 @@
//返回结果为选中的省份名,筛选项标签 //返回结果为选中的省份名,筛选项标签
function getDetailProvinceCheckedTitles(){ function getDetailProvinceCheckedTitles() {
var provinceArray=new Array(); var provinceArray = new Array();
var i=0; var i = 0;
$(".provinceDetail:checked").each(function(){ $(".provinceDetail:checked").each(function () {
provinceArray[i]=$(this).attr("title"); provinceArray[i] = $(this).attr("title");
i++; i++;
}); });
var detailProvinceTitles=""; var detailProvinceTitles = "";
for(var i=0;i<provinceArray.length;i++){ for (var i = 0; i < provinceArray.length; i++) {
if(i==provinceArray.length-1){ if (i == provinceArray.length - 1) {
detailProvinceTitles+=provinceArray[i]; detailProvinceTitles += provinceArray[i];
}else{ } else {
detailProvinceTitles+=provinceArray[i]+" "; detailProvinceTitles += provinceArray[i] + " ";
} }
} }
return detailProvinceTitles; return detailProvinceTitles;
...@@ -313,56 +316,59 @@ ...@@ -313,56 +316,59 @@
</script> </script>
<%--************************************************集成商与省份联动***************************************** --%> <%--************************************************集成商与省份联动***************************************** --%>
<script type="text/javascript"> <script type="text/javascript">
function detailProviderChange(){ function detailProviderChange() {
$("#provinceSelectAreaDetail").empty(); $("#provinceSelectAreaDetail").empty();
var providerSelectIds = getDetailProviderCheckedValuesString(); var providerSelectIds = getDetailProviderCheckedValuesString();
$.ajax({ $.ajax({
type : 'GET', type: 'GET',
contentType : 'application/json', contentType: 'application/json',
url: '${ctx}/MonitorOperation/FailureStatisticsCriteria/provider_select/'+providerSelectIds+'/'+Date.parse(new Date()), url: '${ctx}/MonitorOperation/FailureStatisticsCriteria/provider_select/' + providerSelectIds + '/' + Date.parse(new Date()),
dataType : 'text', dataType: 'text',
beforeSend: function(data) {}, beforeSend: function (data) {
success: function(data) { },
for(var i=0;i<data.length;i++){ success: function (data) {
if(data[i]=='\"'){ for (var i = 0; i < data.length; i++) {
data=data.replace('\"','\''); if (data[i] == '\"') {
data = data.replace('\"', '\'');
} }
} }
data=eval("("+data+")");//获取从后台返回的数据,通常是Json格式 data = eval("(" + data + ")");//获取从后台返回的数据,通常是Json格式
if(data != null && data != ""){ if (data != null && data != "") {
$("#allProvinceDetail").attr("checked",true); $("#allProvinceDetail").attr("checked", true);
for(var t=0;t<data.length;t++){ for (var t = 0; t < data.length; t++) {
$("#provinceSelectAreaDetail").append('<div class="checkbox-inline"><label><input type="checkbox" name="provinceDetail" class="provinceDetail" title="'+data[t].provinceName+'" value="'+data[t].provinceId+'" checked>'+data[t].provinceName+'</label></div>'); $("#provinceSelectAreaDetail").append('<div class="checkbox-inline"><label><input type="checkbox" name="provinceDetail" class="provinceDetail" title="' + data[t].provinceName + '" value="' + data[t].provinceId + '" checked>' + data[t].provinceName + '</label></div>');
} }
} }
detailProvinceCheckedValues=$(".provinceDetail:checked"); detailProvinceCheckedValues = $(".provinceDetail:checked");
//全选和不全选所有的省 //全选和不全选所有的省
$("#allProvinceDetail").click(function(){ $("#allProvinceDetail").click(function () {
if($("#allProvinceDetail").attr("checked") == "checked"){//全选 if ($("#allProvinceDetail").attr("checked") == "checked") {//全选
$(".provinceDetail").attr("checked","checked"); $(".provinceDetail").attr("checked", "checked");
detailProvinceCheckedValues=$(".provinceDetail:checked"); detailProvinceCheckedValues = $(".provinceDetail:checked");
}else{//不全选 } else {//不全选
$(".provinceDetail").attr("checked",false); $(".provinceDetail").attr("checked", false);
$(".provinceDetail").attr("disabled",false); $(".provinceDetail").attr("disabled", false);
detailProvinceCheckedValues=$(".provinceDetail:checked"); detailProvinceCheckedValues = $(".provinceDetail:checked");
} }
judge=false; judge = false;
}); });
//选中勾选了的省 //选中勾选了的省
$(".provinceDetail").click(function(){ $(".provinceDetail").click(function () {
var clickFlag=true;//是否全部选中 var clickFlag = true;//是否全部选中
$(".provinceDetail").each(function(){ $(".provinceDetail").each(function () {
if($(this).attr("checked") == null||$(this).attr("checked") == false){ clickFlag=false; } if ($(this).attr("checked") == null || $(this).attr("checked") == false) {
clickFlag = false;
}
}); });
$("#allProvinceDetail").attr("checked",clickFlag); $("#allProvinceDetail").attr("checked", clickFlag);
detailProvinceCheckedValues=$(".provinceDetail:checked"); detailProvinceCheckedValues = $(".provinceDetail:checked");
//alert(getDetailProvinceCheckedValueString()); //alert(getDetailProvinceCheckedValueString());
judge=false; judge = false;
}); });
} }
}); });
...@@ -372,12 +378,13 @@ ...@@ -372,12 +378,13 @@
// reset province // reset province
function detail_Province_Reset() { function detail_Province_Reset() {
$("#allProvinceDetail").attr("checked","checked"); $("#allProvinceDetail").attr("checked", "checked");
$(".provinceDetail").attr("checked","checked"); $(".provinceDetail").attr("checked", "checked");
} }
// reset dimension // reset dimension
function detail_Dimension_Reset(){ function detail_Dimension_Reset() {
$("#xcdStatusSelect option").removeAttr("selected"); $("#xcdStatusSelect option").removeAttr("selected");
$("#xcdStatusSelect option:eq(1)").attr("selected",true); $("#xcdStatusSelect option:eq(1)").attr("selected", true);
} }
</script> </script>
\ No newline at end of file
<%@tag pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<div id="timeLine" class="date">
<label for="">时间范围</label><!-- 最近3年 -->
<input id="d1" class="Wdate" type="text" value=""
onFocus="var d2=$dp.$('d2');WdatePicker({onpicked:function(){d2.focus();},minDate:'{%y-3}-%M-%d %H:%m:%s',maxDate:'#F{$dp.$D(\'d2\')||\'%y-%M-%d %H:%m:%s\'}'})">
--
<input id="d2" class="Wdate" type="text" value=""
onFocus="WdatePicker({minDate:'#F{$dp.$D(\'d1\')||\'{%y-3}-%M-%d %H:%m:%s\'}',maxDate:'%y-%M-%d %H:%m:%s'})">
<%--<input id="d1" class="Wdate" type="text" style="width:137px;" value="" onFocus="var d2=$dp.$('d2');WdatePicker({onpicked:function(){d2.focus();},minDate:'{%y-3}-%M-%d %H:%m:%s',maxDate:'#F{$dp.$D(\'d2\')||\'%y-%M-%d %H:%m:%s\'}',dateFmt:'yyyy-MM-dd'})">
--
<input id="d2" class="Wdate" type="text" style="width:137px;" value="" onFocus="WdatePicker({minDate:'#F{$dp.$D(\'d1\')||\'{%y-3}-%M-%d %H:%m:%s\'}',maxDate:'%y-%M-%d %H:%m:%s',dateFmt:'yyyy-MM-dd'})">
--%>
</div>
<div id="more-option" class="slide-menu-option">
<div class="slide-select">
<label for="">关联维度:</label>
<select name="xcdStatus" id="xcdStatusSelect" class="slide-menu-select" onChange="judge=false;">
<option value="c">业务</option>
<option value="q" selected>渠道</option>
<%--<c:forEach var="workingOrderStatus" items="${workingOrderStatusList}">
<option value="${workingOrderStatus}" id="xcdStatus">
${workingOrderStatus}
</option>
</c:forEach>--%>
</select>
</div>
</div>
<%--省份筛选项 --%>
<div id="provinceDetail" class="slide-menu-option">
<label for="">省份</label>
<div class="checkbox-inline"><label><input type="checkbox" name="allProvinceDetail" id="allProvinceDetail"
title="allSelect" checked/>全选</label></div>
<div id="provinceSelectAreaDetail">
<c:forEach items="${provinceList}" var="provinces">
<c:if test="${provinces.provinceId !=32}">
<div class="checkbox-inline">
<label>
<input type="checkbox" name="provinceDetail" class="provinceDetail"
title="${provinces.provinceName}" value="${provinces.provinceId}"
checked/>${provinces.provinceName}
</label>
</div>
</c:if>
</c:forEach>
</div>
</div>
<script type="text/javascript">
function initStartTime() {
var now = new Date();
var year = now.getFullYear(); //年
var month = now.getMonth() + 1; //月
var day = now.getDate(); //日
var hh = now.getHours(); //时
var mm = now.getMinutes(); //分
var clock = year + "-";
if (month < 10)
clock += "0";
clock += month + "-";
if (day < 10)
clock += "0";
clock += day + " ";
if (hh < 10)
clock += "0";
clock += hh + ":";
if (mm < 10) clock += '0';
clock += mm;
clock += ":" + "00";
return (clock);
}
function initEndTime() {
var date = new Date();
var daysInMonth = new Array([0], [31], [28], [31], [30], [31], [30], [31], [31], [30], [31], [30], [31]);
var strYear = date.getFullYear();
var strDay = date.getDate();
var strMonth = date.getMonth() + 1;
var hh = date.getHours(); //时
var mm = date.getMinutes(); //分
if (strYear % 4 == 0 && strYear % 100 != 0) {
daysInMonth[2] = 29;
}
if (strMonth - 1 == 0) {
strYear -= 1;
strMonth = 12;
}
else {
strMonth -= 1;
}
strDay = daysInMonth[strMonth] >= strDay ? strDay : daysInMonth[strMonth];
if (strMonth < 10) {
strMonth = "0" + strMonth;
}
if (strDay < 10) {
strDay = "0" + strDay;
}
var clock = strYear + "-" + strMonth + "-" + strDay;
clock += " ";
if (hh < 10)
clock += "0";
clock += hh + ":";
if (mm < 10) clock += '0';
clock += mm;
clock += ":" + "00";
return (clock);
}
//初始化时间控件的默认值,需要在页面加载时调用此初始化方法
function initDate() {
$(".date #d1").val(initEndTime());
$(".date #d2").val(initStartTime());
}
var detailProviderCheckedValues = $(".providerDetail:checked");
$("#allProviderDetail").click(function () {
if ($("#allProviderDetail").attr("checked") == "checked") {//全选
$(".providerDetail").attr("checked", "checked");
// $(".providerDetail").attr("disabled",true);
detailProviderCheckedValues = $(".providerDetail:checked");
//alert(getDetailChannelCheckedValuesString());
detailProviderChange();
} else {//不全选
$(".providerDetail").attr("checked", false);
$(".providerDetail").attr("disabled", false);
detailProviderCheckedValues = $(".providerDetail:checked");
// alert(getDetailChannelCheckedValuesString());
detailProviderChange();
}
judge = false;
});
$(".providerDetail").click(function () {
var clickFlag = true;//是否全部选中
$(".providerDetail").each(function () {
if ($(this).attr("checked") == null || $(this).attr("checked") == false) {
clickFlag = false;
}
});
$("#allProviderDetail").attr("checked", clickFlag);
detailProviderCheckedValues = $(".providerDetail:checked");
detailProviderChange();
//alert(getDetailProviderCheckedValuesString());
//alert(getDetailProviderCheckedTitles());
judge = false;
});
//返回结果为一个数组,数组中包含选中的渠道类型
function getDetailProviderCheckedValues() {
var detailProviderArray = new Array();
var i = 0;
detailProviderCheckedValues.each(function () {
detailProviderArray[i] = $(this).val();
i++;
});
return detailProviderArray;
}
//返回结果为逗号分隔的ID字串
function getDetailProviderCheckedValuesString() {
//var detailProviderStr="";
var detailProviderArray = getDetailProviderCheckedValues();
// detailProviderArray.join(",");
// if($("#allProviderDetail").attr("checked") == "checked"){detailProviderArray.push("-1");}
/* for(var i=0;i<detailProviderArray.length;i++){
if(i==detailProviderArray.length-1){
detailProviderStr+=detailProviderArray[i];
}else{
detailProviderStr+=detailProviderArray[i]+",";
}
} */
return detailProviderArray;//detailProviderStr;
}
//返回 关联维度 的 选择值
function getDetailCheckeddDimension() {
var checkedDimension = $("#xcdStatusSelect option:selected").val();
console.log("checkedDimension " + checkedDimension);
return checkedDimension;
}
//返回结果集成商名称集
function getDetailProviderCheckedTitles() {
var detailProviderArray = new Array();
var i = 0;
detailProviderCheckedValues.each(function () {
detailProviderArray[i] = $(this).attr("title");
i++;
});
var detailProviderTitles = "";
for (i = 0; i < detailProviderArray.length; i++) {
if (i == detailProviderArray.length - 1) {
detailProviderTitles += detailProviderArray[i];
} else {
detailProviderTitles += detailProviderArray[i] + " ";
}
}
return detailProviderTitles;
}
function detailProviderReset() {
$("#allProviderDetail").attr("checked", "checked");
$(".providerDetail").attr("checked", "checked");
detailProviderCheckedValues = $(".providerDetail:checked");
detailProviderChange();
}
</script>
<script type="text/javascript">
var detailProvinceCheckedValues = $(".provinceDetail:checked");
//全选和不全选所有的省
$("#allProvinceDetail").click(function () {
if ($("#allProvinceDetail").attr("checked") == "checked") {//全选
$(".provinceDetail").attr("checked", "checked");
detailProvinceCheckedValues = $(".provinceDetail:checked");
} else {//不全选
$(".provinceDetail").attr("checked", false);
$(".provinceDetail").attr("disabled", false);
detailProvinceCheckedValues = $(".provinceDetail:checked");
}
judge = false;
});
//选中勾选了的省
$(".provinceDetail").click(function () {
var clickFlag = true;//是否全部选中
$(".provinceDetail").each(function () {
if ($(this).attr("checked") == null || $(this).attr("checked") == false) {
clickFlag = false;
}
});
$("#allProvinceDetail").attr("checked", clickFlag);
detailProvinceCheckedValues = $(".provinceDetail:checked");
//alert(getDetailProvinceCheckedValueString());
judge = false;
});
//重置
function detailProvinceReset() {
$("#allProvinceDetail").attr("checked", "checked");
$(".provinceDetail").attr("checked", "checked");
detailProvinceCheckedValues = $(".provinceDetail");
}
//返回结果为一个数组,数组中包含选中的省份
function getDetailProvinceCheckedValues() {
var provinceArray = new Array();
detailProvinceCheckedValues.each(function () {
provinceArray.push($(this).val());
});
console.log("provinceArray " + provinceArray);
return provinceArray;
}
//获取 选择的省份
function getDetailProvinceCheckedValueString() {
//var detailProvince = "";
var provinceArray = getDetailProvinceCheckedValues();
//provinceArray.join("-1");
//if($("#allProvinceDetail").attr("checked") == "checked"){provinceArray.push("-1");}
/* for(var i=0;i<provinceArray.length;i++){
if(i==provinceArray.length-1){
detailProvince+=provinceArray[i];
}else{
detailProvince+=provinceArray[i]+",";
}
} */
return provinceArray;//detailProvince;
}
//返回结果为选中的省份名,筛选项标签
function getDetailProvinceCheckedTitles() {
var provinceArray = new Array();
var i = 0;
$(".provinceDetail:checked").each(function () {
provinceArray[i] = $(this).attr("title");
i++;
});
var detailProvinceTitles = "";
for (var i = 0; i < provinceArray.length; i++) {
if (i == provinceArray.length - 1) {
detailProvinceTitles += provinceArray[i];
} else {
detailProvinceTitles += provinceArray[i] + " ";
}
}
return detailProvinceTitles;
}
</script>
<%--************************************************集成商与省份联动***************************************** --%>
<script type="text/javascript">
function detailProviderChange() {
$("#provinceSelectAreaDetail").empty();
var providerSelectIds = getDetailProviderCheckedValuesString();
$.ajax({
type: 'GET',
contentType: 'application/json',
url: '${ctx}/MonitorOperation/FailureStatisticsCriteria/provider_select/' + providerSelectIds + '/' + Date.parse(new Date()),
dataType: 'text',
beforeSend: function (data) {
},
success: function (data) {
for (var i = 0; i < data.length; i++) {
if (data[i] == '\"') {
data = data.replace('\"', '\'');
}
}
data = eval("(" + data + ")");//获取从后台返回的数据,通常是Json格式
if (data != null && data != "") {
$("#allProvinceDetail").attr("checked", true);
for (var t = 0; t < data.length; t++) {
$("#provinceSelectAreaDetail").append('<div class="checkbox-inline"><label><input type="checkbox" name="provinceDetail" class="provinceDetail" title="' + data[t].provinceName + '" value="' + data[t].provinceId + '" checked>' + data[t].provinceName + '</label></div>');
}
}
detailProvinceCheckedValues = $(".provinceDetail:checked");
//全选和不全选所有的省
$("#allProvinceDetail").click(function () {
if ($("#allProvinceDetail").attr("checked") == "checked") {//全选
$(".provinceDetail").attr("checked", "checked");
detailProvinceCheckedValues = $(".provinceDetail:checked");
} else {//不全选
$(".provinceDetail").attr("checked", false);
$(".provinceDetail").attr("disabled", false);
detailProvinceCheckedValues = $(".provinceDetail:checked");
}
judge = false;
});
//选中勾选了的省
$(".provinceDetail").click(function () {
var clickFlag = true;//是否全部选中
$(".provinceDetail").each(function () {
if ($(this).attr("checked") == null || $(this).attr("checked") == false) {
clickFlag = false;
}
});
$("#allProvinceDetail").attr("checked", clickFlag);
detailProvinceCheckedValues = $(".provinceDetail:checked");
//alert(getDetailProvinceCheckedValueString());
judge = false;
});
}
});
}
</script>
<script type="text/javascript">
// reset province
function detail_Province_Reset() {
$("#allProvinceDetail").attr("checked", "checked");
$(".provinceDetail").attr("checked", "checked");
}
// reset dimension
function detail_Dimension_Reset() {
$("#xcdStatusSelect option").removeAttr("selected");
$("#xcdStatusSelect option:eq(1)").attr("selected", true);
}
</script>
\ No newline at end of file
...@@ -15,19 +15,25 @@ ...@@ -15,19 +15,25 @@
<select name="xcdStatus" id="xcdStatusSelect" class="slide-menu-select" onChange="judge=false;"> <select name="xcdStatus" id="xcdStatusSelect" class="slide-menu-select" onChange="judge=false;">
<option value="y">业务</option> <option value="y">业务</option>
<option value="c" selected>渠道</option> <option value="c" selected>渠道</option>
<%--<c:forEach var="workingOrderStatus" items="${workingOrderStatusList}">
<option value="${workingOrderStatus}" id="xcdStatus">
${workingOrderStatus}
</option>
</c:forEach>--%>
</select> </select>
</div> </div>
</div> </div>
<%--省份筛选项 --%> <%--省份筛选项 --%>
<div id="provinceDetail" class="slide-menu-option"> <div id="provinceDetail" class="slide-menu-option">
<label for="">省份</label> <label for="">省份</label>
<div class="checkbox-inline"><label><input type="checkbox" name="allProvinceDetail" id="allProvinceDetail" title="allSelect" checked />全选</label></div> <div class="checkbox-inline">
<div id="provinceSelectAreaDetail"> <%--<label><input type="checkbox" name="allProvinceDetail" id="allProvinceDetail" title="allSelect" checked />全选</label>--%>
<label>
<c:forEach items="${provinceList}" var="provinces">
<c:if test="${provinces.provinceId ==32}">
<input type="checkbox" name="provinceDetail" class="provinceDetail" title="${provinces.provinceName}" value="${provinces.provinceId}" checked disabled/>${provinces.provinceName}
</c:if>
</c:forEach>
</label>
</div>
<%--<div id="provinceSelectAreaDetail">
<c:forEach items="${provinceList}" var="provinces"> <c:forEach items="${provinceList}" var="provinces">
<div class="checkbox-inline"> <div class="checkbox-inline">
<label> <label>
...@@ -35,7 +41,7 @@ ...@@ -35,7 +41,7 @@
</label> </label>
</div> </div>
</c:forEach> </c:forEach>
</div> </div>--%>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
var detailProviderCheckedValues=$(".providerDetail:checked"); var detailProviderCheckedValues=$(".providerDetail:checked");
......
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
<div class="slideMenu" id="cbp-spmenu-s2" style=""> <div class="slideMenu" id="cbp-spmenu-s2" style="">
<div class="form"> <div class="form">
<tags:GZFX__Dimension_Province_detail/> <tags:GZFX__Dimension_Province_detail_associateDiagosisDetail/>
<button class="btn btn-primary" onclick="detailSubmit()">提交</button> <button class="btn btn-primary" onclick="detailSubmit()">提交</button>
<button class="btn btn-warning" onclick="detailReset()">重置</button> <button class="btn btn-warning" onclick="detailReset()">重置</button>
......
...@@ -15,22 +15,37 @@ ...@@ -15,22 +15,37 @@
<head> <head>
<title>模型维护</title> <title>模型维护</title>
<style> <style>
.table-null .table{ .table-null .table {
margin-bottom: 0px; margin-bottom: 0px;
} }
.table-null .table > tbody > tr > td, .table-null .table > thead > tr > th{
.table-null .table > tbody > tr > td, .table-null .table > thead > tr > th {
text-align: center; text-align: center;
width: 25%; width: 25%;
} }
.table-null td:first-child{
.table-null td:first-child {
text-align: right; text-align: right;
width: 36%; width: 36%;
} }
.table-null tr td:last-child .form-control,.table-null tr td:last-child table{
.table-null tr td:last-child .form-control, .table-null tr td:last-child table {
width: 400px; width: 400px;
} }
.file-box{ position:relative;}
.file{ position:absolute; top:0; height:30px; filter:alpha(opacity:0);opacity:0;width:470px;cursor: pointer; } .file-box {
position: relative;
}
.file {
position: absolute;
top: 0;
height: 30px;
filter: alpha(opacity:0);
opacity: 0;
width: 470px;
cursor: pointer;
}
/* .file-box{ position:relative;width:340px} /* .file-box{ position:relative;width:340px}
.txt{ height:22px; border:1px solid #cdcdcd; width:180px;} .txt{ height:22px; border:1px solid #cdcdcd; width:180px;}
...@@ -58,27 +73,36 @@ ...@@ -58,27 +73,36 @@
<div class="row"> <div class="row">
<div class="col-xs-12"> <div class="col-xs-12">
<div class="table-header">新建指标</div> <div class="table-header">新建指标</div>
<form action="#" class="form-horizontal" id="modelMaintainForm" method="post" enctype="multipart/form-data"> <form action="#" class="form-horizontal" id="modelMaintainForm" method="post"
enctype="multipart/form-data">
<table id="modelMaintainTable" class="table-null"> <table id="modelMaintainTable" class="table-null">
<tr> <tr>
<td>省份:</td> <td>省份:</td>
<td> <td>
<div class="checkbox-inline"> <%--<div class="checkbox-inline">
<input type="checkbox" name="" id="provinceDetailAll" title="" value="" /><div style="color:red;">全选</div> <input type="checkbox" name="" id="provinceDetailAll" title="" value="" /><div style="color:red;">全选</div>
</div> </div>--%>
<c:forEach var="provice" items="${proviceList}"> <c:forEach var="provice" items="${proviceList}">
<div class="checkbox-inline"> <c:if test="${provice.provinceId ==32}">
<label> <label>
<input type="checkbox" name="provinceDetail" class="provinceDetail" title="${provice.provinceName}" value="${provice.provinceId}" />${provice.provinceName} <input type="checkbox" name="provinceDetail"
class="provinceDetail" title="${provice.provinceName}"
value="${provice.provinceId}" checked disabled/>
${provice.provinceName}
</label> </label>
</div>
</c:if>
</c:forEach> </c:forEach>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>维度:</td> <td>维度:</td>
<td><select class="form-control" name="dimensionTd" id="dimensionTd" > <td><select class="form-control" name="dimensionTd" id="dimensionTd">
<c:forEach var="modelType" items="${dimensionList}"> <c:forEach var="modelType" items="${dimensionList}">
<c:choose> <c:choose>
...@@ -97,17 +121,26 @@ ...@@ -97,17 +121,26 @@
</tr> </tr>
<tr> <tr>
<td>描述(<font color="red">必填</font>):</td> <td>描述(<font color="red">必填</font>):</td>
<td><input type="text" class="form-control" name="descTd" id="descTd" style="display: inline;" /> <td><input type="text" class="form-control" name="descTd" id="descTd"
<span id="writeWarningInf" style="color:red;display: inline;padding-left:10px;"></span></td> style="display: inline;"/>
<span id="writeWarningInf"
style="color:red;display: inline;padding-left:10px;"></span></td>
</tr> </tr>
<tr> <tr>
<td>已添加指标:</td> <td>已添加指标:</td>
<td><table class="table table-hover table-striped" id="displayParam"> <td>
<table class="table table-hover table-striped" id="displayParam">
<thead> <thead>
<tr><th>指标名称</th><th>权重值</th><th><a href="javascript:deleteAllTr()">删除所有</a></th></tr> <tr>
<th>指标名称</th>
<th>权重值</th>
<th><a href="javascript:deleteAllTr()">删除所有</a></th>
</tr>
</thead> </thead>
<tbody id="addTr"></tbody> <tbody id="addTr"></tbody>
</table></td></tr> </table>
</td>
</tr>
<tr> <tr>
<tr> <tr>
<td>数据源:</td> <td>数据源:</td>
...@@ -116,7 +149,10 @@ ...@@ -116,7 +149,10 @@
<c:forEach items="${dataSourceList}" var="dataSource"> <c:forEach items="${dataSourceList}" var="dataSource">
<div class="checkbox-inline"> <div class="checkbox-inline">
<label> <label>
<input type="checkbox" onclick="dataSourceRadioClick()" name="dataSourceRadio" class="provinceDetail" title="${dataSource.dataSourceName}" value="${dataSource.dataSourceId}" />${dataSource.dataSourceName} <input type="checkbox" onclick="dataSourceRadioClick()"
name="dataSourceRadio" class="provinceDetail"
title="${dataSource.dataSourceName}"
value="${dataSource.dataSourceId}"/>${dataSource.dataSourceName}
</label> </label>
</div> </div>
</c:forEach> </c:forEach>
...@@ -132,7 +168,10 @@ ...@@ -132,7 +168,10 @@
<c:forEach items="${channelList}" var="channel"> <c:forEach items="${channelList}" var="channel">
<div class="checkbox-inline"> <div class="checkbox-inline">
<label> <label>
<input type="checkbox" onclick="channelRadioClick()" name="channelRadio" class="provinceDetail" title="${channel.channelId}" value="${channel.channelId}" />${channel.channelName} <input type="checkbox" onclick="channelRadioClick()"
name="channelRadio" class="provinceDetail"
title="${channel.channelId}"
value="${channel.channelId}"/>${channel.channelName}
</label> </label>
</div> </div>
</c:forEach> </c:forEach>
...@@ -141,7 +180,6 @@ ...@@ -141,7 +180,6 @@
</tr> </tr>
<tr> <tr>
<td><acronym title="ni caicai">业务:</acronym></td> <td><acronym title="ni caicai">业务:</acronym></td>
<td id="businessActivedListTd"> <td id="businessActivedListTd">
...@@ -158,7 +196,8 @@ ...@@ -158,7 +196,8 @@
</tr> </tr>
<tr><td></td> <tr>
<td></td>
<%--<td><button type="button" id="selectAnaInfo" class="btn btn-primary btn-small">查找指标</button>--%> <%--<td><button type="button" id="selectAnaInfo" class="btn btn-primary btn-small">查找指标</button>--%>
<%--<button type="button" id="selectBusiness" class="btn btn-info- btn-small">查找业务</button></td>--%> <%--<button type="button" id="selectBusiness" class="btn btn-info- btn-small">查找业务</button></td>--%>
<%--<td><button type="button" id="addAnaInfo" class="btn btn-primary">添加指标</button></td>--%> <%--<td><button type="button" id="addAnaInfo" class="btn btn-primary">添加指标</button></td>--%>
...@@ -166,22 +205,31 @@ ...@@ -166,22 +205,31 @@
<tr> <tr>
<td>权重(<font color="red">必填</font>):</td> <td>权重(<font color="red">必填</font>):</td>
<td><input type="number" step="0.01" class="form-control" name="descTd" id="kpiWeightTd" value="1.00" style="display: inline;" /> <td><input type="number" step="0.01" class="form-control" name="descTd"
<span id="writeWarningInfTd" style="color:red;display: inline;padding-left:10px;"></span></td> id="kpiWeightTd" value="1.00" style="display: inline;"/>
<span id="writeWarningInfTd"
style="color:red;display: inline;padding-left:10px;"></span></td>
</tr> </tr>
<tr><td></td><td> <tr>
<td></td>
<td>
<button type="button" id="UPDATEAnaInfo" class="btn btn-primary">修改指标</button> <button type="button" id="UPDATEAnaInfo" class="btn btn-primary">修改指标
</button>
</td></tr> </td>
</tr>
<tr><td></td><td> <tr>
<td></td>
<td>
<button type="button" id="addAnaInfo" class="btn btn-info">添加勾选指标</button> <button type="button" id="addAnaInfo" class="btn btn-info">添加勾选指标</button>
<button type="button" id="modelSubmit" class="btn btn-primary">确定</button> <button type="button" id="modelSubmit" class="btn btn-primary">确定</button>
<button type="reset" class="btn btn-default" id="modelReset">清空</button> <button type="reset" class="btn btn-default" id="modelReset">清空</button>
<button type="reset" class="btn btn-warning" id="modelBack">返回</button> <button type="reset" class="btn btn-warning" id="modelBack">返回</button>
</td></tr> </td>
</tr>
</table> </table>
</form> </form>
</div> </div>
...@@ -194,18 +242,18 @@ ...@@ -194,18 +242,18 @@
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function(){ $(document).ready(function () {
$("#UPDATEAnaInfo").hide(); $("#UPDATEAnaInfo").hide();
if($("#paramDataType").val()=="字符"){ if ($("#paramDataType").val() == "字符") {
var addDataValue = $("<input type='text' class='form-control name=paramValue' id='paramValue'/>"); var addDataValue = $("<input type='text' class='form-control name=paramValue' id='paramValue'/>");
$("#addParamVal").append(addDataValue); $("#addParamVal").append(addDataValue);
}else if($("#paramDataType").val()=="日期"){ } else if ($("#paramDataType").val() == "日期") {
var addDataValue = $("<input type='text' class='form-control name=paramValue' id='paramValue' onFocus='WdatePicker({dateFmt:\" yyyy-MM-dd \"})'/>"); var addDataValue = $("<input type='text' class='form-control name=paramValue' id='paramValue' onFocus='WdatePicker({dateFmt:\" yyyy-MM-dd \"})'/>");
$("#addParamVal").append(addDataValue); $("#addParamVal").append(addDataValue);
}else if($("#paramDataType").val()=="时间"){ } else if ($("#paramDataType").val() == "时间") {
var addDataValue = $("<input type='text' class='form-control name=paramValue' id='paramValue' onFocus='WdatePicker({})'/>"); var addDataValue = $("<input type='text' class='form-control name=paramValue' id='paramValue' onFocus='WdatePicker({})'/>");
$("#addParamVal").append(addDataValue); $("#addParamVal").append(addDataValue);
}else{ } else {
var addDataValue = $("<input type='text' class='form-control' name='paramValue' id='paramValue' onkeyup='(this.v=function(){this.value=this.value.replace(/[^0-9]+/,\"\");}).call(this)' onblur='this.v();'/>"); var addDataValue = $("<input type='text' class='form-control' name='paramValue' id='paramValue' onkeyup='(this.v=function(){this.value=this.value.replace(/[^0-9]+/,\"\");}).call(this)' onblur='this.v();'/>");
$("#addParamVal").append(addDataValue); $("#addParamVal").append(addDataValue);
} }
...@@ -214,37 +262,68 @@ ...@@ -214,37 +262,68 @@
//全选和不全选所有的省 //全选和不全选所有的省
$("#provinceDetailAll").click(function () { $("#provinceDetailAll").click(function () {
if($("#provinceDetailAll").attr("checked") == "checked"){//全选 if ($("#provinceDetailAll").attr("checked") == "checked") {//全选
$("provinceDetail").attr("checked","checked"); $("provinceDetail").attr("checked", "checked");
$("input[name='provinceDetail']").attr("checked","checked"); $("input[name='provinceDetail']").attr("checked", "checked");
$("input[name='provinceDetail'][value='32']").attr("checked", false);
}else{//不全选 } else {//不全选
$("input[name='provinceDetail']").attr("checked",false); $("input[name='provinceDetail']").attr("checked", false);
$("input[name='provinceDetail']").attr("disabled",false); $("input[name='provinceDetail']").attr("disabled", false);
} }
}); });
$("input[name='provinceDetail'][value='3000']").click(function () {
alert($("input[name='provinceDetail'][value='32']").text());
alert($("input[name='provinceDetail'][value='32']").html());
if ($("input[name='provinceDetail'][value='32']").attr("checked") == "checked") {
/*$("#provinceDetailAll").next().hide();
$("#provinceDetailAll").hide();
$("input[name='provinceDetail'][value!='32']").next().hide();
$("input[name='provinceDetail'][value!='32']").hide();
*/
$("#provinceDetailAll").prop("disabled", "disabled");
$("input[name='provinceDetail'][value!='32']").prop("disabled", "disabled");
} else {
/* $("#provinceDetailAll").next().show();
$("#provinceDetailAll").show();
$("input[name='provinceDetail'][value!='32']").next().show();
$("input[name='provinceDetail'][value!='32']").show();*/
$("#provinceDetailAll").removeAttr("disabled");
$("input[name='provinceDetail'][value!='32']").removeAttr("disabled");
}
}
);
//模型名称是否重复判断 //模型名称是否重复判断
var isDouble = true; var isDouble = true;
$("#dataModelName").blur(function(){ $("#dataModelName").blur(function () {
if(""!=$.trim($(this).val())){ if ("" != $.trim($(this).val())) {
var modelName = $(this).val(); var modelName = $(this).val();
$.ajax({ $.ajax({
type: "GET", type: "GET",
contentType : "application/json", contentType: "application/json",
dataType: "text", dataType: "text",
url: "${ctx}/ModelManage/ModelMaintain/select_modelName/"+encodeURIComponent(modelName), url: "${ctx}/ModelManage/ModelMaintain/select_modelName/" + encodeURIComponent(modelName),
beforeSend: function(data) { $("#modelSubmit").attr("disabled",true);}, beforeSend: function (data) {
success:function(data){ $("#modelSubmit").attr("disabled", true);
},
success: function (data) {
data = parseInt(data); data = parseInt(data);
if(0==data){ if (0 == data) {
$("#writeWarningInf").html(""); $("#writeWarningInf").html("");
isDouble = false; isDouble = false;
$("#modelSubmit").attr("disabled",false); $("#modelSubmit").attr("disabled", false);
}else{ } else {
$("#writeWarningInf").html("<img src='${ctx}/static/images/x.png'/> 标题已存在"); $("#writeWarningInf").html("<img src='${ctx}/static/images/x.png'/> 标题已存在");
isDouble = true; isDouble = true;
$("#modelSubmit").attr("disabled",true); $("#modelSubmit").attr("disabled", true);
} }
} }
}); });
...@@ -252,58 +331,45 @@ ...@@ -252,58 +331,45 @@
}); });
//参数类型变化 类型数据验证 //参数类型变化 类型数据验证
$("#paramDataType").change(function(){ $("#paramDataType").change(function () {
$("#addParamVal").empty(); $("#addParamVal").empty();
var paramDataType = $(this).find("option:selected").val(); var paramDataType = $(this).find("option:selected").val();
if(paramDataType=="字符"){ if (paramDataType == "字符") {
var addDataValue = $("<input type='text' class='form-control name=paramValue' id='paramValue'/>"); var addDataValue = $("<input type='text' class='form-control name=paramValue' id='paramValue'/>");
$("#addParamVal").append(addDataValue); $("#addParamVal").append(addDataValue);
}else if(paramDataType=="日期"){ } else if (paramDataType == "日期") {
var addDataValue = $("<input type='text' class='form-control name=paramValue' id='paramValue' onFocus='WdatePicker({dateFmt:\" yyyy-MM-dd \"})'/>"); var addDataValue = $("<input type='text' class='form-control name=paramValue' id='paramValue' onFocus='WdatePicker({dateFmt:\" yyyy-MM-dd \"})'/>");
$("#addParamVal").append(addDataValue); $("#addParamVal").append(addDataValue);
}else if(paramDataType=="时间"){ } else if (paramDataType == "时间") {
var addDataValue = $("<input type='text' class='form-control name=paramValue' id='paramValue' onFocus='WdatePicker({})'/>"); var addDataValue = $("<input type='text' class='form-control name=paramValue' id='paramValue' onFocus='WdatePicker({})'/>");
$("#addParamVal").append(addDataValue); $("#addParamVal").append(addDataValue);
}else{ } else {
var addDataValue = $("<input type='text' class='form-control' name='paramValue' id='paramValue' onkeyup='(this.v=function(){this.value=this.value.replace(/[^0-9]+/,\"\");}).call(this)' onblur='this.v();'/>"); var addDataValue = $("<input type='text' class='form-control' name='paramValue' id='paramValue' onkeyup='(this.v=function(){this.value=this.value.replace(/[^0-9]+/,\"\");}).call(this)' onblur='this.v();'/>");
$("#addParamVal").append(addDataValue); $("#addParamVal").append(addDataValue);
} }
}); });
//删除所有参数 //删除所有参数
function deleteAllTr(){ function deleteAllTr() {
$("#addTr").empty(); $("#addTr").empty();
dimKpiSelected.splice(0,dimKpiSelected.length); dimKpiSelected.splice(0, dimKpiSelected.length);
} }
//修改一条参数
/* function updateRow(elementTag){
$("#addParam").text("修改参数");
$("#addTr").find("tr").removeClass("orange-tr");
$(elementTag).parents("tr").eq(0).addClass("orange-tr");
var paramName = $(elementTag).parents("tr").find("td").eq(0).html();
var paramValue = $(elementTag).parents("tr").find("td").eq(1).html();
var paramType = $(elementTag).parents("tr").find("td").eq(2).html();
$("#paramDataType option[value='"+paramType+"']").attr("selected","selected");
$("#paramDataType").change();
$("#paramName").val(paramName);
$("#paramValue").val(paramValue);
}*/
//添加/修改参数 //添加/修改参数
$("#addParam").click(function(){ $("#addParam").click(function () {
var paramDataType = $("#paramDataType").val(); var paramDataType = $("#paramDataType").val();
var paramName = $.trim($("#paramName").val()); var paramName = $.trim($("#paramName").val());
var paramValue = $("#paramValue").val(); var paramValue = $("#paramValue").val();
if(paramName==""){ if (paramName == "") {
$.alert("参数名不能为空"); $.alert("参数名不能为空");
}else{ } else {
if($("#addTr").find("tr.orange-tr").html()==null){ if ($("#addTr").find("tr.orange-tr").html() == null) {
var addRow = $("<tr><td>"+paramName+"</td><td id='paramValue_'+paramValue>"+paramValue+"</td><td>"+paramDataType+"</td><td><a href='javascript:;' title='' onclick='deleteRow(this)'>删除</a>&nbsp;&nbsp;<a href='javascript:;' onclick='updateRow(this)'>修改</a></td></tr>"); var addRow = $("<tr><td>" + paramName + "</td><td id='paramValue_'+paramValue>" + paramValue + "</td><td>" + paramDataType + "</td><td><a href='javascript:;' title='' onclick='deleteRow(this)'>删除</a>&nbsp;&nbsp;<a href='javascript:;' onclick='updateRow(this)'>修改</a></td></tr>");
$("#addTr").append(addRow); $("#addTr").append(addRow);
$("#paramName").attr("value",""); $("#paramName").attr("value", "");
$("#paramValue").attr("value",""); $("#paramValue").attr("value", "");
}else{ } else {
var findTr = $("#addTr").find("tr.orange-tr"); var findTr = $("#addTr").find("tr.orange-tr");
$(findTr).find("td").eq(0).html(paramName); $(findTr).find("td").eq(0).html(paramName);
$(findTr).find("td").eq(1).html(paramValue); $(findTr).find("td").eq(1).html(paramValue);
...@@ -315,59 +381,59 @@ ...@@ -315,59 +381,59 @@
}); });
//修改一条参数 //修改一条参数
function updateRow(e){ function updateRow(e) {
var pro=prompt("请输入",$(e).parent().prev()[0].innerHTML); var pro = prompt("请输入", $(e).parent().prev()[0].innerHTML);
var initK=Number($(e).parent().prev()[0].innerHTML); var initK = Number($(e).parent().prev()[0].innerHTML);
pro=$.trim(pro); pro = $.trim(pro);
if($.isNumeric(pro)){ if ($.isNumeric(pro)) {
pro=parseFloat(pro); pro = parseFloat(pro);
if(pro >0){ if (pro > 0) {
if(initK >= pro){ if (initK >= pro) {
$(e).parent().prev()[0].innerHTML=parseFloat(pro); $(e).parent().prev()[0].innerHTML = parseFloat(pro);
sumkpiWeightTdVal-=initK; sumkpiWeightTdVal -= initK;
sumkpiWeightTdVal+=pro; sumkpiWeightTdVal += pro;
var maxV=(1-Number(sumkpiWeightTdVal)).toFixed(2); var maxV = (1 - Number(sumkpiWeightTdVal)).toFixed(2);
$("#kpiWeightTd").val(maxV); $("#kpiWeightTd").val(maxV);
}else{ } else {
var k=sumkpiWeightTdVal-initK+pro; var k = sumkpiWeightTdVal - initK + pro;
if(k <=1.00){ if (k <= 1.00) {
$(e).parent().prev()[0].innerHTML=parseFloat(pro); $(e).parent().prev()[0].innerHTML = parseFloat(pro);
sumkpiWeightTdVal-=initK; sumkpiWeightTdVal -= initK;
sumkpiWeightTdVal+=pro; sumkpiWeightTdVal += pro;
var maxV=(1-Number(sumkpiWeightTdVal)).toFixed(2); var maxV = (1 - Number(sumkpiWeightTdVal)).toFixed(2);
$("#kpiWeightTd").val(maxV); $("#kpiWeightTd").val(maxV);
} }
} }
} }
} }
} }
//删除一条参数 //删除一条参数
function deleteRow(e){ function deleteRow(e) {
var v=$(e).parent().prev().text(); var v = $(e).parent().prev().text();
sumkpiWeightTdVal=sumkpiWeightTdVal-v; sumkpiWeightTdVal = sumkpiWeightTdVal - v;
$("#kpiWeightTd").val( (1.00-sumkpiWeightTdVal).toFixed(2)); $("#kpiWeightTd").val((1.00 - sumkpiWeightTdVal).toFixed(2));
var id=Number(e.title); var id = Number(e.title);
dimKpiSelected.splice($.inArray(id,dimKpiSelected),1); dimKpiSelected.splice($.inArray(id, dimKpiSelected), 1);
$(e).parent().parent().remove(); $(e).parent().parent().remove();
} }
//form表单重置 //form表单重置
$("#modelReset").click(function(){ $("#modelReset").click(function () {
$("#businessActivedListTd").empty(); $("#businessActivedListTd").empty();
$("#dimKpiListTd").empty(); $("#dimKpiListTd").empty();
deleteAllTr(); deleteAllTr();
}); });
//返回 选中的省份 //返回 选中的省份
function getDetailProvinceCheckedValues(){ function getDetailProvinceCheckedValues() {
var provinceArray=new Array(); var provinceArray = new Array();
$("input[name='provinceDetail']").each(function(){ $("input[name='provinceDetail']").each(function () {
if($(this).attr("checked")){ if ($(this).attr("checked")) {
provinceArray.push($(this).val()); provinceArray.push($(this).val());
} }
}); });
...@@ -375,50 +441,54 @@ ...@@ -375,50 +441,54 @@
} }
//form表单提交 //form表单提交
$("#modelSubmit").click(function(){ $("#modelSubmit").click(function () {
//sumkpiWeightTdVal=sumkpiWeightTdVal.toFixed(2); //sumkpiWeightTdVal=sumkpiWeightTdVal.toFixed(2);
sumkpiWeightTdVal=parseFloat(2); sumkpiWeightTdVal = parseFloat(2);
if(sumkpiWeightTdVal <1.00){ if (sumkpiWeightTdVal < 1.00) {
$.alert("权限总和需 为 1"); $.alert("权限总和需 为 1");
return; return;
} }
var anainfoShallSaveArr= getAnainfoShallSave(); var anainfoShallSaveArr = getAnainfoShallSave();
var arrDimKpiChecked=getArrDimKpiChecked(); var arrDimKpiChecked = getArrDimKpiChecked();
var provinceDetailChecked=getDetailProvinceCheckedValues(); var provinceDetailChecked = getDetailProvinceCheckedValues();
if(provinceDetailChecked.length < 1){ if (provinceDetailChecked.length < 1) {
$.alert("省份需选"); $.alert("省份需选");
return; return;
}else if($.trim($("#descTd").val())==""){ } else if ($.trim($("#descTd").val()) == "") {
$.alert("描述不能为空"); $.alert("描述不能为空");
return; return;
}else if(anainfoShallSaveArr.length < 1){ } else if (anainfoShallSaveArr.length < 1) {
$.alert("指标需选"); $.alert("指标需选");
return; return;
} }
else{ else {
var proviceTdSelected=$("#proviceTd option:selected").val(); var proviceTdSelected = $("#proviceTd option:selected").val();
var dimensionTdSelected=$("#dimensionTd option:selected").val(); var dimensionTdSelected = $("#dimensionTd option:selected").val();
var descTdV=$("#descTd").val(); var descTdV = $("#descTd").val();
var kpiWeightTdV=$("#kpiWeightTd").val(); var kpiWeightTdV = $("#kpiWeightTd").val();
$("#modelSubmit").attr("disabled","disabled"); $("#modelSubmit").attr("disabled", "disabled");
$.ajax({ $.ajax({
type : 'GET', type: 'GET',
async : true, async: true,
contentType : 'application/json', contentType: 'application/json',
data : {/*proviceTdSelected : proviceTdSelected,*/dimensionTdSelected:dimensionTdSelected,descTdV:descTdV/*,kpiWeightTdV:kpiWeightTdV*/}, data: {
url: "${ctx}/MonitorOperation/AssociateDiagosisConfiguration/createAssociDigConfig?anainfoShallSaveArr="+anainfoShallSaveArr+"&proviceSelected="+provinceDetailChecked, /*proviceTdSelected : proviceTdSelected,*/
dataType : 'text', dimensionTdSelected: dimensionTdSelected,
success: function(data){ descTdV: descTdV/*,kpiWeightTdV:kpiWeightTdV*/
},
url: "${ctx}/MonitorOperation/AssociateDiagosisConfiguration/createAssociDigConfig?anainfoShallSaveArr=" + anainfoShallSaveArr + "&proviceSelected=" + provinceDetailChecked,
dataType: 'text',
success: function (data) {
$.alert(data); $.alert(data);
sumkpiWeightTdVal=0.00; sumkpiWeightTdVal = 0.00;
setTimeout(function () { setTimeout(function () {
location.href="${ctx}/MonitorOperation/AssociateDiagosisConfiguration"; location.href = "${ctx}/MonitorOperation/AssociateDiagosisConfiguration";
},2000); }, 2000);
} }
...@@ -427,9 +497,9 @@ ...@@ -427,9 +497,9 @@
} }
}); });
$("#modelBack").click(function(){ $("#modelBack").click(function () {
location.href="${ctx}/MonitorOperation/AssociateDiagosisConfiguration"; location.href = "${ctx}/MonitorOperation/AssociateDiagosisConfiguration";
}); });
...@@ -438,25 +508,25 @@ ...@@ -438,25 +508,25 @@
$("#dimKpiListTd").empty(); $("#dimKpiListTd").empty();
//获取选择的 业务 //获取选择的 业务
var businessSelectedArr=[]; var businessSelectedArr = [];
$("input[name='BusinessCheck']").each(function(e){ $("input[name='BusinessCheck']").each(function (e) {
if($(this).attr("checked")){ if ($(this).attr("checked")) {
businessSelectedArr.push($(this).context.id.split("_")[1]); businessSelectedArr.push($(this).context.id.split("_")[1]);
} }
}); });
$.ajax({ $.ajax({
type : 'GET', type: 'GET',
async : true, async: true,
contentType : 'application/json', contentType: 'application/json',
url: "${ctx}/MonitorOperation/AssociateDiagosisConfiguration/getDimKpiListByBusinessIdList?businessIdList="+businessSelectedArr, url: "${ctx}/MonitorOperation/AssociateDiagosisConfiguration/getDimKpiListByBusinessIdList?businessIdList=" + businessSelectedArr,
dataType : 'text', dataType: 'text',
success: function(data){ success: function (data) {
var jsonDa=eval('('+data+')'); var jsonDa = eval('(' + data + ')');
for(var i=0;i<jsonDa.length;i++){ for (var i = 0; i < jsonDa.length; i++) {
var strInput="<input type='checkbox' id=dimKpiCheck_"+jsonDa[i].kpiId+" name='dimKpiCheck' class='provinceDetail' title='"+jsonDa[i].name+" value='"+jsonDa[i].kpiId+"'>"+jsonDa[i].name+"</input>"; var strInput = "<input type='checkbox' id=dimKpiCheck_" + jsonDa[i].kpiId + " name='dimKpiCheck' class='provinceDetail' title='" + jsonDa[i].name + " value='" + jsonDa[i].kpiId + "'>" + jsonDa[i].name + "</input>";
$("#dimKpiListTd").append(strInput); $("#dimKpiListTd").append(strInput);
} }
} }
...@@ -464,45 +534,44 @@ ...@@ -464,45 +534,44 @@
}); });
//渠道 复选框 点击 事件 //渠道 复选框 点击 事件
function channelRadioClick(){ function channelRadioClick() {
$("#businessActivedListTd").empty(); $("#businessActivedListTd").empty();
var channelId=$("input[name='channelRadio']:checked").val(); var channelId = $("input[name='channelRadio']:checked").val();
var dataSourceId=$("input[name='dataSourceRadio']:checked").val(); var dataSourceId = $("input[name='dataSourceRadio']:checked").val();
var channelArray=new Array();// 存放 所选 频道 var channelArray = new Array();// 存放 所选 频道
var i=0; var i = 0;
$("input[name='channelRadio']:checked").each(function(){ $("input[name='channelRadio']:checked").each(function () {
channelArray[i]=$(this).val(); channelArray[i] = $(this).val();
i++; i++;
}); });
var dataSourceArray=new Array();// 存放 所选数据源 var dataSourceArray = new Array();// 存放 所选数据源
var j=0; var j = 0;
$("input[name='dataSourceRadio']:checked").each(function(){ $("input[name='dataSourceRadio']:checked").each(function () {
dataSourceArray[j]=$(this).val(); dataSourceArray[j] = $(this).val();
j++; j++;
}); });
if(channelArray.length< 0|| dataSourceArray.length < 0){ if (channelArray.length < 0 || dataSourceArray.length < 0) {
return; return;
} }
$.ajax({ $.ajax({
type : 'GET', type: 'GET',
async : true, async: true,
contentType : 'application/json', contentType: 'application/json',
url: "${ctx}/MonitorOperation/AssociateDiagosisConfiguration/getBusinessByChannelIdListAndDataSourceIdList?dataSourceId="+dataSourceArray+"&channelId="+channelArray, url: "${ctx}/MonitorOperation/AssociateDiagosisConfiguration/getBusinessByChannelIdListAndDataSourceIdList?dataSourceId=" + dataSourceArray + "&channelId=" + channelArray,
dataType : 'text', dataType: 'text',
success: function(data){ success: function (data) {
var jsonDa=eval('('+data+')'); var jsonDa = eval('(' + data + ')');
// var jsonDa=data; // var jsonDa=data;
var strcheckBox=""; var strcheckBox = "";
for(var i=0;i<jsonDa.length;i++){ for (var i = 0; i < jsonDa.length; i++) {
var strInput="<input type='checkbox' onClick='BusinessCheckClick()' id=BusinessCheck_"+jsonDa[i].businessId+" name='BusinessCheck' class='provinceDetail' title='"+jsonDa[i].businessName+"' value='"+jsonDa[i].businessId+"'/>"+jsonDa[i].businessName; var strInput = "<input type='checkbox' onClick='BusinessCheckClick()' id=BusinessCheck_" + jsonDa[i].businessId + " name='BusinessCheck' class='provinceDetail' title='" + jsonDa[i].businessName + "' value='" + jsonDa[i].businessId + "'/>" + jsonDa[i].businessName;
strcheckBox+=strInput; strcheckBox += strInput;
} }
$("#businessActivedListTd").append(strcheckBox); $("#businessActivedListTd").append(strcheckBox);
...@@ -513,46 +582,45 @@ ...@@ -513,46 +582,45 @@
} }
//数据源 复选框 点击 事件 //数据源 复选框 点击 事件
function dataSourceRadioClick(){ function dataSourceRadioClick() {
$("#businessActivedListTd").empty(); $("#businessActivedListTd").empty();
var channelId=$("input[name='channelRadio']:checked").val(); var channelId = $("input[name='channelRadio']:checked").val();
var dataSourceId=$("input[name='dataSourceRadio']:checked").val(); var dataSourceId = $("input[name='dataSourceRadio']:checked").val();
var channelArray=new Array();// 存放 所选 频道 var channelArray = new Array();// 存放 所选 频道
var i=0; var i = 0;
$("input[name='channelRadio']:checked").each(function(){ $("input[name='channelRadio']:checked").each(function () {
channelArray[i]=$(this).val(); channelArray[i] = $(this).val();
i++; i++;
}); });
var dataSourceArray=new Array();// 存放 所选数据源 var dataSourceArray = new Array();// 存放 所选数据源
var j=0; var j = 0;
$("input[name='dataSourceRadio']:checked").each(function(){ $("input[name='dataSourceRadio']:checked").each(function () {
dataSourceArray[j]=$(this).val(); dataSourceArray[j] = $(this).val();
j++; j++;
}); });
if(channelArray.length< 0|| dataSourceArray.length < 0){ if (channelArray.length < 0 || dataSourceArray.length < 0) {
return; return;
} }
$.ajax({ $.ajax({
type : 'GET', type: 'GET',
async : true, async: true,
contentType : 'application/json', contentType: 'application/json',
url: "${ctx}/MonitorOperation/AssociateDiagosisConfiguration/getBusinessByChannelIdListAndDataSourceIdList?dataSourceId="+dataSourceArray+"&channelId="+channelArray, url: "${ctx}/MonitorOperation/AssociateDiagosisConfiguration/getBusinessByChannelIdListAndDataSourceIdList?dataSourceId=" + dataSourceArray + "&channelId=" + channelArray,
dataType : 'text', dataType: 'text',
success: function(data){ success: function (data) {
var jsonDa=eval('('+data+')'); var jsonDa = eval('(' + data + ')');
var strcheckBox=""; var strcheckBox = "";
for(var i=0;i<jsonDa.length;i++){ for (var i = 0; i < jsonDa.length; i++) {
var strInput="<input type='checkbox' onClick='BusinessCheckClick()' id=BusinessCheck_"+jsonDa[i].businessId+" name='BusinessCheck' class='provinceDetail' title='"+jsonDa[i].businessName+"' value='"+jsonDa[i].businessId+"'/>"+jsonDa[i].businessName; var strInput = "<input type='checkbox' onClick='BusinessCheckClick()' id=BusinessCheck_" + jsonDa[i].businessId + " name='BusinessCheck' class='provinceDetail' title='" + jsonDa[i].businessName + "' value='" + jsonDa[i].businessId + "'/>" + jsonDa[i].businessName;
strcheckBox+=strInput; strcheckBox += strInput;
} }
$("#businessActivedListTd").append(strcheckBox); $("#businessActivedListTd").append(strcheckBox);
...@@ -561,13 +629,14 @@ ...@@ -561,13 +629,14 @@
}); });
} }
// 业务 复选框 点击事件 // 业务 复选框 点击事件
function BusinessCheckClick() { function BusinessCheckClick() {
//$("#dimKpiListTd").empty(); //$("#dimKpiListTd").empty();
// 重置 指标 一栏 筛选保留原有的 和已选择的 指标 // 重置 指标 一栏 筛选保留原有的 和已选择的 指标
$("input[name='dimKpiCheck']").each(function(e){ $("input[name='dimKpiCheck']").each(function (e) {
if(!$(this).attr("checked")){ if (!$(this).attr("checked")) {
$(this).next().remove(); $(this).next().remove();
$(this).remove(); $(this).remove();
...@@ -576,27 +645,27 @@ ...@@ -576,27 +645,27 @@
//获取选择的 业务 //获取选择的 业务
var businessSelectedArr=[]; var businessSelectedArr = [];
$("input[name='BusinessCheck']").each(function(e){ $("input[name='BusinessCheck']").each(function (e) {
if($(this).attr("checked")){ if ($(this).attr("checked")) {
businessSelectedArr.push($(this).context.id.split("_")[1]); businessSelectedArr.push($(this).context.id.split("_")[1]);
} }
}); });
$.ajax({ $.ajax({
type : 'GET', type: 'GET',
async : true, async: true,
contentType : 'application/json', contentType: 'application/json',
url: "${ctx}/MonitorOperation/AssociateDiagosisConfiguration/getDimKpiListByBusinessIdList?businessIdList="+businessSelectedArr, url: "${ctx}/MonitorOperation/AssociateDiagosisConfiguration/getDimKpiListByBusinessIdList?businessIdList=" + businessSelectedArr,
dataType : 'text', dataType: 'text',
success: function(data){ success: function (data) {
var jsonDa=eval('('+data+')'); var jsonDa = eval('(' + data + ')');
for(var i=0;i<jsonDa.length;i++){ for (var i = 0; i < jsonDa.length; i++) {
if($.inArray(jsonDa[i].kpiId,dimKpiSelected) < 0){ if ($.inArray(jsonDa[i].kpiId, dimKpiSelected) < 0) {
var strInput="<input type='checkbox' id=dimKpiCheck_"+jsonDa[i].kpiId+" name='dimKpiCheck' class='provinceDetail' title='"+jsonDa[i].name+" "+jsonDa[i].code+"' value='"+jsonDa[i].kpiId+"'/><font>"+jsonDa[i].name+"</font>"; var strInput = "<input type='checkbox' id=dimKpiCheck_" + jsonDa[i].kpiId + " name='dimKpiCheck' class='provinceDetail' title='" + jsonDa[i].name + " " + jsonDa[i].code + "' value='" + jsonDa[i].kpiId + "'/><font>" + jsonDa[i].name + "</font>";
$("#dimKpiListTd").append(strInput); $("#dimKpiListTd").append(strInput);
} }
...@@ -606,44 +675,41 @@ ...@@ -606,44 +675,41 @@
} }
// 查找 业务 // 查找 业务
$("#selectBusiness").click(function(){ $("#selectBusiness").click(function () {
$("#businessActivedListTd").empty(); $("#businessActivedListTd").empty();
var channelId=$("input[name='channelRadio']:checked").val(); var channelId = $("input[name='channelRadio']:checked").val();
var dataSourceId=$("input[name='dataSourceRadio']:checked").val(); var dataSourceId = $("input[name='dataSourceRadio']:checked").val();
var channelArray=new Array();// 存放 所选 频道 var channelArray = new Array();// 存放 所选 频道
var i=0; var i = 0;
$("input[name='channelRadio']:checked").each(function(){ $("input[name='channelRadio']:checked").each(function () {
channelArray[i]=$(this).val(); channelArray[i] = $(this).val();
i++; i++;
}); });
var dataSourceArray=new Array();// 存放 所选数据源 var dataSourceArray = new Array();// 存放 所选数据源
var j=0; var j = 0;
$("input[name='dataSourceRadio']:checked").each(function(){ $("input[name='dataSourceRadio']:checked").each(function () {
dataSourceArray[j]=$(this).val(); dataSourceArray[j] = $(this).val();
j++; j++;
}); });
$.ajax({ $.ajax({
type : 'GET', type: 'GET',
async : true, async: true,
contentType : 'application/json', contentType: 'application/json',
url: "${ctx}/MonitorOperation/AssociateDiagosisConfiguration/getBusinessByChannelIdListAndDataSourceIdList?dataSourceId="+dataSourceArray+"&channelId="+channelArray, url: "${ctx}/MonitorOperation/AssociateDiagosisConfiguration/getBusinessByChannelIdListAndDataSourceIdList?dataSourceId=" + dataSourceArray + "&channelId=" + channelArray,
dataType : 'text', dataType: 'text',
success: function(data){ success: function (data) {
var jsonDa=eval('('+data+')'); var jsonDa = eval('(' + data + ')');
var strcheckBox=""; var strcheckBox = "";
for(var i=0;i<jsonDa.length;i++){ for (var i = 0; i < jsonDa.length; i++) {
var strInput="<input type='checkbox' id=BusinessCheck_"+jsonDa[i].businessId+" name='BusinessCheck' class='provinceDetail' title='"+jsonDa[i].businessName+" value='"+jsonDa[i].businessId+"'/>"+jsonDa[i].businessName; var strInput = "<input type='checkbox' id=BusinessCheck_" + jsonDa[i].businessId + " name='BusinessCheck' class='provinceDetail' title='" + jsonDa[i].businessName + " value='" + jsonDa[i].businessId + "'/>" + jsonDa[i].businessName;
strcheckBox+=strInput; strcheckBox += strInput;
} }
$("#businessActivedListTd").append(strcheckBox); $("#businessActivedListTd").append(strcheckBox);
...@@ -654,78 +720,78 @@ ...@@ -654,78 +720,78 @@
}); });
sumkpiWeightTdVal=0.00; sumkpiWeightTdVal = 0.00;
// 添加 '勾选指标指标'按钮 点击事件 // 添加 '勾选指标指标'按钮 点击事件
$("#addAnaInfo").click(function(){ $("#addAnaInfo").click(function () {
var arrDimKpiChecked=getArrDimKpiChecked(); var arrDimKpiChecked = getArrDimKpiChecked();
if(arrDimKpiChecked.length <1){ if (arrDimKpiChecked.length < 1) {
$.alert("需选指标"); $.alert("需选指标");
return; return;
} }
var kpiWeightTdVal=$.trim($("#kpiWeightTd").val()); var kpiWeightTdVal = $.trim($("#kpiWeightTd").val());
if (kpiWeightTdVal == "" || kpiWeightTdVal ==0){ if (kpiWeightTdVal == "" || kpiWeightTdVal == 0) {
$.alert("权重不能为空"); $.alert("权重不能为空");
return; return;
} }
if (kpiWeightTdVal < 0){ if (kpiWeightTdVal < 0) {
$.alert("权重不能为负"); $.alert("权重不能为负");
var mmm=(1-Number(sumkpiWeightTdVal)).toFixed(2); var mmm = (1 - Number(sumkpiWeightTdVal)).toFixed(2);
$("#kpiWeightTd").val(mmm); $("#kpiWeightTd").val(mmm);
return; return;
} }
if(kpiWeightTdVal >1.00){ if (kpiWeightTdVal > 1.00) {
$.alert("权重超值 1"); $.alert("权重超值 1");
var mmmm=(1-Number(sumkpiWeightTdVal)).toFixed(2); var mmmm = (1 - Number(sumkpiWeightTdVal)).toFixed(2);
$("#kpiWeightTd").val(mmmm); $("#kpiWeightTd").val(mmmm);
return ; return;
} }
var tt=0.00; var tt = 0.00;
for(var jj=0;jj<arrDimKpiChecked.length;jj++){ for (var jj = 0; jj < arrDimKpiChecked.length; jj++) {
tt+=Number(kpiWeightTdVal); tt += Number(kpiWeightTdVal);
} }
var k=sumkpiWeightTdVal+tt; var k = sumkpiWeightTdVal + tt;
//var k=sumkpiWeightTdVal+Number(kpiWeightTdVal); //var k=sumkpiWeightTdVal+Number(kpiWeightTdVal);
if(k > 1.00){ if (k > 1.00) {
$.alert("权重和 超值 1"); $.alert("权重和 超值 1");
var mm=(1-Number(sumkpiWeightTdVal)).toFixed(2); var mm = (1 - Number(sumkpiWeightTdVal)).toFixed(2);
$("#kpiWeightTd").val(mm); $("#kpiWeightTd").val(mm);
return; return;
} }
// 勾选指标 的 名称 和 value // 勾选指标 的 名称 和 value
var arrDimKpiidAndNameChecked=getArrDimKpiidAndNameChecked(); var arrDimKpiidAndNameChecked = getArrDimKpiidAndNameChecked();
//向 已添加指标 添加 //向 已添加指标 添加
for(var i=0;i<arrDimKpiidAndNameChecked.length;i++){ for (var i = 0; i < arrDimKpiidAndNameChecked.length; i++) {
var id_name=arrDimKpiidAndNameChecked[i]; var id_name = arrDimKpiidAndNameChecked[i];
var addRow = $("<tr class='"+id_name.split("_")[0]+"_"+kpiWeightTdVal+"'><td>"+id_name.split("_")[1]+"</td><td>"+kpiWeightTdVal+"</td><td><a href='javascript:;' title='"+id_name.split("_")[0]+"' onclick='deleteRow(this)'>删除</a>&nbsp;&nbsp;<a href='javascript:;' onclick='updateRow(this)'>修改</a></td></tr>"); var addRow = $("<tr class='" + id_name.split("_")[0] + "_" + kpiWeightTdVal + "'><td>" + id_name.split("_")[1] + "</td><td>" + kpiWeightTdVal + "</td><td><a href='javascript:;' title='" + id_name.split("_")[0] + "' onclick='deleteRow(this)'>删除</a>&nbsp;&nbsp;<a href='javascript:;' onclick='updateRow(this)'>修改</a></td></tr>");
$("#addTr").append(addRow); $("#addTr").append(addRow);
dimKpiSelected.push(Number(id_name.split("_")[0])); dimKpiSelected.push(Number(id_name.split("_")[0]));
} }
// 指标项中 去除 已添加指标 已有的指标 // 指标项中 去除 已添加指标 已有的指标
$("input[name='dimKpiCheck']").each(function(e){ $("input[name='dimKpiCheck']").each(function (e) {
var id=Number($(this).context.id.split("_")[1]); var id = Number($(this).context.id.split("_")[1]);
if($.inArray(id,dimKpiSelected) >= 0){ if ($.inArray(id, dimKpiSelected) >= 0) {
$(this).next().remove(); $(this).next().remove();
$(this).remove(); $(this).remove();
} }
}); });
//sumkpiWeightTdVal+=Number(kpiWeightTdVal); //sumkpiWeightTdVal+=Number(kpiWeightTdVal);
sumkpiWeightTdVal+=tt; sumkpiWeightTdVal += tt;
var maxV=(1-Number(sumkpiWeightTdVal)).toFixed(2); var maxV = (1 - Number(sumkpiWeightTdVal)).toFixed(2);
$("#kpiWeightTd").val(maxV); $("#kpiWeightTd").val(maxV);
//$("#kpiWeightTd").attr("max",maxV); //$("#kpiWeightTd").attr("max",maxV);
}); });
dimKpiSelected=new Array(); dimKpiSelected = new Array();
function getAnainfoShallSave(){ function getAnainfoShallSave() {
var anainfoShallSaveArr=new Array(); var anainfoShallSaveArr = new Array();
$("#addTr").find("tr").each(function(){ $("#addTr").find("tr").each(function () {
var claz=$(this).attr("class"); var claz = $(this).attr("class");
anainfoShallSaveArr.push(claz); anainfoShallSaveArr.push(claz);
}); });
return anainfoShallSaveArr; return anainfoShallSaveArr;
...@@ -741,21 +807,21 @@ ...@@ -741,21 +807,21 @@
}*/ }*/
// 获取勾选指标的 数据 格式 id_名称 // 获取勾选指标的 数据 格式 id_名称
function getArrDimKpiidAndNameChecked(){ function getArrDimKpiidAndNameChecked() {
var arrDimKpiChecked=[]; var arrDimKpiChecked = [];
$("input[name='dimKpiCheck']").each(function(e){ $("input[name='dimKpiCheck']").each(function (e) {
if($(this).attr("checked")){ if ($(this).attr("checked")) {
var id_name=$(this).context.id.split("_")[1]+"_"+$(this).context.title.split(" ")[0]; var id_name = $(this).context.id.split("_")[1] + "_" + $(this).context.title.split(" ")[0];
arrDimKpiChecked.push(id_name); arrDimKpiChecked.push(id_name);
} }
}); });
return arrDimKpiChecked; return arrDimKpiChecked;
} }
function getArrDimKpiChecked(){ function getArrDimKpiChecked() {
var arrDimKpiChecked=[]; var arrDimKpiChecked = [];
$("input[name='dimKpiCheck']").each(function(e){ $("input[name='dimKpiCheck']").each(function (e) {
if($(this).attr("checked")){ if ($(this).attr("checked")) {
arrDimKpiChecked.push($(this).context.id.split("_")[1]); arrDimKpiChecked.push($(this).context.id.split("_")[1]);
} }
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment