提交 62e965fc 编写于 作者: 蔡祥熠

Merge branch 'fix/datatemplate.modify' into 'wrdp'

Merge of fix/datatemplate.modify 数据模板的导入导出字段配置增加导入功能 to wrdp

See merge request o2oa/o2oa!4642
......@@ -7,8 +7,8 @@ MWF.xApplication.cms.FormDesigner.Module.Form = MWF.CMSFCForm = new Class({
"style": "default",
"propertyPath": "../x_component_cms_FormDesigner/Module/Form/form.html",
"mode": "PC",
"fields": ["Calendar", "Checkbox", "Datagrid", "Datagrid$Title", "Datagrid$Data", "Datatable", "Datatable$Title", "Datatable$Data", "Datatemplate", "Htmleditor", "Number", "Office",
"Orgfield", "Personfield", "Readerfield", "Authorfield", "Org", "Reader", "Author", "Radio", "Select", "Textarea", "Textfield"],
"fields": ["Calendar", "Checkbox", "Datagrid", "Datagrid$Title", "Datagrid$Data", "Datatable", "Datatable$Title", "Datatable$Data",
"Datatemplate", "Htmleditor", "Number", "Office", "Orgfield", "Personfield", "Readerfield", "Authorfield", "Org", "Reader", "Author", "Radio", "Select", "Textarea", "Textfield", "Address","Combox"],
"injectActions" : [
{
"name" : "top",
......
......@@ -312,6 +312,7 @@ MWF.APPPD.LP = {
"action": "Action",
"moveup": "Move to the previous line",
"deleteRow": "Delete Row",
"insertRow": "Insert Row"
"insertRow": "Insert Row",
"importFromForm": "Import field configuration from the interface"
}
};
......@@ -274,6 +274,7 @@ MWF.APPPD.LP = {
"action": "操作",
"moveup": "移动到上一行",
"deleteRow": "删除行",
"insertRow": "插入行"
"insertRow": "插入行",
"importFromForm": "从界面上中导入字段配置"
}
};
......@@ -176,6 +176,35 @@ MWF.xApplication.process.FormDesigner.Module.Datatemplate = MWF.FCDatatemplate =
this.form.json.moduleList[newElementJson.id] = newElementJson;
th.set("id", newElementJson.id);
}.bind(this));
},
_getDirectSubModuleJson: function(node, moduleJsons){
var subNode = node.getFirst();
while (subNode){
var module = subNode.retrieve("module");
var flag = module && !["datatable","datagrid","datatemplate"].contains(module.moduleName);
if (flag) {
moduleJsons[module.json.id] = Object.clone(module.json);
}
if( !module || flag){
this._getDirectSubModuleJson(subNode, moduleJsons);
}
subNode = subNode.getNext();
}
},
getExpImpFieldJson: function () {
var o = {};
var list = [];
this._getDirectSubModuleJson(this.node, o);
for( var key in o ){
var json = o[key];
if(this.form.options.fields.contains(json.type) && !["Office"].contains(json.type)){
list.push({
"field": json.id,
"title": json.name || ""
});
}
}
return list;
}
});
......@@ -157,8 +157,7 @@
</tr>
</table>
<div class="MWFFormulaArea" name="excelName" title="{{$.lp.exportFileName}}"></div>
<div style="height:24px; text-align: center; line-height: 24px; background-color: #EEE; border-top: 1px solid #999;">{{$.lp.importExporConfig}}</div>
<div class="MWFFieldConfigArea" name="excelFieldConfig"></div>
<div class="MWFFieldConfigArea" name="excelFieldConfig" data-title="{{$.lp.importExporConfig}}"></div>
<div style="height:24px; text-align: center; line-height: 24px; background-color: #EEE; border-top: 1px solid #999;">{{$.lp.validationPopFormConfig}}</div>
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
<tr>
......
......@@ -7,7 +7,8 @@ MWF.xApplication.process.FormDesigner.Module.Form = MWF.FCForm = new Class({
"style": "default",
"propertyPath": "../x_component_process_FormDesigner/Module/Form/form.html",
"mode": "PC",
"fields": ["Calendar", "Checkbox", "Datagrid", "Datagrid$Title", "Datagrid$Data", "Datatable", "Datatable$Title", "Datatable$Data", "Datatemplate","Htmleditor", "Number", "Office", "Orgfield", "org", "Personfield", "Radio", "Select", "Textarea", "Textfield"],
"fields": ["Calendar", "Checkbox", "Datagrid", "Datagrid$Title", "Datagrid$Data", "Datatable", "Datatable$Title", "Datatable$Data",
"Datatemplate","Htmleditor", "Number", "Office", "Orgfield","Org", "org", "Personfield", "Radio", "Select", "Textarea", "Textfield", "Address","Combox"],
"injectActions" : [
{
"name" : "top",
......
......@@ -653,6 +653,29 @@ MWF.xApplication.process.FormDesigner.Property = MWF.FCProperty = new Class({
}
MWF.xDesktop.requireApp("process.FormDesigner", "widget.FiledConfigurator", function(){
var filedConfigurator = new MWF.xApplication.process.FormDesigner.widget.FiledConfigurator(node, this.designer, {
"title": node.get("data-title"),
"hasRefresh": true,
"onRefresh": function () {
debugger;
var _self = this;
if( typeOf(this.data[name]) === "array" && this.data[name].length > 0 ){
//this.form.designer.lp.selectIcon
this.form.designer.confirm( "", new Event(), "导入字段确认", "本操作从数据模板的内部组件获取字段。如果执行本操作,之前配置的字段会被替换,是否继续?", 300, 200, function(){
if( !_self.module.getExpImpFieldJson )return;
filedConfigurator.data = _self.module.getExpImpFieldJson();
filedConfigurator.reloadContent();
_self.data[name] = filedConfigurator.data;
this.close();
}, function(){
this.close();
})
}else{
if( !_self.module.getExpImpFieldJson )return;
filedConfigurator.data = _self.module.getExpImpFieldJson();
filedConfigurator.reloadContent();
_self.data[name] = filedConfigurator.data;
}
}.bind(this),
"onChange": function(){
debugger;
this.data[name] = filedConfigurator.getData();
......
......@@ -186,6 +186,9 @@ MWF.xApplication.process.FormDesigner.LP = {
"clearNoDomModuleTitle": "Clear the component configuration that is not in the HTML tree",
"clearNoDomModuleContent": "Do you want to clear the component configuration that is not in the HTML tree? It needs to be saved after clearing to take effect.",
"refreshDatatemplateImpExpTitle": "Import field confirmation",
"refreshDatatemplateImpExpContent": "This operation gets the fields from the internal components of the data template. If you perform this operation, the previously configured fields will be replaced. Do you want to continue?",
"filter": {
"and": "and",
"or": "Or",
......@@ -975,7 +978,8 @@ MWF.xApplication.process.FormDesigner.LP = {
"action": "Action",
"moveup": "Move to the previous line",
"deleteRow": "Delete Row",
"insertRow": "Insert Row"
"insertRow": "Insert Row",
"importFromForm": "Import field configuration from the interface"
}
};
......@@ -184,6 +184,9 @@ MWF.xApplication.process.FormDesigner.LP = {
"clearNoDomModuleTitle" : "清除未在HTML树中的组件配置",
"clearNoDomModuleContent" : "是否清除未在HTML树中的组件配置?清除后需要保存生效。",
"refreshDatatemplateImpExpTitle": "导入字段确认",
"refreshDatatemplateImpExpContent": "本操作从数据模板的内部组件获取字段。如果执行本操作,之前配置的字段会被替换,是否继续?",
"filter": {
"and": "并且",
"or": "或者",
......@@ -980,6 +983,7 @@ MWF.xApplication.process.FormDesigner.LP = {
"action": "操作",
"moveup": "移动到上一行",
"deleteRow": "删除行",
"insertRow": "插入行"
"insertRow": "插入行",
"importFromForm": "从界面上中导入字段配置"
}
};
......@@ -73,5 +73,21 @@
"margin": "5px auto",
"cursor": "pointer",
"text-align": "center"
},
"titleNode": {
"height":"24px",
"text-align": "center",
"line-height": "24px",
"background-color": "#EEE",
"border-top": "1px solid #999",
"position": "relative"
},
"refreshNode": {
"position": "absolute",
"height": "16px",
"width": "16px",
"top":"4px",
"right":"4px",
"background": "url('../x_component_process_FormDesigner/widget/$FiledConfigurator/default/icon/refresh.png')"
}
}
\ No newline at end of file
......@@ -2,7 +2,9 @@ MWF.xApplication.process.FormDesigner.widget.FiledConfigurator = new Class({
Implements: [Options, Events],
Extends: MWF.widget.Common,
options: {
"style": "default"
"style": "default",
"title": "",
"hasRefresh": false
},
initialize: function(node, designer, options, data){
......@@ -17,9 +19,28 @@ MWF.xApplication.process.FormDesigner.widget.FiledConfigurator = new Class({
this._loadCss();
},
load: function(){
this.loadTitle();
this.loadContent();
this.loadAddAction();
},
loadTitle: function(){
this.titleNode = new Element("div",{
"styles": this.css.titleNode,
"text": this.options.title,
}).inject(this.node);
this.refreshNode = new Element("div",{
"styles": this.css.refreshNode,
"title": this.app.lp.filedConfigurator.importFromForm
}).inject(this.titleNode);
this.refreshNode.addEvent("click", function () {
this.fireEvent("refresh")
}.bind(this))
},
loadContent: function(){
if(!this.contentNode)this.contentNode = new Element("div").inject(this.node);
this.items = [];
this.table = new Element("table").inject(this.node);
this.table = new Element("table").inject(this.contentNode);
var tr = new Element("tr").inject(this.table);
new Element("th", {"text": this.app.lp.filedConfigurator.sequence, "width":"10%"}).inject(tr);
......@@ -27,15 +48,6 @@ MWF.xApplication.process.FormDesigner.widget.FiledConfigurator = new Class({
new Element("th", {"text": this.app.lp.filedConfigurator.fieldId, "width":"35%"}).inject(tr);
var td = new Element("th", {"text": this.app.lp.filedConfigurator.action, "width":"20%"}).inject(tr);
this.addNewItemAction = new Element("div", {"styles": this.css.addNewItemAction, "text": "+"}).inject(this.node);
this.addNewItemAction.addEvent("click", function(){
this.addItem();
this.addNewItemAction.hide();
}.bind(this));
if(this.data.length > 0)this.addNewItemAction.hide();
// if( this.data.length === 0 ){
// this.addItem()
// }else{
......@@ -47,6 +59,24 @@ MWF.xApplication.process.FormDesigner.widget.FiledConfigurator = new Class({
// }
},
loadAddAction: function(){
this.addNewItemAction = new Element("div", {"styles": this.css.addNewItemAction, "text": "+"}).inject(this.node);
this.addNewItemAction.addEvent("click", function(){
this.addItem();
this.addNewItemAction.hide();
}.bind(this));
if(this.data.length > 0)this.addNewItemAction.hide();
},
reloadContent: function(){
this.contentNode.empty();
this.loadContent();
if(this.data.length > 0){
this.addNewItemAction.hide();
}else{
this.addNewItemAction.show();
}
},
getData: function(){
return this.data;
},
......@@ -61,8 +91,7 @@ MWF.xApplication.process.FormDesigner.widget.FiledConfigurator = new Class({
var index = beforeItem.index+1;
this.data.splice(index, 0, {"field": "", "title":""});
this.node.empty();
this.load();
this.reloadContent();
this.fireEvent("change");
// var item = new MWF.xApplication.process.FormDesigner.widget.FiledConfigurator.Item(this);
......@@ -92,8 +121,7 @@ MWF.xApplication.process.FormDesigner.widget.FiledConfigurator = new Class({
this.data[item.index-1] = this.data[item.index];
this.data[item.index] = beforeData;
this.node.empty();
this.load();
this.reloadContent();
this.fireEvent("change");
},
setItemsSequence: function () {
......
......@@ -108,8 +108,8 @@
<tr>
<td class="editTableTitle">{{$.lp.routeNow}}:</td>
<td class="editTableValue" id="text{$.id}sole" >
<input class="editTableRadio" name="soleDirect" text{($.soleDirect!==false)?'checked':''} type="radio" value="true"/>{{$.lp.yes}}
<input class="editTableRadio" name="soleDirect" text{($.soleDirect===false)?'checked':''} type="radio" value="false"/>{{$.lp.no}}
<input class="editTableRadio" name="soleDirect" text{($.soleDirect===true)?'checked':''} type="radio" value="true"/>{{$.lp.yes}}
<input class="editTableRadio" name="soleDirect" text{($.soleDirect!==true)?'checked':''} type="radio" value="false"/>{{$.lp.no}}
<br><div style="color: #999999">{{$.lp.routeNowInfo}}</div>
</td>
</tr>
......
......@@ -20,6 +20,15 @@
</div>
<div style="margin-top:10px">
<div style="padding: 5px;">
{{$.lp.valueScriptNote}}
<br/>{ <br/>
&nbsp;&nbsp;"importedData" : {}, //{{$.lp.valueScriptImportedDataNote}}<br/>
&nbsp;&nbsp;"data" : {}, //{{$.lp.valueScriptDataNote}} <br/>
&nbsp;&nbsp;"document" : {}, //{{$.lp.valueScriptDocumentNote}}<br/>
&nbsp;&nbsp;"work" : {}, //{{$.lp.valueScriptWorkNote}}<br/>
};
</div>
<div class="MWFFormulaArea" name="valueScript" title="{{$.lp.valueScript}}"></div>
<div style="display:text{($.vtype=='cms')?'block':'none'}" id="text{$.pid}cmsFieldProperty" class="text{$.vid}cmsFieldProperty">
<div style="background-color: #EEE; height:24px; line-height: 24px; text-align: center; font-weight: bold">{{$.lp.cmsProperty}}</div>
......
......@@ -21,7 +21,7 @@ MWF.xApplication.query.ImporterDesigner.LP = {
"copy": "Copy",
"ok": "OK",
"cancel": "Cancel",
"columnField": "Column Field",
"columnField": "Excel column corresponding field",
"calculateField": "Calculate Field",
"action": {
......@@ -137,6 +137,11 @@ MWF.xApplication.query.ImporterDesigner.LP = {
"startTimeField": "Start Date",
"completeTimeField": "End Date",
"selectProcess1": "Please select the process first",
"lineBreak": "Line Break"
"lineBreak": "Line Break",
"valueScriptNote": "The field value needs to be returned by return. You can get the data of the current imported row through this.target;, as follows:",
"valueScriptImportedDataNote": "Imported Original Data",
"valueScriptDataNote": "Business data generated by the system according to configuration",
"valueScriptDocumentNote": "If you import a CMS document, the document data generated by the system",
"valueScriptWorkNote": "If importing process Work, the system generated work data"
}
};
\ No newline at end of file
......@@ -21,7 +21,7 @@ MWF.xApplication.query.ImporterDesigner.LP = {
"copy" : "副本",
"ok" : "确定",
"cancel" : "取消",
"columnField": "字段",
"columnField": "Excel列对应字段",
"calculateField": "计算字段",
"action": {
......@@ -138,6 +138,11 @@ MWF.xApplication.query.ImporterDesigner.LP = {
"startTimeField": "开始日期",
"completeTimeField": "结束日期",
"selectProcess1": "请先选择流程",
"lineBreak": "换行符"
"lineBreak": "换行符",
"valueScriptNote": "在“值脚本”中需要通过return返回字段值。可以通过this.target;获取当前导入行的数据,如下:",
"valueScriptImportedDataNote": "导入的原始数据",
"valueScriptDataNote": "系统根据配置生成的业务数据",
"valueScriptDocumentNote": "如果导入CMS文档,系统生成的文档数据",
"valueScriptWorkNote": "如果导入流程work,系统生成的工作数据"
}
};
\ No newline at end of file
......@@ -393,7 +393,7 @@ MWF.xApplication.query.Query.Importer = MWF.QImporter = new Class({
if( identityList.length ){
identityList = identityList.unique();
o2.Actions.load("x_organization_assemble_express").IdentityAction.listObject({ identityList : identityList }, function (json) {
json.data.each( function (d) { this.identityMapImported[ d.matchKey ] = d; }.bind(this));
json.data.each( function (d) { if(d)this.identityMapImported[ d.matchKey ] = d; }.bind(this));
identityLoaded = true;
check();
}.bind(this))
......@@ -406,7 +406,7 @@ MWF.xApplication.query.Query.Importer = MWF.QImporter = new Class({
if( personList.length ){
personList = personList.unique();
o2.Actions.load("x_organization_assemble_express").PersonAction.listObject({ personList : personList }, function (json) {
json.data.each( function (d) { this.personMapImported[ d.matchKey ] = d; }.bind(this));
json.data.each( function (d) { if(d)this.personMapImported[ d.matchKey ] = d; }.bind(this));
personLoaded = true;
check();
}.bind(this))
......@@ -419,7 +419,7 @@ MWF.xApplication.query.Query.Importer = MWF.QImporter = new Class({
if( unitList.length ){
unitList = unitList.unique();
o2.Actions.load("x_organization_assemble_express").UnitAction.listObject({ unitList : unitList }, function (json) {
json.data.each( function (d) { this.unitMapImported[ d.matchKey ] = d; }.bind(this));
json.data.each( function (d) { if(d)this.unitMapImported[ d.matchKey ] = d; }.bind(this));
unitLoaded = true;
check();
}.bind(this))
......@@ -432,7 +432,7 @@ MWF.xApplication.query.Query.Importer = MWF.QImporter = new Class({
if( groupList.length ){
groupList = groupList.unique();
o2.Actions.load("x_organization_assemble_express").GroupAction.listObject({ groupList : groupList }, function (json) {
json.data.each( function (d) { this.groupMapImported[ d.matchKey ] = d; }.bind(this));
json.data.each( function (d) { if(d)this.groupMapImported[ d.matchKey ] = d; }.bind(this));
groupLoaded = true;
check();
}.bind(this))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册