import { layuiObj, yearTimeList, boroughList, schoolBasicInfo, currenYearNewTime } from "./index.js"; import { getStationStarRatingHistory } from "./orgApi/getStationStarRatingHistory.js"; import { drawSchoolYearScopeChart } from "./drawEchart.js"; import { getStartLevelText } from "./leftPage.js"; import { getStationStarDetail } from "./orgApi/getStationStarDetail.js"; import { showSchoolInScopePopPage, showSchoolOutScopePopPage, showHiddenRectifPopPage, showLegalEducationPopPage, showEmergencyResponsePopPage } from "./pop/starRatingDetail.js"; import { showSchoolSignature } from "./pop/schoolSignature.js"; let currentStation=""; let currentTime=""; let currentBorough=""; let schoolScopeList=[]; function initSchoolSelect(){ $("#mainContentC_boroughSelect").html(createBoroughOptions()); $("#mainContentC_schoolSelect").html(starRatingSelectOptions()); $("#mainContentC_school_time").html(getYearOption()); layuiObj.layuiForm.render("select","mainContentC_schoolForm"); boroughOptionsChange(); $("#mainContentC_schoolSelect").siblings("div.layui-form-select").find("div.layui-select-title").find("input").attr("onfocus","this.select()"); $("#mainContentC_school_time").siblings("div.layui-form-select").find("div.layui-select-title").find("input").attr("onfocus","this.select()"); $("#schoolLevelHistory_time").html(getYearOption()); layuiObj.layuiForm.render("select","schoolLevelHistoryForm"); $("#schoolLevelHistory_time").siblings("div.layui-form-select").find("div.layui-select-title").find("input").attr("onfocus","this.select()"); addThreeColorSelectBtn(); getStationStarRatingData(); } function createBoroughOptions(){ var options=``; for(var i=0;i${remark}`; }else{ options+=``; } } return options; } function addThreeColorSelectBtn(){ $(".selectThreeColorBtn").on('click',function(){ currentStation=$("#mainContentC_schoolSelect").find("option:selected").val(); currentTime=$("#mainContentC_school_time").find("option:selected").val(); getStationStarRatingData(); }) } function boroughOptionsChange(){ layuiObj.layuiForm.on('select(mainContentC_boroughSelect)', function(data){ currentBorough=data["value"]; $("#mainContentC_schoolSelect").html(starRatingSelectOptions()); layuiObj.layuiForm.render("select","mainContentC_schoolForm"); }) } function getStationStarRatingData(){ getStationStarRatingHistory(currentStation).then(res=>{ var code=res["data"]["code"]; if(code==0){ var data=res["data"]["data"]; for(var i=0;i

${currentStation}

评分

得分:${scoreTotal}分

星级

${getStartLevelText(scoreTotal)}

评估时间

${timestamp}

`; var school_level_div=`

评分指标

当前学校: ${currentStation}

  • 校园安全

    ${scoreInsideManage}/20

  • 周边安全

    ${scoreOutsideManage}/20

  • 隐患整改

    ${scoreRiskManage}/25

  • 法制宣传

    ${scoreLawEducation}/15

  • 应急处置

    ${scoreEmcManage}/20

`; $(".mainContentC_school_logo").html(school_Info_div) $(".mainContentC_school_center").html(school_level_div) } } addSchoolColorRatingEvent(); } function addSchoolColorRatingEvent(){ $(".colorDetailContent>li").on('click',function(){ var name=$(this).attr("name"); getStationStarDetail(currentStation,currentTime).then(res=>{ var code=res["data"]["code"]; if(code==0){ var obj=res["data"]["data"]; obj["inResponsibility"]=obj["inResponsibility"]/10; obj["inTeamBuild"]=obj["inTeamBuild"]/10; obj["inDevicesSetup"]=obj["inDevicesSetup"]/10; obj["inFireManage"]=obj["inFireManage"]/10; obj["inDangerousManage"]=obj["inDangerousManage"]/10; obj["inSmartSecurity"]=obj["inSmartSecurity"]/10; obj["inSecurityScheme"]=obj["inSecurityScheme"]/10; obj["outPeakGuard"]=obj["outPeakGuard"]/10; obj["outRiskPrevent"]=obj["outRiskPrevent"]/10; obj["outTraffic"]=obj["outTraffic"]/10; obj["outCaseManage"]=obj["outCaseManage"]/10; obj["riskDangerManage"]=obj["riskDangerManage"]/10; obj["riskConflictManage"]=obj["riskConflictManage"]/10; obj["riskProcess"]=obj["riskProcess"]/10; obj["lawEducation"]=obj["lawEducation"]/10; obj["lawFirstClass"]=obj["lawFirstClass"]/10; obj["emcPlan"]=obj["emcPlan"]/10; obj["emcDrill"]=obj["emcDrill"]/10; obj["bonus1"]=obj["bonus1"]/10; obj["bonus2"]=obj["bonus2"]/10; obj["bonus3"]=obj["bonus3"]/10; obj["bonus4"]=obj["bonus4"]/10; obj["bonus5"]=obj["bonus5"]/10; switch(name){ case "scoreInsideManage"://校园安全 showSchoolInScopePopPage(obj); break; case "scoreOutsideManage"://周边安全 showSchoolOutScopePopPage(obj) break; case "scoreRiskManage"://隐患整改 showHiddenRectifPopPage(obj) break; case "scoreLawEducation"://法制宣传 showLegalEducationPopPage(obj) break; case "scoreEmcManage"://应急处置 showEmergencyResponsePopPage(obj) break; default: break; } }else{ layer.msg("接口异常"); } }) }) //显示签名 $(".schoolSignature").on('click',function(){ getStationStarDetail(currentStation,currentTime).then(res=>{ var code=res["data"]["code"]; if(code==0){ var obj=res["data"]["data"]; //学校 var signatureImage=obj["signatureImage"]; //派出所 var signatureImageSchool=obj["signatureImageSchool"]; var flag=0; if(signatureImage!=null){ flag++; } if(signatureImageSchool!=null){ flag++ } if(flag!=0){ showSchoolSignature(currentStation,currentTime,signatureImage,signatureImageSchool) }else{ layer.msg("未提供签名"); } } }) }) } function drawSchoolYearScope(){ var valueData=[]; var timeData=getYearTime(); for(var i=0;i${name}`; } } return options; } function getYearTime(){ var arr=[]; for(var i=0;i${yearList[i]}` }else{ options+=`` } } return options; } export { initSchoolSelect, schoolScopeList, getYearOption }