ViewExplorer.js 46 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104
  1. MWF.xApplication.cms = MWF.xApplication.cms || {};
  2. MWF.xApplication.cms.Module = MWF.xApplication.cms.Module || {};
  3. MWF.require("MWF.xAction.org.express.RestActions", null,false);
  4. MWF.xDesktop.requireApp("cms.Module", "lp."+MWF.language, null, false);
  5. MWF.xDesktop.requireApp("cms.Module", "package", null, false);
  6. MWF.xDesktop.requireApp("process.Application", "Viewer", null, false);
  7. MWF.xDesktop.requireApp("query.Query", "Viewer", null, false);
  8. MWF.xApplication.cms.Module.ViewExplorer = new Class({
  9. Extends: MWF.widget.Common,
  10. Implements: [Options, Events],
  11. options: {
  12. "style": "default",
  13. "isAdmin": false,
  14. "searchKey" : ""
  15. },
  16. initialize: function( node, app, columnData, categoryData, revealData, options, searchNode ){
  17. this.setOptions(options);
  18. this.node = node;
  19. this.app = app;
  20. this.columnData = columnData;
  21. this.categoryData = categoryData;
  22. this.revealData = revealData;
  23. this.searchNode = searchNode;
  24. this.path = "/x_component_cms_Module/$ViewExplorer/";
  25. this.cssPath = "/x_component_cms_Module/$ViewExplorer/"+this.options.style+"/css.wcss";
  26. this._loadCss();
  27. },
  28. reload: function(){
  29. this.node.empty();
  30. this.searchNode.empty();
  31. this.load();
  32. },
  33. load : function(){
  34. this.loadContentNode();
  35. this.loadQuryView();
  36. //if( this.revealData.viewType ){
  37. // this.loadQuryView(); //QeuryView
  38. //}else{
  39. // this.loadView(); //CMSView
  40. //}
  41. },
  42. loadContentNode: function(){
  43. this.elementContentNode = new Element("div", {
  44. "styles": this.css.elementContentNode
  45. }).inject(this.node);
  46. this.searchContainer = new Element("div",{
  47. "styles" : this.css.searchContainer
  48. }).inject( this.searchNode );
  49. this.resizeFun = function(){this.setContentSize();}.bind(this);
  50. this.app.addEvent("resize", this.resizeFun );
  51. },
  52. loadQuryView : function(){
  53. var viewJson = {
  54. "application": this.revealData.appName,
  55. "viewName": this.revealData.name,
  56. "isTitle": "yes",
  57. "select": "none",
  58. "titleStyles": this.css.normalThNode,
  59. "itemStyles": {},
  60. "isExpand": "no",
  61. "filter": []
  62. };
  63. this.view = new MWF.xApplication.cms.Module.QueryViewer(this.elementContentNode, viewJson, {
  64. "hasAction" : this.options.isAdmin,
  65. "resizeNode": true,
  66. "selectEnable" : this.selectEnable,
  67. "onSelect": function(){
  68. this.fireEvent("select");
  69. }.bind(this)
  70. }, this.app, this.searchContainer);
  71. this.setContentSize();
  72. },
  73. //loadView : function(){
  74. // var viewJson = {
  75. // "application": this.columnData.id,
  76. // "viewName": this.revealData.name,
  77. // "isTitle": "yes",
  78. // "select": "none", //none , single, multi
  79. // "titleStyles": this.css.normalThNode,
  80. // "isExpand": "no",
  81. // "itemStyles": {}
  82. // };
  83. //
  84. // this.view = new MWF.xApplication.cms.Module.Viewer(this.elementContentNode, viewJson, {
  85. // "type" : "cms",
  86. // "hasAction" : this.options.isAdmin,
  87. // "actions": {
  88. // //"lookup": {"uri": "/jaxrs/queryview/flag/{view}/application/flag/{application}/execute", "method":"PUT"},
  89. // //"getView": {"uri": "/jaxrs/queryview/flag/{view}/application/flag/{application}"},
  90. // "lookup": {"uri": "/jaxrs/view/{view}/execute", "method":"PUT"},
  91. // "getView": {"uri": "/jaxrs/view/{view}"},
  92. // "deleteDocument" : {"uri":"/jaxrs/document/{id}","method": "DELETE"}
  93. // },
  94. // "actionRoot": "x_query_assemble_surface",
  95. // "resizeNode": true,
  96. // "selectEnable" : this.selectEnable,
  97. // "onSelect": function(){
  98. // this.fireEvent("select");
  99. // }.bind(this)
  100. // }, this.app, this.searchContainer);
  101. //
  102. // this.setContentSize();
  103. //},
  104. selectMode : function(){
  105. this.selectEnable = true;
  106. this.view.selectMode()
  107. },
  108. disableSelectMode : function(){
  109. this.selectEnable = false;
  110. this.view.disableSelectMode()
  111. },
  112. getSelectedIds : function(){
  113. return this.view.getSelectedIds();
  114. },
  115. setContentSize: function(){
  116. var toolbarSize = this.toolbarNode ? this.toolbarNode.getSize() : {"x":0,"y":0};
  117. var titlebarSize = {"x":0,"y":0}; //this.app.titleBar ? this.app.titleBar.getSize() : {"x":0,"y":0};
  118. var nodeSize = this.app.node.getSize();
  119. var pt = 0; //this.elementContentNode.getStyle("padding-top").toFloat();
  120. var pb = 0; // this.elementContentNode.getStyle("padding-bottom").toFloat();
  121. var filterConditionSize = this.filterConditionNode ? this.filterConditionNode.getSize() : {"x":0,"y":0};
  122. var height = nodeSize.y-toolbarSize.y-pt-pb-filterConditionSize.y-titlebarSize.y;
  123. this.elementContentNode.setStyle("height", ""+height+"px");
  124. if( this.view )this.view.setContentHeight();
  125. }
  126. });
  127. MWF.xApplication.cms.Module.QueryViewer = new Class({
  128. Implements: [Options, Events],
  129. Extends: MWF.QViewer,
  130. options: {
  131. "style": "default",
  132. "hasAction" : false, //cxy add
  133. "resizeNode": true,
  134. "paging" : "scroll",
  135. "perPageCount" : 50,
  136. "selectEnable" : false
  137. },
  138. initialize: function(container, json, options, app, searchContainer){
  139. this.setOptions(options);
  140. this.app = app;
  141. this.searchContainer = searchContainer;
  142. this.path = "/x_component_cms_Module/$ViewExplorer/";
  143. this.cssPath = "/x_component_cms_Module/$ViewExplorer/"+this.options.style+"/viewer.wcss";
  144. this._loadCss();
  145. this.lp = MWF.xApplication.query.Query.LP;
  146. this.container = $(container);
  147. this.json = json;
  148. this.viewJson = null;
  149. this.filterItems = [];
  150. this.searchStatus = "none"; //none, custom, default
  151. this.selectEnable = this.options.selectEnable;
  152. this.items = [];
  153. this.selectedItems = [];
  154. this.hideColumns = [];
  155. this.openColumns = [];
  156. this.gridJson = null;
  157. this.init(function(){
  158. this.load();
  159. }.bind(this));
  160. },
  161. selectMode : function(){
  162. this.selectEnable = true;
  163. this.createSelectTh();
  164. this.items.each( function (it) {
  165. it.createSelectTd();
  166. }.bind(this));
  167. },
  168. disableSelectMode : function(){
  169. this.selectEnable = false;
  170. this.destroySelectTh();
  171. this.items.each( function (it) {
  172. it.destroySelectTd();
  173. }.bind(this));
  174. },
  175. destroySelectTh : function(){
  176. if( this.selectTh ){
  177. this.selectTh.destroy();
  178. this.selectTh = null;
  179. }
  180. },
  181. createSelectTh : function(){
  182. this.selectTh = new Element("th",{styles:{width:"20px"}}).inject(this.viewTitleLine, "top");
  183. this.checkboxElement = new Element("input", {
  184. "type": "checkbox"
  185. }).inject(this.selectTh);
  186. this.checkboxElement.addEvent("click", function () {
  187. this.selectAll()
  188. }.bind(this));
  189. },
  190. selectAll : function () {
  191. var flag = this.checkboxElement.get("checked");
  192. this.items.each(function (it) {
  193. if (it.checkboxElement)it.checkboxElement.set("checked", flag)
  194. }.bind(this))
  195. },
  196. getSelectedIds : function(){
  197. var checkedItems = [];
  198. this.items.each(function (it) {
  199. if (it.checkboxElement.get("checked")) {
  200. checkedItems.push( it.data.bundle )
  201. }
  202. }.bind(this));
  203. return checkedItems;
  204. },
  205. getSelectedItems : function(){
  206. var checkedItems = [];
  207. this.items.each(function (it) {
  208. if (it.checkboxElement.get("checked")) {
  209. checkedItems.push( it )
  210. }
  211. }.bind(this));
  212. return checkedItems;
  213. },
  214. createViewNode: function(data){
  215. this.viewAreaNode.empty();
  216. this.contentAreaNode = new Element("div.contentAreaNode", {"styles": this.css.contentAreaNode}).inject(this.viewAreaNode);
  217. this.viewTable = new Element("table.viewTable", {
  218. "styles": this.css.viewTitleTableNode,
  219. "border": "0px",
  220. "cellPadding": "0",
  221. "cellSpacing": "0"
  222. }).inject(this.contentAreaNode);
  223. this.createLoadding();
  224. if (this.json.isTitle!=="no"){
  225. this.viewTitleLine = new Element("tr", {"styles": this.css.viewTitleLineNode}).inject(this.viewTable);
  226. if( this.selectEnable ){
  227. this.createSelectTh();
  228. }
  229. //if (this.json.select==="single" || this.json.select==="multi") {
  230. //this.selectTitleCell = new Element("td", {
  231. // "styles": this.css.viewTitleCellNode
  232. //}).inject(this.viewTitleLine);
  233. //this.selectTitleCell.setStyle("width", "10px");
  234. //if (this.json.titleStyles) this.selectTitleCell.setStyles(this.json.titleStyles);
  235. //}
  236. this.entries = {};
  237. this.viewJson.selectList.each(function(column){
  238. this.entries[column.column] = column;
  239. if (!column.hideColumn){
  240. var viewCell = new Element("td", {
  241. "styles": this.css.viewTitleCellNode,
  242. "text": column.displayName
  243. }).inject(this.viewTitleLine);
  244. var size = MWF.getTextSize(column.displayName, this.css.viewTitleCellNode);
  245. viewCell.setStyle("min-width", ""+size.x+"px");
  246. if (this.json.titleStyles) viewCell.setStyles(this.json.titleStyles);
  247. }else{
  248. this.hideColumns.push(column.column);
  249. }
  250. if (column.allowOpen) this.openColumns.push(column.column);
  251. }.bind(this));
  252. if( this.options.hasAction ){
  253. var viewCell = new Element("td", {
  254. "styles": this.css.viewTitleCellNode,
  255. "text": "操作"
  256. }).inject(this.viewTitleLine);
  257. viewCell.setStyle("width","40px");
  258. if (this.json.titleStyles) viewCell.setStyles(this.json.titleStyles);
  259. }
  260. this.lookup(data);
  261. }else{
  262. this.viewJson.selectList.each(function(column){
  263. if (column.hideColumn) this.hideColumns.push(column.column);
  264. if (!column.allowOpen) this.openColumns.push(column.column);
  265. }.bind(this));
  266. this.lookup(data);
  267. }
  268. },
  269. loadLayout: function(){
  270. this.node = new Element("div", {"styles": this.css.node}).inject(this.container);
  271. if (this.options.export) this.exportAreaNode = new Element("div", {"styles": this.css.exportAreaNode}).inject(this.node);
  272. this.searchAreaNode = new Element("div", {"styles": this.css.searchAreaNode}).inject(this.searchContainer || this.node );
  273. this.viewAreaNode = new Element("div.viewAreaNode", {"styles": this.css.viewAreaNode}).inject(this.node);
  274. this.viewPageNode = new Element("div", {"styles": this.css.viewPageNode}).inject(this.node);
  275. this.viewPageAreaNode = new Element("div", {"styles": this.css.viewPageAreaNode}).inject(this.viewPageNode);
  276. },
  277. //loadData: function(){
  278. // if (this.gridJson.length){
  279. // this.gridJson.each(function(line, i){
  280. // this.items.push(new MWF.xApplication.cms.Module.QueryViewer.Item(this, line, null, i));
  281. // }.bind(this));
  282. // }
  283. //},
  284. loadData: function(){
  285. if (this.gridJson.length){
  286. if( !this.options.paging ){
  287. this.gridJson.each(function(line, i){
  288. this.items.push(new MWF.xApplication.cms.Module.QueryViewer.Item(this, line, null, i));
  289. }.bind(this));
  290. }else{
  291. this.loadPaging();
  292. }
  293. }
  294. },
  295. loadPaging : function(){
  296. this.isItemsLoading = false;
  297. this.pageNumber = 0;
  298. this.isItemsLoaded = false;
  299. this.isSetedScroll = false;
  300. this.setScroll();
  301. this.loadDataByPaging()
  302. },
  303. setScroll : function(){
  304. if( this.options.paging && !this.isSetedScroll ){
  305. this.contentAreaNode.setStyle("overflow","auto");
  306. this.scrollContainerFun = function(){
  307. var scrollSize = this.contentAreaNode.getScrollSize();
  308. var clientSize = this.contentAreaNode.getSize();
  309. var scrollHeight = scrollSize.y - clientSize.y;
  310. //alert( "clientSize.y=" + clientSize.y + " scrollSize.y="+scrollSize.y + " this.contentAreaNode.scrollTop="+this.contentAreaNode.scrollTop);
  311. if (this.contentAreaNode.scrollTop + 150 > scrollHeight ) {
  312. if (!this.isItemsLoaded) this.loadDataByPaging();
  313. }
  314. }.bind(this);
  315. this.isSetedScroll = true;
  316. this.contentAreaNode.addEvent("scroll", this.scrollContainerFun )
  317. }
  318. },
  319. loadDataByPaging : function(){
  320. if( this.isItemsLoading )return;
  321. if( !this.isItemsLoaded ){
  322. var from = Math.min( this.pageNumber * this.options.perPageCount , this.gridJson.length);
  323. var to = Math.min( ( this.pageNumber + 1 ) * this.options.perPageCount + 1 , this.gridJson.length);
  324. this.isItemsLoading = true;
  325. for( var i = from; i<to; i++ ){
  326. this.items.push(new MWF.xApplication.cms.Module.QueryViewer.Item(this, this.gridJson[i], null, i));
  327. }
  328. this.isItemsLoading = false;
  329. this.pageNumber ++;
  330. if( to == this.gridJson.length )this.isItemsLoaded = true;
  331. }
  332. },
  333. loadGroupData: function(){
  334. if (this.selectTitleCell){
  335. this.selectTitleCell.set("html", "<span style='font-family: Webdings'>"+"<img src='/x_component_process_Application/$Viewer/"+this.options.style+"/icon/expand.png'/>"+"</span>");
  336. this.selectTitleCell.setStyle("cursor", "pointer");
  337. this.selectTitleCell.addEvent("click", this.expandOrCollapseAll.bind(this));
  338. }
  339. if (this.gridJson.length){
  340. this.gridJson.each(function(data){
  341. this.items.push(new MWF.xApplication.cms.Module.QueryViewer.ItemCategory(this, data));
  342. }.bind(this));
  343. if (this.json.isExpand=="yes")this.expandOrCollapseAll();
  344. }
  345. },
  346. createSearchNode: function(){
  347. if (this.viewJson.customFilterList && this.viewJson.customFilterList.length){
  348. this.searchStatus = "default";
  349. this.loadFilterSearch();
  350. this.originalSearchContainerWidth = this.searchContainer.getSize().x;
  351. this.viewSearchCustomActionNode.addEvents({
  352. "click": function(){
  353. var parent = this.searchContainer.getParent();
  354. if( parent ){
  355. var x = parent.getParent().getSize().x;
  356. this.searchContainer.setStyle("width", Math.min( 800, x ) + "px" );
  357. }
  358. }.bind(this)
  359. });
  360. }else{
  361. this.searchStatus = "simple";
  362. this.loadSimpleSearch();
  363. }
  364. },
  365. loadSimpleSearch: function(){
  366. this.searchSimpleNode = new Element("div", {"styles": this.css.searchSimpleNode}).inject(this.searchAreaNode);
  367. this.searchSimpleButtonNode = new Element("div", {"styles": this.css.searchSimpleButtonNode}).inject(this.searchSimpleNode);
  368. this.searchSimpleWarpNode = new Element("div", {"style": "margin-right: 40px; margin-left: 5px; height: 24px; overflow: hidden;"}).inject(this.searchSimpleNode);
  369. this.searchSimpleInputNode = new Element("input", {"type":"text", "styles": this.css.searchSimpleInputNode, "value": this.lp.searchKeywork}).inject(this.searchSimpleWarpNode);
  370. this.searchSimpleButtonNode.addEvent("click", function(){
  371. this.search();
  372. }.bind(this));
  373. this.searchSimpleInputNode.addEvents({
  374. "focus": function(){
  375. if (this.searchSimpleInputNode.get("value")===this.lp.searchKeywork) this.searchSimpleInputNode.set("value", "");
  376. }.bind(this),
  377. "blur": function(){if (!this.searchSimpleInputNode.get("value")) this.searchSimpleInputNode.set("value", this.lp.searchKeywork);}.bind(this),
  378. "keydown": function(e){
  379. if (e.code===13) this.search();
  380. }.bind(this)
  381. });
  382. },
  383. setContentHeight: function(){
  384. if( this.viewSearchCustomCloseActionNode && !this.setCustomSearchCloseEvent ){
  385. this.viewSearchCustomCloseActionNode.addEvent("click", function(){
  386. this.searchContainer.setStyle("width", this.originalSearchContainerWidth + "px" );
  387. }.bind(this));
  388. this.setCustomSearchCloseEvent = true;
  389. }
  390. if(this.viewSearchInputAreaNode)this.viewSearchInputAreaNode.setStyle("width","auto");
  391. if( this.node && this.searchContainer && this.viewAreaNode ){
  392. var size = this.node.getSize();
  393. debugger;
  394. var searchSize;
  395. var parent = this.searchContainer.getParent();
  396. if( parent ){
  397. searchSize = parent.getParent().getSize();
  398. }else{
  399. searchSize = this.searchContainer.getSize();
  400. }
  401. var h = size.y-searchSize.y - 80; //80是视图翻页条的高度
  402. this.viewAreaNode.setStyle("height", ""+h+"px");
  403. }
  404. }
  405. });
  406. MWF.xApplication.cms.Module.QueryViewer.Item = new Class({
  407. Extends : MWF.xApplication.query.Query.Viewer.Item,
  408. load: function(){
  409. var _self = this;
  410. this.node = new Element("tr", {"styles": this.css.viewContentTrNode});
  411. if (this.prev){
  412. this.node.inject(this.prev.node, "after");
  413. }else{
  414. this.node.inject(this.view.viewTable);
  415. }
  416. this.node.addEvents({
  417. mouseover : function(){ this.setStyles(_self.css.viewContentTrNode_over) },
  418. mouseout : function(){ this.setStyles(_self.css.viewContentTrNode) }
  419. });
  420. if( this.view.selectEnable ){
  421. this.createSelectTd();
  422. }
  423. //if (this.view.json.select==="single" || this.view.json.select==="multi"){
  424. //this.selectTd = new Element("td", {"styles": this.css.viewContentTdNode}).inject(this.node);
  425. //this.selectTd.setStyles({"cursor": "pointer"});
  426. //if (this.view.json.itemStyles) this.selectTd.setStyles(this.view.json.itemStyles);
  427. //}
  428. //Object.each(this.data.data, function(cell, k){
  429. // if (this.view.hideColumns.indexOf(k)===-1){
  430. // var td = new Element("td", {"styles": this.css.viewContentTdNode}).inject(this.node);
  431. // if (k!== this.view.viewJson.group.column){
  432. // 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;
  433. // td.set("text", v);
  434. // }
  435. // if (this.view.openColumns.indexOf(k)!==-1){
  436. // this.setOpenWork(td)
  437. // }
  438. // if (this.view.json.itemStyles) td.setStyles(this.view.json.itemStyles);
  439. // }
  440. //}.bind(this));
  441. debugger;
  442. this.view.viewJson.selectList.each(function(column){
  443. var k = column.column;
  444. var cell = this.data.data[column.column];
  445. if (this.view.hideColumns.indexOf(k)===-1){
  446. var td = new Element("td", {"styles": this.css.viewContentTdNode}).inject(this.node);
  447. if (k!== this.view.viewJson.group.column){
  448. //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;
  449. td.set("text", cell);
  450. }
  451. if (this.view.openColumns.indexOf(k)!==-1){
  452. this.setOpenWork(td, column)
  453. }
  454. if (this.view.json.itemStyles) td.setStyles(this.view.json.itemStyles);
  455. }
  456. }.bind(this));
  457. if( this.view.options.hasAction ){
  458. var td = new Element("td", {"styles": this.css.viewContentTdNode}).inject(this.node);
  459. this.loadActions( td );
  460. if (this.view.json.itemStyles) td.setStyles(this.view.json.itemStyles);
  461. }
  462. this.setEvent();
  463. },
  464. destroySelectTd : function(){
  465. if( this.checboxTd ){
  466. this.checboxTd.destroy();
  467. this.checboxTd = null;
  468. }
  469. },
  470. createSelectTd : function(){
  471. if( this.checboxTd )return;
  472. this.checboxTd = new Element("td").inject(this.node, "top");
  473. this.checkboxElement = new Element("input", {
  474. "type": "checkbox",
  475. "events" : { click : function(ev){ ev.stopPropagation(); } }
  476. }).inject(this.checboxTd);
  477. this.checboxTd.addEvent("click", function(ev){
  478. this.checkboxElement.set("checked", !this.checkboxElement.get("checked") );
  479. ev.stopPropagation();
  480. }.bind(this));
  481. },
  482. loadActions : function( container ){
  483. this.deleteNode = new Element("div", {"styles": this.css.actionDeleteNode, "title": "删除"}).inject(container);
  484. this.deleteNode.addEvents({
  485. "mouseover": function(){this.deleteNode.setStyles(this.css.actionDeleteNode_over);}.bind(this),
  486. "mouseout": function(){this.deleteNode.setStyles(this.css.actionDeleteNode);}.bind(this),
  487. "mousedown": function(){this.deleteNode.setStyles(this.css.actionDeleteNode_down);}.bind(this),
  488. "mouseup": function(){this.deleteNode.setStyles(this.css.actionDeleteNode_over);}.bind(this),
  489. "click": function(e){
  490. this.remove(e);
  491. e.stopPropagation();
  492. }.bind(this)
  493. });
  494. this.editNode = new Element("div", {"styles": this.css.actionEditNode, "title": "编辑"}).inject(container);
  495. this.editNode.addEvents({
  496. "mouseover": function(){this.editNode.setStyles(this.css.actionEditNode_over);}.bind(this),
  497. "mouseout": function(){this.editNode.setStyles(this.css.actionEditNode);}.bind(this),
  498. "mousedown": function(){this.editNode.setStyles(this.css.actionEditNode_down);}.bind(this),
  499. "mouseup": function(){this.editNode.setStyles(this.css.actionEditNode_over);}.bind(this),
  500. "click": function(e){
  501. this.editCMSDocument();
  502. e.stopPropagation();
  503. }.bind(this)
  504. });
  505. },
  506. setOpenWork: function(td, column){
  507. td.setStyle("cursor", "pointer");
  508. if( column.clickCode ) {
  509. if (!this.view.Macro) {
  510. MWF.require("MWF.xScript.Macro", function () {
  511. this.view.businessData = {};
  512. this.view.Macro = new MWF.Macro.PageContext(this.view);
  513. }.bind(this), false);
  514. }
  515. td.addEvent("click", function( ev ){
  516. return this.view.Macro.fire(column.clickCode, this, ev);
  517. }.bind(this));
  518. }else{
  519. td.addEvent("click", function(){
  520. this.openCMSDocument()
  521. }.bind(this));
  522. }
  523. },
  524. openCMSDocument : function( isEdited ){
  525. var appId = "cms.Document"+this.data.bundle;
  526. if (layout.desktop.apps[appId]){
  527. if (!layout.desktop.apps[appId].window){
  528. layout.desktop.apps[appId] = null;
  529. layout.openApplication(null, layout.desktop.apps[appId].options.name, layout.desktop.apps[appId].options, layout.desktop.apps[appId].options.app, false, this, false);
  530. }else{
  531. layout.desktop.apps[appId].setCurrent();
  532. }
  533. //layout.desktop.apps[appId].setCurrent();
  534. }else {
  535. var options = {
  536. "documentId": this.data.bundle,
  537. "readonly" : !isEdited
  538. };
  539. layout.desktop.openApplication(null, "cms.Document", options);
  540. }
  541. },
  542. editCMSDocument : function(){
  543. this.openCMSDocument( true );
  544. },
  545. remove: function(e){
  546. var text = "删除后不能恢复,你确定要删除该文档?";
  547. var _self = this;
  548. this.node.setStyles(this.css.viewContentTrNode_delete);
  549. this.readyRemove = true;
  550. this.view.app.confirm("warn", e, "删除确认", text, 350, 120, function(){
  551. _self.removeCMSDocument(_self, false);
  552. this.close();
  553. }, function(){
  554. _self.node.setStyles(_self.css.viewContentTrNode );
  555. _self.readyRemove = false;
  556. this.close();
  557. });
  558. },
  559. removeCMSDocument: function(){
  560. var id = this.data.bundle;
  561. //this.view.lookupAction.invoke({"name": "deleteDocument","async": true, "parameter": {"id": id },"success": function(json){
  562. // this.readyRemove = false;
  563. // this.node.destroy();
  564. // this.view.app.notice("删除成功", "success");
  565. // MWF.release(this);
  566. //}.bind(this)});
  567. MWF.Actions.get("x_cms_assemble_control").removeDocument(id, function(json){
  568. this.readyRemove = false;
  569. this.node.destroy();
  570. this.view.app.notice("删除成功", "success");
  571. MWF.release(this);
  572. }.bind(this));
  573. }
  574. });
  575. MWF.xApplication.cms.Module.QueryViewer.ItemCategory = new Class({
  576. Extends : MWF.xApplication.query.Query.Viewer.ItemCategory,
  577. load: function(){
  578. this.node = new Element("tr", {"styles": this.css.viewContentTrNode}).inject(this.view.viewTable);
  579. //if (this.view.json.select==="single" || this.view.json.select==="multi"){
  580. this.selectTd = new Element("td", {"styles": this.css.viewContentCategoryTdNode}).inject(this.node);
  581. if (this.view.json.itemStyles) this.selectTd.setStyles(this.view.json.itemStyles);
  582. //}
  583. var colsapn = this.view.viewJson.selectList.length;
  584. if( this.view.options.hasAction ){
  585. colsapn ++
  586. }
  587. this.categoryTd = new Element("td", {
  588. "styles": this.css.viewContentCategoryTdNode,
  589. "colspan": colsapn
  590. }).inject(this.node);
  591. this.groupColumn = null;
  592. for (var c = 0; c<this.view.viewJson.selectList.length; c++){
  593. if (this.view.viewJson.selectList[c].column === this.view.viewJson.group.column){
  594. this.groupColumn = this.view.viewJson.selectList[c];
  595. break;
  596. }
  597. }
  598. if (this.groupColumn){
  599. 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;
  600. }else{
  601. var text = this.data.group;
  602. }
  603. 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);
  604. if (this.view.json.itemStyles) this.categoryTd.setStyles(this.view.json.itemStyles);
  605. this.setEvent();
  606. },
  607. expand: function(){
  608. this.items.each(function(item){
  609. item.node.setStyle("display", "table-row");
  610. }.bind(this));
  611. this.node.getElement("span").set("html", "<img src='/x_component_process_Application/$Viewer/"+this.view.options.style+"/icon/down.png'/>");
  612. if (!this.loadChild){
  613. //window.setTimeout(function(){
  614. this.data.list.each(function(line){
  615. this.items.push(new MWF.xApplication.cms.Module.QueryViewer.Item(this.view, line, this));
  616. }.bind(this));
  617. this.loadChild = true;
  618. //}.bind(this), 10);
  619. }
  620. }
  621. });
  622. //MWF.xApplication.cms.Module.Viewer = new Class({
  623. // Implements: [Options, Events],
  624. // Extends: MWF.xApplication.process.Application.Viewer,
  625. // options: {
  626. // "style": "default",
  627. // "hasAction" : false, //cxy add
  628. // "resizeNode": true,
  629. // "actions": {
  630. // //"lookup": {"uri": "/jaxrs/queryview/flag/{view}/application/flag/{application}/execute", "method":"PUT"},
  631. // //"getView": {"uri": "/jaxrs/queryview/flag/{view}/application/flag/{application}"},
  632. // "lookup": {"uri": "/jaxrs/view/{view}/execute", "method":"PUT"},
  633. // "getView": {"uri": "/jaxrs/view/{view}"},
  634. // "listWorkByJob": {"uri": "/jaxrs/job/{job}/find/work/workcompleted"},
  635. // "listTaskByWork": {"uri": "/jaxrs/work/{id}/assignment/manage"}
  636. //
  637. // },
  638. // "actionRoot": "x_processplatform_assemble_surface"
  639. // },
  640. // initialize: function(container, json, options, app, searchContainer){
  641. // this.setOptions(options);
  642. // this.app = app;
  643. // this.searchContainer = searchContainer;
  644. //
  645. // this.path = "/x_component_cms_Module/$ViewExplorer/";
  646. // this.cssPath = "/x_component_cms_Module/$ViewExplorer/"+this.options.style+"/viewer.wcss";
  647. // this._loadCss();
  648. // this.lp = MWF.xApplication.process.Application.LP;
  649. //
  650. // this.container = $(container);
  651. // this.json = json;
  652. //
  653. // this.viewJson = null;
  654. // this.filterItems = [];
  655. // this.searchStatus = "none"; //none, custom, default
  656. //
  657. //
  658. // this.items = [];
  659. // this.selectedItems = [];
  660. // this.hideColumns = [];
  661. // this.openColumns = [];
  662. //
  663. // this.gridJson = null;
  664. //
  665. // this.init(function(){
  666. // this.load();
  667. // }.bind(this));
  668. // },
  669. // selectMode : function(){
  670. // this.selectEnable = true;
  671. // this.createSelectTh();
  672. // this.items.each( function (it) {
  673. // it.createSelectTd();
  674. // }.bind(this));
  675. // },
  676. // disableSelectMode : function(){
  677. // this.selectEnable = false;
  678. // this.destroySelectTh();
  679. // this.items.each( function (it) {
  680. // it.destroySelectTd();
  681. // }.bind(this));
  682. // },
  683. // destroySelectTh : function(){
  684. // if( this.selectTh ){
  685. // this.selectTh.destroy();
  686. // this.selectTh = null;
  687. // }
  688. // },
  689. // createSelectTh : function(){
  690. // this.selectTh = new Element("th").inject(this.viewTitleLine, "top");
  691. // this.checkboxElement = new Element("input", {
  692. // "type": "checkbox"
  693. // }).inject(this.selectTh);
  694. // this.checkboxElement.addEvent("click", function () {
  695. // this.selectAll()
  696. // }.bind(this));
  697. // },
  698. // selectAll : function () {
  699. // var flag = this.checkboxElement.get("checked");
  700. // this.items.each(function (it) {
  701. // if (it.checkboxElement)it.checkboxElement.set("checked", flag)
  702. // }.bind(this))
  703. // },
  704. // getSelectedIds : function(){
  705. // var checkedItems = [];
  706. // this.items.each(function (it) {
  707. // if (it.checkboxElement.get("checked")) {
  708. // checkedItems.push( it.data.bundle )
  709. // }
  710. // }.bind(this));
  711. // return checkedItems;
  712. // },
  713. // getSelectedItems : function(){
  714. // var checkedItems = [];
  715. // this.items.each(function (it) {
  716. // if (it.checkboxElement.get("checked")) {
  717. // checkedItems.push( it )
  718. // }
  719. // }.bind(this));
  720. // return checkedItems;
  721. // },
  722. // createViewNode: function(data){
  723. // this.viewAreaNode.empty();
  724. // this.contentAreaNode = new Element("div", {"styles": this.css.contentAreaNode}).inject(this.viewAreaNode);
  725. //
  726. // this.viewTable = new Element("table", {
  727. // "styles": this.css.viewTitleTableNode,
  728. // "border": "0px",
  729. // "cellPadding": "0",
  730. // "cellSpacing": "0"
  731. // }).inject(this.contentAreaNode);
  732. // this.createLoadding();
  733. //
  734. // if (this.json.isTitle!=="no"){
  735. // this.viewTitleLine = new Element("tr", {"styles": this.css.viewTitleLineNode}).inject(this.viewTable);
  736. //
  737. // //if (this.json.select==="single" || this.json.select==="multi") {
  738. // this.selectTitleCell = new Element("td", {
  739. // "styles": this.css.viewTitleCellNode
  740. // }).inject(this.viewTitleLine);
  741. // this.selectTitleCell.setStyle("width", "10px");
  742. // if (this.json.titleStyles) this.selectTitleCell.setStyles(this.json.titleStyles);
  743. // //}
  744. // this.entries = {};
  745. // this.viewJson.selectList.each(function(column){
  746. // this.entries[column.column] = column;
  747. //
  748. // if (!column.hideColumn){
  749. // var viewCell = new Element("td", {
  750. // "styles": this.css.viewTitleCellNode,
  751. // "text": column.displayName
  752. // }).inject(this.viewTitleLine);
  753. // if (this.json.titleStyles) viewCell.setStyles(this.json.titleStyles);
  754. // }else{
  755. // this.hideColumns.push(column.column);
  756. // }
  757. // if (column.allowOpen) this.openColumns.push(column.column);
  758. // }.bind(this));
  759. //
  760. // if( this.options.hasAction ){
  761. // var viewCell = new Element("td", {
  762. // "styles": this.css.viewTitleCellNode,
  763. // "text": "操作"
  764. // }).inject(this.viewTitleLine);
  765. // viewCell.setStyle("width","40px");
  766. // if (this.json.titleStyles) viewCell.setStyles(this.json.titleStyles);
  767. // }
  768. //
  769. // this.lookup(data);
  770. // }else{
  771. // this.viewJson.selectEntryList.each(function(column){
  772. // if (column.hideColumn) this.hideColumns.push(column.column);
  773. // if (!column.allowOpen) this.openColumns.push(column.column);
  774. // }.bind(this));
  775. // this.lookup(data);
  776. // }
  777. // },
  778. // lookup: function(data){
  779. // this.getLookupAction(function(){
  780. // if (this.json.application){
  781. // this.lookupAction.invoke({"name": "lookup","async": true, "data": (data || null), "parameter": {"view": this.json.name, "application": this.json.application},"success": function(json){
  782. // this.viewData = json.data;
  783. // if (this.viewJson.group.column){
  784. // this.gridJson = json.data.groupGrid;
  785. // this.loadGroupData();
  786. // }else{
  787. // this.gridJson = json.data.grid;
  788. // this.loadData();
  789. // }
  790. // if (this.loadingAreaNode){
  791. // this.loadingAreaNode.destroy();
  792. // this.loadingAreaNode = null;
  793. // }
  794. // }.bind(this)});
  795. // }
  796. // }.bind(this));
  797. // },
  798. // loadLayout: function(){
  799. // this.node = new Element("div", {"styles": this.css.node}).inject(this.container);
  800. // this.searchAreaNode = new Element("div", {"styles": this.css.searchAreaNode}).inject(this.searchContainer || this.node );
  801. // this.viewAreaNode = new Element("div", {"styles": this.css.viewAreaNode}).inject(this.node);
  802. // },
  803. // loadData: function(){
  804. // if (this.gridJson.length){
  805. // this.gridJson.each(function(line, i){
  806. // this.items.push(new MWF.xApplication.cms.Module.Viewer.Item(this, line, null, i));
  807. // }.bind(this));
  808. // }
  809. // },
  810. // loadGroupData: function(){
  811. // if (this.selectTitleCell){
  812. // this.selectTitleCell.set("html", "<span style='font-family: Webdings'>"+"<img src='/x_component_process_Application/$Viewer/"+this.options.style+"/icon/expand.png'/>"+"</span>");
  813. // this.selectTitleCell.setStyle("cursor", "pointer");
  814. // this.selectTitleCell.addEvent("click", this.expandOrCollapseAll.bind(this));
  815. // }
  816. //
  817. // if (this.gridJson.length){
  818. // this.gridJson.each(function(data){
  819. // this.items.push(new MWF.xApplication.cms.Module.Viewer.ItemCategory(this, data));
  820. // }.bind(this));
  821. //
  822. // if (this.json.isExpand=="yes")this.expandOrCollapseAll();
  823. // }
  824. // },
  825. // setContentHeight: function(){
  826. // if( this.node && this.searchAreaNode && this.viewAreaNode ){
  827. // var size = this.node.getSize();
  828. // var searchSize = this.searchAreaNode.getSize();
  829. // var h = size.y-searchSize.y;
  830. // this.viewAreaNode.setStyle("height", ""+h+"px");
  831. // }
  832. // }
  833. //});
  834. //
  835. //MWF.xApplication.cms.Module.Viewer.Item = new Class({
  836. // Extends : MWF.xApplication.process.Application.Viewer.Item,
  837. // load: function(){
  838. // var _self = this;
  839. // this.node = new Element("tr", {"styles": this.css.viewContentTrNode});
  840. // if (this.prev){
  841. // this.node.inject(this.prev.node, "after");
  842. // }else{
  843. // this.node.inject(this.view.viewTable);
  844. // }
  845. // this.node.addEvents({
  846. // mouseover : function(){ this.setStyles(_self.css.viewContentTrNode_over) },
  847. // mouseout : function(){ this.setStyles(_self.css.viewContentTrNode) }
  848. // });
  849. //
  850. // if( this.view.selectEnable ){
  851. // this.createSelectTd();
  852. // }
  853. //
  854. // //if (this.view.json.select==="single" || this.view.json.select==="multi"){
  855. // this.selectTd = new Element("td", {"styles": this.css.viewContentTdNode}).inject(this.node);
  856. // this.selectTd.setStyles({"cursor": "pointer"});
  857. // if (this.view.json.itemStyles) this.selectTd.setStyles(this.view.json.itemStyles);
  858. // //}
  859. //
  860. // debugger;
  861. // this.view.viewJson.selectList.each(function(column){
  862. // var k = column.column;
  863. // var cell = this.data.data[column.column];
  864. //
  865. // if (this.view.hideColumns.indexOf(k)===-1){
  866. // var td = new Element("td", {"styles": this.css.viewContentTdNode}).inject(this.node);
  867. // if (k!== this.view.viewJson.group.column){
  868. // 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;
  869. // td.set("text", v);
  870. // }
  871. // if (this.view.openColumns.indexOf(k)!==-1){
  872. // this.setOpenWork(td)
  873. // }
  874. // if (this.view.json.itemStyles) td.setStyles(this.view.json.itemStyles);
  875. // }
  876. //
  877. // }.bind(this));
  878. //
  879. // //Object.each(this.data.data, function(cell, k){
  880. // // if (this.view.hideColumns.indexOf(k)===-1){
  881. // // var td = new Element("td", {"styles": this.css.viewContentTdNode}).inject(this.node);
  882. // // if (k!== this.view.viewJson.group.column){
  883. // // 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;
  884. // // td.set("text", v);
  885. // // }
  886. // // if (this.view.openColumns.indexOf(k)!==-1){
  887. // // this.setOpenWork(td)
  888. // // }
  889. // // if (this.view.json.itemStyles) td.setStyles(this.view.json.itemStyles);
  890. // // }
  891. // //}.bind(this));
  892. //
  893. // if( this.view.options.hasAction ){
  894. // var td = new Element("td", {"styles": this.css.viewContentTdNode}).inject(this.node);
  895. // this.loadActions( td );
  896. // if (this.view.json.itemStyles) td.setStyles(this.view.json.itemStyles);
  897. // }
  898. //
  899. // this.setEvent();
  900. // },
  901. //
  902. // loadActions : function( container ){
  903. // this.deleteNode = new Element("div", {"styles": this.css.actionDeleteNode, "title": "删除"}).inject(container);
  904. // this.deleteNode.addEvents({
  905. // "mouseover": function(){this.deleteNode.setStyles(this.css.actionDeleteNode_over);}.bind(this),
  906. // "mouseout": function(){this.deleteNode.setStyles(this.css.actionDeleteNode);}.bind(this),
  907. // "mousedown": function(){this.deleteNode.setStyles(this.css.actionDeleteNode_down);}.bind(this),
  908. // "mouseup": function(){this.deleteNode.setStyles(this.css.actionDeleteNode_over);}.bind(this),
  909. // "click": function(e){
  910. // this.remove(e);
  911. // e.stopPropagation();
  912. // }.bind(this)
  913. // });
  914. //
  915. // this.editNode = new Element("div", {"styles": this.css.actionEditNode, "title": "编辑"}).inject(container);
  916. // this.editNode.addEvents({
  917. // "mouseover": function(){this.editNode.setStyles(this.css.actionEditNode_over);}.bind(this),
  918. // "mouseout": function(){this.editNode.setStyles(this.css.actionEditNode);}.bind(this),
  919. // "mousedown": function(){this.editNode.setStyles(this.css.actionEditNode_down);}.bind(this),
  920. // "mouseup": function(){this.editNode.setStyles(this.css.actionEditNode_over);}.bind(this),
  921. // "click": function(e){
  922. // this.editCMSDocument();
  923. // e.stopPropagation();
  924. // }.bind(this)
  925. // });
  926. // },
  927. // destroySelectTd : function(){
  928. // if( this.checboxTd ){
  929. // this.checboxTd.destroy();
  930. // this.checboxTd = null;
  931. // }
  932. // },
  933. // createSelectTd : function(){
  934. // if( this.checboxTd )return;
  935. // this.checboxTd = new Element("td").inject(this.node, "top");
  936. // this.checboxTd.addEvent("click", function(ev){
  937. // ev.stopPropagation();
  938. // });
  939. // this.checkboxElement = new Element("input", {
  940. // "type": "checkbox"
  941. // }).inject(this.checboxTd);
  942. // },
  943. // setOpenWork: function(td){
  944. // td.setStyle("cursor", "pointer");
  945. // td.addEvent("click", function(){
  946. // this.openCMSDocument()
  947. // }.bind(this));
  948. // },
  949. // openCMSDocument : function( isEdited ){
  950. // var appId = "cms.Document"+this.data.bundle;
  951. // if (layout.desktop.apps[appId]){
  952. // layout.desktop.apps[appId].setCurrent();
  953. // }else {
  954. // var options = {
  955. // "documentId": this.data.bundle,
  956. // "readonly" : !isEdited
  957. // };
  958. // layout.desktop.openApplication(null, "cms.Document", options);
  959. // }
  960. // },
  961. // editCMSDocument : function(){
  962. // this.openCMSDocument( true );
  963. // },
  964. // remove: function(e){
  965. // var text = "删除后不能恢复,你确定要删除该文档?";
  966. // var _self = this;
  967. // this.node.setStyles(this.css.viewContentTrNode_delete);
  968. // this.readyRemove = true;
  969. // this.view.app.confirm("warn", e, "删除确认", text, 350, 120, function(){
  970. //
  971. // _self.removeCMSDocument(_self, false);
  972. //
  973. // this.close();
  974. //
  975. // }, function(){
  976. // _self.node.setStyles(_self.css.viewContentTrNode );
  977. // _self.readyRemove = false;
  978. // this.close();
  979. // });
  980. // },
  981. // removeCMSDocument: function(){
  982. // var id = this.data.bundle;
  983. // MWF.Actions.get("x_cms_assemble_control").removeDocument(id, function(json){
  984. // //this.viewJson = JSON.decode(json.data.data);
  985. // //this.json = Object.merge(this.json, json.data);
  986. // this.readyRemove = false;
  987. // this.node.destroy();
  988. // this.view.app.notice("删除成功", "success");
  989. // MWF.release(this);
  990. // }.bind(this));
  991. // }
  992. //
  993. //});
  994. //
  995. //MWF.xApplication.cms.Module.Viewer.ItemCategory = new Class({
  996. // Extends : MWF.xApplication.process.Application.Viewer.ItemCategory,
  997. // load: function(){
  998. // this.node = new Element("tr", {"styles": this.css.viewContentTrNode}).inject(this.view.viewTable);
  999. // //if (this.view.json.select==="single" || this.view.json.select==="multi"){
  1000. // this.selectTd = new Element("td", {"styles": this.css.viewContentCategoryTdNode}).inject(this.node);
  1001. // if (this.view.json.itemStyles) this.selectTd.setStyles(this.view.json.itemStyles);
  1002. // //}
  1003. //
  1004. // var colsapn = this.view.viewJson.selectList.length;
  1005. // if( this.view.options.hasAction ){
  1006. // colsapn ++
  1007. // }
  1008. //
  1009. // this.categoryTd = new Element("td", {
  1010. // "styles": this.css.viewContentCategoryTdNode,
  1011. // "colspan": colsapn
  1012. // }).inject(this.node);
  1013. //
  1014. // this.groupColumn = null;
  1015. // for (var c = 0; c<this.view.viewJson.selectList.length; c++){
  1016. // if (this.view.viewJson.selectList[c].column === this.view.viewJson.group.column){
  1017. // this.groupColumn = this.view.viewJson.selectList[c];
  1018. // break;
  1019. // }
  1020. // }
  1021. // if (this.groupColumn){
  1022. // 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;
  1023. // }else{
  1024. // var text = this.data.group;
  1025. // }
  1026. //
  1027. // 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);
  1028. // if (this.view.json.itemStyles) this.categoryTd.setStyles(this.view.json.itemStyles);
  1029. //
  1030. // this.setEvent();
  1031. // },
  1032. // expand: function(){
  1033. // this.items.each(function(item){
  1034. // item.node.setStyle("display", "table-row");
  1035. // }.bind(this));
  1036. // this.node.getElement("span").set("html", "<img src='/x_component_process_Application/$Viewer/"+this.view.options.style+"/icon/down.png'/>");
  1037. // if (!this.loadChild){
  1038. // //window.setTimeout(function(){
  1039. // this.data.list.each(function(line){
  1040. // this.items.push(new MWF.xApplication.cms.Module.Viewer.Item(this.view, line, this));
  1041. // }.bind(this));
  1042. // this.loadChild = true;
  1043. // //}.bind(this), 10);
  1044. // }
  1045. // }
  1046. //});