提交 2ac66c03 编写于 作者: 蔡祥熠

Merge branch 'feature/Query.statement_add_view' into 'wrdp'

Merge of feature/Query.statement_add_view 查询语句中可以使用视图功能 to wrdp

See merge request o2oa/o2oa!1993
......@@ -371,6 +371,22 @@ o2.widget.JavascriptEditor = new Class({
setValue: function(v){
if (this.editor) this.editor.setValue(v);
},
insertValue : function(v){
if (this.editor){
switch (this.options.type.toLowerCase()) {
case "ace":
this.editor.insert(v);
break;
case "monaco":
// this.editor.getModel().applyEdits([{
this.editor.executeEdits("", [{
range: monaco.Range.fromPositions(this.editor.getPosition()),
text: v
}]);
break;
}
}
},
getValue: function(){
return (this.editor) ? this.editor.getValue() : "";
},
......
......@@ -468,6 +468,34 @@ o2.widget.O2QueryView = new Class({
}
}
});
o2.widget.O2QueryStatement = new Class({
Extends: o2.widget.O2View,
getPersonData: function(){
if (!this.data.query){
var data = null;
o2.Actions.load("x_query_assemble_designer").StatementAction.get(this.data.id, function(json){
data = json.data
}, null, false);
this.data = data;
return data;
}else{
return this.data;
}
},
open : function (e) {
if( this.data.id && this.data.query ){
var appId = "query.StatementDesigner" + this.data.id;
if (layout.desktop.apps[appId]){
layout.desktop.apps[appId].setCurrent();
}else {
var options = {"id": this.data.id, "application": this.data.query, "appId": appId};
layout.desktop.openApplication(e, "query.StatementDesigner", options);
}
}
}
});
o2.widget.O2QueryStat = new Class({
Extends: o2.widget.O2View,
getPersonData: function(){
......
......@@ -267,9 +267,13 @@ o2.widget.TabPage = new Class({
this.fireEvent("hide");
}
},
enableTab : function(){
enableTab : function( notShow ){
this.disabled = false;
this.showTab();
if( notShow ){
this.tabNode.show();
}else{
this.showTab();
}
},
disableTab : function( notShowSibling ){
this.disabled = true;
......
......@@ -695,6 +695,104 @@ MWF.xScript.CMSEnvironment = function(ev){
}
};
this.statement = {
"execute": function (statement, callback, async) {
var filterList = { "filterList": (statement.filter || null) };
MWF.Actions.get("x_query_assemble_surface").executeStatement(statement.view, statement.application, filterList, function (json) {
var data = {
"grid": json.data.grid,
};
if (callback) callback(data);
}, null, async);
},
"select": function (statement, callback, options) {
if (statement.statement) {
var statementJson = {
"application": statement.application || _form.json.application,
"statementName": statement.statement || "",
"isTitle": (statement.isTitle === false) ? "no" : "yes",
"select": (statement.isMulti === false) ? "single" : "multi",
"filter": statement.filter
};
if (!options) options = {};
options.width = statement.width;
options.height = statement.height;
options.title = statement.caption;
var width = options.width || "700";
var height = options.height || "400";
if (layout.mobile) {
var size = document.body.getSize();
width = size.x;
height = size.y;
options.style = "viewmobile";
}
width = width.toInt();
height = height.toInt();
var size = _form.app.content.getSize();
var x = (size.x - width) / 2;
var y = (size.y - height) / 2;
if (x < 0) x = 0;
if (y < 0) y = 0;
if (layout.mobile) {
x = 20;
y = 0;
}
var _self = this;
MWF.require("MWF.xDesktop.Dialog", function () {
var dlg = new MWF.xDesktop.Dialog({
"title": options.title || "select statement view",
"style": options.style || "view",
"top": y,
"left": x - 20,
"fromTop": y,
"fromLeft": x - 20,
"width": width,
"height": height,
"html": "<div style='height: 100%;'></div>",
"maskNode": _form.app.content,
"container": _form.app.content,
"buttonList": [
{
"text": MWF.LP.process.button.ok,
"action": function () {
//if (callback) callback(_self.view.selectedItems);
if (callback) callback(_self.statement.getData());
this.close();
}
},
{
"text": MWF.LP.process.button.cancel,
"action": function () { this.close(); }
}
]
});
dlg.show();
if (layout.mobile) {
var backAction = dlg.node.getElement(".MWF_dialod_Action_back");
var okAction = dlg.node.getElement(".MWF_dialod_Action_ok");
if (backAction) backAction.addEvent("click", function (e) {
dlg.close();
}.bind(this));
if (okAction) okAction.addEvent("click", function (e) {
//if (callback) callback(this.view.selectedItems);
if (callback) callback(this.statement.getData());
dlg.close();
}.bind(this));
}
MWF.xDesktop.requireApp("query.Query", "Statement", function () {
this.statement = new MWF.xApplication.query.Query.Statement(dlg.content.getFirst(), statementJson, { "style": "select" }, _form.app, _form.Macro);
}.bind(this));
}.bind(this));
}
}
};
//var lookupAction = null;
//var getLookupAction = function(callback){
......
......@@ -864,6 +864,104 @@ MWF.xScript.Environment = function(ev){
}
};
this.statement = {
"execute": function (statement, callback, async) {
var filterList = { "filterList": (statement.filter || null) };
MWF.Actions.get("x_query_assemble_surface").execute(statement.view, statement.application, filterList, function (json) {
var data = {
"grid": json.data.grid,
};
if (callback) callback(data);
}, null, async);
},
"select": function (statement, callback, options) {
if (statement.statement) {
var statementJson = {
"application": statement.application || _form.json.application,
"statementName": statement.statement || "",
"isTitle": (statement.isTitle === false) ? "no" : "yes",
"select": (statement.isMulti === false) ? "single" : "multi",
"filter": statement.filter
};
if (!options) options = {};
options.width = statement.width;
options.height = statement.height;
options.title = statement.caption;
var width = options.width || "700";
var height = options.height || "400";
if (layout.mobile) {
var size = document.body.getSize();
width = size.x;
height = size.y;
options.style = "viewmobile";
}
width = width.toInt();
height = height.toInt();
var size = _form.app.content.getSize();
var x = (size.x - width) / 2;
var y = (size.y - height) / 2;
if (x < 0) x = 0;
if (y < 0) y = 0;
if (layout.mobile) {
x = 20;
y = 0;
}
var _self = this;
MWF.require("MWF.xDesktop.Dialog", function () {
var dlg = new MWF.xDesktop.Dialog({
"title": options.title || "select statement view",
"style": options.style || "view",
"top": y,
"left": x - 20,
"fromTop": y,
"fromLeft": x - 20,
"width": width,
"height": height,
"html": "<div style='height: 100%;'></div>",
"maskNode": _form.app.content,
"container": _form.app.content,
"buttonList": [
{
"text": MWF.LP.process.button.ok,
"action": function () {
//if (callback) callback(_self.view.selectedItems);
if (callback) callback(_self.statement.getData());
this.close();
}
},
{
"text": MWF.LP.process.button.cancel,
"action": function () { this.close(); }
}
]
});
dlg.show();
if (layout.mobile) {
var backAction = dlg.node.getElement(".MWF_dialod_Action_back");
var okAction = dlg.node.getElement(".MWF_dialod_Action_ok");
if (backAction) backAction.addEvent("click", function (e) {
dlg.close();
}.bind(this));
if (okAction) okAction.addEvent("click", function (e) {
//if (callback) callback(this.view.selectedItems);
if (callback) callback(this.statement.getData());
dlg.close();
}.bind(this));
}
MWF.xDesktop.requireApp("query.Query", "Statement", function () {
this.statement = new MWF.xApplication.query.Query.Statement(dlg.content.getFirst(), statementJson, { "style": "select" }, _form.app, _form.Macro);
}.bind(this));
}.bind(this));
}
}
};
//include 引用脚本
//optionsOrName : {
......
......@@ -751,6 +751,104 @@ MWF.xScript.PageEnvironment = function (ev) {
}
};
this.statement = {
"execute": function (statement, callback, async) {
var filterList = { "filterList": (statement.filter || null) };
MWF.Actions.get("x_query_assemble_surface").execute(statement.view, statement.application, filterList, function (json) {
var data = {
"grid": json.data.grid,
};
if (callback) callback(data);
}, null, async);
},
"select": function (statement, callback, options) {
if (statement.statement) {
var statementJson = {
"application": statement.application || _form.json.application,
"statementName": statement.statement || "",
"isTitle": (statement.isTitle === false) ? "no" : "yes",
"select": (statement.isMulti === false) ? "single" : "multi",
"filter": statement.filter
};
if (!options) options = {};
options.width = statement.width;
options.height = statement.height;
options.title = statement.caption;
var width = options.width || "700";
var height = options.height || "400";
if (layout.mobile) {
var size = document.body.getSize();
width = size.x;
height = size.y;
options.style = "viewmobile";
}
width = width.toInt();
height = height.toInt();
var size = _form.app.content.getSize();
var x = (size.x - width) / 2;
var y = (size.y - height) / 2;
if (x < 0) x = 0;
if (y < 0) y = 0;
if (layout.mobile) {
x = 20;
y = 0;
}
var _self = this;
MWF.require("MWF.xDesktop.Dialog", function () {
var dlg = new MWF.xDesktop.Dialog({
"title": options.title || "select statement view",
"style": options.style || "view",
"top": y,
"left": x - 20,
"fromTop": y,
"fromLeft": x - 20,
"width": width,
"height": height,
"html": "<div style='height: 100%;'></div>",
"maskNode": _form.app.content,
"container": _form.app.content,
"buttonList": [
{
"text": MWF.LP.process.button.ok,
"action": function () {
//if (callback) callback(_self.view.selectedItems);
if (callback) callback(_self.statement.getData());
this.close();
}
},
{
"text": MWF.LP.process.button.cancel,
"action": function () { this.close(); }
}
]
});
dlg.show();
if (layout.mobile) {
var backAction = dlg.node.getElement(".MWF_dialod_Action_back");
var okAction = dlg.node.getElement(".MWF_dialod_Action_ok");
if (backAction) backAction.addEvent("click", function (e) {
dlg.close();
}.bind(this));
if (okAction) okAction.addEvent("click", function (e) {
//if (callback) callback(this.view.selectedItems);
if (callback) callback(this.statement.getData());
dlg.close();
}.bind(this));
}
MWF.xDesktop.requireApp("query.Query", "Statement", function () {
this.statement = new MWF.xApplication.query.Query.Statement(dlg.content.getFirst(), statementJson, { "style": "select" }, _form.app, _form.Macro);
}.bind(this));
}.bind(this));
}
}
};
//include 引用脚本
//optionsOrName : {
// type : "", 默认为portal, 可以为 portal process cms
......
......@@ -667,6 +667,104 @@ MWF.xScript.ViewEnvironment = function (ev) {
}
};
this.statement = {
"execute": function (statement, callback, async) {
var filterList = { "filterList": (statement.filter || null) };
MWF.Actions.get("x_query_assemble_surface").execute(statement.view, statement.application, filterList, function (json) {
var data = {
"grid": json.data.grid,
};
if (callback) callback(data);
}, null, async);
},
"select": function (statement, callback, options) {
if (statement.statement) {
var statementJson = {
"application": statement.application || _form.json.application,
"statementName": statement.statement || "",
"isTitle": (statement.isTitle === false) ? "no" : "yes",
"select": (statement.isMulti === false) ? "single" : "multi",
"filter": statement.filter
};
if (!options) options = {};
options.width = statement.width;
options.height = statement.height;
options.title = statement.caption;
var width = options.width || "700";
var height = options.height || "400";
if (layout.mobile) {
var size = document.body.getSize();
width = size.x;
height = size.y;
options.style = "viewmobile";
}
width = width.toInt();
height = height.toInt();
var size = _form.app.content.getSize();
var x = (size.x - width) / 2;
var y = (size.y - height) / 2;
if (x < 0) x = 0;
if (y < 0) y = 0;
if (layout.mobile) {
x = 20;
y = 0;
}
var _self = this;
MWF.require("MWF.xDesktop.Dialog", function () {
var dlg = new MWF.xDesktop.Dialog({
"title": options.title || "select statement view",
"style": options.style || "view",
"top": y,
"left": x - 20,
"fromTop": y,
"fromLeft": x - 20,
"width": width,
"height": height,
"html": "<div style='height: 100%;'></div>",
"maskNode": _form.app.content,
"container": _form.app.content,
"buttonList": [
{
"text": MWF.LP.process.button.ok,
"action": function () {
//if (callback) callback(_self.view.selectedItems);
if (callback) callback(_self.statement.getData());
this.close();
}
},
{
"text": MWF.LP.process.button.cancel,
"action": function () { this.close(); }
}
]
});
dlg.show();
if (layout.mobile) {
var backAction = dlg.node.getElement(".MWF_dialod_Action_back");
var okAction = dlg.node.getElement(".MWF_dialod_Action_ok");
if (backAction) backAction.addEvent("click", function (e) {
dlg.close();
}.bind(this));
if (okAction) okAction.addEvent("click", function (e) {
//if (callback) callback(this.view.selectedItems);
if (callback) callback(this.statement.getData());
dlg.close();
}.bind(this));
}
MWF.xDesktop.requireApp("query.Query", "Statement", function () {
this.statement = new MWF.xApplication.query.Query.Statement(dlg.content.getFirst(), statementJson, { "style": "select" }, _form.app, _form.Macro);
}.bind(this));
}.bind(this));
}
}
};
//include 引用脚本
//optionsOrName : {
// type : "", 默认为portal, 可以为 portal process cms
......@@ -765,8 +863,9 @@ MWF.xScript.ViewEnvironment = function (ev) {
//仅前台对象-----------------------------------------
//form
this.page = this.form = this.queryView = {
this.page = this.form = this.queryView = this.queryStatement = {
"getParentEnvironment" : function () { return _form.getParentEnvironment(); }, //视图嵌入的表单或页面的上下文
"getStatementInfor" : function () { return _form.getStatementInfor ? _form.getStatementInfor() : null; },
"getViewInfor" : function () { return _form.getViewInfor(); },
"getPageInfor" : function () { return _form.getPageInfor(); },
"getPageData" : function () { return _form.getPageData(); },
......@@ -776,6 +875,7 @@ MWF.xScript.ViewEnvironment = function (ev) {
"getSelectedData" : function () { return _form.getSelectedData(); },
"setFilter" : function ( filter ) { return _form.setFilter(filter); },
"switchView" : function ( options ) { return _form.switchView(options); },
"switchStatement" : function ( options ) { if(_form.switchStatement)_form.switchStatement(options) ; },
"reload" : function () { _form.reload(); },
// "getInfor": function () { return ev.pageInfor; },
......
MWF.xApplication.Selector = MWF.xApplication.Selector || {};
MWF.xDesktop.requireApp("Selector", "Person", null, false);
MWF.xApplication.Selector.QueryStatement = new Class({
Extends: MWF.xApplication.Selector.Person,
options: {
"style": "default",
"count": 0,
"title": MWF.xApplication.Selector.LP.selectStatement,
"values": [],
"names": [],
"expand": false,
"forceSearchInItem" : true
},
_init : function(){
this.selectType = "querystatement";
this.className = "QueryStatement";
},
loadSelectItems: function(addToNext){
this.queryAction.listApplication(function(json){
if (json.data.length){
json.data.each(function(data){
if (!data.statementList){
this.queryAction.listStatement(data.id, function(statementsJson){
data.statementList = statementsJson.data;
}.bind(this), null, false);
}
if (data.statementList && data.statementList.length){
var category = this._newItemCategory(data, this, this.itemAreaNode);
data.statementList.each(function(d){
d.applicationName = data.name;
var item = this._newItem(d, this, category.children);
this.items.push(item);
}.bind(this));
}
}.bind(this));
}
}.bind(this));
},
_scrollEvent: function(y){
return true;
},
_getChildrenItemIds: function(data){
return data.statementList || [];
},
_newItemCategory: function(data, selector, item, level){
return new MWF.xApplication.Selector.QueryStatement.ItemCategory(data, selector, item, level)
},
_listItemByKey: function(callback, failure, key){
return false;
},
_getItem: function(callback, failure, id, async){
this.queryAction.getStatement(function(json){
if (callback) callback.apply(this, [json]);
}.bind(this), failure, ((typeOf(id)==="string") ? id : id.id), async);
},
_newItemSelected: function(data, selector, item){
return new MWF.xApplication.Selector.QueryStatement.ItemSelected(data, selector, item)
},
_listItemByPinyin: function(callback, failure, key){
return false;
},
_newItem: function(data, selector, container, level){
return new MWF.xApplication.Selector.QueryStatement.Item(data, selector, container, level);
}
});
MWF.xApplication.Selector.QueryStatement.Item = new Class({
Extends: MWF.xApplication.Selector.Person.Item,
_getShowName: function(){
return this.data.name;
},
_setIcon: function(){
this.iconNode.setStyle("background-image", "url("+"../x_component_Selector/$Selector/default/icon/view.png)");
},
loadSubItem: function(){
return false;
},
checkSelectedSingle: function(){
var selectedItem = this.selector.options.values.filter(function(item, index){
if (typeOf(item)==="object"){
if( this.data.id && item.id ){
return this.data.id === item.id;
}else{
return this.data.name === item.name;
}
//return (this.data.id === item.id) || (this.data.name === item.name) ;
}
//if (typeOf(item)==="object") return (this.data.id === item.id) || (this.data.name === item.name) ;
if (typeOf(item)==="string") return (this.data.id === item) || (this.data.name === item);
return false;
}.bind(this));
if (selectedItem.length){
this.selectedSingle();
}
},
checkSelected: function(){
var selectedItem = this.selector.selectedItems.filter(function(item, index){
if( item.data.id && this.data.id){
return item.data.id === this.data.id;
}else{
return item.data.name === this.data.name;
}
//return (item.data.id === this.data.id) || (item.data.name === this.data.name);
}.bind(this));
if (selectedItem.length){
//selectedItem[0].item = this;
selectedItem[0].addItem(this);
this.selectedItem = selectedItem[0];
this.setSelected();
}
}
});
MWF.xApplication.Selector.QueryStatement.ItemSelected = new Class({
Extends: MWF.xApplication.Selector.Person.ItemSelected,
_getShowName: function(){
return this.data.name;
},
_setIcon: function(){
this.iconNode.setStyle("background-image", "url("+"../x_component_Selector/$Selector/default/icon/view.png)");
},
check: function(){
if (this.selector.items.length){
var items = this.selector.items.filter(function(item, index){
//return (item.data.id === this.data.id) || (item.data.name === this.data.name);
if( item.data.id && this.data.id){
return item.data.id === this.data.id;
}else{
return item.data.name === this.data.name;
}
}.bind(this));
this.items = items;
if (items.length){
items.each(function(item){
item.selectedItem = this;
item.setSelected();
}.bind(this));
}
}
}
});
MWF.xApplication.Selector.QueryStatement.ItemCategory = new Class({
Extends: MWF.xApplication.Selector.Person.ItemCategory,
_getShowName: function(){
return this.data.name;
},
createNode: function(){
this.node = new Element("div", {
"styles": this.selector.css.selectorItemCategory_department
}).inject(this.container);
},
_setIcon: function(){
this.iconNode.setStyle("background-image", "url("+"../x_component_Selector/$Selector/default/icon/applicationicon.png)");
},
_hasChild: function(){
return (this.data.statementList && this.data.statementList.length);
},
check: function(){}
});
......@@ -10,6 +10,7 @@ MWF.xApplication.Selector.LP = MWF.SelectorLP = {
"selectAppliction": "Select Process Appliction",
"selectProcess": "Select Process",
"selectView": "Select View",
"selectStatement": "Select Statement",
"selectCMSApplication": "Select CMS Application",
"selectCMSCategory": "Select CMS Category",
"searchDescription" : "search",
......
......@@ -12,6 +12,7 @@ MWF.xApplication.Selector.LP = MWF.SelectorLP = {
"selectAppliction": "选择流程应用",
"selectProcess": "选择流程",
"selectView": "选择视图",
"selectStatement" : "选择查询",
"selectTable": "选择数据表",
"selectFormStyle" : "选择表单样式",
"selectCMSApplication": "选择内容管理应用",
......
......@@ -194,5 +194,15 @@
"icon": "comment.png",
"text": "评论",
"className": "Comment"
},
"statementSelector": {
"icon": "statementSelector.png",
"text": "选择查询视图",
"className": "StatementSelector"
},
"statement": {
"icon": "statement.png",
"text": "嵌入查询视图",
"className": "Statement"
}
}
\ No newline at end of file
......@@ -195,5 +195,15 @@
"icon": "comment.png",
"text": "评论",
"className": "Comment"
},
"statementSelector": {
"icon": "statementSelector.png",
"text": "选择查询视图",
"className": "StatementSelector"
},
"statement": {
"icon": "statement.png",
"text": "嵌入查询视图",
"className": "Statement"
}
}
\ No newline at end of file
......@@ -41,4 +41,6 @@ MWF.xDesktop.requireApp("cms.FormDesigner", "Module.Office", null, false);
MWF.xDesktop.requireApp("cms.FormDesigner", "Module.Attachment", null, false);
MWF.xDesktop.requireApp("cms.FormDesigner", "Module.Log", null, false);
MWF.xDesktop.requireApp("cms.FormDesigner", "Module.Office", null, false);
MWF.xDesktop.requireApp("cms.FormDesigner", "Module.Comment", null, false);
\ No newline at end of file
MWF.xDesktop.requireApp("cms.FormDesigner", "Module.Comment", null, false);
MWF.xDesktop.requireApp("cms.FormDesigner", "Module.Statement", null, false);
MWF.xDesktop.requireApp("cms.FormDesigner", "Module.StatementSelector", null, false);
\ No newline at end of file
MWF.xApplication.cms.FormDesigner.Module = MWF.xApplication.cms.FormDesigner.Module || {};
MWF.xDesktop.requireApp("process.FormDesigner", "Module.Statement", null, false);
MWF.xApplication.cms.FormDesigner.Module.Statement = MWF.CMSFCStatement = new Class({
Extends: MWF.FCStatement,
Implements : [MWF.CMSFCMI]//,
//_createViewNode: function(callback){
// if (!this.viewNode) this.viewNode = new Element("div", {"styles": this.css.viewNode}).inject(this.node);
// this.node.setStyle("background", "transparent");
//
// this.viewTable = new Element("table", {
// "styles": this.css.viewTitleTableNode,
// "border": "0px",
// "cellPadding": "0",
// "cellSpacing": "0"
// }).inject(this.viewNode);
// this.viewLine = new Element("tr", {"styles": this.css.viewTitleLineNode}).inject(this.viewTable);
//
// if (this.json.select!="no"){
// this.viewSelectCell = new Element("td", {
// "styles": this.css.viewTitleCellNode
// }).inject(this.viewLine);
// this.viewSelectCell.setStyle("width", "10px");
// }
// this.form.designer.actions.getQueryView(this.json["view"], function(json){
// var viewData = JSON.decode(json.data.data);
// viewData.selectEntryList.each(function(column){
// // if (column.export){
// var viewCell = new Element("td", {
// "styles": this.css.viewTitleCellNode,
// "text": column.displayName
// }).inject(this.viewLine);
// // }
// }.bind(this));
//
// if (callback) callback();
// }.bind(this));
// this._setViewNodeTitle();
//}
});
MWF.xApplication.cms.FormDesigner.Module = MWF.xApplication.cms.FormDesigner.Module || {};
MWF.xDesktop.requireApp("process.FormDesigner", "Module.StatementSelector", null, false);
MWF.xApplication.cms.FormDesigner.Module.StatementSelector = MWF.CMSFCStatementSelector = new Class({
Extends: MWF.FCStatementSelector,
Implements : [MWF.CMSFCMI]
});
......@@ -102,6 +102,10 @@ MWF.xApplication.cms.FormDesigner.Script = new Class({
this.loadAuthorScript(v); break;
case "Reader":
this.loadReaderScript(v); break;
case "Statement":
this.loadStatementScript(v); break;
case "StatementSelector":
this.loadStatementSelectorScript(v); break;
}
this.bindDataId(v);
},
......
MWF.xDesktop.requireApp("process.Xform", "Statement", null, false);
//MWF.xDesktop.requireApp("cms.Xform", "widget.View", null, false);
MWF.xApplication.cms.Xform.Statement = MWF.CMSStatement = new Class({
Extends: MWF.APPStatement
});
\ No newline at end of file
MWF.xDesktop.requireApp("process.Xform", "StatementSelector", null, false);
MWF.xApplication.cms.Xform.StatementSelector = MWF.CMSStatementSelector = new Class({
Extends: MWF.APPStatementSelector
});
\ No newline at end of file
......@@ -103,5 +103,10 @@
"icon": "subpage.png",
"text": "部件元素",
"className": "Widgetmodules"
},
"statement": {
"icon": "statement.png",
"text": "嵌入查询视图",
"className": "Statement"
}
}
\ No newline at end of file
......@@ -123,5 +123,10 @@
"icon": "subpage.png",
"text": "部件元素",
"className": "Widgetmodules"
},
"statement": {
"icon": "statement.png",
"text": "嵌入查询视图",
"className": "Statement"
}
}
\ No newline at end of file
......@@ -27,4 +27,5 @@ MWF.xDesktop.requireApp("portal.PageDesigner", "Module.Source", null, false);
MWF.xDesktop.requireApp("portal.PageDesigner", "Module.SourceText", null, false);
MWF.xDesktop.requireApp("portal.PageDesigner", "Module.SubSource", null, false);
MWF.xDesktop.requireApp("portal.PageDesigner", "Module.Widget", null, false);
MWF.xDesktop.requireApp("portal.PageDesigner", "Module.Widgetmodules", null, false);
\ No newline at end of file
MWF.xDesktop.requireApp("portal.PageDesigner", "Module.Widgetmodules", null, false);
MWF.xDesktop.requireApp("portal.PageDesigner", "Module.Statement", null, false);
\ No newline at end of file
MWF.xApplication.portal.PageDesigner.Module.Statement = MWF.PCStatement = new Class({
Extends: MWF.FCStatement
});
{
"id": "",
"name": "",
"type": "Statement",
"description": "",
"view": "",
"isTitle": "yes",
"select": "no", //single, multi
"isOpen": "yes",
"events": {
"queryLoad": {
"code": "",
"html": ""
},
"postLoad": {
"code": "",
"html": ""
},
"load": {
"code": "",
"html": ""
},
"loadView" : {
"code": "",
"html": ""
},
"select": {
"code": "",
"html": ""
},
"openDocument": {
"code": "",
"html": ""
},
"click": {
"code": "",
"html": ""
},
"dblclick": {
"code": "",
"html": ""
},
"keydown": {
"code": "",
"html": ""
},
"keypress": {
"code": "",
"html": ""
},
"keyup": {
"code": "",
"html": ""
},
"mousedown": {
"code": "",
"html": ""
},
"mousemove": {
"code": "",
"html": ""
},
"mouseout": {
"code": "",
"html": ""
},
"mouseover": {
"code": "",
"html": ""
},
"mouseup": {
"code": "",
"html": ""
},
"focus": {
"code": "",
"html": ""
},
"blur": {
"code": "",
"html": ""
}
},
"properties": {},
"class": "",
"styles": {},
"titleStyles":{},
"itemStyles": {},
"container": ""
}
\ No newline at end of file
......@@ -158,6 +158,10 @@ MWF.xApplication.portal.PageDesigner.Script = new Class({
this.loadSubformScript(v); break;
case "ViewSelector":
this.loadViewSelectorScript(v); break;
case "Statement":
this.loadStatementScript(v); break;
case "StatementSelector":
this.loadStatementSelectorScript(v); break;
}
this.bindDataId(v);
},
......@@ -421,6 +425,14 @@ MWF.xApplication.portal.PageDesigner.Script = new Class({
this.loadEventsScript(data);
},
loadStatementScript: function(data){
this.loadEventsScript(data);
},
loadStatementSelectorScript: function(data){
this.addScriptItem(data.selectedScript, "code", data, "selectedScript");
this.loadEventsScript(data);
},
loadEventsScript: function(data){
Object.each(data.events, function(event, key){
......
......@@ -174,5 +174,15 @@
"icon": "office.png",
"text": "Office控件",
"className": "Office"
},
"statementSelector": {
"icon": "statementSelector.png",
"text": "选择查询视图",
"className": "StatementSelector"
},
"statement": {
"icon": "statement.png",
"text": "嵌入查询视图",
"className": "Statement"
}
}
\ No newline at end of file
......@@ -191,5 +191,15 @@
"icon": "office.png",
"text": "Office控件",
"className": "Office"
},
"statementSelector": {
"icon": "statementSelector.png",
"text": "选择查询视图",
"className": "StatementSelector"
},
"statement": {
"icon": "statement.png",
"text": "嵌入查询视图",
"className": "Statement"
}
}
\ No newline at end of file
......@@ -41,3 +41,5 @@ MWF.xDesktop.requireApp("process.FormDesigner", "Module.Attachment", null, false
MWF.xDesktop.requireApp("process.FormDesigner", "Module.Orgfield", null, false);
MWF.xDesktop.requireApp("process.FormDesigner", "Module.Org", null, false);
MWF.xDesktop.requireApp("process.FormDesigner", "Module.Opinion", null, false);
MWF.xDesktop.requireApp("process.FormDesigner", "Module.Statement", null, false);
MWF.xDesktop.requireApp("process.FormDesigner", "Module.StatementSelector", null, false);
MWF.xApplication.process.FormDesigner.Module = MWF.xApplication.process.FormDesigner.Module || {};
MWF.xDesktop.requireApp("process.FormDesigner", "Module.View", null, false);
MWF.xApplication.process.FormDesigner.Module.Statement = MWF.FCStatement = new Class({
Extends: MWF.FCView,
options: {
"style": "default",
"propertyPath": "../x_component_process_FormDesigner/Module/Statement/statement.html"
},
initialize: function(form, options){
this.setOptions(options);
this.path = "../x_component_process_FormDesigner/Module/Statement/";
this.cssPath = "../x_component_process_FormDesigner/Module/Statement/"+this.options.style+"/css.wcss";
this.imagePath_default = "../x_component_query_ViewDesigner/$Statement/";
this.imagePath_custom = "../x_component_process_FormDesigner/Module/Actionbar/";
this._loadCss();
this.moduleType = "element";
this.moduleName = "statement";
this.form = form;
this.container = null;
this.containerNode = null;
},
_createMoveNode: function(){
this.moveNode = new Element("div", {
"MWFType": "statement",
"id": this.json.id,
"styles": this.css.moduleNodeMove,
"events": {
"selectstart": function(){
return false;
}
}
}).inject(this.form.container);
},
_createNode: function(){
this.node = this.moveNode.clone(true, true);
this.node.setStyles(this.css.moduleNode);
this.node.set("id", this.json.id);
this.node.addEvent("selectstart", function(){
return false;
});
this.iconNode = new Element("div", {
"styles": this.css.iconNode
}).inject(this.node);
new Element("div", {
"styles": this.css.iconNodeIcon
}).inject(this.iconNode);
new Element("div", {
"styles": this.css.iconNodeText,
"text": "Statement"
}).inject(this.iconNode);
this.iconNode.addEvent("click", function(){
this._checkView();
}.bind(this));
},
_createViewNode: function(callback){
if (!this.viewNode) this.viewNode = new Element("div", {"styles": this.css.viewNode}).inject(this.node);
if( !this.actionbarNode)this.actionbarNode = new Element("div.actionbarNode",{}).inject( this.viewNode, "top" );
this.node.setStyle("background", "transparent");
this.viewTable = new Element("table", {
"styles": this.css.viewTitleTableNode,
"border": "0px",
"cellPadding": "0",
"cellSpacing": "0"
}).inject(this.viewNode);
this.viewLine = new Element("tr", {"styles": this.css.viewTitleLineNode}).inject(this.viewTable);
if (this.json.select!="no"){
this.viewSelectCell = new Element("td", {
"styles": this.css.viewTitleCellNode
}).inject(this.viewLine);
this.viewSelectCell.setStyle("width", "10px");
}
MWF.Actions.get("x_query_assemble_designer").getStatement(this.json["queryStatement"].id, function(json){
var viewData = JSON.decode(json.data.view || "");
if( !viewData || !viewData.data ){
return;
}
this.viewData = viewData;
if( this.json.actionbar === "show" ){
this.actionbarList = [];
this._showActionbar();
}
var columnList = viewData.data ? (viewData.data.selectEntryList || viewData.data.selectList) : [];
columnList.each(function(column){
if (!column.hideColumn){
var viewCell = new Element("td", {
"styles": this.css.viewTitleCellNode,
"text": column.displayName
}).inject(this.viewLine);
}
}.bind(this));
if (callback) callback();
}.bind(this));
this._setViewNodeTitle();
},
_checkView: function(callback){
if (this.json["queryStatement"] && this.json["queryStatement"]!="none"){
this.iconNode.setStyle("display", "none");
if (this.viewNode) this.viewNode.destroy();
this.viewNode = null;
this._createViewNode(function(){
if (callback) callback();
}.bind(this));
if( this.property && this.property.viewFilter ){
this.property.viewFilter.resetStatementData( this.json["queryStatement"].id );
}
}else{
this.iconNode.setStyle("display", "block");
if (this.viewNode) this.viewNode.destroy();
this.node.setStyles(this.css.moduleNode);
if (callback) callback();
if( this.property && this.property.viewFilter ){
this.property.viewFilter.resetStatementData();
}
}
},
_setEditStyle: function(name, input, oldValue){
if (name=="queryStatement"){
if (this.json[name]!=oldValue) this._checkView();
}
if (name=="select") this._checkSelect();
if (name=="isTitle") this._checkTitle();
if (name=="titleStyles") this._setTitleStyles();
if (name=="name"){
var title = this.json.name || this.json.id;
var text = this.json.type.substr(this.json.type.lastIndexOf("$")+1, this.json.type.length);
this.treeNode.setText("<"+text+"> "+title);
}
if (name=="id"){
if (!this.json.name){
var text = this.json.type.substr(this.json.type.lastIndexOf("$")+1, this.json.type.length);
this.treeNode.setText("<"+text+"> "+this.json.id);
}
this.treeNode.setTitle(this.json.id);
this.node.set("id", this.json.id);
}
if(name=="actionbar"){
this.json.actionbar === "show" ? this._showActionbar() : this._hideActionbar();
}
this._setEditStyle_custom(name, input, oldValue);
}
});
{
"moduleNodeMove": {
"border": "2px dashed #ffa200",
"height": "22px",
"line-height": "22px",
"overflow": "hidden",
"margin": "3px",
"display": "block",
"-webkit-user-select": "none",
"-moz-user-select": "none",
"position": "absolute",
"z-index": 10002,
"opacity": 0.7,
"width": "100px",
"cursor": "move",
"background-color": "#EEE"
},
"moduleNodeShow": {
"border": "1px dashed #333",
"height": "2px",
"cursor": "pointer",
"line-height": "22px",
"overflow": "hidden",
"margin": "3px",
"-webkit-user-select": "none",
"-moz-user-select": "none",
"position": "static",
"display": "block",
"top": "auto",
"left": "auto",
"width": "auto",
"opacity": 0.5,
"background": "#ffa200"
},
"moduleNode": {
"border": "1px dashed #333",
"height": "100px",
"cursor": "pointer",
"line-height": "22px",
"overflow": "hidden",
"margin": "3px",
"-webkit-user-select": "none",
"-moz-user-select": "none",
"position": "static",
"display": "block",
"top": "auto",
"left": "auto",
"width": "auto",
"opacity": 1,
"background": "transparent"
},
"iconNode": {
"width": "70px",
"height": "24px",
"color": "#999",
"font-size": "12px",
"position": "static",
"margin": "10px auto"
},
"iconNodeIcon":{
"width": "24px",
"height": "24px",
"background": "url("+"../x_component_process_FormDesigner/Module/Statement/default/icon/statement.png) 5px center no-repeat",
"float": "left"
},
"iconNodeText":{
"line-height": "24px",
"height": "24px",
"width": "44px",
"float": "right"
},
"viewNode": {
"overflow": "hidden",
"height": "100%"
},
"viewTitleTableNode": {
"width": "100%",
"height": "30px",
"background-color": "#EEE",
"border": "1px solid #999"
},
"viewTitleLineNode": {
"line-height": "30px"
},
"viewTitleCellNode": {
"border-left": "1px solid #FFF",
"border-right": "1px solid #999",
"padding": "0px 10px"
}
}
\ No newline at end of file
<div style="background-color: #FFF; overflow: hidden">
<div title="基本" class="MWFTab">
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
<tr>
<td class="editTableTitle">标识:</td>
<td class="editTableValue"><input type="text" name="id" value="text{$.id}" class="editTableInput"/></td>
</tr>
<tr>
<td class="editTableTitle">名称:</td>
<td class="editTableValue"><input type="text" name="name" value="text{$.name}" class="editTableInput"/></td>
</tr>
<tr>
<td class="editTableTitle">描述:</td>
<td class="editTableValue"><input type="text" name="description" value="text{$.description}" class="editTableInput"/></td>
</tr>
<tr>
<td class="editTableTitle">Class:</td>
<td class="editTableValue"><input type="text" name="description" value="text{$.description}" class="editTableInput"/></td>
</tr>
</table>
<div class="MWFMaplist" name="styles" title="样式"></div>
<div class="MWFMaplist" name="properties" title="属性"></div>
<div class="MWFMaplist" name="titleStyles" title="标题样式"></div>
<div class="MWFMaplist" name="itemStyles" title="数据样式"></div>
</div>
<div title="查询" class="MWFTab">
<div>
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
<tr>
<td class="editTableTitle">查询:</td>
<td class="editTableValue"><div class="MWFQueryStatementSelect" name="queryStatement"></div></td>
</tr>
</table>
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
<tr>
<td class="editTableTitle">立即载入:</td>
<td class="editTableValue">
<input type="radio" name="loadView" value="yes" text{($.loadView!='no')?'checked':''}/>
<input type="radio" name="loadView" value="no" text{($.loadView=='no')?'checked':''}/>
</td>
</tr>
</table>
</div>
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
<!--<tr>-->
<!--<td class="editTableTitle">视图:</td>-->
<!--<td class="editTableValue">-->
<!--<div class="MWFViewSelect" name="view"></div>-->
<!--</td>-->
<!--</tr>-->
<tr>
<td class="editTableTitle">显示标题</td>
<td class="editTableValue">
<input class="editTableRadio" name="isTitle" text{($.isTitle!='no')?'checked':''} type="radio" value="yes"/>显示
<input class="editTableRadio" name="isTitle" text{($.isTitle=='no')?'checked':''} type="radio" value="no"/>不显示
</td>
</tr>
<tr>
<td class="editTableTitle">选择文件</td>
<td class="editTableValue">
<select name="select">
<option text{($.select!='single' && $.select!='multi')?'selected':''} value="no">不允许</option>
<option text{($.select=='single')?'selected':''} value="single">单选</option>
<option text{($.select=='multi')?'selected':''} value="multi">多选</option>
</select>
</td>
</tr>
<tr>
<td class="editTableTitle">操作条</td>
<td class="editTableValue">
<input class="editTableRadio" name="actionbar" text{($.actionbar=='show')?'checked':''} type="radio" value="show"/>显示
<input class="editTableRadio" name="actionbar" text{($.actionbar!='show')?'checked':''} type="radio" value="hidden"/>不显示
</td>
</tr>
</table>
<div style="background-color: #eeeeee; border-top:1px solid #999999; height: 24px; line-height: 24px; text-align: center; cursor:pointer">过滤</div>
<div class="MWFStatementFilter">
<div class="inputAreaNode_vf">
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable restrictViewFilterTable_vf" style="table-layout: fixed;">
<tr id="text{$.id}pathInputSelectTr">
<td class="editTableTitle">选择:</td>
<td class="editTableValue">
<select class="pathInputSelect_vf"></select>
<!-- <div style="line-height: 20px;color:#999;">注:选择路径后,需在选择的值前面加上"表别名.",如:o.</div>-->
</td>
</tr>
<tr style="display:none">
<td class="editTableTitle">标题:</td>
<td class="editTableValue"><input type="text" class="editTableInput titleInput_vf"/></td>
</tr>
<tr>
<td class="editTableTitle">路径:</td>
<td class="editTableValue">
<input type="text" class="editTableInput pathInput_vf"/>
<div style="color: #999">注:路径的写法是"表别名.字段名",如:o.title</div>
</td>
</tr>
<tr>
<td class="editTableTitle">数据类型:</td>
<td class="editTableValue"><select class="datatypeInput_vf">
<option value="textValue" selected>文本</option>
<option value="numberValue">数字</option>
<option value="dateTimeValue">日期时间</option>
<option value="booleanValue">布尔</option>
</select></td>
</tr>
<tr style="display:none">
<td class="editTableTitle"></td>
<td class="editTableValue">
<input type="radio" class="restrictFilterInput_vf" value="restrict" name="text{$.id}viewFilterType" checked/>作为默认过滤条件<br>
<input type="radio" class="customFilterInput_vf" value="custom" name="text{$.id}viewFilterType"/>作为自定义过滤数据
</td>
</tr>
</table>
<table id="text{$.pid}viewFilterRestrict" width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
<tr style="display:none;">
<td class="editTableTitle">逻辑:</td>
<td class="editTableValue"><select class="logicInput_vf">
<option selected value="and">并且(and)</option>
<option value="or">或者(or)</option>
</select></td>
</tr>
<tr>
<td class="editTableTitle">比较:</td>
<td class="editTableValue"><select class="comparisonInput_vf">
<option value="equals" selected>等于(==)</option>
<option value="notEquals">不等于(!=)</option>
<option value="greaterThan">大于(>)</option>
<option value="greaterThanOrEqualTo">大于等于(>=)</option>
<option value="lessThan">小于(<)</option>
<option value="lessThanOrEqualTo">小于等于(<=)</option>
<option value="like">匹配(like)</option>
<option value="notLike">不匹配(not-like)</option>
<option value="range">范围(range)</option>
</select></td>
</tr>
<tr style="display:none">
<td class="editTableTitle">值:</td>
<td class="editTableValue">
<input type="text" class="editTableInput valueTextInput_vf" style="display: block"/>
<input type="number" class="editTableInput valueNumberInput_vf" style="display: none"/>
<input type="text" class="editTableInput valueDatetimeInput_vf" style="display: none" readonly/>
<input type="text" class="editTableInput valueDateInput_vf" style="display: none" readonly/>
<input type="text" class="editTableInput valueTimeInput_vf" style="display: none" readonly/>
<select class="valueBooleanInput_vf" style="display: none">
<option value="true" selected>是(True)</option>
<option value="false">否(False)</option>
</select>
</td>
</tr>
</table>
<div title="值" class="MWFFilterFormulaArea"></div>
</div>
<div class="actionAreaNode_vf"></div>
<div style="height: 20px; line-height: 20px; text-align:center; background-color: #eeeeee">默认过滤条件</div>
<div class="listAreaNode_vf" style="min-height: 56px; border-bottom:1px solid #CCCCCC; overflow: hidden;"></div>
<div style="display:none; height: 20px; line-height: 20px; text-align:center; background-color: #eeeeee">自定义过滤数据</div>
<div class="fieldListAreaNode_vf" style="display:none; min-height: 56px; border-bottom:1px solid #CCCCCC; overflow: hidden;"></div>
</div>
<div class="MWFScriptArea" name="defaultSelectedScript" title="默认选中行脚本"></div>
</div>
<div title="事件" class="MWFTab">
<div class="MWFEventsArea" name="events"></div>
</div>
<div title="HTML" class="MWFTab">
<div class="MWFHTMLArea" style="font-family: Verdana, Geneva, sans-serif; font-size:14px"></div>
</div>
<div title="JSON" class="MWFTab">
<div class="MWFJSONArea" style="font-family: Verdana, Geneva, sans-serif; font-size:14px"></div>
</div>
</div>
\ No newline at end of file
{
"id": "",
"name": "",
"type": "Statement",
"description": "",
"view": "",
"isTitle": "yes",
"select": "no", //single, multi
"isOpen": "yes",
"events": {
"queryLoad": {
"code": "",
"html": ""
},
"postLoad": {
"code": "",
"html": ""
},
"load": {
"code": "",
"html": ""
},
"loadView" : {
"code": "",
"html": ""
},
"select": {
"code": "",
"html": ""
},
"openDocument": {
"code": "",
"html": ""
},
"click": {
"code": "",
"html": ""
},
"dblclick": {
"code": "",
"html": ""
},
"keydown": {
"code": "",
"html": ""
},
"keypress": {
"code": "",
"html": ""
},
"keyup": {
"code": "",
"html": ""
},
"mousedown": {
"code": "",
"html": ""
},
"mousemove": {
"code": "",
"html": ""
},
"mouseout": {
"code": "",
"html": ""
},
"mouseover": {
"code": "",
"html": ""
},
"mouseup": {
"code": "",
"html": ""
},
"focus": {
"code": "",
"html": ""
},
"blur": {
"code": "",
"html": ""
}
},
"properties": {},
"class": "",
"styles": {},
"titleStyles":{},
"itemStyles": {},
"container": ""
}
\ No newline at end of file
MWF.xApplication.process.FormDesigner.Module = MWF.xApplication.process.FormDesigner.Module || {};
MWF.xDesktop.requireApp("process.FormDesigner", "Module.$Element", null, false);
MWF.xApplication.process.FormDesigner.Module.StatementSelector = MWF.FCStatementSelector = new Class({
Extends: MWF.xApplication.process.FormDesigner.Module.Button,
Implements: [Options, Events],
options: {
"style": "default",
"propertyPath": "../x_component_process_FormDesigner/Module/StatementSelector/StatementSelector.html"
},
initialize: function(form, options){
this.setOptions(options);
this.path = "../x_component_process_FormDesigner/Module/StatementSelector/";
this.cssPath = "../x_component_process_FormDesigner/Module/StatementSelector/"+this.options.style+"/css.wcss";
this._loadCss();
this.moduleType = "element";
this.moduleName = "statementSelector";
this.form = form;
this.container = null;
this.containerNode = null;
},
_checkView: function(callback){
if( this.property && this.property.viewFilter ){
if (this.json["queryStatement"] && this.json["queryStatement"]!="none"){
this.property.viewFilter.resetStatementData( this.json["queryStatement"].id );
}else{
this.property.viewFilter.resetStatementData();
}
}
}
});
<div style="background-color: #FFF; overflow: hidden">
<div title="基本" class="MWFTab">
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
<tr>
<td class="editTableTitle">标识:</td>
<td class="editTableValue"><input type="text" name="id" value="text{$.id}" class="editTableInput"/></td>
</tr>
<tr>
<td class="editTableTitle">名称:</td>
<td class="editTableValue"><input type="text" name="name" value="text{$.name}" class="editTableInput"/></td>
</tr>
<tr>
<td class="editTableTitle">描述:</td>
<td class="editTableValue"><input type="text" name="description" value="text{$.description}" class="editTableInput"/></td>
</tr>
</table>
<div class="MWFMaplist" name="styles" title="样式"></div>
<div class="MWFMaplist" name="properties" title="属性"></div>
<div style="background-color: #eeeeee; height: 24px; line-height: 24px; text-align: center;">查询选择框</div>
<div>
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
<tr>
<td class="editTableTitle">选择框标题:</td>
<td class="editTableValue"><input type="text" name="title" value="text{$.title}" class="editTableInput"/></td>
</tr>
<tr>
<td class="editTableTitle">列标题:</td>
<td class="editTableValue">
<input type="radio" name="isTitle" value="true" text{($.isTitle)?'checked':''}/>显示
<input type="radio" name="isTitle" value="false" text{(!$.isTitle)?'checked':''}/>隐藏
</td>
</tr>
<tr>
<td class="editTableTitle">默认展开</td>
<td class="editTableValue">
<input class="editTableRadio" name="isExpand" text{($.isExpand=='yes')?'checked':''} type="radio" value="yes"/>展开
<input class="editTableRadio" name="isExpand" text{($.isExpand!='yes')?'checked':''} type="radio" value="no"/>不展开
</td>
</tr>
<tr>
<td class="editTableTitle">选择:</td>
<td class="editTableValue">
<input type="radio" name="select" value="single" text{($.select!='multi')?'checked':''}/>单选
<input type="radio" name="select" value="multi" text{($.select=='multi')?'checked':''}/>多选
</td>
</tr>
<tr>
<td class="editTableTitle">操作条</td>
<td class="editTableValue">
<input class="editTableRadio" name="actionbar" text{($.actionbar=='show')?'checked':''} type="radio" value="show"/>显示
<input class="editTableRadio" name="actionbar" text{($.actionbar!='show')?'checked':''} type="radio" value="hidden"/>不显示
</td>
</tr>
<!--<tr>-->
<!--<td class="editTableTitle"></td>-->
<!--<td class="editTableValue">-->
<!--<input type="radio" onclick="if (this.checked) {$('text{$.id}processViewArea').setStyle('display', 'block'); $('text{$.id}cmsViewArea').setStyle('display', 'none');}" name="selectViewType" value="process" text{($.selectViewType!='cms')?'checked':''}/>流程视图-->
<!--<input type="radio" onclick="if (this.checked) {$('text{$.id}processViewArea').setStyle('display', 'none'); $('text{$.id}cmsViewArea').setStyle('display', 'block');}" name="selectViewType" value="cms" text{($.selectViewType=='cms')?'checked':''}/>内容管理视图-->
<!--</td>-->
<!--</tr>-->
</table>
</div>
<!--<div id="text{$.id}processViewArea" style="display: text{($.selectViewType!='cms')?'block':'none'};">-->
<!--<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">-->
<!--<tr>-->
<!--<td class="editTableTitle">视图:</td>-->
<!--<td class="editTableValue"><div class="MWFViewSelect" name="processViewName"></div></td>-->
<!--</tr>-->
<!--</table>-->
<!--</div>-->
<!--<div id="text{$.id}cmsViewArea" style="display: text{($.selectViewType=='cms')?'block':'none'};">-->
<!--<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">-->
<!--<tr>-->
<!--<td class="editTableTitle">视图:</td>-->
<!--<td class="editTableValue"><div class="MWFCMSViewSelect" name="cmsViewName"></div></td>-->
<!--</tr>-->
<!--</table>-->
<!--</div>-->
<div>
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
<tr>
<td class="editTableTitle">查询:</td>
<td class="editTableValue"><div class="MWFQueryStatementSelect" name="queryStatement"></div></td>
</tr>
</table>
</div>
<div class="MWFMaplist" name="titleStyles" title="选择框标题样式"></div>
<div class="MWFMaplist" name="itemStyles" title="选择框条目样式"></div>
<div style="background-color: #eeeeee; height: 24px; line-height: 24px; text-align: center;">选择结果处理</div>
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
<tr>
<td class="editTableTitle">处理方式:</td>
<td class="editTableValue">
<input type="radio" onclick="if (this.checked){ $('text{$.pid}selectedSetValueArea').setStyle('display', 'block'); $('text{$.pid}selectedScriptArea').setStyle('display', 'none')}" name="result" value="setValue" text{($.result!='script')?'checked':''}/>赋值
<input type="radio" onclick="if (this.checked){ $('text{$.pid}selectedSetValueArea').setStyle('display', 'none'); $('text{$.pid}selectedScriptArea').setStyle('display', 'block')}" name="result" value="script" text{($.result=='script')?'checked':''}/>脚本
</td>
</tr>
</table>
<div id="text{$.pid}selectedSetValueArea" style="display: text{($.result!='script')?'block':'none'};">
<div class="MWFMaplist" name="selectedSetValues" title="选择结果赋值"></div>
</div>
<div id="text{$.pid}selectedScriptArea" style="display: text{($.result=='script')?'block':'none'};">
<div class="MWFScriptArea" name="selectedScript" title="选择结果 (S)"></div>
</div>
<div class="MWFScriptArea" name="defaultSelectedScript" title="默认选中行脚本"></div>
</div>
<div title="过滤" class="MWFTab">
<div class="MWFStatementFilter">
<div class="inputAreaNode_vf">
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable restrictViewFilterTable_vf" style="table-layout: fixed;">
<tr id="text{$.id}pathInputSelectTr">
<td class="editTableTitle">选择:</td>
<td class="editTableValue">
<select class="pathInputSelect_vf"></select>
<!-- <div style="line-height: 20px;color:#999;">注:选择路径后,需在选择的值前面加上"表别名.",如:o.</div>-->
</td>
</tr>
<tr style="display:none">
<td class="editTableTitle">标题:</td>
<td class="editTableValue"><input type="text" class="editTableInput titleInput_vf"/></td>
</tr>
<tr>
<td class="editTableTitle">路径:</td>
<td class="editTableValue">
<input type="text" class="editTableInput pathInput_vf"/>
<div style="color: #999">注:路径的写法是"表别名.字段名",如:o.title</div>
</td>
</tr>
<tr>
<td class="editTableTitle">数据类型:</td>
<td class="editTableValue"><select class="datatypeInput_vf">
<option value="textValue" selected>文本</option>
<option value="numberValue">数字</option>
<option value="dateTimeValue">日期时间</option>
<option value="booleanValue">布尔</option>
</select></td>
</tr>
<tr style="display:none">
<td class="editTableTitle"></td>
<td class="editTableValue">
<input type="radio" class="restrictFilterInput_vf" value="restrict" name="text{$.id}viewFilterType" checked/>作为默认过滤条件<br>
<input type="radio" class="customFilterInput_vf" value="custom" name="text{$.id}viewFilterType"/>作为自定义过滤数据
</td>
</tr>
</table>
<table id="text{$.pid}viewFilterRestrict" width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
<tr style="display:none;">
<td class="editTableTitle">逻辑:</td>
<td class="editTableValue"><select class="logicInput_vf">
<option selected value="and">并且(and)</option>
<option value="or">或者(or)</option>
</select></td>
</tr>
<tr>
<td class="editTableTitle">比较:</td>
<td class="editTableValue"><select class="comparisonInput_vf">
<option value="equals" selected>等于(==)</option>
<option value="notEquals">不等于(!=)</option>
<option value="greaterThan">大于(>)</option>
<option value="greaterThanOrEqualTo">大于等于(>=)</option>
<option value="lessThan">小于(<)</option>
<option value="lessThanOrEqualTo">小于等于(<=)</option>
<option value="like">匹配(like)</option>
<option value="notLike">不匹配(not-like)</option>
<option value="range">范围(range)</option>
</select></td>
</tr>
<tr style="display:none">
<td class="editTableTitle">值:</td>
<td class="editTableValue">
<input type="text" class="editTableInput valueTextInput_vf" style="display: block"/>
<input type="number" class="editTableInput valueNumberInput_vf" style="display: none"/>
<input type="text" class="editTableInput valueDatetimeInput_vf" style="display: none" readonly/>
<input type="text" class="editTableInput valueDateInput_vf" style="display: none" readonly/>
<input type="text" class="editTableInput valueTimeInput_vf" style="display: none" readonly/>
<select class="valueBooleanInput_vf" style="display: none">
<option value="true" selected>是(True)</option>
<option value="false">否(False)</option>
</select>
</td>
</tr>
</table>
<div title="值" class="MWFFilterFormulaArea"></div>
</div>
<div class="actionAreaNode_vf"></div>
<div style="height: 20px; line-height: 20px; text-align:center; background-color: #eeeeee">默认过滤条件</div>
<div class="listAreaNode_vf" style="min-height: 56px; border-bottom:1px solid #CCCCCC; overflow: hidden;"></div>
<div style="display:none; height: 20px; line-height: 20px; text-align:center; background-color: #eeeeee">自定义过滤数据</div>
<div class="fieldListAreaNode_vf" style="display:none; min-height: 56px; border-bottom:1px solid #CCCCCC; overflow: hidden;"></div>
</div>
<div class="MWFScriptArea" name="defaultSelectedScript" title="默认选中行脚本"></div>
</div>
<div title="事件" class="MWFTab">
<div class="MWFEventsArea" name="events"></div>
</div>
<div title="HTML" class="MWFTab">
<div class="MWFHTMLArea" style="font-family: Verdana, Geneva, sans-serif; font-size:14px"></div>
</div>
<div title="JSON" class="MWFTab">
<div class="MWFJSONArea" style="font-family: Verdana, Geneva, sans-serif; font-size:14px"></div>
</div>
</div>
\ No newline at end of file
{
"moduleNodeMove": {
"border-radius": "5px",
"border": "1px solid #ffa200",
"overflow": "hidden",
"margin": "3px",
"-webkit-user-select": "none",
"-moz-user-select": "none",
"position": "absolute",
"z-index": 10002,
"opacity": 0.7,
"cursor": "move",
"height": "26px",
"display": "inline-block"
},
"moduleNodeShow": {
"border": "1px solid #333",
"margin": "3px",
"-webkit-user-select": "none",
"-moz-user-select": "none",
"position": "static",
"top": "auto",
"left": "auto",
"width": "18px",
"height": "2px",
"opacity": 0.5,
"display": "inline-block",
"background": "#ffa200"
},
"moduleNode": {
"border-radius": "5px",
"border-top": "1px solid #999",
"border-left": "1px solid #999",
"border-right": "1px solid #333",
"border-bottom": "1px solid #333",
"overflow": "hidden",
"cursor": "pointer",
"margin": "3px",
"-webkit-user-select": "none",
"-moz-user-select": "none",
"position": "static",
"top": "auto",
"left": "auto",
"opacity": 1,
"height": "26px",
"display": "inline-block"
},
"buttonIcon": {
"height": "26px",
"cursor": "pointer",
"border": "0px",
"margin": "0px"
}
}
\ No newline at end of file
{
"id": "",
"name": "",
"type": "StatementSelector",
"description": "",
"titleStyles": {},
"itemStyles": {},
"title": "选择",
"isTitle": true,
"select": "single", //"single", "multi"
"application": "",
"statementName": "",
"result": "setValue", //setValue., script
"selectedSetValues": {},
"selectedScript": {
"code": "",
"html": ""
},
"events": {
"queryLoad": {
"code": "",
"html": ""
},
"postLoad": {
"code": "",
"html": ""
},
"load": {
"code": "",
"html": ""
},
"click": {
"code": "",
"html": ""
},
"dblclick": {
"code": "",
"html": ""
},
"keydown": {
"code": "",
"html": ""
},
"keypress": {
"code": "",
"html": ""
},
"keyup": {
"code": "",
"html": ""
},
"mousedown": {
"code": "",
"html": ""
},
"mousemove": {
"code": "",
"html": ""
},
"mouseout": {
"code": "",
"html": ""
},
"mouseover": {
"code": "",
"html": ""
},
"mouseup": {
"code": "",
"html": ""
},
"focus": {
"code": "",
"html": ""
},
"blur": {
"code": "",
"html": ""
}
},
"properties": {},
"class": "",
"styles": {},
"container": ""
}
\ No newline at end of file
......@@ -84,6 +84,7 @@ MWF.xApplication.process.FormDesigner.Property = MWF.FCProperty = new Class({
this.loadSourceTestRestful();
this.loadSidebarPosition();
this.loadViewFilter();
this.loadStatementFilter();
this.loadDocumentTempleteSelect();
// this.loadScriptIncluder();
// this.loadDictionaryIncluder();
......@@ -517,6 +518,25 @@ MWF.xApplication.process.FormDesigner.Property = MWF.FCProperty = new Class({
}.bind(this));
}
},
loadStatementFilter: function(){
debugger;
var nodes = this.propertyContent.getElements(".MWFStatementFilter");
var filtrData = this.data.filterList;
nodes.each(function(node){
MWF.xDesktop.requireApp("query.StatementDesigner", "widget.ViewFilter", function(){
var _slef = this;
this.viewFilter = new MWF.xApplication.query.StatementDesigner.widget.ViewFilter(node, this.form.designer, {"filtrData": filtrData, "customData": null}, {
"statementId" : this.data.queryStatement ? this.data.queryStatement.id : "",
"withForm" : true,
"onChange": function(ids){
var data = this.getData();
_slef.changeJsonDate(["filterList"], data.data);
//_slef.changeJsonDate(["data", "customFilterEntryList"], data.customData);
}
});
}.bind(this));
}.bind(this));
},
loadViewFilter: function(){
var nodes = this.propertyContent.getElements(".MWFViewFilter");
var filtrData = this.data.filterList;
......@@ -1241,6 +1261,7 @@ debugger;
var viewNodes = this.propertyContent.getElements(".MWFViewSelect");
var cmsviewNodes = this.propertyContent.getElements(".MWFCMSViewSelect");
var queryviewNodes = this.propertyContent.getElements(".MWFQueryViewSelect");
var queryStatementNodes = this.propertyContent.getElements(".MWFQueryStatementSelect");
var querystatNodes = this.propertyContent.getElements(".MWFQueryStatSelect");
var fileNodes = this.propertyContent.getElements(".MWFImageFileSelect");
var processFileNodes = this.propertyContent.getElements(".MWFProcessImageFileSelect");
......@@ -1307,6 +1328,15 @@ debugger;
});
}.bind(this));
queryStatementNodes.each(function(node){
new MWF.xApplication.process.ProcessDesigner.widget.PersonSelector(node, this.form.designer, {
"type": "QueryStatement",
"count": 1,
"names": [this.data[node.get("name")]],
"onChange": function(ids){this.saveViewItem(node, ids);}.bind(this)
});
}.bind(this));
querystatNodes.each(function(node){
new MWF.xApplication.process.ProcessDesigner.widget.PersonSelector(node, this.form.designer, {
"type": "QueryStat",
......
......@@ -197,7 +197,7 @@ MWF.xApplication.process.FormDesigner.widget.ActionsEditor.ButtonAction = new Cl
this.loadNode();
var form = this.editor.designer.form || this.editor.designer.page || this.editor.designer.view;
if (form.scriptDesigner){
if (form && form.scriptDesigner){
this.scriptItem = form.scriptDesigner.addScriptItem(this.data, "actionScript", this.editor.module, "action.tools", this.data.text);
}
......
......@@ -76,28 +76,30 @@ MWF.xApplication.process.ProcessDesigner.widget.PersonSelector = new Class({
if (name){
var data = (typeOf(name)==="string") ? {"name": name, "id": name}: name;
MWF.require("MWF.widget.O2Identity", function(){
if (this.options.type.toLowerCase()==="identity") this.identitys.push(new MWF.widget.O2Identity(data, this.node));
if (this.options.type.toLowerCase()==="unit") this.identitys.push(new MWF.widget.O2Unit(data, this.node));
if (this.options.type.toLowerCase()==="group") this.identitys.push(new MWF.widget.O2Group(data, this.node));
if (this.options.type.toLowerCase()==="person") this.identitys.push(new MWF.widget.O2Person(data, this.node));
var type = this.options.type.toLowerCase();
if (type==="identity") this.identitys.push(new MWF.widget.O2Identity(data, this.node));
if (type==="unit") this.identitys.push(new MWF.widget.O2Unit(data, this.node));
if (type==="group") this.identitys.push(new MWF.widget.O2Group(data, this.node));
if (type==="person") this.identitys.push(new MWF.widget.O2Person(data, this.node));
if (this.options.type.toLowerCase()==="application") this.identitys.push(new MWF.widget.O2Application(data, this.node));
if (this.options.type.toLowerCase()==="process") this.identitys.push(new MWF.widget.O2Process(data, this.node));
if (this.options.type.toLowerCase()==="formfield") this.identitys.push(new MWF.widget.O2FormField(data, this.node));
if (this.options.type.toLowerCase()==="view") this.identitys.push(new MWF.widget.O2View(data, this.node));
if (this.options.type.toLowerCase()==="cmsview") this.identitys.push(new MWF.widget.O2CMSView(data, this.node));
if (this.options.type.toLowerCase()==="queryview") this.identitys.push(new MWF.widget.O2QueryView(data, this.node));
if (this.options.type.toLowerCase()==="querystat") this.identitys.push(new MWF.widget.O2QueryStat(data, this.node));
if (this.options.type.toLowerCase()==="dutyname") this.identitys.push(new MWF.widget.O2Duty(data, this.node));
if (this.options.type.toLowerCase()==="cmsapplication") this.identitys.push(new MWF.widget.O2CMSApplication(data, this.node));
if (this.options.type.toLowerCase()==="cmscategory") this.identitys.push(new MWF.widget.O2CMSCategory(data, this.node));
if (type==="application") this.identitys.push(new MWF.widget.O2Application(data, this.node));
if (type==="process") this.identitys.push(new MWF.widget.O2Process(data, this.node));
if (type==="formfield") this.identitys.push(new MWF.widget.O2FormField(data, this.node));
if (type==="view") this.identitys.push(new MWF.widget.O2View(data, this.node));
if (type==="cmsview") this.identitys.push(new MWF.widget.O2CMSView(data, this.node));
if (type==="queryview") this.identitys.push(new MWF.widget.O2QueryView(data, this.node));
if (type==="querystatement") this.identitys.push(new MWF.widget.O2QueryStatement(data, this.node));
if (type==="querystat") this.identitys.push(new MWF.widget.O2QueryStat(data, this.node));
if (type==="dutyname") this.identitys.push(new MWF.widget.O2Duty(data, this.node));
if (type==="cmsapplication") this.identitys.push(new MWF.widget.O2CMSApplication(data, this.node));
if (type==="cmscategory") this.identitys.push(new MWF.widget.O2CMSCategory(data, this.node));
if (this.options.type.toLowerCase()==="portalfile") this.identitys.push(new MWF.widget.O2File(data, this.node));
if (this.options.type.toLowerCase()==="processfile") this.identitys.push(new MWF.widget.O2File(data, this.node));
if (type==="portalfile") this.identitys.push(new MWF.widget.O2File(data, this.node));
if (type==="processfile") this.identitys.push(new MWF.widget.O2File(data, this.node));
if (this.options.type.toLowerCase()==="dictionary") this.identitys.push(new MWF.widget.O2Dictionary(data, this.node));
if (this.options.type.toLowerCase()==="script") this.identitys.push(new MWF.widget.O2Script(data, this.node));
if (this.options.type.toLowerCase()==="formstyle") this.identitys.push(new MWF.widget.O2FormStyle(data, this.node));
if (type==="dictionary") this.identitys.push(new MWF.widget.O2Dictionary(data, this.node));
if (type==="script") this.identitys.push(new MWF.widget.O2Script(data, this.node));
if (type==="formstyle") this.identitys.push(new MWF.widget.O2FormStyle(data, this.node));
}.bind(this));
}
}.bind(this));
......@@ -141,32 +143,34 @@ MWF.xApplication.process.ProcessDesigner.widget.PersonSelector = new Class({
}
this.identitys = [];
if (this.options.type.toLowerCase()!=="duty") this.node.empty();
var type = this.options.type.toLowerCase();
MWF.require("MWF.widget.O2Identity", function(){
items.each(function(item){
if (this.options.type.toLowerCase()==="identity") this.identitys.push(new MWF.widget.O2Identity(item.data, this.node));
if (this.options.type.toLowerCase()==="person") this.identitys.push(new MWF.widget.O2Person(item.data, this.node));
if (this.options.type.toLowerCase()==="unit") this.identitys.push(new MWF.widget.O2Unit(item.data, this.node));
if (this.options.type.toLowerCase()==="group") this.identitys.push(new MWF.widget.O2Group(item.data, this.node));
if (type==="identity") this.identitys.push(new MWF.widget.O2Identity(item.data, this.node));
if (type==="person") this.identitys.push(new MWF.widget.O2Person(item.data, this.node));
if (type==="unit") this.identitys.push(new MWF.widget.O2Unit(item.data, this.node));
if (type==="group") this.identitys.push(new MWF.widget.O2Group(item.data, this.node));
if (this.options.type.toLowerCase()==="application") this.identitys.push(new MWF.widget.O2Application(item.data, this.node));
if (this.options.type.toLowerCase()==="process") this.identitys.push(new MWF.widget.O2Process(item.data, this.node));
if (this.options.type.toLowerCase()==="cmsapplication") this.identitys.push(new MWF.widget.O2CMSApplication(item.data, this.node));
if (this.options.type.toLowerCase()==="cmscategory") this.identitys.push(new MWF.widget.O2CMSCategory(item.data, this.node));
if (type==="application") this.identitys.push(new MWF.widget.O2Application(item.data, this.node));
if (type==="process") this.identitys.push(new MWF.widget.O2Process(item.data, this.node));
if (type==="cmsapplication") this.identitys.push(new MWF.widget.O2CMSApplication(item.data, this.node));
if (type==="cmscategory") this.identitys.push(new MWF.widget.O2CMSCategory(item.data, this.node));
if (this.options.type.toLowerCase()==="formfield") this.identitys.push(new MWF.widget.O2FormField(item.data, this.node));
if (this.options.type.toLowerCase()==="view") this.identitys.push(new MWF.widget.O2View(item.data, this.node));
if (this.options.type.toLowerCase()==="cmsview") this.identitys.push(new MWF.widget.O2CMSView(item.data, this.node));
if (this.options.type.toLowerCase()==="queryview") this.identitys.push(new MWF.widget.O2QueryView(item.data, this.node));
if (this.options.type.toLowerCase()==="querystat") this.identitys.push(new MWF.widget.O2QueryStat(item.data, this.node));
if (this.options.type.toLowerCase()==="dutyname") this.identitys.push(new MWF.widget.O2Duty(item.data, this.node));
if (this.options.type.toLowerCase()==="portalfile") this.identitys.push(new MWF.widget.O2File(item.data, this.node));
if (this.options.type.toLowerCase()==="processfile") this.identitys.push(new MWF.widget.O2File(item.data, this.node));
if (type==="formfield") this.identitys.push(new MWF.widget.O2FormField(item.data, this.node));
if (type==="view") this.identitys.push(new MWF.widget.O2View(item.data, this.node));
if (type==="cmsview") this.identitys.push(new MWF.widget.O2CMSView(item.data, this.node));
if (type==="queryview") this.identitys.push(new MWF.widget.O2QueryView(item.data, this.node));
if (type==="querystatement") this.identitys.push(new MWF.widget.O2QueryStatement(item.data, this.node));
if (type==="querystat") this.identitys.push(new MWF.widget.O2QueryStat(item.data, this.node));
if (type==="dutyname") this.identitys.push(new MWF.widget.O2Duty(item.data, this.node));
if (type==="portalfile") this.identitys.push(new MWF.widget.O2File(item.data, this.node));
if (type==="processfile") this.identitys.push(new MWF.widget.O2File(item.data, this.node));
if (this.options.type.toLowerCase()==="dictionary") this.identitys.push(new MWF.widget.O2Dictionary(item.data, this.node));
if (this.options.type.toLowerCase()==="script") this.identitys.push(new MWF.widget.O2Script(item.data, this.node));
if (this.options.type.toLowerCase()==="formstyle") this.identitys.push(new MWF.widget.O2FormStyle(item.data, this.node));
if (type==="dictionary") this.identitys.push(new MWF.widget.O2Dictionary(item.data, this.node));
if (type==="script") this.identitys.push(new MWF.widget.O2Script(item.data, this.node));
if (type==="formstyle") this.identitys.push(new MWF.widget.O2FormStyle(item.data, this.node));
}.bind(this));
if (this.options.type.toLowerCase()==="duty") {
if (type==="duty") {
items.each(function(item){
new MWF.xApplication.process.ProcessDesigner.widget.PersonSelector.DutyInput(this, item.data, this.node, 20000);
}.bind(this));
......
......@@ -46,6 +46,8 @@ MWF.xApplication.process.Xform.require = function(callback){
["process.Xform", "Common"],
["process.Xform", "Image"],
["process.Xform", "Html"],
["process.Xform", "Statement"],
["process.Xform", "StatementSelector"],
];
MWF.xDesktop.requireApp(modules, null, function(){
if (callback) callback();
......
MWF.xDesktop.requireApp("process.Xform", "$Module", null, false);
//MWF.xDesktop.requireApp("process.Xform", "widget.View", null, false);
MWF.xApplication.process.Xform.Statement = MWF.APPStatement = new Class({
Extends: MWF.APP$Module,
options: {
"moduleEvents": ["load", "loadView", "queryLoad", "postLoad", "select", "openDocument"]
},
_loadUserInterface: function(){
MWF.xDesktop.requireApp("query.Query", "Statement", null, false);
this.node.empty();
},
_afterLoaded: function(){
if (this.json.queryStatement){
this.loadView();
}
},
reload: function(){
if (this.view){
if (this.view.loadViewRes) if (this.view.loadViewRes.isRunning()) this.view.loadViewRes.cancel();
if (this.view.getViewRes) if (this.view.getViewRes.isRunning()) this.view.getViewRes.cancel();
}
this.node.empty();
this.loadView();
},
active: function(){
if (this.view){
if (!this.view.loadingAreaNode) this.view.loadView();
}else{
this.loadView();
}
},
loadView: function(){
if (!this.json.queryStatement) return "";
var filter = null;
if (this.json.filterList && this.json.filterList.length){
filter = [];
this.json.filterList.each(function(entry){
entry.value = this.form.Macro.exec(entry.code.code, this);
//delete entry.code;
filter.push(entry);
}.bind(this));
}
debugger;
//var data = JSON.parse(this.json.data);
var viewJson = {
"application": (this.json.queryStatement) ? this.json.queryStatement.appName : this.json.application,
"statementName": (this.json.queryStatement) ? this.json.queryStatement.name : this.json.statementName,
"statementId": (this.json.queryStatement) ? this.json.queryStatement.id : this.json.statementId,
"isTitle": this.json.isTitle || "yes",
"select": this.json.select || "none",
"titleStyles": this.json.titleStyles,
"itemStyles": this.json.itemStyles,
"isExpand": this.json.isExpand || "no",
"showActionbar" : this.json.actionbar === "show",
"filter": filter,
"defaultSelectedScript" : this.json.defaultSelectedScript ? this.json.defaultSelectedScript.code : null
};
//MWF.xDesktop.requireApp("query.Query", "Viewer", function(){
this.view = new MWF.xApplication.query.Query.Statement(this.node, viewJson, {
"isload": (this.json.loadView!=="no"),
"resizeNode": (this.node.getStyle("height").toString().toLowerCase()!=="auto" && this.node.getStyle("height").toInt()>0),
"onLoadView": function(){
this.fireEvent("loadView");
}.bind(this),
"onSelect": function(){
this.fireEvent("select");
}.bind(this),
"onOpenDocument": function(options, item){
this.openOptions = {
"options": options,
"item": item
};
this.fireEvent("openDocument");
this.openOptions = null;
}.bind(this)
}, this.form.app, this.form.Macro);
//}.bind(this));
},
getData: function(){
if (this.view.selectedItems.length){
var arr = [];
this.view.selectedItems.each(function(item){
arr.push(item.data);
});
return arr;
}else{
return [];
}
}
});
MWF.xDesktop.requireApp("process.Xform", "$Module", null, false);
MWF.xDesktop.requireApp("process.Xform", "ViewSelector", null, false);
MWF.xApplication.process.Xform.StatementSelector = MWF.APPStatementSelector = new Class({
Implements: [Events],
Extends: MWF.xApplication.process.Xform.ViewSelector,
selectView: function(callback){
var viewData = this.json.queryStatement;
if (viewData){
var filter = null;
if (this.json.filterList && this.json.filterList.length){
filter = [];
this.json.filterList.each(function(entry){
entry.value = this.form.Macro.exec(entry.code.code, this);
//delete entry.code;
filter.push(entry);
}.bind(this));
}
var viewJson = {
"application": viewData.appName,
"statementName": viewData.name,
"statementId": viewData.id,
"isTitle": this.json.isTitle || "yes",
"select": this.json.select || "single",
"titleStyles": this.json.titleStyles,
"itemStyles": this.json.itemStyles,
"isExpand": this.json.isExpand || "no",
"showActionbar" : this.json.actionbar === "show",
"filter": filter,
"defaultSelectedScript" : this.json.defaultSelectedScript ? this.json.defaultSelectedScript.code : null
};
var options = {};
var width = options.width || "850";
var height = options.height || "700";
if (layout.mobile){
var size = document.body.getSize();
width = size.x;
height = size.y;
options.style = "viewmobile";
}
width = width.toInt();
height = height.toInt();
var size = this.form.app.content.getSize();
var x = (size.x-width)/2;
var y = (size.y-height)/2;
if (x<0) x = 0;
if (y<0) y = 0;
if (layout.mobile){
x = 20;
y = 0;
}
var _self = this;
MWF.require("MWF.xDesktop.Dialog", function(){
var dlg = new MWF.xDesktop.Dialog({
"title": this.json.title || "select view",
"style": options.style || "view",
"top": y,
"left": x-20,
"fromTop":y,
"fromLeft": x-20,
"width": width,
"height": height,
"html": "",
"maskNode": layout.mobile?$(document.body) : this.form.app.content,
"container": layout.mobile?$(document.body) : this.form.app.content,
"buttonList": [
{
"text": MWF.LP.process.button.ok,
"action": function(){
//if (callback) callback(_self.view.selectedItems);
debugger;
if (callback) callback(_self.view.getData());
this.close();
}
},
{
"text": MWF.LP.process.button.cancel,
"action": function(){this.close();}
}
],
"onPostShow": function(){
if(layout.mobile){
dlg.node.setStyle("z-index",200);
}
MWF.xDesktop.requireApp("query.Query", "Statement", function(){
this.view = new MWF.xApplication.query.Query.Statement(dlg.content, viewJson, {"style": "select"}, this.form.app, this.form.Macro );
}.bind(this));
}.bind(this)
});
dlg.show();
if (layout.mobile){
var backAction = dlg.node.getElement(".MWF_dialod_Action_back");
var okAction = dlg.node.getElement(".MWF_dialod_Action_ok");
if (backAction) backAction.addEvent("click", function(e){
dlg.close();
}.bind(this));
if (okAction) okAction.addEvent("click", function(e){
//if (callback) callback(this.view.selectedItems);
if (callback) callback(this.view.getData());
dlg.close();
}.bind(this));
}
// MWF.xDesktop.requireApp("process.Xform", "widget.View", function(){
// this.view = new MWF.xApplication.process.Xform.widget.View(dlg.content.getFirst(), viewJson, {"style": "select"});
// }.bind(this));
// MWF.xDesktop.requireApp("query.Query", "Viewer", function(){
// this.view = new MWF.xApplication.query.Query.Viewer(dlg.content, viewJson, {"style": "select"});
// }.bind(this));
}.bind(this));
}
},
doResult: function(data){
if (this.json.result === "script"){
this.selectedData = data;
return (this.json.selectedScript.code) ? this.form.Macro.exec(this.json.selectedScript.code, this) : "";
}else{
Object.each(this.json.selectedSetValues, function(v, k){
var value = "";
data.each(function(d, idx){
// Object.each(d, function(dv, dk){
// if (dk===v) value = (value) ? (value+", "+dv) : dv;
// }.bind(this));
var pathList = v.split(".");
for( var i=0; i<pathList.length; i++ ){
var p = pathList[i];
if( (/(^[1-9]\d*$)/.test(p)) )p = p.toInt();
if( d[ p ] ){
d = d[ p ];
}else{
d = "";
break;
}
}
if( typeOf(d) === "array" || typeOf(d) === "object" ) {
d = JSON.stringify(d);
}
value = (value) ? (value+", "+d) : d;
}.bind(this));
var field = this.form.all[k];
if (field){
field.setData(value);
if (value){
if (field.descriptionNode) field.descriptionNode.setStyle("display", "none");
}else{
if (field.descriptionNode) field.descriptionNode.setStyle("display", "block");
}
}
}.bind(this));
}
},
});
......@@ -52,6 +52,21 @@
"color": "#333333",
"line-height": "40px"
},
"naviStatementTitleNode": {
"height": "40px",
"line-height": "40px",
"padding-left": "65px",
"font-size": "16px",
"color": "#333333",
"background": "url('../x_component_query_Query/$Main/default/icon/statement.png') 38px center no-repeat"
},
"naviStatementContentNode": {
"min-height": "40px",
"overflow": "hidden",
"font-size": "14px",
"color": "#333333",
"line-height": "40px"
},
"naviIconTitleNode": {
"width": "82px",
"height": "100px",
......
......@@ -79,6 +79,10 @@ MWF.xApplication.query.Query.Main = new Class({
this.naviViewContentNode = new Element("div", {"styles": this.css.naviViewContentNode}).inject(this.naviContentNode);
this.naviStatTitleNode = new Element("div", {"styles": this.css.naviStatTitleNode, "text": this.lp.stat}).inject(this.naviContentNode);
this.naviStatContentNode = new Element("div", {"styles": this.css.naviStatContentNode}).inject(this.naviContentNode);
this.naviStatementTitleNode = new Element("div", {"styles": this.css.naviStatementTitleNode, "text": this.lp.statement}).inject(this.naviContentNode);
this.naviStatementContentNode = new Element("div", {"styles": this.css.naviStatementContentNode}).inject(this.naviContentNode);
this.setContentHeightFun = this.setContentHeight.bind(this);
this.addEvent("resize", this.setContentHeightFun);
this.setContentHeightFun();
......@@ -127,6 +131,21 @@ MWF.xApplication.query.Query.Main = new Class({
}.bind(this));
}
}.bind(this));
MWF.Actions.load("x_query_assemble_surface").StatementAction.listWithQuery(this.options.id, {
"justSelect" : true,
"hasView" : true
}, function(json){
//this.action.listStat(this.options.id, function(json){
if (json.data){
json.data.each(function(statement){
debugger;
var item = this.createStatementNaviItem(statement);
if( statement.id === this.options.statementId ){
item.selected()
}
}.bind(this));
}
}.bind(this));
},
createViewNaviItem: function(view){
var item = new MWF.xApplication.query.Query.ViewItem(view, this);
......@@ -136,6 +155,10 @@ MWF.xApplication.query.Query.Main = new Class({
var item = new MWF.xApplication.query.Query.StatItem(stat, this);
return item;
},
createStatementNaviItem: function(statement){
var item = new MWF.xApplication.query.Query.StatementItem(statement, this);
return item;
},
recordStatus: function(){
......@@ -219,4 +242,22 @@ MWF.xApplication.query.Query.StatItem = new Class({
});
}.bind(this));
}
});
MWF.xApplication.query.Query.StatementItem = new Class({
Extends: MWF.xApplication.query.Query.ViewItem,
getContentNode: function(){
return this.app.naviStatementContentNode;
},
loadView: function(){
MWF.xDesktop.requireApp("query.Query", "Statement",function(){
this.viewContent.empty();
debugger;
this.viewer = new MWF.QStatement( this.viewContent, {
"application": this.view.query,
"statementName": this.view.name,
"statementId" : this.view.id
},{}, this.app);
}.bind(this));
}
});
\ No newline at end of file
此差异已折叠。
......@@ -902,10 +902,11 @@ MWF.xApplication.query.Query.Viewer = MWF.QViewer = new Class({
});
},
searchView: function(){
debugger;
if (this.viewJson.customFilterList) {
var key = this.viewSearchInputNode.get("value");
if (key && key !== this.lp.searchKeywork) {
var filterData = this.json.filter ? this.json.filter : [];
var filterData = this.json.filter ? this.json.filter.clone() : [];
this.filterItems = [];
this.viewJson.customFilterList.each(function (entry) {
if (entry.formatType === "textValue") {
......@@ -938,7 +939,8 @@ MWF.xApplication.query.Query.Viewer = MWF.QViewer = new Class({
this.createViewNode({"filterList": filterData});
}else{
this.filterItems = [];
this.createViewNode();
var filterData = this.json.filter ? this.json.filter.clone() : [];
this.createViewNode( {"filterList": filterData} );
}
}
},
......
......@@ -10,6 +10,7 @@ MWF.xApplication.query.Query.LP = {
"noDescription": "未定义描述",
"view": "视图",
"stat": "统计",
"statement" : "查询",
"customSearch": "高级搜索",
"searchKeywork": "输入关键字搜索视图",
"yes": "",
......
<div id="MWFFormToolbar">
<span MWFnodetype="MWFToolBarSeparator"></span>
<span MWFnodetype="MWFToolBarButton" MWFButtonImage="save.gif" title="保存数据表" MWFButtonAction="saveStatement" MWFButtonText=""></span>
<span MWFnodetype="MWFToolBarButton" MWFButtonImage="preview.png" title="预览" MWFButtonAction="preview" MWFButtonText=""></span>
<span MWFnodetype="MWFToolBarSeparator"></span>
<span MWFnodetype="MWFToolBarButton" MWFButtonImage="help.png" title="帮助" MWFButtonAction="statementHelp" MWFButtonText=""></span>
......
<div style="background-color: #FFF; overflow: hidden">
<div title="基本" class="MWFTab">
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
<tr>
<td class="editTableTitle">标识:</td>
<td class="editTableValue"><input type="text" name="id" value="text{$.id}" class="editTableInput"/></td>
</tr>
<tr>
<td class="editTableTitle">名称:</td>
<td class="editTableValue"><input type="text" name="name" value="text{$.name}" class="editTableInput"/></td>
</tr>
<tr>
<td class="editTableTitle">描述:</td>
<td class="editTableValue"><input type="text" name="description" value="text{$.description}" class="editTableInput"/></td>
</tr>
<!-- <tr>-->
<!-- <td class="editTableTitle">系统操作:</td>-->
<!-- <td class="editTableValue">-->
<!-- <input type="radio" name="hideSystemTools" value="false" text{(!$.hideSystemTools)?'checked':''}/>显示-->
<!-- <input type="radio" name="hideSystemTools" value="true" text{($.hideSystemTools)?'checked':''}/>不显示-->
<!-- </td>-->
<!-- </tr>-->
</table>
</div>
<div title="操作" class="MWFTab" style="overflow: hidden">
<!-- <div class="MWFDefaultActionArea" name="defaultTools"></div>-->
<div class="MWFActionArea" name="tools"></div>
</div>
<div title="样式" class="MWFTab">
<div class="MWFActionStylesArea" name="actionStyles"></div>
</div>
<div title="事件" class="MWFTab">
<div class="MWFEventsArea" name="events"></div>
</div>
<!--<div title="HTML" class="MWFTab">-->
<!--<div class="MWFHTMLArea" style="font-family: Verdana, Geneva, sans-serif; font-size:14px"></div>-->
<!--</div>-->
<div title="JSON" class="MWFTab">
<div class="MWFJSONArea" style="font-family: Verdana, Geneva, sans-serif; font-size:14px"></div>
</div>
</div>
\ No newline at end of file
......@@ -2,35 +2,105 @@
<div title="基本" class="MWFTab">
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
<tr>
<td class="editTableTitle">名称:</td>
<td class="editTableValue"><input type="text" name="name" value="text{$.name}" class="editTableInput"/></td>
<td class="editTableTitle">列标题:</td>
<td class="editTableValue"><input type="text" name="displayName" value="text{$.displayName}" class="editTableInput"/></td>
</tr>
<tr>
<td class="editTableTitle">描述:</td>
<td class="editTableValue"><input type="text" name="description" value="text{$.description}" class="editTableInput"/></td>
<td class="editTableTitle">列名:</td>
<td class="editTableValue"><input type="text" name="column" value="text{$.column}" class="editTableInput"/></td>
</tr>
<tr>
<td class="editTableTitle">类型:</td>
<td class="editTableValue"><select class="type" name="column">
<option value="string">string</option>
<option value="integer">integer</option>
<option value="long">long</option>
<option value="double">double</option>
<option value="boolean">boolean</option>
<option value="date">date</option>
<option value="time">time</option>
<option value="dateTime">dateTime</option>
<option value="stringList">stringList</option>
<option value="integerList">integerList</option>
<option value="longList">longList</option>
<option value="doubleList">doubleList</option>
<option value="booleanList">booleanList</option>
<option value="stringLob">stringLob</option>
<option value="stringMap">stringMap</option>
</select></td>
<td class="editTableTitle">默认值:</td>
<td class="editTableValue"><input type="text" name="defaultValue" value="text{$.defaultValue}" class="editTableInput"/></td>
</tr>
<tr>
<td class="editTableTitle">打开文档:</td>
<td class="editTableValue">
<input class="editTableRadio" name="allowOpen" text{($.allowOpen===true)?'checked':''} type="radio" value="true"
onclick="if(this.checked){
$('text{$.pid}clickCodeTr').setStyle('display', '');
$('text{$.pid}idPathTr').setStyle('display', '');
}"/>
<input class="editTableRadio" name="allowOpen" text{($.allowOpen!==true)?'checked':''} type="radio" value="false"
onclick="if(this.checked){
$('text{$.pid}clickCodeTr').setStyle('display', 'none');
$('text{$.pid}idPathTr').setStyle('display', 'none');
}"/>
</td>
</tr>
<tr id="text{$.pid}clickCodeTr" style="display:text{($.allowOpen===true)?'':'none'}">
<td class="editTableValue" colspan="2">
<div class="MWFFormulaArea" name="clickCode" title="打开文档脚本(S)"></div>
</td>
</tr>
<tr id="text{$.pid}idPathTr" style="display:text{($.allowOpen===true)?'':'none'}">
<td class="editTableTitle">id路径:</td>
<td class="editTableValue">
<input type="text" name="idPath" value="text{$.idPath}" class="editTableInput"/>
<div style="line-height: 20px;color:#999;">注:指Id(cms文档id/流程work id)相对单条数据的路径,用于打开文档。</div>
</td>
</tr>
</table>
<div style="border-top: 1px solid #999; margin-top:10px">
<div style="background-color: #EEE; height:24px; line-height: 24px; text-align: center; font-weight: bold">数据</div>
<div class="MWFDataData" id="text{$.pid}dataDataEditor">
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable" style="table-layout: fixed;">
<tr>
<td class="editTableTitle">选择路径:</td>
<td class="editTableValue">
<select class="MWFDataPathSelect" id="text{$.pid}dataPathSelected" onchange=" var v=this.options[this.selectedIndex].value; if (true){var n = $('text{$.pid}viewColumnPathInput'); n.set('value', v); n.focus();} ">
</select>
<div style="line-height: 20px;color:#999;">注:正确填写了查询语句,再测试语句或刷新视图数据可显示(刷新)选择路径。</div>
</td>
</tr>
<tr>
<td class="editTableTitle">数据路径:</td>
<td class="editTableValue">
<input id="text{$.pid}viewColumnPathInput" type="text" name="path" value="text{$.path}" class="editTableInput"/>
<div style="line-height: 20px;color:#999;">注:指该列相对单条数据的路径。比如 0,title,或 0.title</div>
</td>
</tr>
</table>
</div>
</div>
<div style="border-top: 1px solid #999; margin-top:10px">
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
<tr class="MWFColumnExportHide">
<td class="editTableTitle">隐藏:</td>
<td class="editTableValue">
<input class="MWFWorkDataCheck" name="hideColumn" type="radio" value="true" text{($.hideColumn)===true?'checked':''}/>
<input class="MWFWorkDataCheck" name="hideColumn" type="radio" value="false" text{($.hideColumn)!==true?'checked':''}/>
</td>
</tr>
<tr class="MWFColumnExportGroup">
<td class="editTableTitle">组织对象:</td>
<td class="editTableValue">
<input class="MWFWorkDataCheck" name="isName" type="radio" value="true" text{($.isName)===true?'checked':''}/>
<input class="MWFWorkDataCheck" name="isName" type="radio" value="false" text{($.isName)!==true?'checked':''}/>
</td>
</tr>
<tr class="MWFColumnExportGroup">
<td class="editTableTitle">HTML值:</td>
<td class="editTableValue">
<input class="MWFWorkDataCheck" name="isHtml" type="radio" value="true" text{($.isHtml)===true?'checked':''}/>
<input class="MWFWorkDataCheck" name="isHtml" type="radio" value="false" text{($.isHtml)!==true?'checked':''}/>
</td>
</tr>
</table>
</div>
<div class="MWFFormulaArea" name="code" title="显示脚本 (S)"></div>
</div>
<div title="样式" class="MWFTab">
<div class="MWFMaplist" name="titleStyles" title="标题单元格样式"></div>
<div class="MWFMaplist" name="titleProperties" title="标题单元格属性"></div>
<div class="MWFMaplist" name="contentStyles" title="内容单元格样式"></div>
<div class="MWFMaplist" name="contentProperties" title="内容单元格属性"></div>
</div>
<div title="事件" class="MWFTab">
<div class="MWFEventsArea" name="events"></div>
</div>
<div title="JSON" class="MWFTab">
<div class="MWFJSONArea" style="font-family: Verdana, Geneva, sans-serif; font-size:14px"></div>
</div>
......
<div style="background-color: #FFF; overflow: hidden">
<div title="基本" class="MWFTab">
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
<tr>
<td class="editTableTitle">名称:</td>
<td class="editTableValue"><input type="text" name="name" value="text{$.name}" class="editTableInput"/></td>
</tr>
<tr>
<td class="editTableTitle">描述:</td>
<td class="editTableValue"><input type="text" name="description" value="text{$.description}" class="editTableInput"/></td>
</tr>
<tr>
<td class="editTableTitle">类型:</td>
<td class="editTableValue"><select class="type" name="column">
<option value="string">string</option>
<option value="integer">integer</option>
<option value="long">long</option>
<option value="double">double</option>
<option value="boolean">boolean</option>
<option value="date">date</option>
<option value="time">time</option>
<option value="dateTime">dateTime</option>
<option value="stringList">stringList</option>
<option value="integerList">integerList</option>
<option value="longList">longList</option>
<option value="doubleList">doubleList</option>
<option value="booleanList">booleanList</option>
<option value="stringLob">stringLob</option>
<option value="stringMap">stringMap</option>
</select></td>
</tr>
</table>
</div>
<div title="JSON" class="MWFTab">
<div class="MWFJSONArea" style="font-family: Verdana, Geneva, sans-serif; font-size:14px"></div>
</div>
</div>
\ No newline at end of file
......@@ -336,7 +336,7 @@
"margin-right": "8px",
"top": "-38px"
},
propertyRefreshFormNode: {
"propertyRefreshFormNode": {
"width": "24px",
"height": "24px",
"float": "right",
......
.o2_statement_statementDesignerNode {
height : 360px;
overflow: hidden;
padding: 20px;
box-shadow: 0 0 10px #999999;
......@@ -49,7 +50,19 @@
border: 1px solid #cccccc;
background: #ffffff;
}
.o2_statement_statementDesignerCountJpqlLine {
height: 260px;
margin-top: 10px;
border: 1px solid #cccccc;
background: #ffffff;
}
.o2_statement_statementDesignerScript {
height: 260px;
margin-top: 10px;
border: 1px solid #cccccc;
background: #ffffff;
}
.o2_statement_statementDesignerCountScript {
height: 260px;
margin-top: 10px;
border: 1px solid #cccccc;
......@@ -103,4 +116,15 @@
top:45%;
margin: auto;
cursor: pointer;
}
.o2_statement_tabNode{
height: 32px;
}
.o2_statement_statementJpqlTabNode{
height: 32px;
}
.o2_statement_resizeNode{
height: 3px;
background-color: #505050;
cursor: row-resize;
}
\ No newline at end of file
......@@ -21,12 +21,27 @@
<div style="height:24px; text-align: center; line-height: 24px; background-color: #EEE; border-top: 1px solid #999; font-weight: bold">执行权限</div>
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable" id="processEditStarter">
<tr>
<td class="editTableTitle">匿名访问:</td>
<td class="editTableValue">
<input class="editTableRadio" name="anonymousAccessible" text{($.anonymousAccessible===true)?'checked':''} type="radio" value="true"
onclick="if(this.checked){
$('text{$.pid}executePersonListTr').setStyle('display', 'none');
$('text{$.pid}executeUnitListTr').setStyle('display', 'none');
}"/>允许
<input class="editTableRadio" name="anonymousAccessible" text{($.anonymousAccessible!==true)?'checked':''} type="radio" value="false"
onclick="if(this.checked){
$('text{$.pid}executePersonListTr').setStyle('display', '');
$('text{$.pid}executeUnitListTr').setStyle('display', '');
}"/>不允许
</td>
</tr>
<tr id="text{$.pid}executePersonListTr" style="display:text{($.anonymousAccessible==true)?'none':''}">
<td class="editTableTitle">执行人:</td>
<td class="editTableValue">
<div class="MWFPersonIdentity" name="executePersonList"></div>
</td>
</tr>
<tr>
<tr id="text{$.pid}executeUnitListTr" style="display:text{($.anonymousAccessible==true)?'none':''}">
<td class="editTableTitle">执行组织:</td>
<td class="editTableValue">
<div class="MWFPersonUnit" name="executeUnitList"></div>
......@@ -34,9 +49,8 @@
</tr>
</table>
</div>
</div>
<div title="JSON" class="MWFTab">
<div class="MWFJSONArea" style="font-family: Verdana, Geneva, sans-serif; font-size:14px"></div>
</div>
<div title="JSON" class="MWFTab">
<div class="MWFJSONArea" style="font-family: Verdana, Geneva, sans-serif; font-size:14px"></div>
</div>
</div>
\ No newline at end of file
<div class="o2_statement_statementDesignerNode">
<div class="o2_statement_statementDesignerFormatLine">
<div class="o2_statement_statementDesignerFormatTitle">{{$.lp.statementFormat}}: </div>
<div class="o2_statement_statementDesignerFormatTitle">{{$.lp.statementFormat}} </div>
<div class="o2_statement_statementDesignerFormatContent" style="float: left; margin-right: 20px">
<input name="format" type="radio" value="jpql" {{if $.data.format!=='script'}} checked {{end if}}/>{{$.lp.statementJpql}}
<input name="format" type="radio" value="script" {{if $.data.format=='script'}} checked {{end if}}/>{{$.lp.statementScript}}
......@@ -11,7 +11,7 @@
<select>
<option value="official" {{if $.data.entityCategory!=='dynamic' && $.data.entityCategory!=='custom'}} selected {{end if}}>系统表</option>
<option value="dynamic" {{if $.data.entityCategory=='dynamic'}} selected {{end if}}>自建数据表</option>
<option value="custom" {{if $.data.entityCategory=='custom'}} selected {{end if}}>自定义应用</option>
<!-- <option value="custom" {{if $.data.entityCategory=='custom'}} selected {{end if}}>自定义应用</option>-->
</select>
</div>
</div>
......@@ -39,6 +39,7 @@
<div style="margin-left: 30px;" class="o2_statement_statementDesignerTitle">{{$.lp.statementTable}}: </div>
<div class="o2_statement_statementDesignerOfficialTable">
<select>
<option value=""></option>
<option value="com.x.processplatform.core.entity.content.Task" {{if $.data.entityClassName =='com.x.processplatform.core.entity.content.Task'}} selected {{end if}}>待办(Task)</option>
<option value="com.x.processplatform.core.entity.content.TaskCompleted" {{if $.data.entityClassName =='com.x.processplatform.core.entity.content.TaskCompleted'}} selected {{end if}}>已办(TaskCompleted)</option>
<option value="com.x.processplatform.core.entity.content.Read" {{if $.data.entityClassName =='com.x.processplatform.core.entity.content.Read'}} selected {{end if}}>待阅(Read)</option>
......@@ -46,6 +47,7 @@
<option value="com.x.processplatform.core.entity.content.Work" {{if $.data.entityClassName =='com.x.processplatform.core.entity.content.Work'}} selected {{end if}}>流程实例(Work)</option>
<option value="com.x.processplatform.core.entity.content.WorkCompleted" {{if $.data.entityClassName =='com.x.processplatform.core.entity.content.WorkCompleted'}} selected {{end if}}>已完成流程实例(WorkCompleted)</option>
<option value="com.x.processplatform.core.entity.content.Review" {{if $.data.entityClassName =='com.x.processplatform.core.entity.content.Review'}} selected {{end if}}>可阅读(Review)</option>
<option value="com.x.cms.core.entity.Document" {{if $.data.entityClassName =='com.x.cms.core.entity.Document'}} selected {{end if}}>内容管理文档(Document)</option>
</select>
</div>
</div>
......@@ -54,45 +56,69 @@
</div>
<div class="o2_statement_statementDesignerTableArea_field">
<div style="margin-left: 30px;" class="o2_statement_statementDesignerTitle">{{$.lp.field}}: </div>
<select>
</select>
</div>
</div>
<div class="o2_statement_statementDesignerJpql" style="{{if $.data.format=='script'}} display: none {{end if}}">
<div class="o2_statement_statementDesignerJpqlLine">
<!-- <div class="o2_statement_statementDesignerJpql_select" style="{{if $.data.type=='update' || $.data.type=='delete'}} display: none {{end if}}">-->
<!--&lt;!&ndash; <div class="o2_statement_statementDesignerJpql_jpql_select">SELECT</div>&ndash;&gt;-->
<!--&lt;!&ndash; <div class="o2_statement_statementDesignerJpql_jpql_selectContent"></div>&ndash;&gt;-->
<!--&lt;!&ndash; <div class="o2_statement_statementDesignerJpql_jpql_from">FROM</div>&ndash;&gt;-->
<!--&lt;!&ndash; <div class="o2_statement_statementDesignerJpql_jpql_fromContent"></div>&ndash;&gt;-->
<!--&lt;!&ndash; <div class="o2_statement_statementDesignerJpql_jpql_where">WHERE</div>&ndash;&gt;-->
<!--&lt;!&ndash; <div class="o2_statement_statementDesignerJpql_jpql_whereContent"></div>&ndash;&gt;-->
<!-- </div>-->
<!-- <div class="o2_statement_statementDesignerJpql_update" style="{{if $.data.type!=='update'}} display: none {{end if}}">-->
<!--&lt;!&ndash; <div class="o2_statement_statementDesignerJpql_jpql_update">UPDATE</div>&ndash;&gt;-->
<!--&lt;!&ndash; <div class="o2_statement_statementDesignerJpql_jpql_updateContent"></div>&ndash;&gt;-->
<!--&lt;!&ndash; <div class="o2_statement_statementDesignerJpql_jpql_set">SET</div>&ndash;&gt;-->
<!--&lt;!&ndash; <div class="o2_statement_statementDesignerJpql_jpql_setContent"></div>&ndash;&gt;-->
<!--&lt;!&ndash; <div class="o2_statement_statementDesignerJpql_jpql_where">WHERE</div>&ndash;&gt;-->
<!--&lt;!&ndash; <div class="o2_statement_statementDesignerJpql_jpql_whereContent"></div>&ndash;&gt;-->
<!-- </div>-->
<!-- <div class="o2_statement_statementDesignerJpql_sdelete" style="{{if $.data.type!=='delete'}} display: none {{end if}}">-->
<!--&lt;!&ndash; <div class="o2_statement_statementDesignerJpql_jpql_delete">DELETE</div>&ndash;&gt;-->
<!--&lt;!&ndash; <div class="o2_statement_statementDesignerJpql_jpql_deleteContent"></div>&ndash;&gt;-->
<!--&lt;!&ndash; <div class="o2_statement_statementDesignerJpql_jpql_where">WHERE</div>&ndash;&gt;-->
<!--&lt;!&ndash; <div class="o2_statement_statementDesignerJpql_jpql_whereContent"></div>&ndash;&gt;-->
<!-- </div>-->
<!-- <div class="o2_statement_statementJpqlTabNode" style="{{if $.data.type!='select'}} display: none {{end if}}"></div>-->
<div class="o2_statement_statementJpqlTabNode"></div>
<div class="o2_statement_statementJpqlTabPageNode">
<div class="o2_statement_statementDesignerJpql" style="{{if $.data.format=='script'}} display: none {{end if}}">
<div class="o2_statement_statementDesignerJpqlLine">
<!-- <div class="o2_statement_statementDesignerJpql_select" style="{{if $.data.type=='update' || $.data.type=='delete'}} display: none {{end if}}">-->
<!--&lt;!&ndash; <div class="o2_statement_statementDesignerJpql_jpql_select">SELECT</div>&ndash;&gt;-->
<!--&lt;!&ndash; <div class="o2_statement_statementDesignerJpql_jpql_selectContent"></div>&ndash;&gt;-->
<!--&lt;!&ndash; <div class="o2_statement_statementDesignerJpql_jpql_from">FROM</div>&ndash;&gt;-->
<!--&lt;!&ndash; <div class="o2_statement_statementDesignerJpql_jpql_fromContent"></div>&ndash;&gt;-->
<!--&lt;!&ndash; <div class="o2_statement_statementDesignerJpql_jpql_where">WHERE</div>&ndash;&gt;-->
<!--&lt;!&ndash; <div class="o2_statement_statementDesignerJpql_jpql_whereContent"></div>&ndash;&gt;-->
<!-- </div>-->
<!-- <div class="o2_statement_statementDesignerJpql_update" style="{{if $.data.type!=='update'}} display: none {{end if}}">-->
<!--&lt;!&ndash; <div class="o2_statement_statementDesignerJpql_jpql_update">UPDATE</div>&ndash;&gt;-->
<!--&lt;!&ndash; <div class="o2_statement_statementDesignerJpql_jpql_updateContent"></div>&ndash;&gt;-->
<!--&lt;!&ndash; <div class="o2_statement_statementDesignerJpql_jpql_set">SET</div>&ndash;&gt;-->
<!--&lt;!&ndash; <div class="o2_statement_statementDesignerJpql_jpql_setContent"></div>&ndash;&gt;-->
<!--&lt;!&ndash; <div class="o2_statement_statementDesignerJpql_jpql_where">WHERE</div>&ndash;&gt;-->
<!--&lt;!&ndash; <div class="o2_statement_statementDesignerJpql_jpql_whereContent"></div>&ndash;&gt;-->
<!-- </div>-->
<!-- <div class="o2_statement_statementDesignerJpql_sdelete" style="{{if $.data.type!=='delete'}} display: none {{end if}}">-->
<!--&lt;!&ndash; <div class="o2_statement_statementDesignerJpql_jpql_delete">DELETE</div>&ndash;&gt;-->
<!--&lt;!&ndash; <div class="o2_statement_statementDesignerJpql_jpql_deleteContent"></div>&ndash;&gt;-->
<!--&lt;!&ndash; <div class="o2_statement_statementDesignerJpql_jpql_where">WHERE</div>&ndash;&gt;-->
<!--&lt;!&ndash; <div class="o2_statement_statementDesignerJpql_jpql_whereContent"></div>&ndash;&gt;-->
<!-- </div>-->
</div>
</div>
<div class="o2_statement_statementDesignerScript" style="{{if $.data.format!=='script'}} display: none {{end if}}">
</div>
</div>
<div class="o2_statement_statementDesignerScript" style="{{if $.data.format!=='script'}} display: none {{end if}}">
<div class="o2_statement_statementCountJpqlTabPageNode">
<div class="o2_statement_statementDesignerCountJpql" style="{{if $.data.format=='script'}} display: none {{end if}}">
<div class="o2_statement_statementDesignerCountJpqlLine"></div>
</div>
<div class="o2_statement_statementDesignerCountScript" style="{{if $.data.format!=='script'}} display: none {{end if}}">
</div>
</div>
</div>
<div class="o2_statement_resizeNode"></div>
<div class="o2_statement_tabNode"></div>
<div class="o2_statement_statementRunNode">
<div class="o2_statement_statementRunTitleNode">{{$.lp.runTest}}</div>
<!-- <div class="o2_statement_statementRunTitleNode">{{$.lp.runTest}}</div>-->
<div class="o2_statement_statementRunContentNode">
<div class="o2_statement_statementRunJsonNode">
<!-- <div class="o2_statement_statementRunJsonContent"></div>-->
......@@ -105,4 +131,6 @@
</div>
</div>
</div>
\ No newline at end of file
</div>
<div class="o2_statement_viewNode"></div>
\ No newline at end of file
{
"name": "",
"id": "",
"query": "",
"alias": "",
"description": "",
"display": true,
"type": "View",
"pageSize" : "20",
"data": {
// "exportGrid": true,
// "exportGoupGrid": true,
"noDataText" : "未找到数据",
"selectList": [],
"filterList": [],
"orderList": [],
"group": {},
"columnList": [],
// "calculate": {},
// "afterGridScriptText": "",
// "afterGroupGridScriptText": "",
// "afterCalculateGridScriptText": "",
"actionbarHidden" : true,
"events": {
"queryLoad" : {
"code": "",
"html": ""
},
"postLoad": {
"code": "",
"html": ""
},
"postLoadPageData" : {
"code": "",
"html": ""
},
"postLoadPage": {
"code": "",
"html": ""
},
"queryLoadItemRow": {
"code": "",
"html": ""
},
"postLoadItemRow": {
"code": "",
"html": ""
},
// "queryLoadCategoryRow": {
// "code": "",
// "html": ""
// },
// "postLoadCategoryRow": {
// "code": "",
// "html": ""
// },
"selectRow" : {
"code": "",
"html": ""
},
"unselectRow" : {
"code": "",
"html": ""
}
}
}
// "availableIdentityList": [],
// "availableUnitList": []
}
\ No newline at end of file
......@@ -299,20 +299,22 @@ MWF.xApplication.query.StatementDesigner.Main = new Class({
"styles": this.css.designerContentNode
}).inject(this.designerNode);
// this.designerStatementArea = new Element("div", {
// "styles": this.css.designerStatementArea
// }).inject(this.designerContentNode);
//
// this.designerStatementPercent = 0.6;
// this.designerContentResizeNode = new Element("div", {
// "styles": this.css.designerContentResizeNode
// }).inject(this.designerContentNode);
this.designerStatementArea = new Element("div", {
"styles": this.css.designerStatementArea
}).inject(this.designerContentNode);
this.propertyDomArea = this.designerStatementArea;
this.designerStatementPercent = 0.6;
this.designerContentResizeNode = new Element("div", {
"styles": this.css.designerContentResizeNode
}).inject(this.designerContentNode);
this.designerContentArea = new Element("div", {
"styles": this.css.designerContentArea
}).inject(this.designerContentNode);
this.propertyContentArea = this.designerContentArea;
//this.loadDesignerStatementResize();
this.loadDesignerStatementResize();
//this.setPropertyContent();
this.designerNode.addEvent("keydown", function(e){e.stopPropagation();});
},
......@@ -348,37 +350,37 @@ MWF.xApplication.query.StatementDesigner.Main = new Class({
}.bind(this)
});
},
// loadDesignerStatementResize: function(){
// this.designerContentResize = new Drag(this.designerContentResizeNode, {
// "snap": 1,
// "onStart": function(el, e){
// var x = (Browser.name=="firefox") ? e.event.clientX : e.event.x;
// var y = (Browser.name=="firefox") ? e.event.clientY : e.event.y;
// el.store("position", {"x": x, "y": y});
//
// var size = this.designerStatementArea.getSize();
// el.store("initialHeight", size.y);
// }.bind(this),
// "onDrag": function(el, e){
// var size = this.designerContentNode.getSize();
//
// // var x = e.event.x;
// var y = (Browser.name=="firefox") ? e.event.clientY : e.event.y;
// var position = el.retrieve("position");
// var dy = y.toFloat()-position.y.toFloat();
//
// var initialHeight = el.retrieve("initialHeight").toFloat();
// var height = initialHeight+dy;
// if (height<40) height = 40;
// if (height> size.y-40) height = size.y-40;
//
// this.designerStatementPercent = height/size.y;
//
// this.setDesignerStatementResize();
//
// }.bind(this)
// });
// },
loadDesignerStatementResize: function(){
this.designerContentResize = new Drag(this.designerContentResizeNode, {
"snap": 1,
"onStart": function(el, e){
var x = (Browser.name=="firefox") ? e.event.clientX : e.event.x;
var y = (Browser.name=="firefox") ? e.event.clientY : e.event.y;
el.store("position", {"x": x, "y": y});
var size = this.designerStatementArea.getSize();
el.store("initialHeight", size.y);
}.bind(this),
"onDrag": function(el, e){
var size = this.designerContentNode.getSize();
// var x = e.event.x;
var y = (Browser.name=="firefox") ? e.event.clientY : e.event.y;
var position = el.retrieve("position");
var dy = y.toFloat()-position.y.toFloat();
var initialHeight = el.retrieve("initialHeight").toFloat();
var height = initialHeight+dy;
if (height<40) height = 40;
if (height> size.y-40) height = size.y-40;
this.designerStatementPercent = height/size.y;
this.setDesignerStatementResize();
}.bind(this)
});
},
setDesignerStatementResize: function(){
var size = this.designerContentNode.getSize();
//var resizeNodeSize = this.designerContentResizeNode.getSize();
......@@ -495,9 +497,9 @@ MWF.xApplication.query.StatementDesigner.Main = new Class({
}.bind(this));
},
preview : function(){
this.statement.preview();
},
saveStatement: function(){
this.statement.save(function(){
......
MWF.xApplication.query.StatementDesigner.LP = {
MWF.xApplication.query = MWF.xApplication.query || {};
MWF.xApplication.query.StatementDesigner = MWF.xApplication.query.StatementDesigner || {};
if(!MWF.APPDSMD)MWF.APPDSMD = MWF.xApplication.query.StatementDesigner;
MWF.xApplication.query.ViewDesigner = MWF.xApplication.query.ViewDesigner || {};
MWF.xDesktop.requireApp("query.ViewDesigner", "lp."+MWF.language, null, false);
MWF.xApplication.query.StatementDesigner.LP = Object.merge( MWF.xApplication.query.ViewDesigner.LP, {
"title": "查询设计",
"newStatement": "新建查询配置",
"unCategory": "未分类",
......@@ -12,6 +17,11 @@ MWF.xApplication.query.StatementDesigner.LP = {
"save_success": "查询配置保存成功!",
"inputStatementName": "请输入查询配置名称",
"inputStatementData": "请先编辑JPQL查询语句",
"saveStatementNotice" : "请先保存!",
"noViewNotice" : "未创建视图,请先创建视图!",
"previewNotSelectStatementNotice" : "只有语句类型为‘Select’才可以预览",
"field" : "字段",
"fileldSelectNote" : "-选择后在语句中插入字段-",
"statementFormat": "如何创建语句:",
"statementJpql": "直接编写JPQL创建语句",
......@@ -20,32 +30,6 @@ MWF.xApplication.query.StatementDesigner.LP = {
"statementCategory": "访问对象类型",
"scriptTitle": "通过脚本创建JPQL",
"item": "项目",
"type": "类型",
"value": "",
"stat": "统计",
"unnamed": "无标题列",
"newColumn": "新建列",
"close": "关闭",
"id": "标识",
"name": "名称",
"alias": "别名",
"description": "描述",
"application" : "数据应用",
"copyStat" : "拷贝统计",
"newStatName" : "新统计名称",
"copy" : "副本",
"ok" : "确定",
"cancel" : "取消",
"view" : "视图",
"clumn": "",
"addLine": "添加数据",
"jpqlType": "JPQL类型",
"jpqlFromResult": "查询开始条目",
"jpqlMaxResult": "最大返回结果",
......@@ -54,29 +38,9 @@ MWF.xApplication.query.StatementDesigner.LP = {
"jpqlRunSuccess": "JPQL执行成功",
"newLineSuccess": "插入数据成功",
"newLineJsonError": "插入数据错误,数据格式有误",
"queryStatement": "查询语句",
"countStatement": "总数语句",
"action": {
"move": "移动",
"delete": "删除",
"add": "添加"
},
"errorName": "列名只允许使用字母数字和下划线组合,并且不能以数字开头。",
"errorFieldList": "请先创建数据列。",
"duplicateName": "同名的列已存在",
"inputName": "请输入列名称",
"inputTableName": "请输入数据表名称",
"deleteColumnTitle": "删除列确认",
"deleteColumn": "是否确定删除当前列?",
"statusBuildTitle": "发布数据表",
"statusBuildInfor": "当前数据表将会发布到编译环境,如果您删除了列或修改了列的类型,您可能需要手工删除数据库表。您确定要执行此操作吗?",
"statusDraftTitle": "取消编译数据表",
"statusDraftInfor": "<span style='color: #FF0000;'>注意:您正在将此数据表从编译环境中删除,下次编译会删除数据库表。</span><br><br>您确定要执行此操作吗?",
"statusDraftInforAgain": "<span style='color: #FF0000;'>注意:您正在将此数据表从编译环境中删除,您将无法使用当前数据表,这可能会影响到已使用此数据表的相关应用。</span><br><br>请再次确认要执行此操作吗?",
"statusBuild_success": "当前数据表已经发布到编译环境,您需要运行“全部编译”使其生效",
"statusDraft_success": "当前数据表已从编译环境取消,下次“全部编译”时会删除从数据库中删除表",
"buildAllViewTitle": "编译所有数据表",
"buildAllViewInfor": "即将编译所有数据表,包括所有数据应用中的数据表,编译后您可能需要重启服务器后才能使用此数据表。您确定要执行此操作吗?",
"buildAllView_success": "已编译所有数据表,新的更改需要您重启服务器后生效",
"tableHelp": "数据表能够在系统数据库中自动创建真实表,并生成java实体对象,您可以使用JPQL操作数据表。创建数据表需要以下步骤:<br><br>1、创建数据表,并创建每一列;<br>2、点击工具栏按钮,将数据表发布到编译状态;<br>3、点击工具栏按钮,执行“编译所有数据表”操作<br>4、重启服务器,数据表就可以使用了。"
};
\ No newline at end of file
"mastInputParameter" : "请输入参数",
"pathExecption" : "路径的写法是\"表别名.字段名\",格式不正确"
});
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册