总计弹窗

master
OathK1per 2022-07-21 01:32:27 +08:00
parent dbba6bf379
commit 31e5b24ef2
8 changed files with 4746 additions and 12 deletions

View File

@ -595,18 +595,36 @@ public class ProjectController extends BaseController {
}
/**
*
*
*/
@RequestMapping("/checkProjectNo")
@ResponseBody
public ResponseMsg checkProjectNo(@RequestParam String projectNo, @RequestParam int id) {
Project project = projectRepository.findByProjectName(projectNo);
Project project = projectRepository.findByProjectNo(projectNo);
if (project != null && id != project.getId()) {
return ResponseMsg.buildFailedMsg("失败");
}
return ResponseMsg.buildSuccessMsg("成功");
}
/**
*
*/
@RequestMapping("/editProjectNo")
@ResponseBody
public ResponseMsg editProjectNo(@RequestParam String projectNo, @RequestParam int id) {
Project project = projectRepository.findByProjectNo(projectNo);
if (project != null && id != project.getId()) {
return ResponseMsg.buildFailedMsg("修改失败,该项目编号已存在");
}
Project current = projectRepository.findOne(id);
if (current == null) {
return ResponseMsg.buildFailedMsg("修改失败,该项目不存在");
}
projectRepository.updateProjectNo(projectNo, id);
return ResponseMsg.buildSuccessMsg("修改成功");
}
/**
*
*/

View File

@ -1,8 +1,10 @@
package cn.palmte.work.model;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import javax.transaction.Transactional;
import java.util.Date;
import java.util.List;
@ -19,4 +21,9 @@ public interface ProjectRepository extends JpaRepository<Project,Integer> {
@Query(value = "select * from project where creator_id = ?1 and end_date >= ?2 and start_date <= ?2", nativeQuery = true)
List<Project> findByCreator(int id, Date date);
@Modifying
@Transactional(rollbackOn = Exception.class)
@Query(value = "update project set project_no = ?1 where id = ?2", nativeQuery = true)
int updateProjectNo(String projectNo, int id);
}

View File

@ -1,5 +1,5 @@
spring.datasource.url=jdbc:mysql://117.174.24.18:3306/fourcal?\
characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull&serverTimezone=GMT%2b8&rewriteBatchedStatements=true
characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull&serverTimezone=GMT%2b8&rewriteBatchedStatements=true&useSSL=false
spring.datasource.username=root
spring.datasource.password=zytx123!@#

View File

