|
|
@@ -1,38 +1,38 @@
|
|
|
MWF.require("MWF.widget.Common", null, false);
|
|
|
MWF.require("MWF.widget.JsonTemplate", null, false);
|
|
|
MWF.xApplication.query.ViewDesigner.Property = MWF.FVProperty = new Class({
|
|
|
- Extends: MWF.widget.Common,
|
|
|
- Implements: [Options, Events],
|
|
|
- options: {
|
|
|
- "style": "default",
|
|
|
- "path": "../x_component_query_FormDesigner/property/property.html"
|
|
|
- },
|
|
|
-
|
|
|
- initialize: function(module, propertyNode, designer, options){
|
|
|
- this.setOptions(options);
|
|
|
- this.module = module;
|
|
|
- this.view = module.view;
|
|
|
- this.data = module.json;
|
|
|
+ Extends: MWF.widget.Common,
|
|
|
+ Implements: [Options, Events],
|
|
|
+ options: {
|
|
|
+ "style": "default",
|
|
|
+ "path": "../x_component_query_FormDesigner/property/property.html"
|
|
|
+ },
|
|
|
+
|
|
|
+ initialize: function(module, propertyNode, designer, options){
|
|
|
+ this.setOptions(options);
|
|
|
+ this.module = module;
|
|
|
+ this.view = module.view;
|
|
|
+ this.data = module.json;
|
|
|
this.data.vid = this.view.json.id;
|
|
|
this.data.vtype = this.view.json.type;
|
|
|
- this.data.pid = this.view.json.id+this.data.id;
|
|
|
- this.htmlPath = this.options.path;
|
|
|
- this.designer = designer;
|
|
|
-
|
|
|
- this.propertyNode = propertyNode;
|
|
|
- },
|
|
|
-
|
|
|
- load: function(){
|
|
|
- if (this.fireEvent("queryLoad")){
|
|
|
- MWF.getRequestText(this.htmlPath, function(responseText, responseXML){
|
|
|
- this.htmlString = responseText;
|
|
|
+ this.data.pid = this.view.json.id+this.data.id;
|
|
|
+ this.htmlPath = this.options.path;
|
|
|
+ this.designer = designer;
|
|
|
+
|
|
|
+ this.propertyNode = propertyNode;
|
|
|
+ },
|
|
|
+
|
|
|
+ load: function(){
|
|
|
+ if (this.fireEvent("queryLoad")){
|
|
|
+ MWF.getRequestText(this.htmlPath, function(responseText, responseXML){
|
|
|
+ this.htmlString = responseText;
|
|
|
this.fireEvent("postLoad");
|
|
|
- }.bind(this));
|
|
|
- }
|
|
|
+ }.bind(this));
|
|
|
+ }
|
|
|
this.propertyNode.addEvent("keydown", function(e){e.stopPropagation();});
|
|
|
- },
|
|
|
- editProperty: function(td){
|
|
|
- },
|
|
|
+ },
|
|
|
+ editProperty: function(td){
|
|
|
+ },
|
|
|
getHtmlString: function(callback){
|
|
|
if (!this.htmlString){
|
|
|
MWF.getRequestText(this.htmlPath, function(responseText, responseXML){
|
|
|
@@ -43,7 +43,7 @@ MWF.xApplication.query.ViewDesigner.Property = MWF.FVProperty = new Class({
|
|
|
if (callback) callback();
|
|
|
}
|
|
|
},
|
|
|
- show: function(){
|
|
|
+ show: function(){
|
|
|
if (!this.propertyContent){
|
|
|
this.getHtmlString(function(){
|
|
|
if (this.htmlString){
|
|
|
@@ -75,17 +75,17 @@ MWF.xApplication.query.ViewDesigner.Property = MWF.FVProperty = new Class({
|
|
|
this.propertyContent.setStyle("display", "block");
|
|
|
}
|
|
|
|
|
|
-
|
|
|
|
|
|
- },
|
|
|
- hide: function(){
|
|
|
- //this.JsonTemplate = null;
|
|
|
- //this.propertyNode.set("html", "");
|
|
|
+
|
|
|
+ },
|
|
|
+ hide: function(){
|
|
|
+ //this.JsonTemplate = null;
|
|
|
+ //this.propertyNode.set("html", "");
|
|
|
if (this.propertyContent) this.propertyContent.setStyle("display", "none");
|
|
|
- },
|
|
|
+ },
|
|
|
|
|
|
- loadJSONArea: function(){
|
|
|
- var jsonNode = this.propertyContent.getElement(".MWFJSONArea");
|
|
|
+ loadJSONArea: function(){
|
|
|
+ var jsonNode = this.propertyContent.getElement(".MWFJSONArea");
|
|
|
|
|
|
if (jsonNode){
|
|
|
this.propertyTab.pages.each(function(page){
|
|
|
@@ -102,39 +102,39 @@ MWF.xApplication.query.ViewDesigner.Property = MWF.FVProperty = new Class({
|
|
|
}
|
|
|
}.bind(this));
|
|
|
}
|
|
|
- },
|
|
|
- loadPropertyTab: function(){
|
|
|
- var tabNodes = this.propertyContent.getElements(".MWFTab");
|
|
|
- if (tabNodes.length){
|
|
|
- var tmpNode = this.propertyContent.getFirst();
|
|
|
- var tabAreaNode = new Element("div", {
|
|
|
- "styles": this.view.css.propertyTabNode
|
|
|
- }).inject(tmpNode, "before");
|
|
|
-
|
|
|
- MWF.require("MWF.widget.Tab", function(){
|
|
|
- var tab = new MWF.widget.Tab(tabAreaNode, {"style": "formPropertyList"});
|
|
|
- tab.load();
|
|
|
- var tabPages = [];
|
|
|
- tabNodes.each(function(node){
|
|
|
- var page = tab.addTab(node, node.get("title"), false);
|
|
|
- tabPages.push(page);
|
|
|
- this.setScrollBar(page.contentNodeArea, "small", null, null);
|
|
|
- }.bind(this));
|
|
|
- tabPages[0].showTab();
|
|
|
-
|
|
|
- this.propertyTab = tab;
|
|
|
-
|
|
|
- this.designer.resizeNode();
|
|
|
- }.bind(this), false);
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
- setEditNodeEvent: function(){
|
|
|
- var property = this;
|
|
|
- // var inputs = this.process.propertyListNode.getElements(".editTableInput");
|
|
|
- var inputs = this.propertyContent.getElements("input");
|
|
|
- inputs.each(function(input){
|
|
|
- var jsondata = input.get("name");
|
|
|
+ },
|
|
|
+ loadPropertyTab: function(){
|
|
|
+ var tabNodes = this.propertyContent.getElements(".MWFTab");
|
|
|
+ if (tabNodes.length){
|
|
|
+ var tmpNode = this.propertyContent.getFirst();
|
|
|
+ var tabAreaNode = new Element("div", {
|
|
|
+ "styles": this.view.css.propertyTabNode
|
|
|
+ }).inject(tmpNode, "before");
|
|
|
+
|
|
|
+ MWF.require("MWF.widget.Tab", function(){
|
|
|
+ var tab = new MWF.widget.Tab(tabAreaNode, {"style": "formPropertyList"});
|
|
|
+ tab.load();
|
|
|
+ var tabPages = [];
|
|
|
+ tabNodes.each(function(node){
|
|
|
+ var page = tab.addTab(node, node.get("title"), false);
|
|
|
+ tabPages.push(page);
|
|
|
+ this.setScrollBar(page.contentNodeArea, "small", null, null);
|
|
|
+ }.bind(this));
|
|
|
+ tabPages[0].showTab();
|
|
|
+
|
|
|
+ this.propertyTab = tab;
|
|
|
+
|
|
|
+ this.designer.resizeNode();
|
|
|
+ }.bind(this), false);
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ setEditNodeEvent: function(){
|
|
|
+ var property = this;
|
|
|
+ // var inputs = this.process.propertyListNode.getElements(".editTableInput");
|
|
|
+ var inputs = this.propertyContent.getElements("input");
|
|
|
+ inputs.each(function(input){
|
|
|
+ var jsondata = input.get("name");
|
|
|
if (jsondata && jsondata.substr(0,1)!="_"){
|
|
|
if (this.module){
|
|
|
var id = this.module.json.id;
|
|
|
@@ -187,36 +187,36 @@ MWF.xApplication.query.ViewDesigner.Property = MWF.FVProperty = new Class({
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }.bind(this));
|
|
|
-
|
|
|
- var selects = this.propertyContent.getElements("select");
|
|
|
- selects.each(function(select){
|
|
|
- var jsondata = select.get("name");
|
|
|
- if (jsondata){
|
|
|
- select.addEvent("change", function(e){
|
|
|
- property.setSelectValue(jsondata, this);
|
|
|
- });
|
|
|
+ }.bind(this));
|
|
|
+
|
|
|
+ var selects = this.propertyContent.getElements("select");
|
|
|
+ selects.each(function(select){
|
|
|
+ var jsondata = select.get("name");
|
|
|
+ if (jsondata){
|
|
|
+ select.addEvent("change", function(e){
|
|
|
+ property.setSelectValue(jsondata, this);
|
|
|
+ });
|
|
|
//property.setSelectValue(jsondata, select);
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- var textareas = this.propertyContent.getElements("textarea");
|
|
|
- textareas.each(function(input){
|
|
|
- var jsondata = input.get("name");
|
|
|
- if (jsondata){
|
|
|
- input.addEvent("change", function(e){
|
|
|
- property.setValue(jsondata, this.value);
|
|
|
- });
|
|
|
- input.addEvent("blur", function(e){
|
|
|
- property.setValue(jsondata, this.value);
|
|
|
- });
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ var textareas = this.propertyContent.getElements("textarea");
|
|
|
+ textareas.each(function(input){
|
|
|
+ var jsondata = input.get("name");
|
|
|
+ if (jsondata){
|
|
|
+ input.addEvent("change", function(e){
|
|
|
+ property.setValue(jsondata, this.value);
|
|
|
+ });
|
|
|
+ input.addEvent("blur", function(e){
|
|
|
+ property.setValue(jsondata, this.value);
|
|
|
+ });
|
|
|
input.addEvent("keydown", function(e){
|
|
|
e.stopPropagation();
|
|
|
});
|
|
|
- }
|
|
|
- }.bind(this));
|
|
|
-
|
|
|
- },
|
|
|
+ }
|
|
|
+ }.bind(this));
|
|
|
+
|
|
|
+ },
|
|
|
loadCalendar: function(node, jsondata){
|
|
|
MWF.require("MWF.widget.Calendar", function(){
|
|
|
this.calendar = new MWF.widget.Calendar(node, {
|
|
|
@@ -252,14 +252,14 @@ MWF.xApplication.query.ViewDesigner.Property = MWF.FVProperty = new Class({
|
|
|
}.bind(this));
|
|
|
o[key[len]] = value;
|
|
|
},
|
|
|
- setRadioValue: function(name, input){
|
|
|
- if (input.checked){
|
|
|
+ setRadioValue: function(name, input){
|
|
|
+ if (input.checked){
|
|
|
var i = name.indexOf("*");
|
|
|
var names = (i==-1) ? name.split(".") : name.substr(i+1, name.length).split(".");
|
|
|
|
|
|
var value = input.value;
|
|
|
- if (value=="false") value = false;
|
|
|
- if (value=="true") value = true;
|
|
|
+ if (value=="false") value = false;
|
|
|
+ if (value=="true") value = true;
|
|
|
|
|
|
var oldValue = this.data;
|
|
|
for (var idx = 0; idx<names.length; idx++){
|
|
|
@@ -271,32 +271,32 @@ MWF.xApplication.query.ViewDesigner.Property = MWF.FVProperty = new Class({
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //var oldValue = this.data[name];
|
|
|
- this.changeJsonDate(names, value);
|
|
|
+ //var oldValue = this.data[name];
|
|
|
+ this.changeJsonDate(names, value);
|
|
|
this.changeData(name, input, oldValue);
|
|
|
- }
|
|
|
- },
|
|
|
- setCheckboxValue: function(name, input){
|
|
|
+ }
|
|
|
+ },
|
|
|
+ setCheckboxValue: function(name, input){
|
|
|
var id = this.module.json.id;
|
|
|
var checkboxList = $$("input[name='"+id+name+"']");
|
|
|
- var values = [];
|
|
|
- checkboxList.each(function(checkbox){
|
|
|
- if (checkbox.get("checked")){
|
|
|
- values.push(checkbox.value);
|
|
|
- }
|
|
|
- });
|
|
|
- var oldValue = this.data[name];
|
|
|
- //this.data[name] = values;
|
|
|
+ var values = [];
|
|
|
+ checkboxList.each(function(checkbox){
|
|
|
+ if (checkbox.get("checked")){
|
|
|
+ values.push(checkbox.value);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ var oldValue = this.data[name];
|
|
|
+ //this.data[name] = values;
|
|
|
this.changeJsonDate(name, values);
|
|
|
this.changeData(name, input, oldValue);
|
|
|
- },
|
|
|
- setSelectValue: function(name, select){
|
|
|
- var idx = select.selectedIndex;
|
|
|
- var options = select.getElements("option");
|
|
|
- var value = "";
|
|
|
- if (options[idx]){
|
|
|
- value = options[idx].get("value");
|
|
|
- }
|
|
|
+ },
|
|
|
+ setSelectValue: function(name, select){
|
|
|
+ var idx = select.selectedIndex;
|
|
|
+ var options = select.getElements("option");
|
|
|
+ var value = "";
|
|
|
+ if (options[idx]){
|
|
|
+ value = options[idx].get("value");
|
|
|
+ }
|
|
|
|
|
|
var i = name.indexOf("*");
|
|
|
var names = (i==-1) ? name.split(".") : name.substr(i+1, name.length).split(".");
|
|
|
@@ -312,13 +312,13 @@ MWF.xApplication.query.ViewDesigner.Property = MWF.FVProperty = new Class({
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //var oldValue = this.data[name];
|
|
|
- //this.data[name] = value;
|
|
|
+ //var oldValue = this.data[name];
|
|
|
+ //this.data[name] = value;
|
|
|
this.changeJsonDate(names, value);
|
|
|
this.changeData(name, select, oldValue);
|
|
|
- },
|
|
|
-
|
|
|
- setValue: function(name, value, obj){
|
|
|
+ },
|
|
|
+
|
|
|
+ setValue: function(name, value, obj){
|
|
|
var names = name.split(".");
|
|
|
var oldValue = this.data;
|
|
|
for (var idx = 0; idx<names.length; idx++){
|
|
|
@@ -330,23 +330,23 @@ MWF.xApplication.query.ViewDesigner.Property = MWF.FVProperty = new Class({
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //var oldValue = this.data[name];
|
|
|
- //this.data[name] = value;
|
|
|
+ //var oldValue = this.data[name];
|
|
|
+ //this.data[name] = value;
|
|
|
this.changeJsonDate(names, value);
|
|
|
this.changeData(name, obj, oldValue);
|
|
|
- },
|
|
|
- setEditNodeStyles: function(node){
|
|
|
- var nodes = node.getChildren();
|
|
|
- if (nodes.length){
|
|
|
- nodes.each(function(el){
|
|
|
- var cName = el.get("class");
|
|
|
- if (cName){
|
|
|
- if (this.view.css[cName]) el.setStyles(this.view.css[cName]);
|
|
|
- }
|
|
|
- this.setEditNodeStyles(el);
|
|
|
- }.bind(this));
|
|
|
- }
|
|
|
- },
|
|
|
+ },
|
|
|
+ setEditNodeStyles: function(node){
|
|
|
+ var nodes = node.getChildren();
|
|
|
+ if (nodes.length){
|
|
|
+ nodes.each(function(el){
|
|
|
+ var cName = el.get("class");
|
|
|
+ if (cName){
|
|
|
+ if (this.view.css[cName]) el.setStyles(this.view.css[cName]);
|
|
|
+ }
|
|
|
+ this.setEditNodeStyles(el);
|
|
|
+ }.bind(this));
|
|
|
+ }
|
|
|
+ },
|
|
|
loadScriptArea: function(){
|
|
|
var scriptAreas = this.propertyContent.getElements(".MWFScriptArea");
|
|
|
var formulaAreas = this.propertyContent.getElements(".MWFFormulaArea");
|
|
|
@@ -638,11 +638,10 @@ MWF.xApplication.query.ViewDesigner.Property = MWF.FVProperty = new Class({
|
|
|
}
|
|
|
}.bind(this));
|
|
|
|
|
|
- var radios = node.getElements("input");
|
|
|
+ var radios = node.getElements("input[name='"+this.module.json.id+"groupEntry']");
|
|
|
var group = this.view.data.data.group;
|
|
|
if (group.column==this.data.column) radios[0].set("checked", true);
|
|
|
radios.addEvent("click", function(e){
|
|
|
- debugger;
|
|
|
if (this.checked){
|
|
|
if (this.value=="true") {
|
|
|
_self.view.data.data.group.column = _self.data.column;
|
|
|
@@ -931,11 +930,11 @@ MWF.xApplication.query.ViewDesigner.Property = MWF.FVProperty = new Class({
|
|
|
// var mode = ( this.form.options.mode || "" ).toLowerCase() === "mobile" ? "mobile" : "pc";
|
|
|
Object.each(this.module.stylesList, function(s, key){
|
|
|
// if( s.mode.contains( mode ) ){
|
|
|
- new Element("option", {
|
|
|
- "text": s.name,
|
|
|
- "value": key,
|
|
|
- "selected": ((!this.data.data.viewStyleType && key=="default") || (this.data.data.viewStyleType==key))
|
|
|
- }).inject(node)
|
|
|
+ new Element("option", {
|
|
|
+ "text": s.name,
|
|
|
+ "value": key,
|
|
|
+ "selected": ((!this.data.data.viewStyleType && key=="default") || (this.data.data.viewStyleType==key))
|
|
|
+ }).inject(node)
|
|
|
// }
|
|
|
}.bind(this));
|
|
|
}else{
|
|
|
@@ -1250,26 +1249,26 @@ MWF.xApplication.query.ViewDesigner.Property.Filter = new Class({
|
|
|
switch (this.property.data.type){
|
|
|
case "text":
|
|
|
html += "<option value=''></option><option value='==' "+((this.data.comparison=="==") ? "selected": "")+">等于(==)</option>" +
|
|
|
- "<option value='!=' "+((this.data.comparison=="!=") ? "selected": "")+">不等于(!=)</option>" +
|
|
|
- "<option value='@' "+((this.data.comparison=="@") ? "selected": "")+">包含(@)</option>";
|
|
|
+ "<option value='!=' "+((this.data.comparison=="!=") ? "selected": "")+">不等于(!=)</option>" +
|
|
|
+ "<option value='@' "+((this.data.comparison=="@") ? "selected": "")+">包含(@)</option>";
|
|
|
break;
|
|
|
case "date":
|
|
|
html += "<option value=''></option><option value='>' "+((this.data.comparison==">") ? "selected": "")+">大于(>)</option>" +
|
|
|
- "<option value='<' "+((this.data.comparison=="<") ? "selected": "")+">小于(<)</option>" +
|
|
|
- "<option value='>=' "+((this.data.comparison==">=") ? "selected": "")+">大于等于(>=)</option>" +
|
|
|
- "<option value='<=' "+((this.data.comparison=="<=") ? "selected": "")+">小于等于(<=)</option>";
|
|
|
+ "<option value='<' "+((this.data.comparison=="<") ? "selected": "")+">小于(<)</option>" +
|
|
|
+ "<option value='>=' "+((this.data.comparison==">=") ? "selected": "")+">大于等于(>=)</option>" +
|
|
|
+ "<option value='<=' "+((this.data.comparison=="<=") ? "selected": "")+">小于等于(<=)</option>";
|
|
|
break;
|
|
|
case "number":
|
|
|
html += "<option value=''></option><option value='==' "+((this.data.comparison=="==") ? "selected": "")+">等于(==)</option>" +
|
|
|
- "<option value='!=' "+((this.data.comparison=="!=") ? "selected": "")+">不等于(!=)</option>" +
|
|
|
- "<option value='>' "+((this.data.comparison==">") ? "selected": "")+">大于(>)</option>" +
|
|
|
- "<option value='<' "+((this.data.comparison=="<") ? "selected": "")+">小于(<)</option>" +
|
|
|
- "<option value='>=' "+((this.data.comparison==">=") ? "selected": "")+">大于等于(>=)</option>" +
|
|
|
- "<option value='<=' "+((this.data.comparison=="<=") ? "selected": "")+">小于等于(<=)</option>";
|
|
|
+ "<option value='!=' "+((this.data.comparison=="!=") ? "selected": "")+">不等于(!=)</option>" +
|
|
|
+ "<option value='>' "+((this.data.comparison==">") ? "selected": "")+">大于(>)</option>" +
|
|
|
+ "<option value='<' "+((this.data.comparison=="<") ? "selected": "")+">小于(<)</option>" +
|
|
|
+ "<option value='>=' "+((this.data.comparison==">=") ? "selected": "")+">大于等于(>=)</option>" +
|
|
|
+ "<option value='<=' "+((this.data.comparison=="<=") ? "selected": "")+">小于等于(<=)</option>";
|
|
|
break;
|
|
|
case "boolean":
|
|
|
html += "<option value=''></option><option value='==' "+((this.data.comparison=="==") ? "selected": "")+">等于(==)</option>" +
|
|
|
- "<option value='!=' "+((this.data.comparison=="!=") ? "selected": "")+">不等于(!=)</option>";
|
|
|
+ "<option value='!=' "+((this.data.comparison=="!=") ? "selected": "")+">不等于(!=)</option>";
|
|
|
break;
|
|
|
}
|
|
|
comparisonSelect.set("html", html);
|