|
@@ -2042,7 +2042,7 @@ MWF.xApplication.process.Xform.DatagridPC = new Class(
|
|
|
this.fireEvent("import", [data] );
|
|
this.fireEvent("import", [data] );
|
|
|
|
|
|
|
|
this.setData( data );
|
|
this.setData( data );
|
|
|
- this.form.notice("导入成功!");
|
|
|
|
|
|
|
+ this.form.notice( MWF.xApplication.process.Xform.LP.importSuccess );
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
openImportedErrorDlg : function( columnList, tableData ){
|
|
openImportedErrorDlg : function( columnList, tableData ){
|
|
@@ -2067,7 +2067,7 @@ MWF.xApplication.process.Xform.DatagridPC = new Class(
|
|
|
columnList.each( function (obj, i) {
|
|
columnList.each( function (obj, i) {
|
|
|
htmlArray.push( "<th style='"+titleStyle+"'>"+obj.text+"</th>" );
|
|
htmlArray.push( "<th style='"+titleStyle+"'>"+obj.text+"</th>" );
|
|
|
});
|
|
});
|
|
|
- htmlArray.push( "<th style='"+titleStyle+"'>校验信息</th>" );
|
|
|
|
|
|
|
+ htmlArray.push( "<th style='"+titleStyle+"'> "+MWF.xApplication.process.Xform.LP.validationInfor +"</th>" );
|
|
|
htmlArray.push( "</tr>" );
|
|
htmlArray.push( "</tr>" );
|
|
|
|
|
|
|
|
|
|
|
|
@@ -2087,7 +2087,7 @@ MWF.xApplication.process.Xform.DatagridPC = new Class(
|
|
|
var div = new Element("div", { style : "padding:10px;", html : htmlArray.join("") });
|
|
var div = new Element("div", { style : "padding:10px;", html : htmlArray.join("") });
|
|
|
var dlg = o2.DL.open({
|
|
var dlg = o2.DL.open({
|
|
|
"style" : this.form.json.dialogStyle || "user",
|
|
"style" : this.form.json.dialogStyle || "user",
|
|
|
- "title": "导入失败",
|
|
|
|
|
|
|
+ "title": MWF.xApplication.process.Xform.LP.importFail,
|
|
|
"content": div,
|
|
"content": div,
|
|
|
"offset": {"y": 0},
|
|
"offset": {"y": 0},
|
|
|
"isMax": false,
|
|
"isMax": false,
|
|
@@ -2108,6 +2108,10 @@ MWF.xApplication.process.Xform.DatagridPC = new Class(
|
|
|
},
|
|
},
|
|
|
checkImportedData : function( columnList, tableData ){
|
|
checkImportedData : function( columnList, tableData ){
|
|
|
var flag = true;
|
|
var flag = true;
|
|
|
|
|
+
|
|
|
|
|
+ var lp = MWF.xApplication.process.Xform.LP;
|
|
|
|
|
+ var columnText = lp.importValidationColumnText;
|
|
|
|
|
+
|
|
|
tableData.each( function(lineData, lineIndex){
|
|
tableData.each( function(lineData, lineIndex){
|
|
|
|
|
|
|
|
var errorTextList = [];
|
|
var errorTextList = [];
|
|
@@ -2117,6 +2121,8 @@ MWF.xApplication.process.Xform.DatagridPC = new Class(
|
|
|
var thJson = obj.thJson;
|
|
var thJson = obj.thJson;
|
|
|
var text = obj.text;
|
|
var text = obj.text;
|
|
|
|
|
|
|
|
|
|
+ var colInfor = columnText.replace( "{n}", index );
|
|
|
|
|
+
|
|
|
var d = lineData[text] || "";
|
|
var d = lineData[text] || "";
|
|
|
|
|
|
|
|
switch (module.json.type) {
|
|
switch (module.json.type) {
|
|
@@ -2128,14 +2134,14 @@ MWF.xApplication.process.Xform.DatagridPC = new Class(
|
|
|
var arr = d.split(/\s*,\s*/g ); //空格,空格
|
|
var arr = d.split(/\s*,\s*/g ); //空格,空格
|
|
|
arr.each( function(d, idx){
|
|
arr.each( function(d, idx){
|
|
|
var obj = this.getImportOrgData( d );
|
|
var obj = this.getImportOrgData( d );
|
|
|
- if( obj.errorText )errorTextList.push( "第"+index +"列:" + obj.errorText + "。" );
|
|
|
|
|
|
|
+ if( obj.errorText )errorTextList.push( colInfor + obj.errorText + + lp.fullstop );
|
|
|
}.bind(this));
|
|
}.bind(this));
|
|
|
break;
|
|
break;
|
|
|
case "Number":
|
|
case "Number":
|
|
|
- if (parseFloat(d).toString() === "NaN")errorTextList.push( "第"+index +"列:" + d+"不是数字。" );
|
|
|
|
|
|
|
+ if (parseFloat(d).toString() === "NaN")errorTextList.push( colInfor + d + lp.notValidNumber + lp.fullstop );
|
|
|
break;
|
|
break;
|
|
|
case "Calendar":
|
|
case "Calendar":
|
|
|
- if( !( isNaN(d) && !isNaN(Date.parse(d) )))errorTextList.push("第"+index +"列:" +d+"不是日期格式。");
|
|
|
|
|
|
|
+ if( !( isNaN(d) && !isNaN(Date.parse(d) )))errorTextList.push(colInfor + d + lp.notValidDate + lp.fullstop );
|
|
|
break;
|
|
break;
|
|
|
default:
|
|
default:
|
|
|
break;
|
|
break;
|
|
@@ -2144,7 +2150,7 @@ MWF.xApplication.process.Xform.DatagridPC = new Class(
|
|
|
module.setData();
|
|
module.setData();
|
|
|
module.validationMode();
|
|
module.validationMode();
|
|
|
if (!module.validation()){
|
|
if (!module.validation()){
|
|
|
- errorTextList.push("第"+index +"列:" + module.errNode.get("text"));
|
|
|
|
|
|
|
+ errorTextList.push(colInfor + module.errNode.get("text"));
|
|
|
module.errNode.destroy();
|
|
module.errNode.destroy();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -2172,19 +2178,19 @@ MWF.xApplication.process.Xform.DatagridPC = new Class(
|
|
|
var flag = str.substr(str.length-2, 2);
|
|
var flag = str.substr(str.length-2, 2);
|
|
|
switch (flag.toLowerCase()){
|
|
switch (flag.toLowerCase()){
|
|
|
case "@i":
|
|
case "@i":
|
|
|
- return this.identityMapImported[str] || {"errorText": str + "在系统中不存在"};
|
|
|
|
|
|
|
+ return this.identityMapImported[str] || {"errorText": str + MWF.xApplication.process.Xform.LP.notExistInSystem };
|
|
|
case "@p":
|
|
case "@p":
|
|
|
- return this.personMapImported[str] || {"errorText": str + "在系统中不存在"};
|
|
|
|
|
|
|
+ return this.personMapImported[str] || {"errorText": str + MWF.xApplication.process.Xform.LP.notExistInSystem };
|
|
|
case "@u":
|
|
case "@u":
|
|
|
- return this.unitMapImported[str] || {"errorText": str + "在系统中不存在"};
|
|
|
|
|
|
|
+ return this.unitMapImported[str] || {"errorText": str + MWF.xApplication.process.Xform.LP.notExistInSystem };
|
|
|
case "@g":
|
|
case "@g":
|
|
|
- return this.groupMapImported[str] || {"errorText": str + "在系统中不存在"};
|
|
|
|
|
|
|
+ return this.groupMapImported[str] || {"errorText": str + MWF.xApplication.process.Xform.LP.notExistInSystem };
|
|
|
default:
|
|
default:
|
|
|
return this.identityMapImported[str] ||
|
|
return this.identityMapImported[str] ||
|
|
|
this.personMapImported[str] ||
|
|
this.personMapImported[str] ||
|
|
|
this.unitMapImported[str] ||
|
|
this.unitMapImported[str] ||
|
|
|
this.groupMapImported[str] ||
|
|
this.groupMapImported[str] ||
|
|
|
- {"errorText": str + "在系统中不存在"};
|
|
|
|
|
|
|
+ {"errorText": str + MWF.xApplication.process.Xform.LP.notExistInSystem };
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
@@ -2437,7 +2443,7 @@ MWF.xApplication.process.Xform.DatagridPC.ExcelUtils = new Class({
|
|
|
if (files.length) {
|
|
if (files.length) {
|
|
|
var file = files.item(0);
|
|
var file = files.item(0);
|
|
|
if( file.name.indexOf(" ") > -1 ){
|
|
if( file.name.indexOf(" ") > -1 ){
|
|
|
- this.form.notice("上传的文件不能带空格", "error");
|
|
|
|
|
|
|
+ this.form.notice( MWF.xApplication.process.Xform.LP.uploadedFilesCannotHaveSpaces, "error");
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
|