From 1c553d71a85f4711068f2aa04dcca6d4cddf63bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9A=E4=B8=B9ab?= <1421553879@qq.com> Date: Mon, 17 Oct 2022 01:15:28 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AB=9E=E8=B5=9B=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../static/js/jlw/competition/index.js | 63 ++++++++++++++++--- .../jlw/resourcesApplicationCourse/index.js | 6 +- .../templates/jlw/competition/index.html | 39 +++++++----- 3 files changed, 79 insertions(+), 29 deletions(-) diff --git a/web/src/main/resources/static/js/jlw/competition/index.js b/web/src/main/resources/static/js/jlw/competition/index.js index b4793eb7..6ecc37a7 100644 --- a/web/src/main/resources/static/js/jlw/competition/index.js +++ b/web/src/main/resources/static/js/jlw/competition/index.js @@ -25,9 +25,9 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) { ,where:{competitionStatuses:'1,2'} ,limit : 10, cols : [ [ // 表头 - { + /*{ type : 'checkbox' - }, + },*/ { field : 'competitionName',title : '大赛名称',align:"center" }, @@ -38,7 +38,7 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) { }, { field : 'competitionType', width : 100, - title : '大赛模式',align:"center",templet:function (d){ + title : '大赛类型',align:"center",templet:function (d){ return d.competitionType == 1?"个人赛":d.competitionType == 2?"团队赛":"-"; } }, @@ -66,9 +66,9 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) { }, { field : 'userId',title : '操作',align:"center", width : 180,templet: function (d) { - var htm = ''; - htm += ''; - htm += ''; + var htm = '编辑'; + htm += ''+(d.competitionStatus == 1?"停用":"发布")+''; + htm += '删除'; return htm; } } @@ -91,8 +91,43 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) { initToolBar:function(){ toolbar = { add : function() { // 获取选中数据 - var url = "/jlw/competition/add.do"; - Common.openDlg(url,"大赛管理/新增大赛"); + layer.open({ + type:1, + title: '新增大赛', + btn: ['确定', '关闭'], + btnAlign: 'c', + area: ['440px', '170px'], + content: '
' + + '
' + + ' ' + + '
' + + ' ' + + ' ' + + '
' + + '
' + + '
' + ,success: function (layero, index) { + form.render(); + }, + yes: function (index, layero) { + var type = $("input[name='type']:checked").val(); + console.log(type) + if($.isEmpty(type)){ + Common.info("请选择大赛类型!!") + return; + } + if(type == '1'||type == 1){ + var url = "/jlw/competition/add.do"; + Common.openDlg(url,"大赛管理/新增大赛"); + }else { + } + + layer.close(index); + }, + btn2: function (index, layero) { + layer.close(index); + } + }); }, refresh: function () {//刷新 searchForm.reset(); @@ -145,7 +180,17 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) { } }) - } + }; + /*form.on('radio(radioType)', function(data){ + console.log(data.elem) //被执行事件的元素DOM对象,一般为button对象 + console.log(data) //被执行提交的form对象,一般在存在form标签时才会返回 + + return ; + var url = "/jlw/competition/add.do"; + Common.openDlg(url,"大赛管理/新增大赛"); + + return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。 + });*/ exports('index',view); }); \ No newline at end of file diff --git a/web/src/main/resources/static/js/jlw/resourcesApplicationCourse/index.js b/web/src/main/resources/static/js/jlw/resourcesApplicationCourse/index.js index 41edbb47..38c65e96 100644 --- a/web/src/main/resources/static/js/jlw/resourcesApplicationCourse/index.js +++ b/web/src/main/resources/static/js/jlw/resourcesApplicationCourse/index.js @@ -49,17 +49,17 @@ layui.define(['form', 'laydate', 'table'], function (exports) { }, { - field: 'courseLabelType', + field: 'courseLabelId', title: '课程类别', align: "center", templet: function (d) { var courseLabelType = ""; $.each(courseLabelData, function (key, value) { - if (value.courseLabelId == d.courseLabelType) { + if (value.courseLabelId == d.courseLabelId) { courseLabelType = value.courseLabelName; } }); - var html = "\n" + " \n" + " \n" + " \n" + diff --git a/web/src/main/resources/templates/jlw/competition/index.html b/web/src/main/resources/templates/jlw/competition/index.html index e6738bcf..8ddadecf 100644 --- a/web/src/main/resources/templates/jlw/competition/index.html +++ b/web/src/main/resources/templates/jlw/competition/index.html @@ -1,37 +1,42 @@ - +
- 搜索 - 新增 - 刷新 + + 新增 + + 刷新 +