提交 c371adef 编写于 作者: W weizhiqiang

【图片】图片查看调优

上级 6e145ab1
......@@ -120,79 +120,19 @@ layui.config({
});
}
/***
* 图片弹出展示,默认原大小展示。图片大于浏览器时下窗口可视区域时,进行等比例缩小。
* config.src 图片路径。必须项
* default_config.height 图片显示高度,默认原大小展示。图片大于浏览器时下窗口可视区域时,进行等比例缩小。
* default_config.width 图片显示宽度,默认原大小展示。图片大于浏览器时下窗口可视区域时,进行等比例缩小。
* default_config.title 弹出框标题
*/
function previewImg(config) {
if(!config.src || config.src==""){
layer.msg("没有发现图片!");
return ;
}
var default_config = {title: "流程图"};
var img = new Image();
img.onload = function() {//避免图片还未加载完成无法获取到图片的大小。
//避免图片太大,导致弹出展示超出了网页显示访问,所以图片大于浏览器时下窗口可视区域时,进行等比例缩小。
var max_height = $(window).height() - 100;
var max_width = $(window).width();
//rate1,rate2,rate3 三个比例中取最小的。
var rate1 = max_height / img.height;
var rate2 = max_width / img.width;
var rate3 = 1;
var rate = Math.min(rate1, rate2, rate3);
//等比例缩放
default_config.height = img.height * rate; //获取图片高度
default_config.width = img.width * rate; //获取图片宽度
$.extend( default_config, config);
var imgHtml = "<img src='" + default_config.src + "' width='" + default_config.width + "px' height='" + default_config.height + "px'/>";
//弹出层
layer.open({
type: 1,
shade: 0.8,
offset: 'auto',
area: [(default_config.width + 100) + 'px', (default_config.height + 100) + 'px'], ////宽,高
shadeClose:true,
scrollbar: false,
title: default_config.title, //不显示标题
content: imgHtml, //捕获的元素,注意:最好该指定的元素要存放在body最外层,否则可能被其它的相对元素所影响
cancel: function () {
},
error: function(){
}
});
}
img.onerror = function() {
winui.window.msg("该流程图已不存在,无法进行查看。", {icon: 2, time: 2000});
}
img.src = config.src;
}
//附件下载
// 附件下载
$("body").on("click", ".enclosureItem", function() {
download(fileBasePath + $(this).attr("rowpath"), $(this).html());
});
//工作流图片查看
// 工作流图片查看
$("body").on("click", "#processInstanceIdImg", function() {
previewImg({src: $(this).attr("src")});
systemCommonUtil.showPicImg($(this).attr("src"));
});
//图片查看
// 图片查看
$("body").on("click", ".photo-img", function() {
var src = $(this).attr("src");
layer.open({
type:1,
title:false,
closeBtn:0,
skin: 'demo-class',
shadeClose:true,
content:'<img src="' + src + '" style="max-height:600px;max-width:100%;">',
scrollbar:false
});
systemCommonUtil.showPicImg($(this).attr("src"));
});
form.render();
......
......@@ -32,16 +32,7 @@ layui.config({
});
$("body").on("click", "#assetImg", function() {
var src = $(this).attr("src");
layer.open({
type:1,
title:false,
closeBtn:0,
skin: 'demo-class',
shadeClose:true,
content:'<img src="' + src + '" style="max-height:600px;max-width:100%;">',
scrollbar:false
});
systemCommonUtil.showPicImg($(this).attr("src"));
});
});
});
\ No newline at end of file
......@@ -35,18 +35,9 @@ layui.config({
matchingLanguage();
}});
//图片查看
// 图片查看
$("body").on("click", ".photo-img", function() {
var src = $(this).attr("src");
layer.open({
type:1,
title:false,
closeBtn:0,
skin: 'demo-class',
shadeClose:true,
content:'<img src="' + src + '" style="max-height:600px;max-width:100%;">',
scrollbar:false
});
systemCommonUtil.showPicImg($(this).attr("src"));
});
});
......
......@@ -23,22 +23,12 @@ layui.config({
// 附件回显
skyeyeEnclosure.showDetails({"enclosureUploadBtn": json.bean.enclosureInfo});
matchingLanguage();
}
});
$("body").on("click", "#roomImg", function() {
var src = $(this).attr("src");
layer.open({
type:1,
title:false,
closeBtn:0,
skin: 'demo-class',
shadeClose:true,
content:'<img src="' + src + '" style="max-height:600px;max-width:100%;">',
scrollbar:false
});
systemCommonUtil.showPicImg($(this).attr("src"));
});
});
});
\ No newline at end of file
......@@ -64,29 +64,21 @@ layui.config({
table.on('tool(messageTable)', function (obj) {
var data = obj.data;
var layEvent = obj.event;
if (layEvent === 'repair') { //修复
repair(data);
}else if (layEvent === 'roomImg') { //图片预览
layer.open({
type:1,
title:false,
closeBtn:0,
skin: 'demo-class',
shadeClose:true,
content:'<img src="' + fileBasePath + data.roomImg + '" style="max-height:600px;max-width:100%;">',
scrollbar:false
});
}else if (layEvent === 'details') { //详情
details(data);
}else if (layEvent === 'scrap'){ //报废
scrap(data);
}else if (layEvent === 'normal'){ //恢复正常
normal(data);
}else if (layEvent === 'delet'){ //删除
delet(data);
}else if (layEvent === 'edit'){ //编辑
edit(data);
}
if (layEvent === 'repair') { // 修复
repair(data);
} else if (layEvent === 'roomImg') { // 图片预览
systemCommonUtil.showPicImg(fileBasePath + data.roomImg);
} else if (layEvent === 'details') { // 详情
details(data);
} else if (layEvent === 'scrap') { // 报废
scrap(data);
} else if (layEvent === 'normal') { // 恢复正常
normal(data);
} else if (layEvent === 'delet') { // 删除
delet(data);
} else if (layEvent === 'edit') { // 编辑
edit(data);
}
});
form.render();
......
......@@ -28,16 +28,7 @@ layui.config({
});
$("body").on("click", "#vehicleImg", function() {
var src = $(this).attr("src");
layer.open({
type:1,
title:false,
closeBtn:0,
skin: 'demo-class',
shadeClose:true,
content:'<img src="' + src + '" style="max-height:600px;max-width:100%;">',
scrollbar:false
});
systemCommonUtil.showPicImg($(this).attr("src"));
});
});
});
\ No newline at end of file
......@@ -67,29 +67,21 @@ layui.config({
table.on('tool(vehicleTable)', function (obj) {
var data = obj.data;
var layEvent = obj.event;
if (layEvent === 'vehiclerepair') { //维修
vehiclerepair(data);
}else if (layEvent === 'vehicleImg') { //图片预览
layer.open({
type:1,
title:false,
closeBtn:0,
skin: 'demo-class',
shadeClose:true,
content:'<img src="' + fileBasePath + data.vehicleImg + '" style="max-height:600px;max-width:100%;">',
scrollbar:false
});
}else if (layEvent === 'vehicledetails') { //详情
vehicledetails(data);
}else if (layEvent === 'vehiclescrap'){ //报废
vehiclescrap(data);
}else if (layEvent === 'vehiclenormal'){ //恢复正常
vehiclenormal(data);
}else if (layEvent === 'vehicledelet'){ //删除
vehicledelet(data);
}else if (layEvent === 'vehicleedit'){ //编辑
vehicleedit(data);
}
if (layEvent === 'vehiclerepair') { // 维修
vehiclerepair(data);
} else if (layEvent === 'vehicleImg') { // 图片预览
systemCommonUtil.showPicImg(fileBasePath + data.vehicleImg);
} else if (layEvent === 'vehicledetails') { // 详情
vehicledetails(data);
} else if (layEvent === 'vehiclescrap') { // 报废
vehiclescrap(data);
} else if (layEvent === 'vehiclenormal') { // 恢复正常
vehiclenormal(data);
} else if (layEvent === 'vehicledelet') { // 删除
vehicledelet(data);
} else if (layEvent === 'vehicleedit') { // 编辑
vehicleedit(data);
}
});
// 车辆详情
......
......@@ -13,7 +13,7 @@ layui.config({
var useTemplate = $("#useTemplate").html();
AjaxPostUtil.request({url: flowableBasePath + "vehicle016", params:{rowId: parent.rowId}, type: 'json', callback: function (json) {
//状态
// 状态
if(json.bean.state == '0'){
json.bean.stateName = "<span>" + json.bean.stateName + "</span>";
}else if(json.bean.state == '1'){
......@@ -46,16 +46,7 @@ layui.config({
}});
$("body").on("click", "#vehicleImg", function() {
var src = $(this).attr("src");
layer.open({
type:1,
title:false,
closeBtn:0,
skin: 'demo-class',
shadeClose:true,
content:'<img src="' + src + '" style="max-height:600px;max-width:100%;">',
scrollbar:false
});
systemCommonUtil.showPicImg($(this).attr("src"));
});
});
......
......@@ -85,16 +85,7 @@ layui.config({
// 图片预览
$("body").on("click", ".barCode", function (e) {
var src = $(this).attr("src");
layer.open({
type: 1,
title: false,
closeBtn: 0,
skin: 'demo-class',
shadeClose: true,
content: '<img src="' + src + '" style="max-height:600px; max-width:100%;">',
scrollbar: false
});
systemCommonUtil.showPicImg($(this).attr("src"));
});
// 验收
......
......@@ -49,20 +49,12 @@ layui.config({
}
});
//图片预览
// 图片预览
$("body").on("click", ".barCode", function (e) {
layer.open({
type:1,
title:false,
closeBtn:0,
skin: 'demo-class',
shadeClose:true,
content:'<img src="' + fileBasePath + $(this).attr("src") + '" style="max-height:600px;max-width:100%;">',
scrollbar:false
});
systemCommonUtil.showPicImg(fileBasePath + $(this).attr("src"));
});
//取消
// 取消
$("body").on("click", "#cancle", function() {
parent.layer.close(index);
});
......
......@@ -39,17 +39,9 @@ layui.config({
});
});
//图片预览
// 图片预览
$("body").on("click", ".barCode", function (e) {
layer.open({
type:1,
title:false,
closeBtn:0,
skin: 'demo-class',
shadeClose:true,
content:'<img src="' + fileBasePath + $(this).attr("src") + '" style="max-height:600px;max-width:100%;">',
scrollbar:false
});
systemCommonUtil.showPicImg(fileBasePath + $(this).attr("src"));
});
});
......
......@@ -39,17 +39,9 @@ layui.config({
});
});
//图片预览
// 图片预览
$("body").on("click", ".barCode", function (e) {
layer.open({
type:1,
title:false,
closeBtn:0,
skin: 'demo-class',
shadeClose:true,
content:'<img src="' + fileBasePath + $(this).attr("src") + '" style="max-height:600px;max-width:100%;">',
scrollbar:false
});
systemCommonUtil.showPicImg(fileBasePath + $(this).attr("src"));
});
});
......
......@@ -39,17 +39,9 @@ layui.config({
});
});
//图片预览
// 图片预览
$("body").on("click", ".barCode", function (e) {
layer.open({
type:1,
title:false,
closeBtn:0,
skin: 'demo-class',
shadeClose:true,
content:'<img src="' + fileBasePath + $(this).attr("src") + '" style="max-height:600px;max-width:100%;">',
scrollbar:false
});
systemCommonUtil.showPicImg(fileBasePath + $(this).attr("src"));
});
});
......
......@@ -57,25 +57,17 @@ layui.config({
table.on('tool(messageTable)', function (obj) {
var data = obj.data;
var layEvent = obj.event;
if (layEvent === 'edit') { //编辑
edit(data);
}else if (layEvent === 'delete'){ //删除
del(data);
}else if (layEvent === 'up') { //上线
up(data);
}else if (layEvent === 'down') { //下线
down(data);
}else if (layEvent === 'appLogo') { //预览
layer.open({
type:1,
title:false,
closeBtn:0,
skin: 'demo-class',
shadeClose:true,
content:'<img src="' + fileBasePath + data.appLogo + '" style="max-height:600px;max-width:100%;">',
scrollbar:false
});
}
if (layEvent === 'edit') { // 编辑
edit(data);
} else if (layEvent === 'delete') { // 删除
del(data);
} else if (layEvent === 'up') { // 上线
up(data);
} else if (layEvent === 'down') { // 下线
down(data);
} else if (layEvent === 'appLogo') { // 预览
systemCommonUtil.showPicImg(fileBasePath + data.appLogo);
}
});
form.render();
......
......@@ -63,29 +63,21 @@ layui.config({
table.on('tool(messageTable)', function (obj) {
var data = obj.data;
var layEvent = obj.event;
if (layEvent === 'edit') { //编辑
edit(data);
}else if (layEvent === 'iconPath') { //预览
layer.open({
type:1,
title:false,
closeBtn:0,
skin: 'demo-class',
shadeClose:true,
content:'<img src="' + fileBasePath + data.iconPath + '" style="max-height:600px;max-width:100%;">',
scrollbar:false
});
}else if (layEvent === 'delete'){ //删除
del(data);
}else if (layEvent === 'up') { //上线
up(data);
}else if (layEvent === 'down') { //下线
down(data);
}else if (layEvent === 'top') { //上移
topOne(data);
}else if (layEvent === 'lower') { //下移
lowerOne(data);
}
if (layEvent === 'edit') { // 编辑
edit(data);
} else if (layEvent === 'iconPath') { // 预览
systemCommonUtil.showPicImg(fileBasePath + data.iconPath);
} else if (layEvent === 'delete') { // 删除
del(data);
} else if (layEvent === 'up') { // 上线
up(data);
} else if (layEvent === 'down') { // 下线
down(data);
} else if (layEvent === 'top') { // 上移
topOne(data);
} else if (layEvent === 'lower') { // 下移
lowerOne(data);
}
});
form.render();
......
......@@ -264,20 +264,12 @@ layui.config({
}
});
//图片预览
// 图片预览
$('body').on('click', '.cursor', function() {
layer.open({
type:1,
title:false,
closeBtn:0,
skin: 'demo-class',
shadeClose:true,
content:'<img src="' + $(this).attr("src") + '" style="max-height:600px;max-width:100%;">',
scrollbar:false
});
systemCommonUtil.showPicImg($(this).attr("src"));
});
//页面内组件选中组件项
// 页面内组件选中组件项
$('body').on('click', '.check-item', function() {
$(".check-item").removeClass("show-operation");
$(".check-item").removeClass("check-item-shoose");//移除之前被选中的组件
......
......@@ -77,21 +77,13 @@ layui.config({
table.on('tool(messageTable)', function (obj) {
var data = obj.data;
var layEvent = obj.event;
if (layEvent === 'edit') { //编辑
edit(data);
}else if (layEvent === 'userPhoto') { //头像预览
layer.open({
type:1,
title:false,
closeBtn:0,
skin: 'demo-class',
shadeClose:true,
content:'<img src="' + fileBasePath + data.userPhoto + '" style="max-height:600px;max-width:100%;">',
scrollbar:false
});
}else if (layEvent === 'details') { //教师详情
details(data);
}
if (layEvent === 'edit') { // 编辑
edit(data);
} else if (layEvent === 'userPhoto') { // 头像预览
systemCommonUtil.showPicImg(fileBasePath + data.userPhoto);
} else if (layEvent === 'details') { // 教师详情
details(data);
}
});
form.render();
}
......
......@@ -86,21 +86,13 @@ layui.config({
layui.table.on('tool(messageTable)', function (obj) {
var data = obj.data;
var layEvent = obj.event;
if (layEvent === 'subBind') { //科目技能绑定
subBind(data);
}else if (layEvent === 'userPhoto') { //头像预览
layer.open({
type:1,
title:false,
closeBtn:0,
skin: 'demo-class',
shadeClose:true,
content:'<img src="' + fileBasePath + data.userPhoto + '" style="max-height:600px;max-width:100%;">',
scrollbar:false
});
}else if (layEvent === 'details') { //教师详情
details(data);
}
if (layEvent === 'subBind') { // 科目技能绑定
subBind(data);
} else if (layEvent === 'userPhoto') { // 头像预览
systemCommonUtil.showPicImg(fileBasePath + data.userPhoto);
} else if (layEvent === 'details') { // 教师详情
details(data);
}
});
form.render();
......
......@@ -91,7 +91,7 @@ layui.config({
}
});
//客户详情
// 客户详情
$("body").on("click", ".customerNameMation", function() {
rowId = $(this).attr("rowid");
_openNewWindows({
......@@ -103,7 +103,7 @@ layui.config({
}});
});
//产品详情
// 产品详情
$("body").on("click", ".productNameMation", function() {
rowId = $(this).attr("rowid");
_openNewWindows({
......@@ -115,7 +115,7 @@ layui.config({
}});
});
//故障关键组件详情
// 故障关键组件详情
$("body").on("click", ".faultKeyPartsNameMation", function() {
rowId = $(this).attr("rowid");
_openNewWindows({
......@@ -127,21 +127,12 @@ layui.config({
}});
});
//图片查看
// 图片查看
$("body").on("click", ".pictureItem", function() {
var src = $(this).attr("src");
layer.open({
type:1,
title:false,
closeBtn:0,
skin: 'demo-class',
shadeClose:true,
content:'<img src="' + src + '" style="max-height:600px;max-width:100%;">',
scrollbar:false
});
systemCommonUtil.showPicImg($(this).attr("src"));
});
//打印
// 打印
$("body").on("click", "#jprint", function (e) {
$("#showForm").jqprint({
title: '售后工单',
......@@ -152,7 +143,7 @@ layui.config({
});
});
//情况反馈详情
// 情况反馈详情
$("body").on("click", ".details", function() {
rowId = $(this).attr("rowid");
_openNewWindows({
......
......@@ -42,17 +42,10 @@ layui.config({
}
matchingLanguage();
form.render();
$("body").on("click","#menuIconPic", function() {
layer.open({
type:1,
title:false,
closeBtn:0,
skin: 'demo-class',
shadeClose:true,
content:'<img src="' + fileBasePath + json.bean.menuIconPic + '" style="max-height:400px;max-width:100%;">',
scrollbar:false
});
})
systemCommonUtil.showPicImg(fileBasePath + json.bean.menuIconPic);
})
}
});
......
......@@ -111,29 +111,21 @@ layui.config({
table.on('tool(messageTable)', function (obj) {
var data = obj.data;
var layEvent = obj.event;
if (layEvent === 'del') { //删除
del(data, obj);
}else if (layEvent === 'edit') { //编辑
edit(data);
}else if (layEvent === 'top') { //上移
topOne(data);
}else if (layEvent === 'lower') { //下移
lowerOne(data);
}else if (layEvent === 'authpoint') { //权限点
authpoint(data);
}else if(layEvent === 'menuIconPic'){ //图片
layer.open({
type:1,
title:false,
closeBtn:0,
skin: 'demo-class',
shadeClose:true,
content:'<img src="' + fileBasePath + data.menuIconPic + '" style="max-height:600px;max-width:100%;">',
scrollbar:false
});
}else if (layEvent === 'details') { //详情
details(data);
}
if (layEvent === 'del') { // 删除
del(data, obj);
} else if (layEvent === 'edit') { // 编辑
edit(data);
} else if (layEvent === 'top') { // 上移
topOne(data);
} else if (layEvent === 'lower') { // 下移
lowerOne(data);
} else if (layEvent === 'authpoint') { // 权限点
authpoint(data);
} else if (layEvent === 'menuIconPic') { // 图片
systemCommonUtil.showPicImg(fileBasePath + data.menuIconPic);
} else if (layEvent === 'details') { // 详情
details(data);
}
});
}
......
......@@ -65,25 +65,17 @@ layui.config({
table.on('tool(messageTable)', function (obj) {
var data = obj.data;
var layEvent = obj.event;
if (layEvent === 'unlock') { //解锁
unlock(data);
}else if (layEvent === 'edit') { //编辑
edit(data);
}else if (layEvent === 'bindRole') { //绑定角色
bindRole(data);
}else if (layEvent === 'userPhoto') { //头像预览
layer.open({
type:1,
title:false,
closeBtn:0,
skin: 'demo-class',
shadeClose:true,
content:'<img src="' + fileBasePath + data.userPhoto + '" style="max-height:600px;max-width:100%;">',
scrollbar:false
});
}else if (layEvent === 'details') { //员工详情
details(data);
}
if (layEvent === 'unlock') { // 解锁
unlock(data);
} else if (layEvent === 'edit') { // 编辑
edit(data);
} else if (layEvent === 'bindRole') { // 绑定角色
bindRole(data);
} else if (layEvent === 'userPhoto') { // 头像预览
systemCommonUtil.showPicImg(fileBasePath + data.userPhoto);
} else if (layEvent === 'details') { // 员工详情
details(data);
}
});
var loadCompany = false;
......
......@@ -348,16 +348,7 @@ layui.config({
}
$("body").on("click", "#userPhoto", function() {
var src = $(this).attr("src");
layer.open({
type: 1,
title: false,
closeBtn: 0,
skin: 'demo-class',
shadeClose: true,
content: '<img src="' + src + '" style="max-height:600px;max-width:100%;">',
scrollbar: false
});
systemCommonUtil.showPicImg($(this).attr("src"));
});
$("body").on("click", ".workDay", function() {
......
......@@ -58,25 +58,17 @@ layui.config({
table.on('tool(messageTable)', function (obj) {
var data = obj.data;
var layEvent = obj.event;
if (layEvent === 'del') { //删除
del(data, obj);
}else if (layEvent === 'edit') { //编辑
edit(data);
}else if (layEvent === 'authorization'){//授权
authorization(data, obj);
}else if (layEvent === 'cancleauthorization'){//取消授权
cancleauthorization(data, obj);
}else if (layEvent === 'sysPic'){
layer.open({
type:1,
title:false,
closeBtn:0,
skin: 'demo-class',
shadeClose:true,
content:'<img src="' + fileBasePath + data.sysPic + '" style="max-height:600px;max-width:100%;">',
scrollbar:false
});
}
if (layEvent === 'del') { // 删除
del(data, obj);
} else if (layEvent === 'edit') { // 编辑
edit(data);
} else if (layEvent === 'authorization') {// 授权
authorization(data, obj);
} else if (layEvent === 'cancleauthorization') {// 取消授权
cancleauthorization(data, obj);
} else if (layEvent === 'sysPic') {
systemCommonUtil.showPicImg(fileBasePath + data.sysPic);
}
});
//删除
......
......@@ -90,19 +90,11 @@ layui.config({
table.on('tool(messageTable)', function (obj) {
var data = obj.data;
var layEvent = obj.event;
if (layEvent === 'wagesDesign') { // 薪资变更
if (layEvent === 'wagesDesign') { // 薪资变更
wagesDesign(data);
}else if (layEvent === 'userPhoto') { // 头像预览
layer.open({
type:1,
title:false,
closeBtn:0,
skin: 'demo-class',
shadeClose:true,
content:'<img src="' + fileBasePath + data.userPhoto + '" style="max-height:600px;max-width:100%;">',
scrollbar:false
});
}
} else if (layEvent === 'userPhoto') { // 头像预览
systemCommonUtil.showPicImg(fileBasePath + data.userPhoto);
}
});
var loadCompany = false;
......
......@@ -89,19 +89,11 @@ layui.config({
table.on('tool(messageTable)', function (obj) {
var data = obj.data;
var layEvent = obj.event;
if (layEvent === 'wagesDesign') { // 薪资设定
if (layEvent === 'wagesDesign') { // 薪资设定
wagesDesign(data);
}else if (layEvent === 'userPhoto') { // 头像预览
layer.open({
type:1,
title:false,
closeBtn:0,
skin: 'demo-class',
shadeClose:true,
content:'<img src="' + fileBasePath + data.userPhoto + '" style="max-height:600px;max-width:100%;">',
scrollbar:false
});
}
} else if (layEvent === 'userPhoto') { // 头像预览
systemCommonUtil.showPicImg(fileBasePath + data.userPhoto);
}
});
var loadCompany = false;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册