提交 9d138744 编写于 作者: U unknown

表单中增加数据导入组件,并增加相关API

上级 49072ee3
......@@ -43,7 +43,7 @@
<tr>
<td><a href="module-o2m.html">平台移动APP API - o2m</a></td>
<td><a href="module-wait.html">表单等待 - wait</a></td>
<td></td>
<td><a href="module-importer.html">导入数据 - importer</a></td>
</tr>
</table>
......@@ -123,6 +123,11 @@
<td><a href="MWF.xApplication.process.Xform.DatatablePC.html">数据表格PC端 - DatatablePC</a></td>
<td><a href="MWF.xApplication.process.Xform.DatatableMobile.html">数据表格移动端 - DatatableMobile</a></td>
</tr>
<tr>
<td><a href="MWF.xApplication.process.Xform.Importer.html">数据导入 - Importer</a></td>
<td></td>
<td></td>
</tr>
</table>
......@@ -197,7 +202,7 @@
<tr>
<td><a href="MWF.xApplication.process.Xform.DatatablePC.html">数据表格PC端 - DatatablePC</a></td>
<td><a href="MWF.xApplication.process.Xform.DatatableMobile.html">数据表格移动端 - DatatableMobile</a></td>
<td></td>
<td><a href="MWF.xApplication.process.Xform.Importer.html">数据导入 - Importer</a></td>
</tr>
</table>
......@@ -251,7 +256,7 @@
<tr>
<td><a href="MWF.xApplication.process.Xform.DatatablePC.html">数据表格PC端 - DatatablePC</a></td>
<td><a href="MWF.xApplication.process.Xform.DatatableMobile.html">数据表格移动端 - DatatableMobile</a></td>
<td></td>
<td><a href="MWF.xApplication.process.Xform.Importer.html">数据导入 - Importer</a></td>
</tr>
</table>
......
......@@ -219,5 +219,10 @@
"icon": "statement.png",
"text": MWF.xApplication.cms.FormDesigner.LP.modules.statement,
"className": "Statement"
},
"importer": {
"icon": "importer.png",
"text": MWF.xApplication.cms.FormDesigner.LP.modules.importer,
"className": "Importer"
}
}
\ No newline at end of file
......@@ -220,5 +220,10 @@
"icon": "statement.png",
"text": MWF.xApplication.cms.FormDesigner.LP.modules.statement,
"className": "Statement"
},
"importer": {
"icon": "importer.png",
"text": MWF.xApplication.cms.FormDesigner.LP.modules.importer,
"className": "Importer"
}
}
\ No newline at end of file
MWF.xApplication.cms.FormDesigner.Module = MWF.xApplication.cms.FormDesigner.Module || {};
MWF.xDesktop.requireApp("process.FormDesigner", "Module.Importer", null, false);
MWF.xApplication.cms.FormDesigner.Module.Importer = MWF.CMSFCImporter = new Class({
Extends: MWF.FCImporter,
Implements : [MWF.CMSFCMI]
});
......@@ -46,4 +46,5 @@ 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);
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.xDesktop.requireApp("cms.FormDesigner", "Module.StatementSelector", null, false);
MWF.xDesktop.requireApp("cms.FormDesigner", "Module.Importer", null, false);
\ No newline at end of file
......@@ -114,6 +114,8 @@ MWF.xApplication.cms.FormDesigner.Script = new Class({
this.loadStatementScript(v); break;
case "StatementSelector":
this.loadStatementSelectorScript(v); break;
case "Importer":
this.loadImporterScript(v); break;
}
this.bindDataId(v);
},
......
MWF.xDesktop.requireApp("process.Xform", "Importer", null, false);
MWF.xApplication.cms.Xform.Importer = MWF.CMSImporter = new Class({
Extends: MWF.APPImporter
});
\ No newline at end of file
......@@ -153,5 +153,10 @@
"icon": "datatemplate.png",
"text": MWF.APPPD.LP.modules.datatemplate,
"className": "Datatemplate"
},
"importer": {
"icon": "importer.png",
"text": MWF.APPPD.LP.modules.importer,
"className": "Importer"
}
}
......@@ -153,5 +153,10 @@
"icon": "datatemplate.png",
"text": MWF.APPPD.LP.modules.datatemplate,
"className": "Datatemplate"
},
"importer": {
"icon": "importer.png",
"text": MWF.APPPD.LP.modules.importer,
"className": "Importer"
}
}
......@@ -1109,6 +1109,7 @@ MWF.xApplication.portal.PageDesigner.Main = new Class({
if (callback) callback();
}.bind(this),
onError: function(text, error){
debugger;
this.notice("request tools data error: "+error, "error");
}.bind(this)
});
......
MWF.xApplication.portal.PageDesigner.Module.Importer = MWF.PCImporter = new Class({
Extends: MWF.FCImporter,
Implements: [Options, Events],
options: {
"style": "default",
"propertyPath": "../x_component_portal_PageDesigner/Module/Importer/importer.html"
},
initialize: function(form, options){
this.setOptions(options);
this.path = "../x_component_portal_PageDesigner/Module/Importer/";
this.cssPath = "../x_component_portal_PageDesigner/Module/Importer/"+this.options.style+"/css.wcss";
this._loadCss();
this.moduleType = "element";
this.moduleName = "importer";
this.form = form;
this.container = null;
this.containerNode = null;
}
});
{
"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
<div style="background-color: #FFF; overflow: hidden">
<div title="{{$.lp.base}}" class="MWFTab">
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
<tr>
<td class="editTableTitle">{{$.lp.id}}:</td>
<td class="editTableValue"><input type="text" name="id" value="text{$.id}" class="editTableInput"/></td>
</tr>
<tr>
<td class="editTableTitle">{{$.lp.name}}</td>
<td class="editTableValue"><input type="text" name="name" value="text{$.name}" class="editTableInput"/></td>
</tr>
<tr>
<td class="editTableTitle">{{$.lp.description}}:</td>
<td class="editTableValue"><input type="text" name="description" value="text{$.description}" class="editTableInput"/></td>
</tr>
</table>
<div class="MWFMaplist" name="styles" title="{{$.lp.style}}"></div>
<div class="MWFMaplist" name="properties" title="{{$.lp.attribute}}"></div>
<div>
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
<tr>
<td class="editTableTitle">{{$.lp.importModel}}:</td>
<td class="editTableValue"><div class="MWFQueryImportModelSelect" name="queryImportModel"></div></td>
</tr>
<tr>
<td class="editTableTitle">{{$.lp.downloadTempalte}}:</td>
<td class="editTableValue">
<input name="allowDownloadTempalte" type="radio" value="true" text{($.allowDownloadTempalte)!==false?'checked':''}
onclick="if (this.checked){ $('text{$.pid}downloadTempalteFieldIdDiv').setStyle('display', '')}" />{{$.lp.enable}}
<input name="allowDownloadTempalte" type="radio" value="false" text{($.allowDownloadTempalte)===false?'checked':''}
onclick="if (this.checked){ $('text{$.pid}downloadTempalteFieldIdDiv').setStyle('display', 'none')}" />{{$.lp.disable}}
</td>
</tr>
</table>
<div id="text{$.pid}downloadTempalteFieldIdDiv" style="display: text{($.allowDownloadTempalte!==false)?'':'none'};">
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
<tr>
<td class="editTableTitle">{{$.lp.downloadTempalteId}}:</td>
<td class="editTableValue" style="position: relative;">
<input type="text" name="downloadTempalteFieldId" value="text{$.downloadTempalteFieldId}" class="editTableInputNoWidth" style="width:60%;margin-right: 16px;"/>
<div class="MWFHelp" style="position: absolute;height: 16px;width: 16px;top:4px;right:4px;background: url('../x_component_process_FormDesigner/$Main/default/formtoolbar/question.png')">
{{$.lp.downloadTempalteIdNote}}
</div>
</td>
</tr>
</table>
</div>
<div class="MWFFormulaArea" name="excelName" title="{{$.lp.exportFileName}}"></div>
</div>
</div>
<div title="{{$.lp.event}}" 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>
{
"id": "",
"name": "",
"type": "Importer",
"description": "",
"application": "",
"importName": "",
"selectedScript": {
"code": "",
"html": ""
},
"events": {
"queryLoad": {
"code": "",
"html": ""
},
"postLoad": {
"code": "",
"html": ""
},
"afterLoad": {
"code": "",
"html": ""
},
"loadImporter": {
"code": "",
"html": ""
},
"beforeImport": {
"code": "",
"html": ""
},
"validImport": {
"code": "",
"html": ""
},
"afterImport": {
"code": "",
"html": ""
},
"beforeCreateRowData": {
"code": "",
"html": ""
},
"afterCreateRowData": {
"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
......@@ -33,4 +33,5 @@ MWF.xDesktop.requireApp("portal.PageDesigner", "Module.Widgetmodules", null, fal
MWF.xDesktop.requireApp("portal.PageDesigner", "Module.Statement", null, false);
MWF.xDesktop.requireApp("portal.PageDesigner", "Module.Datagrid", null, false);
MWF.xDesktop.requireApp("portal.PageDesigner", "Module.Datatable", null, false);
MWF.xDesktop.requireApp("portal.PageDesigner", "Module.Datatemplate", null, false);
\ No newline at end of file
MWF.xDesktop.requireApp("portal.PageDesigner", "Module.Datatemplate", null, false);
MWF.xDesktop.requireApp("portal.PageDesigner", "Module.Importer", null, false);
\ No newline at end of file
......@@ -170,6 +170,8 @@ MWF.xApplication.portal.PageDesigner.Script = new Class({
this.loadStatementScript(v); break;
case "StatementSelector":
this.loadStatementSelectorScript(v); break;
case "Importer":
this.loadImporterScript(v); break;
}
this.bindDataId(v);
},
......@@ -326,6 +328,10 @@ MWF.xApplication.portal.PageDesigner.Script = new Class({
loadViewScript: function(data){
this.loadEventsScript(data);
},
loadImporterScript: function(data){
this.addScriptItem(data.excelName, "code", data, "excelName");
this.loadEventsScript(data);
},
loadActionbarScript: function(data){
if (data.tools){
......
......@@ -302,7 +302,8 @@ MWF.APPPD.LP = {
"sourceText": "SourceText",
"widget": "Widget",
"widgetmodules": "WidgetEl",
"address": "Address"
"address": "Address",
"importer": "DataImport"
},
"filedConfigurator": {
"sequence": "Sequence",
......
......@@ -264,7 +264,8 @@ MWF.APPPD.LP = {
"sourceText": "数据文本",
"widget": "部件",
"widgetmodules": "部件元素",
"address": "地址"
"address": "地址",
"importer": "数据导入"
},
"filedConfigurator": {
"sequence": "序号",
......
......@@ -22,6 +22,10 @@
"code": "",
"html": ""
},
"loadImporter": {
"code": "",
"html": ""
},
"beforeImport": {
"code": "",
"html": ""
......
MWF.xDesktop.requireApp("process.Xform", "$Module", null, false);
MWF.xDesktop.requireApp("process.Xform", "Button", null, false);
/** @class Importer 导入数据组件。
/** @class Importer 导入数据组件,本组件通过导入模型来执行数据的导入,支持内容管理文档,流程管理work,自建表数据的导入
* @example
* //可以在脚本中获取该组件
* //方法1:
* var importer = this.form.get("fieldId"); //获取组件
* //方法2
* var importer = this.target; //在组件本身的脚本中获取
* @extends MWF.xApplication.process.Xform.Importer
* @extends MWF.xApplication.process.Xform.Button
* @o2category FormComponents
* @o2range {Process|CMS}
* @since v6.2
* @o2range {Process|CMS|Portal}
* @hideconstructor
*/
MWF.xApplication.process.Xform.Importer = MWF.APPImporter = new Class({
MWF.xApplication.process.Xform.Importer = MWF.APPImporter = new Class(
/** @lends MWF.xApplication.process.Xform.Importer# */
{
Implements: [Events],
Extends: MWF.xApplication.process.Xform.Button,
options: {
/**
* 加载importer(导入模型对象)的时候执行,可以通过this.target.importer获取导入模型对象。
* @event MWF.xApplication.process.Xform.Importer#loadImporter
* @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明}
*/
/**
* 导入前触发,this.event指向导入的数据,您可以通过修改this.event来修改数据。
* @event MWF.xApplication.process.Xform.Importer#beforeImport
* @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明}
* @example
* <caption>this.event数据格式如下:</caption>
*[
* [ "标题一","张三","男","大学本科","计算机","2001-1-2","2019-9-2" ], //第一行数据
* [ "标题二","李四","男","大学专科","数学","1998-1-2","2018-9-2" ] //第二行数据
*]
*/
/**
* 数据已经生成,前台进行数据校验时触发,this.event指向导入的数据。
* @event MWF.xApplication.process.Xform.Importer#validImport
* @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明}
* @example
* <caption>this.event数据格式如下:</caption>
* {
* "data" : [
* [ "标题一","张三","男","大学本科","计算机","2001-1-2","2019-9-2" ], //第一行数据
* [ "标题二","李四","男","大学专科","数学","1998-1-2","2018-9-2" ] //第二行数据
* ],
* "rowList": [], //导入的行对象,数据格式常见本章API的afterCreateRowData说明。
* "validted" : true //是否校验通过,可以在本事件中修改该参数,确定是否强制导入
* }
*/
/**
* 前台校验成功,并且后台执行完导入后触发,this.event指向后台返回的导入结果。
* @event MWF.xApplication.process.Xform.Importer#afterImport
* @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明}
* @example
* <caption>this.event格式如下:</caption>
* {
* "status": "导入成功", //导入结果:状态有 "导入成功","部分成功","导入失败"
* "count" : 10, //导入总数量
* "failCount": 0, //失败数量
* "distribution": "" //导入时候时的错误信息
* }
*/
/**
* 创建每行需要导入的数据前触发,this.event指向当前行对象,您可以通过修改this.event.importData来修改数据。
* @event MWF.xApplication.process.Xform.Importer#beforeCreateRowData
* @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明}
*/
/**
* 创建每行需要导入的数据后触发,this.event指向当前行对象。
* @event MWF.xApplication.process.Xform.Importer#afterCreateRowData
* @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明}
* @example
* <caption>this.event格式如下:</caption>
* {
* "importData": [ "标题一","张三","男","大学本科","计算机","2001-1-2","2019-9-2" ], //导入的数据
* "data" : {//根据导入模型生成的业务数据
* {
* "subject", "标题一", //subject为导入模型列配置的路径
* "name" : "张三",
* ...
* },
* "document": { //如果导入目标是内容管理,则包含document对象
* "title": "标题一"
* "identity": "xxx@xxx@I"
* ...
* },
* "work": { //如果导入目标是流程管理,则包含work对象
* "title": "标题一"
* "identity": "xxx@xxx@I"
* ...
* },
* "errorTextList" : [], //错误信息
* "errorTextListExcel": [] //在出错界面导出Excel时的错误信息
* }
*/
"moduleEvents": ["queryLoad","postLoad", "afterLoad", "loadImporter",
"beforeImport", "validImport","afterImport", "beforeCreateRowData", "afterCreateRowData"]
},
_loadUserInterface: function(){
var button = this.node.getElement("button");
if (!button) button = new Element("button");
......@@ -34,13 +118,10 @@ MWF.xApplication.process.Xform.Importer = MWF.APPImporter = new Class({
this.setDownloadEvent();
}
},
upload: function () {
debugger;
var options;
if( this.json.queryImportModel.id ){
options = {
"id" : this.json.queryImportModel.id
};
getImporter: function(callback){
var options;
if( this.json.queryImportModel.id ){
options = { "id" : this.json.queryImportModel.id };
}else{
options = {
"application": this.json.queryImportModel.application || this.json.queryImportModel.appName,
......@@ -48,10 +129,46 @@ MWF.xApplication.process.Xform.Importer = MWF.APPImporter = new Class({
}
}
MWF.xDesktop.requireApp("query.Query", "Importer", function () {
var importer = new MWF.xApplication.query.Query.Importer(this.form.app.content, options, {}, this.form.app, this.form.Macro);
importer.load();
/**
* @summary 导入模型对象.
* @member {MWF.xApplication.query.Query.Importer}
* @example
* var importer = this.form.get("fieldId").importer; //获取组件
* if(importer)importer.importFromExcel(); //执行导入
*/
this.importer = new MWF.xApplication.query.Query.Importer(this.form.app.content, options, {
"onQueryLoad": function () {
this.fireEvent("loadImporter")
}.bind(this),
"onBeforeImport": function (importedData) {
this.fireEvent("beforeImport", importedData)
}.bind(this),
"onValidImport": function (arg) {
this.fireEvent("validImport", [arg])
}.bind(this),
"onAfterImport": function ( infor ) {
this.fireEvent("afterImport", [infor])
}.bind(this),
"onBeforeCreateRowData": function (row) {
this.fireEvent("beforeCreateRowData", [row])
}.bind(this),
"onAfterCreateRowData": function (row) {
this.fireEvent("afterCreateRowData", [row])
}.bind(this),
}, this.form.app, this.form.Macro);
if(callback)callback();
}.bind(this));
},
upload: function () {
if( this.importer ){
this.importer.importFromExcel();
}else{
this.getImporter(function(){
this.importer.load();
}.bind(this))
}
},
setDownloadEvent: function () {
this.bindEvent = function () {
var module = this._getModuleByPath(this.json.downloadTempalteFieldId);
......@@ -70,22 +187,13 @@ MWF.xApplication.process.Xform.Importer = MWF.APPImporter = new Class({
this.form.addEvent("afterModulesLoad", this.bindEvent );
},
downloadTemplate: function(){
var options;
if( this.json.queryImportModel.id ){
options = {
"id" : this.json.queryImportModel.id
};
if( this.importer ){
this.importer.downloadTemplate( this.getExcelName() );
}else{
options = {
"application": this.json.queryImportModel.application || this.json.queryImportModel.appName,
"name": this.json.queryImportModel.alias || this.json.queryImportModel.name
}
this.getImporter(function(){
this.importer.downloadTemplate( this.getExcelName() );
}.bind(this))
}
MWF.xDesktop.requireApp("query.Query", "Importer", function () {
var importer = new MWF.xApplication.query.Query.Importer(this.form.app.content, options, {}, this.form.app, this.form.Macro);
importer.downloadTemplate( this.getExcelName() );
}.bind(this));
},
getExcelName: function(){
......
......@@ -32,15 +32,13 @@ MWF.xApplication.query.Query.Importer = MWF.QImporter = new Class({
},
load: function(){
this.excelUtils = new MWF.xApplication.query.Query.Importer.ExcelUtils( this );
this.getImporterJSON( function () {
this.loadMacro( function () {
this._loadModuleEvents();
if (this.fireEvent("queryLoad")){
this.importFromExcel()
}
this.fireEvent("queryLoad");
this.importFromExcel()
}.bind(this))
}.bind(this))
......@@ -60,23 +58,27 @@ MWF.xApplication.query.Query.Importer = MWF.QImporter = new Class({
loadingTextNode.set("text", "loading...");
},
getImporterJSON: function(callback){
if (this.json.name){
this.lookupAction.getImportModel(this.json.name, this.json.application, function(json){
this.importerId = json.data.id;
this.importerJson = JSON.decode(json.data.data);
json.data.data = this.importerJson;
this.json = Object.merge(this.json, json.data);
if (callback) callback();
}.bind(this));
if( this.importerJson && this.json ){
if (callback) callback();
}else{
this.lookupAction.getImportModelById(this.json.id, function(json){
this.importerId = json.data.id;
this.importerJson = JSON.decode(json.data.data);
json.data.data = this.importerJson;
this.json.application = json.data.query;
this.json = Object.merge(this.json, json.data);
if (callback) callback();
}.bind(this));
if (this.json.name){
this.lookupAction.getImportModel(this.json.name, this.json.application, function(json){
this.importerId = json.data.id;
this.importerJson = JSON.decode(json.data.data);
json.data.data = this.importerJson;
this.json = Object.merge(this.json, json.data);
if (callback) callback();
}.bind(this));
}else{
this.lookupAction.getImportModelById(this.json.id, function(json){
this.importerId = json.data.id;
this.importerJson = JSON.decode(json.data.data);
json.data.data = this.importerJson;
this.json.application = json.data.query;
this.json = Object.merge(this.json, json.data);
if (callback) callback();
}.bind(this));
}
}
},
_loadModuleEvents : function(){
......@@ -126,7 +128,7 @@ MWF.xApplication.query.Query.Importer = MWF.QImporter = new Class({
if( this.importedData.length > 0 )this.importedData.shift();
this.fireEvent("beforeImport");
this.fireEvent("beforeImport", [this.importedData]);
this.listAllOrgDataByImport( function () {
this.importedData.each( function( lineData, lineIndex ){
......@@ -149,7 +151,6 @@ MWF.xApplication.query.Query.Importer = MWF.QImporter = new Class({
var data = ( this.rowList || [] ).map( function(row){
return row.getResult();
});
debugger;
return data;
},
doImportData: function(){
......@@ -163,23 +164,22 @@ MWF.xApplication.query.Query.Importer = MWF.QImporter = new Class({
this.rowList.each( function(row, index){
if( row.errorTextList.length )flag = false;
}.bind(this));
if( !flag ){
var arg = {
validted : false,
data : this.importedData,
rowList : this.rowList
};
this.fireEvent( "validImport", [arg] );
flag = arg.validted;
}
var arg = {
validted : flag,
data : this.importedData,
rowList : this.rowList
};
this.fireEvent( "validImport", [arg] );
flag = arg.validted;
if( !flag ){
this.openImportedErrorDlg();
return;
}
var data = this.getData();
console.log();
this.lookupAction.getUUID(function(json){
this.recordId = json.data;
......@@ -189,7 +189,6 @@ MWF.xApplication.query.Query.Importer = MWF.QImporter = new Class({
}, function () {
this.showImportingStatus()
}.bind(this), function (xhr) {
debugger;
var requestJson = JSON.parse(xhr.responseText);
this.app.notice(requestJson.message, "error");
this.progressBar.close();
......@@ -211,7 +210,6 @@ MWF.xApplication.query.Query.Importer = MWF.QImporter = new Class({
return arr.join( " " )
},
openImportedErrorDlg : function(){
debugger;
if(this.progressBar)this.progressBar.close();
var _self = this;
......@@ -457,15 +455,13 @@ MWF.xApplication.query.Query.Importer = MWF.QImporter = new Class({
},
showImportingStatus: function(){
this.progressBar.showImporting( this.recordId, function(){
this.fireEvent("afterImport")
this.progressBar.showImporting( this.recordId, function( data ){
this.fireEvent("afterImport", data)
}.bind(this));
},
exportWithImportDataToExcel : function ( importData ) {
debugger;
if( !this.excelUtils ){
this.excelUtils = new MWF.xApplication.query.Query.Importer.ExcelUtils( this );
}
......@@ -932,7 +928,7 @@ MWF.xApplication.query.Query.Importer.Row = new Class({
};
}
this.importer.fireEvent("beforeCreateRowData", [null, this]);
this.importer.fireEvent("beforeCreateRowData", [this]);
json.data.columnList.each( function (columnJson, i) {
......@@ -1038,10 +1034,9 @@ MWF.xApplication.query.Query.Importer.Row = new Class({
}
this.importer.fireEvent("afterCreateRowData", [null, this]);
this.importer.fireEvent("afterCreateRowData", [ this]);
},
parseData: function(value, dataType, json){
debugger;
var data;
var type = this.importer.json.type;
switch ( dataType ) {
......@@ -1611,7 +1606,7 @@ MWF.xApplication.query.Query.Importer.ProgressBar = new Class({
}else{ //已经结束, 状态有 "导入成功","部分成功","导入失败"
if(this.intervalId)window.clearInterval( this.intervalId );
this.transferComplete( data );
if( callback )callback();
if( callback )callback( data );
}
}.bind(this), null)
}.bind(this), 500 );
......@@ -1628,7 +1623,6 @@ MWF.xApplication.query.Query.Importer.ProgressBar = new Class({
close: function(){
// this.maskNode.destroy();
// this.node.destroy();
debugger;
this.dlg.close();
},
// setSize: function(){
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册