提交 012821eb 编写于 作者: U unknown

导入模型

上级 68ed9f92
......@@ -53,6 +53,7 @@ MWF.xApplication.Template.Explorer.ComplexView = new Class({
currentPage : 1,
currentItem : null,
hasPagingBar : true,
pagingBarUseWidget: false,
hasTruningBar : true,
hasNextPage : true,
hasPrevPage : false,
......@@ -600,10 +601,47 @@ MWF.xApplication.Template.Explorer.ComplexView = new Class({
});
if( pageNum )par.currentPage = pageNum;
if( this.options.pagingPar.hasPagingBar ){
this.paging = new MWF.xApplication.Template.Explorer.Paging(this.pagingContainerTop, this.pagingContainerBottom, par, this.css);
this.paging.load();
if( this.options.pagingPar.pagingBarUseWidget ){
if(this.pagingContainerTop){
this.loadWidgetPaging(this.pagingContainerTop, itemSize, par)
}
if(this.pagingContainerBottom){
this.loadWidgetPaging(this.pagingContainerBottom, itemSize, par)
}
}else{
this.paging = new MWF.xApplication.Template.Explorer.Paging(
this.pagingContainerTop, this.pagingContainerBottom, par, this.css);
this.paging.load();
}
}
},
loadWidgetPaging: function(node, itemSize, par){
if(!o2.widget.Paging)MWF.require("o2.widget.Paging", null, false);
var pageSize = Math.ceil(itemSize/this.options.pagingPar.countPerPage);
this.paging = new o2.widget.Paging(node, Object.merge({
countPerPage: 20,
visiblePages: 9,
currentPage: 1,
itemSize: 0,
pageSize: pageSize,
hasNextPage: true,
hasPrevPage: true,
hasTruningBar: true,
hasBatchTuring: true,
hasFirstPage: true,
hasLastPage: true,
hasJumper: true,
hiddenWithDisable: false,
hiddenWithNoItem: true,
text: {
prePage: "",
nextPage: "",
firstPage: "",
lastPage: ""
}
}, par), this.options.pagingPar.pagingStyles || {});
this.paging.load();
},
_getCurrentPageData: function (callback, count, page) {
if( this.options.pagingEnable ){
this.actions.listDetailFilter(page, count, filter, function (json) {
......@@ -1211,7 +1249,7 @@ MWF.xApplication.Template.Explorer.Paging = new Class({
if( this.options.currentPage != pageSize && pageSize != 1 && pageSize != 0 ){
this.nextPageNode = new Element("div.nextPageNode", {
"styles" : this.css.nextPageNode,
"text" : MWF.xApplication.Template.LP.explorer.prePage
"text" : MWF.xApplication.Template.LP.explorer.nextPage
}).inject(container);
this.nextPageNode.addEvents( {
"mouseover" : function( ev ){ ev.target.setStyles( this.css.nextPageNode_over ) }.bind(this),
......@@ -1229,7 +1267,7 @@ MWF.xApplication.Template.Explorer.Paging = new Class({
if( this.options.currentPage != 1 && pageSize != 1 && pageSize != 0 ){
this.prevPageNode = new Element("div.prevPageNode", {
"styles" : this.css.prevPageNode,
"text" : MWF.xApplication.Template.LP.explorer.nextPage
"text" : MWF.xApplication.Template.LP.explorer.prePage
}).inject(container);
this.prevPageNode.addEvents( {
"mouseover" : function( ev ){ ev.target.setStyles( this.css.prevPageNode_over ) }.bind(this),
......
{
"node" : {
"width": "100%", "height": "100%", "overflow": "hidden",
"-webkit-user-select": "text",
"-moz-user-select": "text"
},
"contentContainerNode_inContainer" : {
"overflow-x" : "hidden",
//"margin-right": "10px"
"overflow-y" : "hidden"
},
"contentContainerNode" : {
"overflow-x" : "hidden",
//"margin-right": "10px"
"overflow-y" : "scroll"
},
"contentDiv":{
"min-width":"1000px",
"background-color" : "#fff"
},
"toolbar" : {
"padding-top" : "10px",
"padding-bottom" : "10px",
"height" : "36px",
"overflow" : "hidden"
},
"toolbarTextNode" : {
"margin" : "6px 40px 6px 20px",
"color" : "#999",
"font-size" : "18px",
"font-weight" : "bold",
"float" : "left",
"text-align" : "center"
},
"toolbarActionNode" : {
"float" : "left",
"height" : "34px",
"line-height" : "34px",
"cursor" : "pointer",
"color" : "#fff",
"margin-left" : "16px",
"padding-left" : "32px",
"padding-right" : "20px",
"font-size" : "14px",
"background-image" : "url( ../x_component_ForumDocument/$Main/default/icon/action_new.png )",
"background-position-x" : "8px",
"background-position-y" : "center",
"background-repeat" : "no-repeat",
"background-color" : "#3C76B7",
"margin-right" : "10px",
"border" : "1px solid #3C76B7"
},
"toolbarActionNode_over" : {
"background-color" : "#43aafa",
"border" : "1px solid #43aafa"
},
"pagingBar" : {
"float": "left",
"margin-left": "10px",
"margin-top": "18px",
"height": "24px",
"color": "#777777"
},
"viewContainer" : {
"overflow" : "hidden"
},
"viewContainerTop" : {
//"padding-bottom" : "10px",
"overflow" : "hidden"
},
"viewHeadNode": {
"width":"100%",
"height": "30px",
"background-color": "#fff",
"color": "#666666",
"line-height": "30px",
"font-family": "Microsoft YaHei",
"font-size": "14px"
},
"normalThNode" : {
"color" : "#333",
"background-color" : "#f0f0f0",
"text-align":"center",
"font-weight" : "normal"
},
"documentNode_empty" : {
"background-color" : "#f3f3f3"
},
"documentNode":{
"font-size" : "12px",
"min-height": "50px",
"overflow": "hidden",
"color": "#666666",
//"line-height": "39px",
"cursor": "pointer",
"font-family": "Microsoft YaHei",
"font-size": "12px",
"background-color": "#fff"
},
"documentNode_noread": {
"background-color": "#fcfcfc"
},
"documentNode_over": {
"background-color": "#f5f6f7"
},
"documentNode_down": {
"background-color": "#f5f6f7"
},
"documentNode_remove": {
"background-color": "#ffcccc"
},
"normalTdNode" : {
"height": "30px",
"line-height": "30px",
"font-size" : "14px",
"border-bottom" : "1px solid #d6d6d6"
},
"normalTdCenterNode" : {
"border-bottom" : "1px solid #d6d6d6",
"text-align" : "center"
},
"normalTdBottom" : {
"color" : "#999"
},
"tdInline" : {
"float" : "left"
},
"tdTitle" : {
"color" : "#333",
"font-size" : "14px",
//"float" : "left",
"margin-left" : "10px"
},
"documentActionNode": {
"font-size" : "12px",
"height": "20px",
"width": "20px",
"line-height": "20px",
"color": "#0066cc",
"cursor": "pointer",
"margin-right": "5px"
},
"documentActionNode_over":{
"color": "#003399"
},
"documentActionNode_down":{
"color": "#000"
},
"actionDeleteNode": {
"height": "20px",
"width": "20px",
"line-height": "20px",
"margin-top": "5px",
"color": "#888",
"cursor": "pointer",
"display": "inline-block",
"margin-right": "5px",
"background": "url(../x_component_cms_Module/$ViewExplorer/default/icon/delete.png) no-repeat center center"
},
"actionDeleteNode_over":{
"background": "url(../x_component_cms_Module/$ViewExplorer/default/icon/delete_over.png) no-repeat center center"
},
"actionDeleteNode_down":{
"background": "url(../x_component_cms_Module/$ViewExplorer/default/icon/delete_over.png) no-repeat center center"
},
"actionEditNode": {
"height": "20px",
"width": "20px",
"line-height": "20px",
"margin-top": "5px",
"color": "#888",
"cursor": "pointer",
"display": "inline-block",
"margin-right": "5px",
"background": "url(../x_component_cms_Module/$ViewExplorer/default/icon/editing.png) no-repeat center center"
},
"actionEditNode_over":{
"background": "url(../x_component_cms_Module/$ViewExplorer/default/icon/editing_over.png) no-repeat center center"
},
"actionEditNode_down":{
"background": "url(../x_component_cms_Module/$ViewExplorer/default/icon/editing_over.png) no-repeat center center"
}
}
\ No newline at end of file
{
"viewSetting": {
"html": "<table width='100%' border='0' cellpadding='5' cellspacing='0' styles='editTable' style='table-layout:fixed;'></table>"
},
"headSetting": {
"html": "<tr styles='viewHeadNode'></tr>"
},
"documentSetting": {
"html": "<tr styles='documentNode'></tr>",
// "mouseoverStyles": "documentNode_over",
"mousedownStyles": "documentNode_down",
"holdMouseDownStyles" : true,
"action": "open"
},
"items": [
{
"name": "name",
"head": {
"html": "<th styles='normalThNode' lable='importerName'></th>",
"width": "58%"
},
"content": {
"html": "<td styles='normalTdNode' width='30%' name='title'><div item='name'></div></td>",
"items": {
"name" : {}
}
}
},
{
"name": "status",
"head": {
"html": "<th styles='normalThNode' lable='status'></th>",
"width": "14%"
},
"content": {
"html": "<td styles='normalTdCenterNode' width='14%'><div item='status'></div></td>",
"items": {
"status" : {}
}
}
},
{
"name": "count",
"head": {
"html": "<th styles='normalThNode' lable='importCount'></th>",
"width": "9%"
},
"content": {
"html": "<td styles='normalTdCenterNode' width='9%'><div item='count'></div></td>",
"items": {
"count" : {}
}
}
},
{
"name": "createTime",
"head": {
"html": "<th styles='normalThNode' lable='importTime'></th>",
"width": "19%"
},
"content": {
"html": "<td styles='normalTdCenterNode' width='9%'><div item='createTime'></div></td>",
"items": {
"createTime" : {}
}
}
}
// {
// "head": {
// "html": "<th styles='normalThNode' lable='action'></th>",
// "width": "10%"
// },
// "content": {
// "html": "<td styles='normalTdCenterNode' width='10%'>" +
// " <span styles='documentActionNode' item='remove'></span>" +
// "</td>",
// "items": {
// "remove": {
// "title": "remove",
// "action": "remove",
// "condition": "function( d ){ return this.app.isAdmin || (d.creatorName == this.app.userName) }",
// "styles": "actionDeleteNode",
// "mouseoverStyles": "actionDeleteNode_over",
// "mousedownStyles": "actionDeleteNode_down"
// }
// }
// }
// }
]
}
\ No newline at end of file
......@@ -67,6 +67,23 @@
"color": "#333333",
"line-height": "40px"
},
"naviImporterTitleNode": {
"height": "40px",
"line-height": "40px",
"padding-left": "65px",
"font-size": "16px",
"color": "#333333",
"background": "url('../x_component_query_Query/$Main/default/icon/importer.png') 38px center no-repeat"
},
"naviImporterContentNode": {
"min-height": "40px",
"overflow": "hidden",
"font-size": "14px",
"color": "#333333",
"line-height": "40px"
},
"naviIconTitleNode": {
"width": "82px",
"height": "100px",
......
......@@ -1539,7 +1539,7 @@ MWF.xApplication.query.Query.Importer.ProgressBar = new Class({
clearMessageProgress: function(){
// var progressNode = this.getProgessNode();
this.progressNode.destroy();
},
}
// getProgessNode : function(){
// if(!this.progressNode)this.progressNode = this.contentNode.getFirst("div").getFirst("div");
// return this.progressNode;
......
MWF.xApplication.query = MWF.xApplication.query || {};
MWF.xApplication.query.Query = MWF.xApplication.query.Query || {};
MWF.require("MWF.widget.Common", null, false);
MWF.xDesktop.requireApp("Template","Explorer", null, false);
MWF.xDesktop.requireApp("query.Query", "lp."+o2.language, null, false);
MWF.xApplication.query.Query.ImporterExplorer = new Class({
Extends: MWF.widget.Common,
Implements: [Options, Events],
options: {
"importId": "",
"style": "default",
"viewPageNum" : 1
},
initialize: function (container, app, options) {
this.setOptions( options );
this.container = container;
this.path = "../x_component_query_Query/$ImporterExplorer/";
this.cssPath = "../x_component_query_Query/$ImporterExplorer/"+this.options.style+"/css.wcss";
this._loadCss();
this.app = app;
this.lp = MWF.xApplication.query.Query.LP;
},
load: function () {
debugger;
this.container.empty();
this.loadToolbar();
this.viewContainerTop = Element("div",{
"styles" : this.css.viewContainerTop
}).inject(this.container);
this.viewContainer = Element("div",{
"styles" : this.css.viewContainer
}).inject(this.container);
//this.loadTopView();
this.loadView();
},
destroy : function(){
if(this.resizeWindowFun)this.app.removeEvent("resize",this.resizeWindowFun);
this.view.destroy();
},
loadToolbar: function(){
var toolbar = new Element("div",{
styles : this.css.toolbar
}).inject(this.container);
this.toolbarTop = toolbar;
var createActionNode = new Element("div",{
styles : this.css.toolbarActionNode,
text: this.lp.createSubject
}).inject(toolbar);
createActionNode.addEvents(
{
"mouseover": function () {
this.node.setStyles(this.obj.css.toolbarActionNode_over);
}.bind({obj: this, node: createActionNode}),
"mouseout": function () {
this.node.setStyles(this.obj.css.toolbarActionNode);
}.bind({obj: this, node: createActionNode}),
"click": function () {
if( this.app.access.isAnonymousDynamic() ){
this.app.openLoginForm(
function(){ this.createSubject(); }.bind(this)
);
}else{
this.createSubject();
}
}.bind(this)
}
)
},
loadView : function(){
//this.resizeWindow();
//this.resizeWindowFun = this.resizeWindow.bind(this)
//this.app.addEvent("resize", this.resizeWindowFun );
this.view = new MWF.xApplication.query.Query.ImporterView( this.viewContainer, this.app, this, {
templateUrl : this.path+this.options.style+"/listItem.json",
pagingEnable : true,
onPostCreateViewBody : function(){
this.app.fireEvent("postCreateViewBody");
}.bind(this),
pagingPar : {
pagingBarUseWidget: true,
position : [ "bottom" ],
style : "blue_round",
hasReturn : false,
currentPage : this.options.viewPageNum,
countPerPage : 30,
visiblePages : 9,
hasNextPage : true,
hasPrevPage : true,
hasTruningBar : true,
hasJumper : true,
returnText : "",
hiddenWithDisable: false,
text: {
prePage: "",
nextPage: "",
firstPage: "第一页",
lastPage: "最后一页"
}
}
} );
this.view.load();
},
reloadView : function() {
this.viewContainer.setStyle("display","");
this.viewContainerTop.setStyle("display","");
//this.loadTopView();
this.loadView();
},
resizeWindow: function(){
var size = this.app.content.getSize();
this.viewContainer.setStyles({"height":(size.y-121)+"px"});
},
createSubject: function(){
var _self = this;
var appId = "ForumDocument"+this.app.sectionData.id;
if (_self.app.desktop.apps[appId]){
_self.app.desktop.apps[appId].setCurrent();
}else {
this.app.desktop.openApplication(null, "ForumDocument", {
"sectionId": this.app.sectionData.id,
"appId": appId,
"isNew" : true,
"isEdited" : true,
"onPostPublish" : function(){
//this.view.reload();
}.bind(this)
});
}
}
});
MWF.xApplication.query.Query.ImporterView = new Class({
Extends: MWF.xApplication.Template.Explorer.ComplexView,
_createDocument: function(data, index){
return new MWF.xApplication.query.Query.ImporterDocument(this.viewNode, data, this.explorer, this, null, index);
},
_getCurrentPageData: function(callback, count, pageNum){
this.clearBody();
if(!count)count=30;
if(!pageNum)pageNum = 1;
var filter = { "modelId": this.explorer.options.importId };
var json = {
count: 5,
size: 5,
data: [
{
"name": "导入测试",
"status": "导入成功",
"count": "200",
"createTime": "2020-03-10 09:11:12"
},
{
"name": "导入测试1",
"status": "导入失败",
"count": "110",
"createTime": "2020-03-10 09:11:10"
},
{
"name": "导入测试2",
"status": "导入成功",
"count": "200",
"createTime": "2020-03-10 09:11:12"
},
{
"name": "导入测试3",
"status": "导入失败",
"count": "110",
"createTime": "2020-03-10 09:11:10"
},
{
"name": "导入测试4",
"status": "导入成功",
"count": "200",
"createTime": "2020-03-10 09:11:12"
},
{
"name": "导入测试5",
"status": "导入失败",
"count": "110",
"createTime": "2020-03-10 09:11:10"
}
]
};
if( callback )callback(json);
return;
//filter.withTopSubject = false;
this.actions.listImportModuleRecord( pageNum, count, filter, function(json){
if( !json.data )json.data = [];
if( !json.count )json.count=0;
if( callback )callback(json);
}.bind(this))
},
_removeDocument: function(documentData, all){
this.actions.deleteSubject(documentData.id, function(json){
this.reload();
this.app.notice(this.explorer.lp.deleteDocumentOK, "success");
}.bind(this));
},
_create: function(){
},
_openDocument: function( documentData,index ){
var appId = "ForumDocument"+documentData.id;
if (this.app.desktop.apps[appId]){
this.app.desktop.apps[appId].setCurrent();
}else {
this.app.desktop.openApplication(null, "ForumDocument", {
"sectionId" : documentData.sectionId,
"id" : documentData.id,
"appId": appId,
"isEdited" : false,
"isNew" : false,
"index" : index
});
}
},
_queryCreateViewNode: function(){
},
_postCreateViewNode: function( viewNode ){
},
_queryCreateViewHead:function(){
},
_postCreateViewHead: function( headNode ){
}
});
MWF.xApplication.query.Query.ImporterDocument = new Class({
Extends: MWF.xApplication.Template.Explorer.ComplexDocument,
_queryCreateDocumentNode:function( itemData ){
},
_postCreateDocumentNode: function( itemNode, itemData ){
},
open: function (e) {
this.view._openDocument(this.data, this.index);
},
edit : function(){
var appId = "ForumDocument"+this.data.id;
if (this.app.desktop.apps[appId]){
this.app.desktop.apps[appId].setCurrent();
}else {
this.app.desktop.openApplication(null, "ForumDocument", {
"sectionId" : this.data.sectionId,
"id" : this.data.id,
"appId": appId,
"isEdited" : true,
"isNew" : false,
"index" : this.index
});
}
}
});
\ No newline at end of file
......@@ -83,6 +83,9 @@ MWF.xApplication.query.Query.Main = new Class({
this.naviStatementTitleNode = new Element("div", {"styles": this.css.naviStatementTitleNode, "text": this.lp.statement}).inject(this.naviContentNode);
this.naviStatementContentNode = new Element("div", {"styles": this.css.naviStatementContentNode}).inject(this.naviContentNode);
this.naviImporterTitleNode = new Element("div", {"styles": this.css.naviImporterTitleNode, "text": this.lp.importer}).inject(this.naviContentNode);
this.naviImporterContentNode = new Element("div", {"styles": this.css.naviImporterContentNode}).inject(this.naviContentNode);
this.setContentHeightFun = this.setContentHeight.bind(this);
this.addEvent("resize", this.setContentHeightFun);
this.setContentHeightFun();
......@@ -146,6 +149,20 @@ MWF.xApplication.query.Query.Main = new Class({
}.bind(this));
}
}.bind(this));
MWF.Actions.load("x_query_assemble_surface").ImportModelAction.listWithQuery(this.options.id, function(json){
//this.action.listStat(this.options.id, function(json){
if (json.data){
json.data.each(function(importer){
debugger;
var item = this.createImporterNaviItem(importer);
if( importer.id === this.options.importerId ){
item.selected()
}
}.bind(this));
}
}.bind(this));
},
createViewNaviItem: function(view){
var item = new MWF.xApplication.query.Query.ViewItem(view, this);
......@@ -159,6 +176,10 @@ MWF.xApplication.query.Query.Main = new Class({
var item = new MWF.xApplication.query.Query.StatementItem(statement, this);
return item;
},
createImporterNaviItem: function(importer){
var item = new MWF.xApplication.query.Query.ImporterItem(importer, this);
return item;
},
recordStatus: function(){
......@@ -260,4 +281,24 @@ MWF.xApplication.query.Query.StatementItem = new Class({
},{}, this.app);
}.bind(this));
}
});
MWF.xApplication.query.Query.ImporterItem = new Class({
Extends: MWF.xApplication.query.Query.ViewItem,
getContentNode: function(){
return this.app.naviImporterContentNode;
},
loadView: function(){
MWF.xDesktop.requireApp("query.Query", "ImporterExplorer", function(){
debugger;
this.viewContent.empty();
this.viewer = new MWF.xApplication.query.Query.ImporterExplorer( this.viewContent, this.app, {
"application": this.view.query,
"importerName": this.view.name,
"importerId" : this.view.id
});
this.viewer.load()
}.bind(this));
}
});
\ No newline at end of file
......@@ -11,6 +11,7 @@ MWF.xApplication.query.Query.LP = {
"view": "View",
"stat": "Statistics",
"statement": "Query",
"importer": "Importing",
"customSearch": "Advanced Search",
"searchKeywork": "Enter keyword search view",
"yes": "Yes",
......
......@@ -11,6 +11,7 @@ MWF.xApplication.query.Query.LP = {
"view": "视图",
"stat": "统计",
"statement" : "查询",
"importer": "导入",
"customSearch": "高级搜索",
"searchKeywork": "输入关键字搜索视图",
"yes": "",
......@@ -208,7 +209,10 @@ MWF.xApplication.query.Query.LP = {
"importSuccessTitle": "导入成功",
"importSuccessContent": "共导入数据{total}条 速度: {speed}条/秒 耗时: {timeStr}",
"importFailTitle": "导入失败",
"importFailContent": "共有数据{total}条 出错: {errorCount}条 耗时: {timeStr} 请修改后重新导入"
"importFailContent": "共有数据{total}条 出错: {errorCount}条 耗时: {timeStr} 请修改后重新导入",
"importerName": "导入模型名称",
"importTime": "导入时间",
"importCount": "数据条数"
};
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册