Browse Source

REPORT-11699 网页框插件10 url编码适配

master
yaoh.wu 7 years ago
parent
commit
d26a623fe6
  1. 26
      src/main/resources/com/fr/plugin/form/widget/web/widget.rh.iframe.js

26
src/main/resources/com/fr/plugin/form/widget/web/widget.rh.iframe.js

@ -2,7 +2,7 @@
* @class FR.RHIframe * @class FR.RHIframe
* @extends FR.BaseEditor * @extends FR.BaseEditor
*/ */
(function($){ (function ($) {
FR.RHIframe = FR.extend(FR.BaseEditor, { FR.RHIframe = FR.extend(FR.BaseEditor, {
@ -31,8 +31,8 @@
o.iframeName = o.widgetName || this.createNoRepeatName(); o.iframeName = o.widgetName || this.createNoRepeatName();
this.$iframe = $("<iframe name=" + o.iframeName + " id=" this.$iframe = $("<iframe name=" + o.iframeName + " id="
+ o.iframeName + ">").addClass(o.baseClass).attr({ + o.iframeName + ">").addClass(o.baseClass).attr({
width : '100%', width: '100%',
height : '100%', height: '100%',
frameborder: 0, frameborder: 0,
scrolling: !o.showOverFlowX && !o.showOverFlowY scrolling: !o.showOverFlowX && !o.showOverFlowY
? 'no' ? 'no'
@ -55,6 +55,7 @@
setOverflow($(doc.documentElement)); setOverflow($(doc.documentElement));
setOverflow($(doc.body)); setOverflow($(doc.body));
} }
function setOverflow(cc) { function setOverflow(cc) {
if (!o.showOverFlowX) { if (!o.showOverFlowX) {
cc.css('overflow-x', 'hidden'); cc.css('overflow-x', 'hidden');
@ -68,7 +69,7 @@
console && console.log("error"); console && console.log("error");
} }
} }
} };
// IE里面需要设置rowspan为1才能正常显示....否则会跳过n行不显示,chrome应该是bug,一会儿好一会儿不好 // IE里面需要设置rowspan为1才能正常显示....否则会跳过n行不显示,chrome应该是bug,一会儿好一会儿不好
if ($.browser.msie && (this.$iframe.parent()).is("div") if ($.browser.msie && (this.$iframe.parent()).is("div")
@ -159,16 +160,15 @@
} }
// 模板 // 模板
if (this.options.sourceType == 'tpl') { if (this.options.sourceType == 'tpl') {
var cpParas = {};
$.each(paras, function (pName, pValue) { $.each(paras, function (pName, pValue) {
if (FR.isArray(pValue)) { //后端没有encode,那就前端做
paras[pName] = pValue; cpParas[encodeURIComponent(pName)] = encodeURIComponent(pValue);
} else {
paras[pName] = encodeURIComponent(pValue);
}
}); });
src += "__parameters__=" + FR.cjkEncode(FR.jsonEncode(paras)); src += "__parameters__=" + encodeURIComponent(FR.jsonEncode(cpParas));
} else { } else {
$.each(paras, function (name, value) { $.each(paras, function (name, value) {
// web链接的参数不进行额外处理。
if (typeof(name) === 'string') { if (typeof(name) === 'string') {
src += name + "=" + value + "&"; src += name + "=" + value + "&";
} }
@ -183,7 +183,7 @@
*/ */
_addDisableMask: function () { _addDisableMask: function () {
this.mask = $('<span/>').css({ this.mask = $('<span/>').css({
backgroundColor : '#66B9FF', backgroundColor: '#66B9FF',
height: this.options.height, height: this.options.height,
width: this.options.width, width: this.options.width,
left: this.element.offset().left left: this.element.offset().left
@ -194,7 +194,7 @@
* 设置网页框控件的地址并重新加载页面(保留原参数) * 设置网页框控件的地址并重新加载页面(保留原参数)
* @param {String} v 新的地址 * @param {String} v 新的地址
*/ */
setValue : function(v) { setValue: function (v) {
this.options.src = v; this.options.src = v;
this._loadIframeByGet(); this._loadIframeByGet();
}, },
@ -225,7 +225,7 @@
* 加载指定的url * 加载指定的url
* @param url 网页地址 * @param url 网页地址
*/ */
loadUrl : function(url) { loadUrl: function (url) {
this.$iframe.attr("src", url); this.$iframe.attr("src", url);
}, },

Loading…
Cancel
Save