Commit 357f410a authored by 莫林毅's avatar 莫林毅

2017年11月24 智能分析平台提交内容

监控运营->告警关联诊断模块
parent e7202c9c
package com.hp.cmsz.entity;
import javax.persistence.*;
import java.io.Serializable;
import java.util.List;
/**
*CCOLAP.DIM_ASSOCIATION_ANALYSIS_INFO_T对应的实体类 一对多 CCOLAP.DIM_KPI_ASSOCIATION_RELATED_INFO_T
*
* @author Molinyi
*
*/
@Entity
@Table(name = "DIM_ASSOCIATION_ANALYSIS_INFO_T",schema = "CCOLAP")
public class DimAssociationAnaInfo implements Serializable {
@Id
@GeneratedValue(strategy= GenerationType.SEQUENCE, generator="DimAssociationAnaInfoSequence")
@SequenceGenerator(name = "DimAssociationAnaInfoSequence", sequenceName = "ASSOCIATION_SEQ", initialValue = 1,allocationSize=1)
private Long associationId;
@Column(name = "PROVINCE_ID")
private Long provinceId;//省份ID
@Column(name = "ASSOCIATION_TYPE")
private String AssociationType;//维度
@Column(name = "ASSOCIATION_DESC")
private String AssoicationDesc;//描述
@OneToMany(fetch = FetchType.EAGER,cascade = {CascadeType.ALL},mappedBy = "dimAssociationAnaInfo")
private transient List<DimKpiAssociationRelInfo> items;
public Long getAssociationId() {
return associationId;
}
public void setAssociationId(Long associationId) {
this.associationId = associationId;
}
public Long getProvinceId() {
return provinceId;
}
public void setProvinceId(Long provinceId) {
this.provinceId = provinceId;
}
public String getAssociationType() {
return AssociationType;
}
public void setAssociationType(String associationType) {
AssociationType = associationType;
}
public String getAssoicationDesc() {
return AssoicationDesc;
}
public void setAssoicationDesc(String assoicationDesc) {
AssoicationDesc = assoicationDesc;
}
public List<DimKpiAssociationRelInfo> getItems() {
return items;
}
public void setItems(List<DimKpiAssociationRelInfo> items) {
this.items = items;
}
@Override
public String toString() {
return "DimAssociationAnaInfo{" +
"associationId=" + associationId +
", provinceId=" + provinceId +
", AssociationType='" + AssociationType + '\'' +
", AssoicationDesc='" + AssoicationDesc + '\'' +
", items=" + items +
'}';
}
}
package com.hp.cmsz.entity;
import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
/**
*CCOLAP.DIM_KPI_ASSOCIATION_RELATED_INFO_T对应的实体类 多对一 CCOLAP.DIM_ASSOCIATION_ANALYSIS_INFO_T
*
* @author Molinyi
*
*/
@Entity
@Table(name = "DIM_KPI_ASSOCIATION_RELATED_INFO_T",schema = "CCOLAP")
public class DimKpiAssociationRelInfo implements Serializable {
@Id
@GeneratedValue(strategy= GenerationType.SEQUENCE, generator="DimKpiAssociationRelInfoSequence")//作用:为一个实体生成一个唯一标识的主键
@SequenceGenerator(name = "DimKpiAssociationRelInfoSequence", sequenceName = "KPI_ASSOCIATION_RELATED_SEQ",initialValue = 1,allocationSize=1)
private Long kpiAssociationRelatedId;//
@Column(name = "KPI_ID")
private Long kpiId;//指标名称
@Column(name = "KPI_WEIGHT")
private BigDecimal kpiWeight;//权重
@ManyToOne(cascade = {CascadeType.ALL},fetch = FetchType.EAGER,optional = false)// optional :代表外键字段是否可以为空。true可以为空,false不可以为空
@JoinColumn(name = "ASSOCIATION_ID")
private DimAssociationAnaInfo dimAssociationAnaInfo;
public Long getKpiAssociationRelatedId() {
return kpiAssociationRelatedId;
}
public void setKpiAssociationRelatedId(Long kpiAssociationRelatedId) {
this.kpiAssociationRelatedId = kpiAssociationRelatedId;
}
public Long getKpiId() {
return kpiId;
}
public void setKpiId(Long kpiId) {
this.kpiId = kpiId;
}
public DimAssociationAnaInfo getDimAssociationAnaInfo() {
return dimAssociationAnaInfo;
}
public void setDimAssociationAnaInfo(DimAssociationAnaInfo dimAssociationAnaInfo) {
this.dimAssociationAnaInfo = dimAssociationAnaInfo;
}
public BigDecimal getKpiWeight() {
return kpiWeight;
}
public void setKpiWeight(BigDecimal kpiWeight) {
this.kpiWeight = kpiWeight;
}
}
package com.hp.cmsz.repository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import com.hp.cmsz.entity.DimAssociationAnaInfo;
import java.util.List;
public interface DimAssociationAnaInfoDao extends JpaSpecificationExecutor<DimAssociationAnaInfo>,
PagingAndSortingRepository<DimAssociationAnaInfo, Long> {
/*@Query("from DimAssociationAnaInfo ")
public List<DimAssociationAnaInfo> findAllDimAssociationAnaInfo();
public List<DimAssociationAnaInfo> findAllDimAssociationAnaInfoByProvince(String province);
public List<DimAssociationAnaInfo> findAllDimAssociationAnaInfoByDemension(String demension);*/
}
package com.hp.cmsz.repository;
import com.hp.cmsz.entity.DimKpiAssociationRelInfo;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;
import java.util.List;
public interface DimKpiAssociationRelInfoDao extends JpaSpecificationExecutor<DimKpiAssociationRelInfo>,
PagingAndSortingRepository<DimKpiAssociationRelInfo, Long> {
@Query("from DimKpiAssociationRelInfo ")
List<DimKpiAssociationRelInfo> findAllDimKpiAssociationRelInfo();
@Query("select relInfo from DimKpiAssociationRelInfo relInfo where relInfo.dimAssociationAnaInfo.AssociationType in (:demension)")
public List<DimKpiAssociationRelInfo> findDimKpiAssociationRelInfoByDimension(@Param(value = "demension") String demension);
@Query("select relInfo from DimKpiAssociationRelInfo relInfo where relInfo.dimAssociationAnaInfo.AssociationType in (:dimension) and relInfo.dimAssociationAnaInfo.provinceId in (:detailProvince)")
public List<DimKpiAssociationRelInfo> findDimKpiAssociationRelInfoByDimensionAndProvince(@Param(value = "dimension") String dimension,@Param(value = "detailProvince") List<Long> detailProvince);
@Query("select relInfo from DimKpiAssociationRelInfo relInfo where relInfo.dimAssociationAnaInfo.provinceId in (:detailProvince)")
public List<DimKpiAssociationRelInfo> findDimKpiAssociationRelInfoByProvince(@Param(value = "detailProvince")List<Long> detailProvince);
}
package com.hp.cmsz.service.monitoroperation;
import com.hp.cmsz.entity.DimAssociationAnaInfo;
import com.hp.cmsz.entity.DimKpiAssociationRelInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import com.hp.cmsz.repository.DimKpiAssociationRelInfoDao;
import com.hp.cmsz.repository.DimAssociationAnaInfoDao;
import java.util.ArrayList;
import java.util.List;
@Component
@Transactional
public class AssociateDiagosisConfigurationService {
@Autowired
private DimKpiAssociationRelInfoDao dimKpiAssociationRelInfoDao;
@Autowired
private DimAssociationAnaInfoDao dimAssociationAnaInfoDao;
public void test(){
DimKpiAssociationRelInfo d=dimKpiAssociationRelInfoDao.findOne(1L);
System.out.println(d.getDimAssociationAnaInfo().getAssociationType());
DimAssociationAnaInfo info= dimAssociationAnaInfoDao.findOne(1l);
System.out.println(info.getItems().get(0).getKpiWeight());
System.out.println(info.getItems().get(1).getKpiWeight());
System.out.println(d.toString());
System.out.println(info.toString());
}
public List<DimKpiAssociationRelInfo> findAllDimKpiAssociationRelInfo(){
return dimKpiAssociationRelInfoDao.findAllDimKpiAssociationRelInfo();
}
public List<DimKpiAssociationRelInfo> findDimKpiAssociationRelInfoByDimension(String demension){
return dimKpiAssociationRelInfoDao.findDimKpiAssociationRelInfoByDimension(demension);
}
public List<DimKpiAssociationRelInfo> findDimKpiAssociationRelInfoByDimensionAndProvince(String dimension,List<Long> detailProvince){
return dimKpiAssociationRelInfoDao.findDimKpiAssociationRelInfoByDimensionAndProvince(dimension,detailProvince);
}
public List<DimKpiAssociationRelInfo> findDimKpiAssociationRelInfoByProvince(List<Long> detailProvince){
return dimKpiAssociationRelInfoDao.findDimKpiAssociationRelInfoByProvince(detailProvince);
}
}
......@@ -79,7 +79,18 @@ public class PageURLController {
//监控运营下的故障创建
//FailureCreate映射到WEB-INF/views下的MonitorOperation/FailureCreate.jsp页面
public static String FailureCreate="MonitorOperation/FailureCreate";
//监控运营>告警关联诊>关联诊断明细
//AssociateDiagosisDetail映射到WEB-INF/views下的MonitorOperation/AssociateDiagosisDetail.jsp页面
public static String AssociateDiagosisDetail="MonitorOperation/AssociateDiagosisDetail";
//监控运营>告警关联诊>关联诊断配置
//AssociateDiagosisConfiguration-INF/views下的MonitorOperation/AssociateDiagosisConfiguration.jsp页面
public static String AssociateDiagosisConfiguration="MonitorOperation/AssociateDiagosisConfiguration";
//监控运营>告警关联诊>关联诊断配置> 新建指标
public static String CreateDiagosis="MonitorOperation/CreateDiagosis";
//分析支撑下的集成商分析
//通过ProviderAnalysis映射到WEB-INF/views下的AnalysisSupport/ProviderFailureAnalysis.jsp页面
public static String ProviderFailureAnalysis="AnalysisSupport/ProviderFailureAnalysis";
......
package com.hp.cmsz.web.monitoroperation;
import com.google.gson.Gson;
import com.hp.cmsz.entity.DimKpiAssociationRelInfo;
import com.hp.cmsz.entity.Province;
import com.hp.cmsz.repository.DimKpiAssociationRelInfoDao;
import com.hp.cmsz.repository.ProvinceDao;
import com.hp.cmsz.service.monitoroperation.AssociateDiagosisConfigurationService;
import com.hp.cmsz.web.PageURLController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CopyOnWriteArrayList;
/**
* AssociateDiagosisConfigurationController 监控运营>告警关联诊>关联诊断配置
*
* @author Molinyi
*
*/
@Controller
@RequestMapping(value = "/MonitorOperation/AssociateDiagosisConfiguration")
public class AssociateDiagosisConfigurationController {
@Autowired
private ProvinceDao provinceDao;
@Autowired
private AssociateDiagosisConfigurationService associateDiagosisConfigurationService;
@Autowired
private DimKpiAssociationRelInfoDao dimKpiAssociationRelInfoDao;
@RequestMapping("")
public String list(Map model,
@RequestParam(defaultValue = "",value = "detailProvince")String detailProvince,
@RequestParam(defaultValue = "",value = "dimension")String dimension
){
System.out.printf("detailProvince "+detailProvince);
System.out.printf("dimension "+dimension);
List<DimKpiAssociationRelInfo>list=new ArrayList();
if(detailProvince.equalsIgnoreCase("")&&dimension.equalsIgnoreCase("")){//查找所有
list= associateDiagosisConfigurationService.findAllDimKpiAssociationRelInfo();
}
if(detailProvince.equalsIgnoreCase("")&&(!dimension.equalsIgnoreCase(""))){
list=associateDiagosisConfigurationService.findDimKpiAssociationRelInfoByDimension(dimension);
}
if((!detailProvince.equalsIgnoreCase(""))&&(!dimension.equalsIgnoreCase(""))){
String[]arrProvice=detailProvince.split(",");
List<Long>listProvice=new CopyOnWriteArrayList<Long>();
int length=arrProvice.length;
for(int i=0;i<length;i++){
listProvice.add(Long.parseLong(arrProvice[i]));
}
list=associateDiagosisConfigurationService.findDimKpiAssociationRelInfoByDimensionAndProvince(dimension,listProvice);
}
if((!detailProvince.equalsIgnoreCase(""))&&dimension.equalsIgnoreCase("")){
String[]arrProvice=detailProvince.split(",");
List<Long>listProvice=new CopyOnWriteArrayList<Long>();
int length=arrProvice.length;
for(int i=0;i<length;i++){
listProvice.add(Long.parseLong(arrProvice[i]));
}
list=associateDiagosisConfigurationService.findDimKpiAssociationRelInfoByProvince(listProvice);
}
Gson gson = new Gson();
Gson gsonP = new Gson();
List<Province> provinceList =(List<Province>) provinceDao.findProvince();
model.put("provinceList", provinceList);
model.put("gzfxDetailInfos",gson.toJson(list));
model.put("provinces",gsonP.toJson(provinceList));
model.put("indicatorsAll",gsonP.toJson(provinceList));//所有指标
System.out.println(")))"+gsonP.toJson(provinceList));
return PageURLController.AssociateDiagosisConfiguration;
}
}
package com.hp.cmsz.web.monitoroperation;
import com.google.gson.Gson;
import com.hp.cmsz.commons.utils.ExportExcelUtil;
import com.hp.cmsz.entity.*;
import com.hp.cmsz.repository.*;
import com.hp.cmsz.service.*;
import com.hp.cmsz.service.monitoroperation.*;
import com.hp.cmsz.web.PageURLController;
import org.apache.poi.hssf.usermodel.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.UnsupportedEncodingException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* AssociateDiagosisDetailControllerr 监控运营>告警关联诊>关联诊断明细
*
* @author Molinyi
*
*/
@Controller
@RequestMapping(value = "/MonitorOperation/AssociateDiagosisDetail")
public class AssociateDiagosisDetailController {
@Autowired
private ChannelService channelService;
@Autowired
private DataSourceService dataSourceService;
@Autowired
private BusinessService businessService;
@Autowired
private ProviderDao providerDao;
@Autowired
private ProviderService providerService;
@Autowired
private WarningSourceService warningSourcerService;
@Autowired
private ProvinceDao provinceDao;
@Autowired
private ProvinceService provinceService;
@Autowired
private GzfxDetailInfoService gzfxDetailInfoService;
@Autowired
private GzfxDetailInfoDao gzfxDetailInfoDao;
@Autowired
private GjfxWarningInfoDao gjfxWarningInfoDao;
@Autowired
private GjfxWarningInfoService gjfxWarningInfoService;
@Autowired
private FailureAdditionDao failureAdditionDao;
@Autowired
private XcdWorkingOrderInfoDao xcdWorkingOrderInfoDao;
@Autowired
private XcdWorkingOrderInfoService xcdWorkingOrderInfoService;
@Autowired
private XcdChangeOrderService xcdChangeOrderService;
@Autowired
private CmszOperationLogService cmszOperationLogService;
@Autowired
private FailureService failureService;
List<GzfxDetailInfo> uploadGzfxDetail = new ArrayList<GzfxDetailInfo>();
String staticFailureTitle ="";
String staticDetailTime ="";
String staticDetailProvince = "";
String staticDetailProvider = "";
String staticXcdStatus = "";
String staticDetailDataSource = "";
String staticDetailChannel = "";
String staticDetailBusiness = "";
String staticDetailWarningSource = "";
public String lists(Map model,
@RequestParam(value = "xcdStatus", defaultValue="") String xcdStatus,
@RequestParam(value = "detailProvince",defaultValue = "") String detailProvince
){
return "";
}
@RequestMapping("")
public String list(Map model, ServletRequest request, HttpSession session)
throws UnsupportedEncodingException, ParseException {
List<GzfxDetailInfo> gzfxDetailInfos = new ArrayList<GzfxDetailInfo>();
//创建searchParams对象用来完成过滤操作
String timeTag = request.getParameter("timeTag");
String warningSourceTag = request.getParameter("warningSourceTag");
String dataSourceTag = request.getParameter("dataSourceTag");
String channelTag = request.getParameter("channelTag");
String businessTag = request.getParameter("businessTag");
String provinceTag = request.getParameter("provinceTag");
String providerTag = request.getParameter("providerTag");
String failureId = request.getParameter("failureId");
String provinceId = request.getParameter("provinceId");
String providerId = request.getParameter("providerId");
String dateVal = request.getParameter("dateVal");
System.out.println("timeTag="+timeTag+
"\nwarningSourceTag="+warningSourceTag+
"\ndataSourceTag="+dataSourceTag+
"\nchannelTag="+channelTag+
"\nbusinessTag="+businessTag+
"\nprovinceTag="+provinceTag+
"\nproviderTag="+providerTag+
"\nfailureId="+failureId+
"\nprovinceId="+provinceId+
"\nproviderId="+providerId+
"\ndateVal="+dateVal);
//根据ID查找故障
if(failureId!=null){
gzfxDetailInfos = gzfxDetailInfoDao.findByFailureId(Long.parseLong(failureId));
//标签
model.put("failureId", failureId);
cmszOperationLogService.createLog("查询","故障明细","点击相应故障ID:"+failureId+"得到故障相关信息");
}else{
//根据多图钻取得到相应故障
if(businessTag!=null && timeTag!=null && dataSourceTag!=null && warningSourceTag!=null){
String filterWarningSource = "";
List<Long> dataSource = changeStringToList(dataSourceTag);
List<Long> channel = changeStringToList(channelTag);
List<Long> business = changeStringToList(businessTag);
List<Long> province = changeStringToList(provinceTag);
List<Long> provider = changeStringToList(providerTag);
List<Long> extFailureList = new ArrayList<Long>();
List<Long> extXcdFailureIdList = new ArrayList<Long>();
if(warningSourceTag.indexOf("extFailure")>=0){
if(filterWarningSource.equals("")){
filterWarningSource = "省公司告知";
}else{
filterWarningSource += " 省公司告知";
}
extFailureList = failureAdditionDao.findDistinctFailureIdByDataSourceIdInAndChannelIdIn(dataSource, channel);
warningSourceTag = warningSourceTag.replaceAll("extFailure", "");
}
if(warningSourceTag.indexOf("extXcd")>=0){
if(filterWarningSource.equals("")){
filterWarningSource = "其他";
}else{
filterWarningSource += " 其他";
}
extXcdFailureIdList = xcdWorkingOrderInfoDao.getRelevantFailureId(dataSource, channel);
extFailureList.addAll(extXcdFailureIdList);
warningSourceTag = warningSourceTag.replaceAll("extXcd", "");
}
List<Long> warningSource = changeStringToList(warningSourceTag);
if(timeTag.trim().equals("")){
if(!warningSource.isEmpty()){
List<Long> failureIdListByRelevantWarningSourceId = gjfxWarningInfoDao.getByWarningSourceAndDataSourceAndChannelAndBusiness(warningSource, dataSource, channel, business);
extFailureList.addAll(failureIdListByRelevantWarningSourceId);
}
if(extFailureList.isEmpty()){
gzfxDetailInfos = gzfxDetailInfoDao.findByFailureIdIsNull();
}else{
gzfxDetailInfos = gzfxDetailInfoService.getListMonthFailuresByFailureIdAndProvinceIdAndProviderId(extFailureList, province, provider);
}
//}
}else{
if(timeTag.split("~").length>1){
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String[] times = timeTag.split("~");
Date startTime = sdf.parse(times[0]);
Date endTime = sdf.parse(times[1]);
System.out.println("have time");
if(!warningSource.isEmpty()){
List<Long> failureIdListByRelevantWarningSourceId = gjfxWarningInfoDao.getByWarningSourceAndDataSourceAndChannelAndBusiness(warningSource, dataSource, channel, business);
extFailureList.addAll(failureIdListByRelevantWarningSourceId);
}
if(extFailureList.isEmpty()){
gzfxDetailInfos = gzfxDetailInfoDao.findByFailureIdIsNull();
}else{
gzfxDetailInfos = gzfxDetailInfoDao.findByHappenTimeBetweenAndFailureIdInAndProvinceIdInAndProviderIdInOrderByHappenTimeDesc(startTime, endTime, extFailureList, province, provider);
}
//}
}else{
if(!warningSource.isEmpty()){
List<Long> failureIdListByRelevantWarningSourceId = gjfxWarningInfoDao.getByWarningSourceAndDataSourceAndChannelAndBusiness(warningSource, dataSource, channel, business);
extFailureList.addAll(failureIdListByRelevantWarningSourceId);
}
if(extFailureList.isEmpty()){
gzfxDetailInfos = gzfxDetailInfoDao.findByFailureIdIsNull();
}else{
SimpleDateFormat timeFormat = new SimpleDateFormat("yyyy/MM/dd");
gzfxDetailInfos = gzfxDetailInfoDao.getByHappenTimeAndFailureIdAndProvinceIdAndProviderIdOrderByHappenTime(extFailureList, province, provider, timeFormat.parse(timeTag.trim()));
}
//}
//筛选后的报表时间转换
if(!gzfxDetailInfos.isEmpty()){
timeTag = gzfxDetailInfos.get(0).getHappenTime().toString();
}
}
}
//筛选项
String filterDataSource = dataSourceService.getDataSourceById(dataSource);
String filterChannel = channelService.getChannelNameByChannelId(channel);
String filterBusiness = businessService.getBusinessNameByBusinessId(business);
String filterProvince = provinceService.getProvinceNameByProvinceIds(province);
String filterProvider = providerService.getProviderById(provider);
if(!warningSource.isEmpty()){
if(filterWarningSource.equals("")){
filterWarningSource = warningSourcerService.getWarningSourceNameByWarningSourceId(warningSource);
}else{
filterWarningSource = filterWarningSource + " " + warningSourcerService.getWarningSourceNameByWarningSourceId(warningSource);
}
}
model.put("filterDataSource", filterDataSource);
model.put("filterChannel", filterChannel);
model.put("filterBusiness", filterBusiness);
model.put("filterProvince", filterProvince);
model.put("filterProvider", filterProvider);
model.put("filterWarningSource", filterWarningSource);
model.put("filterTimeTag", timeTag);
cmszOperationLogService.createLog("查询","故障明细","故障统计分析钻取到故障明细");
}else if(businessTag==null && (timeTag!=null && timeTag!="") && (channelTag!=null && channelTag!="") && provinceTag!=null && providerTag!=null && (dataSourceTag!=null && dataSourceTag!="") && warningSourceTag==null){
//从集成商钻取之后的页面钻取到相应的故障
List<Long> channelIds = changeStringToList(channelTag);
List<Long> dataSourceIds = changeStringToList(dataSourceTag);
List<Long> relevantFailureId = gjfxWarningInfoDao.getByDataSourceAndChannel(dataSourceIds,channelIds);
List<Long> extFialrueId = failureAdditionDao.findDistinctFailureIdByDataSourceIdInAndChannelIdIn(dataSourceIds, channelIds);
relevantFailureId.addAll(extFialrueId);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date startTime = sdf.parse(timeTag.split("~")[0]);
Date endTime = sdf.parse(timeTag.split("~")[1]);
List<Long> providerIds = changeStringToList(providerTag);
List<Long> provinceIdByName = new ArrayList<Long>();
provinceIdByName.add(provinceDao.findByProvinceName(provinceTag).get(0).getProvinceId());
gzfxDetailInfos = gzfxDetailInfoDao.findByHappenTimeBetweenAndFailureIdInAndProvinceIdInAndProviderIdInOrderByHappenTimeDesc(startTime, endTime, relevantFailureId, provinceIdByName, providerIds);
//筛选项
String filterDataSource = dataSourceService.getDataSourceById(dataSourceIds);
String filterChannel = channelService.getChannelNameByChannelId(channelIds);
String filterProvince = provinceTag;
String filterProvider = providerService.getProviderById(providerIds);
model.put("filterDataSource", filterDataSource);
model.put("filterChannel", filterChannel);
model.put("filterProvince", filterProvince);
model.put("filterProvider", filterProvider);
model.put("filterTimeTag", timeTag);
cmszOperationLogService.createLog("查询","故障明细","故障统计分析钻取到故障明细");
}else if(businessTag==null && (timeTag==null || timeTag=="") && (channelTag==null || channelTag=="") && provinceTag!=null && providerTag!=null && (dataSourceTag==null || dataSourceTag=="") && warningSourceTag==null){
//从集成商首页钻取之后的页面钻取到相应的故障
List<Long> provinceIdByName = new ArrayList<Long>();
provinceIdByName.add(provinceDao.findByProvinceName(provinceTag).get(0).getProvinceId());
gzfxDetailInfos = gzfxDetailInfoService.getListMonthFailuresByProvinceIdAndProviderId(provinceIdByName, Long.parseLong(providerTag));
//标签
String filterProvince = provinceTag;
List<Long> providerList = new ArrayList<Long>();
providerList.add(Long.parseLong(providerTag));
String filterProvider = providerService.getProviderById(providerList);
model.put("filterProvince", filterProvince);
model.put("filterProvider", filterProvider);
cmszOperationLogService.createLog("查询","故障明细","故障统计分析钻取到故障明细");
}else if(timeTag==null && dataSourceTag==null && providerId==null && dateVal==null && provinceId!=null){
//故障首页省份的钻取
gzfxDetailInfos = gzfxDetailInfoService.getLastMonthFailureByprovinceId(Long.parseLong(provinceId));
//标签
model.put("driProvinceId", provinceId);
cmszOperationLogService.createLog("查询","故障明细","故障统计分析钻取到故障明细");
}else if(timeTag==null && dataSourceTag==null && provinceId==null && dateVal==null && providerId!=null){
//故障首页集成商的钻取
gzfxDetailInfos = gzfxDetailInfoService.getLastMonthFailureByProviderId(Long.parseLong(providerId));
//标签
model.put("driProviderId", providerId);
cmszOperationLogService.createLog("查询","故障明细","故障统计分析钻取到故障明细");
}else if(timeTag==null && dataSourceTag==null && provinceId==null && providerId==null && dateVal!=null){
//故障首页时间的钻取
SimpleDateFormat timeFormat = new SimpleDateFormat("yyyy/MM/dd");
//gzfxDetailInfos = gzfxDetailInfoDao.getByHappenTime((int)(Long.parseLong(dateVal.trim())/1000));
gzfxDetailInfos = gzfxDetailInfoDao.getByHappenTime(timeFormat.parse(dateVal.trim()));
if(!gzfxDetailInfos.isEmpty()){
Date indexTime = gzfxDetailInfos.get(0).getHappenTime();
model.put("driDateVal", indexTime);
}
cmszOperationLogService.createLog("查询","故障明细","故障统计分析钻取到故障明细");
}else{
//故障明细默认页面
gzfxDetailInfos = gzfxDetailInfoService.getLastMonthFailures();
cmszOperationLogService.createLog("查询","故障明细","故障明细首页");
}
}
uploadGzfxDetail = gzfxDetailInfos;
Gson gson = new Gson();
model.put("gzfxDetailInfos", gson.toJson(gzfxDetailInfos));
//放入筛选项 || modify by August at 2014-05-16
List<Channel> channelList = channelService.getAllChannels();
List<DataSource> datasourceList = dataSourceService.getAllDataSources();
List<Provider> providerList = providerDao.findProvidersByProvinceVersionConfig();
List<WarningSource> warningSourceList = warningSourcerService.getAllWarningSource();
List<String> workingOrderStatusList = xcdWorkingOrderInfoDao.getXcdXcdStatus();
List<Province> provinceList =(List<Province>) provinceDao.findProvince();
List<String> businessList = businessService.getAllBusinessIdAndBusinessName();
model.put("channelList", channelList);
model.put("datasourceList", datasourceList);
model.put("providerList", providerList);
model.put("warningSourceList", warningSourceList);
model.put("workingOrderStatusList", workingOrderStatusList);
model.put("businessList", businessList);
model.put("provinceList", provinceList);
return PageURLController.AssociateDiagosisDetail;
}
//把关联诊断明细统计列表导出为Excel格式
@RequestMapping(value = "/upLoadGzfxDetailExcel", method = RequestMethod.POST)
public void getFailuresExcel(HttpServletRequest request, HttpServletResponse response, HttpSession session, ModelMap model) throws Exception{
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date =new Date();
String fileName = "关联诊断明细列表"+format.format(date);
try{
fileName = new String(fileName.getBytes("gb2312"), "ISO-8859-1");
}catch(UnsupportedEncodingException e1){
e1.printStackTrace();
}
//创建工作薄
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = wb.createSheet();
ExportExcelUtil exportExcel = new ExportExcelUtil(wb, sheet);
//创建列标头LIST
List<String> fialList = new ArrayList<String>();
fialList.add("故障ID");
fialList.add("故障标题");
fialList.add("省份");
fialList.add("渠道");
fialList.add("数据来源");
fialList.add("故障来源");
fialList.add("集成商");
fialList.add("开始时间");
fialList.add("结束时间");
fialList.add("详细原因");
fialList.add("解决方案");
//该报表的列数
int number = fialList.size();
//给工作表列定义列宽
for(int i = 0; i<number; i++){
sheet.setColumnWidth(i, 5500);
}
//创建单元格样式
HSSFCellStyle cellStyle = wb.createCellStyle();
//指定单元格居中对齐
cellStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);
//指定单元格垂直居中对齐
cellStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
//指定当单元格内容显示不下时自动换行
cellStyle.setWrapText(true);
//设置单元格字体
HSSFFont font = wb.createFont();
font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
font.setFontName("宋体");
font.setFontHeight((short) 220);
cellStyle.setFont(font);
//创建报表头部
exportExcel.createNormalHead("关联诊断明细列表", number - 1);
//创建第二行
HSSFRow row2 = sheet.createRow(1);
//设置行高
row2.setHeight((short) 500);
//单元格
HSSFCell row2Cell = null;
//创建不同的LIST的列标题
for(int i = 0; i< number; i++){
row2Cell = row2.createCell(i);
row2Cell.setCellStyle(cellStyle);
row2Cell.setCellValue(new HSSFRichTextString(fialList.get(i).toString()));
}
}
//将string数据类型转换成List<Long>类型
public List<Long> changeStringToList(String str){
List<Long> list = new ArrayList<Long>();
for(int i=0;i<str.split(",").length;i++){
if(!str.split(",")[i].equals("")){
list.add(Long.parseLong(str.split(",")[i]));
}
}
return list;
}
@RequestMapping("/createDiagosis")
public String createDiagosis(){
return PageURLController.CreateDiagosis;
}
}
<%@ page language="java" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page import="com.hp.cmsz.commons.utils.PropertiesUtil,com.hp.cmsz.commons.utils.OSinfo,com.hp.cmsz.commons.utils.EPlatform" %>
<%@ page
import="com.hp.cmsz.commons.utils.PropertiesUtil,com.hp.cmsz.commons.utils.OSinfo,com.hp.cmsz.commons.utils.EPlatform" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%@ page import="com.hp.cmsz.entity.UserInfo" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<div id="sticky-wrap">
<div id="header">
<div class="container">
<div class="row">
<div class="col-xs-10">
<div id="top-bar">
<img src="${ctx}/static/images/top_bar.png" alt="全网监控智能分析系统" title="全网监控智能分析系统"/>
<span style="font-size:14px;color:rgb(23,138,234);">专业的监控数据分析平台</span>
</div>
</div>
<div class="col-xs-2">
<div id="login">
<shiro:user>
<div style='margin-top:0px;margin-right:5%;'>
<div style="width:20%;height:40%;float:left"><img src="${ctx}/static/images/user.PNG" width="90%" height="5%" alt="" title=""/></div>
<div id="userdiv" style="margin-top:15px;">
<a href="#" >
<span id='userName' style="font-size:15px;"></span><span class='glyphicon glyphicon-chevron-down'></span>
</a>
</div>
<div id="showuser" style="position: absolute;display:none;">
<ul class="menu" style="margin-left:40px;">
<a href="javascript:;" onclick="modifyPassword()">修改密码</a><br>
<%-- <a href="${ctx}/logout">退出</a> --%>
<a href="#"><div id="logout">退出</div></a>
</ul>
</div>
</div>
</shiro:user>
</div>
</div>
<div id="sticky-wrap">
<div id="header">
<div class="container">
<div class="row">
<div class="col-xs-10">
<div id="top-bar">
<img src="${ctx}/static/images/top_bar.png" alt="全网监控智能分析系统" title="全网监控智能分析系统"/>
<span style="font-size:14px;color:rgb(23,138,234);">专业的监控数据分析平台</span>
</div>
</div>
<div class="col-xs-2">
<div id="login">
<shiro:user>
<div style='margin-top:0px;margin-right:5%;'>
<div style="width:20%;height:40%;float:left"><img src="${ctx}/static/images/user.PNG"
width="90%" height="5%" alt=""
title=""/></div>
<div id="userdiv" style="margin-top:15px;">
<a href="#">
<span id='userName' style="font-size:15px;"></span><span
class='glyphicon glyphicon-chevron-down'></span>
</a>
</div>
<div id="showuser" style="position: absolute;display:none;">
<ul class="menu" style="margin-left:40px;">
<a href="javascript:;" onclick="modifyPassword()">修改密码</a><br>
<%-- <a href="${ctx}/logout">退出</a> --%>
<a href="#">
<div id="logout">退出</div>
</a>
</ul>
</div>
</div>
</shiro:user>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="navbar navbar-static-top">
<div class="navbar-inner">
<div class="container">
<ul class="nav navbar-nav">
<shiro:user>
<li class="titleLine"></li>
<li class="dropdown">
<a class="dropdonw-toggle" role="button" href="${ctx}/index"><span class="menu-icon"><img alt="" src="${ctx}/static/images/1.png" /></span>首页</a>
</li>
</shiro:user>
<shiro:hasPermission name="社交媒体:数据查询 or 社交媒体:系统配置 ">
<li class="titleLine"></li>
<li class="dropdown">
<a class="dropdonw-toggle" data-toggle="dropdown" role="button" href="#"><span class="menu-icon"><img alt="" src="${ctx}/static/images/2.png" /></span>社交媒体</a>
<ul class="dropdown-menu" aria-labelledby="drop" role="menu">
<shiro:hasPermission name="社交媒体:数据查询 ">
<li class="dropdown-submenu">
<a href="#">数据查询</a>
<ul class="dropdown-menu">
<li><a href="${ctx}/CrawlDataManage/ViewData/home?selectTab=a_dataApp">APP数据查询</a></li>
<li><a href="${ctx}/CrawlDataManage/ViewData/home?selectTab=a_dataForum">论坛类数据查询</a></li>
<li><a href="${ctx}/CrawlDataManage/ViewData/home?selectTab=a_dataMall">电子商城类数据查询</a></li>
<li><a href="${ctx}/CrawlDataManage/ViewData/home?selectTab=a_dataSearch">搜索引擎类数据查询</a></li>
<li><a href="${ctx}/CrawlDataManage/ViewData/home?selectTab=a_dataMobile">电商手机类数据查询</a></li>
<li><a href="${ctx}/CrawlDataManage/ViewData/home?selectTab=a_dataTwitter">微博类数据查询</a></li>
<li><a href="${ctx}/CrawlDataManage/ViewData/home?selectTab=a_dataAlexa">网站排名类数据查询</a></li>
</ul>
</li>
</shiro:hasPermission>
<shiro:hasPermission name="社交媒体:系统配置 ">
<li class="dropdown-submenu">
<a href="#">系统配置</a>
<ul class="dropdown-menu">
<li><a href="${ctx}/CrawlDataManage/ViewData/config?selectTab=a_configKeyWord">关键字</a></li>
<li><a href="${ctx}/CrawlDataManage/ViewData/config?selectTab=a_configUrl">URL配置</a></li>
</ul>
</li>
</shiro:hasPermission>
</ul>
</li>
</shiro:hasPermission>
<shiro:hasPermission name="预分析与建模:数据预分析 or 预分析与建模:数据模型管理 or 预分析与建模:数据模型验证 or 预分析与建模:数据沙盒 ">
<li class="titleLine"></li>
<li class="dropdown">
<a class="dropdonw-toggle" data-toggle="dropdown" role="button" href="#"><span class="menu-icon"><img alt="" src="${ctx}/static/images/2.png" /></span>预分析与建模</a>
<ul class="dropdown-menu" aria-labelledby="drop" role="menu">
<shiro:hasPermission name="预分析与建模:数据预分析">
<li class="dropdown-submenu">
<a href="#">数据预分析</a>
<ul class="dropdown-menu">
<li><a href="${ctx}/MonitorOperation/RegularityAnalysis">数据特征探查</a></li>
<li><a href="${ctx}/MonitorOperation/KeyLinkProcessAnalysis">业务环节分析</a></li>
</ul>
</li>
</shiro:hasPermission>
<shiro:hasPermission name="预分析与建模:数据模型管理">
<li class="dropdown-submenu">
<a href="#">数据模型管理</a>
<ul class="dropdown-menu">
<li><a href="${ctx}/ModelManage/ModelResult">模型维护</a></li>
<li><a href="${ctx}/BaseManage/TaskManage/modelMonitorHome">模型监控</a></li>
</ul>
</li>
</shiro:hasPermission>
<shiro:hasPermission name="预分析与建模:数据模型验证">
<li class="dropdown-submenu">
<a href="#">数据模型验证</a>
<ul class="dropdown-menu">
<li><a href="${ctx}/MonitorOperation/FailureForcast">预警结果验证</a></li>
</ul>
</li>
</shiro:hasPermission>
<shiro:hasPermission name="预分析与建模:数据沙盒">
<li class="dropdown-submenu">
<a href="#">数据沙盒</a>
<ul class="dropdown-menu">
<li><a href="${ctx}/BaseManage/TaskManage/sandboxHome?selectTab=a_taskDetail">沙盒数据配置</a></li>
<li><a href="${ctx}/BaseManage/TaskManage/sandboxHome?selectTab=a_taskManage">沙盒任务配置</a></li>
</ul>
</li>
</shiro:hasPermission>
</ul>
</li>
</shiro:hasPermission>
<shiro:hasPermission name="监控运营:告警监控 or 监控运营:协查单分析 or 监控运营:故障管理 or 监控运营:协查单管理 ">
<li class="titleLine"></li>
<li class="dropdown">
<a class="dropdonw-toggle" data-toggle="dropdown" role="button" href="#"><span class="menu-icon"><img alt="" src="${ctx}/static/images/3.png" /></span>监控运营</a>
<ul class="dropdown-menu" aria-labelledby="drop" role="menu">
<shiro:hasPermission name="监控运营:告警监控">
<li class="dropdown-submenu">
<a href="#">告警监控</a>
<ul class="dropdown-menu">
<li><a href="${ctx}/MonitorOperation/WorkingOrderManage">预警和隐患维护</a></li>
<li><a href="${ctx}/MonitorOperation/WarnAnalysis">告警统计</a></li>
<li><a href="${ctx}/MonitorOperation/WarnAnalysisDetail">告警明细</a></li>
<%--create by hubin 2017-10-26 --%>
<li><a href="${ctx}/MonitorOperation/InsideXcd">内部协查单管理</a></li>
<div class="navbar navbar-static-top">
<div class="navbar-inner">
<div class="container">
<ul class="nav navbar-nav">
</ul>
</li>
</shiro:hasPermission>
<shiro:hasPermission name="监控运营:协查单管理">
<li class="dropdown-submenu">
<a href="#">协查单管理</a>
<ul class="dropdown-menu">
<li><a href="${ctx}/MonitorOperation/WorkingOrderAnalysis">协查单统计</a></li>
<li><a href="${ctx}/MonitorOperation/WorkingOrderReasult">协查单明细</a></li>
</ul>
</li>
</shiro:hasPermission>
<shiro:hasPermission name="监控运营:故障管理">
<li class="dropdown-submenu">
<a href="#">故障管理</a>
<ul class="dropdown-menu">
<li><a href="${ctx}/MonitorOperation/FailureAnalysis">故障统计</a></li>
<li><a href="${ctx}/MonitorOperation/FailureAnalysisDetail">故障明细</a></li>
<li><a href="${ctx}/MonitorOperation/FailureAnalysisXcd">故障维护</a></li>
</ul>
</li>
</shiro:hasPermission>
</ul>
</li>
</shiro:hasPermission>
<shiro:hasPermission name="运营支撑:配置项分析 or 运营支撑:集成商分析 or 运营支撑:竞品分析 or 运营支撑:业务热点分析 or 运营支撑:投诉文本分析 or 运营支撑:数据质量核查 ">
<li class="titleLine"></li>
<li class="dropdown">
<a class="dropdonw-toggle" data-toggle="dropdown" role="button" href="#"><span class="menu-icon"><img alt="" src="${ctx}/static/images/4.png" /></span>运营支撑</a>
<ul class="dropdown-menu" aria-labelledby="drop" role="menu">
<shiro:hasPermission name="运营支撑:配置项分析">
<li class="dropdown-submenu">
<a href="#">配置项分析</a>
<ul class="dropdown-menu">
<li><a href="${ctx}/AnalysisSupport/PzxAnalysis">总领</a></li>
<li><a href="${ctx}/AnalysisSupport/PzxNumCount">配置数量统计</a></li>
<li><a href="${ctx}/AnalysisSupport/PzxDetail">配置明细分析</a></li>
<li><a href="${ctx}/AnalysisSupport/PzxAttribute" >配置属性统计</a></li>
<li><a href="${ctx}/AnalysisSupport/PzxAttributeDetail">属性明细分析</a></li>
<li><a href="${ctx}/AnalysisSupport/PzxAnalysisLifeCycle">生命周期统计</a></li>
</ul>
</li>
</shiro:hasPermission>
<shiro:hasPermission name="运营支撑:业务热点分析">
<li class="dropdown-submenu">
<a href="#">业务热点分析</a>
<ul class="dropdown-menu">
<li><a href="${ctx}/AnalysisSupport/ServiceFeature">地市热点分析</a></li>
<li><a href="${ctx}/AnalysisSupport/ChannelAnalysis">渠道热点分析</a></li>
</ul>
</li>
</shiro:hasPermission>
<shiro:hasPermission name="运营支撑:集成商分析">
<li class="dropdown-submenu">
<a href="#">集成商分析</a>
<ul class="dropdown-menu">
<li><a href="${ctx}/AnalysisSupport/ProviderAnalysis">隐患按集成商分析</a></li>
<li><a href="${ctx}/AnalysisSupport/ProviderEWarningAnalysis">预警按集成商分析</a></li>
<li><a href="${ctx}/AnalysisSupport/ProviderFailureAnalysis">故障按集成商分析</a></li>
</ul>
</li>
</shiro:hasPermission>
<shiro:hasPermission name="运营支撑:竞品分析">
<li><a href="${ctx}/AnalysisSupport/JpfxAnalysis">竞品分析</a></li>
</shiro:hasPermission>
<shiro:hasPermission name="运营支撑:投诉文本分析">
<li class="dropdown-submenu">
<a href="#">投诉文本分析</a>
<ul class="dropdown-menu">
<li><a href="${ctx}/AnalysisSupport/TSWBAnalysisHomeView/home?selectTab=focus">焦点投诉</a></li>
<li><a href="${ctx}/AnalysisSupport/TSWBAnalysisHomeView/home?selectTab=yz_detail">业支-明细数据</a> </li>
<li ><a href="${ctx}/AnalysisSupport/TSWBAnalysisHomeView/home?selectTab=yz_focus" >业支-焦点投诉</a> </li>
<li ><a href="${ctx}/AnalysisSupport/TSWBAnalysisHomeView/home?selectTab=yz_liability" >业支-责任原因</a> </li>
<li ><a href="${ctx}/AnalysisSupport/TSWBAnalysisHomeView/home?selectTab=yz_template" >业支-下发模板</a> </li>
<shiro:user>
<li class="titleLine"></li>
<li class="dropdown">
<a class="dropdonw-toggle" role="button" href="${ctx}/index"><span class="menu-icon"><img
alt="" src="${ctx}/static/images/1.png"/></span>首页</a>
</li>
</shiro:user>
<shiro:hasPermission name="社交媒体:数据查询 or 社交媒体:系统配置 ">
<li class="titleLine"></li>
<li class="dropdown">
<a class="dropdonw-toggle" data-toggle="dropdown" role="button" href="#"><span
class="menu-icon"><img alt="" src="${ctx}/static/images/2.png"/></span>社交媒体</a>
<ul class="dropdown-menu" aria-labelledby="drop" role="menu">
<shiro:hasPermission name="社交媒体:数据查询 ">
<li class="dropdown-submenu">
<a href="#">数据查询</a>
<ul class="dropdown-menu">
<li><a href="${ctx}/CrawlDataManage/ViewData/home?selectTab=a_dataApp">APP数据查询</a>
</li>
<li><a href="${ctx}/CrawlDataManage/ViewData/home?selectTab=a_dataForum">论坛类数据查询</a>
</li>
<li><a href="${ctx}/CrawlDataManage/ViewData/home?selectTab=a_dataMall">电子商城类数据查询</a>
</li>
<li><a href="${ctx}/CrawlDataManage/ViewData/home?selectTab=a_dataSearch">搜索引擎类数据查询</a>
</li>
<li><a href="${ctx}/CrawlDataManage/ViewData/home?selectTab=a_dataMobile">电商手机类数据查询</a>
</li>
<li><a href="${ctx}/CrawlDataManage/ViewData/home?selectTab=a_dataTwitter">微博类数据查询</a>
</li>
<li><a href="${ctx}/CrawlDataManage/ViewData/home?selectTab=a_dataAlexa">网站排名类数据查询</a>
</li>
</ul>
</li>
</shiro:hasPermission>
<shiro:hasPermission name="社交媒体:系统配置 ">
<li class="dropdown-submenu">
<a href="#">系统配置</a>
<ul class="dropdown-menu">
<li>
<a href="${ctx}/CrawlDataManage/ViewData/config?selectTab=a_configKeyWord">关键字</a>
</li>
<li><a href="${ctx}/CrawlDataManage/ViewData/config?selectTab=a_configUrl">URL配置</a>
</li>
</ul>
</li>
</shiro:hasPermission>
</ul>
</li>
</shiro:hasPermission>
<shiro:hasPermission name="运营支撑:数据质量核查">
<li class="dropdown-submenu">
<a href="#">数据质量核查</a>
<ul class="dropdown-menu">
<li><a href="${ctx}/AnalysisSupport/QualityRuleResult">质量规则维护</a></li>
<li><a href="${ctx}/AnalysisSupport/FilterRuleResult">过滤规则维护</a></li>
<li><a href="${ctx}/AnalysisSupport/">质量规则运营</a></li>
</ul>
</li>
</shiro:hasPermission>
</ul>
</li>
</shiro:hasPermission>
<shiro:hasPermission name="即席查询:明细查询 or 即席查询:知识管理">
<li class="titleLine"></li>
<li class="dropdown">
<a class="dropdonw-toggle" data-toggle="dropdown" role="button" href="#"><span class="menu-icon"><img alt="" src="${ctx}/static/images/5.png" /></span>即席查询</a>
<ul class="dropdown-menu" aria-labelledby="drop" role="menu">
<shiro:hasPermission name="即席查询:明细查询">
<%--Commented by huach on 20140731 begin <%
EPlatform osn = OSinfo.getOSname();
if (osn.toString().startsWith("Windows")) {%>
<li><a href="http://localhost:8080/pentaho/adhoc/waqr.html">明细查询</a></li>
<%} else {%>
<li><a href='<%= "http://" + PropertiesUtil.readValue("/home/pentaho/conf" + System.getProperty("file.separator") + "application.properties", "linux_server_ip") + ":8080/pentaho/adhoc/waqr.html?&userid=joe&password=password" %>' target="_blank">明细查询</a></li>
<%}
%> Commented by huach on 20140731 end --%>
<li><a href='<%= request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+"/pentaho/adhoc/waqr.html?&userid=joe&password=password" %>' target="_blank">明细查询</a></li>
</shiro:hasPermission>
<shiro:hasPermission name="即席查询:知识管理">
<li><a href="${ctx}/DataManage/KnowledgeShare">知识管理</a></li>
</shiro:hasPermission>
</ul>
</li>
</shiro:hasPermission>
<shiro:hasPermission name="基础管理:配置管理 or 基础管理:系统自监控 or 基础管理:系统数据备份和恢复 or 基础管理:元数据管理 or 基础管理:告警规则管理 or 基础管理:任务管理 ">
<li class="titleLine"></li>
<li class="dropdown">
<a class="dropdonw-toggle" data-toggle="dropdown" role="button" href="#"><span class="menu-icon"><img alt="" src="${ctx}/static/images/6.png" /></span>基础管理</a>
<ul class="dropdown-menu" aria-labelledby="drop" role="menu">
<shiro:hasPermission name="基础管理:告警规则管理">
<li class="dropdown-submenu">
<a href="#">告警规则管理</a>
<ul class="dropdown-menu">
<li><a href="${ctx}/BaseManage/ParameterManage/ruleHome?selectTab=a_eWarningDropRule">预警消除规则维护</a></li>
<li><a href="${ctx}/BaseManage/ParameterManage/ruleHome?selectTab=a_eWarningRule">预警生成规则维护</a></li>
<li><a href="${ctx}/BaseManage/ParameterManage/ruleHome?selectTab=a_hWarningRule">隐患生成规则维护</a></li>
</ul>
</li>
</shiro:hasPermission>
<shiro:hasPermission name="基础管理:系统数据备份和恢复">
<li class="dropdown-submenu">
<a href="#">系统数据备份和恢复</a>
<ul class="dropdown-menu">
<li><a href="${ctx}/BaseManage/DataBackup/dataBackupHome?selectTab=a_dataBackup">系统数据备份</a></li>
<li><a href="${ctx}/BaseManage/DataBackup/dataBackupHome?selectTab=a_taskDetail">系统数据恢复</a></li>
</ul>
</li>
<shiro:hasPermission name="预分析与建模:数据预分析 or 预分析与建模:数据模型管理 or 预分析与建模:数据模型验证 or 预分析与建模:数据沙盒 ">
<li class="titleLine"></li>
<li class="dropdown">
<a class="dropdonw-toggle" data-toggle="dropdown" role="button" href="#"><span
class="menu-icon"><img alt="" src="${ctx}/static/images/2.png"/></span>预分析与建模</a>
<ul class="dropdown-menu" aria-labelledby="drop" role="menu">
<shiro:hasPermission name="预分析与建模:数据预分析">
<li class="dropdown-submenu">
<a href="#">数据预分析</a>
<ul class="dropdown-menu">
<li><a href="${ctx}/MonitorOperation/RegularityAnalysis">数据特征探查</a></li>
<li><a href="${ctx}/MonitorOperation/KeyLinkProcessAnalysis">业务环节分析</a></li>
</ul>
</li>
</shiro:hasPermission>
<shiro:hasPermission name="预分析与建模:数据模型管理">
<li class="dropdown-submenu">
<a href="#">数据模型管理</a>
<ul class="dropdown-menu">
<li><a href="${ctx}/ModelManage/ModelResult">模型维护</a></li>
<li><a href="${ctx}/BaseManage/TaskManage/modelMonitorHome">模型监控</a></li>
</ul>
</li>
</shiro:hasPermission>
<shiro:hasPermission name="预分析与建模:数据模型验证">
<li class="dropdown-submenu">
<a href="#">数据模型验证</a>
<ul class="dropdown-menu">
<li><a href="${ctx}/MonitorOperation/FailureForcast">预警结果验证</a></li>
</ul>
</li>
</shiro:hasPermission>
<shiro:hasPermission name="预分析与建模:数据沙盒">
<li class="dropdown-submenu">
<a href="#">数据沙盒</a>
<ul class="dropdown-menu">
<li>
<a href="${ctx}/BaseManage/TaskManage/sandboxHome?selectTab=a_taskDetail">沙盒数据配置</a>
</li>
<li>
<a href="${ctx}/BaseManage/TaskManage/sandboxHome?selectTab=a_taskManage">沙盒任务配置</a>
</li>
</ul>
</li>
</shiro:hasPermission>
</ul>
</li>
</shiro:hasPermission>
<shiro:hasPermission name="基础管理:任务管理">
<li class="dropdown-submenu">
<a href="#">任务管理</a>
<ul class="dropdown-menu">
<li><a href="${ctx}/BaseManage/TaskManage/taskHome?selectTab=a_taskManage">自定义任务维护</a></li>
<li><a href="${ctx}/BaseManage/TaskManage/taskHome?selectTab=a_taskLog">任务运行日志查询</a></li>
</ul>
</li>
<shiro:hasPermission name="监控运营:告警监控 or 监控运营:协查单分析 or 监控运营:故障管理 or 监控运营:协查单管理 or 监控运营:告警关联诊断">
<li class="titleLine"></li>
<li class="dropdown">
<a class="dropdonw-toggle" data-toggle="dropdown" role="button" href="#"><span
class="menu-icon"><img alt="" src="${ctx}/static/images/3.png"/></span>监控运营</a>
<ul class="dropdown-menu" aria-labelledby="drop" role="menu">
<shiro:hasPermission name="监控运营:告警监控">
<li class="dropdown-submenu">
<a href="#">告警监控</a>
<ul class="dropdown-menu">
<li><a href="${ctx}/MonitorOperation/WorkingOrderManage">预警和隐患维护</a></li>
<li><a href="${ctx}/MonitorOperation/WarnAnalysis">告警统计</a></li>
<li><a href="${ctx}/MonitorOperation/WarnAnalysisDetail">告警明细</a></li>
<%--create by hubin 2017-10-26 --%>
<li><a href="${ctx}/MonitorOperation/InsideXcd">内部协查单管理</a></li>
</ul>
</li>
</shiro:hasPermission>
<shiro:hasPermission name="监控运营:协查单管理">
<li class="dropdown-submenu">
<a href="#">协查单管理</a>
<ul class="dropdown-menu">
<li><a href="${ctx}/MonitorOperation/WorkingOrderAnalysis">协查单统计</a></li>
<li><a href="${ctx}/MonitorOperation/WorkingOrderReasult">协查单明细</a></li>
</ul>
</li>
</shiro:hasPermission>
<shiro:hasPermission name="监控运营:故障管理">
<li class="dropdown-submenu">
<a href="#">故障管理</a>
<ul class="dropdown-menu">
<li><a href="${ctx}/MonitorOperation/FailureAnalysis">故障统计</a></li>
<li><a href="${ctx}/MonitorOperation/FailureAnalysisDetail">故障明细</a></li>
<li><a href="${ctx}/MonitorOperation/FailureAnalysisXcd">故障维护</a></li>
</ul>
</li>
</shiro:hasPermission>
<shiro:hasPermission name="监控运营:告警关联诊断">
<li class="dropdown-submenu">
<a href="#">告警关联诊断</a>
<ul class="dropdown-menu">
<li><a href="${ctx}/MonitorOperation/AssociateDiagosisConfiguration">关联诊断配置</a></li>
<li><a href="${ctx}/MonitorOperation/AssociateDiagosisDetail">关联诊断明细</a></li>
</ul>
</li>
</shiro:hasPermission>
</ul>
</li>
</shiro:hasPermission>
<shiro:hasPermission name="基础管理:配置管理">
<li class="dropdown-submenu">
<a href="#">配置管理</a>
<ul class="dropdown-menu">
<li><a href="${ctx}/BaseManage/SystemParameter/home?selectTab=a_dataBackup">前台系统参数维护</a></li>
<li><a href="${ctx}/BaseManage/SystemParameter/home?selectTab=a_analysysType">数据分析参数维护</a></li>
<li><a href="${ctx}/BaseManage/SystemParameter/home?selectTab=a_taskGroup">任务组维护</a></li>
<li><a href="${ctx}/BaseManage/SystemParameter/home?selectTab=a_deployedServer">部署服务器维护</a></li>
<li><a href="${ctx}/BaseManage/SystemParameter/home?selectTab=a_dataModelType">隐患预警类型维护</a></li>
<li><a href="${ctx}/BaseManage/SystemParameter/home?selectTab=a_baseData">后台系统参数维护</a></li>
</ul>
</li>
<shiro:hasPermission
name="运营支撑:配置项分析 or 运营支撑:集成商分析 or 运营支撑:竞品分析 or 运营支撑:业务热点分析 or 运营支撑:投诉文本分析 or 运营支撑:数据质量核查 ">
<li class="titleLine"></li>
<li class="dropdown">
<a class="dropdonw-toggle" data-toggle="dropdown" role="button" href="#"><span
class="menu-icon"><img alt="" src="${ctx}/static/images/4.png"/></span>运营支撑</a>
<ul class="dropdown-menu" aria-labelledby="drop" role="menu">
<shiro:hasPermission name="运营支撑:配置项分析">
<li class="dropdown-submenu">
<a href="#">配置项分析</a>
<ul class="dropdown-menu">
<li><a href="${ctx}/AnalysisSupport/PzxAnalysis">总领</a></li>
<li><a href="${ctx}/AnalysisSupport/PzxNumCount">配置数量统计</a></li>
<li><a href="${ctx}/AnalysisSupport/PzxDetail">配置明细分析</a></li>
<li><a href="${ctx}/AnalysisSupport/PzxAttribute">配置属性统计</a></li>
<li><a href="${ctx}/AnalysisSupport/PzxAttributeDetail">属性明细分析</a></li>
<li><a href="${ctx}/AnalysisSupport/PzxAnalysisLifeCycle">生命周期统计</a></li>
</ul>
</li>
</shiro:hasPermission>
<shiro:hasPermission name="运营支撑:业务热点分析">
<li class="dropdown-submenu">
<a href="#">业务热点分析</a>
<ul class="dropdown-menu">
<li><a href="${ctx}/AnalysisSupport/ServiceFeature">地市热点分析</a></li>
<li><a href="${ctx}/AnalysisSupport/ChannelAnalysis">渠道热点分析</a></li>
</ul>
</li>
</shiro:hasPermission>
<shiro:hasPermission name="运营支撑:集成商分析">
<li class="dropdown-submenu">
<a href="#">集成商分析</a>
<ul class="dropdown-menu">
<li><a href="${ctx}/AnalysisSupport/ProviderAnalysis">隐患按集成商分析</a></li>
<li><a href="${ctx}/AnalysisSupport/ProviderEWarningAnalysis">预警按集成商分析</a>
</li>
<li><a href="${ctx}/AnalysisSupport/ProviderFailureAnalysis">故障按集成商分析</a>
</li>
</ul>
</li>
</shiro:hasPermission>
<shiro:hasPermission name="运营支撑:竞品分析">
<li><a href="${ctx}/AnalysisSupport/JpfxAnalysis">竞品分析</a></li>
</shiro:hasPermission>
<shiro:hasPermission name="运营支撑:投诉文本分析">
<li class="dropdown-submenu">
<a href="#">投诉文本分析</a>
<ul class="dropdown-menu">
<li>
<a href="${ctx}/AnalysisSupport/TSWBAnalysisHomeView/home?selectTab=focus">焦点投诉</a>
</li>
<li>
<a href="${ctx}/AnalysisSupport/TSWBAnalysisHomeView/home?selectTab=yz_detail">业支-明细数据</a>
</li>
<li>
<a href="${ctx}/AnalysisSupport/TSWBAnalysisHomeView/home?selectTab=yz_focus">业支-焦点投诉</a>
</li>
<li>
<a href="${ctx}/AnalysisSupport/TSWBAnalysisHomeView/home?selectTab=yz_liability">业支-责任原因</a>
</li>
<li>
<a href="${ctx}/AnalysisSupport/TSWBAnalysisHomeView/home?selectTab=yz_template">业支-下发模板</a>
</li>
</ul>
</li>
</shiro:hasPermission>
<shiro:hasPermission name="运营支撑:数据质量核查">
<li class="dropdown-submenu">
<a href="#">数据质量核查</a>
<ul class="dropdown-menu">
<li><a href="${ctx}/AnalysisSupport/QualityRuleResult">质量规则维护</a></li>
<li><a href="${ctx}/AnalysisSupport/FilterRuleResult">过滤规则维护</a></li>
<li><a href="${ctx}/AnalysisSupport/">质量规则运营</a></li>
</ul>
</li>
</shiro:hasPermission>
</ul>
</li>
</shiro:hasPermission>
<shiro:hasPermission name="基础管理:系统自监控">
<li><a href="${ctx}/BaseManage/SelfMonitor/monitorHome">系统自监控</a></li>
<shiro:hasPermission name="即席查询:明细查询 or 即席查询:知识管理">
<li class="titleLine"></li>
<li class="dropdown">
<a class="dropdonw-toggle" data-toggle="dropdown" role="button" href="#"><span
class="menu-icon"><img alt="" src="${ctx}/static/images/5.png"/></span>即席查询</a>
<ul class="dropdown-menu" aria-labelledby="drop" role="menu">
<shiro:hasPermission name="即席查询:明细查询">
<%--Commented by huach on 20140731 begin <%
EPlatform osn = OSinfo.getOSname();
if (osn.toString().startsWith("Windows")) {%>
<li><a href="http://localhost:8080/pentaho/adhoc/waqr.html">明细查询</a></li>
<%} else {%>
<li><a href='<%= "http://" + PropertiesUtil.readValue("/home/pentaho/conf" + System.getProperty("file.separator") + "application.properties", "linux_server_ip") + ":8080/pentaho/adhoc/waqr.html?&userid=joe&password=password" %>' target="_blank">明细查询</a></li>
<%}
%> Commented by huach on 20140731 end --%>
<li>
<a href='<%= request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+"/pentaho/adhoc/waqr.html?&userid=joe&password=password" %>'
target="_blank">明细查询</a></li>
</shiro:hasPermission>
<shiro:hasPermission name="即席查询:知识管理">
<li><a href="${ctx}/DataManage/KnowledgeShare">知识管理</a></li>
</shiro:hasPermission>
</ul>
</li>
</shiro:hasPermission>
<shiro:hasPermission name="基础管理:元数据管理">
<li><a href="${ctx}/BaseManage/ParameterManage/parameterHome">元数据管理</a></li>
<shiro:hasPermission
name="基础管理:配置管理 or 基础管理:系统自监控 or 基础管理:系统数据备份和恢复 or 基础管理:元数据管理 or 基础管理:告警规则管理 or 基础管理:任务管理 ">
<li class="titleLine"></li>
<li class="dropdown">
<a class="dropdonw-toggle" data-toggle="dropdown" role="button" href="#"><span
class="menu-icon"><img alt="" src="${ctx}/static/images/6.png"/></span>基础管理</a>
<ul class="dropdown-menu" aria-labelledby="drop" role="menu">
<shiro:hasPermission name="基础管理:告警规则管理">
<li class="dropdown-submenu">
<a href="#">告警规则管理</a>
<ul class="dropdown-menu">
<li>
<a href="${ctx}/BaseManage/ParameterManage/ruleHome?selectTab=a_eWarningDropRule">预警消除规则维护</a>
</li>
<li>
<a href="${ctx}/BaseManage/ParameterManage/ruleHome?selectTab=a_eWarningRule">预警生成规则维护</a>
</li>
<li>
<a href="${ctx}/BaseManage/ParameterManage/ruleHome?selectTab=a_hWarningRule">隐患生成规则维护</a>
</li>
</ul>
</li>
</shiro:hasPermission>
<shiro:hasPermission name="基础管理:系统数据备份和恢复">
<li class="dropdown-submenu">
<a href="#">系统数据备份和恢复</a>
<ul class="dropdown-menu">
<li>
<a href="${ctx}/BaseManage/DataBackup/dataBackupHome?selectTab=a_dataBackup">系统数据备份</a>
</li>
<li>
<a href="${ctx}/BaseManage/DataBackup/dataBackupHome?selectTab=a_taskDetail">系统数据恢复</a>
</li>
</ul>
</li>
</shiro:hasPermission>
<shiro:hasPermission name="基础管理:任务管理">
<li class="dropdown-submenu">
<a href="#">任务管理</a>
<ul class="dropdown-menu">
<li><a href="${ctx}/BaseManage/TaskManage/taskHome?selectTab=a_taskManage">自定义任务维护</a>
</li>
<li><a href="${ctx}/BaseManage/TaskManage/taskHome?selectTab=a_taskLog">任务运行日志查询</a>
</li>
</ul>
</li>
</shiro:hasPermission>
<shiro:hasPermission name="基础管理:配置管理">
<li class="dropdown-submenu">
<a href="#">配置管理</a>
<ul class="dropdown-menu">
<li><a href="${ctx}/BaseManage/SystemParameter/home?selectTab=a_dataBackup">前台系统参数维护</a>
</li>
<li>
<a href="${ctx}/BaseManage/SystemParameter/home?selectTab=a_analysysType">数据分析参数维护</a>
</li>
<li><a href="${ctx}/BaseManage/SystemParameter/home?selectTab=a_taskGroup">任务组维护</a>
</li>
<li>
<a href="${ctx}/BaseManage/SystemParameter/home?selectTab=a_deployedServer">部署服务器维护</a>
</li>
<li>
<a href="${ctx}/BaseManage/SystemParameter/home?selectTab=a_dataModelType">隐患预警类型维护</a>
</li>
<li><a href="${ctx}/BaseManage/SystemParameter/home?selectTab=a_baseData">后台系统参数维护</a>
</li>
</ul>
</li>
</shiro:hasPermission>
<shiro:hasPermission name="基础管理:系统自监控">
<li><a href="${ctx}/BaseManage/SelfMonitor/monitorHome">系统自监控</a></li>
</shiro:hasPermission>
<shiro:hasPermission name="基础管理:元数据管理">
<li><a href="${ctx}/BaseManage/ParameterManage/parameterHome">元数据管理</a></li>
</shiro:hasPermission>
<shiro:hasRole name="admin">
<li class="dropdown-submenu">
<a href="#">权限管理</a>
<ul class="dropdown-menu">
<li><a href="${ctx}/BaseManage/AuthorityManage">用户管理</a></li>
<li><a id="roleManage" href="${ctx}/BaseManage/AuthorityManage/roleManage">角色管理</a>
</li>
</ul>
</li>
</shiro:hasRole>
</ul>
</li>
<li class="titleLine"></li>
</shiro:hasPermission>
<shiro:hasRole name="admin">
<li class="dropdown-submenu">
<a href="#">权限管理</a>
<ul class="dropdown-menu">
<li><a href="${ctx}/BaseManage/AuthorityManage">用户管理</a></li>
<li><a id="roleManage" href="${ctx}/BaseManage/AuthorityManage/roleManage">角色管理</a></li>
</ul>
</li>
</shiro:hasRole>
</ul>
</li>
<li class="titleLine"></li>
</shiro:hasPermission>
</ul>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
$("#logout").click(function(){
var href="${ctx}/index/logoutCreateLog";
$.ajax({
type : 'GET',
contentType : 'application/json',
url: href,
dataType : 'text',
beforeSend: function(data) {
},
success: function(data) {
location.href="${ctx}/logout";
}
});
});
$("#login").mouseover(function(){
$("#showuser").show();
});
$("#login").mouseout(function(){
$("#showuser").hide();
});
var userName;
<% if(session.getAttribute("CURRENT_USER_SESSION")!=null){ %>
userName= '<%= ((UserInfo)(session.getAttribute("CURRENT_USER_SESSION"))).getStaffname()%>';
$("#userName").html(userName);
console.log("userName:"+userName);
<% } %>
});
$(document).ready(function () {
$("#logout").click(function () {
var href = "${ctx}/index/logoutCreateLog";
$.ajax({
type: 'GET',
contentType: 'application/json',
url: href,
dataType: 'text',
beforeSend: function (data) {
},
success: function (data) {
location.href = "${ctx}/logout";
}
});
function modifyPassword() {
$.dialog({
id: "modifyPassword",
title: "修改密码",
content: "<div style='width:290px;height:129px'><div class='form-horizontal' id='modifyPassword'>"
+"<div class='form-group'><div class='col-xs-4'><label class='control-label'>旧密码(<font color='red'>*</font>):</label></div><div class='col-xs-7' style='margin:0 -17px'><input id='oldPassword' name='oldPassword' class='form-control' type='password' value='' /></div></div>"
+"<div class='form-group'><div class='col-xs-4'><label class='control-label'>新密码(<font color='red'>*</font>):</label></div><div class='col-xs-7' style='margin:0 -17px'><input id='newPassword' name='newPassword' class='form-control' type='password' value='' /></div></div>"
+"<div class='form-group'><div class='col-xs-4'><label class='control-label'>确认新密码(<font color='red'>*</font>):</label></div><div class='col-xs-7' style='margin:0 -17px'><input id='reNewPassword' name='reNewPassword' class='form-control' type='password' value='' /></div></div>"
+"<div class='form-group'><div style='margin-left:10px;'><font color='red'><p></p></font></div></div>"
+"</div></div>",
initialize: function () {
$(".d-buttons input:first").css({
"color": "#ffffff",
"background": "#428bca",
"border-color": "#357ebd"
});
},
button: [{
value: "提交",
callback: function () {
if($.trim($("#oldPassword").val()) =="" ) {
//$.alert("输入的旧密码不能为空!");
$('p').html("输入的旧密码不能为空!");
return false;
} else if ($.trim($("#oldPassword").val()).length < 6){
//$.alert("输入旧密码的长度至少为6位!");
$("#oldPassword").focus();
$('p').html("输入旧密码的长度至少为6位!");
return false;
}
$("#login").mouseover(function () {
$("#showuser").show();
});
$("#login").mouseout(function () {
$("#showuser").hide();
});
var userName;
<% if(session.getAttribute("CURRENT_USER_SESSION")!=null){ %>
userName = '<%= ((UserInfo)(session.getAttribute("CURRENT_USER_SESSION"))).getStaffname()%>';
$("#userName").html(userName);
console.log("userName:" + userName);
<% } %>
});
function modifyPassword() {
$.dialog({
id: "modifyPassword",
title: "修改密码",
content: "<div style='width:290px;height:129px'><div class='form-horizontal' id='modifyPassword'>"
+ "<div class='form-group'><div class='col-xs-4'><label class='control-label'>旧密码(<font color='red'>*</font>):</label></div><div class='col-xs-7' style='margin:0 -17px'><input id='oldPassword' name='oldPassword' class='form-control' type='password' value='' /></div></div>"
+ "<div class='form-group'><div class='col-xs-4'><label class='control-label'>新密码(<font color='red'>*</font>):</label></div><div class='col-xs-7' style='margin:0 -17px'><input id='newPassword' name='newPassword' class='form-control' type='password' value='' /></div></div>"
+ "<div class='form-group'><div class='col-xs-4'><label class='control-label'>确认新密码(<font color='red'>*</font>):</label></div><div class='col-xs-7' style='margin:0 -17px'><input id='reNewPassword' name='reNewPassword' class='form-control' type='password' value='' /></div></div>"
+ "<div class='form-group'><div style='margin-left:10px;'><font color='red'><p></p></font></div></div>"
+ "</div></div>",
initialize: function () {
$(".d-buttons input:first").css({
"color": "#ffffff",
"background": "#428bca",
"border-color": "#357ebd"
});
},
button: [{
value: "提交",
callback: function () {
if ($.trim($("#oldPassword").val()) == "") {
//$.alert("输入的旧密码不能为空!");
$('p').html("输入的旧密码不能为空!");
return false;
} else if ($.trim($("#oldPassword").val()).length < 6) {
//$.alert("输入旧密码的长度至少为6位!");
$("#oldPassword").focus();
$('p').html("输入旧密码的长度至少为6位!");
return false;
}
if($.trim($("#newPassword").val()) =="" || $.trim($("#reNewPassword").val()) =="") {
//$.alert("输入的新密码不能为空!");
$('p').html("输入的新密码不能为空!");
return false;
} else if ($.trim($("#newPassword").val()).length < 6){
//$.alert("输入新密码的长度至少为6位!");
$('p').html("输入新密码的长度至少为6位!");
$("#newPassword").focus();
return false;
}else{
if($.trim($("#newPassword").val()) != $.trim($("#reNewPassword").val())) {//前后两次输入的新密码不一致
//$.alert("前后两次输入的新密码不一致!");
$('p').html("前后两次输入的新密码不一致!");
return false;
} else {
var userinfo='?oldPassword='+$.trim($("#oldPassword").val())+'&newPassword='+$.trim($("#newPassword").val())+'&random='+Math.random();
$.ajax({
type : 'GET',
if ($.trim($("#newPassword").val()) == "" || $.trim($("#reNewPassword").val()) == "") {
//$.alert("输入的新密码不能为空!");
$('p').html("输入的新密码不能为空!");
return false;
} else if ($.trim($("#newPassword").val()).length < 6) {
//$.alert("输入新密码的长度至少为6位!");
$('p').html("输入新密码的长度至少为6位!");
$("#newPassword").focus();
return false;
} else {
if ($.trim($("#newPassword").val()) != $.trim($("#reNewPassword").val())) {//前后两次输入的新密码不一致
//$.alert("前后两次输入的新密码不一致!");
$('p').html("前后两次输入的新密码不一致!");
return false;
} else {
var userinfo = '?oldPassword=' + $.trim($("#oldPassword").val()) + '&newPassword=' + $.trim($("#newPassword").val()) + '&random=' + Math.random();
$.ajax({
type: 'GET',
contentType: 'application/x-www-form-urlencoded;charset=UTF-8',
url: encodeURI(encodeURI('${ctx}/BaseManage/AuthorityManage/modifyPassword'+userinfo)),
dataType : 'text',
beforeSend: function(data) {
url: encodeURI(encodeURI('${ctx}/BaseManage/AuthorityManage/modifyPassword' + userinfo)),
dataType: 'text',
beforeSend: function (data) {
},
success: function(data) {
success: function (data) {
data = JSON.parse(data);
if(data == "oldPasswordError") {
// $.alert("旧密码输入有误,请重新登录!");
modifyPassword();
$('p').html("旧密码输入有误,请重新输入!");
// window.location.href = "${ctx}/logout";
} else if(data == "success") {
$.alert("修改密码成功!");
} else {
$.alert("修改密码失败!");
if (data == "oldPasswordError") {
// $.alert("旧密码输入有误,请重新登录!");
modifyPassword();
$('p').html("旧密码输入有误,请重新输入!");
// window.location.href = "${ctx}/logout";
} else if (data == "success") {
$.alert("修改密码成功!");
} else {
$.alert("修改密码失败!");
}
}
});
}
}
}
},
{
value: "取消",
callback: function () { }
}],
lock: false
});
}
}
}
}
},
{
value: "取消",
callback: function () {
}
}],
lock: false
});
}
</script>
<%@tag pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags"%>
<%--省份筛选项 --%>
<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>
<br/>
<c:forEach items="${provinceList}" var="provinces">
<div class="checkbox-inline">
<label>
<input type="checkbox" name="provinceDetail" class="provinceDetail" title="${provinces.provinceName}" value="${provinces.provinceId}" checked/>${provinces.provinceName}
</label>
</div>
</c:forEach>
</div>
<script type="text/javascript">
$("#allProvinceDetail").click(function(){
alert(21)
});
</script>
\ No newline at end of file
......@@ -15,14 +15,14 @@
</div>
</c:forEach>
</div>
<script type="text/javascript">
var detailProvinceCheckedValues=$(".provinceDetail:checked");
var detailProvinceCheckedValues=$(".provinceDetail:checked");
//全选和不全选所有的省
$("#allProvinceDetail").click(function(){
if($("#allProvinceDetail").attr("checked") == "checked"){//全选
//全选和不全选所有的省
$("#allProvinceDetail").click(function(){
if($("#allProvinceDetail").attr("checked")
== "checked"){//全选
$(".provinceDetail").attr("checked","checked");
detailProvinceCheckedValues=$(".provinceDetail:checked");
}else{//不全选
......
<%@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="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="yewu">业务</option>
<option value="qudao" 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">
<div class="checkbox-inline">
<label>
<input type="checkbox" name="provinceDetail" class="provinceDetail" title="${provinces.provinceName}" value="${provinces.provinceId}" checked/>${provinces.provinceName}
</label>
</div>
</c:forEach>
</div>
</div>
<script type="text/javascript">
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();
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();
var i=0;
detailProvinceCheckedValues.each(function(){
provinceArray[i]=$(this).val();
i++;
});
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;
detailProvinceCheckedValues.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
<%@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="timeDetail" class="">
</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="yewu">业务</option>
<option value="qudao" 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">
<div class="checkbox-inline">
<label>
<input type="checkbox" name="provinceDetail" class="provinceDetail" title="${provinces.provinceName}" value="${provinces.provinceId}" checked/>${provinces.provinceName}
</label>
</div>
</c:forEach>
</div>
</div>
<script type="text/javascript">
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();
return detailProviderArray;//detailProviderStr;
}
//返回 关联维度 的 选择值
function getDetailCheckeddDimension() {
var checkedDimension=$("#xcdStatusSelect option:selected").val();
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();
var i=0;
detailProvinceCheckedValues.each(function(){
provinceArray[i]=$(this).val();
i++;
});
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;
detailProvinceCheckedValues.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
<%--
Created by IntelliJ IDEA.
User: Administrator
Date: 2017/11/21 0021
Time: 下午 2:27
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<html>
<head>
<title>全网监控智能分析平台</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<script src="${ctx}/static/artDialog4.1.7/artDialog.source.js?skin=default"></script>
<script src="${ctx}/static/artDialog4.1.7/plugins/iframeTools.source.js"></script>
<script type="text/javascript" src="${ctx}/static/js/associatediagosisconfiguration.js"></script>
<script type="text/javascript">
$(document).ready(function() {
var jso = document.getElementById('gzfxDetail').value;
alert(jso);
// failureTable();
// initDateDetail();//初始化 时间范围
initTable();//初始化 主面板
// $("#businessSelectAreaDetail").hide();
});
</script>
</head>
<body>
<div>
<div class="container">
<ol class="breadcrumb">
<li><a href="${ctx}/index">首页</a></li>
<li>监控运营</li>
<li class="active">告警关联诊断</li>
</ol>
</div>
</div>
<div id="main-container main-tab-container">
<div id="content" class="container">
<div class="tab-bar-bt">
<ul class="nav nav-tabs">
<li class="active"><a id="a_detail" href="#detail" data-toggle="tab">关联诊断配置</a></li>
<li><a id="a_statistics" href="${ctx}/MonitorOperation/AssociateDiagosisDetail">关联诊断明细</a></li>
</ul>
</div>
<div class="section">
<div class="tab-content">
<div class="tab-pane fade in active" id="detail">
<div class="row me-row">
<div id="slidePushMenus2" class="cbp-spmenu-push">
<div class="slideMenu" id="cbp-spmenu-s2" style="">
<div class="form">
<%--<tags:GZFX_Period_detail/>--%>
<tags:GZFX__Time_Dimension_Province_AssociateDiagosisConfiguration/>
<button class="btn btn-primary" onclick="detailSubmit()">提交</button>
<button class="btn btn-warning" onclick="detailReset()">重置</button>
</div>
</div>
<div class="main col-xs-12">
<!-- <table id="mainm2" class="mainm" onclick="hideMenu('showLeftPush2','slidePushMenus2')"></table> -->
<div id="mainm2" class="mainm"></div>
<div class="content clearfix">
<div class="block clearfix">
<button id="showLeftPush2" class="menu-trigger btn btn-default"
onclick="toggleMenu('slidePushMenus2')">
<span class="glyphicon glyphicon-list"></span>
</button>
<div class="slide-menu-tags">
<span id="detailPeriodTag" class="label label-info" data-placement="bottom">最近一个月</span>
<span id="detailTimeTag" class="label label-info"
data-placement="bottom"></span>
<span id="detailDemensionTag" class="label label-info"
data-placement="bottom"></span>
<span id="detailProvinceTag" class="label label-info"
data-placement="bottom"></span>
</div>
<div class="bt-list-import">
<a href="#" id="downloadEecel" class="">
<span class="glyphicon glyphicon-import"></span>
<span class="glyphicon-class">导出Excel</span>
</a>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="table-header">
关联诊断结果查询
<shiro:hasAnyRoles name="admin,dataAnalysis,businessAnalysis">
<div id="time_div"
style="top: -6px;float: right;height: 0px;position: relative;">
<button id="createIndicatorsBtn"
class="btn-sm btn btn-primary btn-sm btn-group btn-group-cog"
onclick="createIndicators()">新建指标
</button>
<button id="updateIndicatorsBtn"
class="btn-sm btn btn-primary btn-sm btn-group btn-group-cog"
onclick="updateIndicators()">修改指标
</button>
</div>
</shiro:hasAnyRoles>
</div>
<!--写故障明细列表处-->
<table class="table table-hover table-striped"
id="failureAnalysisDetailTable">
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<form action="#" method="get" id="listForm"></form>
<input type="hidden" id="gzfxDetail" name="gzfxDetail" value='${gzfxDetailInfos}' />
<input type="hidden" id="provinceAll" name="provinceAll" value='${provinces}' />
<input type="hidden" id="indicatorsAll" name="indicatorsAll" value='${indicatorsAll}' />
</div>
</div>
</div>
</div>
<script type="text/javascript">
function detailSubmit(){
var detailProvinceSum = getDetailProvinceCheckedValues().length;
if(detailProvinceSum==0) {
$.alert("省份的选择不能为空");
}else {
var detailProvince = getDetailProvinceCheckedValueString();
alert(detailProvince);
var dimension = getDetailCheckeddDimension();
alert(dimension);
// var detailTime = getDetailPeriodStr();
$.ajax({
type : 'GET',
contentType : 'application/json',
url: "${ctx}/MonitorOperation/AssociateDiagosisConfiguration?detailProvince="+encodeURIComponent(detailProvince)+
"&dimension="+dimension,
dataType : 'text',
beforeSend: function(data) {
},
success: function(data) {
$("#gzfxDetail").val(data);
failureTable();
// checkFailureIds=[];
$("#deleteFailureBtn").attr("disabled", true);
toggleMenu('slidePushMenus2');//隐藏筛选项
}
});
}
toggleMenu('slidePushMenus2');//隐藏筛选项
updateTags(true)//更新 tags显示
}
function updateTags(flag){
$("#detailPeriodTag").empty();
$("#detailDemensionTag").empty();
$("#detailProvinceTag").empty();
$("#detailTimeTag").empty();
if(flag){
/* $("#detailTimeTag").text("时间范围").attr('data-original-title',getDetailPeriodString()).tooltip();*/
$("#detailDemensionTag").text("关联维度").attr('data-original-title',getdetailDemensionTagValue()).tooltip();
$("#detailProvinceTag").text("省份").append($("<span class='badge'></span>").text(getDetailProvinceTagLength())).attr('data-original-title',getDetailProvinceTag()).tooltip();
}else{
$("#detailPeriodTag").text("最近一个月");
}
}
function getdetailDemensionTagValue(){
var checkedDimension=$("#xcdStatusSelect option:selected").text();
return checkedDimension;
}
function getDetailProvinceTag(){
var str="";
$(".provinceDetail:input:checkbox:checked").each(function(){
//alert($(this).text());
str+=$(this).attr("title")+" ";
});
return str;
}
function getDetailProvinceTagLength(){
var length="";
$(".provinceDetail:input:checkbox:checked").each(function(){
length++;
});
return length;
}
//重置detail中的筛选项
function detailReset(){
initDateDetail();
detail_Dimension_Reset();
detail_Province_Reset();
updateTags(false);
// judge = true;
}
$("#downloadEecel").click(function(){
alert("downloadExcel");
var listForm=$("#listForm");
listForm.attr("method","post");
listForm.attr("action","${ctx}/ModelManage/ModelResult/uploadModel");
listForm.submit();
listForm.attr("action","#");
});
$("#createIndicatorsBtn").click(function(){
$.dialog({
title: "提醒",
content:"确定新建指标?",
ok: function(){location.href="${ctx}/MonitorOperation/AssociateDiagosisDetail/createDiagosis";},
okValue:"确定",
cancel: function(){},
cancelValue:"取消",
lock:true
});
});
</script>
</body>
</html>
<%--
Created by IntelliJ IDEA.
User: molinyi
Date: 2017/11/21 0021
Time: 下午 2:12
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<html>
<head>
<title>全网监控智能分析平台</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<script src="${ctx}/static/artDialog4.1.7/artDialog.source.js?skin=default"></script>
<script src="${ctx}/static/artDialog4.1.7/plugins/iframeTools.source.js"></script>
<%--<script type="text/javascript" src="${ctx}/static/js/failureAnalysisDetailTable.js"></script>--%>
<script type="text/javascript" src="${ctx}/static/js/associatediagosisdetail.js"></script>
<script type="text/javascript">
$(document).ready(function(){
// alert(1);
// failureTable();
// initDateDetail();
//$("#businessSelectAreaDetail").hide();
//初始化界面
initTable();
});
</script>
</head>
<body>
<div>
<div class="container">
<ol class="breadcrumb">
<li><a href="${ctx}/index">首页</a></li>
<li>监控运营</li>
<li class="active">告警关联诊断</li>
</ol>
</div>
</div>
<div id="main-container main-tab-container">
<div id="content" class="container">
<div class="tab-bar-bt">
<ul class="nav nav-tabs">
<li><a id="a_statistics" href="${ctx}/MonitorOperation/AssociateDiagosisConfiguration">关联诊断配置</a></li>
<li class="active"><a id="a_detail" href="#detail" data-toggle="tab">关联诊断明细</a></li>
</ul>
</div>
<div class="section">
<div class="tab-content">
<div class="tab-pane fade in active" id="detail">
<div class="row me-row">
<div id="slidePushMenus2" class="cbp-spmenu-push">
<div class="slideMenu" id="cbp-spmenu-s2" style="">
<div class="form">
<tags:GZFX__Dimension_Province_detail/>
<button class="btn btn-primary" onclick="detailSubmit()">提交</button>
<button class="btn btn-warning" onclick="detailReset()">重置</button>
</div>
</div>
<div class="main col-xs-12">
<!-- <table id="mainm2" class="mainm" onclick="hideMenu('showLeftPush2','slidePushMenus2')"></table> -->
<div id="mainm2" class="mainm"></div>
<div class="content clearfix">
<div class="block clearfix">
<button id="showLeftPush2" class="menu-trigger btn btn-default"
onclick="toggleMenu('slidePushMenus2')">
<span class="glyphicon glyphicon-list"></span>
</button>
<div class="slide-menu-tags">
<span id="detailPeriodTag" class="label label-info" data-placement="bottom">最近一个月</span>
<span id="detailDataSourceTag" class="label label-info"
data-placement="bottom"></span>
<span id="detailChannelTag" class="label label-info"
data-placement="bottom"></span>
<span id="detailBusinessTag" class="label label-info"
data-placement="bottom"></span>
<span id="detailProvinceTag" class="label label-info"
data-placement="bottom"></span>
<span id="detailProviderTag" class="label label-info"
data-placement="bottom"></span>
<span id="detailXcdStatusTag" class="label label-info"
data-placement="bottom"></span>
<span id="detailTitleTag" class="label label-info"
data-placement="bottom"></span>
<span id="detailWarningSourceTag" class="label label-info"
data-placement="bottom"></span>
<span id="detailFailureIdTag" class="label label-info"
data-placement="bottom"></span>
</div>
<div class="bt-list-import">
<a href="#" id="gzfxDetailUpload" class="">
<span class="glyphicon glyphicon-import"></span>
<span class="glyphicon-class">导出Excel</span>
</a>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="table-header">
关联诊断结果查询
<%--<shiro:hasAnyRoles name="admin,dataAnalysis,businessAnalysis">
<div id="time_div"
style="top: -6px;float: right;height: 0px;position: relative;">
<button id="deleteFailureBtn"
class="btn-sm btn btn-primary btn-sm btn-group btn-group-cog"
onclick="failureDelete()">删除故障
</button>
</div>
</shiro:hasAnyRoles>--%>
</div>
<!--写故障明细列表处-->
<table class="table table-hover table-striped"
id="failureAnalysisDetailTable">
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<form action="#" method="get" id="listForm"></form>
<input type="hidden" id="gzfxDetail" name="gzfxDetail" value='${gzfxDetailInfos}' />
</div>
</div>
</div>
</div>
<script type="text/javascript">
//判断是否重置了
var judge = true ;
//onloading 确认标签
var failureId = "${failureId}";
var driProvinceId = "${driProvinceId}";
var driProviderId = "${driProviderId}";
var driDateVal = "${driDateVal}";
if(failureId!=""){
$("#detailPeriodTag").empty();
$("#detailFailureIdTag").text("故障ID:"+failureId);
}
if(driProvinceId!=""){
$("#detailProvinceTag").text("省份").append($("<span class='badge'></span>").text("1")).attr('data-original-title',$(".provinceDetail[value="+driProvinceId+"]").attr("title")).tooltip();
}
//条件筛选后的标签改变
if("${filterDataSource}"!="" && "${filterBusiness}"!="" && "${filterChannel}"!="" && "${filterProvince}"!="" && "${filterProvider}"!=""){
var filterTimeTag = "${filterTimeTag}";
$("#detailPeriodTag").text("时间范围").attr('data-original-title',(filterTimeTag.split("-").length>1)?filterTimeTag:"").tooltip();
$("#detailDataSourceTag").text("数据来源").append($("<span class='badge'></span>").text("${filterDataSource}".split(" ").length)).attr('data-original-title',"${filterDataSource}").tooltip();
//渠道刷选项
$("#detailChannelTag").text("渠道").append($("<span class='badge'></span>").text("${filterChannel}".split(" ").length)).attr('data-original-title',"${filterChannel}").tooltip();
//业务刷选项
$("#detailBusinessTag").text("业务").append($("<span class='badge'></span>").text("${filterBusiness}".split(" ").length)).attr('data-original-title',"${filterBusiness}").tooltip();
//省份筛选项
$("#detailProvinceTag").text("省份").append($("<span class='badge'></span>").text("${filterProvince}".split(" ").length)).attr('data-original-title',"${filterProvince}").tooltip();
//集成商筛选项
$("#detailProviderTag").text("集成商").append($("<span class='badge'></span>").text("${filterProvider}".split(" ").length)).attr('data-original-title',"${filterProvider}").tooltip();
if("${filterWarningSource}"!=""){
//故障来源
$("#detailWarningSourceTag").text("故障来源").append($("<span class='badge'></span>").text("${filterWarningSource}".split(" ").length)).attr('data-original-title',"${filterWarningSource}").tooltip();
}
}else if("${filterBusiness}"=="" && "${filterDataSource}"!="" && "${filterChannel}"!="" && "${filterProvince}"!="" && "${filterProvider}"!=""){
var filterTimeTag = "${filterTimeTag}";
$("#detailPeriodTag").text("时间范围").attr('data-original-title',(filterTimeTag.split("-").length>1)?filterTimeTag:"").tooltip();
$("#detailDataSourceTag").text("数据来源").append($("<span class='badge'></span>").text("${filterDataSource}".split(" ").length)).attr('data-original-title',"${filterDataSource}").tooltip();
//渠道刷选项
$("#detailChannelTag").text("渠道").append($("<span class='badge'></span>").text("${filterChannel}".split(" ").length)).attr('data-original-title',"${filterChannel}").tooltip();
//省份筛选项
$("#detailProvinceTag").text("省份").append($("<span class='badge'></span>").text("${filterProvince}".split(" ").length)).attr('data-original-title',"${filterProvince}").tooltip();
//集成商筛选项
$("#detailProviderTag").text("集成商").append($("<span class='badge'></span>").text("${filterProvider}".split(" ").length)).attr('data-original-title',"${filterProvider}").tooltip();
}else if("${filterBusiness}"=="" && "${filterDataSource}"=="" && "${filterChannel}"=="" && "${filterProvince}"!="" && "${filterProvider}"!=""){
//省份筛选项
$("#detailProvinceTag").text("省份").append($("<span class='badge'></span>").text("${filterProvince}".split(" ").length)).attr('data-original-title',"${filterProvince}").tooltip();
//集成商筛选项
$("#detailProviderTag").text("集成商").append($("<span class='badge'></span>").text("${filterProvider}".split(" ").length)).attr('data-original-title',"${filterProvider}").tooltip();
}
</script>
<script type="text/javascript">
function writeLable(){
if(judge == true){
$("#detailPeriodTag").text("最近一个月");
$("#detailDataSourceTag").empty();
$("#detailChannelTag").empty();
$("#detailBusinessTag").empty();
$("#detailProvinceTag").empty();
$("#detailProviderTag").empty();
$("#detailXcdStatusTag").empty();
$("#detailWarningSourceTag").empty();
}else{
if($("#titleText").val()!=""){
$("#detailPeriodTag").empty();
$("#detailDataSourceTag").empty();
$("#detailChannelTag").empty();
$("#detailBusinessTag").empty();
$("#detailProvinceTag").empty();
$("#detailProviderTag").empty();
$("#detailXcdStatusTag").empty();
$("#detailWarningSourceTag").empty();
$('#detailTitleTag').text("故障标题:"+$("#titleText").val());
}else{
$('#detailTitleTag').empty();
$("#detailWarningSourceTag").text("故障来源").append($("<span class='badge'></span>").text(getStatsWarningSourceCheckedValues().length)).attr('data-original-title',getStatsWaringSourceCheckedTitles()).tooltip();
$("#detailXcdStatusTag").text("协查单状态:"+getXcdStatusTitle());
$("#detailPeriodTag").text((getDetailPeriodStr()=="")?"最近一个月":"时间范围").attr('data-original-title',getDetailPeriodStr()).tooltip();
//数据来源刷选项
$("#detailDataSourceTag").text("数据来源").append($("<span class='badge'></span>").text(getDetailDataSourceCheckedTexts().length)).attr('data-original-title',getDetailDataSourceCheckedTitles()).tooltip();
//渠道刷选项
$("#detailChannelTag").text("渠道").append($("<span class='badge'></span>").text(getDetailChannelCheckedValues().length)).attr('data-original-title',getDetailChannelCheckedTitles()).tooltip();
//业务刷选项
$("#detailBusinessTag").text("业务").append($("<span class='badge'></span>").text(getDetailBusinessCheckedValues().length)).attr('data-original-title',getDetailBusinessCheckedTitlesString()).tooltip();
//省份筛选项
$("#detailProvinceTag").text("省份").append($("<span class='badge'></span>").text(getDetailProvinceCheckedValues().length)).attr('data-original-title',getDetailProvinceCheckedTitles()).tooltip();
//集成商筛选项
$("#detailProviderTag").text("集成商").append($("<span class='badge'></span>").text(getDetailProviderCheckedValues().length)).attr('data-original-title',getDetailProviderCheckedTitles()).tooltip();
}
}
}
function detailSubmit(){
var detailProvinceSum = getDetailProvinceCheckedValues().length;
if(detailProvinceSum==0) {
$.alert("省份的选择不能为空");
}else{
var detailProvince = getDetailProvinceCheckedValueString();
var dimension=getDetailCheckeddDimension();
//alert(dimension+"-pi-");
// alert(detailProvince);
//var href="${ctx}/MonitorOperation/FailureAnalysisDetail/changeTable?detailProvince="+detailProvince+"&detailProvider="+detailProvider+"&xcdStatus="+xcdStatus+"&detailDataSource="+detailDataSource+"&detailChannel="+detailChannel+"&detailBusiness="+detailBusiness+"&detailWarningSource="+detailWarningSource+"&failureTitle="+"-1";
/* $.ajax({
type : 'GET',
contentType : 'application/json',
url: encodeURI(encodeURI(href))+"&detailTime="+detailTime,//href,
dataType : 'text',
beforeSend: function(data) {
},
success: function(data) {
$("#gzfxDetail").val(data);
failureTable();
checkFailureIds=[];
$("#deleteFailureBtn").attr("disabled", true);
toggleMenu('slidePushMenus2');//隐藏筛选项
}
});*/
toggleMenu('slidePushMenus2');//隐藏筛选项
}
writeLable();
}
//重置detail中的筛选项
function detailReset(){
detail_Province_Reset();
detail_Dimension_Reset();
judge = true;
}
//把故障明细统计列表导出为Excel格式
$("#gzfxDetailUpload").click(function(){
//upLoadExcel
var listForm=$("#listForm");
listForm.attr("method","post");
listForm.attr("action","${ctx}/MonitorOperation/FailureAnalysisDetail/upLoadGzfxDetailExcel");
listForm.submit();
listForm.attr("action","#");
});
</script>
</body>
</html>
<%--
Created by IntelliJ IDEA.
User: molinyi
Date: 2017/11/23 0023
Time: 上午 11:07
To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>模型维护</title>
<style>
.table-null .table{
margin-bottom: 0px;
}
.table-null .table > tbody > tr > td, .table-null .table > thead > tr > th{
text-align: center;
width: 25%;
}
.table-null td:first-child{
text-align: right;
width: 36%;
}
.table-null tr td:last-child .form-control,.table-null tr td:last-child table{
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;width:340px}
.txt{ height:22px; border:1px solid #cdcdcd; width:180px;}
.btn{ background-color:#FFF; border:1px solid #CDCDCD;height:24px; width:70px;}
.file{ position:absolute; top:0; right:80px; height:24px; filter:alpha(opacity:0);opacity: 0;width:260px } */
</style>
</head>
<body>
<div class="container">
<ol class="breadcrumb">
<li><a href="${ctx}/index">首页</a></li>
<li>监控运营</li>
<li class="active">告警关联诊断</li>
</ol>
</div>
<div id="main-container main-tab-container">
<div id="content" class="container">
<div class="section">
<div class="tab-content">
<div class="tab-pane fade in active" id="home">
<div class="row">
<div class="col-xs-12">
<div class="table-header">新建指标</div>
<form action="#" class="form-horizontal" id="modelMaintainForm" method="post" enctype="multipart/form-data">
<table id="modelMaintainTable" class="table-null">
<tr><td>指标名称(<font color="red">必填</font>):</td><td><input type="text" class="form-control" name="dataModelName" id="dataModelName" style="display: inline;" /><span id="writeWarningInf" style="color:red;display: inline;padding-left:10px;"></span></td></tr>
<tr><td>指标权重:</td><td><input type="text" class="form-control" name="modelDesc" id="modelDesc" style="display:inline;" /></td></tr>
<tr><td>关联描述:</td><td><input type="text" class="form-control" name="ruleDefinition" id="ruleDefinition"/></td></tr>
<tr><td>省份:</td><td><input type="text" class="form-control" name="evaluationMethod" id="evaluationMethod" style="display: inline;" /></td></tr>
<tr><td>评判标准:</td><td><input type="text" class="form-control" name="evaluationStandard" id="evaluationStandard" style="display: inline;" /></td></tr>
<tr><td>模型执行脚本(<font color="red">必填</font>):</td><td>
<div class="file-box">
<input type='text' id='modelExeScriptName' class="form-control" style="display: inline;"/>
<input type='button' class="btn btn-default" value='浏 览' style="width:70px"/>
<input type="file" name="uploadFile" class="file" id="fileField" onchange="document.getElementById('modelExeScriptName').value=this.value" />
</div>
</td></tr>
<tr><td>关联维度:</td>
<td><select class="form-control" name="modelType" id="modelType" >
<c:forEach var="modelType" items="${dataModelTypeList}">
<option value="${modelType.dataModelTypeId}">${modelType.dataModelTypeName}</option>
</c:forEach>
</select></td></tr>
<tr><td>部署服务器:</td>
<td><select class="form-control" name="deployedServer" id="deployedServer">
<c:forEach var="deployedServers" items="${deployedServerList}">
<option value="${deployedServers.serverId}">${deployedServers.serverName}</option>
</c:forEach>
</select></td></tr>
<tr><td>模型状态:</td>
<td><select class="form-control" name="modelStatus" id="modelStatus">
<option value="1">正常</option>
<option value="0">失效</option>
</select></td></tr>
<tr><td>数据类型(<font color="red">必填</font>):</td>
<td><select class="form-control" name="kpiTypeId" id="kpiTypeId">
<option value="1">时长类</option>
<option value="2">业务量类</option>
<option value="3">百分比类</option>
</select></td></tr>
<!-- <tr><td>模型运行频度分钟数(<font color="red">只能是数字</font>):</td><td><input name="cycleMinutes" type="text" class="form-control" onkeyup="(this.v=function(){this.value=this.value.replace(/[^0-9]+/,'');}).call(this)" onblur="this.v();"/></td></tr> -->
<tr><td>业务结束时间(<font color="red">必填</font>):</td><td><input type="text" class="form-control" id="businessEndTime" name="businessEndTime" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'businessStartTime\')}'})" /></td></tr>
<tr><td>业务开始时间(<font color="red">必填</font>):</td><td><input id="businessStartTime" name="businessStartTime" class="form-control" type="text" onFocus="WdatePicker({maxDate:'#F{$dp.$D(\'businessEndTime\')}'})"> </td></tr>
<tr><td>已添加参数:</td>
<td><table class="table table-hover table-striped" id="displayParam">
<thead>
<tr><th>参数名</th><th>参数值</th><th>参数类型</th><th><a href="javascript:deleteAllTr()">删除所有参数</a></th></tr>
</thead>
<tbody id="addTr"></tbody>
</table></td></tr>
<tr><td>参数数据类型:</td>
<td><select class="form-control" id="paramDataType" name="paramDataType">
<c:forEach var="dataTypes" items="${dataTypeList}">
<option value="${dataTypes.dataTypeName}">${dataTypes.dataTypeName}</option>
</c:forEach>
</select></td></tr>
<tr><td>参数名:</td><td><input type="text" class="form-control" name="paramName" id="paramName"/></td></tr>
<tr><td>参数值:</td><td id="addParamVal"></td></tr>
<tr><td></td>
<td><button type="button" id="addParam" class="btn btn-primary">添加参数</button></td></tr>
<tr><td></td><td><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-warning" id="modelBack">返回</button>
</td></tr>
</table>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
if($("#paramDataType").val()=="字符"){
var addDataValue = $("<input type='text' class='form-control name=paramValue' id='paramValue'/>");
$("#addParamVal").append(addDataValue);
}else if($("#paramDataType").val()=="日期"){
var addDataValue = $("<input type='text' class='form-control name=paramValue' id='paramValue' onFocus='WdatePicker({dateFmt:\" yyyy-MM-dd \"})'/>");
$("#addParamVal").append(addDataValue);
}else if($("#paramDataType").val()=="时间"){
var addDataValue = $("<input type='text' class='form-control name=paramValue' id='paramValue' onFocus='WdatePicker({})'/>");
$("#addParamVal").append(addDataValue);
}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();'/>");
$("#addParamVal").append(addDataValue);
}
});
//模型名称是否重复判断
var isDouble = true;
$("#dataModelName").blur(function(){
if(""!=$.trim($(this).val())){
var modelName = $(this).val();
$.ajax({
type: "GET",
contentType : "application/json",
dataType: "text",
url: "${ctx}/ModelManage/ModelMaintain/select_modelName/"+encodeURIComponent(modelName),
beforeSend: function(data) { $("#modelSubmit").attr("disabled",true);},
success:function(data){
data = parseInt(data);
if(0==data){
$("#writeWarningInf").html("");
isDouble = false;
$("#modelSubmit").attr("disabled",false);
}else{
$("#writeWarningInf").html("<img src='${ctx}/static/images/x.png'/> 标题已存在");
isDouble = true;
$("#modelSubmit").attr("disabled",true);
}
}
});
}
});
//参数类型变化 类型数据验证
$("#paramDataType").change(function(){
$("#addParamVal").empty();
var paramDataType = $(this).find("option:selected").val();
if(paramDataType=="字符"){
var addDataValue = $("<input type='text' class='form-control name=paramValue' id='paramValue'/>");
$("#addParamVal").append(addDataValue);
}else if(paramDataType=="日期"){
var addDataValue = $("<input type='text' class='form-control name=paramValue' id='paramValue' onFocus='WdatePicker({dateFmt:\" yyyy-MM-dd \"})'/>");
$("#addParamVal").append(addDataValue);
}else if(paramDataType=="时间"){
var addDataValue = $("<input type='text' class='form-control name=paramValue' id='paramValue' onFocus='WdatePicker({})'/>");
$("#addParamVal").append(addDataValue);
}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();'/>");
$("#addParamVal").append(addDataValue);
}
});
//删除所有参数
function deleteAllTr(){
$("#addTr").empty();
}
//修改一条参数
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(){
var paramDataType = $("#paramDataType").val();
var paramName = $.trim($("#paramName").val());
var paramValue = $("#paramValue").val();
if(paramName==""){
$.alert("参数名不能为空");
}else{
if($("#addTr").find("tr.orange-tr").html()==null){
var addRow = $("<tr><td>"+paramName+"</td><td>"+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);
$("#paramName").attr("value","");
$("#paramValue").attr("value","");
}else{
var findTr = $("#addTr").find("tr.orange-tr");
$(findTr).find("td").eq(0).html(paramName);
$(findTr).find("td").eq(1).html(paramValue);
$(findTr).find("td").eq(2).html(paramDataType);
$("#addTr").find("tr").removeClass();
$("#addParam").text("添加参数");
}
}
});
//删除一条参数
function deleteRow(elementTag){
$(elementTag).parent().parent().remove();
}
//form表单重置
$("#modelReset").click(function(){
deleteAllTr();
});
//form表单提交
$("#modelSubmit").click(function(){
if($.trim($("#dataModelName").val())==""){
$.alert("数据模型名称不能为空");
}else if($("#modelExeScriptName").val()==""){
$.alert("模型执行脚本不能为空");
}else if($("#businessStartTime").val()==""){
$.alert("业务开始时间不能为空");
}else if($("#businessEndTime").val()==""){
$.alert("业务结束时间不能为空");
}else{
if($.trim($("#paramName").val())!=""){
$.dialog({
title: "提醒",
content: "有参数尚未添加,确定提交",
ok: function(){
$("#modelSubmit").attr("disabled",true);
var i = $("#addTr").find("tr").size();
if(i==0){
var createForm=$("#modelMaintainForm");
createForm.attr("action","${ctx}/ModelManage/ModelMaintain/saveModelDataForm");
createForm.submit();
createForm.attr("action","#");
}else{
$("#addTr").find("tr").each(function(){
//alert($(this).find("td").eq(0).html());
var paramName = $(this).find("td").eq(0).html();
var paramValue = $(this).find("td").eq(1).html();
var paramType = $(this).find("td").eq(2).html();
$.ajax({
type : "GET",
contentType : "application/json",
url: "${ctx}/ModelManage/ModelMaintain/createModelParam?paramName="+encodeURIComponent(paramName)+"&paramValue="+encodeURIComponent(paramValue)+"&paramType="+encodeURIComponent(paramType),
dataType : "text",
async: false,
beforeSend: function(data) {},
success: function(){
i--;
if(i==0){
var createForm=$("#modelMaintainForm");
createForm.attr("action","${ctx}/ModelManage/ModelMaintain/saveModelDataForm");
createForm.submit();
createForm.attr("action","#");
}
}
});
});
}
},
okValue: "确定",
cancel: function(){},
cancelValue: "取消",
});
}else{
$("#modelSubmit").attr("disabled",true);
var i = $("#addTr").find("tr").size();
if(i==0){
var createForm=$("#modelMaintainForm");
createForm.attr("action","${ctx}/ModelManage/ModelMaintain/saveModelDataForm");
createForm.submit();
createForm.attr("action","#");
}else{
$("#addTr").find("tr").each(function(){
//alert($(this).find("td").eq(0).html());
var paramName = $(this).find("td").eq(0).html();
var paramValue = $(this).find("td").eq(1).html();
var paramType = $(this).find("td").eq(2).html();
$.ajax({
type : "GET",
contentType : "application/json",
url: "${ctx}/ModelManage/ModelMaintain/createModelParam?paramName="+encodeURIComponent(paramName)+"&paramValue="+encodeURIComponent(paramValue)+"&paramType="+encodeURIComponent(paramType),
dataType : "text",
async: false,
beforeSend: function(data) {},
success: function(){
i--;
if(i==0){
var createForm=$("#modelMaintainForm");
createForm.attr("action","${ctx}/ModelManage/ModelMaintain/saveModelDataForm");
createForm.submit();
createForm.attr("action","#");
}
}
});
});
}
}
}
});
$("#modelBack").click(function(){
location.href="${ctx}/MonitorOperation/AssociateDiagosisConfiguration";
});
</script>
</body>
</html>
function initTable(){
jsonStr = document.getElementById('gzfxDetail').value;
// alert(jsonStr);
var header = new Array();
//provinceToArr();
header[0] = ["","<input type='radio' name='update'id='update' onclick='javascript:radioChoose(this);'/>","1%",""];
header[1] = ["指标名称","kpiId","10%",""];
header[2] = ["关联维度","AssociationType","10%","16"];
header[3] = ["指标权重","kpiWeight","5%",""];
header[4] = ["省份","provinceId","8%",""];
header[5] = ["关联描述","AssoicationDesc","8%",""];
window.pagging = new table_pagging({limit:11,tableId:'failureAnalysisDetailTable',header:header});
pagging.pagging(jsonStr);
}
//删除明细
function failureDelete(){
alert()
}
//将省份转换为 数组
function provinceToArr(){
var str=document.getElementById('provinceAll').value;
var jsonPro=eval('('+str+')');
var arrProvince=new Array();
for (var i=0;i<jsonPro.length;i++){
arrProvince[i+1]=jsonPro[i].provinceName;
}
return arrProvince;
}
// 将 指标转换为 数组
function indicatorsToArr(){
var str=document.getElementById('indicatorsAll').value;
var jsonPro=eval('('+str+')');
var arrProvince=new Array();
return arrProvince;
}
var table_pagging = function(){
this.init.apply(this, arguments);
}
table_pagging.prototype={
init:function(s){
//从第几个数据开始获取,缺省状态下从0开始显示
if(s.start){
this.start = parseInt(s.start);
}else{
this.start = 0;
}
//limit是指从start开始一共要用几条数据,缺省状态下显示10条
if(s.limit){
this.limit = parseInt(s.limit);
}else{
this.limit = 10;
}
//cellStep表示每行要显示的行数.缺省状态下为1,一行一条记录.
if(s.cellStep){
this.cellStep = parseInt(s.cellStep);
}else{
this.cellStep = 1;
}
//要执行的表的名字
if(s.tableId){
this.tableObj = document.getElementById(s.tableId);
}else{
alert("missing table id~");
}
//头部的样式编码
if(s.headTrClassName){
this.headTrClassName = s.headTrClassName;
}else{
this.headTrClassName = "";
}
if(s.trClassName){
this.trClassName = s.trClassName;
}else{
this.trClassName = "";
}
//定义头部信息
if(this.checkHeadersIsArray(s.header)){
this.header = s.header;
}else{
alert("header is wrong~");
}
//初始化头部
this.createTableHeader();
},
cloumnModel:function(){
}
,
pagging:function(objectJson){
this.objectlist = eval('('+objectJson+')');
if(this.start+this.limit >=this.objectlist.length){
this.end =this.objectlist.length;
}else{
this.end = this.start+this.limit;
}
this.clearSearchTable();
this.createTableBodyTd();
},
checkHeadersIsArray:function(header){
if(!(header instanceof Array)){
return false;
}
for(var i=0;i<header.length;i++){
if(!(header[i] instanceof Array) || header[i].length<4){
return false;
}
}
return true;
},
//清空表格数据
clearSearchTable:function(){
for(var i =this.tableObj.rows.length;i>1;i--){
this.tableObj.deleteRow(i-1);
}
},
//创建头部
createTableHeader:function(){
var tr = this.tableObj.insertRow(this.tableObj.rows.length);
if(this.headTrClassName){
tr.className = this.headTrClassName;
}
var rowLength = this.header.length;
for(var i=0;i<rowLength;i++){
var td = tr.insertCell(i);
td.innerHTML = this.header[i][0];
if(this.header[i][2]){
td.width=this.header[i][2];
}
}
},
//创建table的数据区域
createTableBodyTd:function(){
this.clearSearchTable();
if(this.start>this.objectlist.length){
return;
}
if(this.start>this.end){
return;
}
if(this.end>this.objectlist.length){
this.end = this.objectlist.length;
}
var rowLength = this.header.length;
for(var i=this.start;i<this.end;i++){
var tr = this.tableObj.insertRow(this.tableObj.rows.length);
if(this.trClassName){
tr.className= this.trClassName;
}
for(var j=0;j<this.cellStep;j++){
for(var k=0;k<rowLength;k++){
var td = tr.insertCell(rowLength*j+k);
var tdContext = "&nbsp;";
var tdTitle="";
if(this.header[k][1]){
var reg = /\%\{([\d\w.]+)\}\%/g;
if (k != 0) {
if (result = reg.exec(this.header[k][1])) {
// var result = reg.exec(this.header[k][1]);
var context = this.header[k][1];
while (reg.lastIndex != 0) {
var value = this.getData(
this.objectlist[i], result[1]);
context = context.replace(
/\%\{[\d\w.]+\}\%/, value);
result = reg.exec(this.header[k][1]);
}
tdContext = context;
} else {
if(k==1 ||k==3){
console.log(this.objectlist)
tdContext = this.getData(this.objectlist[i],this.header[k][1])
}else{
if(k==4){
tdContext=this.getProviceData(this.objectlist[i]["dimAssociationAnaInfo"],this.header[k][1])
}else{
tdContext=this.getData(this.objectlist[i]["dimAssociationAnaInfo"],this.header[k][1])
}
}
}
} else {
// tdContext="<input type='checkbox' name='failureBox"+i+"' class='failureBox' onclick='javascript:checkFailureIdsChoose(this);'/>"+"<span style='display:none'>"+i+"</span>";
// for ( var t = 0; t < checkFailureIds.length; t++) {
// if (checkFailureIds[t] == this.getData(this.objectlist[i], "failureId")){
// tdContext="<input type='checkbox' name='failureBox"+i+"' class='failureBox' checked onclick='javascript:checkFailureIdsChoose(this);'/>"+"<span style='display:none'>"+i+"</span>";
// break;
// }
// }
}
} else {
tdContext = "&nbsp;";
}
if(!tdTitle){
tdTitle = tdContext;
}
if(this.header[k][3] && !(tdContext == "&nbsp;")){
td.title = tdTitle;
tdContext = tdContext+"";
if(tdContext.length > parseInt(this.header[k][3])){
tdContext = tdContext.substring(0,this.header[k][3])+"..";
}
}
td.innerHTML=tdContext;
}
i = i+j;
if(i>=this.start+this.limit){
break;
}
}
if(i>=this.start+this.limit){
break;
}
}
this.createPageTr();
},
getProviceData: function (arrayObj,key){
var arrProvinc = provinceToArr();
if(key.indexOf(".")>0){
var keys = key.split(".");
var obj;
for(var c = 0;c<keys.length;c++){
if(c == keys.length-1){
return obj[keys[c]];
}
if(!arrayObj[keys[c]]){
return "&nbsp;"
}else{
obj = arrayObj[keys[c]]
}
}
}else{
return arrProvinc[arrayObj[key]];
}
},
//从json获取数据,其中key如果带有.这个符号,说明需要获取的数据是多维数组(也可以看成对象)
getData:function(arrayObj,key){
if(key.indexOf(".")>0){
var keys = key.split(".");
var obj;
for(var c = 0;c<keys.length;c++){
if(c == keys.length-1){
return obj[keys[c]];
}
if(!arrayObj[keys[c]]){
return "&nbsp;"
}else{
obj = arrayObj[keys[c]]
}
}
}else{
return arrayObj[key];
}
},
//格式化Date数据
formateDate:function(dateObj){
if(dateObj.month){
return parseInt(dateObj.month)+1+"-"+dateObj.date+" "+dateObj.hours+":"+dateObj.minutes+":"+dateObj.seconds;
}else{
return dateObj;
}
},
operator:function(_start,_end){
$("#ckAll").attr("checked",false);
this.start = _start;
this.end = _end;
this.createTableBodyTd();
},
//获取当前对象名
getObjectName:function(){
for(var a in window){
if(window[a]==this){
return a;
}
}
},
// 创建尾部,上一页,下一页,当前页之类信息
createPageTr : function() {
var objectName = this.getObjectName();
var tr = this.tableObj.insertRow(this.tableObj.rows.length);
td = tr.insertCell(0);
td.colSpan = this.header.length + '';
var totalPage = Math.ceil(this.objectlist.length / this.limit);
var currentPage = Math.ceil(this.start / this.limit);
var tableName = objectName + "assrotCurrentIndexTable";
td.innerHTML = "<table id='" + tableName + "' width='100%'></table>";
var tableObj = document.getElementById(tableName);
var tr = tableObj.insertRow(0);
var td1 = tr.insertCell(0);
td1.width = "15%";
td1.align = "center";
if (this.start >= this.limit) {
td1.innerHTML = "<a href='javascript:" + objectName
+ ".operator(0," + this.limit + ")'>首页</a>";
} else {
td1.innerHTML = "<a>首页</a>";
}
var td2 = tr.insertCell(1);
td2.width = "15%";
td2.align = "center";
if (this.start >= this.limit) {
td2.innerHTML = "<a href='javascript:" + objectName + ".operator("
+ (this.start - this.limit) + "," + this.start
+ ")'>上一页</a>";
} else {
td2.innerHTML = "<a>上一页</a>";
}
var td3 = tr.insertCell(2);
td3.width = "20%";
td3.align = "center";
// td3.innerHTML = "Page <input id='table_pagging_page_input_id'
// type='text' size='1' id='currentIndex' value='"+(currentPage+1)+"'
// >of&nbsp;"+totalPage;
td3.innerHTML = "<div class='col-sm-5'><input type=\"text\" class=\"form-control\" id=\"goPageNo\" value=\""
+ (currentPage + 1)
+ "\" size=\"3\" /></div><div class='col-sm-5' style='margin:0 -28px'><input type=\"button\" class=\"form-control\" value=\"跳转\" onclick=\"javascript:"
+ objectName + ".jump2PageNum()\" /></div>";
var td4 = tr.insertCell(3);
td4.width = "15%";
td4.align = "center";
if (this.end >= this.objectlist.length) {
td4.innerHTML = "<a>下一页<a>";
} else {
if ((this.end + this.limit) > this.objectlist.length) {
td4.innerHTML = "<a href='javascript:" + objectName
+ ".operator(" + this.end + ","
+ this.objectlist.length + ")'>下一页<a>";
} else {
td4.innerHTML = "<a href='javascript:" + objectName
+ ".operator(" + this.end + ","
+ (this.end + this.limit) + ")'>下一页<a>";
}
}
var td5 = tr.insertCell(4);
td5.width = "15%";
td5.align = "center";
if (this.end >= this.objectlist.length) {
td5.innerHTML = "<a>末页</a>";
} else {
td5.innerHTML = "<a href='javascript:" + objectName + ".operator("
+ this.limit * (totalPage - 1) + ","
+ this.objectlist.length + ")'>末页</a>";
}
var td6 = tr.insertCell(5);
td6.align = 'right';
td6.width = "25%";
// td6.innerHTML =
// "显示第"+this.start+"到第"+this.end+"记录,共"+this.objectlist.length+"条记录";
td6.innerHTML = "页数:<span style='color:blue'>" + (currentPage + 1)
+ "</span>/" + totalPage;
},
// 点击跳转,未开发
jump2PageNum : function() {
var re = /^[1-9]+[0-9]*]*$/;
if (!re.test(document.getElementById('goPageNo').value)) {
alert("请输入正整数");
} else {
if (parseInt(document.getElementById('goPageNo').value) > Math
.ceil(this.objectlist.length / this.limit)) {
alert("你输入的数值过大!");
} else {
this
.operator(
this.limit
* (parseInt(document
.getElementById('goPageNo').value) - 1),
(this.limit
* (parseInt(document
.getElementById('goPageNo').value) - 1) + this.limit));
}
}
},
test : function() {
alert(this.start);
alert(this.step);
alert(this.cellStep), alert(this.tablename)
}
}
function initTable(){
jsonStr = document.getElementById('gzfxDetail').value;
var header = new Array();
header[0] = ["<input type='checkbox' name='ckAll' id='ckAll' class='ckAll' onclick='javascript:checkAll();'/>","checkbox","1%",""];
header[1] = ["开始时间","failureId","10%",""];
header[2] = ["结束时间","failureTitle","10%","16"];
header[3] = ["省份","provinceName","5%",""];
header[4] = ["类型","channelName","8%",""];
header[5] = ["名称告警个数","dataSourceName","8%",""];
header[6] = ["异常种类","warningSourceName","8%",""];
header[7] = ["商标告警明细","providerName","8%",""];
/*header[8] = ["发生时间","happenTime","10%",""];
header[9] = ["结束时间","closeTime","10%",""];
header[10] = ["详细原因","failureReason","14%","20"];
header[11] = ["解决方案","resolution","14%","20"];*/
window.pagging = new table_pagging({limit:11,tableId:'failureAnalysisDetailTable',header:header});
pagging.pagging(jsonStr);
}
//删除明细
function failureDelete(){
alert()
}
var table_pagging = function(){
this.init.apply(this, arguments);
}
table_pagging.prototype={
init:function(s){
//从第几个数据开始获取,缺省状态下从0开始显示
if(s.start){
this.start = parseInt(s.start);
}else{
this.start = 0;
}
//limit是指从start开始一共要用几条数据,缺省状态下显示10条
if(s.limit){
this.limit = parseInt(s.limit);
}else{
this.limit = 10;
}
//cellStep表示每行要显示的行数.缺省状态下为1,一行一条记录.
if(s.cellStep){
this.cellStep = parseInt(s.cellStep);
}else{
this.cellStep = 1;
}
//要执行的表的名字
if(s.tableId){
this.tableObj = document.getElementById(s.tableId);
}else{
alert("missing table id~");
}
//头部的样式编码
if(s.headTrClassName){
this.headTrClassName = s.headTrClassName;
}else{
this.headTrClassName = "";
}
if(s.trClassName){
this.trClassName = s.trClassName;
}else{
this.trClassName = "";
}
//定义头部信息
if(this.checkHeadersIsArray(s.header)){
this.header = s.header;
}else{
alert("header is wrong~");
}
//初始化头部
this.createTableHeader();
},
cloumnModel:function(){
}
,
pagging:function(objectJson){
this.objectlist = eval('('+objectJson+')');
if(this.start+this.limit >=this.objectlist.length){
this.end =this.objectlist.length;
}else{
this.end = this.start+this.limit;
}
this.clearSearchTable();
this.createTableBodyTd();
},
checkHeadersIsArray:function(header){
if(!(header instanceof Array)){
return false;
}
for(var i=0;i<header.length;i++){
if(!(header[i] instanceof Array) || header[i].length<4){
return false;
}
}
return true;
},
//清空表格数据
clearSearchTable:function(){
for(var i =this.tableObj.rows.length;i>1;i--){
this.tableObj.deleteRow(i-1);
}
},
//创建头部
createTableHeader:function(){
var tr = this.tableObj.insertRow(this.tableObj.rows.length);
if(this.headTrClassName){
tr.className = this.headTrClassName;
}
var rowLength = this.header.length;
for(var i=0;i<rowLength;i++){
var td = tr.insertCell(i);
td.innerHTML = this.header[i][0];
if(this.header[i][2]){
td.width=this.header[i][2];
}
}
},
//创建table的数据区域
createTableBodyTd:function(){
this.clearSearchTable();
if(this.start>this.objectlist.length){
return;
}
if(this.start>this.end){
return;
}
if(this.end>this.objectlist.length){
this.end = this.objectlist.length;
}
var rowLength = this.header.length;
for(var i=this.start;i<this.end;i++){
var tr = this.tableObj.insertRow(this.tableObj.rows.length);
if(this.trClassName){
tr.className= this.trClassName;
}
for(var j=0;j<this.cellStep;j++){
for(var k=0;k<rowLength;k++){
var td = tr.insertCell(rowLength*j+k);
var tdContext = "&nbsp;";
var tdTitle="";
if(this.header[k][1]){
var reg = /\%\{([\d\w.]+)\}\%/g;
if (k != 0) {
if (result = reg.exec(this.header[k][1])) {
// var result = reg.exec(this.header[k][1]);
var context = this.header[k][1];
while (reg.lastIndex != 0) {
var value = this.getData(
this.objectlist[i], result[1]);
context = context.replace(
/\%\{[\d\w.]+\}\%/, value);
result = reg.exec(this.header[k][1]);
}
tdContext = context;
} else {
tdContext = this.getData(this.objectlist[i],this.header[k][1]);
if(tdContext==null){
tdContext = "&nbsp;";
}
if(k==1){
tdContext="<a href='javascript:openDialog("+this.getData(this.objectlist[i],"failureId")+")' alt='"+i+"'>"+this.getData(this.objectlist[i],this.header[k][1])+"</a>";
}
if(k==8){
if(tdContext=="&nbsp;"){
tdContext = "&nbsp;";
}else{
tdContext = df.format(new Date(tdContext));
}
}else if(k==9){
if(tdContext=="&nbsp;"){
tdContext = "&nbsp;";
}else{
tdContext = df.format(new Date(tdContext));
}
}
}
} else {
tdContext="<input type='checkbox' name='failureBox"+i+"' class='failureBox' onclick='javascript:checkFailureIdsChoose(this);'/>"+"<span style='display:none'>"+i+"</span>";
for ( var t = 0; t < checkFailureIds.length; t++) {
if (checkFailureIds[t] == this.getData(this.objectlist[i], "failureId")){
tdContext="<input type='checkbox' name='failureBox"+i+"' class='failureBox' checked onclick='javascript:checkFailureIdsChoose(this);'/>"+"<span style='display:none'>"+i+"</span>";
break;
}
}
}
} else {
tdContext = "&nbsp;";
}
if(!tdTitle){
tdTitle = tdContext;
}
if(this.header[k][3] && !(tdContext == "&nbsp;")){
td.title = tdTitle;
tdContext = tdContext+"";
if(tdContext.length > parseInt(this.header[k][3])){
tdContext = tdContext.substring(0,this.header[k][3])+"..";
}
}
td.innerHTML=tdContext;
}
i = i+j;
if(i>=this.start+this.limit){
break;
}
}
if(i>=this.start+this.limit){
break;
}
}
this.createPageTr();
},
//从json获取数据,其中key如果带有.这个符号,说明需要获取的数据是多维数组(也可以看成对象)
getData:function(arrayObj,key){
if(key.indexOf(".")>0){
var keys = key.split(".");
var obj;
for(var c = 0;c<keys.length;c++){
if(c == keys.length-1){
return obj[keys[c]];
}
if(!arrayObj[keys[c]]){
return "&nbsp;"
}else{
obj = arrayObj[keys[c]]
}
}
}else{
return arrayObj[key];
}
},
//格式化Date数据
formateDate:function(dateObj){
if(dateObj.month){
return parseInt(dateObj.month)+1+"-"+dateObj.date+" "+dateObj.hours+":"+dateObj.minutes+":"+dateObj.seconds;
}else{
return dateObj;
}
},
operator:function(_start,_end){
$("#ckAll").attr("checked",false);
this.start = _start;
this.end = _end;
this.createTableBodyTd();
},
//获取当前对象名
getObjectName:function(){
for(var a in window){
if(window[a]==this){
return a;
}
}
},
// 创建尾部,上一页,下一页,当前页之类信息
createPageTr : function() {
var objectName = this.getObjectName();
var tr = this.tableObj.insertRow(this.tableObj.rows.length);
td = tr.insertCell(0);
td.colSpan = this.header.length + '';
var totalPage = Math.ceil(this.objectlist.length / this.limit);
var currentPage = Math.ceil(this.start / this.limit);
var tableName = objectName + "assrotCurrentIndexTable";
td.innerHTML = "<table id='" + tableName + "' width='100%'></table>";
var tableObj = document.getElementById(tableName);
var tr = tableObj.insertRow(0);
var td1 = tr.insertCell(0);
td1.width = "15%";
td1.align = "center";
if (this.start >= this.limit) {
td1.innerHTML = "<a href='javascript:" + objectName
+ ".operator(0," + this.limit + ")'>首页</a>";
} else {
td1.innerHTML = "<a>首页</a>";
}
var td2 = tr.insertCell(1);
td2.width = "15%";
td2.align = "center";
if (this.start >= this.limit) {
td2.innerHTML = "<a href='javascript:" + objectName + ".operator("
+ (this.start - this.limit) + "," + this.start
+ ")'>上一页</a>";
} else {
td2.innerHTML = "<a>上一页</a>";
}
var td3 = tr.insertCell(2);
td3.width = "20%";
td3.align = "center";
// td3.innerHTML = "Page <input id='table_pagging_page_input_id'
// type='text' size='1' id='currentIndex' value='"+(currentPage+1)+"'
// >of&nbsp;"+totalPage;
td3.innerHTML = "<div class='col-sm-5'><input type=\"text\" class=\"form-control\" id=\"goPageNo\" value=\""
+ (currentPage + 1)
+ "\" size=\"3\" /></div><div class='col-sm-5' style='margin:0 -28px'><input type=\"button\" class=\"form-control\" value=\"跳转\" onclick=\"javascript:"
+ objectName + ".jump2PageNum()\" /></div>";
var td4 = tr.insertCell(3);
td4.width = "15%";
td4.align = "center";
if (this.end >= this.objectlist.length) {
td4.innerHTML = "<a>下一页<a>";
} else {
if ((this.end + this.limit) > this.objectlist.length) {
td4.innerHTML = "<a href='javascript:" + objectName
+ ".operator(" + this.end + ","
+ this.objectlist.length + ")'>下一页<a>";
} else {
td4.innerHTML = "<a href='javascript:" + objectName
+ ".operator(" + this.end + ","
+ (this.end + this.limit) + ")'>下一页<a>";
}
}
var td5 = tr.insertCell(4);
td5.width = "15%";
td5.align = "center";
if (this.end >= this.objectlist.length) {
td5.innerHTML = "<a>末页</a>";
} else {
td5.innerHTML = "<a href='javascript:" + objectName + ".operator("
+ this.limit * (totalPage - 1) + ","
+ this.objectlist.length + ")'>末页</a>";
}
var td6 = tr.insertCell(5);
td6.align = 'right';
td6.width = "25%";
// td6.innerHTML =
// "显示第"+this.start+"到第"+this.end+"记录,共"+this.objectlist.length+"条记录";
td6.innerHTML = "页数:<span style='color:blue'>" + (currentPage + 1)
+ "</span>/" + totalPage;
},
// 点击跳转,未开发
jump2PageNum : function() {
var re = /^[1-9]+[0-9]*]*$/;
if (!re.test(document.getElementById('goPageNo').value)) {
alert("请输入正整数");
} else {
if (parseInt(document.getElementById('goPageNo').value) > Math
.ceil(this.objectlist.length / this.limit)) {
alert("你输入的数值过大!");
} else {
this
.operator(
this.limit
* (parseInt(document
.getElementById('goPageNo').value) - 1),
(this.limit
* (parseInt(document
.getElementById('goPageNo').value) - 1) + this.limit));
}
}
},
test : function() {
alert(this.start);
alert(this.step);
alert(this.cellStep), alert(this.tablename)
}
}
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