123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437 |
- <link href="/css/base.css" rel="stylesheet">
- <link rel="stylesheet" type="text/css" href="/css/jquery.datetimepicker.css" />
- <script src="/js/jquery.validate.min.js"></script>
- <style>
- body{
- position: initial;
- }
- .screen{
- margin: 0 30px;
- font-size: 16px;
- color: #666666;
- }
- .screen-rows{
- margin: 20px 0;
- line-height: 30px;
- /*overflow: hidden;*/
- }
- .screen-rows-title{
- line-height: 25px;
- font-size: 18px;
- color: #333;
- }
- .subject{
- margin-right: 50px;
- }
- .subject>select, .grade>select{
- width: 120px;
- height: 30px;
- }
- .go-back{
- font-size: 16px;
- border: none;
- color: #2977ff;
- outline: none;
- background: #fff;
- cursor: pointer;
- }
- .teaching-class{
- display: flex;
- }
- .active-class-box{
- /*display: flex;*/
- padding: 5px;
- background: #F8F8F8;
- }
- #classSelected{
- margin: 5px;
- }
- .active-class{
- margin: 5px;
- padding: 0 20px;
- border: 1px solid #2977ff;
- border-radius: 2px;
- }
- .add-active-class{
- margin: 5px;
- font-size: 16px;
- color: #2977ff;
- cursor: pointer;
- }
- .add-active-class>img{
- display: inline-block;
- width: 18px;
- height: 18px;
- vertical-align: middle;
- margin-right: 2px;
- }
- .btn-delete, .btn-delete-chapter {
- display: inline-block;
- margin-left: 10px;
- font-size: 14px;
- color: red;
- cursor: pointer;
- }
- .screen .date input {
- height: 30px;
- border-radius: 4px;
- border: 1px solid #ccc;
- box-shadow: none;
- text-indent: 10px;
- }
- .look-history{
- width: 120px;
- line-height: 30px;
- border: 1px solid #2977ff;
- color: #2977ff;
- outline: none;
- background: #fff;
- cursor: pointer;
- }
- .screen-msg{
- font-size: 14px;
- color: #2977ff;
- }
- .img-add-versions{
- margin-left: 10px;
- vertical-align:middle;
- cursor: pointer;
- }
- .chapter-box-wrap{
- width: 100%;
- border: 1px solid #333;
- padding: 10px;
- overflow-x: auto;
- overflow-y: hidden;
- }
- .chapter-box{
- display: inline-flex;
- overflow-x: auto;
- overflow-y: hidden;
- }
- .chapter{
- margin: 5px;
- padding: 10px;
- width: 20px;
- height: 380px;
- line-height: 30px;
- color: #fff;
- font-size: 22px;
- text-align: center;
- box-sizing: content-box !important;
- -moz-box-sizing: content-box;
- -webkit-box-sizing: content-box;
- -o-box-sizing: content-box;
- -ms-box-sizing: content-box;
- word-break: break-all;
- }
- .chapter-box .type-versions{
- background-color: #52596A;;
- }
- .chapter-box .type-chapter{
- background-color: #747E9A;
- }
- .chapter-box .type-knowledge{
- background-color: #99B7D6;
- }
- .chapter:hover{
- background-color: #f2988f;
- cursor: pointer;
- }
- .chapter-box .active{
- background-color: #f2988f;
- }
- .active-chapter-box{
- /*display: flex;*/
- padding: 10px;
- }
- .active-chapter{
- float:left;
- margin-right: 10px;
- margin-bottom: 10px;
- padding: 0 20px;
- border: 1px solid #619aff;
- }
- .btn-box{
- padding: 10px 0;
- /*border-top: 1px solid #dcdcdc;
- border-bottom:1px solid #dcdcdc;*/
- text-align: center;
- }
- .generating-teaching-schedule{
- padding: 6px 12px;
- line-height: 30px;
- border: 1px solid #2977ff;
- border-radius: 5px;
- font-size: 14px;
- color: #fff;
- background: #2977ff;
- outline: none;
- cursor: pointer;
- }
- .bottom-msg{
- text-indent: 2em;
- font-size: 14px;
- color: #999;
- }
- .layer-add-class{
- position: relative;
- display: none;
- width: 740px;
- height: 460px;
- font-size: 16px;
- line-height: 30px;
- }
- .class-type-box{
- height: 400px;
- overflow: auto;
- }
- .class-type{
- margin: 20px 10px;
- overflow: hidden;
- }
- .class-type-title >span{
- font-size: 16px;
- color: #619aff;
- }
- .class-type-title >label{
- font-size: 16px;
- color: #333333;
- }
- .class-type-checkbox{
- font-size: 14px;
- color: #333333;
- }
- .class-type-checkbox label{
- position: relative;
- display: inline-block;
- width: 100px;
- margin-right: 10px;
- overflow: hidden;
- text-overflow:ellipsis;
- white-space: nowrap;
- }
- .classTextbookVersions{
- display: inline-block;
- position: absolute;
- left: 0;
- top: -200px;
- }
- .layer-add-class label{
- cursor: pointer;
- }
- .layer-add-class input[type='checkbox']{
- width: 16px;
- height: 16px;
- vertical-align: sub;
- }
- .layer-err-msg{
- display: none;
- color: red;
- text-align: center;
- }
- .button-btn-box{
- position: absolute;
- bottom: 0;
- width: 100%;
- height: 45px;
- line-height: 45px;
- text-align: center;
- border-top: 1px solid #dcdcdc;
- /*border-bottom: 1px solid #dcdcdc;*/
- }
- .button-btn-box button{
- width: 88px;
- line-height: 30px;
- border-radius: 3px;
- outline: none;
- cursor: pointer;
- }
- .layer-btn-add-class{
- color: #fff;
- background-color: #619aff;
- border: 1px solid #619aff;
- }
- .layer-btn-cancel-class{
- color: #333;
- background-color: #fff;
- border: 1px solid #333;
- }
- .btn-box-show-2{
- display: none;
- }
- .layer-choice-teaching-material-type{
- position: relative;
- display: none;
- width: 478px;
- height: 200px;
- color: #717171;
- text-align: center;
- }
- .layer-teaching-material-type-title{
- margin-bottom: 20px;
- color: #333;
- font-size: 16px;
- }
- .layer-choice-teaching-material-type p{
- line-height: 22px;
- color: #333;
- font-size: 16px;
- }
- .layer-teaching-material-type-btn-box{
- position: absolute;
- bottom: 0;
- width: 100%;
- /*margin-top: 20px;
- margin-bottom: 20px;*/
- }
- .step-tips{
- margin-top: 20px;
- }
- .step-tips .line{
- display: inline-block;
- width: 30px;
- /*margin: 10px;*/
- border-bottom: 1px solid #619aff;
- vertical-align: middle
- }
- .layer-teaching-material-type-btn-box button{
- width: 88px;
- line-height: 30px;
- color: #619aff;
- background-color: #fff;
- border: 1px solid #619aff;
- border-radius: 3px;
- outline: none;
- cursor: pointer;
- }
- #btnLayerStepThreeCancel{
- color: #dcdcdc;
- border: 1px solid #dcdcdc;
- }
- .teaching-material-type-box{
- height: 72px;
- overflow: auto;
- }
- .teaching-material-type-box button{
- margin: 5px;
- width: 80px;
- line-height: 26px;
- color: #999;
- background-color: #fff;
- border: 1px solid #999;
- border-radius: 3px;
- outline: none;
- cursor: pointer;
- }
- .btn-teaching-material-type.active{
- color: #fff;
- background: #619aff;
- border-radius: 2px;
- border: 1px solid #619aff;
- }
- .layer-choice-teaching-material-type .step-2{
- display: none;
- }
- .layer-choice-teaching-material-type .step-3{
- display: none;
- }
- .confirm-layer-box{
- margin: 20px;
- line-height: 20px;
- text-align: center;
- }
- .layui-layer-btn .layui-layer-btn0{
- border-color: #619aff !important ;
- background-color: #619aff!important;
- }
- .chapter-msg{
- width: 100%;
- text-align: center;
- font-size: 40px;
- color: #2977ff;
- line-height: 394px;
- }
- .secher-versions-box{
- position: absolute;
- right: 10px;
- width: 290px;
- height: 34px;
- border: 1px solid #ddd;
- border-radius: 17px;
- }
- .input-search-versions-text{
- width: 216px;
- margin-left: 20px;
- line-height: 32px;
- font-size: 16px;
- color: #666;
- border: none;
- outline: none!important;
- }
- input:focus {
- outline: none;
- border: none;}
- .btn-search-versions{
- font-size: 16px;
- color: #2977ff;
- border: none;
- outline: none;
- background: #fff;
- cursor: pointer;
- }
- .layui-layer-title{
- background-color:#619aff!important;
- color: #fff!important;
- border-bottom:none!important;
- font-size:18px;
- }
- .layer-btn-teaching-material-type {
- background-color:#619aff!important;
- color: #fff!important;
- }
- </style>
- <div class="teaching-progress">
- <div class="screen">
- <form action="">
- <div class="screen-rows clearfix">
- <div class="subject fl">
- <span class="screen-rows-title">科目:</span>
- <select name="select-subject">
- <option value="3" <?php echo $subjectId == 3?"selected='selected'":'';?>>数学</option>
- <option value="8" <?php echo $subjectId == 8?"selected='selected'":'';?>>英语</option>
- </select>
- </div>
- <div class="grade fl">
- <span class="screen-rows-title">年级:</span>
- <select name="select-grade">
- <option value="1" <?php echo $grade == 1?"selected='selected'":'';?>>高一</option>
- <option value="2" <?php echo $grade == 2?"selected='selected'":'';?>>高二</option>
- <option value="3" <?php echo $grade == 3?"selected='selected'":'';?>>高三</option>
- </select>
- </div>
- <?php if($edit):?>
- <button type="button" class="go-back fr" id="goBack" onclick='location.href="<?php echo $this->createUrl("classes/viewHistoryProgress");?>"'>返回</button>
- <?php else:?>
- <button type="button" class="go-back fr" id="goBack" onclick='location.href="<?php echo $this->createUrl("classes/index");?>"'>返回</button>
- <?php endif;?>
- </div>
- <div class="screen-rows clearfix">
- <div class="teaching-class fl">
- <span class="screen-rows-title">班级(已选<i id="classSelectedLength"><?php echo $edit ==1?1:0;?></i>):</span>
- </div>
- <button type="button" class="look-history fr" id="lookHistory">查看历史</button>
- </div>
- <div class="screen-rows">
- <div class="active-class-box">
- <!--<span id="classSelected"></span>-->
- <!-- <span class="active-class">高一1班<i class="btn-delete" >X</i></span>
- <span class="active-class">高一2班</span>
- <span class="active-class">高一3班</span>
- <span class="active-class">高一4班</span> -->
- <?php if($edit ==1):?>
- <span class="active-class"><?php echo $className;?><i class="btn-delete" value="<?php echo $classId;?>">X</i></span>;
- <?php endif;?>
- <span class="add-active-class">
- <img src="/images/add-active-class.png" alt="">
- <span>添加班级</span>
- </span>
- </div>
- </div>
- <div class="screen-rows">
- <div class="date">
- <span class="screen-rows-title">时间:</span>
- <input type="text" class="some_class" value="" id="some_class_1" /> --
- <input type="text" class="some_class" value="" id="some_class_2" />
- <span class="screen-msg">(温馨提示:请严格按照校方教学进度时间设置)</span>
- </div>
- </div>
- <div class="screen-rows">
- <div class="versions">
- <span class="screen-rows-title">教材版本:</span>
- <?php if($edit == 1):?>
- <span class="select-textbook" textbookId="<?php echo $textbookId;?>" textbookName="<?php echo $textbook_name;?>"><?php echo $textbook_name;?></span>
- <?php else:?>
- <span class="select-textbook">— —</span>
- <?php endif;?>
- <img src="/images/img-add-versions-1.png" class="img-add-versions" alt="">
- <span class="secher-versions-box">
- <input type="text" class="input-search-versions-text" placeholder="请输入章节关键字检索">
- <button type="button" class="btn-search-versions" id="btnSearchVersions">搜索</button>
- </span>
- </div>
- </div>
- <div class="screen-rows section-content">
- <div class="chapter-box-wrap">
- <p class="chapter-msg">请选择教材版本,再设置教学进度</p>
- <div class="chapter-box">
- </div>
- </div>
- </div>
- <div class="screen-rows clearfix">
- <span class="screen-rows-title">已选内容:</span>
- <div class="active-chapter-box clearfix">
- <!-- <span class="active-chapter">函数<i class="btn-delete-chapter" >X</i></span>
- <span class="active-chapter">函数</span>
- <span class="active-chapter">函数</span> -->
- </div>
- </div>
- </form>
- </div>
- <div class="btn-box">
- <button type="button" class="generating-teaching-schedule" id="generatingTeachingSchedule" active="true">生成教学进度</button>
- </div>
- <!-- <div class="bottom-msg">
- <span>所属学校:史莱克</span>
- </div> -->
- <!-- 选择班级弹窗 开始 -->
- <div class="layer-add-class">
- <p class="layer-err-msg"><img src="/images/icon-warning-red.png" alt=""> 已选班级使用的教材版本不一致,是否继续?</p>
- <div class="button-btn-box">
- <div class="btn-box-show-1">
- <button type="button" class="layer-btn-add-class " id="btnLayerAddClassOne">确定</button>
- </div>
- <div class="btn-box-show-2">
- <button type="button" class="layer-btn-add-class " id="btnLayerAddClassTwo">继续</button>
- <button type="button" class="layer-btn-cancel-class " id="btnLayerCancelClass">取消</button>
- </div>
- </div>
- </div>
- <!-- 选择班级弹窗 结束 -->
- <!-- 选择教材弹窗 开始 -->
- <div class="layer-choice-teaching-material-type">
- <p class="layer-teaching-material-type-title">提示</p>
- <div class="step-1">
- <p>请确保选择正确的教材</p>
- <p>若修改教材将重置教学进度</p>
- <div class="step-tips">
- <img src="/images/step-tips-completed.png" alt="">
- <i class="line"></i>
- <img src="/images/step-tips-unfinished.png" alt="">
- <i class="line"></i>
- <img src="/images/step-tips-unfinished.png" alt="">
- </div>
- <div class="layer-teaching-material-type-btn-box">
- <button type="button" class="layer-btn-teaching-material-type " id="btnLayerStepOne">下一步</button>
- </div>
- </div>
- <div class="step-2">
- <div class="teaching-material-type-box">
- <?php if(isset($textbookName) && $textbookName):?>
- <?php $i = 1;?>
- <?php foreach($textbookName as $k=>$v):?>
- <button type="button" class="btn-teaching-material-type" textbookId="<?php echo $k;?>"><?php echo $v;?></button>
- <?php $i++;?>
- <?php endforeach;?>
- <?php endif;?>
- </div>
- <div class="step-tips">
- <img src="/images/step-tips-completed.png" alt="">
- <i class="line"></i>
- <img src="/images/step-tips-completed.png" alt="">
- <i class="line"></i>
- <img src="/images/step-tips-unfinished.png" alt="">
- </div>
- <div class="layer-teaching-material-type-btn-box">
- <button type="button" class="layer-btn-teaching-material-type " id="btnLayerStepTwo">下一步</button>
- </div>
- </div>
- <div class="step-3">
- <p>当前选择为:<span class="text-no-now"></span></p>
- <p>请再次确认是否修改版本</p>
- <div class="step-tips">
- <img src="/images/step-tips-completed.png" alt="">
- <i class="line"></i>
- <img src="/images/step-tips-completed.png" alt="">
- <i class="line"></i>
- <img src="/images/step-tips-completed.png" alt="">
- </div>
- <div class="layer-teaching-material-type-btn-box">
- <button type="button" class="layer-btn-teaching-material-type " id="btnLayerStepThreeConfirm">确认</button>
- <button type="button" class="layer-btn-teaching-material-type " id="btnLayerStepThreeCancel">取消</button>
- </div>
- </div>
- </div>
- <!-- 选择教材弹窗 结束 -->·
- </div>
- <script src="/js/jquery.datetimepicker.js"></script>
- <script src="/js/layer/layer.js"></script>
- <script>
- $(document).ready(function(){
- //$('#lookHistory').trigger("click");
- var date=new Date;
- var year=date.getFullYear();
- var month=date.getMonth()+1;
- if(month<10){
- month ='0'+month;
- }
- var day = date.getDate(); //获取当前日(1-31)
- if(day<10){
- day ='0'+day
- }
- var minD = year +'-'+month +'-'+ '01';
- var maxD = year +'-'+month +'-' +day;
- var minD = '<?php echo $start_time;?>';
- var maxD = '<?php echo $end_time;?>';
- <?php if($edit == 1):?>
- getSctionsByTextbookId(<?php echo $textbookId;?>,<?php echo $subjectId;?>,1,'',0);
- <?php endif;?>
- // 显示默认时间
- $("#some_class_1").attr("value",minD);
- $("#some_class_2").attr("value",maxD);
- $('.some_class').datetimepicker({
- format: "Y-m-d", //格式化日期
- timepicker: false, //关闭时间选项
- minDate:"<?php echo $sem_start_time;?>",
- maxDate:"<?php echo $sem_end_time;?>"
- });
- $("#generatingTeachingSchedule[active='true']").on("click", function() {
- $(this).attr("active","false");
- var d1 = $("#some_class_1").val();
- //dateTmp = d1.replace(/-/g,'/') //为了兼容IOS,需先将字符串转换为'2018/9/11 9:11:23'
- timestamp = Date.parse(d1)
- var d2 = $("#some_class_2").val();
- console.log(timestamp,d2)
- var error = [];
- var moduleArr = [];
- var chapterArr = [];
- var sectionArr = [];
- var subjectId = $("select[name='select-subject']").val();
- var grade = $("select[name='select-grade']").val();
- var startTime = $("#some_class_1").val();
- var endTime = $("#some_class_2").val();
- var textbookId = $('.select-textbook').attr("textbookId");
- var textbookName = $('.select-textbook').attr("textbookName");
- var classIds = [];
- var className = '';
- var selectSectionIds = [];
- $('.active-class-box .active-class').each(function(){
- if(className == ''){
- className = $(this).text().substr(0,$(this).text().length-1);
- }
- classIds.push($(this).find("i").attr("value"));
- });
- $('.active-chapter-box .active-chapter i').each(function(){
- if($(this).attr('type') == 1){
- moduleArr.push($(this).attr('saveId'));
- }else if($(this).attr('type') == 2){
- chapterArr.push($(this).attr('saveId'));
- }else if($(this).attr('type') == 3){
- sectionArr.push($(this).attr('saveId'));
- }
- // for(var b =0;b++;b<$(this).attr('selectSectionIds').split(',').length){
- // selectSectionIds.push($(this).attr('selectSectionIds').split(',')[b]);
- // }
- selectSectionIds.push($(this).attr('selectSectionIds').split(','));
- });
- if(moduleArr.length == 0 && chapterArr.length == 0 && sectionArr.length == 0){
- error.push("请选择模块章节");
- }
- if(!textbookId){
- error.push("请指定教材");
- }
- if(classIds.length == 0 ){
- error.push("请选择班级");
- }
- if(!startTime){
- error.push("请设置开始时间");
- }
- if(!endTime){
- error.push("请设置结束时间");
- }
- var startTimeUnix = Date.parse(startTime) / 1000;
- var endTimeUnix = Date.parse(endTime) / 1000;
- var date_start = new Date(startTimeUnix * 1000);//时间戳为10位需*1000,时间戳为13位的话不需乘1000
- var start_M = date_start.getMonth()+1 + '.';
- var start_D = date_start.getDate();
- var startTimeStr = start_M + start_D;
- var date_end = new Date(endTimeUnix * 1000);//时间戳为10位需*1000,时间戳为13位的话不需乘1000
- var end_M = date_end.getMonth()+1 + '.';
- var end_D = date_end.getDate();
- var endTimeStr = end_M + end_D;
- if(startTimeUnix > endTimeUnix){
- error.push("开始时间不能大于结束时间");
- }
- if(error.length == 0){
- layer.open({
- type: 1,
- title: '提示',
- btn: ['确定', '取消'],
- area: ['420px', '190px'], //宽高
- btnAlign: 'c',
- content: '<div class="confirm-layer-box"><span>确认要生成'+className+'等共'+classIds.length+'个班级在'+startTimeStr+'~'+endTimeStr+'的数学教学进度表吗?</span></div>',
- yes: function(index, layero) {
- var data = {
- subjectId : subjectId,
- grade:grade,
- classIds:classIds,
- startTimeUnix:startTimeUnix,
- endTimeUnix:endTimeUnix,
- moduleArr:moduleArr,
- chapterArr:chapterArr,
- sectionArr:sectionArr,
- textbookId:textbookId,
- textbookName:textbookName,
- selectSectionIds:selectSectionIds
- };
- $.post("<?php echo Yii::app()->createUrl('classes/ajaxInsertTeachProgress')?>",data,function(flags){
- var m = JSON.parse(flags);
- console.log(m);
- if(m.status == 0)
- {
- layer.msg(m.error);
- $(this).attr("active","true");
- }else{
- var params = "grade="+grade+"&subjectId="+subjectId;
- location.href="<?php echo $this->createUrl("classes/viewHistoryProgress?");?>"+params;
- // location.reload();
- }
- });
- //提交
- layer.closeAll();
- },
- btn2: function(index, layero) {
- //取消按钮
- console.log(111)
- //return false 开启该代码可禁止点击该按钮关闭
- }
- });
- }else{
- $(this).attr("active","true");
- layer.msg(error.join('<br>'));
- }
- });
- // 弹窗选择班级
- $(".add-active-class").on("click", function() {
- var selectClassIds = [];
- $(".active-class-box .btn-delete").each(function(k,v){
- selectClassIds.push($(this).attr('value'));
- });
- console.log(selectClassIds);
- var grade = $("select[name='select-grade']").val();
- var subjectId = $("select[name='select-subject']").val();
- if(grade > 0){
- $.post("<?php echo Yii::app()->createUrl('classes/ajaxGetClassesBylevel')?>",{grade:grade,subjectId:subjectId},function(flags){
- var m = JSON.parse(flags);
- console.log(m);
- var html = "";
- var levelName = {1:'A',2:'B',3:'C'};
- if(m.status>0)
- {
- html += "<div class='class-type-box'>";
- for(var k in m.data){
- html += '<div class="class-type">';
- html += ' <div class="class-type-title clearfix">';
- html += ' <span class="fl">'+levelName[k]+'层班级:</span>';
- html += ' <label for="all'+levelName[k]+'" class="fr"><input type="checkbox" name="class-name-all" value="1" id="all'+levelName[k]+'">全选</label>';
- html += ' </div>';
- html += ' <div class="class-type-checkbox">';
- html += ' <form action="">';
- for(var j = 0;j<m.data[k].length;j++){
- if($.inArray(m.data[k][j].class_id,selectClassIds) > -1){
- html += '<label for="'+m.data[k][j].class_id+'"><input type="checkbox" name="class-name" value="'+m.data[k][j].class_id+'" id="'+m.data[k][j].class_id+'" checked="checked" textbookId="'+m.data[k][j].textbook_id+'" textbookName="'+m.data[k][j].textbook_name+'" className="'+m.data[k][j].class_name+'">'+m.data[k][j].class_name+'</label>';
- }else{
- html += '<label for="'+m.data[k][j].class_id+'"><input type="checkbox" name="class-name" value="'+m.data[k][j].class_id+'" id="'+m.data[k][j].class_id+'" textbookId="'+m.data[k][j].textbook_id+'" textbookName="'+m.data[k][j].textbook_name+'" className="'+m.data[k][j].class_name+'">'+m.data[k][j].class_name+'</label>';
- }
- }
- html += ' </form>';
- html += ' </div>';
- html += '</div>';
- }
- html += "</div>";
- }
- html += '<p class="layer-err-msg"><img src="/images/icon-warning-red.png" alt=""> 已选班级使用的教材版本不一致,是否继续?</p>';
- html += '<div class="button-btn-box">';
- html += ' <div class="btn-box-show-1">';
- html += ' <button type="button" class="layer-btn-add-class " id="btnLayerAddClassOne">确定</button>';
- html += ' </div>';
- html += ' <div class="btn-box-show-2">';
- html += ' <button type="button" class="layer-btn-add-class " id="btnLayerAddClassTwo">继续</button>';
- html += ' <button type="button" class="layer-btn-cancel-class " id="btnLayerCancelClass">取消</button>';
- html += ' </div>';
- html += '</div>';
- $('.layer-add-class').html(html);
- });
- layer.open({
- type: 1,
- title: '添加班级',
- area: ['760px', '500px'], //宽高
- content: $('.layer-add-class'),
- });
- }else{
- alert("班级错误");
- }
- });
- // 弹出修改教材版本
- $(".img-add-versions").on("click", function() {
- $('.step-2').hide();
- $('.step-3').hide();
- $('.step-1').show();
- // var $(this)
- layer.open({
- type: 1,
- title: '教材设置',
- area: ['480px', '250px'], //宽高
- content: $('.layer-choice-teaching-material-type'),
- });
- });
- // 单选按钮
- $("body").on('change',"input[name='class-name']",function() {
- getsClassSelected();
- });
- // 全选按钮
- $("body").on('change',"input[name='class-name-all']",function() {
- var isChecked = $(this).prop("checked");
- if(isChecked){
- $(this).parents('.class-type').find("input").prop("checked", true);
- getsClassSelected();
- return false;
- }else{
- $(this).parents('.class-type').find("input").prop("checked", false);
- getsClassSelected();
- return false;
- }
- });
- var selectedData=[];
- var selectedDataValue = [];
- var selectedDataList = [];
- function getsClassSelected() {
- selectedData = $("input[name='class-name']:checked"); //获取所有选中
- selectedDataList = [];
- var className = '';
- selectedDataValue = [];
- for (var i = 0; i < selectedData.length; i++) {
- className = $(selectedData[i]).parent().text();
- //添加已选择班级
- selectedDataList.push('<span class="active-class">'+className+'<i class="btn-delete" value="' + selectedData[i].value + '">X</i></span>');
- selectedDataValue.push(selectedData[i].value);
- }
- //判断班级教材版本是否一致
- // let testType = ture;
- // isClassTextbook(testType);
- };
- function isClassTextbook(type){
- if(type==false){
- $('.layer-err-msg').show();
- $('.btn-box-show-1').hide();
- $('.btn-box-show-2').show();
- }else{
- $('.layer-err-msg').hide();
- $('.btn-box-show-2').hide();
- $('.btn-box-show-1').show();
- }
- }
- // 确定已选班级
- $("body").on("click",'#btnLayerAddClassOne', function() {
- //$('#classSelected').html(selectedDataList);
- var isRepeat = 0;
- var nowTextbookId = 0;
- $('.class-type-box .class-type-checkbox input:checked').each(function(){
- if($(this).attr("textbookId") != 0){
- if(nowTextbookId == 0){
- nowTextbookId = $(this).attr("textbookId");
- }
- if(nowTextbookId != $(this).attr("textbookId")){
- isRepeat = 1;
- }
- }
- });
- //alert(isRepeat);
- if(isRepeat == 1){
- $('.btn-box-show-2').show();
- $('.layer-err-msg').show();
- $('.btn-box-show-1').hide();
- }else{
- $('.active-class-box .active-class').remove();
- $('.active-class-box').prepend(selectedDataList);
- $('#classSelectedLength').text(selectedData.length);
- $('.btn-teaching-material-type').removeClass('active');
- $('.btn-teaching-material-type[textbookId="'+nowTextbookId+'"]').addClass('active');
- if(!$('.select-textbook').attr('textbookId') || $('.select-textbook').attr('textbookId')==0){
- $('.select-textbook').html('— —');
- }
- layer.closeAll();
- }
- });
- $("body").on("click",'#btnLayerAddClassTwo', function() {
- $('.active-class-box .active-class').remove();
- $('.active-class-box').prepend(selectedDataList);
- $('#classSelectedLength').text(selectedData.length);
- $('.select-textbook').text("已选班级教材不一致");
- $('.select-textbook').attr("textbookId",0);
- $('.select-textbook').attr("textbookName",'');
- $('.section-content .chapter-msg').html('<p class="chapter-msg">请选择教材版本,再设置教学进度</p>');
- $('.active-chapter-box').html('');
- $('.chapter-box').html('');
- $('.btn-teaching-material-type').removeClass('active');
- layer.closeAll();
- });
- $("body").on("click",'#btnLayerCancelClass', function() {
- layer.closeAll();
- })
- //显示班级教材版本
- $("body").on("mouseover",".class-type-checkbox label",function () {
- //alert(1);
- var versions = $(this).attr('versions');
- var className = $(this).find("input").attr("className");
- var textbookName = $(this).find("input").attr("textbookName");
- console.log(className);
- var classId ='#'+$(this).children('input').attr('id');
- if(textbookName == ''){
- textbookName = "无教材";
- }
- // if(textbookName){
- layer.tips(className+'</br>'+textbookName, classId, {
- tips: [1, '#619aff'],
- time: 2000
- });
- // }
- })
- $("body").on("mouseover",".chapter",function () {
- //alert(1);
- var textbookName = $(this).html();
- var classId ='#'+$(this).attr('id');
- // if(textbookName){
- layer.tips(textbookName, classId, {
- tips: [1, '#747E9A'],
- time: 2000
- });
- // }
- })
- //清除已选班级
- $("body").on("click", ".btn-delete", function() {
- $(this).parent().remove();
- var classValue = $(this).attr('value');
- $(".layer-add-class input[value='" + classValue + "']").prop("checked", false);
- $(".layer-add-class input[name='class-name-all']").prop("checked", false);
- $('#classSelectedLength').text($('#classSelected span').length);
- getsClassSelected();
- return false;
- });
- // 教材设置步骤
- $("#btnLayerStepOne").on("click", function() {
- $('.step-1').hide();
- $('.step-2').show();
- });
- $("#btnLayerStepTwo").on("click", function() {
- var textbookId = $('.teaching-material-type-box button.active').attr("textbookId");
- if(typeof(textbookId)!="undefined"){
- var textbookName = $('.teaching-material-type-box button.active').text();
- $('.text-no-now').text(textbookName);
- $('.text-no-now').attr("textbookId",textbookId);
- $('.step-2').hide();
- $('.step-3').show();
- }else{
- layer.msg('请选择教材');
- }
- });
- //确认教材
- $("#btnLayerStepThreeConfirm").on("click", function() {
- var textbookId = $('.text-no-now').attr("textbookId");
- var subjectId = $('select[name="select-subject"]').val();
- $('.select-textbook').html($('.text-no-now').text());
- $('.select-textbook').attr("textbookId",textbookId);
- $('.select-textbook').attr("textbookName",$('.text-no-now').text());
- getSctionsByTextbookId(textbookId,subjectId,0,'',0);
- layer.closeAll();
- });
- //取消教材
- $("#btnLayerStepThreeCancel").on("click", function() {
- layer.closeAll();
- });
- //点击知识点
- //点击知识点
- $(".chapter-box").on("click", ".chapter", function() {
- var isActiveChapter = $(this).hasClass('active');
- var mcode = '';
- var zcode = '';
- var code = '';
- var codeall =[];
- var zcodeall = [];
- //判断是否已选择
- if(isActiveChapter){
- mcode = $(this).attr('mcode');
- $(this).removeClass('active show-btn');
- //判断点击类型 knowledge:节;chapter:章;versions:模块;
- if($(this).hasClass('type-knowledge')){
- //清除节时 删除当前章和模块的选中状态
- zcode = $(this).attr('zcode');
- $('#z'+zcode).removeClass('active show-btn');
- $('#m'+mcode).removeClass('active show-btn');
- //给未清除的节与章添加取消按钮
- $(".chapter-box .active[zcode='" + zcode + "']").addClass('show-btn');
- $(".chapter-box .type-chapter.active[mcode='" + mcode + "']").addClass('show-btn');
- }else if($(this).hasClass('type-chapter')){
- zcode = $(this).attr('zcode');
- $('#m'+mcode).removeClass('active show-btn');
- $(".chapter-box .chapter[zcode='" + zcode + "']").removeClass('active');
- $(".chapter-box .type-chapter.active[mcode='" + mcode + "']").addClass('show-btn');
- }else if($(this).hasClass('type-versions')){
- $('#m'+mcode).removeClass('active show-btn');
- $(".chapter-box .chapter[mcode='" + mcode + "']").removeClass('active');
- }
- getCapterList();
- }else{
- //添加选中效果和清除按钮
- $(this).addClass('active show-btn');
- mcode = $(this).attr('mcode');
- //判断点击类型 knowledge:节;chapter:章;versions:模块;
- if($(this).hasClass('type-knowledge')){
- zcode = $(this).attr('zcode');
- code = $(this).attr('code');
- codeall = $('#z'+zcode).attr('codeall');
- zcodeall = $('#m'+mcode).attr('zcodeall');
- //获取当前章已选中的节
- var isActiveKnowledgeAll = [];
- // for (var i = 0; i < $(".chapter-box .chapter[zcode='" + zcode + "']").length; i++) {
- // $(".chapter-box .chapter[zcode='" + zcode + "']")[i]
- // }
- $(".chapter-box .active[zcode='" + zcode + "']").each(function( index ) {
- if($(this).attr('code')){
- isActiveKnowledgeAll.push($(this).attr('code'));
- }
- });
- // 判断是否已全选当前章里的所有节
- if(codeall.toString()==isActiveKnowledgeAll.toString()){
- console.log(6)
- //删除当前章里所有节的清除按钮
- $(".chapter-box .chapter[zcode='" + zcode + "']").removeClass('show-btn');
- //给当前章添加清除按钮
- $('#z'+zcode).addClass('active show-btn');
- // 获取当前模块已选中的章
- var isActiveChapterAll=[];
- $(".chapter-box .active[mcode='" + mcode + "']").each(function( index ) {
- if($(this).hasClass('type-chapter')){
- isActiveChapterAll.push($(this).attr('zcode'));
- }
- });
- // 判断是否已全选当前模块里的所有章
- if(zcodeall.toString()==isActiveChapterAll.toString()){
- console.log(16)
- $('#m'+mcode).addClass('active');
- $(".chapter-box .chapter[mcode='" + mcode + "']").removeClass('show-btn');
- $('#m'+mcode).addClass('show-btn');
- }else{
- console.log(18)
- }
- }else{
- console.log(8)
- }
- }else if($(this).hasClass('type-chapter')){
- zcode = $(this).attr('zcode');
- zcodeall = $('#m'+mcode).attr('zcodeall');
- $(".chapter-box .chapter[zcode='" + zcode + "']").addClass('active');
- $(".chapter-box .chapter[zcode='" + zcode + "']").removeClass('show-btn');
- $(this).addClass('show-btn');
- var isActiveChapterAll=[];
- $(".chapter-box .active[mcode='" + mcode + "']").each(function( index ) {
- if($(this).hasClass('type-chapter')){
- isActiveChapterAll.push($(this).attr('zcode'));
- }
- });
- if(zcodeall.toString()==isActiveChapterAll.toString()){
- console.log(16)
- $('#m'+mcode).addClass('active');
- $(".chapter-box .chapter[mcode='" + mcode + "']").removeClass('show-btn');
- $('#m'+mcode).addClass('show-btn');
- }else{
- console.log(18)
- }
- }else if($(this).hasClass('type-versions')){
- $(".chapter-box .chapter[mcode='" + mcode + "']").addClass('active');
- $(".chapter-box .chapter[mcode='" + mcode + "']").removeClass('show-btn');
- $('#m'+mcode).addClass('show-btn');
- }
- getCapterList();
- }
- });
- function getSctionsByTextbookId(textbookId,subjectId,isEdit,keywords,isSearch){
- selectIcon = $('.active-chapter-box .active-chapter .btn-delete-chapter');
- $.post("<?php echo Yii::app()->createUrl('classes/ajaxGetSectionsByTextbookId')?>",{textbookId:textbookId,subjectId:subjectId},function(flags){
- var m = JSON.parse(flags);
- var html = "";
- var iconhtml = "";
- var levelName = {1:'A',2:'B',3:'C'};
- var isSearchIconHtml = $('.active-chapter-box').html();
- if(m.status>0)
- {
- if(isEdit == 1){
- var selectModuleArr = '<?php echo $module_id;?>'.split(',');
- var selectChapterArr = '<?php echo $chapter_id;?>'.split(',');
- var selectSectionArr = '<?php echo $section_id;?>'.split(',');
- }else{
- var selectModuleArr = [];
- var selectChapterArr = [];
- var selectSectionArr = [];
- $.each(selectIcon,function(k,v){
- // $('.active-chapter-box .active-chapter .btn-delete-chapter').each(function(k,v){
- console.log($(this).attr('type'));
- if($(this).attr('type') == 1){
- selectModuleArr.push($(this).attr('saveId'));
- }
- if($(this).attr('type') == 2){
- selectChapterArr.push($(this).attr('saveId'));
- }
- if($(this).attr('type') == 3){
- selectSectionArr.push($(this).attr('saveId'));
- }
- });
- }
- var n = 1;
- for(var k in m.data){
- var mcodeall = [];
- if($.inArray(m.data[k].module_id.toString(),selectModuleArr) > -1){
- var modeleShowBtn = 1;
- var moduleSelectArr = [];
- var modulestyle = "active show-btn";
- }else{
- var modeleShowBtn = 0;
- var modulestyle = "";
- }
- if(keywords){
- if(m.data[k].module_name.indexOf(keywords) != -1){
- html += '<span class="chapter type-versions '+modulestyle+'" moduleId="'+m.data[k].module_id+'" type="1" mcode="'+m.data[k].module_id+'" id="m'+m.data[k].module_id+'" zcodeall="tempChapter">'+m.data[k].module_name+'</span>';
- }else{
- html += '<span class="chapter type-versions hide '+modulestyle+'" moduleId="'+m.data[k].module_id+'" type="1" mcode="'+m.data[k].module_id+'" id="m'+m.data[k].module_id+'" zcodeall="tempChapter">'+m.data[k].module_name+'</span>';
- }
- }else{
- html += '<span class="chapter type-versions '+modulestyle+'" moduleId="'+m.data[k].module_id+'" type="1" mcode="'+m.data[k].module_id+'" id="m'+m.data[k].module_id+'" zcodeall="tempChapter">'+m.data[k].module_name+'</span>';
- }
- if(m.data[k].chapters && m.data[k].chapters.length>0){
- for(var x=0;x<m.data[k].chapters.length;x++){
- var scodeall=[];
- if($.inArray(m.data[k].chapters[x].chapter_id.toString(),selectChapterArr) > -1){
- var chapterShowBtn = 1;
- var chapterSelectArr = [];
- var chapterstyle = "active show-btn";
- }else{
- var chapterShowBtn = 0;
- if(modeleShowBtn == 0){
- var chapterstyle = "";
- }else{
- chapterstyle = "active";
- }
- }
- mcodeall.push(m.data[k].chapters[x].chapter_id);
- if(keywords){
- if(m.data[k].chapters[x].chapter_name.indexOf(keywords) != -1){
- html += '<span class="chapter type-chapter '+chapterstyle+'" id="z'+m.data[k].chapters[x].chapter_id+'" codeall="tempSection" zcode="'+m.data[k].chapters[x].chapter_id+'" mcode="'+m.data[k].module_id+'" chapterId="'+m.data[k].chapters[x].chapter_id+'" type="2">'+m.data[k].chapters[x].chapter_name+'</span>';
- }else{
- html += '<span class="chapter type-chapter hide '+chapterstyle+'" id="z'+m.data[k].chapters[x].chapter_id+'" codeall="tempSection" zcode="'+m.data[k].chapters[x].chapter_id+'" mcode="'+m.data[k].module_id+'" chapterId="'+m.data[k].chapters[x].chapter_id+'" type="2">'+m.data[k].chapters[x].chapter_name+'</span>';
- }
- }else{
- html += '<span class="chapter type-chapter '+chapterstyle+'" id="z'+m.data[k].chapters[x].chapter_id+'" codeall="tempSection" zcode="'+m.data[k].chapters[x].chapter_id+'" mcode="'+m.data[k].module_id+'" chapterId="'+m.data[k].chapters[x].chapter_id+'" type="2">'+m.data[k].chapters[x].chapter_name+'</span>';
- }
- if(m.data[k].chapters[x].sections && m.data[k].chapters[x].sections.length>0){
- for(var y=0;y<m.data[k].chapters[x].sections.length;y++){
- if($.inArray(m.data[k].chapters[x].sections[y].section_id.toString(),selectSectionArr) > -1){
- var sectionShowBtn = 1;
- var sectionstyle = "active show-btn";
- iconhtml+= '<span class="active-chapter">'+m.data[k].chapters[x].sections[y].section_name.replace(/<[^>]+>/g,"")+'<i class="btn-delete-chapter" code="'+m.data[k].chapters[x].sections[y].section_id+'" type="3" saveid="'+m.data[k].chapters[x].sections[y].section_id+'" selectsectionids="'+m.data[k].chapters[x].sections[y].section_id+'">X</i></span>';
- }else{
- var sectionShowBtn = 0;
- if(modeleShowBtn == 1 || chapterShowBtn == 1){
- var sectionstyle = "active";
- }else{
- sectionstyle = "";
- }
- }
- if(chapterShowBtn == 1){
- chapterSelectArr.push(m.data[k].chapters[x].sections[y].section_id.toString());
- }
- if(modeleShowBtn == 1){
- moduleSelectArr.push(m.data[k].chapters[x].sections[y].section_id.toString());
- }
- scodeall.push(m.data[k].chapters[x].sections[y].section_id);
- if(keywords){
- if(m.data[k].chapters[x].sections[y].section_name.indexOf(keywords) != -1){
- html += '<span class="chapter type-knowledge '+sectionstyle+'" id="c'+m.data[k].chapters[x].sections[y].section_id+'" mcode="'+m.data[k].module_id+'" zcode="'+m.data[k].chapters[x].chapter_id+'" code="'+m.data[k].chapters[x].sections[y].section_id+'" sectionId="'+m.data[k].chapters[x].sections[y].section_id+'" type="3" moduleId="'+m.data[k].module_id+'" chapterId="'+m.data[k].chapters[x].chapter_id+'">'+m.data[k].chapters[x].sections[y].section_name+'</span>';
- }else{
- html += '<span class="chapter type-knowledge hide '+sectionstyle+'" id="c'+m.data[k].chapters[x].sections[y].section_id+'" mcode="'+m.data[k].module_id+'" zcode="'+m.data[k].chapters[x].chapter_id+'" code="'+m.data[k].chapters[x].sections[y].section_id+'" sectionId="'+m.data[k].chapters[x].sections[y].section_id+'" type="3" moduleId="'+m.data[k].module_id+'" chapterId="'+m.data[k].chapters[x].chapter_id+'">'+m.data[k].chapters[x].sections[y].section_name+'</span>';
- }
- }else{
- html += '<span class="chapter type-knowledge '+sectionstyle+'" id="c'+m.data[k].chapters[x].sections[y].section_id+'" mcode="'+m.data[k].module_id+'" zcode="'+m.data[k].chapters[x].chapter_id+'" code="'+m.data[k].chapters[x].sections[y].section_id+'" sectionId="'+m.data[k].chapters[x].sections[y].section_id+'" type="3" moduleId="'+m.data[k].module_id+'" chapterId="'+m.data[k].chapters[x].chapter_id+'">'+m.data[k].chapters[x].sections[y].section_name+'</span>';
- }
- }
- html = html.replace(/tempSection/g,scodeall.join(','));
- }
- if(chapterShowBtn == 1){
- iconhtml += '<span class="active-chapter">'+m.data[k].chapters[x].chapter_name.replace(/<[^>]+>/g,"")+'<i class="btn-delete-chapter" zcode="'+m.data[k].chapters[x].chapter_id+'" type="2" saveid="'+m.data[k].chapters[x].chapter_id+'" selectsectionids="'+chapterSelectArr.join(',')+'">X</i></span>';
- }
- }
- html = html.replace(/tempChapter/g,mcodeall.join(','));
- if(modeleShowBtn == 1){
- iconhtml += '<span class="active-chapter">'+m.data[k].module_name.replace(/<[^>]+>/g,"")+'<i class="btn-delete-chapter" mcode="'+m.data[k].module_id+'" type="1" saveid="'+m.data[k].module_id+'" selectsectionids="'+moduleSelectArr.join(',')+'">X</i></span>';
- }
- }
- //html += '</div>';
- }
- console.log(iconhtml);
- if(isSearch == 0){
- $('.active-chapter-box').html(iconhtml);
- }
- $('.chapter-msg').html('');
- if(html == ''){
- $('.section-content .chapter-box').prev().html('<p class="chapter-msg">暂无教材内容</p>');
- }
- $('.section-content .chapter-box').html(html);
- }else{
- layer.msg(m.error);
- }
- });
- }
- var capterValueList =[]
- function getCapterList (){
- var capterList = $(".chapter-box .show-btn"); //获取所有选中学生
- var capterDataList = [];
- var capterName, code = '';
- capterValueList = [];
- for (var i = 0; i < capterList.length; i++) {
- var selectSectionIds = [];
- capterName = $(capterList[i]).text();
- //code = $(capterList[i]).attr('code');
- if($(capterList[i]).hasClass('type-knowledge')){
- code = $(capterList[i]).attr('code');
- var saveId = $(capterList[i]).attr('sectionId');
- selectSectionIds.push($(capterList[i]).attr('sectionId'));
- capterDataList.push('<span class="active-chapter">'+capterName+'<i class="btn-delete-chapter" code="' + code + '" type="'+$(capterList[i]).attr('type')+'" saveId = "'+saveId+'" selectSectionIds="'+selectSectionIds.join(',')+'">X</i></span>');
- capterValueList.push(code);
- }else if($(capterList[i]).hasClass('type-chapter')){
- code = $(capterList[i]).attr('zcode');
- var saveId = $(capterList[i]).attr('chapterId');
- $('.type-knowledge[chapterId="'+saveId+'"]').each(function(){
- selectSectionIds.push($(this).attr('sectionId'));
- });
- capterDataList.push('<span class="active-chapter">'+capterName+'<i class="btn-delete-chapter" zcode="' + code + '" type="'+$(capterList[i]).attr('type')+'" saveId = "'+saveId+'" selectSectionIds="'+selectSectionIds.join(',')+'">X</i></span>');
- capterValueList.push(code);
- } else if($(capterList[i]).hasClass('type-versions')){
- code = $(capterList[i]).attr('mcode');
- var saveId = $(capterList[i]).attr('moduleId');
- $('.type-knowledge[moduleId="'+saveId+'"]').each(function(){
- selectSectionIds.push($(this).attr('sectionId'));
- });
- capterDataList.push('<span class="active-chapter">'+capterName+'<i class="btn-delete-chapter" mcode="' + code + '" type="'+$(capterList[i]).attr('type')+'" saveId = "'+saveId+'" selectSectionIds="'+selectSectionIds.join(',')+'">X</i></span>');
- capterValueList.push(code);
- }
- // if($(capterList[i]).attr('type') == 1){
- // var saveId = $(capterList[i]).attr('moduleId');
- // $('.type-knowledge[moduleId="'+saveId+'"]').each(function(){
- // selectSectionIds.push($(this).attr('sectionId'));
- // });
- // }else if($(capterList[i]).attr('type') == 2){
- // var saveId = $(capterList[i]).attr('chapterId');
- // $('.type-knowledge[chapterId="'+saveId+'"]').each(function(){
- // selectSectionIds.push($(this).attr('sectionId'));
- // });
- // }else if($(capterList[i]).attr('type') == 3){
- // var saveId = $(capterList[i]).attr('sectionId');
- // selectSectionIds.push($(capterList[i]).attr('sectionId'));
- // }
- // capterDataList.push('<span class="active-chapter">'+capterName+'<i class="btn-delete-chapter" code="' + code + '" type="'+$(capterList[i]).attr('type')+'" saveId = "'+saveId+'" selectSectionIds="'+selectSectionIds.join(',')+'">X</i></span>');
- // capterValueList.push(code);
- }
- $('.active-chapter-box').html(capterDataList);
- }
- //清除已选知识点
- $(".active-chapter-box").on("click", ".btn-delete-chapter", function() {
- $(this).parent().remove();
- var classValue='';
- if($(this).attr('code')){
- classValue = $(this).attr('code');
- $(".chapter-box .chapter[code='" + classValue + "']").removeClass('active show-btn');
- }else if($(this).attr('zcode')){
- classValue = $(this).attr('zcode');
- $(".chapter-box .chapter[zcode='" + classValue + "']").removeClass('active show-btn');
- } else if($(this).attr('mcode')){
- classValue = $(this).attr('mcode');
- $(".chapter-box .chapter[mcode='" + classValue + "']").removeClass('active show-btn');
- }
- return false;
- });
- //选择教材版本
- $(".teaching-material-type-box").on("click", ".btn-teaching-material-type", function() {
- $(".teaching-material-type-box .btn-teaching-material-type").removeClass('active');
- $(this).addClass('active');
- });
- //切换年级
- $("select[name='select-grade']").change(function(){
- var grade = $(this).val();
- var subjectId = $("select[name='select-subject']").val();
- var params = "grade="+grade+"&subjectId="+subjectId;
- location.href = "<?php echo $this->createUrl("classes/settingProgress?");?>"+params;
- //$('#classSelectedLength').text(0);
- //$('#classSelected').html('');
- });
- //查看历史
- $('#lookHistory').click(function(){
- var grade = $("select[name='select-grade']").val();
- var subjectId = $("select[name='select-subject']").val();
- var params = "grade="+grade+"&subjectId="+subjectId;
- location.href="<?php echo $this->createUrl("classes/viewHistoryProgress?");?>"+params;
- });
- //切换科目
- $("select[name='select-subject']").change(function(){
- var subjectId = $(this).val();
- var grade = 1;
- var params = "grade="+grade+"&subjectId="+subjectId;
- location.href = "<?php echo $this->createUrl("classes/settingProgress?");?>"+params;
- //$('#classSelectedLength').text(0);
- });
- //搜索btnSearchVersions
- $('#btnSearchVersions').click(function(){
- var keywords = $(this).prev().val();
- var textbookId = $('.select-textbook').attr("textbookId");
- var subjectId = $('select[name="select-subject"]').val();
- // if(keywords && textbookId && subjectId){
- getSctionsByTextbookId(textbookId,subjectId,0,keywords,1);
- // }
- });
- });
- </script>
|