From 95ab734d99711540b7e62a421c31d55e6453c501 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B7=B4=E6=8E=8C?= Date: Tue, 9 Mar 2021 20:32:23 +0800 Subject: [PATCH] 0 --- app/kaoshi/controller/KaoshiSet.php | 2 +- app/kaoshi/view/index/index.html | 2 +- app/kaoshi/view/kaoshi_set/index.html | 236 +++++++++++---------- public/static/x-admin2.2/js/canyuKaoshi.js | 67 +++++- 4 files changed, 186 insertions(+), 121 deletions(-) diff --git a/app/kaoshi/controller/KaoshiSet.php b/app/kaoshi/controller/KaoshiSet.php index be99d8a8..4926db47 100755 --- a/app/kaoshi/controller/KaoshiSet.php +++ b/app/kaoshi/controller/KaoshiSet.php @@ -26,7 +26,7 @@ class KaoshiSet extends AdminBase $ksset = new ksset; $src['kaoshi_id'] = $kaoshi_id; - $list['subject'] = $ksset->srcSubject($src); + // $list['subject'] = $ksset->srcSubject($src); $nj = $ksset->srcGrade($kaoshi_id); $list['nj'] = $nj; $kaoshi = new \app\kaoshi\model\Kaoshi; diff --git a/app/kaoshi/view/index/index.html b/app/kaoshi/view/index/index.html index 9dab2a48..886a5a24 100755 --- a/app/kaoshi/view/index/index.html +++ b/app/kaoshi/view/index/index.html @@ -69,7 +69,7 @@ {/block} diff --git a/public/static/x-admin2.2/js/canyuKaoshi.js b/public/static/x-admin2.2/js/canyuKaoshi.js index e386e222..3e63c556 100644 --- a/public/static/x-admin2.2/js/canyuKaoshi.js +++ b/public/static/x-admin2.2/js/canyuKaoshi.js @@ -13,9 +13,70 @@ layui.extend({ xmSelect = layui.xmSelect; var obj = { - nianji:function(myid, data, hasNull = true){ - - } + gradeSelect: function(myid, kaoshi_id, hasNull = true) { + $.ajax({ + url: '/kaoshi/kscy/grade', + type: 'POST', + data: { + kaoshi_id: kaoshi_id + }, + success: function(result) { + 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() {}); + }, + }); + }, + + + // 参与本次考试学科 + subjectSelect: function(myid, kaoshi_id, ruxuenian, hasNull = true){ + $.ajax({ + url: '/kaoshi/kscy/subject', + type: 'POST', + data: { + kaoshi_id: kaoshi_id, + ruxuenian: ruxuenian + }, + success: function(result) { + 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接口