|
@@ -1,211 +1,199 @@
|
|
|
<!DOCTYPE html>
|
|
|
-<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
|
|
+<html lang="zh" xmlns:th="http://www.thymeleaf.org">
|
|
|
<head>
|
|
|
- <th:block th:include="include :: header('新增赛事发布')" />
|
|
|
- <th:block th:include="include :: datetimepicker-css" />
|
|
|
- <th:block th:include="include :: summernote-css" />
|
|
|
+ <th:block th:include="include :: header('新增赛事发布')"/>
|
|
|
+ <th:block th:include="include :: datetimepicker-css"/>
|
|
|
+ <th:block th:include="include :: summernote-css"/>
|
|
|
</head>
|
|
|
<body class="white-bg">
|
|
|
- <div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
|
|
- <form class="form-horizontal m" id="form-competition-add">
|
|
|
- <div class="col-xs-12">
|
|
|
- <div class="form-group">
|
|
|
- <label class="col-sm-3 control-label is-required">活动标题:</label>
|
|
|
- <div class="col-sm-8">
|
|
|
- <input name="competitionTitle" class="form-control" type="text" placeholder="请输入活动标题" required>
|
|
|
- </div>
|
|
|
+<div class="wrapper wrapper-content animated fadeInRight ibox-content" >
|
|
|
+ <form class="form-horizontal m" id="form-competition-add">
|
|
|
+ <div class="col-xs-12">
|
|
|
+ <div class="form-group">
|
|
|
+ <label class="col-sm-2 control-label is-required">赛事标题:</label>
|
|
|
+ <div class="col-sm-4">
|
|
|
+ <input name="competitionTitle" class="form-control" type="text" placeholder="请输入赛事标题"
|
|
|
+ required>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div class="col-xs-12">
|
|
|
- <div class="form-group">
|
|
|
- <label class="col-sm-3 control-label is-required">活动类型:</label>
|
|
|
- <div class="col-sm-8">
|
|
|
- <select name="competitionType" class="form-control" th:with="type=${@dict.getType('competition_type')}" required>
|
|
|
- <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
|
|
- </select>
|
|
|
- </div>
|
|
|
+ <label class="col-sm-2 control-label is-required">赛事类型:</label>
|
|
|
+ <div class="col-sm-4">
|
|
|
+ <select name="competitionType" class="form-control"
|
|
|
+ th:with="type=${@dict.getType('competition_type')}" required>
|
|
|
+ <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
|
|
|
+ th:value="${dict.dictValue}"></option>
|
|
|
+ </select>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="col-xs-12">
|
|
|
- <div class="form-group">
|
|
|
- <label class="col-sm-3 control-label is-required">团队最大人数:</label>
|
|
|
- <div class="col-sm-8">
|
|
|
- <input name="personMax" class="form-control" type="text" placeholder="请输入团队最大人数" min="1" required>
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
+ <div class="col-xs-12">
|
|
|
+ <div class="form-group">
|
|
|
+ <label class="col-sm-2 control-label is-required">最大人数/团队数:</label>
|
|
|
+ <div class="col-sm-4">
|
|
|
+ <input name="teamMax" class="form-control" type="number" placeholder="请输入最大人数或团队数"
|
|
|
+ required>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div class="col-xs-12">
|
|
|
- <div class="form-group">
|
|
|
- <label class="col-sm-3 control-label is-required">最大团队数:</label>
|
|
|
- <div class="col-sm-8">
|
|
|
- <input name="teamMax" class="form-control" type="text" placeholder="请输入最大团队数" required>
|
|
|
- </div>
|
|
|
+ <label class="col-sm-2 control-label">场地:</label>
|
|
|
+ <div class="col-sm-4">
|
|
|
+ <input name="competitionPlace" class="form-control" type="text" placeholder="请输入场地名称">
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="col-xs-12">
|
|
|
- <div class="form-group">
|
|
|
- <label class="col-sm-3 control-label is-required">场地:</label>
|
|
|
- <div class="col-sm-8">
|
|
|
- <input name="competitionPlace" class="form-control" type="text" placeholder="请输入场地名称或编号" required>
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
+ <div class="col-xs-12">
|
|
|
+ <div class="form-group">
|
|
|
+ <label class="col-sm-2 control-label is-required">报名费用:</label>
|
|
|
+ <div class="col-sm-4">
|
|
|
+ <input name="competitionExpense" class="form-control" type="number" placeholder="请输入报名费用"
|
|
|
+ required>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div class="col-xs-12">
|
|
|
- <div class="form-group">
|
|
|
- <label class="col-sm-3 control-label is-required">赛事开始时间:</label>
|
|
|
- <div class="col-sm-8">
|
|
|
- <div class="input-group date">
|
|
|
- <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
|
|
- <input name="applyStartTime" type="text" class="form-control" id="applyStartTime" placeholder="年-月-日 时:分" required>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ <label class="col-sm-2 control-label is-required">观看费用:</label>
|
|
|
+ <div class="col-sm-4">
|
|
|
+ <input name="viewingTicket" class="form-control" type="number" placeholder="请输入观看费用"
|
|
|
+ required>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="col-xs-12">
|
|
|
- <div class="form-group">
|
|
|
- <label class="col-sm-3 control-label is-required">赛事结束时间:</label>
|
|
|
- <div class="col-sm-8">
|
|
|
- <div class="input-group date">
|
|
|
- <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
|
|
- <input name="applyEndTime" type="text" class="form-control" id="applyEndTime" placeholder="年-月-日 时:分" required>
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
+ <div class="col-xs-12">
|
|
|
+ <div class="form-group">
|
|
|
+ <label class="col-sm-2 control-label is-required">赛事开始时间:</label>
|
|
|
+ <div class="col-sm-4">
|
|
|
+ <div class="input-group date">
|
|
|
+ <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
|
|
+ <input name="applyStartTime" type="text" class="form-control" id="applyStartTime"
|
|
|
+ placeholder="年-月-日 时:分" required>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div class="col-xs-12">
|
|
|
- <div class="form-group">
|
|
|
- <label class="col-sm-3 control-label">取消报名截至时间:</label>
|
|
|
- <div class="col-sm-8">
|
|
|
- <select name="applyBeforeTime" class="form-control">
|
|
|
- <option value="1">赛事开始前1小时</option>
|
|
|
- <option value="2">赛事开始前2小时</option>
|
|
|
- <option value="3">赛事开始前3小时</option>
|
|
|
- <option value="6">赛事开始前6小时</option>
|
|
|
- <option value="12">赛事开始前12小时</option>
|
|
|
- <option value="24">赛事开始前24小时</option>
|
|
|
- <option value="48">赛事开始前48小时</option>
|
|
|
- </select>
|
|
|
+ <label class="col-sm-2 control-label">赛事结束时间:</label>
|
|
|
+ <div class="col-sm-4">
|
|
|
+ <div class="input-group date">
|
|
|
+ <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
|
|
+ <input name="applyEndTime" type="text" class="form-control" id="applyEndTime"
|
|
|
+ placeholder="年-月-日 时:分">
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="col-xs-12">
|
|
|
- <div class="form-group">
|
|
|
- <label class="col-sm-3 control-label is-required">报名费用:</label>
|
|
|
- <div class="col-sm-8">
|
|
|
- <input name="competitionExpense" class="form-control" type="text" required>
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
+ <div class="col-xs-12">
|
|
|
+ <div class="form-group">
|
|
|
+ <label class="col-sm-2 control-label is-required">取消报名截至时间:</label>
|
|
|
+ <div class="col-sm-4">
|
|
|
+ <select name="applyBeforeTime" class="form-control" required>
|
|
|
+ <option value="1">赛事开始前1小时</option>
|
|
|
+ <option value="2">赛事开始前2小时</option>
|
|
|
+ <option value="3">赛事开始前3小时</option>
|
|
|
+ <option value="6">赛事开始前6小时</option>
|
|
|
+ <option value="12">赛事开始前12小时</option>
|
|
|
+ <option value="24">赛事开始前24小时</option>
|
|
|
+ <option value="48">赛事开始前48小时</option>
|
|
|
+ </select>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="col-xs-12">
|
|
|
- <div class="form-group">
|
|
|
- <label class="col-sm-3 control-label">活动详情:</label>
|
|
|
- <div class="col-sm-8">
|
|
|
- <input type="hidden" class="form-control" name="competitionDetails">
|
|
|
- <div class="summernote" id="competitionDetails"></div>
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
+ <div class="col-xs-12">
|
|
|
+ <div class="form-group">
|
|
|
+ <label class="col-sm-2 control-label is-required">赛事详情:</label>
|
|
|
+ <div class="col-sm-4">
|
|
|
+ <input type="hidden" class="form-control" name="competitionDetails" required>
|
|
|
+ <div class="summernote" id="competitionDetails"></div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div class="col-xs-12">
|
|
|
- <div class="form-group">
|
|
|
- <label class="col-sm-3 control-label">报名须知:</label>
|
|
|
- <div class="col-sm-8">
|
|
|
- <input type="hidden" class="form-control" name="registrationNotes">
|
|
|
- <div class="summernote" id="registrationNotes"></div>
|
|
|
- </div>
|
|
|
+ <label class="col-sm-2 control-label">报名须知:</label>
|
|
|
+ <div class="col-sm-4">
|
|
|
+ <input type="hidden" class="form-control" name="registrationNotes">
|
|
|
+ <div class="summernote" id="registrationNotes"></div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </form>
|
|
|
- </div>
|
|
|
- <th:block th:include="include :: footer" />
|
|
|
- <th:block th:include="include :: datetimepicker-js" />
|
|
|
- <th:block th:include="include :: summernote-js" />
|
|
|
- <script th:inline="javascript">
|
|
|
- var prefix = ctx + "competition"
|
|
|
- $("#form-competition-add").validate({
|
|
|
- focusCleanup: true,
|
|
|
- rules:{
|
|
|
- personMax:{
|
|
|
- digits: true
|
|
|
- },
|
|
|
- teamMax:{
|
|
|
- digits: true
|
|
|
- },
|
|
|
- competitionExpense:{
|
|
|
- double: true
|
|
|
- }
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+</div>
|
|
|
+<th:block th:include="include :: footer"/>
|
|
|
+<th:block th:include="include :: datetimepicker-js"/>
|
|
|
+<th:block th:include="include :: summernote-js"/>
|
|
|
+<script th:inline="javascript">
|
|
|
+ var prefix = ctx + "competition"
|
|
|
+ $("#form-competition-add").validate({
|
|
|
+ focusCleanup: true,
|
|
|
+ rules: {
|
|
|
+ teamMax: {
|
|
|
+ digits: true
|
|
|
},
|
|
|
- });
|
|
|
-
|
|
|
- function submitHandler() {
|
|
|
- var applyStartTime = $('#applyStartTime').val()
|
|
|
- var applyEndTime = $('#applyEndTime').val()
|
|
|
- var currentTime = new Date().toISOString().slice(0, 16); // 当前时间,格式为 YYYY-MM-DD HH:MM
|
|
|
-
|
|
|
+ competitionExpense: {
|
|
|
+ double: true
|
|
|
+ },
|
|
|
+ competitionExpense: {
|
|
|
+ double: true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ });
|
|
|
|
|
|
+ function submitHandler() {
|
|
|
+ var applyStartTime = $('#applyStartTime').val()
|
|
|
+ var applyEndTime = $('#applyEndTime').val()
|
|
|
+ var currentTime = new Date().toISOString().slice(0, 16); // 当前时间,格式为 YYYY-MM-DD HH:MM
|
|
|
|
|
|
- if ($.validate.form()) {
|
|
|
|
|
|
- // 检查赛事开始时间不能小于当前时间
|
|
|
- if (applyStartTime < currentTime) {
|
|
|
- $.modal.alertWarning("赛事开始时间不能小于当前时间");
|
|
|
- return false;
|
|
|
- }
|
|
|
+ if ($.validate.form()) {
|
|
|
|
|
|
- // 检查赛事结束时间不能小于赛事开始时间
|
|
|
- if (applyEndTime < applyStartTime) {
|
|
|
- $.modal.alertWarning("赛事结束时间不能小于赛事开始时间");
|
|
|
- return false;
|
|
|
- }
|
|
|
+ // 检查赛事开始时间不能小于当前时间
|
|
|
+ if (applyStartTime < currentTime) {
|
|
|
+ $.modal.alertWarning("赛事开始时间不能小于当前时间");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
|
|
|
- $.operate.save(prefix + "/add", $('#form-competition-add').serialize());
|
|
|
+ // 检查赛事结束时间不能小于赛事开始时间
|
|
|
+ if (applyEndTime < applyStartTime) {
|
|
|
+ $.modal.alertWarning("赛事结束时间不能小于赛事开始时间");
|
|
|
+ return false;
|
|
|
}
|
|
|
+
|
|
|
+ $.operate.save(prefix + "/add", $('#form-competition-add').serialize());
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- $("input[name='applyStartTime']").datetimepicker({
|
|
|
- format: "yyyy-mm-dd hh:ii",
|
|
|
- autoclose: true
|
|
|
- });
|
|
|
+ $("input[name='applyStartTime']").datetimepicker({
|
|
|
+ format: "yyyy-mm-dd hh:ii",
|
|
|
+ autoclose: true
|
|
|
+ });
|
|
|
|
|
|
- $("input[name='applyEndTime']").datetimepicker({
|
|
|
- format: "yyyy-mm-dd hh:ii",
|
|
|
- autoclose: true
|
|
|
- });
|
|
|
+ $("input[name='applyEndTime']").datetimepicker({
|
|
|
+ format: "yyyy-mm-dd hh:ii",
|
|
|
+ autoclose: true
|
|
|
+ });
|
|
|
|
|
|
- $(function() {
|
|
|
- $('.summernote').summernote({
|
|
|
- lang: 'zh-CN',
|
|
|
- dialogsInBody: true,
|
|
|
- callbacks: {
|
|
|
- onChange: function(contents, $edittable) {
|
|
|
- $("input[name='" + this.id + "']").val(contents);
|
|
|
- },
|
|
|
- onImageUpload: function(files) {
|
|
|
- var obj = this;
|
|
|
- var data = new FormData();
|
|
|
- data.append("file", files[0]);
|
|
|
- $.ajax({
|
|
|
- type: "post",
|
|
|
- url: ctx + "common/upload",
|
|
|
- data: data,
|
|
|
- cache: false,
|
|
|
- contentType: false,
|
|
|
- processData: false,
|
|
|
- dataType: 'json',
|
|
|
- success: function(result) {
|
|
|
- if (result.code == web_status.SUCCESS) {
|
|
|
- $('#' + obj.id).summernote('insertImage', result.url);
|
|
|
- } else {
|
|
|
- $.modal.alertError(result.msg);
|
|
|
- }
|
|
|
- },
|
|
|
- error: function(error) {
|
|
|
- $.modal.alertWarning("图片上传失败。");
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
+ $(function () {
|
|
|
+ $('.summernote').summernote({
|
|
|
+ lang: 'zh-CN',
|
|
|
+ dialogsInBody: true,
|
|
|
+ height: 400,
|
|
|
+ callbacks: {
|
|
|
+ onChange: function (contents, $edittable) {
|
|
|
+ $("input[name='" + this.id + "']").val(contents);
|
|
|
+ },
|
|
|
+ onImageUpload: function (files) {
|
|
|
+ var obj = this;
|
|
|
+ var data = new FormData();
|
|
|
+ data.append("file", files[0]);
|
|
|
+ $.ajax({
|
|
|
+ type: "post",
|
|
|
+ url: ctx + "common/upload",
|
|
|
+ data: data,
|
|
|
+ cache: false,
|
|
|
+ contentType: false,
|
|
|
+ processData: false,
|
|
|
+ dataType: 'json',
|
|
|
+ success: function (result) {
|
|
|
+ if (result.code == web_status.SUCCESS) {
|
|
|
+ $('#' + obj.id).summernote('insertImage', result.url);
|
|
|
+ } else {
|
|
|
+ $.modal.alertError(result.msg);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error: function (error) {
|
|
|
+ $.modal.alertWarning("图片上传失败。");
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
- });
|
|
|
+ }
|
|
|
});
|
|
|
- </script>
|
|
|
+ });
|
|
|
+</script>
|
|
|
</body>
|
|
|
</html>
|