Commit ad8ae226 by 宋祥

1.二维码展示和放大

parent 48c199c6
......@@ -39,6 +39,16 @@ $(function () {
}
return template;
}
}, {
field: "qrcodeDocId",
template: function (item) {
if (isBlank(item.qrcodeDocId)) {
return "";
} else {
return '<img src="' + downloadHref(item.qrcodeDocId) + '" width="20px" height="20px"'
+ ' onclick="imgClick(\'' + item.qrcodeDocId + '\')" />';
}
}
}],
/**
* 翻页事件,点翻页按钮,输入页数跳转时触发
......@@ -410,3 +420,26 @@ function saveDetail(btn) {
});
}
}
/**
* 图片放大
*/
let imgClick = function (docId) {
// 图片路径
$("#bigImg").attr("src", downloadHref(docId));
$("#bigImg").css({'width': 400});
// 图片淡入
$("#back-curtain").fadeIn("fast");
// 遮罩效果
$("#back-curtain").css({
'position': 'fixed',
'overflow-y': 'auto',
'width': '100%',
'height': '100%',
'z-index': '998'
}).show();
// 点击图片或遮罩,图片淡出
$("#back-curtain").on('click', function () {
$(this).fadeOut("fast");
});
}
......@@ -29,6 +29,7 @@
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="100" align="center"/>
<EF:EFColumn enable="false" ename="qrcodeDocId" cname="二维码" width="50" align="center"/>
<EF:EFColumn enable="false" ename="projCode" cname="项目号" readonly="true" hidden="true"/>
<EF:EFColumn enable="false" ename="planInfoNo" cname="生产计划单号" readonly="true" hidden="true" width="100"/>
<EF:EFColumn enable="false" ename="projName" cname="项目名称" width="120" readonly="true"/>
......@@ -86,3 +87,9 @@
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
<div id="back-curtain" style="position:fixed; top:0; left:0; background:rgba(0,0,0,0.5); z-index:998; width:100%;
display:none;display: flex; justify-content: center; align-items: center;">
<img id="bigImg" src=""/>
</div>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment