From 40984718ca5ff63b30a5a36eb9a0c9bd73473cd3 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Nov 2020 16:08:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E8=A7=86=E5=9B=BE=E4=B8=AD?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=85=A8=E9=80=89=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Module/Statement/statement.html | 4 +- .../StatementSelector/StatementSelector.html | 2 +- .../x_component_process_Xform/Statement.js | 3 +- .../StatementSelector.js | 93 ++++++++++--------- .../x_component_query_Query/Statement.js | 64 ++++++++++--- .../$Statement/view.html | 37 +++++++- 6 files changed, 136 insertions(+), 67 deletions(-) diff --git a/o2web/source/x_component_process_FormDesigner/Module/Statement/statement.html b/o2web/source/x_component_process_FormDesigner/Module/Statement/statement.html index a43590d395..e12abe07e7 100644 --- a/o2web/source/x_component_process_FormDesigner/Module/Statement/statement.html +++ b/o2web/source/x_component_process_FormDesigner/Module/Statement/statement.html @@ -64,7 +64,7 @@ 选择文件 - @@ -166,6 +166,8 @@
+
diff --git a/o2web/source/x_component_process_FormDesigner/Module/StatementSelector/StatementSelector.html b/o2web/source/x_component_process_FormDesigner/Module/StatementSelector/StatementSelector.html index acd8a49cc7..0595312c71 100644 --- a/o2web/source/x_component_process_FormDesigner/Module/StatementSelector/StatementSelector.html +++ b/o2web/source/x_component_process_FormDesigner/Module/StatementSelector/StatementSelector.html @@ -108,6 +108,7 @@
+
@@ -194,7 +195,6 @@
自定义过滤数据
-
diff --git a/o2web/source/x_component_process_Xform/Statement.js b/o2web/source/x_component_process_Xform/Statement.js index 504e2ad1c2..35545caca8 100644 --- a/o2web/source/x_component_process_Xform/Statement.js +++ b/o2web/source/x_component_process_Xform/Statement.js @@ -56,7 +56,8 @@ MWF.xApplication.process.Xform.Statement = MWF.APPStatement = new Class({ "isExpand": this.json.isExpand || "no", "showActionbar" : this.json.actionbar === "show", "filter": filter, - "defaultSelectedScript" : this.json.defaultSelectedScript ? this.json.defaultSelectedScript.code : null + "defaultSelectedScript" : this.json.defaultSelectedScript ? this.json.defaultSelectedScript.code : null, + "selectedAbleScript" : this.json.selectedAbleScript ? this.json.selectedAbleScript.code : null }; //MWF.xDesktop.requireApp("query.Query", "Viewer", function(){ diff --git a/o2web/source/x_component_process_Xform/StatementSelector.js b/o2web/source/x_component_process_Xform/StatementSelector.js index 1a0c0aae21..5b035cf392 100644 --- a/o2web/source/x_component_process_Xform/StatementSelector.js +++ b/o2web/source/x_component_process_Xform/StatementSelector.js @@ -3,6 +3,50 @@ 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, + 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 -1 ){ - var user = layout.user; + }else{ + //var user = layout.user; switch ( f.value ) { case "@person": - value = user.distinguishedName; + case "person": + //value = user.distinguishedName; break; case "@identityList": - value = user.identityList.map( function (d) { - return d.distinguishedName; - }); + case "identityList": + //value = user.identityList.map( function (d) { + // return d.distinguishedName; + //}); break; case "@unitList": - o2.Actions.load("x_organization_assemble_express").UnitAction.listWithPerson({ "personList" : [user.distinguishedName] }, function (json) { - value = json.unitList; - }, null, false); + case "unitList": + //o2.Actions.load("x_organization_assemble_express").UnitAction.listWithPerson({ "personList" : [user.distinguishedName] }, function (json) { + // value = json.unitList; + //}, null, false); break; case "@unitAllList": - o2.Actions.load("x_organization_assemble_express").UnitAction.listWithIdentitySupNested({ "personList" : [user.distinguishedName] }, function (json) { - value = json.unitList; - }, null, false); + case "unitAllList": + //o2.Actions.load("x_organization_assemble_express").UnitAction.listWithIdentitySupNested({ "personList" : [user.distinguishedName] }, function (json) { + // value = json.unitList; + //}, null, false); break; case "@year": value = (new Date().getFullYear()).toString(); @@ -294,6 +298,7 @@ MWF.xApplication.query.Query.Statement = MWF.QStatement = new Class({ } this.gridJson = json.data; + this.setSelectedableFlag(); this.fireEvent("postLoadPageData"); @@ -331,6 +336,16 @@ MWF.xApplication.query.Query.Statement = MWF.QStatement = new Class({ }, loadData: function(){ + if( this.getSelectFlag() === "multi" && this.viewJson.allowSelectAll ) { + if(this.selectTitleCell && this.selectTitleCell.retrieve("selectAllLoaded")){ + this.setUnSelectAllStyle(); + }else{ + this.createSelectAllNode(); + } + }else if(this.selectAllNode){ + this.clearSelectAllStyle(); + } + if (this.gridJson.length){ // if( !this.options.paging ){ this.gridJson.each(function(line, i){ @@ -375,7 +390,7 @@ MWF.xApplication.query.Query.Statement = MWF.QStatement = new Class({ "path": entry.path, "value": key, "formatType": entry.formatType, - "logic": "and", + "logic": "or", "comparison": "like" }; filterData.push(d); @@ -387,7 +402,7 @@ MWF.xApplication.query.Query.Statement = MWF.QStatement = new Class({ "path": entry.path, "value": v, "formatType": entry.formatType, - "logic": "and", + "logic": "or", "comparison": "like" }; filterData.push(d); @@ -483,11 +498,12 @@ MWF.xApplication.query.Query.Statement = MWF.QStatement = new Class({ MWF.xApplication.query.Query.Statement.Item = new Class({ Extends : MWF.xApplication.query.Query.Viewer.Item, - initialize: function(view, data, prev, i){ + initialize: function(view, data, prev, i, category){ this.view = view; this.data = data; this.css = this.view.css; this.isSelected = false; + this.category = category; this.prev = prev; this.idx = i; this.clazzType = "item"; @@ -513,6 +529,24 @@ MWF.xApplication.query.Query.Statement.Item = new Class({ this.selectTd = new Element("td", { "styles": viewContentTdNode }).inject(this.node); this.selectTd.setStyles({"cursor": "pointer"}); if (this.view.json.itemStyles) this.selectTd.setStyles(this.view.json.itemStyles); + + //var selectFlag = this.view.json.select || this.view.viewJson.select || "none"; + var selectFlag = this.view.getSelectFlag(); + if ( this.data.$selectedEnable && ["multi","single"].contains(selectFlag) && this.view.viewJson.selectBoxShow==="always") { + var viewStyles = this.view.viewJson.viewStyles; + if (viewStyles) { + if (selectFlag === "single") { + this.selectTd.setStyles(viewStyles["radioNode"]); + } else { + this.selectTd.setStyles(viewStyles["checkboxNode"]); + } + } else { + var iconName = "checkbox"; + if (selectFlag === "single") iconName = "radiobox"; + this.selectTd.setStyles({"background": "url(" + "../x_component_query_Query/$Viewer/default/icon/" + iconName + ".png) center center no-repeat"}); + } + } + if( this.view.isSelectTdHidden() ){ this.selectTd.hide(); } diff --git a/o2web/source/x_component_query_StatementDesigner/$Statement/view.html b/o2web/source/x_component_query_StatementDesigner/$Statement/view.html index a51ee70ccf..00e4c2277a 100644 --- a/o2web/source/x_component_query_StatementDesigner/$Statement/view.html +++ b/o2web/source/x_component_query_StatementDesigner/$Statement/view.html @@ -60,9 +60,38 @@ 选择: - 无 - 单选 - 多选 + 无 + 单选 + 多选 + + + + 选择框显示: + + 一直显示 + 鼠标经过时 + + + + 允许全选: + + 是 + 否 @@ -85,6 +114,8 @@
+
-- GitLab