@ -0,0 +1,137 @@
@charset "utf-8";
/* DaTouWang URL: www.datouwang.com */
body{height: 100%;width:100%;font-size: 14px;background: #f0f4f5;overflow-x:hidden;}
body, input[type=text],input[type=date], input[type=tel],input[type=file], input[type=email], input[type=password], input[type=number], textarea, select{outline: none;font-family: "MicroSoft YaHei";}
a{text-decoration:none;color:inherit;}
a:visited{text-decoration:none;}
a.de{text-decoration:underline}
ol,ul,li{list-style:none;font-family:"MicroSoft YaHei";}
img{width:100%;border:0 none;}
.close {
float: right;
font-size: 21px;
font-weight: bold;
line-height: 1;
color: #eee;
}
.close:hover,
.close:focus {
color: #fff;
text-decoration: none;
cursor: pointer;
}
button.close {
-webkit-appearance: none;
padding: 0;
cursor: pointer;
background: transparent;
border: 0;
}
.modal-open {
overflow: hidden;
}
.modal {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1050;
display: none;
overflow: hidden;
-webkit-overflow-scrolling: touch;
outline: 0;
}
.modal.fade .modal-dialog {
-webkit-transition: -webkit-transform .3s ease-out;
-o-transition: -o-transform .3s ease-out;
transition: transform .3s ease-out;
-webkit-transform: translate(0, -25%);
-ms-transform: translate(0, -25%);
-o-transform: translate(0, -25%);
transform: translate(0, -25%);
}
.modal.in .modal-dialog {
-webkit-transform: translate(0, 0);
-ms-transform: translate(0, 0);
-o-transform: translate(0, 0);
transform: translate(0, 0);
}
.modal-open .modal {
overflow-x: hidden;
overflow-y: auto;
}
.modal-dialog {
position: relative;
width: 700px;
margin: 140px auto 35px;
}
.modal-content {
position: relative;
-webkit-background-clip: padding-box;
background-clip: padding-box;
border-radius: 6px;
outline: 0;
}
.modal-backdrop {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1040;
background-color: #000;
}
.modal-backdrop.fade {
filter: alpha(opacity=0);
opacity: 0;
}
.modal-backdrop.in {
filter: alpha(opacity=50);
opacity: .5;
}
.modal-header {
position: absolute;
top:9.5%;
right:5%;
min-height: 16.42857143px;
}
.modal-header .close {
margin-top: -2px;
}
.modal-title {
margin: 0;
line-height: 1.42857143;
}
.modal-body {
position: relative;
padding: 15px;
}
.modal-footer {
padding: 15px;
text-align: right;
border-top: 1px solid #e5e5e5;
}
.modal-footer .btn + .btn {
margin-bottom: 0;
margin-left: 5px;
}
.modal-footer .btn-group .btn + .btn {
margin-left: -1px;
}
.modal-footer .btn-block + .btn-block {
margin-left: 0;
}
.modal-scrollbar-measure {
position: absolute;
top: -9999px;
width: 50px;
height: 50px;
overflow: scroll;
}
@media (min-width: 1400px) {
.modal-dialog {
width: 50%;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,329 @@
/* DaTouWang URL: www.datouwang.com */
+function ($) {
'use strict';
// MODAL CLASS DEFINITION
// ======================
var Modal = function (element, options) {
this.options = options
this.$body = $(document.body)
this.$element = $(element)
this.$dialog = this.$element.find('.modal-dialog')
this.$backdrop = null
this.isShown = null
this.originalBodyPad = null
this.scrollbarWidth = 0
this.ignoreBackdropClick = false
if (this.options.remote) {
this.$element
.find('.modal-content')
.load(this.options.remote, $.proxy(function () {
this.$element.trigger('loaded.bs.modal')
}, this))
}
}
Modal.VERSION = '3.3.5'
Modal.TRANSITION_DURATION = 300
Modal.BACKDROP_TRANSITION_DURATION = 150
Modal.DEFAULTS = {
backdrop: true,
keyboard: true,
show: true
}
Modal.prototype.toggle = function (_relatedTarget) {
return this.isShown ? this.hide() : this.show(_relatedTarget)
}
Modal.prototype.show = function (_relatedTarget) {
var that = this
var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
this.$element.trigger(e)
if (this.isShown || e.isDefaultPrevented()) return
this.isShown = true
// this.checkScrollbar()
// this.setScrollbar()
// this.$body.addClass('modal-open')
this.escape()
this.resize()
this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
this.$dialog.on('mousedown.dismiss.bs.modal', function () {
that.$element.one('mouseup.dismiss.bs.modal', function (e) {
if ($(e.target).is(that.$element)) that.ignoreBackdropClick = true
})
})
this.backdrop(function () {
var transition = $.support.transition && that.$element.hasClass('fade')
if (!that.$element.parent().length) {
that.$element.appendTo(that.$body) // don't move modals dom position
}
that.$element
.show()
.scrollTop(0)
that.adjustDialog()
if (transition) {
that.$element[0].offsetWidth // force reflow
}
that.$element.addClass('in')
that.enforceFocus()
var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
transition ?
that.$dialog // wait for modal to slide in
.one('bsTransitionEnd', function () {
that.$element.trigger('focus').trigger(e)
})
.emulateTransitionEnd(Modal.TRANSITION_DURATION) :
that.$element.trigger('focus').trigger(e)
})
}
Modal.prototype.hide = function (e) {
if (e) e.preventDefault()
e = $.Event('hide.bs.modal')
this.$element.trigger(e)
if (!this.isShown || e.isDefaultPrevented()) return
this.isShown = false
this.escape()
this.resize()
$(document).off('focusin.bs.modal')
this.$element
.removeClass('in')
.off('click.dismiss.bs.modal')
.off('mouseup.dismiss.bs.modal')
this.$dialog.off('mousedown.dismiss.bs.modal')
$.support.transition && this.$element.hasClass('fade') ?
this.$element
.one('bsTransitionEnd', $.proxy(this.hideModal, this))
.emulateTransitionEnd(Modal.TRANSITION_DURATION) :
this.hideModal()
}
Modal.prototype.enforceFocus = function () {
$(document)
.off('focusin.bs.modal') // guard against infinite focus loop
.on('focusin.bs.modal', $.proxy(function (e) {
if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
this.$element.trigger('focus')
}
}, this))
}
Modal.prototype.escape = function () {
if (this.isShown && this.options.keyboard) {
this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) {
e.which == 27 && this.hide()
}, this))
} else if (!this.isShown) {
this.$element.off('keydown.dismiss.bs.modal')
}
}
Modal.prototype.resize = function () {
if (this.isShown) {
$(window).on('resize.bs.modal', $.proxy(this.handleUpdate, this))
} else {
$(window).off('resize.bs.modal')
}
}
Modal.prototype.hideModal = function () {
var that = this
this.$element.hide()
this.backdrop(function () {
that.$body.removeClass('modal-open')
// that.resetAdjustments()
// that.resetScrollbar()
that.$element.trigger('hidden.bs.modal')
})
}
Modal.prototype.removeBackdrop = function () {
this.$backdrop && this.$backdrop.remove()
this.$backdrop = null
}
Modal.prototype.backdrop = function (callback) {
var that = this
var animate = this.$element.hasClass('fade') ? 'fade' : ''
if (this.isShown && this.options.backdrop) {
var doAnimate = $.support.transition && animate
this.$backdrop = $(document.createElement('div'))
.addClass('modal-backdrop ' + animate)
.appendTo(this.$body)
this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
if (this.ignoreBackdropClick) {
this.ignoreBackdropClick = false
return
}
if (e.target !== e.currentTarget) return
this.options.backdrop == 'static'
? this.$element[0].focus()
: this.hide()
}, this))
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
this.$backdrop.addClass('in')
if (!callback) return
doAnimate ?
this.$backdrop
.one('bsTransitionEnd', callback)
.emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
callback()
} else if (!this.isShown && this.$backdrop) {
this.$backdrop.removeClass('in')
var callbackRemove = function () {
that.removeBackdrop()
callback && callback()
}
$.support.transition && this.$element.hasClass('fade') ?
this.$backdrop
.one('bsTransitionEnd', callbackRemove)
.emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
callbackRemove()
} else if (callback) {
callback()
}
}
// these following methods are used to handle overflowing modals
Modal.prototype.handleUpdate = function () {
this.adjustDialog()
}
Modal.prototype.adjustDialog = function () {
var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight
this.$element.css({
paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '',
paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : ''
})
}
Modal.prototype.resetAdjustments = function () {
this.$element.css({
paddingLeft: '',
paddingRight: ''
})
}
Modal.prototype.checkScrollbar = function () {
var fullWindowWidth = window.innerWidth
if (!fullWindowWidth) { // workaround for missing window.innerWidth in IE8
var documentElementRect = document.documentElement.getBoundingClientRect()
fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left)
}
this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth
this.scrollbarWidth = this.measureScrollbar()
}
Modal.prototype.setScrollbar = function () {
var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10)
this.originalBodyPad = document.body.style.paddingRight || ''
if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)
}
Modal.prototype.resetScrollbar = function () {
this.$body.css('padding-right', this.originalBodyPad)
}
Modal.prototype.measureScrollbar = function () { // thx walsh
var scrollDiv = document.createElement('div')
scrollDiv.className = 'modal-scrollbar-measure'
this.$body.append(scrollDiv)
var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth
this.$body[0].removeChild(scrollDiv)
return scrollbarWidth
}
// MODAL PLUGIN DEFINITION
// =======================
function Plugin(option, _relatedTarget) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.modal')
var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
if (typeof option == 'string') data[option](_relatedTarget)
else if (options.show) data.show(_relatedTarget)
})
}
var old = $.fn.modal
$.fn.modal = Plugin
$.fn.modal.Constructor = Modal
// MODAL NO CONFLICT
// =================
$.fn.modal.noConflict = function () {
$.fn.modal = old
return this
}
// MODAL DATA-API
// ==============
$(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
var $this = $(this)
var href = $this.attr('href')
var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) // strip for ie7
var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
if ($this.is('a')) e.preventDefault()
$target.one('show.bs.modal', function (showEvent) {
if (showEvent.isDefaultPrevented()) return // only register focus restorer if modal will actually get shown
$target.one('hidden.bs.modal', function () {
$this.is(':visible') && $this.trigger('focus')
})
})
Plugin.call($target, option, this)
})
}(jQuery);

