提交 052d7d5f 编写于 作者: U unknown

数据模型

上级 e8d48c66
......@@ -53,6 +53,9 @@ o2.widget.Paging = new Class({
this.fireEvent("postLoad", this);
},
destroy: function(){
this.container.empty();
},
createNode: function() {
var _self = this;
......
......@@ -2,6 +2,7 @@ o2.require("MWF.widget.Dialog", null, false);
o2.xDesktop.Dialog = o2.DDL = new Class({
Extends: o2.widget.Dialog,
options : {
"zindex": null,
maxHeightPercent : "98%"
},
// _markShow: function(){
......@@ -61,7 +62,17 @@ o2.xDesktop.Dialog = o2.DDL = new Class({
this.markNode.setStyle("display", "block");
}
},
setZindex: function(){
if( o2.typeOf(this.options.zindex) === "number" && this.options.zindex > 0 ){
this.css = Object.clone(this.css);
this.css.from["z-index"] = this.options.zindex.toString();
this.css.to["z-index"] = this.options.zindex.toString();
this.css.mark["z-index"] = (this.options.zindex-1).toString();
}
},
getDialogNode: function(){
this.setZindex();
this.width = this.options.width;
this.height = this.options.height;
......
......@@ -126,6 +126,7 @@ MWF.xApplication.Template.Explorer.ComplexView = new Class({
this.fireEvent("postLoad");
},
reload: function () {
debugger;
this.clear();
this.node = new Element("div", {
"styles": this.css.viewContentListNode
......@@ -155,9 +156,14 @@ MWF.xApplication.Template.Explorer.ComplexView = new Class({
this.destroyScroll()
}
this.clear();
//delete this;
},
clear: function () {
if(this.pagingContainerTop ){
if( this.pagingContainerTopCreated ){
this.pagingContainerTop.destroy();
this.pagingContainerTop = null;
}else{
this.pagingContainerTop.empty();
}
......@@ -166,17 +172,15 @@ MWF.xApplication.Template.Explorer.ComplexView = new Class({
if( this.pagingContainerBottom ){
if( this.pagingContainerBottomCreated ){
this.pagingContainerBottom.destroy();
this.pagingContainerBottom = null;
}else{
this.pagingContainerBottom.empty();
}
}
if( this.paging )this.paging.destroy();
this.paging = null;
this.clear();
//delete this;
},
clear: function () {
if( this.documentDragSort ){
this.documentDragSort.removeLists( this.viewBodyNode || this.viewNode );
this.documentDragSort.detach();
......@@ -1292,6 +1296,7 @@ MWF.xApplication.Template.Explorer.Paging = new Class({
}
},
gotoPage : function( num ){
if(o2.typeOf(num) === "string")num = num.toInt();
if( num < 1 || num > this.options.pageSize )return;
this.fireEvent( "jumpingPage", { pageNum : num } );
this.options.currentPage = num;
......
......@@ -98,6 +98,24 @@
}
},
{
"name": "errorInfor",
"condition": "function( d ){ return ['导入失败','部分成功'].contains(this.explorer.data.status) && ['','导入失败'].contains(this.explorer.currentStatus) }",
"head": {
"html": "<th styles='normalThNode' lable='errorInfor'></th>",
"width": "15%"
},
"content": {
"html": "<td styles='normalTdNode' width='15%'><div item='errorInfor'></div></td>",
"items": {
"errorInfor" : {
"value": "function(d){ return d.distribution || '' }"
}
}
}
},
{
"condition": "function( d ){ return ['导入成功','部分成功'].contains(this.explorer.data.status) && ['','导入成功'].contains(this.explorer.currentStatus) }",
"head": {
"html": "<th styles='normalThNode' lable='action'></th>",
"width": "5%"
......
......@@ -1394,7 +1394,10 @@ MWF.xApplication.query.Query.Importer.ExcelUtils = new Class({
MWF.xApplication.query.Query.Importer.ProgressBar = new Class({
Implements: [Options, Events],
Extends: o2.widget.Common,
options: {},
options: {
zindex: null,
disableDetailButton: false
},
initialize : function( importer, options ){
this.setOptions(options);
this.importer = importer;
......@@ -1407,7 +1410,7 @@ MWF.xApplication.query.Query.Importer.ProgressBar = new Class({
openDlg: function () {
var _self = this;
this.contentNode = new Element("div",{"styles": this.css.processContentNode});
this.dlg = o2.DL.open({
var opt = {
"style" : "user",
"title": this.lp.importRecordDetail,
"content": this.contentNode,
......@@ -1415,6 +1418,7 @@ MWF.xApplication.query.Query.Importer.ProgressBar = new Class({
"isMax": false,
"width": 500,
"height": 200,
"zindex": this.options.zindex,
"buttonList": [
{
"type": "openImportRecordDetail",
......@@ -1437,7 +1441,12 @@ MWF.xApplication.query.Query.Importer.ProgressBar = new Class({
"onPostClose": function(){
this.dlg = null;
}.bind(this)
});
};
if( this.options.disableDetailButton ){
opt.buttonList.splice(0, 1);
}
this.dlg = o2.DL.open(opt);
},
createNode: function( noProgress ){
// var lp = this.lp;
......
......@@ -149,6 +149,7 @@ MWF.xApplication.query.Query.ImporterRecord = new Class({
"id": this.options.importerId
}, {
"onAfterImport": function () {
debugger;
if(this.view)this.view.reload();
}.bind(this)
}, this.app);
......@@ -197,7 +198,8 @@ MWF.xApplication.query.Query.ImporterRecord.View = new Class({
this.explorer.container,
this.app,
{ recordId: documentData.id }
)
);
detail.recordView = this;
detail.load();
},
_queryCreateViewNode: function(){
......@@ -244,19 +246,34 @@ MWF.xApplication.query.Query.ImporterRecord.Detail = new Class({
this.app = app;
this.lp = MWF.xApplication.query.Query.LP;
},
load: function () {
load: function (callback) {
o2.Actions.load("x_query_assemble_surface").ImportModelAction.getRecord(this.options.recordId, function (json) {
this.data = json.data;
this.currentStatus = "";
this.createNode();
this.setBaseInfor();
if( this.data.status === "部分成功" ){
this.createTab();
}
this.openDlg();
if(!this.dlg)this.openDlg();
if(callback)callback();
}.bind(this))
},
reload: function(){
this.view.destroy();
this.node.destroy();
this.load(function () {
this.loadView();
this.dlg.button.getElements("input[type='button']").each(function (button) {
if( [this.lp.reExecuteImport,this.lp.exportErrorDataToExcel].contains(button.get("value"))){
button.setStyle("display", this.data.status === "导入成功" ? "none" : "")
}
}.bind(this))
}.bind(this));
},
createNode: function(){
this.node = new Element("div", { style : "padding:0px;"});
if(this.dlg)this.node.inject(this.dlg.content);
this.inforNode = new Element("div", { style : "padding:0px;"}).inject(this.node);
if( this.data.status === "部分成功" ){
this.tabNode = new Element("div", { "styles": this.css.tabNode }).inject(this.node);
......@@ -298,6 +315,11 @@ MWF.xApplication.query.Query.ImporterRecord.Detail = new Class({
"width": 1000,
"height": 750,
"buttonList": [
{
"type": "reExecute",
"text": this.lp.reExecuteImport,
"action": function () { _self.reExecuteImport(); }
},
{
"type": "exportWithError",
"text": this.lp.exportErrorDataToExcel,
......@@ -306,12 +328,12 @@ MWF.xApplication.query.Query.ImporterRecord.Detail = new Class({
{
"type": "cancel",
"text": this.lp.close,
"action": function () { this.dlg.close(); }.bind(this)
"action": function () { _self.dlg.close(); }
}
],
"onResizeCompleted": function () { this.setContentHeight(); }.bind(this),
"onMax": function () { this.setContentHeight(); }.bind(this),
"onRestore": function () { this.setContentHeight(); }.bind(this),
"onResizeCompleted": function () { _self.setContentHeight(); },
"onMax": function () { _self.setContentHeight(); },
"onRestore": function () { _self.setContentHeight(); },
"onPostShow": function () {
// if( this.dlg.content.getScrollSize().y - this.dlg.content.getSize().y > 15 ){
// this.dlg.content.setStyles("padding-right","0px");
......@@ -320,11 +342,11 @@ MWF.xApplication.query.Query.ImporterRecord.Detail = new Class({
_self.loadView();
},
"onPostClose": function(){
this.dlg = null;
}.bind(this)
_self.dlg = null;
}
};
if( this.data.status === "导入成功" ){
opt.buttonList.splice(0, 1);
opt.buttonList.splice(0, 2);
}
this.dlg = o2.DL.open(opt);
},
......@@ -397,6 +419,25 @@ MWF.xApplication.query.Query.ImporterRecord.Detail = new Class({
this.inforNode.set("html", htmlArray.join(""));
},
reExecuteImport: function(){
var _self = this;
o2.Actions.load("x_query_assemble_surface").ImportModelAction.reExecuteRecord(this.options.recordId, function () {
window.setTimeout(function (json) {
MWF.xDesktop.requireApp("query.Query", "Importer", null, false);
var importer = new MWF.xApplication.query.Query.Importer( this.container );
var progressBar = new MWF.xApplication.query.Query.Importer.ProgressBar(importer, {
"zindex": ( _self.dlg.css.from["z-index"] || "1" ).toInt() + 2,
"disableDetailButton": true,
"onPostShow": function(){
this.showImporting( _self.options.recordId, function(){
_self.reload();
if(_self.recordView)_self.recordView.reload();
});
}
});
}.bind(this), 500);
}.bind(this));
},
loadView: function(){
this.view = new MWF.xApplication.query.Query.ImporterRecord.DetailView( this.viewNode, this.app, this, {
templateUrl : this.path+this.options.style+"/detailListItem.json",
......@@ -413,7 +454,7 @@ MWF.xApplication.query.Query.ImporterRecord.Detail = new Class({
hasReturn : false,
currentPage : this.options.viewPageNum,
countPerPage : 15,
visiblePages : 9,
visiblePages : 7,
hasNextPage : true,
hasPrevPage : true,
hasTruningBar : true,
......
......@@ -228,5 +228,6 @@ MWF.xApplication.query.Query.LP = {
"importData": "Import Data",
"importRecordDetail": "Import Details",
"downloadTemplate": "Download Template",
"exportErrorDataToExcel": "Export Error Data"
"exportErrorDataToExcel": "Export Error Data",
"errorInfor": "error message"
};
\ No newline at end of file
......@@ -232,6 +232,8 @@ MWF.xApplication.query.Query.LP = {
"downloadTemplate": "下载模板",
"exportErrorDataToExcel": "导出错误数据",
"openImportRecordDetail": "查看导入详情",
"importStatusList": ["全部","导入成功","导入失败"]
"importStatusList": ["全部","导入成功","导入失败"],
"errorInfor": "错误信息",
"reExecuteImport": "重新执行导入"
};
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册