Statement.js 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663
  1. MWF.xApplication.query = MWF.xApplication.query || {};
  2. MWF.xApplication.query.Query = MWF.xApplication.query.Query || {};
  3. MWF.xDesktop.requireApp("query.Query", "Viewer", null, false);
  4. MWF.xApplication.query.Query.Statement = MWF.QStatement = new Class({
  5. Extends: MWF.QViewer,
  6. options: {
  7. },
  8. initialize: function(container, json, options, app, parentMacro){
  9. //本类有三种事件,
  10. //一种是通过 options 传进来的事件,包括 loadView、openDocument、select
  11. //一种是用户配置的 事件, 在this.options.moduleEvents 中定义的作为类事件
  12. //还有一种也是用户配置的事件,不在this.options.moduleEvents 中定义的作为 this.node 的DOM事件
  13. this.setOptions(options);
  14. this.path = "../x_component_query_Query/$Viewer/";
  15. this.cssPath = "../x_component_query_Query/$Viewer/"+this.options.style+"/css.wcss";
  16. this._loadCss();
  17. this.lp = MWF.xApplication.query.Query.LP;
  18. this.app = app;
  19. this.container = $(container);
  20. this.json = json || {};
  21. this.parentMacro = parentMacro;
  22. this.originalJson = Object.clone(json);
  23. this.viewJson = null;
  24. this.filterItems = [];
  25. this.searchStatus = "none"; //none, custom, default
  26. this.items = [];
  27. this.selectedItems = [];
  28. this.hideColumns = [];
  29. this.openColumns = [];
  30. this.parameter = {};
  31. this.gridJson = null;
  32. if (this.options.isload){
  33. this.init(function(){
  34. this.load();
  35. }.bind(this));
  36. }
  37. },
  38. init: function(callback){
  39. if (this.json.view){
  40. this.viewJson = JSON.decode(this.json.view);
  41. if (callback) callback();
  42. }else{
  43. this.getView(callback);
  44. }
  45. },
  46. loadMacro: function (callback) {
  47. MWF.require("MWF.xScript.Macro", function () {
  48. this.Macro = new MWF.Macro.ViewContext(this);
  49. if (callback) callback();
  50. }.bind(this));
  51. },
  52. createActionbarNode : function(){
  53. this.actionbarAreaNode.empty();
  54. if( typeOf(this.json.showActionbar) === "boolean" && this.json.showActionbar !== true )return;
  55. if( typeOf( this.viewJson.actionbarHidden ) === "boolean" ){
  56. if( this.viewJson.actionbarHidden === true || !this.viewJson.actionbarList || !this.viewJson.actionbarList.length )return;
  57. this.actionbar = new MWF.xApplication.query.Query.Statement.Actionbar(this.actionbarAreaNode, this.viewJson.actionbarList[0], this, {});
  58. this.actionbar.load();
  59. }
  60. },
  61. _loadPageNode : function(){
  62. this.viewPageAreaNode.empty();
  63. if( !this.paging ){
  64. var json;
  65. if( !this.viewJson.pagingList || !this.viewJson.pagingList.length ){
  66. json = {
  67. "firstPageText": this.lp.firstPage,
  68. "lastPageText": this.lp.lastPage
  69. };
  70. }else{
  71. json = this.viewJson.pagingList[0];
  72. }
  73. this.paging = new MWF.xApplication.query.Query.Statement.Paging(this.viewPageAreaNode, json, this, {});
  74. this.paging.load();
  75. }else{
  76. this.paging.reload();
  77. }
  78. },
  79. // _initPage: function(){
  80. // var i = this.count/this.json.pageSize;
  81. // this.pages = (i.toInt()<i) ? i.toInt()+1 : i;
  82. // this.currentPage = this.options.defaultPage || 1;
  83. // this.options.defaultPage = null;
  84. // },
  85. lookup: function(data, callback){
  86. if( this.lookuping )return;
  87. this.lookuping = true;
  88. // this.getLookupAction(function(){
  89. // if (this.json.application){
  90. var d = data || {};
  91. // d.count = this.json.count;
  92. // this.lookupAction.bundleView(this.json.id, d, function(json){
  93. // this.bundleItems = json.data.valueList;
  94. // this._initPage();
  95. debugger;
  96. this.loadParameter();
  97. this.loadFilter( d );
  98. this.currentPage = this.options.defaultPage || 1;
  99. this.options.defaultPage = null;
  100. if( this.noDataTextNode )this.noDataTextNode.destroy();
  101. this.loadCurrentPageData( function (json) {
  102. if(this.count){
  103. this.fireEvent("postLoad"); //用户配置的事件
  104. this.lookuping = false;
  105. if(callback)callback(this);
  106. }else{
  107. this.viewPageAreaNode.empty();
  108. if( this.viewJson.noDataText ){
  109. var noDataTextNodeStyle = this.css.noDataTextNode;
  110. if( this.viewJson.viewStyles && this.viewJson.viewStyles["noDataTextNode"] ){
  111. noDataTextNodeStyle = this.viewJson.viewStyles["noDataTextNode"];
  112. }
  113. this.noDataTextNode = new Element( "div", {
  114. "styles": noDataTextNodeStyle,
  115. "text" : this.viewJson.noDataText
  116. }).inject( this.contentAreaNode );
  117. }
  118. // if (this.loadingAreaNode){
  119. // this.loadingAreaNode.destroy();
  120. // this.loadingAreaNode = null;
  121. // }
  122. this.fireEvent("postLoad"); //用户配置的事件
  123. this.lookuping = false;
  124. if(callback)callback(this);
  125. }
  126. }.bind(this), true,"all");
  127. // }.bind(this));
  128. // }
  129. // }.bind(this));
  130. },
  131. loadFilter : function( data ){
  132. debugger;
  133. this.filterList = [];
  134. ( data.filterList || [] ).each( function (d) {
  135. var parameterName = d.path.replace(/\./g, "_");
  136. var value = d.value;
  137. if( d.code && d.code.code ){
  138. value = this.Macro.exec( d.code.code, this);
  139. }
  140. if( d.comparison === "like" || d.comparison === "notLike" ){
  141. this.parameter[ parameterName ] = "%"+value+"%";
  142. }else{
  143. if( d.formatType === "dateTimeValue" || d.formatType === "datetimeValue"){
  144. value = "{ts '"+value+"'}"
  145. }else if( d.formatType === "dateValue" ){
  146. value = "{d '"+value+"'}"
  147. }else if( d.formatType === "timeValue" ){
  148. value = "{t '"+value+"'}"
  149. }
  150. this.parameter[ parameterName ] = value;
  151. }
  152. d.value = parameterName;
  153. this.filterList.push( d );
  154. }.bind(this))
  155. },
  156. loadParameter : function(){
  157. this.parameter = {};
  158. ( this.viewJson.filterList || [] ).each( function (f) {
  159. var value = f.value;
  160. debugger;
  161. if( f.valueType === "script" ){
  162. value = this.Macro.exec( f.valueScript ? f.valueScript.code : "", this);
  163. }else if( f.value.indexOf( "@" ) > -1 ){
  164. var user = layout.user;
  165. switch ( f.value ) {
  166. case "@person":
  167. value = user.distinguishedName;
  168. break;
  169. case "@identityList":
  170. value = user.identityList.map( function (d) {
  171. return d.distinguishedName;
  172. });
  173. break;
  174. case "@unitList":
  175. o2.Actions.load("x_organization_assemble_express").UnitAction.listWithPerson({ "personList" : [user.distinguishedName] }, function (json) {
  176. value = json.unitList;
  177. }, null, false);
  178. break;
  179. case "@unitAllList":
  180. o2.Actions.load("x_organization_assemble_express").UnitAction.listWithIdentitySupNested({ "personList" : [user.distinguishedName] }, function (json) {
  181. value = json.unitList;
  182. }, null, false);
  183. break;
  184. case "@year":
  185. value = (new Date().getFullYear()).toString();
  186. break;
  187. case "@season":
  188. var m = new Date().format("%m");
  189. if( ["01","02","03"].contains(m) ){
  190. value = "1"
  191. }else if( ["04","05","06"].contains(m) ){
  192. value = "2"
  193. }else if( ["07","08","09"].contains(m) ){
  194. value = "3"
  195. }else{
  196. value = "4"
  197. }
  198. break;
  199. case "@month":
  200. value = new Date().format("%Y-%m");
  201. break;
  202. case "@time":
  203. value = new Date().format("db");
  204. break;
  205. case "@date":
  206. value = new Date().format("%Y-%m-%d");
  207. break;
  208. default:
  209. }
  210. }
  211. if( f.formatType === "dateTimeValue" || f.formatType === "datetimeValue"){
  212. value = "{ts '"+value+"'}"
  213. }else if( f.formatType === "dateValue" ){
  214. value = "{d '"+value+"'}"
  215. }else if( f.formatType === "timeValue" ){
  216. value = "{t '"+value+"'}"
  217. }
  218. this.parameter[ f.parameter ] = value;
  219. }.bind(this))
  220. },
  221. loadCurrentPageData: function( callback, async, type ){
  222. //是否需要在翻页的时候清空之前的items ?
  223. debugger;
  224. if( this.pageloading )return;
  225. this.pageloading = true;
  226. this.items = [];
  227. var p = this.currentPage;
  228. var d = {
  229. "filterList" : this.filterList,
  230. "parameter" : this.parameter
  231. };
  232. while (this.viewTable.rows.length>1){
  233. this.viewTable.deleteRow(-1);
  234. }
  235. //this.createLoadding();
  236. this.loadViewRes = o2.Actions.load("x_query_assemble_surface").StatementAction.executeV2(
  237. this.options.statementId || this.options.statementName || this.json.statementId || this.json.statementName,
  238. type || "data", p, this.json.pageSize, d, function(json){
  239. if( type === "all" || type === "count" ){
  240. if( typeOf(json.count) === "number" ){
  241. this.count = json.count;
  242. var i = this.count/this.json.pageSize;
  243. this.pages = (i.toInt()<i) ? i.toInt()+1 : i;
  244. }
  245. }
  246. this.gridJson = json.data;
  247. this.fireEvent("postLoadPageData");
  248. // if (this.viewJson.group.column){
  249. // this.gridJson = json.data.groupGrid;
  250. // }else{
  251. // this.gridJson = json.data.grid;
  252. this.loadData();
  253. // }
  254. if (this.gridJson.length) this._loadPageNode();
  255. if (this.loadingAreaNode){
  256. this.loadingAreaNode.destroy();
  257. this.loadingAreaNode = null;
  258. }
  259. this.pageloading = false;
  260. this.fireEvent("loadView"); //options 传入的事件
  261. this.fireEvent("postLoadPage");
  262. if(callback)callback( json );
  263. }.bind(this), null, async === false ? false : true );
  264. },
  265. getView: function(callback){
  266. this.getViewRes = o2.Actions.load("x_query_assemble_surface").StatementAction.get(this.json.statementId || this.json.statementName, function(json){
  267. debugger;
  268. var viewData = JSON.decode(json.data.view);
  269. if( !this.json.pageSize )this.json.pageSize = viewData.pageSize || "20";
  270. this.viewJson = viewData.data;
  271. this.json.application = json.data.query;
  272. //this.json = Object.merge(this.json, json.data);
  273. this.statementJson = json.data;
  274. if (callback) callback();
  275. }.bind(this));
  276. },
  277. loadData: function(){
  278. if (this.gridJson.length){
  279. // if( !this.options.paging ){
  280. this.gridJson.each(function(line, i){
  281. this.items.push(new MWF.xApplication.query.Query.Statement.Item(this, line, null, i));
  282. }.bind(this));
  283. // }else{
  284. // this.loadPaging();
  285. // }
  286. }else{
  287. if (this.viewPageAreaNode) this.viewPageAreaNode.empty();
  288. }
  289. },
  290. loadDataByPaging : function(){
  291. if( this.isItemsLoading )return;
  292. if( !this.isItemsLoaded ){
  293. var from = Math.min( this.pageNumber * this.options.perPageCount , this.gridJson.length);
  294. var to = Math.min( ( this.pageNumber + 1 ) * this.options.perPageCount + 1 , this.gridJson.length);
  295. this.isItemsLoading = true;
  296. for( var i = from; i<to; i++ ){
  297. this.items.push(new MWF.xApplication.query.Query.Statement.Item(this, this.gridJson[i], null, i));
  298. }
  299. this.isItemsLoading = false;
  300. this.pageNumber ++;
  301. if( to == this.gridJson.length )this.isItemsLoaded = true;
  302. }
  303. },
  304. getFilter: function(){
  305. var filterData = [];
  306. if (this.searchStatus==="custom"){
  307. if (this.filterItems.length){
  308. this.filterItems.each(function(filter){
  309. filterData.push(filter.data);
  310. }.bind(this));
  311. }
  312. }
  313. if (this.searchStatus==="default"){
  314. var key = this.viewSearchInputNode.get("value");
  315. if (key && key!==this.lp.searchKeywork){
  316. this.viewJson.customFilterList.each(function(entry){
  317. if (entry.formatType==="textValue"){
  318. var d = {
  319. "path": entry.path,
  320. "value": key,
  321. "formatType": entry.formatType,
  322. "logic": "and",
  323. "comparison": "like"
  324. };
  325. filterData.push(d);
  326. }
  327. if (entry.formatType==="numberValue"){
  328. var v = key.toFloat();
  329. if (!isNaN(v)){
  330. var d = {
  331. "path": entry.path,
  332. "value": v,
  333. "formatType": entry.formatType,
  334. "logic": "and",
  335. "comparison": "like"
  336. };
  337. filterData.push(d);
  338. }
  339. }
  340. }.bind(this));
  341. }
  342. }
  343. return (filterData.length) ? filterData : null;
  344. },
  345. viewSearchCustomAddToFilter: function(){
  346. var pathIdx = this.viewSearchCustomPathListNode.selectedIndex;
  347. var comparisonIdx = this.viewSearchCustomComparisonListNode.selectedIndex;
  348. if (pathIdx===-1){
  349. MWF.xDesktop.notice("error", {"x": "left", "y": "top"}, this.lp.filterErrorTitle, this.viewSearchCustomPathListNode, {"x": 0, "y": 85});
  350. return false;
  351. }
  352. if (comparisonIdx===-1){
  353. MWF.xDesktop.notice("error", {"x": "left", "y": "top"}, this.lp.filterErrorComparison, this.viewSearchCustomComparisonListNode, {"x": 0, "y": 85});
  354. return false;
  355. }
  356. var pathOption = this.viewSearchCustomPathListNode.options[pathIdx];
  357. var entry = pathOption.retrieve("entry");
  358. if (entry){
  359. var pathTitle = entry.title;
  360. var path = entry.path;
  361. var comparison = this.viewSearchCustomComparisonListNode.options[comparisonIdx].get("value");
  362. var comparisonTitle = this.viewSearchCustomComparisonListNode.options[comparisonIdx].get("text");
  363. var value = "";
  364. if( entry.valueType === "script" && entry.valueScript && entry.valueScript.code ){
  365. var idx = this.viewSearchCustomValueNode.selectedIndex;
  366. if (idx!==-1){
  367. var v = this.viewSearchCustomValueNode.options[idx].get("value");
  368. value = entry.formatType === "booleanValue" ? (v==="true") : v;
  369. }
  370. }else{
  371. switch (entry.formatType){
  372. case "numberValue":
  373. value = this.viewSearchCustomValueNode.get("value");
  374. break;
  375. case "dateTimeValue":
  376. value = this.viewSearchCustomValueNode.get("value");
  377. break;
  378. case "booleanValue":
  379. var idx = this.viewSearchCustomValueNode.selectedIndex;
  380. if (idx!==-1){
  381. var v = this.viewSearchCustomValueNode.options[idx].get("value");
  382. value = (v==="true");
  383. }
  384. break;
  385. default:
  386. value = this.viewSearchCustomValueNode.get("value");
  387. }
  388. }
  389. if (value===""){
  390. MWF.xDesktop.notice("error", {"x": "left", "y": "top"}, this.lp.filterErrorValue, this.viewSearchCustomValueContentNode, {"x": 0, "y": 85});
  391. return false;
  392. }
  393. this.filterItems.push(new MWF.xApplication.query.Query.Statement.Filter(this, {
  394. "logic": "and",
  395. "path": path,
  396. "title": pathTitle,
  397. "comparison": comparison,
  398. "comparisonTitle": comparisonTitle,
  399. "value": value,
  400. "formatType": (entry.formatType=="datetimeValue") ? "dateTimeValue": entry.formatType
  401. }, this.viewSearchCustomFilterContentNode));
  402. this.searchCustomView();
  403. }
  404. },
  405. //搜索相关结束
  406. getStatementInfor : function () {
  407. return this.json;
  408. },
  409. switchStatement : function (json) {
  410. this.switchView(json);
  411. }
  412. });
  413. MWF.xApplication.query.Query.Statement.Item = new Class({
  414. Extends : MWF.xApplication.query.Query.Viewer.Item,
  415. initialize: function(view, data, prev, i){
  416. this.view = view;
  417. this.data = data;
  418. this.css = this.view.css;
  419. this.isSelected = false;
  420. this.prev = prev;
  421. this.idx = i;
  422. this.clazzType = "item";
  423. this.load();
  424. },
  425. load: function(){
  426. this.view.fireEvent("queryLoadItemRow", [null, this]);
  427. var viewStyles = this.view.viewJson.viewStyles;
  428. var viewContentTdNode = ( viewStyles && viewStyles["contentTd"] ) ? viewStyles["contentTd"] : this.css.viewContentTdNode;
  429. this.node = new Element("tr", {
  430. "styles": ( viewStyles && viewStyles["contentTr"] ) ? viewStyles["contentTr"] : this.css.viewContentTrNode
  431. });
  432. if (this.prev){
  433. this.node.inject(this.prev.node, "after");
  434. }else{
  435. this.node.inject(this.view.viewTable);
  436. }
  437. //if (this.view.json.select==="single" || this.view.json.select==="multi"){
  438. this.selectTd = new Element("td", { "styles": viewContentTdNode }).inject(this.node);
  439. this.selectTd.setStyles({"cursor": "pointer"});
  440. if (this.view.json.itemStyles) this.selectTd.setStyles(this.view.json.itemStyles);
  441. if( this.view.isSelectTdHidden() ){
  442. this.selectTd.hide();
  443. }
  444. //}
  445. //序号
  446. if (this.view.viewJson.isSequence==="yes"){
  447. this.sequenceTd = new Element("td", {"styles": viewContentTdNode}).inject(this.node);
  448. this.sequenceTd.setStyle("width", "10px");
  449. var s= 1+this.view.json.pageSize*(this.view.currentPage-1)+this.idx;
  450. this.sequenceTd.set("text", s);
  451. }
  452. debugger;
  453. Object.each(this.view.entries, function(c, k){
  454. //if (cell){
  455. if (this.view.hideColumns.indexOf(k)===-1){
  456. var td = new Element("td", {"styles": viewContentTdNode}).inject(this.node);
  457. var cell = this.getText( c, k, td ); //this.data[k];
  458. if (cell === undefined || cell === null) cell = "";
  459. // if (k!== this.view.viewJson.group.column){
  460. var v = cell;
  461. if (c.isHtml){
  462. td.set("html", v);
  463. }else{
  464. td.set("text", v);
  465. }
  466. if( typeOf(c.contentProperties) === "object" )td.setProperties(c.contentProperties);
  467. if (this.view.json.itemStyles) td.setStyles(this.view.json.itemStyles);
  468. if( typeOf(c.contentStyles) === "object" )td.setStyles(c.contentStyles);
  469. // }else{
  470. // if (this.view.json.itemStyles) td.setStyles(this.view.json.itemStyles);
  471. // }
  472. if (this.view.openColumns.indexOf(k)!==-1){
  473. this.setOpenWork(td, c)
  474. }
  475. // if (k!== this.view.viewJson.group.column){
  476. Object.each( c.events || {}, function (e , key) {
  477. if(e.code){
  478. if( key === "loadContent" ){
  479. this.view.Macro.fire( e.code,
  480. {"node" : td, "json" : c, "data" : v, "view": this.view, "row" : this});
  481. }else if( key !== "loadTitle" ){
  482. td.addEvent(key, function(event){
  483. return this.view.Macro.fire(
  484. e.code,
  485. {"node" : td, "json" : c, "data" : v, "view": this.view, "row" : this},
  486. event
  487. );
  488. }.bind(this));
  489. }
  490. }
  491. }.bind(this));
  492. // }
  493. }
  494. //}
  495. }.bind(this));
  496. //默认选中
  497. var defaultSelectedScript = this.view.json.defaultSelectedScript || this.view.viewJson.defaultSelectedScript;
  498. if( !this.isSelected && defaultSelectedScript ){
  499. // var flag = this.view.json.select || this.view.viewJson.select || "none";
  500. // if ( flag ==="single" || flag==="multi"){
  501. //
  502. // }
  503. var flag = this.view.Macro.exec( defaultSelectedScript,
  504. {"node" : this.node, "data" : this.data, "view": this.view, "row" : this});
  505. if( flag ){
  506. if( flag === "multi" || flag === "single" ){
  507. this.select( flag );
  508. }else if( flag.toString() === "true" ){
  509. var f = this.view.json.select || this.view.viewJson.select || "none";
  510. if ( f ==="single" || f==="multi"){
  511. this.select();
  512. }
  513. }
  514. }
  515. }
  516. this.setEvent();
  517. this.view.fireEvent("postLoadItemRow", [null, this]);
  518. },
  519. getText : function(c, k, td){
  520. var path = c.path, code = c.code, obj = this.data;
  521. if( !path ){
  522. return ""
  523. }else if( path === "$all" ){
  524. }else{
  525. var pathList = path.split(".");
  526. for (var i = 0; i < pathList.length; i++) {
  527. var p = pathList[i];
  528. if ((/(^[1-9]\d*$)/.test(p))) p = p.toInt();
  529. if (obj[p]) {
  530. obj = obj[p];
  531. } else {
  532. obj = "";
  533. break;
  534. }
  535. }
  536. }
  537. if( code && code.trim())obj = this.view.Macro.exec( code, {"value": obj, "data": this.data, "entry": c, "node" : td, "json" : c, "row" : this});
  538. var toName = function (value) {
  539. if(typeOf(value) === "array"){
  540. Array.each( value, function (v, idx) {
  541. value[idx] = toName(v)
  542. })
  543. }else if( typeOf(value) === "object" ){
  544. Object.each( value, function (v, key) {
  545. value[key] = toName(v);
  546. })
  547. }else if( typeOf( value ) === "string" ){
  548. value = o2.name.cn( value )
  549. }
  550. return value;
  551. };
  552. var d;
  553. if( obj!= undefined && obj!= null ){
  554. if( typeOf(obj) === "array" ) {
  555. d = c.isName ? JSON.stringify(toName(Array.clone(obj))) : JSON.stringify(obj);
  556. }else if( typeOf(obj) === "object" ){
  557. d = c.isName ? JSON.stringify(toName(Object.clone(obj))) : JSON.stringify(obj);
  558. }else{
  559. d = c.isName ? o2.name.cn( obj.toString() ) : obj;
  560. }
  561. }
  562. return d;
  563. },
  564. setOpenWork: function(td, column){
  565. td.setStyle("cursor", "pointer");
  566. if( column.clickCode ){
  567. if( !this.view.Macro ){
  568. MWF.require("MWF.xScript.Macro", function () {
  569. this.view.businessData = {};
  570. this.view.Macro = new MWF.Macro.PageContext(this.view);
  571. }.bind(this), false);
  572. }
  573. td.addEvent("click", function( ev ){
  574. var result = this.view.Macro.fire(column.clickCode, this, ev);
  575. ev.stopPropagation();
  576. return result;
  577. }.bind(this));
  578. }else{
  579. // if (this.view.json.type==="cms"){
  580. // td.addEvent("click", function(ev){
  581. // this.openCms(ev)
  582. // ev.stopPropagation();
  583. // }.bind(this));
  584. // }else{
  585. td.addEvent("click", function(ev){
  586. this.openWorkAndCompleted(ev)
  587. ev.stopPropagation();
  588. }.bind(this));
  589. // }
  590. }
  591. }
  592. });
  593. MWF.xApplication.query.Query.Statement.Filter = new Class({
  594. Extends : MWF.xApplication.query.Query.Viewer.Filter
  595. });
  596. MWF.xApplication.query.Query.Statement.Actionbar = new Class({
  597. Extends : MWF.xApplication.query.Query.Viewer.Actionbar
  598. });
  599. MWF.xApplication.query.Query.Statement.Paging = new Class({
  600. Extends : MWF.xApplication.query.Query.Viewer.Paging
  601. });