View File

@ -223,7 +223,7 @@
<#if adminId==1>
<button type="button"
class="am-btn am-btn-default am-btn-xs am-text-secondary"
onclick="location.href='${base}/project/selectRoleUser?projectId=${list.id}'"><span class="am-icon-pencil-square-o"></span>设置项目可见性
onclick="projectNo(${list.id})"><span class="am-icon-pencil-square-o"></span>填写项目编号
</button>
</#if>
<#--<@shiro.hasPermission name="PROJECT_EDIT">-->
@ -372,7 +372,29 @@
<hr>
</footer>
</div>
<!-- 模态框Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="myModalLabel">您正在编辑项目编号</h4>
</div>
<div>
<input type="text" id="newProjectNo" class="am-modal-prompt-input" placeholder="请输入项目编号"/>
<input type="hidden" id="modelId" name="keywords" value=''/>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal" data-am-modal-cancel>关闭</button>
<button type="button" class="btn btn-primary" data-am-modal-confirm onclick="projectNoCheck('')">提交</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div>
<!-- /.modal -->
</@defaultLayout.layout>
<script type="text/javascript" src="../modal/js/modal.js"></script>
<script src="../assets/js/amazeui.switch.js"></script>
<script src="${base}/assets/js/project_common.js"></script>
<script type="text/javascript">
@ -463,4 +485,35 @@
}
};
var projectNo = function(id) {
console.log("~~~~~~~~~~~~~"+id);
$("#modelId").val(id);
// $('#myModal').modal('show');
$('#myModal').modal({
relatedElement: this,
onConfirm: function(id) {
console.log("提交");
projectNoCheck(id);
},
onCancel: function() {
console.log("取消");
}
});
};
var projectNoCheck = function () {
var newProjectNo = $("#newProjectNo").val();
var id = $("#modelId").val();
$.ajax({
url: "${base}/project/editProjectNo?projectNo=" + newProjectNo + "&id=" + id,
type: "get",
dataType: "json",
async: false,
success: function (data) {
alert(data.msg);
window.location.href=window.location.href;
}
});
};
</script>

