12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322 |
- MWF.xApplication.cms = MWF.xApplication.cms || {};
- MWF.xApplication.cms.Module = MWF.xApplication.cms.Module || {};
- MWF.require("MWF.xAction.org.express.RestActions", null,false);
- MWF.xDesktop.requireApp("cms.Module", "lp."+MWF.language, null, false);
- MWF.xDesktop.requireApp("cms.Module", "package", null, false);
- MWF.xDesktop.requireApp("process.Application", "Viewer", null, false);
- MWF.xDesktop.requireApp("query.Query", "Viewer", null, false);
- MWF.xApplication.cms.Module.ViewExplorer = new Class({
- Extends: MWF.widget.Common,
- Implements: [Options, Events],
- options: {
- "style": "default",
- "isAdmin": false,
- "searchKey" : ""
- },
- initialize: function( node, app, columnData, categoryData, revealData, options, searchNode ){
- this.setOptions(options);
- this.node = node;
- this.app = app;
- this.columnData = columnData;
- this.categoryData = categoryData;
- this.revealData = revealData;
- this.searchNode = searchNode;
- this.path = "../x_component_cms_Module/$ViewExplorer/";
- this.cssPath = "../x_component_cms_Module/$ViewExplorer/"+this.options.style+"/css.wcss";
- this._loadCss();
- },
- reload: function(){
- this.node.empty();
- this.searchNode.empty();
- this.load();
- },
- load : function(){
- this.loadContentNode();
- this.loadQuryView();
- //if( this.revealData.viewType ){
- // this.loadQuryView(); //QeuryView
- //}else{
- // this.loadView(); //CMSView
- //}
- },
- loadContentNode: function(){
- this.elementContentNode = new Element("div", {
- "styles": this.css.elementContentNode
- }).inject(this.node);
- this.searchContainer = new Element("div",{
- "styles" : this.css.searchContainer
- }).inject( this.searchNode );
- this.resizeFun = function(){this.setContentSize();}.bind(this);
- this.app.addEvent("resize", this.resizeFun );
- },
- loadQuryView : function(){
- var viewJson = {
- "application": this.revealData.appName,
- "viewName": this.revealData.name,
- "isTitle": "yes",
- "select": "none",
- "titleStyles": this.css.normalThNode,
- "itemStyles": {},
- // "isExpand": "no",
- "filter": []
- };
- this.view = new MWF.xApplication.cms.Module.QueryViewer(this.elementContentNode, viewJson, {
- "hasAction" : this.options.isAdmin,
- "resizeNode": true,
- "selectEnable" : this.selectEnable,
- "onSelect": function(){
- this.fireEvent("select");
- }.bind(this)
- }, this.app, this.searchContainer);
- this.setContentSize();
- },
- //loadView : function(){
- // var viewJson = {
- // "application": this.columnData.id,
- // "viewName": this.revealData.name,
- // "isTitle": "yes",
- // "select": "none", //none , single, multi
- // "titleStyles": this.css.normalThNode,
- // "isExpand": "no",
- // "itemStyles": {}
- // };
- //
- // this.view = new MWF.xApplication.cms.Module.Viewer(this.elementContentNode, viewJson, {
- // "type" : "cms",
- // "hasAction" : this.options.isAdmin,
- // "actions": {
- // //"lookup": {"uri": "/jaxrs/queryview/flag/{view}/application/flag/{application}/execute", "method":"PUT"},
- // //"getView": {"uri": "/jaxrs/queryview/flag/{view}/application/flag/{application}"},
- // "lookup": {"uri": "/jaxrs/view/{view}/execute", "method":"PUT"},
- // "getView": {"uri": "/jaxrs/view/{view}"},
- // "deleteDocument" : {"uri":"/jaxrs/document/{id}","method": "DELETE"}
- // },
- // "actionRoot": "x_query_assemble_surface",
- // "resizeNode": true,
- // "selectEnable" : this.selectEnable,
- // "onSelect": function(){
- // this.fireEvent("select");
- // }.bind(this)
- // }, this.app, this.searchContainer);
- //
- // this.setContentSize();
- //},
- selectMode : function(){
- this.selectEnable = true;
- this.view.selectMode()
- },
- disableSelectMode : function(){
- this.selectEnable = false;
- this.view.disableSelectMode()
- },
- getSelectedIds : function(){
- return this.view.getSelectedIds();
- },
- setContentSize: function(){
- var toolbarSize = this.toolbarNode ? this.toolbarNode.getSize() : {"x":0,"y":0};
- var titlebarSize = {"x":0,"y":0}; //this.app.titleBar ? this.app.titleBar.getSize() : {"x":0,"y":0};
- var nodeSize = this.app.node.getSize();
- var pt = 0; //this.elementContentNode.getStyle("padding-top").toFloat();
- var pb = 0; // this.elementContentNode.getStyle("padding-bottom").toFloat();
- var filterConditionSize = this.filterConditionNode ? this.filterConditionNode.getSize() : {"x":0,"y":0};
- var height = nodeSize.y-toolbarSize.y-pt-pb-filterConditionSize.y-titlebarSize.y;
- this.elementContentNode.setStyle("height", ""+height+"px");
- if( this.view )this.view.setContentHeight();
- }
- });
- MWF.xApplication.cms.Module.QueryViewer = new Class({
- Implements: [Options, Events],
- Extends: MWF.QViewer,
- options: {
- "style": "default",
- "hasAction" : false, //cxy add
- "resizeNode": true,
- "paging" : "scroll",
- "perPageCount" : 50,
- "selectEnable" : false
- },
- initialize: function(container, json, options, app, searchContainer){
- this.setOptions(options);
- this.app = app;
- this.searchContainer = searchContainer;
- this.path = "../x_component_cms_Module/$ViewExplorer/";
- this.cssPath = "../x_component_cms_Module/$ViewExplorer/"+this.options.style+"/viewer.wcss";
- this._loadCss();
- this.lp = MWF.xApplication.query.Query.LP;
- this.container = $(container);
- this.json = json;
- this.viewJson = null;
- this.filterItems = [];
- this.searchStatus = "none"; //none, custom, default
- this.originalJson = Object.clone(json);
- this.selectEnable = this.options.selectEnable;
- this.items = [];
- this.selectedItems = [];
- this.hideColumns = [];
- this.openColumns = [];
- this.gridJson = null;
- this.init(function(){
- this.load();
- }.bind(this));
- },
- selectMode : function(){
- this.selectEnable = true;
- this.createSelectTh();
- this.items.each( function (it) {
- if( it.clazzType == "category" ){
- it.items.each( function(i){
- i.createSelectTd();
- })
- }else{
- it.createSelectTd();
- }
- }.bind(this));
- },
- disableSelectMode : function(){
- this.selectEnable = false;
- this.destroySelectTh();
- this.items.each( function (it) {
- if( it.clazzType == "category" ){
- it.items.each( function(i){
- i.destroySelectTd();
- })
- }else{
- it.destroySelectTd();
- }
- }.bind(this));
- },
- destroySelectTh : function(){
- if( this.selectTh ){
- this.selectTh.destroy();
- this.selectTh = null;
- }
- },
- createSelectTh : function(){
- var viewStyles = this.viewJson.viewStyles;
- var viewTitleCellNode = (viewStyles && viewStyles["titleTd"]) ? viewStyles["titleTd"] : this.css.viewTitleCellNode;
- this.selectTh = new Element("td",{
- styles: viewTitleCellNode
- }).inject(this.viewTitleLine, "top");
- this.selectTh.setStyles({width:"20px"});
- this.checkboxElement = new Element("input", {
- "type": "checkbox"
- }).inject(this.selectTh);
- this.checkboxElement.addEvent("click", function () {
- this.selectAll()
- }.bind(this));
- },
- selectAll : function () {
- var flag = this.checkboxElement.get("checked");
- this.items.each(function (it) {
- if( it.clazzType == "category" ){
- it.expand();
- it.items.each( function(i){
- if (i.checkboxElement)i.checkboxElement.set("checked", flag)
- })
- }else{
- if (it.checkboxElement)it.checkboxElement.set("checked", flag)
- }
- }.bind(this))
- },
- getSelectedIds : function(){
- var checkedItems = [];
- this.items.each(function (it) {
- if( it.clazzType == "category" ){
- it.items.each( function(i){
- if (i.checkboxElement.get("checked")) {
- checkedItems.push( i.data.bundle )
- }
- })
- }else{
- if (it.checkboxElement.get("checked")) {
- checkedItems.push( it.data.bundle )
- }
- }
- }.bind(this));
- return checkedItems;
- },
- getSelectedItems : function(){
- var checkedItems = [];
- this.items.each(function (it) {
- if( it.clazzType == "category" ){
- it.items.each( function(i){
- if (i.checkboxElement.get("checked")) {
- checkedItems.push( i )
- }
- })
- }else{
- if (it.checkboxElement.get("checked")) {
- checkedItems.push( it )
- }
- }
- }.bind(this));
- return checkedItems;
- },
- createViewNode: function(data){
- this.viewAreaNode.empty();
- var viewStyles = this.viewJson.viewStyles;
- this.contentAreaNode = new Element("div", {"styles":
- (viewStyles && viewStyles["container"]) ? viewStyles["container"] : this.css.contentAreaNode
- }).inject(this.viewAreaNode);
- this.viewTable = new Element("table.viewTable", {
- "styles": this.css.viewTitleTableNode,
- "border": "0px",
- "cellPadding": "0",
- "cellSpacing": "0"
- }).inject(this.contentAreaNode);
- if( viewStyles ){
- if( viewStyles["tableProperties"] )this.viewTable.set(viewStyles["tableProperties"]);
- if( viewStyles["table"] )this.viewTable.setStyles(viewStyles["table"]);
- }
- this.createLoadding();
- var viewTitleCellNode = (viewStyles && viewStyles["titleTd"]) ? viewStyles["titleTd"] : this.css.viewTitleCellNode;
- debugger;
- if (this.json.isTitle!=="no"){
- this.viewTitleLine = new Element("tr.viewTitleLine", {
- "styles": (viewStyles && viewStyles["titleTr"]) ? viewStyles["titleTr"] : this.css.viewTitleLineNode
- }).inject(this.viewTable);
- if( this.selectEnable ){
- this.createSelectTh();
- }
- //if (this.json.select==="single" || this.json.select==="multi") {
- this.selectTitleCell = new Element("td", {
- "styles": viewTitleCellNode
- }).inject(this.viewTitleLine);
- this.selectTitleCell.setStyle("width", "10px");
- // if (this.json.titleStyles) this.selectTitleCell.setStyles(this.json.titleStyles);
- //}
- this.viewJson.firstTdHidden = true;
- if( this.json.defaultSelectedScript )this.json.defaultSelectedScript = "";
- if( this.viewJson.defaultSelectedScript )this.viewJson.defaultSelectedScript = "";
- if( this.json.selectedAbleScript )this.json.selectedAbleScript = "";
- if( this.viewJson.selectedAbleScript )this.viewJson.selectedAbleScript = "";
- if( this.isSelectTdHidden() ){
- this.selectTitleCell.hide();
- }
- //序号
- if (this.viewJson.isSequence==="yes"){
- this.sequenceTitleCell = new Element("td", {
- "styles": viewTitleCellNode
- }).inject(this.viewTitleLine);
- this.sequenceTitleCell.setStyle("width", "10px");
- // if (this.json.titleStyles) this.sequenceTitleCell.setStyles(this.json.titleStyles);
- }
- this.entries = {};
- this.viewJson.selectList.each(function(column){
- this.entries[column.column] = column;
- if (!column.hideColumn){
- var viewCell = new Element("td", {
- "styles": viewTitleCellNode,
- "text": column.displayName
- }).inject(this.viewTitleLine);
- var size = MWF.getTextSize(column.displayName, viewTitleCellNode);
- viewCell.setStyle("min-width", ""+size.x+"px");
- // if (this.json.titleStyles) viewCell.setStyles(this.json.titleStyles);
- }else{
- this.hideColumns.push(column.column);
- }
- if (column.allowOpen) this.openColumns.push(column.column);
- }.bind(this));
- if( this.options.hasAction ){
- var viewCell = new Element("td", {
- "styles": viewTitleCellNode,
- "text": this.lp.action
- }).inject(this.viewTitleLine);
- viewCell.setStyle("width","40px");
- // if (this.json.titleStyles) viewCell.setStyles(this.json.titleStyles);
- }
- this.lookup(data);
- }else{
- this.entries = {};
- this.viewJson.selectList.each(function(column){
- this.entries[column.column] = column;
- if (column.hideColumn) this.hideColumns.push(column.column);
- if (!column.allowOpen) this.openColumns.push(column.column);
- }.bind(this));
- this.lookup(data);
- }
- },
- loadLayout: function(){
- this.node = new Element("div", {"styles": this.css.node}).inject(this.container);
- this.actionbarAreaNode = new Element("div.actionbarAreaNode", {"styles": this.css.actionbarAreaNode}).inject(this.node);
- // if (this.options.export) this.exportAreaNode = new Element("div", {"styles": this.css.exportAreaNode}).inject(this.node);
- this.searchAreaNode = new Element("div", {"styles": this.css.searchAreaNode}).inject(this.searchContainer || this.node );
- this.viewAreaNode = new Element("div.viewAreaNode", {"styles": this.css.viewAreaNode}).inject(this.node);
- // this.viewPageNode = new Element("div", {"styles": this.css.viewPageNode}).inject(this.node);
- this.viewPageAreaNode = new Element("div", {"styles": this.css.viewPageAreaNode}).inject(this.node);
- },
- //loadData: function(){
- // if (this.gridJson.length){
- // this.gridJson.each(function(line, i){
- // this.items.push(new MWF.xApplication.cms.Module.QueryViewer.Item(this, line, null, i));
- // }.bind(this));
- // }
- //},
- loadData: function(){
- if( this.checkboxElement ){
- this.checkboxElement.set("checked", false )
- }
- if (this.gridJson.length){
- if( !this.options.paging ){
- this.gridJson.each(function(line, i){
- this.items.push(new MWF.xApplication.cms.Module.QueryViewer.Item(this, line, null, i));
- }.bind(this));
- }else{
- this.loadPaging();
- }
- }else{
- if (this.viewPageAreaNode) this.viewPageAreaNode.empty();
- }
- },
- loadPaging : function(){
- this.isItemsLoading = false;
- this.pageNumber = 0;
- this.isItemsLoaded = false;
- this.isSetedScroll = false;
- this.setScroll();
- this.loadDataByPaging()
- },
- setScroll : function(){
- if( this.options.paging && !this.isSetedScroll ){
- this.contentAreaNode.setStyle("overflow","auto");
- this.scrollContainerFun = function(){
- var scrollSize = this.contentAreaNode.getScrollSize();
- var clientSize = this.contentAreaNode.getSize();
- var scrollHeight = scrollSize.y - clientSize.y;
- //alert( "clientSize.y=" + clientSize.y + " scrollSize.y="+scrollSize.y + " this.contentAreaNode.scrollTop="+this.contentAreaNode.scrollTop);
- if (this.contentAreaNode.scrollTop + 150 > scrollHeight ) {
- if (!this.isItemsLoaded) this.loadDataByPaging();
- }
- }.bind(this);
- this.isSetedScroll = true;
- this.contentAreaNode.addEvent("scroll", this.scrollContainerFun )
- }
- },
- loadDataByPaging : function(){
- if( this.isItemsLoading )return;
- if( !this.isItemsLoaded ){
- var from = Math.min( this.pageNumber * this.options.perPageCount , this.gridJson.length);
- var to = Math.min( ( this.pageNumber + 1 ) * this.options.perPageCount + 1 , this.gridJson.length);
- this.isItemsLoading = true;
- for( var i = from; i<to; i++ ){
- this.items.push(new MWF.xApplication.cms.Module.QueryViewer.Item(this, this.gridJson[i], null, i));
- }
- this.isItemsLoading = false;
- this.pageNumber ++;
- if( to == this.gridJson.length )this.isItemsLoaded = true;
- }
- },
- loadGroupData: function(){
- if( this.checkboxElement ){
- this.checkboxElement.set("checked", false )
- }
- if (this.selectTitleCell && !this.selectTitleCell.retrieve("expandLoaded") ){
- if( this.viewJson.viewStyles && this.viewJson.viewStyles["groupCollapseNode"] ){
- this.expandAllNode = new Element("span", {
- styles : this.viewJson.viewStyles["groupCollapseNode"]
- }).inject( this.selectTitleCell );
- this.selectTitleCell.setStyle("cursor", "pointer");
- }else{
- this.selectTitleCell.set("html", "<span style='font-family: Webdings'>"+"<img src='../x_component_query_Query/$Viewer/"+this.options.style+"/icon/expand.png'/>"+"</span>");
- }
- this.selectTitleCell.setStyle("cursor", "pointer");
- this.selectTitleCell.addEvent("click", this.expandOrCollapseAll.bind(this));
- this.selectTitleCell.store("expandLoaded", true);
- }
- // this.expandAll = false;
- if (this.gridJson.length){
- var i = 0;
- this.gridJson.each(function(data){
- this.items.push(new MWF.xApplication.cms.Module.QueryViewer.ItemCategory(this, data, i));
- i += data.list.length;
- }.bind(this));
- if (this.getExpandFlag()=="yes")this.expandOrCollapseAll();
- }else{
- if (this.viewPageAreaNode) this.viewPageAreaNode.empty();
- }
- },
- createSearchNode: function(){
- if (this.viewJson.customFilterList && this.viewJson.customFilterList.length){
- this.searchStatus = "default";
- this.loadFilterSearch();
- this.originalSearchContainerWidth = this.searchContainer.getSize().x;
- this.viewSearchCustomActionNode.addEvents({
- "click": function(){
- var parent = this.searchContainer.getParent();
- if( parent ){
- var x = parent.getParent().getSize().x;
- this.searchContainer.setStyle("width", Math.min( 800, x ) + "px" );
- }
- }.bind(this)
- });
- }else{
- this.searchStatus = "simple";
- this.loadSimpleSearch();
- }
- },
- loadSimpleSearch: function(){
- return false;
- this.searchSimpleNode = new Element("div", {"styles": this.css.searchSimpleNode}).inject(this.searchAreaNode);
- this.searchSimpleButtonNode = new Element("div", {"styles": this.css.searchSimpleButtonNode}).inject(this.searchSimpleNode);
- this.searchSimpleWarpNode = new Element("div", {"style": "margin-right: 40px; margin-left: 5px; height: 24px; overflow: hidden;"}).inject(this.searchSimpleNode);
- this.searchSimpleInputNode = new Element("input", {"type":"text", "styles": this.css.searchSimpleInputNode, "value": this.lp.searchKeywork}).inject(this.searchSimpleWarpNode);
- this.searchSimpleButtonNode.addEvent("click", function(){
- this.search();
- }.bind(this));
- this.searchSimpleInputNode.addEvents({
- "focus": function(){
- if (this.searchSimpleInputNode.get("value")===this.lp.searchKeywork) this.searchSimpleInputNode.set("value", "");
- }.bind(this),
- "blur": function(){if (!this.searchSimpleInputNode.get("value")) this.searchSimpleInputNode.set("value", this.lp.searchKeywork);}.bind(this),
- "keydown": function(e){
- if (e.code===13) this.search();
- }.bind(this)
- });
- },
- _loadPageNode : function(){
- this.viewPageAreaNode.empty();
- if( this.viewJson.pagingbarHidden === true ){
- return;
- }
- if( !this.paging ){
- var json;
- if( !this.viewJson.pagingList || !this.viewJson.pagingList.length ){
- json = {
- "firstPageText": this.lp.firstPage,
- "lastPageText": this.lp.lastPage
- };
- }else{
- json = this.viewJson.pagingList[0];
- }
- this.paging = new MWF.xApplication.query.Query.Viewer.Paging(this.viewPageAreaNode, json, this, {useMainColor: true});
- this.paging.load();
- }else{
- this.paging.reload();
- }
- },
- setContentHeight: function(){
- if( this.viewSearchCustomCloseActionNode && !this.setCustomSearchCloseEvent ){
- this.viewSearchCustomCloseActionNode.addEvent("click", function(){
- this.searchContainer.setStyle("width", this.originalSearchContainerWidth + "px" );
- }.bind(this));
- this.setCustomSearchCloseEvent = true;
- }
- if(this.viewSearchInputAreaNode)this.viewSearchInputAreaNode.setStyle("width","auto");
- debugger;
- if( this.node && this.searchContainer && this.viewAreaNode ){
- var size = this.node.getSize();
- var searchSize;
- var parent = this.searchContainer.getParent();
- if( parent ){
- searchSize = parent.getParent().getSize();
- }else{
- searchSize = this.searchContainer.getSize();
- }
- var h = size.y-searchSize.y; // - 80; //80是视图翻页条的高度
- if( this.actionbarAreaNode ){
- var exportSize = this.actionbarAreaNode.getComputedSize();
- h = h-exportSize.totalHeight;
- }
- var pageSize = this.viewPageAreaNode.getComputedSize();
- h = h-pageSize.totalHeight;
- this.viewAreaNode.setStyle("height", ""+h+"px");
- }
- }
- });
- MWF.xApplication.cms.Module.QueryViewer.Item = new Class({
- Extends : MWF.xApplication.query.Query.Viewer.Item,
- load: function(){
- this.view.fireEvent("queryLoadItemRow", [null, this]);
- var _self = this;
- var viewStyles = this.view.viewJson.viewStyles;
- var viewContentTdNode = ( viewStyles && viewStyles["contentTd"] ) ? viewStyles["contentTd"] : this.css.viewContentTdNode;
- this.node = new Element("tr", {
- "styles": ( viewStyles && viewStyles["contentTr"] ) ? viewStyles["contentTr"] : this.css.viewContentTrNode
- });
- if (this.prev){
- this.node.inject(this.prev.node, "after");
- }else{
- this.node.inject(this.view.viewTable);
- }
- this.node.addEvents({
- mouseover : function(){ this.setStyles(_self.css.viewContentTrNode_over) },
- mouseout : function(){ this.setStyles(_self.css.viewContentTrNode) }
- });
- if( this.view.selectEnable ){
- this.createSelectTd();
- }
- //if (this.view.json.select==="single" || this.view.json.select==="multi"){
- this.selectTd = new Element("td", { "styles": viewContentTdNode }).inject(this.node);
- this.selectTd.setStyles({"cursor": "pointer"});
- if (this.view.json.itemStyles) this.selectTd.setStyles(this.view.json.itemStyles);
- //}
- if( this.view.isSelectTdHidden() ){
- this.selectTd.hide();
- }
- //Object.each(this.data.data, function(cell, k){
- // if (this.view.hideColumns.indexOf(k)===-1){
- // var td = new Element("td", {"styles": this.css.viewContentTdNode}).inject(this.node);
- // if (k!== this.view.viewJson.group.column){
- // var v = (this.view.entries[k].code) ? MWF.Macro.exec(this.view.entries[k].code, {"value": cell, "gridData": this.view.gridJson, "data": this.view.viewData, "entry": this.data}) : cell;
- // td.set("text", v);
- // }
- // if (this.view.openColumns.indexOf(k)!==-1){
- // this.setOpenWork(td)
- // }
- // if (this.view.json.itemStyles) td.setStyles(this.view.json.itemStyles);
- // }
- //}.bind(this));
- //序号
- var sequence = 1+this.view.json.pageSize*(this.view.currentPage-1)+this.idx;
- this.data["$sequence"] = sequence;
- if (this.view.viewJson.isSequence==="yes"){
- this.sequenceTd = new Element("td", {"styles": viewContentTdNode}).inject(this.node);
- this.sequenceTd.setStyles({
- "width": "30px",
- "text-align": "center"
- });
- this.sequenceTd.set("text", sequence);
- }
- this.view.viewJson.selectList.each(function(column){
- var k = column.column;
- var cell = this.data.data[column.column];
- if (this.view.hideColumns.indexOf(k)===-1){
- var td = new Element("td", {"styles": viewContentTdNode}).inject(this.node);
- if (k!== this.view.viewJson.group.column){
- //var v = (this.view.entries[k].code) ? MWF.Macro.exec(this.view.entries[k].code, {"value": cell, "gridData": this.view.gridJson, "data": this.view.viewData, "entry": this.data}) : cell;
- //td.set("text", cell);
- var v = cell;
- if (column.isHtml){
- td.set("html", v);
- }else{
- td.set("text", v);
- }
- }
- if (this.view.openColumns.indexOf(k)!==-1){
- this.setOpenWork(td, column)
- }
- if (this.view.json.itemStyles) td.setStyles(this.view.json.itemStyles);
- }
- }.bind(this));
- if( this.view.options.hasAction ){
- var td = new Element("td", {"styles": this.css.viewContentTdNode}).inject(this.node);
- this.loadActions( td );
- if (this.view.json.itemStyles) td.setStyles(this.view.json.itemStyles);
- }
- this.setEvent();
- this.view.fireEvent("postLoadItemRow", [null, this]);
- },
- destroySelectTd : function(){
- if( this.checboxTd ){
- this.checboxTd.destroy();
- this.checboxTd = null;
- }
- },
- createSelectTd : function(){
- if( this.checboxTd )return;
- var viewStyles = this.view.viewJson.viewStyles;
- var viewContentTdNode = ( viewStyles && viewStyles["contentTd"] ) ? viewStyles["contentTd"] : this.css.viewContentTdNode;
- this.checboxTd = new Element("td", {styles:viewContentTdNode}).inject(this.node, "top");
- this.checkboxElement = new Element("input", {
- "type": "checkbox",
- "events" : { click : function(ev){ ev.stopPropagation(); } }
- }).inject(this.checboxTd);
- this.checboxTd.addEvent("click", function(ev){
- this.checkboxElement.set("checked", !this.checkboxElement.get("checked") );
- ev.stopPropagation();
- }.bind(this));
- },
- loadActions : function( container ){
- this.deleteNode = new Element("div.o2icon-delete", {"styles": this.css.actionDeleteNode, "title": this.view.lp.delete }).inject(container);
- this.deleteNode.addEvents({
- "mouseover": function(){
- this.deleteNode.setStyles(this.css.actionDeleteNode_over);
- this.deleteNode.addClass("mainColor_color");
- }.bind(this),
- "mouseout": function(){
- this.deleteNode.setStyles(this.css.actionDeleteNode);
- this.deleteNode.removeClass("mainColor_color");
- }.bind(this),
- //"mousedown": function(){this.deleteNode.setStyles(this.css.actionDeleteNode_down);}.bind(this),
- //"mouseup": function(){this.deleteNode.setStyles(this.css.actionDeleteNode_over);}.bind(this),
- "click": function(e){
- this.remove(e);
- e.stopPropagation();
- }.bind(this)
- });
- this.editNode = new Element("div.o2icon-edit2", {"styles": this.css.actionEditNode, "title": this.view.lp.edit }).inject(container);
- this.editNode.addEvents({
- "mouseover": function(){
- this.editNode.setStyles(this.css.actionEditNode_over);
- this.editNode.addClass("mainColor_color");
- }.bind(this),
- "mouseout": function(){
- this.editNode.setStyles(this.css.actionEditNode);
- this.editNode.removeClass("mainColor_color");
- }.bind(this),
- //"mousedown": function(){this.editNode.setStyles(this.css.actionEditNode_down);}.bind(this),
- //"mouseup": function(){this.editNode.setStyles(this.css.actionEditNode_over);}.bind(this),
- "click": function(e){
- this.editCMSDocument();
- e.stopPropagation();
- }.bind(this)
- });
- },
- setOpenWork: function(td, column){
- td.setStyle("cursor", "pointer");
- if( column.clickCode ) {
- // if( !this.view.Macro ){
- // MWF.require("MWF.xScript.Macro", function () {
- // this.view.businessData = {};
- // this.view.Macro = new MWF.Macro.PageContext(this.view);
- // }.bind(this), false);
- // }
- td.addEvent("click", function( ev ){
- var result = this.view.Macro.fire(column.clickCode, this, ev);
- ev.stopPropagation();
- return result;
- }.bind(this));
- }else{
- if (this.view.json.type==="cms"){
- td.addEvent("click", function(ev){
- this.openCMSDocument(false)
- ev.stopPropagation();
- }.bind(this));
- }else{
- td.addEvent("click", function(ev){
- this.openWorkAndCompleted(ev)
- ev.stopPropagation();
- }.bind(this));
- }
- }
- },
- openCMSDocument : function( isEdited ){
- var appId = "cms.Document"+this.data.bundle;
- if (layout.desktop.apps[appId]){
- if (!layout.desktop.apps[appId].window){
- layout.desktop.apps[appId] = null;
- layout.openApplication(null, layout.desktop.apps[appId].options.name, layout.desktop.apps[appId].options, layout.desktop.apps[appId].options.app, false, this, false);
- }else{
- layout.desktop.apps[appId].setCurrent();
- }
- //layout.desktop.apps[appId].setCurrent();
- }else {
- var options = {
- "documentId": this.data.bundle,
- "readonly" : !isEdited
- };
- layout.desktop.openApplication(null, "cms.Document", options);
- }
- },
- editCMSDocument : function(){
- this.openCMSDocument( true );
- },
- remove: function(e){
- var text = this.view.lp.deleteConfirmContent;
- var _self = this;
- this.node.setStyles(this.css.viewContentTrNode_delete);
- this.readyRemove = true;
- this.view.app.confirm("warn", e, this.view.lp.deleteConfirmTitle, text, 350, 120, function(){
- _self.removeCMSDocument(_self, false);
- this.close();
- }, function(){
- _self.node.setStyles(_self.css.viewContentTrNode );
- _self.readyRemove = false;
- this.close();
- });
- },
- removeCMSDocument: function(){
- var id = this.data.bundle;
- //this.view.lookupAction.invoke({"name": "deleteDocument","async": true, "parameter": {"id": id },"success": function(json){
- // this.readyRemove = false;
- // this.node.destroy();
- // this.view.app.notice("删除成功", "success");
- // MWF.release(this);
- //}.bind(this)});
- MWF.Actions.get("x_cms_assemble_control").removeDocument(id, function(json){
- this.readyRemove = false;
- this.node.destroy();
- this.view.app.notice( this.view.lp.deleteSuccessNotice, "success");
- MWF.release(this);
- }.bind(this));
- }
- });
- MWF.xApplication.cms.Module.QueryViewer.ItemCategory = new Class({
- Extends : MWF.xApplication.query.Query.Viewer.ItemCategory,
- load: function(){
- this.view.fireEvent("queryLoadCategoryRow", [null, this]);
- var viewStyles = this.view.viewJson.viewStyles;
- var viewContentCategoryTdNode = ( viewStyles && viewStyles["contentGroupTd"] ) ? viewStyles["contentGroupTd"] : this.css.viewContentCategoryTdNode;
- this.node = new Element("tr", {
- "styles": (viewStyles && viewStyles["contentTr"]) ? viewStyles["contentTr"] : this.css.viewContentTrNode
- }).inject(this.view.viewTable);
- //if (this.view.json.select==="single" || this.view.json.select==="multi"){
- this.selectTd = new Element("td", {"styles": viewContentCategoryTdNode}).inject(this.node);
- if (this.view.json.itemStyles) this.selectTd.setStyles(this.view.json.itemStyles);
- //}
- var colsapn = this.view.viewJson.selectList.length+1;
- if( this.view.options.hasAction ){
- colsapn ++
- }
- this.categoryTd = new Element("td", {
- "styles": viewContentCategoryTdNode,
- "colspan": colsapn
- }).inject(this.node);
- this.groupColumn = null;
- for (var c = 0; c<this.view.viewJson.selectList.length; c++){
- if (this.view.viewJson.selectList[c].column === this.view.viewJson.group.column){
- this.groupColumn = this.view.viewJson.selectList[c];
- break;
- }
- }
- if (this.groupColumn){
- //var text = (this.groupColumn.code) ? MWF.Macro.exec(this.groupColumn.code, {"value": this.data.group, "gridData": this.view.gridJson, "data": this.view.viewData, "entry": this.data}) : this.data.group;
- var text = this.data.group;
- }else{
- var text = this.data.group;
- }
- if( viewStyles && viewStyles["groupCollapseNode"] ){
- this.expandNode = new Element("span", {
- styles : viewStyles["groupCollapseNode"]
- }).inject( this.categoryTd );
- new Element("span", { text : text }).inject( this.categoryTd );
- // this.categoryTd.set("text", text );
- }else{
- this.categoryTd.set("html", "<span style='font-family: Webdings'><img src='../x_component_query_Query/$Viewer/"+this.view.options.style+"/icon/expand.png'/></span> "+text);
- }
- this.expanded = false;
- if (this.view.json.itemStyles) this.categoryTd.setStyles(this.view.json.itemStyles);
- this.setEvent();
- this.view.fireEvent("postLoadCategoryRow", [null, this]);
- },
- expand: function( from ){
- this.items.each(function(item){
- item.node.setStyle("display", "table-row");
- }.bind(this));
- if( this.expandNode ){
- this.expandNode.setStyles( this.view.viewJson.viewStyles["groupExpandNode"] )
- }else{
- this.node.getElement("span").set("html", "<img src='../x_component_query_Query/$Viewer/"+this.view.options.style+"/icon/down.png'/>");
- }
- this.expanded = true;
- if (!this.loadChild){
- //window.setTimeout(function(){
- this.data.list.each(function(line, i){
- var s = this.idx+i;
- this.lastItem = new MWF.xApplication.cms.Module.QueryViewer.Item(this.view, line, (this.lastItem || this), s);
- this.items.push(this.lastItem);
- //this.items.push(new MWF.xApplication.cms.Module.QueryViewer.Item(this.view, line, this));
- }.bind(this));
- this.loadChild = true;
- //}.bind(this), 10);
- }
- if( from !== "view" ){
- this.view.checkExpandAllStatus();
- }
- }
- });
- //MWF.xApplication.cms.Module.Viewer = new Class({
- // Implements: [Options, Events],
- // Extends: MWF.xApplication.process.Application.Viewer,
- // options: {
- // "style": "default",
- // "hasAction" : false, //cxy add
- // "resizeNode": true,
- // "actions": {
- // //"lookup": {"uri": "/jaxrs/queryview/flag/{view}/application/flag/{application}/execute", "method":"PUT"},
- // //"getView": {"uri": "/jaxrs/queryview/flag/{view}/application/flag/{application}"},
- // "lookup": {"uri": "/jaxrs/view/{view}/execute", "method":"PUT"},
- // "getView": {"uri": "/jaxrs/view/{view}"},
- // "listWorkByJob": {"uri": "/jaxrs/job/{job}/find/work/workcompleted"},
- // "listTaskByWork": {"uri": "/jaxrs/work/{id}/assignment/manage"}
- //
- // },
- // "actionRoot": "x_processplatform_assemble_surface"
- // },
- // initialize: function(container, json, options, app, searchContainer){
- // this.setOptions(options);
- // this.app = app;
- // this.searchContainer = searchContainer;
- //
- // this.path = "../x_component_cms_Module/$ViewExplorer/";
- // this.cssPath = "../x_component_cms_Module/$ViewExplorer/"+this.options.style+"/viewer.wcss";
- // this._loadCss();
- // this.lp = MWF.xApplication.process.Application.LP;
- //
- // this.container = $(container);
- // this.json = json;
- //
- // this.viewJson = null;
- // this.filterItems = [];
- // this.searchStatus = "none"; //none, custom, default
- //
- //
- // this.items = [];
- // this.selectedItems = [];
- // this.hideColumns = [];
- // this.openColumns = [];
- //
- // this.gridJson = null;
- //
- // this.init(function(){
- // this.load();
- // }.bind(this));
- // },
- // selectMode : function(){
- // this.selectEnable = true;
- // this.createSelectTh();
- // this.items.each( function (it) {
- // it.createSelectTd();
- // }.bind(this));
- // },
- // disableSelectMode : function(){
- // this.selectEnable = false;
- // this.destroySelectTh();
- // this.items.each( function (it) {
- // it.destroySelectTd();
- // }.bind(this));
- // },
- // destroySelectTh : function(){
- // if( this.selectTh ){
- // this.selectTh.destroy();
- // this.selectTh = null;
- // }
- // },
- // createSelectTh : function(){
- // this.selectTh = new Element("th").inject(this.viewTitleLine, "top");
- // this.checkboxElement = new Element("input", {
- // "type": "checkbox"
- // }).inject(this.selectTh);
- // this.checkboxElement.addEvent("click", function () {
- // this.selectAll()
- // }.bind(this));
- // },
- // selectAll : function () {
- // var flag = this.checkboxElement.get("checked");
- // this.items.each(function (it) {
- // if (it.checkboxElement)it.checkboxElement.set("checked", flag)
- // }.bind(this))
- // },
- // getSelectedIds : function(){
- // var checkedItems = [];
- // this.items.each(function (it) {
- // if (it.checkboxElement.get("checked")) {
- // checkedItems.push( it.data.bundle )
- // }
- // }.bind(this));
- // return checkedItems;
- // },
- // getSelectedItems : function(){
- // var checkedItems = [];
- // this.items.each(function (it) {
- // if (it.checkboxElement.get("checked")) {
- // checkedItems.push( it )
- // }
- // }.bind(this));
- // return checkedItems;
- // },
- // createViewNode: function(data){
- // this.viewAreaNode.empty();
- // this.contentAreaNode = new Element("div", {"styles": this.css.contentAreaNode}).inject(this.viewAreaNode);
- //
- // this.viewTable = new Element("table", {
- // "styles": this.css.viewTitleTableNode,
- // "border": "0px",
- // "cellPadding": "0",
- // "cellSpacing": "0"
- // }).inject(this.contentAreaNode);
- // this.createLoadding();
- //
- // if (this.json.isTitle!=="no"){
- // this.viewTitleLine = new Element("tr", {"styles": this.css.viewTitleLineNode}).inject(this.viewTable);
- //
- // //if (this.json.select==="single" || this.json.select==="multi") {
- // this.selectTitleCell = new Element("td", {
- // "styles": this.css.viewTitleCellNode
- // }).inject(this.viewTitleLine);
- // this.selectTitleCell.setStyle("width", "10px");
- // if (this.json.titleStyles) this.selectTitleCell.setStyles(this.json.titleStyles);
- // //}
- // this.entries = {};
- // this.viewJson.selectList.each(function(column){
- // this.entries[column.column] = column;
- //
- // if (!column.hideColumn){
- // var viewCell = new Element("td", {
- // "styles": this.css.viewTitleCellNode,
- // "text": column.displayName
- // }).inject(this.viewTitleLine);
- // if (this.json.titleStyles) viewCell.setStyles(this.json.titleStyles);
- // }else{
- // this.hideColumns.push(column.column);
- // }
- // if (column.allowOpen) this.openColumns.push(column.column);
- // }.bind(this));
- //
- // if( this.options.hasAction ){
- // var viewCell = new Element("td", {
- // "styles": this.css.viewTitleCellNode,
- // "text": "操作"
- // }).inject(this.viewTitleLine);
- // viewCell.setStyle("width","40px");
- // if (this.json.titleStyles) viewCell.setStyles(this.json.titleStyles);
- // }
- //
- // this.lookup(data);
- // }else{
- // this.viewJson.selectEntryList.each(function(column){
- // if (column.hideColumn) this.hideColumns.push(column.column);
- // if (!column.allowOpen) this.openColumns.push(column.column);
- // }.bind(this));
- // this.lookup(data);
- // }
- // },
- // lookup: function(data){
- // this.getLookupAction(function(){
- // if (this.json.application){
- // this.lookupAction.invoke({"name": "lookup","async": true, "data": (data || null), "parameter": {"view": this.json.name, "application": this.json.application},"success": function(json){
- // this.viewData = json.data;
- // if (this.viewJson.group.column){
- // this.gridJson = json.data.groupGrid;
- // this.loadGroupData();
- // }else{
- // this.gridJson = json.data.grid;
- // this.loadData();
- // }
- // if (this.loadingAreaNode){
- // this.loadingAreaNode.destroy();
- // this.loadingAreaNode = null;
- // }
- // }.bind(this)});
- // }
- // }.bind(this));
- // },
- // loadLayout: function(){
- // this.node = new Element("div", {"styles": this.css.node}).inject(this.container);
- // this.searchAreaNode = new Element("div", {"styles": this.css.searchAreaNode}).inject(this.searchContainer || this.node );
- // this.viewAreaNode = new Element("div", {"styles": this.css.viewAreaNode}).inject(this.node);
- // },
- // loadData: function(){
- // if (this.gridJson.length){
- // this.gridJson.each(function(line, i){
- // this.items.push(new MWF.xApplication.cms.Module.Viewer.Item(this, line, null, i));
- // }.bind(this));
- // }
- // },
- // loadGroupData: function(){
- // if (this.selectTitleCell){
- // this.selectTitleCell.set("html", "<span style='font-family: Webdings'>"+"<img src='../x_component_process_Application/$Viewer/"+this.options.style+"/icon/expand.png'/>"+"</span>");
- // this.selectTitleCell.setStyle("cursor", "pointer");
- // this.selectTitleCell.addEvent("click", this.expandOrCollapseAll.bind(this));
- // }
- //
- // if (this.gridJson.length){
- // this.gridJson.each(function(data){
- // this.items.push(new MWF.xApplication.cms.Module.Viewer.ItemCategory(this, data));
- // }.bind(this));
- //
- // if (this.json.isExpand=="yes")this.expandOrCollapseAll();
- // }
- // },
- // setContentHeight: function(){
- // if( this.node && this.searchAreaNode && this.viewAreaNode ){
- // var size = this.node.getSize();
- // var searchSize = this.searchAreaNode.getSize();
- // var h = size.y-searchSize.y;
- // this.viewAreaNode.setStyle("height", ""+h+"px");
- // }
- // }
- //});
- //
- //MWF.xApplication.cms.Module.Viewer.Item = new Class({
- // Extends : MWF.xApplication.process.Application.Viewer.Item,
- // load: function(){
- // var _self = this;
- // this.node = new Element("tr", {"styles": this.css.viewContentTrNode});
- // if (this.prev){
- // this.node.inject(this.prev.node, "after");
- // }else{
- // this.node.inject(this.view.viewTable);
- // }
- // this.node.addEvents({
- // mouseover : function(){ this.setStyles(_self.css.viewContentTrNode_over) },
- // mouseout : function(){ this.setStyles(_self.css.viewContentTrNode) }
- // });
- //
- // if( this.view.selectEnable ){
- // this.createSelectTd();
- // }
- //
- // //if (this.view.json.select==="single" || this.view.json.select==="multi"){
- // this.selectTd = new Element("td", {"styles": this.css.viewContentTdNode}).inject(this.node);
- // this.selectTd.setStyles({"cursor": "pointer"});
- // if (this.view.json.itemStyles) this.selectTd.setStyles(this.view.json.itemStyles);
- // //}
- //
- // debugger;
- // this.view.viewJson.selectList.each(function(column){
- // var k = column.column;
- // var cell = this.data.data[column.column];
- //
- // if (this.view.hideColumns.indexOf(k)===-1){
- // var td = new Element("td", {"styles": this.css.viewContentTdNode}).inject(this.node);
- // if (k!== this.view.viewJson.group.column){
- // var v = (this.view.entries[k].code) ? MWF.Macro.exec(this.view.entries[k].code, {"value": cell, "gridData": this.view.gridJson, "data": this.view.viewData, "entry": this.data}) : cell;
- // td.set("text", v);
- // }
- // if (this.view.openColumns.indexOf(k)!==-1){
- // this.setOpenWork(td)
- // }
- // if (this.view.json.itemStyles) td.setStyles(this.view.json.itemStyles);
- // }
- //
- // }.bind(this));
- //
- // //Object.each(this.data.data, function(cell, k){
- // // if (this.view.hideColumns.indexOf(k)===-1){
- // // var td = new Element("td", {"styles": this.css.viewContentTdNode}).inject(this.node);
- // // if (k!== this.view.viewJson.group.column){
- // // var v = (this.view.entries[k].code) ? MWF.Macro.exec(this.view.entries[k].code, {"value": cell, "gridData": this.view.gridJson, "data": this.view.viewData, "entry": this.data}) : cell;
- // // td.set("text", v);
- // // }
- // // if (this.view.openColumns.indexOf(k)!==-1){
- // // this.setOpenWork(td)
- // // }
- // // if (this.view.json.itemStyles) td.setStyles(this.view.json.itemStyles);
- // // }
- // //}.bind(this));
- //
- // if( this.view.options.hasAction ){
- // var td = new Element("td", {"styles": this.css.viewContentTdNode}).inject(this.node);
- // this.loadActions( td );
- // if (this.view.json.itemStyles) td.setStyles(this.view.json.itemStyles);
- // }
- //
- // this.setEvent();
- // },
- //
- // loadActions : function( container ){
- // this.deleteNode = new Element("div", {"styles": this.css.actionDeleteNode, "title": "删除"}).inject(container);
- // this.deleteNode.addEvents({
- // "mouseover": function(){this.deleteNode.setStyles(this.css.actionDeleteNode_over);}.bind(this),
- // "mouseout": function(){this.deleteNode.setStyles(this.css.actionDeleteNode);}.bind(this),
- // "mousedown": function(){this.deleteNode.setStyles(this.css.actionDeleteNode_down);}.bind(this),
- // "mouseup": function(){this.deleteNode.setStyles(this.css.actionDeleteNode_over);}.bind(this),
- // "click": function(e){
- // this.remove(e);
- // e.stopPropagation();
- // }.bind(this)
- // });
- //
- // this.editNode = new Element("div", {"styles": this.css.actionEditNode, "title": "编辑"}).inject(container);
- // this.editNode.addEvents({
- // "mouseover": function(){this.editNode.setStyles(this.css.actionEditNode_over);}.bind(this),
- // "mouseout": function(){this.editNode.setStyles(this.css.actionEditNode);}.bind(this),
- // "mousedown": function(){this.editNode.setStyles(this.css.actionEditNode_down);}.bind(this),
- // "mouseup": function(){this.editNode.setStyles(this.css.actionEditNode_over);}.bind(this),
- // "click": function(e){
- // this.editCMSDocument();
- // e.stopPropagation();
- // }.bind(this)
- // });
- // },
- // destroySelectTd : function(){
- // if( this.checboxTd ){
- // this.checboxTd.destroy();
- // this.checboxTd = null;
- // }
- // },
- // createSelectTd : function(){
- // if( this.checboxTd )return;
- // this.checboxTd = new Element("td").inject(this.node, "top");
- // this.checboxTd.addEvent("click", function(ev){
- // ev.stopPropagation();
- // });
- // this.checkboxElement = new Element("input", {
- // "type": "checkbox"
- // }).inject(this.checboxTd);
- // },
- // setOpenWork: function(td){
- // td.setStyle("cursor", "pointer");
- // td.addEvent("click", function(){
- // this.openCMSDocument()
- // }.bind(this));
- // },
- // openCMSDocument : function( isEdited ){
- // var appId = "cms.Document"+this.data.bundle;
- // if (layout.desktop.apps[appId]){
- // layout.desktop.apps[appId].setCurrent();
- // }else {
- // var options = {
- // "documentId": this.data.bundle,
- // "readonly" : !isEdited
- // };
- // layout.desktop.openApplication(null, "cms.Document", options);
- // }
- // },
- // editCMSDocument : function(){
- // this.openCMSDocument( true );
- // },
- // remove: function(e){
- // var text = "删除后不能恢复,你确定要删除该文档?";
- // var _self = this;
- // this.node.setStyles(this.css.viewContentTrNode_delete);
- // this.readyRemove = true;
- // this.view.app.confirm("warn", e, "删除确认", text, 350, 120, function(){
- //
- // _self.removeCMSDocument(_self, false);
- //
- // this.close();
- //
- // }, function(){
- // _self.node.setStyles(_self.css.viewContentTrNode );
- // _self.readyRemove = false;
- // this.close();
- // });
- // },
- // removeCMSDocument: function(){
- // var id = this.data.bundle;
- // MWF.Actions.get("x_cms_assemble_control").removeDocument(id, function(json){
- // //this.viewJson = JSON.decode(json.data.data);
- // //this.json = Object.merge(this.json, json.data);
- // this.readyRemove = false;
- // this.node.destroy();
- // this.view.app.notice("删除成功", "success");
- // MWF.release(this);
- // }.bind(this));
- // }
- //
- //});
- //
- //MWF.xApplication.cms.Module.Viewer.ItemCategory = new Class({
- // Extends : MWF.xApplication.process.Application.Viewer.ItemCategory,
- // load: function(){
- // this.node = new Element("tr", {"styles": this.css.viewContentTrNode}).inject(this.view.viewTable);
- // //if (this.view.json.select==="single" || this.view.json.select==="multi"){
- // this.selectTd = new Element("td", {"styles": this.css.viewContentCategoryTdNode}).inject(this.node);
- // if (this.view.json.itemStyles) this.selectTd.setStyles(this.view.json.itemStyles);
- // //}
- //
- // var colsapn = this.view.viewJson.selectList.length;
- // if( this.view.options.hasAction ){
- // colsapn ++
- // }
- //
- // this.categoryTd = new Element("td", {
- // "styles": this.css.viewContentCategoryTdNode,
- // "colspan": colsapn
- // }).inject(this.node);
- //
- // this.groupColumn = null;
- // for (var c = 0; c<this.view.viewJson.selectList.length; c++){
- // if (this.view.viewJson.selectList[c].column === this.view.viewJson.group.column){
- // this.groupColumn = this.view.viewJson.selectList[c];
- // break;
- // }
- // }
- // if (this.groupColumn){
- // var text = (this.groupColumn.code) ? MWF.Macro.exec(this.groupColumn.code, {"value": this.data.group, "gridData": this.view.gridJson, "data": this.view.viewData, "entry": this.data}) : this.data.group;
- // }else{
- // var text = this.data.group;
- // }
- //
- // this.categoryTd.set("html", "<span style='font-family: Webdings'><img src='../x_component_process_Application/$Viewer/"+this.view.options.style+"/icon/expand.png'/></span> "+text);
- // if (this.view.json.itemStyles) this.categoryTd.setStyles(this.view.json.itemStyles);
- //
- // this.setEvent();
- // },
- // expand: function(){
- // this.items.each(function(item){
- // item.node.setStyle("display", "table-row");
- // }.bind(this));
- // this.node.getElement("span").set("html", "<img src='../x_component_process_Application/$Viewer/"+this.view.options.style+"/icon/down.png'/>");
- // if (!this.loadChild){
- // //window.setTimeout(function(){
- // this.data.list.each(function(line){
- // this.items.push(new MWF.xApplication.cms.Module.Viewer.Item(this.view, line, this));
- // }.bind(this));
- // this.loadChild = true;
- // //}.bind(this), 10);
- // }
- // }
- //});
|