51 lines
1.7 KiB
JavaScript
51 lines
1.7 KiB
JavaScript
import { layuiObj } from "../index.js";
|
||
import { stationurl } from "../../../../public/js/url.js";
|
||
function showSchoolSignature(currentStation,currentTime,signatureImage,signatureImageSchool){
|
||
layuiObj.layer.open({
|
||
type: 1,
|
||
title: `${currentStation}【${currentTime}】-签名`, //不显示标题栏
|
||
area: ['600px', '400px'],
|
||
shade: 0.6,
|
||
id:new Date().getTime(), //设定一个id,防止重复弹出
|
||
btnAlign: 'c',
|
||
moveType: 1, //拖拽模式,0或者1
|
||
content: `<div style="padding:10px;color:#fff;background:#fff;height:calc(100% - 20px);overflow-y:auto;">
|
||
<div class="schoolSignatureContent">
|
||
${getSignatureImg(signatureImage,signatureImageSchool)}
|
||
</div>
|
||
</div>`,
|
||
success: function(layero){
|
||
showImgViewer(signatureImage)
|
||
showImgViewer(signatureImageSchool)
|
||
}
|
||
});
|
||
}
|
||
|
||
//获取签名的照片
|
||
function getSignatureImg(signatureImage,signatureImageSchool){
|
||
var div="";
|
||
if(signatureImage!=null){
|
||
div+=`<div>
|
||
<p>派出所签名:</p>
|
||
<img src="${signatureImage}" id="schoolSignature${signatureImage}">
|
||
</div>`
|
||
}
|
||
if(signatureImageSchool!=null){
|
||
div+=`<div>
|
||
<p>学校签名:</p>
|
||
<img src="${signatureImageSchool}" id="schoolSignature${signatureImageSchool}">
|
||
</div>`
|
||
}
|
||
return div;
|
||
}
|
||
|
||
//图片放大器
|
||
function showImgViewer(img){
|
||
var box=document.getElementById(`schoolSignature${img}`);
|
||
new Viewer(box, {
|
||
inline: false, // 是否启用 inline 模式
|
||
title: true, // 是否显示当前图片的标题
|
||
})
|
||
}
|
||
|
||
export {showSchoolSignature} |