5
This commit is contained in:
@@ -468,87 +468,86 @@ define(['jquery', 'bootstrap', 'moment', 'bootstrap-table', 'bootstrap-table-lan
|
||||
}
|
||||
});
|
||||
//当内容渲染完成后
|
||||
// table.on('post-body.bs.table', function (e, data) {
|
||||
// $(Table.config.refreshbtn, toolbar).find(".fa").removeClass("fa-spin");
|
||||
// if ($(Table.config.checkboxtd + ":first", table).find("input[type='checkbox'][data-index]").length > 0) {
|
||||
// //拖拽选择复选框
|
||||
// var posx, posy, dragdiv, drag = false, prepare = false;
|
||||
// var mousemove = function (e) {
|
||||
// if (drag) {
|
||||
// var left = Math.min(e.pageX, posx);
|
||||
// var top = Math.min(e.pageY, posy);
|
||||
// var width = Math.abs(posx - e.pageX);
|
||||
// var height = Math.abs(posy - e.pageY);
|
||||
// dragdiv.css({left: left + "px", top: top + "px", width: width + "px", height: height + "px"});
|
||||
// var dragrect = {x: left, y: top, width: width, height: height};
|
||||
// $(Table.config.checkboxtd, table).each(function () {
|
||||
// var checkbox = $("input:checkbox", this);
|
||||
// var tdrect = this.getBoundingClientRect();
|
||||
// tdrect.x += document.documentElement.scrollLeft;
|
||||
// tdrect.y += document.documentElement.scrollTop;
|
||||
table.on('post-body.bs.table', function (e, data) {
|
||||
$(Table.config.refreshbtn, toolbar).find(".fa").removeClass("fa-spin");
|
||||
if ($(Table.config.checkboxtd + ":first", table).find("input[type='checkbox'][data-index]").length > 0) {
|
||||
//拖拽选择复选框
|
||||
var posx, posy, dragdiv, drag = false, prepare = false;
|
||||
var mousemove = function (e) {
|
||||
if (drag) {
|
||||
var left = Math.min(e.pageX, posx);
|
||||
var top = Math.min(e.pageY, posy);
|
||||
var width = Math.abs(posx - e.pageX);
|
||||
var height = Math.abs(posy - e.pageY);
|
||||
dragdiv.css({left: left + "px", top: top + "px", width: width + "px", height: height + "px"});
|
||||
var dragrect = {x: left, y: top, width: width, height: height};
|
||||
$(Table.config.checkboxtd, table).each(function () {
|
||||
var checkbox = $("input:checkbox", this);
|
||||
var tdrect = this.getBoundingClientRect();
|
||||
tdrect.x += document.documentElement.scrollLeft;
|
||||
tdrect.y += document.documentElement.scrollTop;
|
||||
|
||||
// var td_min_x = tdrect.x;
|
||||
// var td_min_y = tdrect.y;
|
||||
// var td_max_x = tdrect.x + tdrect.width;
|
||||
// var td_max_y = tdrect.y + tdrect.height;
|
||||
var td_min_x = tdrect.x;
|
||||
var td_min_y = tdrect.y;
|
||||
var td_max_x = tdrect.x + tdrect.width;
|
||||
var td_max_y = tdrect.y + tdrect.height;
|
||||
|
||||
// var drag_min_x = dragrect.x;
|
||||
// var drag_min_y = dragrect.y;
|
||||
// var drag_max_x = dragrect.x + dragrect.width;
|
||||
// var drag_max_y = dragrect.y + dragrect.height;
|
||||
// var overlapped = td_min_x <= drag_max_x && td_max_x >= drag_min_x && td_min_y <= drag_max_y && td_max_y >= drag_min_y;
|
||||
// if (overlapped) {
|
||||
// if (!$(this).hasClass("overlaped")) {
|
||||
// $(this).addClass("overlaped");
|
||||
// checkbox.trigger("click");
|
||||
// }
|
||||
// } else {
|
||||
// if ($(this).hasClass("overlaped")) {
|
||||
// $(this).removeClass("overlaped");
|
||||
// checkbox.trigger("click");
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// };
|
||||
// var selectstart = function () {
|
||||
// return false;
|
||||
// };
|
||||
// var mouseup = function () {
|
||||
// if (drag) {
|
||||
// $(document).off("mousemove", mousemove);
|
||||
// $(document).off("selectstart", selectstart);
|
||||
// dragdiv.remove();
|
||||
// }
|
||||
// drag = false;
|
||||
// prepare = false;
|
||||
// $(document.body).css({'MozUserSelect': '', 'webkitUserSelect': ''}).attr('unselectable', 'off');
|
||||
// };
|
||||
var drag_min_x = dragrect.x;
|
||||
var drag_min_y = dragrect.y;
|
||||
var drag_max_x = dragrect.x + dragrect.width;
|
||||
var drag_max_y = dragrect.y + dragrect.height;
|
||||
var overlapped = td_min_x <= drag_max_x && td_max_x >= drag_min_x && td_min_y <= drag_max_y && td_max_y >= drag_min_y;
|
||||
if (overlapped) {
|
||||
if (!$(this).hasClass("overlaped")) {
|
||||
$(this).addClass("overlaped");
|
||||
checkbox.trigger("click");
|
||||
}
|
||||
} else {
|
||||
if ($(this).hasClass("overlaped")) {
|
||||
$(this).removeClass("overlaped");
|
||||
checkbox.trigger("click");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
var selectstart = function () {
|
||||
return false;
|
||||
};
|
||||
var mouseup = function () {
|
||||
if (drag) {
|
||||
$(document).off("mousemove", mousemove);
|
||||
$(document).off("selectstart", selectstart);
|
||||
dragdiv.remove();
|
||||
}
|
||||
drag = false;
|
||||
prepare = false;
|
||||
$(document.body).css({'MozUserSelect': '', 'webkitUserSelect': ''}).attr('unselectable', 'off');
|
||||
};
|
||||
|
||||
// $(Table.config.checkboxtd, table).on("mousedown", function (e) {
|
||||
// //禁止鼠标右键事件和文本框
|
||||
// if (e.button === 2 || $(e.target).is("input")) {
|
||||
// return false;
|
||||
// }
|
||||
// posx = e.pageX;
|
||||
// posy = e.pageY;
|
||||
// prepare = true;
|
||||
// }).on("mousemove", function (e) {
|
||||
// if (prepare && !drag) {
|
||||
// drag = true;
|
||||
// dragdiv = $("<div />");
|
||||
// dragdiv.css({position: 'absolute', width: 0, height: 0, border: "1px dashed blue", background: "#0029ff", left: e.pageX + "px", top: e.pageY + "px", opacity: .1});
|
||||
// dragdiv.appendTo(document.body);
|
||||
// $(document.body).css({'MozUserSelect': 'none', 'webkitUserSelect': 'none'}).attr('unselectable', 'on');
|
||||
// $(document).on("mousemove", mousemove).on("mouseup", mouseup).on("selectstart", selectstart);
|
||||
// if (options.dragCheckboxMultiselect) {
|
||||
// $(Table.config.checkboxtd, table).removeClass("overlaped");
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
|
||||
// }
|
||||
// });
|
||||
$(Table.config.checkboxtd, table).on("mousedown", function (e) {
|
||||
//禁止鼠标右键事件和文本框
|
||||
if (e.button === 2 || $(e.target).is("input")) {
|
||||
return false;
|
||||
}
|
||||
posx = e.pageX;
|
||||
posy = e.pageY;
|
||||
prepare = true;
|
||||
}).on("mousemove", function (e) {
|
||||
if (prepare && !drag) {
|
||||
drag = true;
|
||||
dragdiv = $("<div />");
|
||||
dragdiv.css({position: 'absolute', width: 0, height: 0, border: "1px dashed blue", background: "#0029ff", left: e.pageX + "px", top: e.pageY + "px", opacity: .1});
|
||||
dragdiv.appendTo(document.body);
|
||||
$(document.body).css({'MozUserSelect': 'none', 'webkitUserSelect': 'none'}).attr('unselectable', 'on');
|
||||
$(document).on("mousemove", mousemove).on("mouseup", mouseup).on("selectstart", selectstart);
|
||||
if (options.dragCheckboxMultiselect) {
|
||||
$(Table.config.checkboxtd, table).removeClass("overlaped");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
var exportDataType = options.exportDataType;
|
||||
// 处理选中筛选框后按钮的状态统一变更
|
||||
table.on('check.bs.table uncheck.bs.table check-all.bs.table uncheck-all.bs.table post-body.bs.table', function (e) {
|
||||
@@ -956,17 +955,18 @@ define(['jquery', 'bootstrap', 'moment', 'bootstrap-table', 'bootstrap-table-lan
|
||||
var data = [];
|
||||
value = value === null ? '' : value.toString();
|
||||
var arr = value != '' ? value.split(",") : [];
|
||||
debugger;
|
||||
var url;
|
||||
$.each(arr, function (index, value) {
|
||||
url = Fast.api.cdnurl(value);
|
||||
data.push({
|
||||
src: url,
|
||||
thumb: url.match(/^(\/|data:image\\)/) ? url : url + Config.thumbstyle
|
||||
thumb: url.match(/^(\/|data:image\\)/) ? url : url + Config.upload_thumbstyle
|
||||
});
|
||||
});
|
||||
Layer.photos({
|
||||
photos: {
|
||||
"start": $(this).parent().index(),
|
||||
"start": 0,
|
||||
"data": data
|
||||
},
|
||||
anim: 5 //0-6的选择,指定弹出图片动画类型,默认随机(请注意,3.0之前的版本用shift参数)
|
||||
@@ -985,21 +985,21 @@ define(['jquery', 'bootstrap', 'moment', 'bootstrap-table', 'bootstrap-table-lan
|
||||
image: function (value, row, index) {
|
||||
value = value == null || value.length === 0 ? '' : value.toString();
|
||||
value = value ? value : '/assets/img/blank.gif';
|
||||
var classname = typeof this.classname !== 'undefined' ? this.classname : 'img-sm img-center';
|
||||
var classname = typeof this.classname !== 'undefined' ? this.classname : 'img-sm img-center previewitem';
|
||||
var url = Fast.api.cdnurl(value, true);
|
||||
url = url.match(/^(\/|data:image\\)/) ? url : url + Config.thumbstyle;
|
||||
url = url.match(/^(\/|data:image\\)/) ? url : url + Config.upload_thumbstyle;
|
||||
return '<a href="javascript:"><img class="' + classname + '" src="' + url + '" /></a>';
|
||||
},
|
||||
images: function (value, row, index) {
|
||||
value = value == null || value.length === 0 ? '' : value.toString();
|
||||
var classname = typeof this.classname !== 'undefined' ? this.classname : 'img-sm img-center';
|
||||
var classname = typeof this.classname !== 'undefined' ? this.classname : 'img-sm img-center previewitem';
|
||||
var arr = value != '' ? value.split(',') : [];
|
||||
var html = [];
|
||||
var url;
|
||||
$.each(arr, function (i, value) {
|
||||
value = value ? value : '/assets/img/blank.gif';
|
||||
url = Fast.api.cdnurl(value, true);
|
||||
url = url.match(/^(\/|data:image\\)/) ? url : url + Config.thumbstyle;
|
||||
url = url.match(/^(\/|data:image\\)/) ? url : url + Config.upload_thumbstyle;
|
||||
html.push('<a href="javascript:"><img class="' + classname + '" src="' + url + '" /></a>');
|
||||
});
|
||||
return html.join(' ');
|
||||
|
||||
Reference in New Issue
Block a user