Iframe_wev8.js
3.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
if(typeof(MEC_NS) == 'undefined'){
MEC_NS = {};
}
MEC_NS.Iframe = function(type, id, mecJson){
this.type = type;
if(!id){
id = new UUID().toString();
}
this.id = id;
if(!mecJson){
mecJson = this.getDefaultMecJson();
}
this.mecJson = mecJson;
var that = this;
require(['mec'], function(mec){
that.remark = function(){
return mec.remark(that.mecJson.iframe_path);
};
});
}
/*获取id。 必需的方法*/
MEC_NS.Iframe.prototype.getID = function(){
return this.id;
};
/*获取设计的html, 页面上怎么显示控件完全依赖于此方法。 必需的方法*/
MEC_NS.Iframe.prototype.getDesignHtml = function(){
return getDesignHtml(this);
};
/*页面上显示控件完成后调用此方法,主要用于一些必须要使用js对页面进行后置操作时,无需要此方法可至空。 不必需的方法,有此方法系统自动调用*/
MEC_NS.Iframe.prototype.afterDesignHtmlBuild = function(){
var theId = this.id;
};
/*获取构建属性编辑窗体的html,添加和单击控件后会调用此方法,由此方法去构建属性编辑窗体。 必需的方法*/
MEC_NS.Iframe.prototype.getAttrDlgHtml = function(){
var theId = this.id;
var htm = "<div id=\"MADIframe_"+theId+"\">";
htm += "<div class=\"title\">"+SystemEnv.getHtmlNoteName(4650)+"</div>"; //Iframe信息
htm += "<div class=\"form-group\">"
+ "<div class=\"row\">"
+ "<span class=\"col-2 span-control\">"+SystemEnv.getHtmlNoteName(4255)+"</span>" //来源:
+ "<div class=\"col-m-8\" >"
+ "<input id=\"iframe_path_"+theId+"\" data-autobind='iframe_path' type=\"text\" class=\"form-control\" style=\"padding-right: 16px;\"/>"
+ "</div>"
+ "</div>"
+ "<div class=\"row\">"
+"<span class=\"col-2 span-control\">"+SystemEnv.getHtmlNoteName(4191)+"</span>" //宽度:
+ "<div class=\"col-m-8\" >"
+"<input class=\"form-control\" id=\"width_"+theId+"\" data-autobind='width' type=\"text\" placeholder=\""+SystemEnv.getHtmlNoteName(4491)+"\"/>" //如:344,此处缺省则为页面宽度
+ "</div>"
+ "</div>"
+ "<div class=\"row\">"
+"<span class=\"col-2 span-control\">"+SystemEnv.getHtmlNoteName(4128)+"</span>" //高度:
+ "<div class=\"col-m-8\" >"
+"<input class=\"form-control\" id=\"height_"+theId+"\" data-autobind='height' type=\"text\" placeholder=\""+SystemEnv.getHtmlNoteName(4496)+"\"/>" //如:617,此处缺省则为页面高度
+ "</div>"
+ "</div>"
htm += "</div>";
htm += "<div class=\"bottom\"><div class=\"save-btn\" onclick=\"refreshMecDesign('"+theId+"');\">"+SystemEnv.getHtmlNoteName(3451)+"</div></div>"; //确定
htm += "</div>";
htm += "<div class=\"MAD_Alert\">"+SystemEnv.getHtmlNoteName(4115)+"</div>"; //已生成到布局
return htm;
};
/*构建属性编辑窗体完成后调用此方法,主要用于一些必须要使用js对页面进行后置操作时,无需要此方法可至空。 不必需的方法,有此方法系统自动调用*/
MEC_NS.Iframe.prototype.afterAttrDlgBuild = function(){
var theId = this.id;
var iframe_path = this.mecJson["iframe_path"];
var width = this.mecJson["width"];
var height = this.mecJson["height"];
$("#iframe_path_"+theId).val(iframe_path);
$("#width_"+theId).val(width);
$("#height_"+theId).val(height);
};
/*获取JSON*/
MEC_NS.Iframe.prototype.getMecJson = function(){
var theId = this.id;
this.mecJson["id"] = theId;
this.mecJson["mectype"] = this.type;
var $attrContainer = $("#MADIframe_"+theId);
if($attrContainer.length > 0){
this.mecJson["iframe_path"] = $("#iframe_path_"+theId).val();
this.mecJson["width"] = $("#width_"+theId).val();
this.mecJson["height"] = $("#height_"+theId).val();
}
return this.mecJson;
};
MEC_NS.Iframe.prototype.getDefaultMecJson = function(){
var theId = this.id;
var defMecJson = {};
defMecJson["id"] = theId;
defMecJson["mectype"] = this.type;
defMecJson["iframe_path"] = "";
defMecJson["width"] = "";
defMecJson["height"] = "";
return defMecJson;
};