Pre Merge pull request !175 from Ricky/master
This commit is contained in:
commit
186cfeba82
|
|
@ -30,6 +30,11 @@ public class GoodsModel
|
||||||
*/
|
*/
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 时间
|
||||||
|
*/
|
||||||
|
private String time;
|
||||||
|
|
||||||
public String getName()
|
public String getName()
|
||||||
{
|
{
|
||||||
return name;
|
return name;
|
||||||
|
|
@ -70,6 +75,14 @@ public class GoodsModel
|
||||||
this.type = type;
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getTime() {
|
||||||
|
return time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTime(String time) {
|
||||||
|
this.time = time;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
|
@ -77,6 +90,7 @@ public class GoodsModel
|
||||||
.append("weight", getWeight())
|
.append("weight", getWeight())
|
||||||
.append("price", getPrice())
|
.append("price", getPrice())
|
||||||
.append("type", getType())
|
.append("type", getType())
|
||||||
|
.append("time", getTime())
|
||||||
.toString();
|
.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,43 @@
|
||||||
|
/**
|
||||||
|
* bootstrapTable行内编辑扩展
|
||||||
|
* 可以自行扩展其他属性,如data-type="date"
|
||||||
|
*/
|
||||||
|
|
||||||
|
(function($) {
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
var BootstrapTable = $.fn.bootstrapTable.Constructor,
|
||||||
|
_initBody = BootstrapTable.prototype.initBody;
|
||||||
|
|
||||||
|
BootstrapTable.prototype.initBody = function() {
|
||||||
|
var that = this;
|
||||||
|
_initBody.apply(this, Array.prototype.slice.apply(arguments));
|
||||||
|
var data = that.getData();
|
||||||
|
var $tr = that.$body.find('tr');
|
||||||
|
$.each($tr, function(rowindex, row) {//循环行
|
||||||
|
var $td = $(row).find('td');//当前行的所有列
|
||||||
|
$.each(that.columns, function(columnindex, column) {//循环列
|
||||||
|
const $time = $($td[columnindex]).find('.time');// 查找时间控件
|
||||||
|
if($time.length > 0){
|
||||||
|
$time.each((i, element) => {//循环time控件,获取element
|
||||||
|
//可以获取其他属性
|
||||||
|
layui.use('laydate', function () {
|
||||||
|
layui.laydate.render({
|
||||||
|
elem: element,
|
||||||
|
theme: 'molv',
|
||||||
|
trigger: 'click',
|
||||||
|
type: 'date',
|
||||||
|
done: function (value, d) {
|
||||||
|
//此处可以扩展callback
|
||||||
|
data[rowindex][column.field] = value;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
})(jQuery);
|
||||||
|
|
@ -191,8 +191,8 @@ $(function() {
|
||||||
'use strict';
|
'use strict';
|
||||||
$.fn.toTop = function(opt) {
|
$.fn.toTop = function(opt) {
|
||||||
var elem = this;
|
var elem = this;
|
||||||
var win = $(window);
|
var win = (opt && opt.hasOwnProperty('win')) ? opt.win : $(window);
|
||||||
var doc = $('html, body');
|
var doc = (opt && opt.hasOwnProperty('doc')) ? opt.doc : $('html, body');
|
||||||
var options = $.extend({
|
var options = $.extend({
|
||||||
autohide: true,
|
autohide: true,
|
||||||
offset: 50,
|
offset: 50,
|
||||||
|
|
|
||||||
|
|
@ -82,6 +82,7 @@
|
||||||
<th:block th:include="include :: footer" />
|
<th:block th:include="include :: footer" />
|
||||||
<th:block th:include="include :: datetimepicker-js" />
|
<th:block th:include="include :: datetimepicker-js" />
|
||||||
<script th:src="@{/js/jquery.tmpl.js}"></script>
|
<script th:src="@{/js/jquery.tmpl.js}"></script>
|
||||||
|
<script th:src="@{/ajax/libs/bootstrap-table/extensions/editable/bootstrap-table-editable-inline.js}"></script>
|
||||||
<script th:inline="javascript">
|
<script th:inline="javascript">
|
||||||
$(function() {
|
$(function() {
|
||||||
var options = {
|
var options = {
|
||||||
|
|
@ -130,6 +131,15 @@
|
||||||
return html;
|
return html;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
field: 'time',
|
||||||
|
align: 'center',
|
||||||
|
title: '时间',
|
||||||
|
formatter: function(value, row, index) {
|
||||||
|
var html = $.common.sprintf("<input class='form-control time' type='text' name='goods[%s].time' value='%s'>", index, value);
|
||||||
|
return html;
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
field: 'type',
|
field: 'type',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
|
@ -166,6 +176,7 @@
|
||||||
name: "",
|
name: "",
|
||||||
weight: "",
|
weight: "",
|
||||||
price: "",
|
price: "",
|
||||||
|
time: "",
|
||||||
type: "",
|
type: "",
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,15 @@
|
||||||
if ($(this).width() < 769) {
|
if ($(this).width() < 769) {
|
||||||
panehHidden = true;
|
panehHidden = true;
|
||||||
}
|
}
|
||||||
$('body').layout({ initClosed: panehHidden, west__size: 185 });
|
$('body').layout({ initClosed: panehHidden, west__size: 185});
|
||||||
|
// 回到顶部绑定
|
||||||
|
if ($.fn.toTop !== undefined) {
|
||||||
|
var opt = {
|
||||||
|
win:$('.ui-layout-center'),
|
||||||
|
doc:$('.ui-layout-center')
|
||||||
|
};
|
||||||
|
$('#scroll-up').toTop(opt);
|
||||||
|
}
|
||||||
queryUserList();
|
queryUserList();
|
||||||
queryDeptTree();
|
queryDeptTree();
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue