|
|
|
@ -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 = '<button type="button" class="layui-btn layui-btn-xs" lay-event="edit">编辑</button></a>';
|
|
|
|
|
htm += '<button type="button" class="layui-btn layui-btn-xs" lay-event="editStatus">'+(d.competitionStatus == 1?"停用":"发布")+'</button></a>';
|
|
|
|
|
htm += '<button type="button" class="layui-btn layui-btn-xs" lay-event="del">删除</button></a>';
|
|
|
|
|
var htm = '<a class="layui-table-link" lay-event="edit">编辑</a>';
|
|
|
|
|
htm += '<a class="layui-table-link" lay-event="editStatus">'+(d.competitionStatus == 1?"停用":"发布")+'</a>';
|
|
|
|
|
htm += '<a class="layui-table-link" lay-event="del">删除</a>';
|
|
|
|
|
return htm;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -91,8 +91,43 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) {
|
|
|
|
|
initToolBar:function(){
|
|
|
|
|
toolbar = {
|
|
|
|
|
add : function() { // 获取选中数据
|
|
|
|
|
layer.open({
|
|
|
|
|
type:1,
|
|
|
|
|
title: '新增大赛',
|
|
|
|
|
btn: ['确定', '关闭'],
|
|
|
|
|
btnAlign: 'c',
|
|
|
|
|
area: ['440px', '170px'],
|
|
|
|
|
content: ' <div class="layui-form" style="margin-top: 5px">' +
|
|
|
|
|
'<div class="layui-form-item">' +
|
|
|
|
|
' <label class="layui-form-label">大赛类型:</label>' +
|
|
|
|
|
' <div class="layui-input-block">' +
|
|
|
|
|
' <input type="radio" name="type" value="1" title="金融大数据大赛">' +
|
|
|
|
|
' <input type="radio" name="type" value="2" title="金融模拟交易大赛" checked>' +
|
|
|
|
|
' </div>' +
|
|
|
|
|
' </div>' +
|
|
|
|
|
'</div>'
|
|
|
|
|
,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);
|
|
|
|
|
|
|
|
|
|
});
|