提交 560ab8e7 编写于 作者: U unknown

区段合并

上级 12d0cf1b
......@@ -158,6 +158,7 @@
<div class="MWFMaplist" name="actionStyles" collapse="true" title="{{$.lp.actionCellStyles}}"></div>
<div class="MWFMaplist" name="editStyles" collapse="true" title="{{$.lp.editCellStyles}}"></div>
<div class="MWFMaplist" name="amountStyles" collapse="true" title="{{$.lp.amountCellStyle}}"></div>
<div class="MWFMaplist" name="sectionAmountStyles" collapse="true" title="{{$.lp.sectionAmountCellStyle}}"></div>
<div class="MWFMaplist" name="itemTitleStyles" collapse="true" title="{{$.lp.itemTitleStyle}}"></div>
</div>
<div title="{{$.lp.section}}" class="MWFTab">
......
......@@ -343,6 +343,13 @@
"text-align": "center",
"background-color": "#F1F4F9"
},
"sectionAmountStyles": {
"font-weight": "bold",
"height": "30px",
"line-height": "30px",
"text-align": "center",
"background-color": "#fafafa"
},
"itemTitleStyles": {
"height": "40px",
"background-color": "#ffffff",
......
......@@ -318,6 +318,13 @@
"text-align": "center",
"background-color": "#f0f0f0"
},
"sectionAmountStyles": {
"font-weight": "bold",
"height": "30px",
"line-height": "30px",
"text-align": "center",
"background-color": "#fafafa"
},
"itemTitleStyles": {
"height": "40px",
"background-color": "#ffffff",
......
......@@ -326,6 +326,13 @@
"text-align": "center",
"background-color": "#f0f0f0"
},
"sectionAmountStyles": {
"font-weight": "bold",
"height": "30px",
"line-height": "30px",
"text-align": "center",
"background-color": "#fafafa"
},
"itemTitleStyles": {
"height": "40px",
"background-color": "#ffffff",
......
......@@ -332,6 +332,15 @@
"border-right": "1px solid #666666",
"border-bottom": "1px solid #666666"
},
"sectionAmountStyles": {
"font-weight": "bold",
"height": "30px",
"line-height": "30px",
"text-align": "center",
"background-color": "#fafafa",
"border-right": "1px solid #666666",
"border-bottom": "1px solid #666666"
},
"itemTitleStyles": {
"height": "40px",
"background-color": "#ffffff",
......
......@@ -310,6 +310,14 @@
"background-color": "#ffffff",
"border-bottom": "1px solid #cccccc"
},
"sectionAmountStyles": {
"font-weight": "bold",
"height": "36px",
"line-height": "36px",
"text-align": "right",
"background-color": "#ffffff",
"border-bottom": "1px solid #cccccc"
},
"itemTitleStyles": {
"height": "40px",
"background-color": "#ffffff",
......
......@@ -401,6 +401,16 @@
"border-bottom" : "1px solid #cfd9df",
"text-align": "right"
},
"sectionAmountStyles": {
"background-color": "#FFFFFF",
"color": "#000",
"font-size": "16px",
"border-top": "0px",
"border-left": "0px",
"border-right" : "0px",
"border-bottom" : "1px solid #cfd9df",
"text-align": "right"
},
"itemTitleStyles": {
"height": "16px",
"overflow" : "hidden",
......
......@@ -141,6 +141,7 @@
"actionStyles": {},
"editStyles": {},
"amountStyles": {},
"sectionAmountStyles": {},
"itemTitleStyles": {},
"importActionStyles" : {},
"exportActionStyles" : {},
......
......@@ -351,6 +351,16 @@
"border-right": "1px solid #fd1113",
"border-bottom": "1px solid #fd1113"
},
"sectionAmountStyles": {
"border-top": "1px solid #ccc",
"font-weight": "bold",
"height": "30px",
"line-height": "30px",
"text-align": "center",
"background-color": "#fafafa",
"border-right": "1px solid #fd1113",
"border-bottom": "1px solid #fd1113"
},
"itemTitleStyles": {
"height": "40px",
"background-color": "#ffffff",
......
......@@ -351,6 +351,16 @@
"border-right": "1px solid #fd1113",
"border-bottom": "1px solid #fd1113"
},
"sectionAmountStyles": {
"border-top": "1px solid #ccc",
"font-weight": "bold",
"height": "30px",
"line-height": "30px",
"text-align": "center",
"background-color": "#fafafa",
"border-right": "1px solid #fd1113",
"border-bottom": "1px solid #fd1113"
},
"itemTitleStyles": {
"height": "40px",
"background-color": "#ffffff",
......
......@@ -319,6 +319,14 @@
"text-align": "center",
"background-color": "#f0f0f0"
},
"sectionAmountStyles": {
"border-top": "1px solid #ccc",
"font-weight": "bold",
"height": "30px",
"line-height": "30px",
"text-align": "center",
"background-color": "#fafafa"
},
"itemTitleStyles": {
"height": "40px",
"background-color": "#ffffff",
......
......@@ -470,6 +470,32 @@ MWF.xApplication.process.FormDesigner.LP = {
"activityId": "Activity Id",
"splitValue": "Split Value",
"enableSectionMerge": "Section Merge",
"showSectionKey": "Show Section Value",
"editByMerge": "Merge edit (delete section key)",
"sectionMergeSortScript": "Sorting Script",
"sectionNodeStyles": "Section entry styles",
"sectionKeystyles": "Section Value Styles",
"sectionContentStyles": "Section Content Styles",
"mergeDisplay": "Read only",
"editCurrentSection": "Edit (allows editing the current section)",
"mergeEdit": "Edit (merge data after deleting section key)",
"sectionKey": "section value",
"sectionKeyScript": "Section Value Script",
"textValue1": "Text Value",
"mergeType": "Merge Type",
"amountValue": "Total Value",
"averageValue": "Average",
"sectionMergeEditScript": "Merge Data Script",
"sectionMergeReadHtmlScript": "Displayed html script",
"sectionMergeReadDataScript": "Data Script",
"htmlScript": "html script",
"dataScript": "Data Script",
"bySection": "By Section",
"byModule": "By Component",
"totalRow": "Total Row",
"sectionAmountCellStyle": "section total cell style",
"decimal": "Decimal",
"showCard": "Show Card",
......
......@@ -477,6 +477,7 @@ MWF.xApplication.process.FormDesigner.LP = {
"sectionKeystyles": "区段值样式",
"sectionContentStyles": "区段内容样式",
"mergeDisplay": "只读",
"editCurrentSection": "编辑(允许编辑当前区段)",
"mergeEdit": "编辑(删除区段值后合并数据)",
"sectionKey": "区段值",
"sectionKeyScript": "区段值脚本",
......@@ -484,7 +485,6 @@ MWF.xApplication.process.FormDesigner.LP = {
"mergeType": "合并方式",
"amountValue": "合计数值",
"averageValue": "平均值",
"separatelyDisplay": "分开显示",
"sectionMergeEditScript": "合并数据脚本",
"sectionMergeReadHtmlScript": "展现的html脚本",
"sectionMergeReadDataScript": "数据脚本",
......@@ -493,6 +493,7 @@ MWF.xApplication.process.FormDesigner.LP = {
"bySection": "按区段",
"byModule": "按组件",
"totalRow": "总计行",
"sectionAmountCellStyle": "区段总计单元格样式",
"decimal": "小数点",
......
......@@ -31,6 +31,7 @@ MWF.xApplication.process.FormDesigner.widget.SectionMerger = new Class({
this.node.set("html", this.getHtml());
this.readArea = this.node.getElement(".sectionMergeReadArea");
this.readTypeArea = this.node.getElement(".sectionMergeReadTypeArea");
this.readDefaultArea = this.node.getElement(".sectionMergeReadDefaultArea");
this.readHtmlScriptArea = this.node.getElement(".sectionMergeReadHtmlScriptArea");
this.readDataScriptArea = this.node.getElement(".sectionMergeReadDataScriptArea");
......@@ -76,8 +77,26 @@ MWF.xApplication.process.FormDesigner.widget.SectionMerger = new Class({
style : "",
hasColon : true,
itemTemplate: {
sectionMerge: { name: this.data.pid + "sectionMerge",
type : "radio", selectValue: ["none", "read", "edit"], selectText: [lp.none, lp.mergeDisplay, lp.mergeEdit], event: {
sectionMerge: { name: this.data.pid + "sectionMerge", type : "radio",
selectValue: function(){
switch (moduleName) {
case "datatable":
case "datatemplate":
return ["none", "read", "editSection", "edit"];
default:
return ["none", "read", "edit"]
}
},
selectText: function () {
switch (moduleName) {
case "datatable":
case "datatemplate":
return [lp.none, lp.mergeDisplay, lp.editCurrentSection, lp.mergeEdit];
default:
return [lp.none, lp.mergeDisplay, lp.mergeEdit]
}
},
event: {
change: function (it, ev) {
_self.property.setRadioValue("sectionMerge", this);
_self.checkShow()
......@@ -143,7 +162,7 @@ MWF.xApplication.process.FormDesigner.widget.SectionMerger = new Class({
}
}},
sectionKey: { name: this.data.pid + "sectionKey",
type : "radio", selectValue: ["person", "unit", "textValue", "script"], selectText: [lp.person, lp.unit, lp.textValue1, lp.script], event: {
type : "radio", selectValue: ["person", "unit", "activity", "splitValue", "script"], selectText: [lp.handler, lp.handlerUnit, lp.activityId, lp.splitValue, lp.script], event: {
change: function (it) {
_self.property.setRadioValue("sectionKey", this);
_self.checkShow()
......@@ -178,13 +197,16 @@ MWF.xApplication.process.FormDesigner.widget.SectionMerger = new Class({
var _self = this;
var showCondition = {
"readArea": function() {
return d.sectionMerge==='read'
return d.sectionMerge==='read' || d.sectionMerge==='editSection';
},
"readTypeArea": function(){
return d.sectionMerge==='read';
},
"readDefaultArea": function () {
return d.mergeTypeRead==='default' || !d.mergeTypeRead;
return d.mergeTypeRead==='default' || !d.mergeTypeRead || d.sectionMerge==='editSection';
},
"readWithSectionKeyArea": function () {
return !!d.showSectionKey;
return !!d.showSectionKey || d.sectionMerge==='editSection';
},
"sectionKeyScriptArea": function () {
return d.sectionKey === "script";
......@@ -212,7 +234,8 @@ MWF.xApplication.process.FormDesigner.widget.SectionMerger = new Class({
},
"sortScriptArea": function () {
return ( d.sectionMerge==='read' && d.mergeTypeRead === "default" ) ||
(d.sectionMerge==='edit' && d.mergeTypeEdit === "default")
(d.sectionMerge==='edit' && d.mergeTypeEdit === "default") ||
d.sectionMerge==='editSection'
},
"mergeTypeEditTable" : function () {
return _self.hasEditDefaultModuleList.contains( _self.module.moduleName ) ||
......@@ -235,12 +258,14 @@ MWF.xApplication.process.FormDesigner.widget.SectionMerger = new Class({
' </tr>' +
'</table>' +
'<div class="sectionMergeReadArea">' +
' <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">' +
' <tr>' +
' <td class="editTableTitle">'+this.lp.mergeType+':</td>' +
' <td class="editTableValue" item="mergeTypeRead"></td>' +
' </tr>' +
' </table>' +
' <div class="sectionMergeReadTypeArea">' +
' <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">' +
' <tr>' +
' <td class="editTableTitle">'+this.lp.mergeType+':</td>' +
' <td class="editTableValue" item="mergeTypeRead"></td>' +
' </tr>' +
' </table>' +
' </div>' +
' <div class="sectionMergeReadDefaultArea">' +
' <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">' +
' <tr>' +
......
......@@ -381,6 +381,13 @@
"overflow": "hidden",
"background": "#e1e6f3"
},
"datagridTotalTr_section": {
"height": "20px",
"cursor": "pointer",
"line-height": "20px",
"overflow": "hidden",
"background": "#fafafa"
},
"datagridTotalTd": {
"font-weight": "bold"
},
......
......@@ -213,7 +213,8 @@ MWF.xApplication.process.Xform.$Module = MWF.APP$Module = new Class(
case "unit":
callback( data.key.split("@")[0] );
break;
case "textValue":
case "activity":
case "splitValue":
callback( data.key );
break;
case "script":
......
......@@ -542,6 +542,9 @@ MWF.xApplication.process.Xform.DatatablePC = new Class(
},
_loadTotalTr: function(){
if( !this.totalFlag )return;
if( this.isShowSectionKey() && !(this.json.totalRowBySection || [] ).contains("module")){
return;
}
this.totalTr = new Element("tr.mwf_totaltr", {"styles": this.form.css.datagridTotalTr}).inject(this.tBody||this.table);
var ths = this.titleTr.getElements("th");
......@@ -1649,7 +1652,7 @@ MWF.xApplication.process.Xform.DatatablePC.SectionLine = new Class({
},
load: function () {
this.loadSectionKeyNode();
if( ( this.datatable.totalFlag && this.datatable.json.totalRowBySection || [] ).contains("section") ){
if( this.datatable.totalFlag && ( this.datatable.json.totalRowBySection || [] ).contains("section") ){
this._loadTotalTr();
}
if( this.data.data && this.data.data.data ){
......@@ -1660,6 +1663,9 @@ MWF.xApplication.process.Xform.DatatablePC.SectionLine = new Class({
this.lineList.push(line);
this.datatable.lineList.push(line);
}.bind(this))
if( this.datatable.totalFlag && ( this.datatable.json.totalRowBySection || [] ).contains("section") ){
this._loadTotal();
}
}
},
_loadLine: function(container, data, index, isEdited, isNew){
......@@ -1692,12 +1698,13 @@ MWF.xApplication.process.Xform.DatatablePC.SectionLine = new Class({
},
loadSectionKeyNode: function () {
var sectionKeyStyles = this.datatable._parseStyles(this.datatable.json.sectionKeyStyles);
var td = new Element("td", {
colspan: this.datatable.columnCount
}).inject( this.sectionKeyNode );
var keyNode = new Element("div.mwf_sectionkey", {
var keyNode = new Element("td.mwf_sectionkey", {
colspan: this.datatable.columnCount,
styles : sectionKeyStyles
}).inject(td);
}).inject( this.sectionKeyNode );
// var keyNode = new Element("div.mwf_sectionkey", {
// styles : sectionKeyStyles
// }).inject(td);
debugger;
this.datatable.getSectionKeyWithMerge( this.data, function (key) {
if( o2.typeOf(key) === "string" ){
......@@ -1710,13 +1717,13 @@ MWF.xApplication.process.Xform.DatatablePC.SectionLine = new Class({
}.bind(this));
},
_loadTotalTr: function(){
this.totalTr = new Element("tr.mwf_totaltr", {"styles": this.form.css.datagridTotalTr}).inject(this.sectionKeyNode, "after");
this.totalTr = new Element("tr.mwf_totaltr", {"styles": this.form.css.datagridTotalTr_section}).inject(this.sectionKeyNode, "after");
var ths = this.datatable.titleTr.getElements("th");
//datatable$Title Module
ths.each(function(th, index){
var td = new Element("td", {"text": "", "styles": this.form.css.datagridTotalTd}).inject(this.totalTr);
if (this.datatable.json.amountStyles) td.setStyles(this.datatable.json.amountStyles);
if (this.datatable.json.sectionAmountStyles) td.setStyles(this.datatable.json.sectionAmountStyles);
var json = this.form._getDomjson(th);
if (json){
......@@ -1754,10 +1761,11 @@ MWF.xApplication.process.Xform.DatatablePC.SectionLine = new Class({
}.bind(this));
},
_loadTotal: function(){
debugger;
var totalData = {};
if (!this.datatable.totalFlag)return totalData;
if (!this.totalTr)this._loadTotalTr();
var data = this.data;
var data = this.data.data;
this.totalColumns.each(function(column, index){
var json = column.moduleJson;
if(!json)return;
......@@ -1911,7 +1919,6 @@ MWF.xApplication.process.Xform.DatatablePC.Line = new Class({
var hasData = this.data.hasOwnProperty(templateJsonId);
debugger;
var module = this.form._loadModule(json, node, function () {
if( _self.options.isMergeRead ){
this.field = false; //不希望保存数据
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册