69 lines
2.4 KiB
JavaScript
69 lines
2.4 KiB
JavaScript
|
|
/*子页面*/
|
||
|
|
function openIframe(id, title, content, width, height) {
|
||
|
|
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,
|
||
|
|
shadeClose: false,
|
||
|
|
area: [width, height],
|
||
|
|
move: false,
|
||
|
|
success: function () {
|
||
|
|
let iframeWin = window["layui-layer-iframe" + layerIndex];
|
||
|
|
}
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
/*新增页面*/
|
||
|
|
function openIframe2(id, title, content, width, height, params) {
|
||
|
|
let layerIndex = layer.open({
|
||
|
|
id: id,
|
||
|
|
type: 2,
|
||
|
|
title: ['<div style="border-left: 3px solid #00377A;color:#00377A;font-size:18px;display: flex;letter-spacing:1px;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,
|
||
|
|
shadeClose: false,
|
||
|
|
area: [width, height],
|
||
|
|
move: false,
|
||
|
|
success: function () {
|
||
|
|
let iframeWin = window["layui-layer-iframe" + layerIndex];
|
||
|
|
console.log(params)
|
||
|
|
iframeWin.setParams(JSON.stringify(params));
|
||
|
|
},
|
||
|
|
cancel: function () {
|
||
|
|
// 视频监控-历史回放关闭前回调
|
||
|
|
if (params.videoMonitor) {
|
||
|
|
let iframeWin = window["layui-layer-iframe" + layerIndex];
|
||
|
|
iframeWin.clickLogout();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
function openIframeByParamObj(id, title, content, width, height, paramsObj, type) {
|
||
|
|
let layerIndex = layer.open({
|
||
|
|
id: id,
|
||
|
|
type: 2,
|
||
|
|
title:false,
|
||
|
|
content: content,
|
||
|
|
shade: 0.3,
|
||
|
|
anim: 2,
|
||
|
|
skin: "my-skin child-skin",
|
||
|
|
shadeClose: false,
|
||
|
|
area: [width, height],
|
||
|
|
move: false,
|
||
|
|
success: function () {
|
||
|
|
if (paramsObj) {
|
||
|
|
let iframeWin = window["layui-layer-iframe" + layerIndex];
|
||
|
|
iframeWin.setParams(JSON.stringify(paramsObj));
|
||
|
|
}
|
||
|
|
},
|
||
|
|
end: function () {
|
||
|
|
if (type) {
|
||
|
|
showPlugin();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
});
|
||
|
|
}
|