View File

@ -1,8 +1,8 @@
<!-- 分页 -->
<div>
<ul class="pagination am-pagination" id="pager"></ul>
<input type="hidden" name="pageNumber" id="pageNumber" value="${pager.pageNumber}" />
<div class="pagination am-pagination" id="pager"></div>
<input type="hidden" name="pageNumber" id="pageNumber" value="${pager.pageNumber}" />
<#--<script src="${base}/assets/js/jquery-3.4.1.min.js"></script>-->
<script type="text/javascript" src="${base}/common/js/jqPaginator/jqPaginator.min.js"></script>
<link type="text/css" rel="stylesheet" href="${base}/common/js/jqPaginator/bootstrap.min.css"/>
@ -17,11 +17,10 @@
}
$.jqPaginator('#pager', {
totalPages: ${(pager.totalPage)!10},
totalCounts:'共${(pager.totalRow)!10}条',
<#--totalCounts: ${(pager.totalRow)!10},-->
totalCounts: ${(pager.totalRow)!10},
visiblePages: 7,
currentPage: ${(pager.pageNumber)!1},
first: '<li class="first"><a href="javascript:void(0);">首页<\/a><\/li>',
first: '<li class="first" id="first"><a href="javascript:void(0);">首页<\/a><\/li>',
prev: '<li class="prev"><a href="javascript:void(0);"><i class="arrow arrow2"><\/i>上一页<\/a><\/li>',
next: '<li class="next"><a href="javascript:void(0);">下一页<i class="arrow arrow3"><\/i><\/a><\/li>',
last: '<li class="last"><a href="javascript:void(0);">末页<\/a><\/li>',
@ -48,6 +47,8 @@
}
}
});
$('#pager').prepend('<li><a style="pointer-events:none;">共${(pager.totalRow)!10}条<\/a><\/li>');
</script>
</div>