60 lines
1.9 KiB
JavaScript
60 lines
1.9 KiB
JavaScript
|
|
/**
|
|||
|
|
* id:页面ID
|
|||
|
|
* title:标题
|
|||
|
|
* content, 页面路径
|
|||
|
|
* width:宽度
|
|||
|
|
* height:高度
|
|||
|
|
* params 参数
|
|||
|
|
*/
|
|||
|
|
function openIframeByParam(id, title, content, width, height,params) {
|
|||
|
|
let layerIndex = layer.open({
|
|||
|
|
id: id,
|
|||
|
|
type: 2,
|
|||
|
|
title: ['<div style="border-left: 3px solid #409EFF;color:#409EFF;font-size:18px;letter-spacing:1px;display: flex;align-items: center;height: 20px;padding: 0 10px;">' + title + '</div>', 'font-size:16px;background-color:#f0f0f0;display: flex;align-items: center;'],
|
|||
|
|
content: content,
|
|||
|
|
shade: 0.3,
|
|||
|
|
anim: 2,
|
|||
|
|
shadeClose: false,
|
|||
|
|
area: [width, height],
|
|||
|
|
move: false,
|
|||
|
|
success: function () {
|
|||
|
|
if(params){
|
|||
|
|
let iframeWin = window["layui-layer-iframe" + layerIndex];
|
|||
|
|
iframeWin.setParams(params);
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
cancel:function () {},
|
|||
|
|
end:function(){}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* id:页面ID
|
|||
|
|
* title:标题
|
|||
|
|
* content, 页面路径
|
|||
|
|
* width:宽度
|
|||
|
|
* height:高度
|
|||
|
|
* params 参数对象
|
|||
|
|
*/
|
|||
|
|
function openIframeByParamObj(id, title, content, width, height,paramsObj) {
|
|||
|
|
let layerIndex = layer.open({
|
|||
|
|
id: id,
|
|||
|
|
type: 2,
|
|||
|
|
title: ['<div style="border-left: 3px solid #00377A;color:#00377A;font-size:18px;letter-spacing:1px;display: flex;align-items: center;height: 20px;padding: 0 10px;font-weight: bold;">' + title + '</div>', 'font-size:16px;background-color:#f0f0f0;display: flex;align-items: center;'],
|
|||
|
|
content: content,
|
|||
|
|
shade: 0.3,
|
|||
|
|
anim: 2,
|
|||
|
|
shadeClose: false,
|
|||
|
|
area: [width, height],
|
|||
|
|
move: false,
|
|||
|
|
success: function () {
|
|||
|
|
if(paramsObj){
|
|||
|
|
let iframeWin = window["layui-layer-iframe" + layerIndex];
|
|||
|
|
iframeWin.setParams(JSON.stringify(paramsObj));
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
cancel:function () {},
|
|||
|
|
end:function(){}
|
|||
|
|
});
|
|||
|
|
}
|