diff --git a/admin-core/src/main/resources/static/js/common.js b/admin-core/src/main/resources/static/js/common.js
index 2f800ee1..578f4cf0 100644
--- a/admin-core/src/main/resources/static/js/common.js
+++ b/admin-core/src/main/resources/static/js/common.js
@@ -551,6 +551,26 @@ var Common = {
if (r != null) return unescape(r[2]); return null; //返回参数值
},getLocalTime:function (nS) {//时间戳转换成时间格式
return new Date(parseInt(nS)).format('yyyy-MM-dd HH:mm:ss');
+ },getFormatDate:function (d) {
+ var date = new Date(d);
+ if(!$.isEmpty(d)){
+ var YY = date.getFullYear() + '-';
+ var MM =
+ (date.getMonth() + 1 < 10
+ ? '0' + (date.getMonth() + 1)
+ : date.getMonth() + 1) + '-';
+ var DD = date.getDate() < 10 ? '0' + date.getDate() : date.getDate();
+ var hh =
+ (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
+ var mm =
+ (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) +
+ ':';
+ var ss =
+ date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds();
+ return YY + MM + DD + ' ' + hh + mm + ss;
+ }else {
+ return '';
+ }
}
});
diff --git a/web/filesystem/temp/1666007693941_3_7.gif b/web/filesystem/temp/1666007693941_3_7.gif
new file mode 100644
index 00000000..abd33058
Binary files /dev/null and b/web/filesystem/temp/1666007693941_3_7.gif differ
diff --git a/web/src/main/resources/static/js/jlw/competition/add.js b/web/src/main/resources/static/js/jlw/competition/add.js
index cd90a553..b2eebc98 100644
--- a/web/src/main/resources/static/js/jlw/competition/add.js
+++ b/web/src/main/resources/static/js/jlw/competition/add.js
@@ -1,4 +1,4 @@
-layui.define([ 'form', 'laydate', 'table','element','upload','competitionApi','tree'], function(exports) {
+layui.define(['form', 'laydate', 'table', 'element', 'upload', 'competitionApi', 'tree'], function (exports) {
var form = layui.form;
var competitionApi = layui.competitionApi;
var index = layui.index;
@@ -18,12 +18,15 @@ layui.define([ 'form', 'laydate', 'table','element','upload','competitionApi','t
var tag_ = 0; //用于判断是否第一次加载编辑对话框的树结构 避免多次加载
var getTreeByCourseLabelTypes = []; //编辑对话框的树结构 数据
- if(!$.isEmpty($("input[name='competitionId']").val())){
- var ret = Common.getAjax("/jlw/competition/view.json",{competitionId:$("input[name='competitionId']").val(),part: 1});
- if(ret.code == 0){
+ if (!$.isEmpty($("input[name='competitionId']").val())) {
+ var ret = Common.getAjax("/jlw/competition/view.json", {
+ competitionId: $("input[name='competitionId']").val(),
+ part: 1
+ });
+ if (ret.code == 0) {
$("#competitionGeneralization textarea").val(Lib.repLaceltgt(ret.data.competitionGeneralizationOriginal));
- }else {
- layer.msg(ret.msg, {icon: 2,time: 1500});
+ } else {
+ layer.msg(ret.msg, {icon: 2, time: 1500});
}
}
var editor1 = Lib.editorMd("competitionGeneralization"),//大赛概况
@@ -36,8 +39,9 @@ layui.define([ 'form', 'laydate', 'table','element','upload','competitionApi','t
elem: '#test10'
, url: Common.ctxPath + "/jlw/file/update.do"
, done: function (res) {//每成功一次调用
- $("#logo").hide();
- layui.$('#uploadDemoView').removeClass('layui-hide').find('img').attr('src',Common.ctxPath + res.data.src);
+ //$("#logo").hide();
+ console.log("的是否考虑经济受到法律")
+ layui.$('#uploadDemoView').removeClass('layui-hide').find('img').attr('src', Common.ctxPath + res.data.src);
$("input[name='competitionLogo']").val(res.data.src);
}
});
@@ -48,22 +52,21 @@ layui.define([ 'form', 'laydate', 'table','element','upload','competitionApi','t
, url: Common.ctxPath + "/jlw/file/update.do"
, done: function (res) {//每成功一次调用
$("#newsPicture").hide();
- layui.$('#uploadDemoView_1').removeClass('layui-hide').find('img').attr('src',Common.ctxPath + res.data.src);
+ layui.$('#uploadDemoView_1').removeClass('layui-hide').find('img').attr('src', Common.ctxPath + res.data.src);
$("input[name='competitionNewsPicture']").val(res.data.src);
}
});
-
laydate.render({
elem: '#enrollRange'
- ,range: "至" //或 range: '~' 来自定义分割字符
- ,type: 'datetime'
- ,format: 'yyyy-MM-dd HH:mm'
- ,done: function(value, date, endDate){
- if(!$.isEmpty(value)){
+ , range: "至" //或 range: '~' 来自定义分割字符
+ , type: 'datetime'
+ , format: 'yyyy-MM-dd HH:mm'
+ , done: function (value, date, endDate) {
+ if (!$.isEmpty(value)) {
$("#addForm input[name='competitionEnrollStartTime']").val(value.split(" 至 ")[0]);
$("#addForm input[name='competitionEnrollEndTime']").val(value.split(" 至 ")[1]);
- }else {
+ } else {
$("#addForm input[name='competitionEnrollStartTime']").val("");
$("#addForm input[name='competitionEnrollEndTime']").val("");
}
@@ -71,15 +74,15 @@ layui.define([ 'form', 'laydate', 'table','element','upload','competitionApi','t
});
laydate.render({
elem: '#contestRange'
- ,range: "至" //或 range: '~' 来自定义分割字符
- ,type: 'datetime'
- ,format: 'yyyy-MM-dd HH:mm'
- ,done: function(value, date, endDate){
- if(!$.isEmpty(value)){
+ , range: "至" //或 range: '~' 来自定义分割字符
+ , type: 'datetime'
+ , format: 'yyyy-MM-dd HH:mm'
+ , done: function (value, date, endDate) {
+ if (!$.isEmpty(value)) {
$("#addForm input[name='competitionContestStartTime']").val(value.split(" 至 ")[0]);
$("#addForm input[name='competitionContestEndTime']").val(value.split(" 至 ")[1]);
//$(".renWu").show();
- }else {
+ } else {
$("#addForm input[name='competitionContestStartTime']").val("");
$("#addForm input[name='competitionContestEndTime']").val("");
// $(".renWu").hide();
@@ -91,41 +94,65 @@ layui.define([ 'form', 'laydate', 'table','element','upload','competitionApi','t
laydate.render({
elem: '#renwu3'
- ,range: "至" //或 range: '~' 来自定义分割字符
- ,type: 'datetime'
- ,format: 'yyyy-MM-dd HH:mm'
- ,done: function(value, date, endDate){
- if(!$.isEmpty(value)){
+ , range: "至" //或 range: '~' 来自定义分割字符
+ , type: 'datetime'
+ , format: 'yyyy-MM-dd HH:mm'
+ , done: function (value, date, endDate) {
+ if (!$.isEmpty(value)) {
$("#addForm input[name='competitionTaskThreeStartTime']").val(value.split(" 至 ")[0]);
$("#addForm input[name='competitionTaskThreeEndTime']").val(value.split(" 至 ")[1]);
- }else {
+ } else {
$("#addForm input[name='competitionTaskThreeStartTime']").val("");
$("#addForm input[name='competitionTaskThreeEndTime']").val("");
}
}
});
+ laydate.render({
+ elem: '#registrationStage',
+ type: 'datetime',
+ range: '到',
+ format: 'yyyy-MM-dd HH:mm:ss',
+ trigger: 'click',//解决跳闪问题
+ value: $.getFormatDate($("#registrationStage").attr("start-time")) + $.isEmpty($.getFormatDate($("#registrationStage").attr("start-time")))?'':" 到 " + $.getFormatDate($("#registrationStage").attr("end-time"))
+ });
+ laydate.render({
+ elem: '#trialStage',
+ type: 'datetime',
+ range: '到',
+ format: 'yyyy-MM-dd HH:mm:ss',
+ trigger: 'click',//解决跳闪问题
+ value: $.getFormatDate($("#trialStage").attr("start-time")) + $.isEmpty($.getFormatDate($("#trialStage").attr("start-time")))?'':" 到 " + $.getFormatDate($("#trialStage").attr("end-time"))
+ });
+ laydate.render({
+ elem: '#competitionStage'
+ , type: 'datetime'
+ , range: '到'
+ , format: 'yyyy-MM-dd HH:mm:ss'
+ , trigger: 'click',//解决跳闪问题
+ value: $.getFormatDate($("#competitionStage").attr("start-time")) + $.isEmpty($.getFormatDate($("#competitionStage").attr("start-time")))?'':" 到 " + $.getFormatDate($("#competitionStage").attr("end-time"))
+ });
var view = {
- init:function(){
- Lib.initGenrealForm($("#addForm"),form);
+ init: function () {
+ Lib.initGenrealForm($("#addForm"), form);
this.initSubmit();
},
- initSubmit:function(){
- $("#addButton").click(function(){
+ initSubmit: function () {
+ $("#addButton").click(function () {
saveInfo(1);//先保存再发布
var param = {
- competitionStatus:1,
- competitionId:$("input[name='competitionId']").val()
+ competitionStatus: 1,
+ competitionId: $("input[name='competitionId']").val()
}
- if($.isEmpty(param.competitionId)){
+ if ($.isEmpty(param.competitionId)) {
layer.msg("请先添加大赛!", {
offset: ['50%'],
icon: 2,
time: 1500 //2秒关闭(如果不配置,默认是3秒)
});
- return ;
+ return;
}
- var ret = Common.postAjax("/jlw/competition/editCompetitionStatus.json",param);
+ var ret = Common.postAjax("/jlw/competition/editCompetitionStatus.json", param);
layer.msg(ret.code == 0 ? "发布成功!" : ret.msg, {
offset: ['50%'],
icon: ret.code == 0 ? 1 : 2,
@@ -137,8 +164,8 @@ layui.define([ 'form', 'laydate', 'table','element','upload','competitionApi','t
}
});
});
-
- $("#addButton-cancel").click(function(){
+
+ $("#addButton-cancel").click(function () {
Lib.closeFrame();
});
}
@@ -146,8 +173,8 @@ layui.define([ 'form', 'laydate', 'table','element','upload','competitionApi','t
//监听tab切换
var onSign = 0; //当前显示的tab
- element.on('tab(docDemoTabBrief)', function(){
- saveInfo(1,onSign);
+ element.on('tab(docDemoTabBrief)', function () {
+ saveInfo(1, onSign);
var sign = this.getAttribute('lay-id');
loadView(sign);
});
@@ -155,24 +182,24 @@ layui.define([ 'form', 'laydate', 'table','element','upload','competitionApi','t
//切换大赛模式 1:个人赛 2:团队赛
form.on('select(select_competitionType)', function (obj) {
competitionType_ = obj.value;
- if(competitionType_ == 1){
+ if (competitionType_ == 1) {
$(".competitionTeamLimit").hide();
$("input[name='competitionTeamLimit_1'],input[name='competitionTeamLimit_2']").val("");
- }else if(competitionType_ == 2){
+ } else if (competitionType_ == 2) {
$(".competitionTeamLimit").show();
}
});
//提交保存数据
- function submitInfo(param,t){
+ function submitInfo(param, t) {
var url = "/jlw/competition/add.json";
- if(!$.isEmpty(param.competitionId)){
+ if (!$.isEmpty(param.competitionId)) {
url = "/jlw/competition/edit.json";
}
- var ret = Common.postAjax(url,param);
- if(ret.code == 0){
- if(t != 1){
- layer.msg("保存成功!",{
+ var ret = Common.postAjax(url, param);
+ if (ret.code == 0) {
+ if (t != 1) {
+ layer.msg("保存成功!", {
offset: ['50%'],
icon: 1,
time: 1500 //2秒关闭(如果不配置,默认是3秒)
@@ -181,8 +208,8 @@ layui.define([ 'form', 'laydate', 'table','element','upload','competitionApi','t
$("input[name='competitionId']").val(ret.data);
parent.Lib.tableRefresh();
//showTitle();
- }else {
- layer.msg(ret.msg,{
+ } else {
+ layer.msg(ret.msg, {
offset: ['50%'],
icon: 2,
time: 1500 //2秒关闭(如果不配置,默认是3秒)
@@ -192,127 +219,134 @@ layui.define([ 'form', 'laydate', 'table','element','upload','competitionApi','t
}
//上一步
- $(".syb").click(function (){
+ $(".syb").click(function () {
saveInfo(1);
var i = $(".layui-tab-brief .layui-this").attr("lay-id");//当前操作tab位置
//切换相应位置tab
$(".layui-tab-brief .layui-this").removeClass("layui-this");
- $(".layui-tab-brief .layui-tab-title li:eq("+ (i - 1) +")").addClass("layui-this");
+ $(".layui-tab-brief .layui-tab-title li:eq(" + (i - 1) + ")").addClass("layui-this");
$(".layui-tab-brief .layui-show").removeClass("layui-show");
- $(".layui-tab-brief .layui-tab-content .layui-tab-item:eq("+ (i - 1) +")").addClass("layui-show");
+ $(".layui-tab-brief .layui-tab-content .layui-tab-item:eq(" + (i - 1) + ")").addClass("layui-show");
loadView(i - 1);
});
//下一步
- $(".xyb").click(function (){
+ $(".xyb").click(function () {
saveInfo(1);
var i = $(".layui-tab-brief .layui-this").attr("lay-id");//当前操作tab位置
//切换相应位置tab
$(".layui-tab-brief .layui-this").removeClass("layui-this");
- $(".layui-tab-brief .layui-tab-title li:eq("+ (Number(i) + 1) +")").addClass("layui-this");
+ $(".layui-tab-brief .layui-tab-title li:eq(" + (Number(i) + 1) + ")").addClass("layui-this");
$(".layui-tab-brief .layui-show").removeClass("layui-show");
- $(".layui-tab-brief .layui-tab-content .layui-tab-item:eq("+ (Number(i) + 1) +")").addClass("layui-show");
+ $(".layui-tab-brief .layui-tab-content .layui-tab-item:eq(" + (Number(i) + 1) + ")").addClass("layui-show");
loadView(Number(i) + 1);
});
//上一步下一步 时 加载 //sign = 0:大赛概况 1:竞赛时间 2:参赛学员 3:大赛任务 4:成绩权重 5:大赛评委
- function loadView(sign){
+ function loadView(sign) {
onSign = sign;
- if(sign == 0){
+ if (sign == 0) {
$(".syb").hide();
$(".xyb").show();
$(".sbx").show();
- }else if(sign == 1 || sign == 2 || sign == 3 || sign == 4 || sign == 5){
+ } else if (sign == 1 || sign == 2 || sign == 3 || sign == 4 || sign == 5) {
$(".syb").show();
$(".xyb").show();
$(".sbx").show();
- if(sign == 2){
+ if (sign == 2) {
loadDSRW();
}
- if(sign == 5 && $.isEmpty(editor2)){
- if(!$.isEmpty($("input[name='competitionId']").val())){
- var ret = Common.getAjax("/jlw/competition/view.json",{competitionId:$("input[name='competitionId']").val(),part: 7});
- if(ret.code == 0){
+ if (sign == 5 && $.isEmpty(editor2)) {
+ if (!$.isEmpty($("input[name='competitionId']").val())) {
+ var ret = Common.getAjax("/jlw/competition/view.json", {
+ competitionId: $("input[name='competitionId']").val(),
+ part: 7
+ });
+ if (ret.code == 0) {
$("#competitionAwardList textarea").val(Lib.repLaceltgt(ret.data.competitionAwardListOriginal));
- }else {
- layer.msg(ret.msg, {icon: 2,time: 1500});
+ } else {
+ layer.msg(ret.msg, {icon: 2, time: 1500});
}
}
editor2 = Lib.editorMd("competitionAwardList");
}
- if(sign == 4 && $.isEmpty(editor4)){
- if(!$.isEmpty($("input[name='competitionId']").val())){
- var ret = Common.getAjax("/jlw/competition/view.json",{competitionId:$("input[name='competitionId']").val(),part: 9});
- if(ret.code == 0){
+ if (sign == 4 && $.isEmpty(editor4)) {
+ if (!$.isEmpty($("input[name='competitionId']").val())) {
+ var ret = Common.getAjax("/jlw/competition/view.json", {
+ competitionId: $("input[name='competitionId']").val(),
+ part: 9
+ });
+ if (ret.code == 0) {
$("#competitionCommonProblem textarea").val(Lib.repLaceltgt(ret.data.competitionCommonProblemOriginal));
- }else {
- layer.msg(ret.msg, {icon: 2,time: 1500});
+ } else {
+ layer.msg(ret.msg, {icon: 2, time: 1500});
}
}
editor4 = Lib.editorMd("competitionCommonProblem");
}
- }else if(sign == 6){
+ } else if (sign == 6) {
$(".syb").show();
$(".xyb").hide();
$(".sbx").show();
- if($.isEmpty(editor3)) {
+ if ($.isEmpty(editor3)) {
editor3 = Lib.editorMd("competitionNewsContent");
}
- }else{
+ } else {
$(".sbx").hide();
}
- if(sign == 2 || sign == 5){//上一步、保存、下一步的位置
- $(".sbx").css("margin-left",0);
- }else if(sign == 0 || sign == 1){
- $(".sbx").css("margin-left",190);
- }else {
- $(".sbx").css("margin-left",60);
+ if (sign == 2 || sign == 5) {//上一步、保存、下一步的位置
+ $(".sbx").css("margin-left", 0);
+ } else if (sign == 0 || sign == 1) {
+ $(".sbx").css("margin-left", 190);
+ } else {
+ $(".sbx").css("margin-left", 60);
}
//保存的位置显示
- if(sign == 0 || sign == 3 || sign == 4){
+ if (sign == 0 || sign == 3 || sign == 4) {
$(".bc").removeClass("bc_c").removeClass("bc_c_").addClass("bc_r").show();
- }else if(sign == 2 || sign == 5){
+ } else if (sign == 2 || sign == 5) {
$(".bc").addClass("bc_c").removeClass("bc_c_").removeClass("bc_r").show();
- }else if(sign == 1){
+ } else if (sign == 1) {
$(".bc").removeClass("bc_c").addClass("bc_c_").removeClass("bc_r").show();
- }else {
+ } else {
$(".bc").hide();
}
}
+
//保存获奖名单
- $("#addCompetitionAwardList").click(function (){
+ $("#addCompetitionAwardList").click(function () {
var competitionAwardList = editor2.getPreviewedHTML();//获奖名单 html
var competitionAwardListOriginal = Lib.repLaceString(editor2.getMarkdown());//获奖名单 Markdown 源码
var param = {
- competitionAwardList:competitionAwardList,
- competitionAwardListOriginal:competitionAwardListOriginal,
- competitionId:$("input[name='competitionId']").val()
+ competitionAwardList: competitionAwardList,
+ competitionAwardListOriginal: competitionAwardListOriginal,
+ competitionId: $("input[name='competitionId']").val()
}
submitInfo(param);
});
//保存大赛动态
- $("#addCompetitionNews").click(function (){
+ $("#addCompetitionNews").click(function () {
var competitionNewsContent = editor3.getPreviewedHTML();//动态内容 html
var competitionNewsContentOriginal = Lib.repLaceString(editor3.getMarkdown());//动态内容 Markdown 源码
- if($.isEmpty(competitionNewsContent)){
- layer.msg("请填写大赛动态详情!",{icon:2});
- return ;
+ if ($.isEmpty(competitionNewsContent)) {
+ layer.msg("请填写大赛动态详情!", {icon: 2});
+ return;
}
var competitionNewsPicture = $("input[name='competitionNewsPicture']").val();//动态图片
- if($.isEmpty(competitionNewsPicture)){
- layer.msg("请上传动态图!",{icon:2});
- return ;
+ if ($.isEmpty(competitionNewsPicture)) {
+ layer.msg("请上传动态图!", {icon: 2});
+ return;
}
- var ret = Common.postAjax("/jlw/competitionNews/add.json",{
- competitionNewsContent:competitionNewsContent,
- competitionNewsContentOriginal:competitionNewsContentOriginal,
- competitionNewsPicture:competitionNewsPicture,
- competitionId:$("input[name='competitionId']").val()
- });
+ var ret = Common.postAjax("/jlw/competitionNews/add.json", {
+ competitionNewsContent: competitionNewsContent,
+ competitionNewsContentOriginal: competitionNewsContentOriginal,
+ competitionNewsPicture: competitionNewsPicture,
+ competitionId: $("input[name='competitionId']").val()
+ });
layer.msg(ret.code == 0 ? "保存成功!" : ret.msg, {
offset: ['50%'],
icon: ret.code == 0 ? 1 : 2,
@@ -322,10 +356,10 @@ layui.define([ 'form', 'laydate', 'table','element','upload','competitionApi','t
var htm = '
' +
' ' +
' ' +
- '
'+ret.data.competitionNewsAddTime+'
' +
+ '
' + ret.data.competitionNewsAddTime + '
' +
'
' +
- '
+')
' +
- '
'+ret.data.competitionNewsContent+'
' +
+ '
 + ')
' +
+ '
' + ret.data.competitionNewsContent + '
' +
'
' +
'
' +
' ';
@@ -334,27 +368,27 @@ layui.define([ 'form', 'laydate', 'table','element','upload','competitionApi','t
$("input[name='competitionNewsPicture']").val("");//动态图片
$("#newsPicture").show();
- layui.$('#uploadDemoView_1').addClass('layui-hide').find('img').attr('src',"");
+ layui.$('#uploadDemoView_1').addClass('layui-hide').find('img').attr('src', "");
}
});
});
- //保存常见问题
- $("#addCommonProblem").click(function (){
+ //保存常见问题
+ $("#addCommonProblem").click(function () {
var competitionCommonProblem = editor4.getPreviewedHTML();//常见问题内容 html
var competitionCommonProblemOriginal = Lib.repLaceString(editor4.getMarkdown());//常见问题内容 Markdown 源码
var param = {
- competitionCommonProblem:competitionCommonProblem,
- competitionCommonProblemOriginal:competitionCommonProblemOriginal,
- competitionId:$("input[name='competitionId']").val()
+ competitionCommonProblem: competitionCommonProblem,
+ competitionCommonProblemOriginal: competitionCommonProblemOriginal,
+ competitionId: $("input[name='competitionId']").val()
}
submitInfo(param);
});
//显示获奖名单、大赛动态、常见问题
- function showTitle(){
+ function showTitle() {
$(".hjmd,.dsdt,.cjwt").show();
}
@@ -364,12 +398,12 @@ layui.define([ 'form', 'laydate', 'table','element','upload','competitionApi','t
$(".see_competition_user").click(see_c_user);
//移除参赛学员 (个人)
$(".del_competition_user").click(del_c_user);
- $(".export_gr").click(function (){ //导出个人赛参赛人员信息
- window.open(Common.ctxPath + "/jlw/competition/export.json?competitionId="+ $("input[name='competitionId']").val()+"&beCompetitionStudent=1");
+ $(".export_gr").click(function () { //导出个人赛参赛人员信息
+ window.open(Common.ctxPath + "/jlw/competition/export.json?competitionId=" + $("input[name='competitionId']").val() + "&beCompetitionStudent=1");
});
- $(".export_td").click(function (){ //导出团队赛参赛人员信息
- window.open(Common.ctxPath + "/jlw/competition/export.json?competitionId="+ $("input[name='competitionId']").val()+"&beCompetitionStudent=1");
+ $(".export_td").click(function () { //导出团队赛参赛人员信息
+ window.open(Common.ctxPath + "/jlw/competition/export.json?competitionId=" + $("input[name='competitionId']").val() + "&beCompetitionStudent=1");
});
@@ -384,24 +418,24 @@ layui.define([ 'form', 'laydate', 'table','element','upload','competitionApi','t
//搜索未参赛人 (团队)
$(".select_student_td").click(select_student_td);
- function select_student(){
+ function select_student() {
var studentTempJson = new Array();
- $.each(studentTempMap,function(i,item){
+ $.each(studentTempMap, function (i, item) {
studentTempJson.push({
- studentsId:item.studentsId,
- teamName:item.teamName,
- studentsIds:item.studentsIds
+ studentsId: item.studentsId,
+ teamName: item.teamName,
+ studentsIds: item.studentsIds
});
});
- var si = onTag == 1?3:onTag == 3?2:onTag == 4?3:"";
+ var si = onTag == 1 ? 3 : onTag == 3 ? 2 : onTag == 4 ? 3 : "";
competitionStuTable[onTag].reload({
where: {
- studentTempJson:JSON.stringify(studentTempJson),
- competitionId:$("input[name='competitionId']").val(),
- beCompetitionStudent:1,
- studentName:$(".csyh input[name='studentName']").val(),
- classIds:!$.isEmpty(treeList[si])?treeList[si].getValue('value').join(","):"",
- studentStatuses:"1,2"
+ studentTempJson: JSON.stringify(studentTempJson),
+ competitionId: $("input[name='competitionId']").val(),
+ beCompetitionStudent: 1,
+ studentName: $(".csyh input[name='studentName']").val(),
+ classIds: !$.isEmpty(treeList[si]) ? treeList[si].getValue('value').join(",") : "",
+ studentStatuses: "1,2"
},
page: {
curr: 1
@@ -409,23 +443,23 @@ layui.define([ 'form', 'laydate', 'table','element','upload','competitionApi','t
});
}
- function select_student_no(){
+ function select_student_no() {
var studentTempJson = new Array();
- $.each(studentTempMap,function(i,item){
+ $.each(studentTempMap, function (i, item) {
studentTempJson.push({
- studentsId:item.studentsId,
- teamName:item.teamName,
- studentsIds:item.studentsIds
+ studentsId: item.studentsId,
+ teamName: item.teamName,
+ studentsIds: item.studentsIds
});
});
- var si = onTag == 1?3:onTag == 3?2:onTag == 4?3:"";
+ var si = onTag == 1 ? 3 : onTag == 3 ? 2 : onTag == 4 ? 3 : "";
competitionStuTable[onTag].reload({
where: {
- studentTempJson:JSON.stringify(studentTempJson),
- competitionId:$("input[name='competitionId']").val(),
- beCompetitionStudent:2,
- studentName:$(".csyh input[name='studentName_no']").val(),
- classIds:!$.isEmpty(treeList[si])?treeList[si].getValue('value').join(","):""
+ studentTempJson: JSON.stringify(studentTempJson),
+ competitionId: $("input[name='competitionId']").val(),
+ beCompetitionStudent: 2,
+ studentName: $(".csyh input[name='studentName_no']").val(),
+ classIds: !$.isEmpty(treeList[si]) ? treeList[si].getValue('value').join(",") : ""
},
page: {
curr: 1
@@ -433,47 +467,48 @@ layui.define([ 'form', 'laydate', 'table','element','upload','competitionApi','t
});
}
- function select_student_td(){
+ function select_student_td() {
var studentTempJson = new Array();
- $.each(studentTempMap,function(i,item){
+ $.each(studentTempMap, function (i, item) {
studentTempJson.push({
- studentsId:item.studentsId,
- teamName:item.teamName,
- studentsIds:item.studentsIds
+ studentsId: item.studentsId,
+ teamName: item.teamName,
+ studentsIds: item.studentsIds
});
});
- var si = onTag == 1?3:onTag == 3?2:onTag == 4?3:"";
+ var si = onTag == 1 ? 3 : onTag == 3 ? 2 : onTag == 4 ? 3 : "";
competitionStuTable[onTag].reload({
where: {
- studentTempJson:JSON.stringify(studentTempJson),
- competitionId:$("input[name='competitionId']").val(),
- beCompetitionStudent:1,
- studentName:$(".csyh input[name='studentName_td']").val(),
- classIds:!$.isEmpty(treeList[si])?treeList[si].getValue('value').join(","):"",
- studentStatuses:"1,2"
+ studentTempJson: JSON.stringify(studentTempJson),
+ competitionId: $("input[name='competitionId']").val(),
+ beCompetitionStudent: 1,
+ studentName: $(".csyh input[name='studentName_td']").val(),
+ classIds: !$.isEmpty(treeList[si]) ? treeList[si].getValue('value').join(",") : "",
+ studentStatuses: "1,2"
},
page: {
curr: 1
}
});
}
- function search_dz(){
+
+ function search_dz() {
var studentTempJson = new Array();
- $.each(studentTempMap,function(i,item){
+ $.each(studentTempMap, function (i, item) {
studentTempJson.push({
- studentsId:item.studentsId,
- teamName:item.teamName,
- studentsIds:item.studentsIds
+ studentsId: item.studentsId,
+ teamName: item.teamName,
+ studentsIds: item.studentsIds
});
});
- var si = onTag == 1?3:onTag == 3?2:onTag == 4?3:"";
+ var si = onTag == 1 ? 3 : onTag == 3 ? 2 : onTag == 4 ? 3 : "";
competitionStuTable[onTag].reload({
where: {
- studentTempJson:JSON.stringify(studentTempJson),
- competitionId:$("input[name='competitionId']").val(),
- beCompetitionStudent:2,
- studentName:$(".csyh input[name='studentName_td']").val(),
- classIds:!$.isEmpty(treeList[si])?treeList[si].getValue('value').join(","):""
+ studentTempJson: JSON.stringify(studentTempJson),
+ competitionId: $("input[name='competitionId']").val(),
+ beCompetitionStudent: 2,
+ studentName: $(".csyh input[name='studentName_td']").val(),
+ classIds: !$.isEmpty(treeList[si]) ? treeList[si].getValue('value').join(",") : ""
},
page: {
curr: 1
@@ -490,13 +525,13 @@ layui.define([ 'form', 'laydate', 'table','element','upload','competitionApi','t
var treeList = [];
//监听是否允许自主报名切换 1:允许 2:不允许
form.on('radio(zzbm)', function (obj) {
- if(obj.value == 1){
+ if (obj.value == 1) {
$(".demo1").show();
$(".demo4").show();
- if($.isEmpty(treeList[1])){
+ if ($.isEmpty(treeList[1])) {
treeList[1] = xmSelect.render({
el: document.querySelector('#demo1'),
- name:"onCourseInfoId",
+ name: "onCourseInfoId",
autoRow: true,
theme: {
color: '#1e9fff',
@@ -521,19 +556,19 @@ layui.define([ 'form', 'laydate', 'table','element','upload','competitionApi','t
},
filterable: true,
height: '300px',
- data: function(){
+ data: function () {
return getTreeByCourseLabelTypes
},
});
}
- }else {
+ } else {
$(".demo1").hide();
$(".demo4").hide();
}
});
//选择参赛人
- function see_c_user(){
+ function see_c_user() {
layer.open({
type: 1,
title: "选择参赛学员",
@@ -546,53 +581,53 @@ layui.define([ 'form', 'laydate', 'table','element','upload','competitionApi','t
loadCompetitionUser(1);
}, yes: function (index) {
var studentTempJson = new Array();
- if(!$.isEmpty(competitionStuIds_no)){
- if((competitionStuIds_no +"").indexOf(",") < 0){
+ if (!$.isEmpty(competitionStuIds_no)) {
+ if ((competitionStuIds_no + "").indexOf(",") < 0) {
studentTempJson.push({
- studentsId:competitionStuIds_no
+ studentsId: competitionStuIds_no
});
- }else {
+ } else {
var info = (competitionStuIds_no).split(",");
- for(var i = 0;i编辑";
- }else {
+ } else {
return (d.teamName || ' ') + "编辑";
}
}
- },{
- field : 'studentName',
- title : '队长',align: "center",hide:tag == 2?false:true,width:100
- },{
- field : 'teamStudentNames',
- title : '组员',align: "center",hide:tag == 2?false:true,templet:function (d) {
- if(!$.isEmpty(d.teamStudentNames)){
+ }, {
+ field: 'studentName',
+ title: '队长', align: "center", hide: tag == 2 ? false : true, width: 100
+ }, {
+ field: 'teamStudentNames',
+ title: '组员', align: "center", hide: tag == 2 ? false : true, templet: function (d) {
+ if (!$.isEmpty(d.teamStudentNames)) {
var html = "";
var teamStudentsIds = d.teamStudentsIds.split(",");
- $.each(d.teamStudentNames.split(","),function(n,v) {
- html += ""+v+"ဇ";
- if(n < d.teamStudentNames.split(",").length - 1){
+ $.each(d.teamStudentNames.split(","), function (n, v) {
+ html += "" + v + "ဇ";
+ if (n < d.teamStudentNames.split(",").length - 1) {
html += "/";
}
});
return html;
- }else {
+ } else {
return "";
}
}
- },{
- field : 'classIdText',width:100,
- title : '操作',align: "center",hide:tag == 2?false:true,templet:function (d){
+ }, {
+ field: 'classIdText', width: 100,
+ title: '操作', align: "center", hide: tag == 2 ? false : true, templet: function (d) {
return '选择组员';
}
}
- ] ],done: function (res, curr, count) {
- if(tag == 2){ //团队赛
- $("td[data-field='teamName']").click(function (){ //监听点击团队编辑时只有编辑显示
+ ]], done: function (res, curr, count) {
+ if (tag == 2) { //团队赛
+ $("td[data-field='teamName']").click(function () { //监听点击团队编辑时只有编辑显示
var this_ = $(this);
- setTimeout(function (){
- if(this_.find("input").val() == " 编辑" || this_.find("input").val() == "编辑"){
- this_.find("input").val(this_.find("input").val().replace("编辑","").replace(/ /g,""));
+ setTimeout(function () {
+ if (this_.find("input").val() == " 编辑" || this_.find("input").val() == "编辑") {
+ this_.find("input").val(this_.find("input").val().replace("编辑", "").replace(/ /g, ""));
}
- },1);
+ }, 1);
});
- $(".dy i").click(function (){
+ $(".dy i").click(function () {
var studentId = $(this).attr("studentId");//队长ID
var teamStudentsIds = $(this).attr("teamStudentsIds");//队员ID
- studentTempMap[studentId].studentsIds = Lib.stringRemove(studentTempMap[studentId].studentsIds,teamStudentsIds);
+ studentTempMap[studentId].studentsIds = Lib.stringRemove(studentTempMap[studentId].studentsIds, teamStudentsIds);
$(this).parent().next().remove();
$(this).parent().remove();
});
}
- if(!$.isEmpty(res.classIds) && res.classIds != -1){
- if($.isEmpty(treeList[1])){
+ if (!$.isEmpty(res.classIds) && res.classIds != -1) {
+ if ($.isEmpty(treeList[1])) {
treeList[1] = xmSelect.render({
el: document.querySelector('#demo1'),
- name:"onCourseInfoId",
+ name: "onCourseInfoId",
autoRow: true,
theme: {
color: '#1e9fff',
@@ -734,7 +776,7 @@ layui.define([ 'form', 'laydate', 'table','element','upload','competitionApi','t
showLine: true,
simple: false,
indent: 20,
- },model: {
+ }, model: {
label: {
type: 'block',
block: {
@@ -747,17 +789,17 @@ layui.define([ 'form', 'laydate', 'table','element','upload','competitionApi','t
},
filterable: true,
height: '300px',
- data: function(){
+ data: function () {
return getTreeByCourseLabelTypes
},
- hide:function(){
+ hide: function () {
loadTreeList4();
}
});
- loadTreeList4(res.classIds,res.excludedStudentIds);
+ loadTreeList4(res.classIds, res.excludedStudentIds);
}
- $("input[name='classIds'][value='1']").prop("checked",true);
- $("input[name='classIds'][value='2']").prop("checked",false);
+ $("input[name='classIds'][value='1']").prop("checked", true);
+ $("input[name='classIds'][value='2']").prop("checked", false);
$(".demo1").show();
$(".demo4").show();
treeList[1].append(res.classIds.split(","));
@@ -765,25 +807,25 @@ layui.define([ 'form', 'laydate', 'table','element','upload','competitionApi','t
}
//tag = 个人赛(0:已选参赛人 1:未选参赛人) 团队赛(2:已选参赛人 3:选队长 4:未选参赛人团队)
- if(tag == 0 || tag == 2){
+ if (tag == 0 || tag == 2) {
studentTempMap = res.studentTempMap;
}
- var ta = tag == 0?'studentTable':tag==1 || tag == 4 ?"studentTable_no":tag == 2?'studentTable_td':tag ==3?"studentTable_no_dz":"";
- if(tag == 0){
- Lib.tableFX(this,table.cache[ta],competitionStuIds,'studentId'); //回显
- }else if(tag ==3){
- Lib.tableFX(this,table.cache[ta],competitionStuIds_no_dz,'studentId'); //回显
- }else if(tag == 1 || tag == 2 || tag ==4){
- Lib.tableFX(this,table.cache[ta],competitionStuIds_no,'studentId'); //回显
+ var ta = tag == 0 ? 'studentTable' : tag == 1 || tag == 4 ? "studentTable_no" : tag == 2 ? 'studentTable_td' : tag == 3 ? "studentTable_no_dz" : "";
+ if (tag == 0) {
+ Lib.tableFX(this, table.cache[ta], competitionStuIds, 'studentId'); //回显
+ } else if (tag == 3) {
+ Lib.tableFX(this, table.cache[ta], competitionStuIds_no_dz, 'studentId'); //回显
+ } else if (tag == 1 || tag == 2 || tag == 4) {
+ Lib.tableFX(this, table.cache[ta], competitionStuIds_no, 'studentId'); //回显
}
}
});
- if(tag == 1 || tag == 3 || tag == 4){ //选择队长对话框
- var si = tag == 1?3:tag == 3?2:tag == 4?3:"";
- if($.isEmpty(treeList[si])){
+ if (tag == 1 || tag == 3 || tag == 4) { //选择队长对话框
+ var si = tag == 1 ? 3 : tag == 3 ? 2 : tag == 4 ? 3 : "";
+ if ($.isEmpty(treeList[si])) {
treeList[si] = xmSelect.render({
- el: document.querySelector('#demo'+si),
- name:"onCourseInfoId",
+ el: document.querySelector('#demo' + si),
+ name: "onCourseInfoId",
autoRow: true,
theme: {
color: '#1e9fff',
@@ -797,21 +839,21 @@ layui.define([ 'form', 'laydate', 'table','element','upload','competitionApi','t
},
filterable: true,
height: '300px',
- data: function(){
+ data: function () {
return getTreeByCourseLabelTypes
}
});
$("#demo" + si + " .xm-search").addClass("layui-row").append
- ('')
- .find("input").css("width","300px").css("float","left");
- $('#demo' +si+' .all_'+si).click(function (){
- if((tag == 1 || tag == 3 || tag == 4) && treeList[si].getValue("value").length > 0){
- var ret = Common.getAjax("/jlw/competition/getListByClassIds.json",{classIds:treeList[si].getValue("value").join(",")});
- if(ret.code == 0){
- if(tag == 3 && !$.isEmpty(ret.data)){
+ ('')
+ .find("input").css("width", "300px").css("float", "left");
+ $('#demo' + si + ' .all_' + si).click(function () {
+ if ((tag == 1 || tag == 3 || tag == 4) && treeList[si].getValue("value").length > 0) {
+ var ret = Common.getAjax("/jlw/competition/getListByClassIds.json", {classIds: treeList[si].getValue("value").join(",")});
+ if (ret.code == 0) {
+ if (tag == 3 && !$.isEmpty(ret.data)) {
competitionStuIds_no_dz = ret.data;
}
- if((tag == 1 || tag == 4) && !$.isEmpty(ret.data)){
+ if ((tag == 1 || tag == 4) && !$.isEmpty(ret.data)) {
competitionStuIds_no = ret.data;
}
competitionStuTable[onTag].reload({
@@ -819,20 +861,20 @@ layui.define([ 'form', 'laydate', 'table','element','upload','competitionApi','t
curr: 1
}
});
- }else {
+ } else {
layer.msg(ret.msg);
}
}
});
- }else {
+ } else {
treeList[si].setValue([]);
}
}
//编辑队名
- table.on('edit(studentTable_td)', function(obj){ //注:edit是固定事件名,test是table原始容器的属性 lay-filter="对应的值"
+ table.on('edit(studentTable_td)', function (obj) { //注:edit是固定事件名,test是table原始容器的属性 lay-filter="对应的值"
// console.log(obj.value); //得到修改后的值
// console.log(obj.field); //当前编辑的字段名
// console.log(obj.data); //所在行的所有相关数据
@@ -840,137 +882,137 @@ layui.define([ 'form', 'laydate', 'table','element','upload','competitionApi','t
});
//监听选择与取消已报名学生 注:实现了分页也可以选择
- table.on('checkbox(studentTable)', function(obj){
- if(obj.checked){ //选中
+ table.on('checkbox(studentTable)', function (obj) {
+ if (obj.checked) { //选中
var student = obj.data;
- if(obj.type == "all"){//全选
+ if (obj.type == "all") {//全选
var checkStatus = table.checkStatus('studentTable').data;
- for(var i = 0; i < checkStatus.length;i++){
- if((","+competitionStuIds+",").indexOf(checkStatus[i].studentId) < 0){
- if(!$.isEmpty(competitionStuIds)){
+ for (var i = 0; i < checkStatus.length; i++) {
+ if (("," + competitionStuIds + ",").indexOf(checkStatus[i].studentId) < 0) {
+ if (!$.isEmpty(competitionStuIds)) {
competitionStuIds += "," + checkStatus[i].studentId;
- }else {
+ } else {
competitionStuIds = checkStatus[i].studentId;
}
}
}
- }else {
- if(!$.isEmpty(competitionStuIds)){
+ } else {
+ if (!$.isEmpty(competitionStuIds)) {
competitionStuIds += "," + obj.data.studentId;
- }else {
+ } else {
competitionStuIds = obj.data.studentId;
}
}
- }else{//取消全选
- if(obj.type == "all"){//全选
+ } else {//取消全选
+ if (obj.type == "all") {//全选
var checkStatus = table.cache["studentTable"];
- for(var i = 0; i移除';
}
}
- ] ],done: function (res, curr, count) {
- if(tag == 1){
+ ]], done: function (res, curr, count) {
+ if (tag == 1) {
tempTeacherIds = res.tempTeacherIds;
}
- if(tag == 1){
- Lib.tableFX(this,table.cache['teacherTable'],teacherIds,'teacherId'); //回显
- }else if(tag == 2){
- Lib.tableFX(this,table.cache['teacherTable_no'],teacherIds_no,'teacherId'); //回显
+ if (tag == 1) {
+ Lib.tableFX(this, table.cache['teacherTable'], teacherIds, 'teacherId'); //回显
+ } else if (tag == 2) {
+ Lib.tableFX(this, table.cache['teacherTable_no'], teacherIds_no, 'teacherId'); //回显
}
}
});
//监听选择与取消已报名学生 注:实现了分页也可以选择
- table.on('checkbox(teacherTable)', function(obj){
- if(obj.checked){ //选中
+ table.on('checkbox(teacherTable)', function (obj) {
+ if (obj.checked) { //选中
var student = obj.data;
- if(obj.type == "all"){//全选
+ if (obj.type == "all") {//全选
var checkStatus = table.checkStatus('teacherTable').data;
- for(var i = 0; i < checkStatus.length;i++){
- if((","+teacherIds+",").indexOf(checkStatus[i].teacherId) < 0){
- if(!$.isEmpty(teacherIds)){
+ for (var i = 0; i < checkStatus.length; i++) {
+ if (("," + teacherIds + ",").indexOf(checkStatus[i].teacherId) < 0) {
+ if (!$.isEmpty(teacherIds)) {
teacherIds += "," + checkStatus[i].teacherId;
- }else {
+ } else {
teacherIds = checkStatus[i].teacherId;
}
}
}
- }else {
- if(!$.isEmpty(teacherIds)){
+ } else {
+ if (!$.isEmpty(teacherIds)) {
teacherIds += "," + obj.data.teacherId;
- }else {
+ } else {
teacherIds = obj.data.teacherId;
}
}
- }else{//取消全选
- if(obj.type == "all"){//全选
+ } else {//取消全选
+ if (obj.type == "all") {//全选
var checkStatus = table.cache["teacherTable"];
- for(var i = 0; i
-
+