cc-jjsp-web/bns/js/public/openIframe.js

259 lines
8.0 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* 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 #409EFF;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 () { }
});
}
function openIframeByParamObj2(id, title, content, width, height, paramsObj) {
let layerIndex = parent.layer.open({
id: id,
type: 2,
title: ['<div style="border-left: 3px solid #409EFF;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 = parent.window["layui-layer-iframe" + layerIndex];
iframeWin.setParams(JSON.stringify(paramsObj));
}
},
cancel: function () { },
end: function () { }
});
}
/**
* id页面ID
* title标题
* content, 页面路径
* width宽度
* height高度
* params 参数
*/
function openIframeByParamObj3(id, title, content, width, height, params) {
let width2 = getDefaultWidth().toFixed(0) + "px";
let height2 = getDefaultHeight().toFixed(0) + "px";
let layerIndex = layer.open({
id: id,
title: false,
type: 2,
maxmin: false,
skin: "my-skin child-skin",
content: content,
shade: 0.65,
anim: 2,
closeBtn: 0,
shadeClose: false,
area: [width2, height2],
move: false,
success: function () {
if (params) {
let iframeWin = window["layui-layer-iframe" + layerIndex];
iframeWin.setParams(JSON.stringify(params));
}
$(window).resize(function () {
if (autoResizeWidth) autoResizeWidth(index);
if (autoResizeHeight) autoResizeHeight(index);
});
},
cancel: function () { },
end: function () { }
});
}
/* dtree专用弹框 */
function openIframeByDtree(id, title, content, width, height, params, $div) {
let layerIndex = layer.open({
id: id,
type: 2,
title: ['<div style="border-left: 3px solid #409EFF;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 () {
let iframeWin = window["layui-layer-iframe" + layerIndex];
iframeWin.setParams(JSON.stringify(params));
},
end: function () {
if (jsonData) {
if (params.type === 2) {
// 修改节点
fitTypeTree.partialRefreshEdit($div, jsonData.title);
} else if (params.type === 1) {
// 新增节点
fitTypeTree.partialRefreshAdd($div, jsonData);
}
jsonData = null;
}
}
});
}
function openIframeByParamObj5(id, title, content, width, height, paramsObj) {
let layerIndex = layer.open({
id: id,
type: 2,
title: false,
content: content,
shade: 0.3,
anim: 2,
shadeClose: false,
closeBtn: 0,
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 () { }
});
}
function openIframeByParamObj6(id, title, content, width, height, paramsObj) {
let layerIndex = layer.open({
id: id,
type: 2,
title: ['<div style="border-left: 3px solid #409EFF;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 () {
},
cancel: function () { },
end: function () { }
});
}
/**
* id页面ID
* title标题
* content, 页面路径
* width宽度
* height高度
* params 参数对象
*/
function openIframeByParamObjNoTitle(id, title, content, width, height, paramsObj) {
let layerIndex = layer.open({
id: id,
type: 2,
title: false,
maxmin: false,
content: content,
move: false,
closeBtn: 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 () { }
});
}
/**
* id页面ID
* title标题
* content, 页面路径
* width宽度
* height高度
* params 参数对象
*/
function openIframeByParamObj7(id, title, content, width, height, paramsObj) {
let layerIndex = layer.open({
id: id,
type: 2,
title: ['<div style="border-left: 3px solid #409EFF;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,
closeBtn: 0,
success: function (layero, index) {
if (paramsObj) {
let iframeWin = window["layui-layer-iframe" + layerIndex];
iframeWin.setParams(JSON.stringify(paramsObj));
}
},
cancel: function () { },
end: function () {
}
});
}