From 541a5d31002478b66c8a6af87422febadbd535d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B7=B4=E6=8E=8C?= Date: Fri, 12 Mar 2021 16:58:16 +0800 Subject: [PATCH] 0 --- app/admin/view/index/create.html | 8 +- app/kaohao/controller/Index.php | 2 +- app/kaohao/view/index/create.html | 6 +- app/kaohao/view/index/create_all.html | 80 ++--- app/kaoshi/controller/KaoshiSet.php | 14 +- app/kaoshi/controller/LuruFengong.php | 3 +- app/kaoshi/model/LuruFengong.php | 1 + app/kaoshi/validate/KaoshiSetEdit.php | 10 +- app/kaoshi/validate/Kaoshiset.php | 10 +- app/kaoshi/view/index/create_setp2.html | 329 ++++++++---------- app/kaoshi/view/index/create_setp3.html | 155 +++------ app/kaoshi/view/index/index.html | 2 +- app/kaoshi/view/kaoshi_set/create.html | 275 +++++++-------- app/kaoshi/view/kaoshi_set/edit.html | 38 +- app/kaoshi/view/kaoshi_set/index.html | 58 +-- app/kaoshi/view/luru_fengong/create.html | 152 ++++---- app/kaoshi/view/luru_fengong/index.html | 241 ++++++------- app/login/view/index/shangma_log.html | 5 +- app/student/controller/Index.php | 2 +- app/student/view/index/by_list.html | 15 +- app/student/view/index/create.html | 39 ++- app/student/view/index/del_list.html | 12 +- app/student/view/index/index.html | 17 +- app/teach/model/Banji.php | 2 +- app/teach/view/banji/create.html | 9 +- app/teach/view/banji/index.html | 19 +- .../migrations/202001132733_kaoshi_set.php | 8 +- .../20210215021427_teacher_to_admin.php | 7 +- public/static/x-admin2.2/js/canyuKaoshi.js | 79 ++++- public/static/x-admin2.2/js/createInput.js | 27 +- 30 files changed, 801 insertions(+), 824 deletions(-) diff --git a/app/admin/view/index/create.html b/app/admin/view/index/create.html index a7d54e02..883f6f7c 100755 --- a/app/admin/view/index/create.html +++ b/app/admin/view/index/create.html @@ -49,7 +49,7 @@
@@ -71,21 +71,21 @@ {/php} {volist name="authgrouplist" id="vo"} {/volist}
- +
- +
- +
diff --git a/app/kaohao/controller/Index.php b/app/kaohao/controller/Index.php index a9b349bf..41b59b73 100755 --- a/app/kaohao/controller/Index.php +++ b/app/kaohao/controller/Index.php @@ -77,7 +77,7 @@ class Index extends AdminBase // 获取参加考试年级数组 $enddate = KS::where('id', $list['kaoshi_id'])->value('enddate'); - $njlist = nianJiNameList('str', $enddate); + $njlist = \app\facade\Tools::nianJiNameList($enddate, 'str'); // 重新组合学生信息 $kaohao = array(); foreach ($stulist as $key => $value) { diff --git a/app/kaohao/view/index/create.html b/app/kaohao/view/index/create.html index a3aec963..5b62befd 100755 --- a/app/kaohao/view/index/create.html +++ b/app/kaohao/view/index/create.html @@ -69,9 +69,9 @@ {block name="myjs"} diff --git a/app/kaoshi/controller/KaoshiSet.php b/app/kaoshi/controller/KaoshiSet.php index 859cd61e..1f269d75 100755 --- a/app/kaoshi/controller/KaoshiSet.php +++ b/app/kaoshi/controller/KaoshiSet.php @@ -113,7 +113,11 @@ class KaoshiSet extends AdminBase ,'subject_id' => array() ,'manfen' => array() ,'youxiu' => array() + ,'lianghao' => array() ,'jige' => array() + ,'youxiubi' => array() + ,'lianghaobi' => array() + ,'jigebi' => array() ], 'POST'); event('kslu', $src['kaoshi_id']); @@ -137,7 +141,11 @@ class KaoshiSet extends AdminBase 'subject_id' => $value, 'manfen' => $src['manfen'][$key], 'youxiu' => $src['youxiu'][$key], + 'lianghao' => $src['lianghao'][$key], 'jige' => $src['jige'][$key], + 'youxiubi' => $src['youxiubi'][$key], + 'lianghaobi' => $src['lianghaobi'][$key], + 'jigebi' => $src['jigebi'][$key], ]; } @@ -175,7 +183,7 @@ class KaoshiSet extends AdminBase // 获取考试信息 $ksset = new ksset; $list['data'] = $ksset::where('id',$id) - ->field('id, kaoshi_id, nianjiname, subject_id, manfen, youxiu, jige') + ->field('id, kaoshi_id, nianjiname, subject_id, manfen, youxiu, lianghao, jige, youxiubi, lianghaobi, jigebi') ->with([ 'subjectName' => function($query){ $query->field('id, title, jiancheng'); @@ -213,7 +221,11 @@ class KaoshiSet extends AdminBase ,'kaoshi_id' ,'manfen' ,'youxiu' + ,'lianghao' ,'jige' + ,'youxiubi' + ,'lianghaobi' + ,'jigebi' ], 'POST'); // 验证表单数据 diff --git a/app/kaoshi/controller/LuruFengong.php b/app/kaoshi/controller/LuruFengong.php index 93739771..ddc3590a 100644 --- a/app/kaoshi/controller/LuruFengong.php +++ b/app/kaoshi/controller/LuruFengong.php @@ -87,8 +87,7 @@ class LuruFengong extends AdminBase // 获取考试时间 $ks = new \app\kaoshi\model\Kaoshi; $enddate = $ks->kaoshiInfo($kaoshi_id); - $enddate = $enddate->getData('enddate'); - $list['set']['nianji'] = nianJiNameList('str', $enddate); + $list['set']['enddate'] = $enddate->getData('enddate'); // 模板赋值 $this->view->assign('list', $list); diff --git a/app/kaoshi/model/LuruFengong.php b/app/kaoshi/model/LuruFengong.php index 8755ba5f..fd07a552 100644 --- a/app/kaoshi/model/LuruFengong.php +++ b/app/kaoshi/model/LuruFengong.php @@ -23,6 +23,7 @@ class LuruFengong extends BaseModel $src = array_cover($srcfrom, $src) ; $src['kaoshi_id'] = strToarray($src['kaoshi_id']); $src['banji_id'] = strToarray($src['banji_id']); + $src['subject_id'] = strToarray($src['subject_id']); $logList = self::where('kaoshi_id', 'in', $src['kaoshi_id']) ->when(count($src['banji_id']) > 0, function($query) use($src){ diff --git a/app/kaoshi/validate/KaoshiSetEdit.php b/app/kaoshi/validate/KaoshiSetEdit.php index 46950619..cf63d351 100755 --- a/app/kaoshi/validate/KaoshiSetEdit.php +++ b/app/kaoshi/validate/KaoshiSetEdit.php @@ -17,8 +17,12 @@ class KaoshiSetEdit extends Validate 'id|ID' => 'require|integer', 'kaoshi_id|考试ID' => 'require|integer', 'manfen|满分' => 'require|number', - 'youxiu|优秀' => 'require|number', - 'jige|及格' => 'require|number', + 'youxiu|优秀分数线' => 'require|number', + 'lianghao|良好分数线' => 'require|number', + 'jige|及格分数线' => 'require|number', + 'youxiu|优秀人数比' => 'require|number', + 'lianghao|良好人数比' => 'require|number', + 'jige|及格人数比' => 'require|number', // 'lieming|列名' => 'require|array', ]; @@ -31,6 +35,6 @@ class KaoshiSetEdit extends Validate protected $message = []; protected $scene = [ - 'edit' => ['id','kaoshi_id','manfen','youxiu','jige'], + 'edit' => ['id','kaoshi_id','manfen','youxiu','lianghao','jige','youxiubi','lianghaobi','jigebi'], ]; } diff --git a/app/kaoshi/validate/Kaoshiset.php b/app/kaoshi/validate/Kaoshiset.php index d1ce31ef..c62ea0cc 100755 --- a/app/kaoshi/validate/Kaoshiset.php +++ b/app/kaoshi/validate/Kaoshiset.php @@ -19,8 +19,12 @@ class Kaoshiset extends Validate 'nianjiname|年级名称' => 'require|chsAlphaNum', 'subject_id|学科' => 'require|array', 'manfen|满分' => 'require|array', - 'youxiu|优秀' => 'require|array', - 'jige|及格' => 'require|array', + 'youxiu|优秀分数线' => 'require|array', + 'lianghao|良好分数线' => 'require|array', + 'jige|及格分数线' => 'require|array', + 'youxiubi|优秀人数比' => 'require|array', + 'lianghaobi|良好人数比' => 'require|array', + 'jigebi|及格人数比' => 'require|array', // 'lieming|列名' => 'require|array', ]; @@ -33,6 +37,6 @@ class Kaoshiset extends Validate protected $message = []; protected $scene = [ - 'create' => ['kaoshi_id', 'nianji','nianjiname', 'subject_id', 'manfen', 'youxiu', 'jige'], + 'create' => ['kaoshi_id', 'nianji','nianjiname', 'subject_id', 'manfen', 'youxiu', 'lianghao', 'jige', 'youxiubi', 'lianghaobi', 'jigebi'], ]; } diff --git a/app/kaoshi/view/index/create_setp2.html b/app/kaoshi/view/index/create_setp2.html index 8354579b..a4096670 100644 --- a/app/kaoshi/view/index/create_setp2.html +++ b/app/kaoshi/view/index/create_setp2.html @@ -1,7 +1,7 @@ {extend name=".././view/create.html" /} {block name="jscss"} - {/block} {block name="form"} -
-
开始
-
考试信息
-
以年级为单位设置参加考试学科和分数线
-
生成参加考试学生名单
-
分配录入成绩任务
-
完成
+
+
开始
+
考试信息
+
以年级为单位设置参加考试学科和分数线
+
生成参加考试学生名单
+
分配录入成绩任务
+
完成
+
+
+
+ +
+
- -
- -
- - -
-
-
- -
- {php} - $subject = subjectKaoshiList(); - {/php} - - - - - - - - - - - - - - - - - {volist name="subject" id="vo"} - - - - - - - - {/volist} - -
选择学科满分优秀分数线及格分数线
- - {$vo.title}
-
-
- -
- 上一步 - - 下一步 -
- +
+ +
+ +
+ {php} + $sbj = new \app\teach\model\Subject; + $src = [ + 'status' => 1, + 'kaoshi' => 1 + ]; + $subject = $sbj->search($src); + {/php} + + + + + + + + + + + + + + + + {volist name="subject" id="vo"} + + + + + + + + + + + + {/volist} + +
选择学科满分优秀分数线良好分数线及格分数线优秀人数比良好人数比及格人数比
+ + {$vo.title}
+
+
+ +
+ 上一步 + + 下一步 +
+ {/block} - {block name="myjs"} {/block} - diff --git a/app/kaoshi/view/index/create_setp3.html b/app/kaoshi/view/index/create_setp3.html index 9561495c..b3c387b3 100644 --- a/app/kaoshi/view/index/create_setp3.html +++ b/app/kaoshi/view/index/create_setp3.html @@ -1,8 +1,7 @@ {extend name=".././view/create.html" /} - {block name="jscss"} - {/block} - {block name="form"}
开始
@@ -35,115 +33,66 @@
完成
-
- + <
+
- {php}$schoolList = danweiJibie('校级', '校级');{/php} - -
-
-
- {foreach $list.data.nianji as $key=>$vo } - -
- -
- {/foreach} -
- -
- 上一步 - - 下一步 -
+ +
+
+
+ +
+ +
+
+
+ +
+
+
+ +
+ 上一步 + + 下一步 +
{/block} - {block name="myjs"} {/block} - diff --git a/app/kaoshi/view/index/index.html b/app/kaoshi/view/index/index.html index 3a3c36af..165c9f95 100755 --- a/app/kaoshi/view/index/index.html +++ b/app/kaoshi/view/index/index.html @@ -160,7 +160,7 @@ layui.use(['table', 'mytable','createInput','form'], function() { parent.xadmin.add_tab(obj.data.title + ' 分数线', '/kaoshi/kaoshiset/index/' + obj.data.id, true); break; case 'kaohao': // 生成考号 - xadmin.open(obj.data.title + ' 生成考号', '/kaohao/index/createall/' + obj.data.id, '650', '400', false); + xadmin.open(obj.data.title + ' 生成考号', '/kaohao/index/createall/' + obj.data.id, '550', '300', false); break; case 'chengji': // 查询成绩 parent.xadmin.add_tab(obj.data.title + ' 查看成绩', '/kaoshi/index/chengji/' + obj.data.id, true); diff --git a/app/kaoshi/view/kaoshi_set/create.html b/app/kaoshi/view/kaoshi_set/create.html index 815deae7..7ba51b32 100755 --- a/app/kaoshi/view/kaoshi_set/create.html +++ b/app/kaoshi/view/kaoshi_set/create.html @@ -1,162 +1,141 @@ {extend name=".././view/create.html" /} - {block name="form"} -
-
- -
- -
-
-
- -
- {php} - $sbj = new \app\teach\model\Subject; - $src = [ - 'status' => 1, - 'kaoshi' => 1 - ]; - $subject = $sbj->search($src); - {/php} - - - - - - - - - - - - - - - - - {volist name="subject" id="vo"} - - - - - - - - {/volist} - -
选择学科满分优秀分数线及格分数线
- - {$vo.title}
-
-
- -
- -
-
+
+
+ +
+ +
+
+ +
+ +
+ {php} + $sbj = new \app\teach\model\Subject; + $src = [ + 'status' => 1, + 'kaoshi' => 1 + ]; + $subject = $sbj->search($src); + {/php} + + + + + + + + + + + + + + + + {volist name="subject" id="vo"} + + + + + + + + + + + + {/volist} + +
选择学科满分优秀分数线良好分数线及格分数线优秀人数比良好人数比及格人数比
+ + {$vo.title}
+
+
+ +
+ +
+
{/block} - {block name="myjs"} {/block} - diff --git a/app/kaoshi/view/kaoshi_set/edit.html b/app/kaoshi/view/kaoshi_set/edit.html index 126fee1a..9369ad22 100755 --- a/app/kaoshi/view/kaoshi_set/edit.html +++ b/app/kaoshi/view/kaoshi_set/edit.html @@ -33,7 +33,16 @@
-
+
+
@@ -41,6 +50,33 @@ autocomplete="off" class="layui-input " value="{$list.data.jige|default=''}" placeholder="2-25个字符">
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
diff --git a/app/kaoshi/view/kaoshi_set/index.html b/app/kaoshi/view/kaoshi_set/index.html index eb07a1eb..deefac2c 100755 --- a/app/kaoshi/view/kaoshi_set/index.html +++ b/app/kaoshi/view/kaoshi_set/index.html @@ -47,11 +47,8 @@ {/block} diff --git a/app/kaoshi/view/luru_fengong/create.html b/app/kaoshi/view/luru_fengong/create.html index 6c5f85f3..65a295bc 100644 --- a/app/kaoshi/view/luru_fengong/create.html +++ b/app/kaoshi/view/luru_fengong/create.html @@ -29,28 +29,16 @@
- -
-
- -
- {present name="$list.data.kt_zcr"} - {volist name="$list.data.kt_zcr" id="vo"} -
-
- {$vo.admin.xingming} -
-
- {/volist} - {/present} -
-
+ +
+
+
-
@@ -60,8 +48,7 @@ *年级
-
@@ -90,63 +77,76 @@ {block name="myjs"} {/block} diff --git a/app/login/view/index/shangma_log.html b/app/login/view/index/shangma_log.html index a219cea7..596164b1 100755 --- a/app/login/view/index/shangma_log.html +++ b/app/login/view/index/shangma_log.html @@ -49,15 +49,14 @@

V1.3.8 2021-1-17

- 修改:权限、登录验证、考试更多操作上移、合并管理与教师帐号
+ 修改:部分菜单选项修改成ajax获取,搜索教师、学生使用xmslect、重新分组JS功能,权限、登录验证、考试更多操作上移、合并管理与教师帐号
修复已知错误:表格上传教师错误、phinx、登录页面、已录成绩……
优化:雷达图学科显示、成绩位置算法、部分统计表显示……
- 增加:学生帐号显示成绩或等级设置、统计项目、清除演示数据、数据库升级与降级、与初始化、数据库初始数据重新导入、隐藏学生成绩条中学生的全名成绩录入分工 + 增加:学生帐号显示成绩或等级设置、统计项目、清除演示数据、数据库升级与降级、与初始化、数据库初始数据重新导入、隐藏学生成绩条中学生的全名成绩录入分工、良好分数线、优秀良好合格的人数比例、

升级指导:升级指导数据同步 -

diff --git a/app/student/controller/Index.php b/app/student/controller/Index.php index 1c15b6c1..d3e28d5e 100755 --- a/app/student/controller/Index.php +++ b/app/student/controller/Index.php @@ -73,7 +73,7 @@ class Index extends AdminBase $list['webtitle'] = '毕业学生'; $list['dataurl'] = '/student/index/databy'; - $njlist = nianJiNameList('str', time()); + $njlist = \app\facade\Tools::nianJiNameList(); $njlistCnt = count($njlist); $list['thistime'] = strtotime("-" . $njlistCnt ." year"); diff --git a/app/student/view/index/by_list.html b/app/student/view/index/by_list.html index 070555c7..84826114 100755 --- a/app/student/view/index/by_list.html +++ b/app/student/view/index/by_list.html @@ -24,14 +24,14 @@ -
- +
+
- {php} - $njlist = nianJiNameList('str', $list['thistime']); - {/php} - {volist name="njlist" id="vo"} - {/volist}
+ +
+
+
@@ -64,6 +64,7 @@ mytable = layui.mytable; cInput.schoolSelect('school_id', '校级', '校级'); + cInput.nanjiSelect('ruxuenian', {riqi:"{$list['thistime']}"}); // 设置列 options.cols = [ diff --git a/app/student/view/index/create.html b/app/student/view/index/create.html index 765568aa..73e9348d 100755 --- a/app/student/view/index/create.html +++ b/app/student/view/index/create.html @@ -63,23 +63,22 @@
- {php} $njlist = nianJiNameList();{/php} -
-
- -
- -
+
-
- +
+
+ +
+
+
+
+ +
{/block} {block name="myjs"} @@ -92,7 +91,13 @@ layui.use(['laydate', 'form', 'mytable', 'createInput'], function() { // 填充下拉菜单 cInput.schoolSelect('school_id', '校级', '校级', "{$list.data.stuBanji.school_id|default=''}"); - cInput.banjiSelect('banji_id', form.val("myform"), "{$list.data.banji_id|default=''}"); + cInput.nanjiSelect('ruxuenian', '', "{$list.data.stuBanji.ruxuenian|default=''}"); + data = { + school_id:"{$list.data.stuBanji.school_id|default=''}", + ruxuenian:"{$list.data.stuBanji.ruxuenian|default=''}", + } + cInput.banjiSelect('banji_id', data, "{$list.data.banji_id|default=''}"); + //执行一个laydate实例 laydate.render({ @@ -103,7 +108,7 @@ layui.use(['laydate', 'form', 'mytable', 'createInput'], function() { form.on('select(srcbanji)', function(data) { data = form.val("myform"); if (data.school_id > 0 && data.ruxuenian > 0) { - cInput.banjiSelect('banji_id', data); + cInput.banjiSelect('banji_id', form.val("myform"), "{$list.data.banji_id|default=''}"); } }); diff --git a/app/student/view/index/del_list.html b/app/student/view/index/del_list.html index 2873b772..24c717b3 100755 --- a/app/student/view/index/del_list.html +++ b/app/student/view/index/del_list.html @@ -25,16 +25,9 @@
- +
- {php} - $njlist = nianJiNameList('str', time()); - {/php} -
@@ -72,6 +65,7 @@ layui.use(['table', 'mytable', 'createInput', 'form'], function() { mytable = layui.mytable; cInput.schoolSelect('school_id', '校级', '校级'); + cInput.nanjiSelect('ruxuenian'); // 设置列 options.cols = [ diff --git a/app/student/view/index/index.html b/app/student/view/index/index.html index fee17a8e..3f5960ac 100755 --- a/app/student/view/index/index.html +++ b/app/student/view/index/index.html @@ -25,16 +25,9 @@
- +
- {php} - $njlist = nianJiNameList('str', time()); - {/php} -
@@ -82,13 +75,14 @@ diff --git a/app/teach/view/banji/index.html b/app/teach/view/banji/index.html index 086158ca..e1943f5a 100755 --- a/app/teach/view/banji/index.html +++ b/app/teach/view/banji/index.html @@ -16,14 +16,11 @@ -
- +
+
- - {php} $njlist = nianJiNameList(); {/php} - {volist name="njlist" id="vo"} - - {/volist} +
{/block} @@ -69,6 +66,7 @@ layui.use(['table', 'mytable', 'createInput', 'form'], function() { cInput = layui.createInput; cInput.schoolSelect('school_id', '校级', '校级'); + cInput.nanjiSelect('ruxuenian'); // 设置列 options.cols = [ @@ -79,13 +77,6 @@ layui.use(['table', 'mytable', 'createInput', 'form'], function() { field: 'banjiTitle', title: '班级名称', minWidth: 100, - templet: function(d) { - var str = ''; - if (d.grade && d.ban) { - str = d.grade + d.ban; - } - return str; - } }, { field: 'alias', title: '别名', minWidth: 60, edit: 'text' }, { diff --git a/database/migrations/202001132733_kaoshi_set.php b/database/migrations/202001132733_kaoshi_set.php index cc030acc..d63d9e45 100755 --- a/database/migrations/202001132733_kaoshi_set.php +++ b/database/migrations/202001132733_kaoshi_set.php @@ -38,8 +38,12 @@ class KaoshiSet extends Migrator ->addColumn('nianjiname','string',['limit'=>10,'default'=>'a','null'=>false,'comment'=>'年级名']) ->addColumn('subject_id','integer',['limit'=>11,'default'=>0,'null'=>false,'comment'=>'学科id']) ->addColumn('manfen','integer',['limit'=>3,'default'=>100,'null'=>false,'comment'=>'满分']) - ->addColumn('youxiu','integer',['limit'=>3,'default'=>90,'null'=>false,'comment'=>'优秀']) - ->addColumn('jige','integer',['limit'=>3,'default'=>00,'null'=>false,'comment'=>'及格']) + ->addColumn('youxiu','integer',['limit'=>3,'default'=>90,'null'=>false,'comment'=>'优秀分数线']) + ->addColumn('lianghao','integer',['limit'=>3,'default'=>90,'null'=>false,'comment'=>'良好分数线']) + ->addColumn('jige','integer',['limit'=>3,'default'=>00,'null'=>false,'comment'=>'及格分数线']) + ->addColumn('youxiubi','integer',['limit'=>3,'default'=>90,'null'=>false,'comment'=>'优秀人数比']) + ->addColumn('lianghaobi','integer',['limit'=>3,'default'=>90,'null'=>false,'comment'=>'良好人数比']) + ->addColumn('jigebi','integer',['limit'=>3,'default'=>00,'null'=>false,'comment'=>'及格人数比']) ->addColumn('status','boolean',['default'=>1,'null'=>false,'comment'=>'状态']) ->addColumn('create_time','integer',['limit'=>11,'default'=>'1539158918','null'=>false,'comment'=>'创建时间']) ->addColumn('update_time','integer',['limit'=>11,'default'=>'1539158918','null'=>false,'comment'=>'更新时间']) diff --git a/database/migrations/20210215021427_teacher_to_admin.php b/database/migrations/20210215021427_teacher_to_admin.php index d16aff31..5afe1e31 100644 --- a/database/migrations/20210215021427_teacher_to_admin.php +++ b/database/migrations/20210215021427_teacher_to_admin.php @@ -72,11 +72,16 @@ class TeacherToAdmin extends Migrator $table = $this->table('cj_migrations'); $this->execute('DELETE FROM cj_migrations WHERE version="20210107070200" and migration_name="KaoshiAddUser"'); + + $table = $this->table('cj_kaoshi_set'); + $table->addColumn('youxiubi','integer',['limit'=>3,'default'=>90,'null'=>false,'comment'=>'优秀人数比']) + ->addColumn('lianghaobi','integer',['limit'=>3,'default'=>90,'null'=>false,'comment'=>'良好人数比']) + ->addColumn('jigebi','integer',['limit'=>3,'default'=>00,'null'=>false,'comment'=>'及格人数比']); } //版本退回 - public function down() + public function down1() { $table = $this->table('fields'); $column = $table->hasColumn('user_group'); diff --git a/public/static/x-admin2.2/js/canyuKaoshi.js b/public/static/x-admin2.2/js/canyuKaoshi.js index 93dc03fe..e0d640f6 100644 --- a/public/static/x-admin2.2/js/canyuKaoshi.js +++ b/public/static/x-admin2.2/js/canyuKaoshi.js @@ -9,7 +9,7 @@ layui.define(['table', 'form', 'upload'], function(exports) { upload = layui.upload; var obj = { - gradeSelect: function(myid, kaoshi_id, hasNull = true) { + gradeSelect: function(myid, kaoshi_id, value='', hasNull = true) { $.ajax({ url: '/kaoshi/kscy/grade', type: 'POST', @@ -17,6 +17,7 @@ layui.define(['table', 'form', 'upload'], function(exports) { kaoshi_id: kaoshi_id }, success: function(result) { + $('#' + myid).children().remove(); if (hasNull == true) { str = ''; } else { @@ -25,9 +26,9 @@ layui.define(['table', 'form', 'upload'], function(exports) { temp = ""; $(result.data).each(function(i, el) { if (value != '' && value == el.id) { - temp = ''; + temp = ''; } else { - temp = ''; + temp = ''; } str = str + temp; }); @@ -42,15 +43,13 @@ layui.define(['table', 'form', 'upload'], function(exports) { // 参与本次考试学科 - subjectSelect: function(myid, kaoshi_id, ruxuenian, hasNull = true){ + subjectSelect: function(myid, data, value= '', hasNull = true){ $.ajax({ url: '/kaoshi/kscy/subject', type: 'POST', - data: { - kaoshi_id: kaoshi_id, - ruxuenian: ruxuenian - }, + data: data, success: function(result) { + $('#' + myid).children().remove(); if (hasNull == true) { str = ''; } else { @@ -90,7 +89,7 @@ layui.define(['table', 'form', 'upload'], function(exports) { } temp = ""; $(result.data).each(function(i, el) { - temp = ''; + temp = ''; str = str + temp; }); $('#' + myid).append(str); @@ -103,6 +102,68 @@ layui.define(['table', 'form', 'upload'], function(exports) { }, + // 已经参与本次考试班级 + banjiCheckbox: function(myid, data,hasAll = true){ + $.ajax({ + url: '/kaoshi/kscy/class', + type: 'POST', + data: data, + success: function(result) { + $('#' + myid).children().remove(); + if (hasAll == true) { + str = ''; + } else { + str = ''; + } + temp = ""; + $(result.data).each(function(i, el) { + temp = ''; + str = str + temp; + }); + $('#' + myid).append(str); + form.render('checkbox'); + }, + error: function(result) { + layer.msg('数据扔半道啦。', function() {}); + }, + }); + }, + + + // 参与本次考试学校 + schoolSelect: function(myid, kaoshi_id, value= '', hasNull = true){ + $.ajax({ + url: '/kaoshi/kscy/school', + type: 'POST', + data: { + kaoshi_id:kaoshi_id + }, + success: function(result) { + $('#' + myid).children().remove(); + if (hasNull == true) { + str = ''; + } else { + str = ''; + } + temp = ""; + $(result.data).each(function(i, el) { + if (value != '' && value == el.id) { + temp = ''; + } else { + temp = ''; + } + str = str + temp; + }); + $('#' + myid).append(str); + form.render('select'); + }, + error: function(result) { + layer.msg('数据扔半道啦。', function() {}); + }, + }); + }, + + }; //输出test接口 exports('canyuKaoshi', obj); diff --git a/public/static/x-admin2.2/js/createInput.js b/public/static/x-admin2.2/js/createInput.js index ea12e827..1b5c38e2 100644 --- a/public/static/x-admin2.2/js/createInput.js +++ b/public/static/x-admin2.2/js/createInput.js @@ -22,6 +22,7 @@ layui.extend({ p_id: pid }, success: function(result) { + $('#' + myid).children().remove(); if (hasNull == true) { str = ''; } else { @@ -47,37 +48,43 @@ layui.extend({ // 选中checkbox checkboxChecked: function(data) { - pid = $(data.elem).attr('pid'); + pid = $(data.elem).attr('pid'); cid = $(data.elem).attr('cid'); check = data.elem.checked; editCid(cid, check); editPid(pid, check); function editCid(cid, check) { - $("input[pid='" + cid + "']").each(function(i, el) { + myInput = $(data.elem).siblings("input[pid='" + cid + "']"); + myInput.each(function(i, el) { this.checked = check; cid = $(this).attr('cid'); editCid(cid, check); }); + return false; } function editPid(pid, check) { + myInput = $(data.elem).siblings("input[pid='" + pid + "']"); if (check == true) { - $("input[cid='" + pid + "']").each(function(i, el) { + myInput.each(function(i, el) { this.checked = check; pid = $(this).attr('pid'); + console.log(pid); editPid(pid, check); }); } else { - cnt = $("input[pid='" + pid + "']:checked").length; + myCid = $(data.elem).siblings("input[pid='" + pid + "']"); + cnt = myInput.length; if (cnt == 0) { - $("input[cid='" + pid + "']").each(function(i, el) { + myInput.each(function(i, el) { this.checked = check; pid = $(this).attr('pid'); editPid(pid, check); }); } } + return false; } form.render('checkbox'); @@ -95,6 +102,7 @@ layui.extend({ kaoshi:kaoshi }, success: function(result) { + $('#' + myid).children().remove(); if (hasNull == true) { str = ''; } else { @@ -303,6 +311,7 @@ layui.extend({ kaoshi: kaoshi }, success: function(result) { + $('#' + myid).children().remove(); if (hasNull == true) { str = ''; } else { @@ -343,9 +352,9 @@ layui.extend({ temp = ""; $(result.data).each(function(i, el) { if (value != '' && value == el.id) { - temp = ''; + temp = ''; } else { - temp = ''; + temp = ''; } str = str + temp; }); @@ -391,13 +400,14 @@ layui.extend({ }, - // 创建学期的Select + // 创建年级的Select nanjiSelect: function(myid, data, value, hasNull = true) { $.ajax({ url: '/teach/banji/njlist', type: 'POST', data: data, success: function(result) { + $('#' + myid).children().remove(); if (hasNull == true) { str = ''; } else { @@ -428,6 +438,7 @@ layui.extend({ url: '/teach/xueqi/srcxueqi', type: 'POST', success: function(result) { + $('#' + myid).children().remove(); if (hasNull == true) { str = ''; } else {