Statement.js 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656
  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( data );
  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. this.filterList = [];
  133. ( data.filterList || [] ).each( function (d) {
  134. var parameterName = d.path.replace(/\./g, "_");
  135. if( d.comparison === "like" || d.comparison === "notLike" ){
  136. this.parameter[ parameterName ] = "%"+d.value+"%";
  137. }else{
  138. var value = d.value;
  139. if( d.formatType === "dateTimeValue" || d.formatType === "datetimeValue"){
  140. value = "{ts '"+value+"'}"
  141. }else if( d.formatType === "dateValue" ){
  142. value = "{d '"+value+"'}"
  143. }else if( d.formatType === "timeValue" ){
  144. value = "{t '"+value+"'}"
  145. }
  146. this.parameter[ parameterName ] = value;
  147. }
  148. d.value = parameterName;
  149. this.filterList.push( d );
  150. }.bind(this))
  151. },
  152. loadParameter : function(){
  153. this.parameter = {};
  154. ( this.viewJson.filterList || [] ).each( function (f) {
  155. var value = f.value;
  156. debugger;
  157. if( f.valueType === "script" ){
  158. value = this.Macro.exec( f.valueScript ? f.valueScript.code : "", this);
  159. }else if( f.value.indexOf( "@" ) > -1 ){
  160. var user = layout.user;
  161. switch ( f.value ) {
  162. case "@person":
  163. value = user.distinguishedName;
  164. break;
  165. case "@identityList":
  166. value = user.identityList.map( function (d) {
  167. return d.distinguishedName;
  168. });
  169. break;
  170. case "@unitList":
  171. o2.Actions.load("x_organization_assemble_express").UnitAction.listWithPerson({ "personList" : [user.distinguishedName] }, function (json) {
  172. value = json.unitList;
  173. }, null, false);
  174. break;
  175. case "@unitAllList":
  176. o2.Actions.load("x_organization_assemble_express").UnitAction.listWithIdentitySupNested({ "personList" : [user.distinguishedName] }, function (json) {
  177. value = json.unitList;
  178. }, null, false);
  179. break;
  180. case "@year":
  181. value = (new Date().getFullYear()).toString();
  182. break;
  183. case "@season":
  184. var m = new Date().format("%m");
  185. if( ["01","02","03"].contains(m) ){
  186. value = "1"
  187. }else if( ["04","05","06"].contains(m) ){
  188. value = "2"
  189. }else if( ["07","08","09"].contains(m) ){
  190. value = "3"
  191. }else{
  192. value = "4"
  193. }
  194. break;
  195. case "@month":
  196. value = new Date().format("%Y-%m");
  197. break;
  198. case "@time":
  199. value = new Date().format("db");
  200. break;
  201. case "@date":
  202. value = new Date().format("%Y-%m-%d");
  203. break;
  204. default:
  205. }
  206. }
  207. if( f.formatType === "dateTimeValue" || f.formatType === "datetimeValue"){
  208. value = "{ts '"+value+"'}"
  209. }else if( f.formatType === "dateValue" ){
  210. value = "{d '"+value+"'}"
  211. }else if( f.formatType === "timeValue" ){
  212. value = "{t '"+value+"'}"
  213. }
  214. this.parameter[ f.parameter ] = value;
  215. }.bind(this))
  216. },
  217. loadCurrentPageData: function( callback, async, type ){
  218. //是否需要在翻页的时候清空之前的items ?
  219. debugger;
  220. if( this.pageloading )return;
  221. this.pageloading = true;
  222. this.items = [];
  223. var p = this.currentPage;
  224. var d = {
  225. "filterList" : this.filterList,
  226. "parameter" : this.parameter
  227. };
  228. while (this.viewTable.rows.length>1){
  229. this.viewTable.deleteRow(-1);
  230. }
  231. //this.createLoadding();
  232. this.loadViewRes = o2.Actions.load("x_query_assemble_surface").StatementAction.executeV2(
  233. this.options.statementId || this.options.statementName || this.json.statementId || this.json.statementName,
  234. type || "data", p, this.json.pageSize, d, function(json){
  235. if( type === "all" || type === "count" ){
  236. if( typeOf(json.count) === "number" ){
  237. this.count = json.count;
  238. var i = this.count/this.json.pageSize;
  239. this.pages = (i.toInt()<i) ? i.toInt()+1 : i;
  240. }
  241. }
  242. this.gridJson = json.data;
  243. this.fireEvent("postLoadPageData");
  244. // if (this.viewJson.group.column){
  245. // this.gridJson = json.data.groupGrid;
  246. // }else{
  247. // this.gridJson = json.data.grid;
  248. this.loadData();
  249. // }
  250. if (this.gridJson.length) this._loadPageNode();
  251. if (this.loadingAreaNode){
  252. this.loadingAreaNode.destroy();
  253. this.loadingAreaNode = null;
  254. }
  255. this.pageloading = false;
  256. this.fireEvent("loadView"); //options 传入的事件
  257. this.fireEvent("postLoadPage");
  258. if(callback)callback( json );
  259. }.bind(this), null, async === false ? false : true );
  260. },
  261. getView: function(callback){
  262. this.getViewRes = o2.Actions.load("x_query_assemble_surface").StatementAction.get(this.json.statementId || this.json.statementName, function(json){
  263. debugger;
  264. var viewData = JSON.decode(json.data.view);
  265. if( !this.json.pageSize )this.json.pageSize = viewData.pageSize;
  266. this.viewJson = viewData.data;
  267. this.json.application = json.data.query;
  268. //this.json = Object.merge(this.json, json.data);
  269. this.statementJson = json.data;
  270. if (callback) callback();
  271. }.bind(this));
  272. },
  273. loadData: function(){
  274. if (this.gridJson.length){
  275. // if( !this.options.paging ){
  276. this.gridJson.each(function(line, i){
  277. this.items.push(new MWF.xApplication.query.Query.Statement.Item(this, line, null, i));
  278. }.bind(this));
  279. // }else{
  280. // this.loadPaging();
  281. // }
  282. }else{
  283. if (this.viewPageAreaNode) this.viewPageAreaNode.empty();
  284. }
  285. },
  286. loadDataByPaging : function(){
  287. if( this.isItemsLoading )return;
  288. if( !this.isItemsLoaded ){
  289. var from = Math.min( this.pageNumber * this.options.perPageCount , this.gridJson.length);
  290. var to = Math.min( ( this.pageNumber + 1 ) * this.options.perPageCount + 1 , this.gridJson.length);
  291. this.isItemsLoading = true;
  292. for( var i = from; i<to; i++ ){
  293. this.items.push(new MWF.xApplication.query.Query.Statement.Item(this, this.gridJson[i], null, i));
  294. }
  295. this.isItemsLoading = false;
  296. this.pageNumber ++;
  297. if( to == this.gridJson.length )this.isItemsLoaded = true;
  298. }
  299. },
  300. getFilter: function(){
  301. var filterData = [];
  302. if (this.searchStatus==="custom"){
  303. if (this.filterItems.length){
  304. this.filterItems.each(function(filter){
  305. filterData.push(filter.data);
  306. }.bind(this));
  307. }
  308. }
  309. if (this.searchStatus==="default"){
  310. var key = this.viewSearchInputNode.get("value");
  311. if (key && key!==this.lp.searchKeywork){
  312. this.viewJson.customFilterList.each(function(entry){
  313. if (entry.formatType==="textValue"){
  314. var d = {
  315. "path": entry.path,
  316. "value": key,
  317. "formatType": entry.formatType,
  318. "logic": "and",
  319. "comparison": "like"
  320. };
  321. filterData.push(d);
  322. }
  323. if (entry.formatType==="numberValue"){
  324. var v = key.toFloat();
  325. if (!isNaN(v)){
  326. var d = {
  327. "path": entry.path,
  328. "value": v,
  329. "formatType": entry.formatType,
  330. "logic": "and",
  331. "comparison": "like"
  332. };
  333. filterData.push(d);
  334. }
  335. }
  336. }.bind(this));
  337. }
  338. }
  339. return (filterData.length) ? filterData : null;
  340. },
  341. viewSearchCustomAddToFilter: function(){
  342. var pathIdx = this.viewSearchCustomPathListNode.selectedIndex;
  343. var comparisonIdx = this.viewSearchCustomComparisonListNode.selectedIndex;
  344. if (pathIdx===-1){
  345. MWF.xDesktop.notice("error", {"x": "left", "y": "top"}, this.lp.filterErrorTitle, this.viewSearchCustomPathListNode, {"x": 0, "y": 85});
  346. return false;
  347. }
  348. if (comparisonIdx===-1){
  349. MWF.xDesktop.notice("error", {"x": "left", "y": "top"}, this.lp.filterErrorComparison, this.viewSearchCustomComparisonListNode, {"x": 0, "y": 85});
  350. return false;
  351. }
  352. var pathOption = this.viewSearchCustomPathListNode.options[pathIdx];
  353. var entry = pathOption.retrieve("entry");
  354. if (entry){
  355. var pathTitle = entry.title;
  356. var path = entry.path;
  357. var comparison = this.viewSearchCustomComparisonListNode.options[comparisonIdx].get("value");
  358. var comparisonTitle = this.viewSearchCustomComparisonListNode.options[comparisonIdx].get("text");
  359. var value = "";
  360. if( entry.valueType === "script" && entry.valueScript && entry.valueScript.code ){
  361. var idx = this.viewSearchCustomValueNode.selectedIndex;
  362. if (idx!==-1){
  363. var v = this.viewSearchCustomValueNode.options[idx].get("value");
  364. value = entry.formatType === "booleanValue" ? (v==="true") : v;
  365. }
  366. }else{
  367. switch (entry.formatType){
  368. case "numberValue":
  369. value = this.viewSearchCustomValueNode.get("value");
  370. break;
  371. case "dateTimeValue":
  372. value = this.viewSearchCustomValueNode.get("value");
  373. break;
  374. case "booleanValue":
  375. var idx = this.viewSearchCustomValueNode.selectedIndex;
  376. if (idx!==-1){
  377. var v = this.viewSearchCustomValueNode.options[idx].get("value");
  378. value = (v==="true");
  379. }
  380. break;
  381. default:
  382. value = this.viewSearchCustomValueNode.get("value");
  383. }
  384. }
  385. if (value===""){
  386. MWF.xDesktop.notice("error", {"x": "left", "y": "top"}, this.lp.filterErrorValue, this.viewSearchCustomValueContentNode, {"x": 0, "y": 85});
  387. return false;
  388. }
  389. this.filterItems.push(new MWF.xApplication.query.Query.Statement.Filter(this, {
  390. "logic": "and",
  391. "path": path,
  392. "title": pathTitle,
  393. "comparison": comparison,
  394. "comparisonTitle": comparisonTitle,
  395. "value": value,
  396. "formatType": (entry.formatType=="datetimeValue") ? "dateTimeValue": entry.formatType
  397. }, this.viewSearchCustomFilterContentNode));
  398. this.searchCustomView();
  399. }
  400. },
  401. //搜索相关结束
  402. getStatementInfor : function () {
  403. return this.json;
  404. },
  405. switchStatement : function (json) {
  406. this.switchView(json);
  407. }
  408. });
  409. MWF.xApplication.query.Query.Statement.Item = new Class({
  410. Extends : MWF.xApplication.query.Query.Viewer.Item,
  411. initialize: function(view, data, prev, i){
  412. this.view = view;
  413. this.data = data;
  414. this.css = this.view.css;
  415. this.isSelected = false;
  416. this.prev = prev;
  417. this.idx = i;
  418. this.clazzType = "item";
  419. this.load();
  420. },
  421. load: function(){
  422. this.view.fireEvent("queryLoadItemRow", [null, this]);
  423. var viewStyles = this.view.viewJson.viewStyles;
  424. var viewContentTdNode = ( viewStyles && viewStyles["contentTd"] ) ? viewStyles["contentTd"] : this.css.viewContentTdNode;
  425. this.node = new Element("tr", {
  426. "styles": ( viewStyles && viewStyles["contentTr"] ) ? viewStyles["contentTr"] : this.css.viewContentTrNode
  427. });
  428. if (this.prev){
  429. this.node.inject(this.prev.node, "after");
  430. }else{
  431. this.node.inject(this.view.viewTable);
  432. }
  433. //if (this.view.json.select==="single" || this.view.json.select==="multi"){
  434. this.selectTd = new Element("td", { "styles": viewContentTdNode }).inject(this.node);
  435. this.selectTd.setStyles({"cursor": "pointer"});
  436. if (this.view.json.itemStyles) this.selectTd.setStyles(this.view.json.itemStyles);
  437. if( this.view.isSelectTdHidden() ){
  438. this.selectTd.hide();
  439. }
  440. //}
  441. //序号
  442. if (this.view.viewJson.isSequence==="yes"){
  443. this.sequenceTd = new Element("td", {"styles": viewContentTdNode}).inject(this.node);
  444. this.sequenceTd.setStyle("width", "10px");
  445. var s= 1+this.view.json.pageSize*(this.view.currentPage-1)+this.idx;
  446. this.sequenceTd.set("text", s);
  447. }
  448. debugger;
  449. Object.each(this.view.entries, function(c, k){
  450. //if (cell){
  451. if (this.view.hideColumns.indexOf(k)===-1){
  452. var td = new Element("td", {"styles": viewContentTdNode}).inject(this.node);
  453. var cell = this.getText( c, k, td ); //this.data[k];
  454. if (cell === undefined || cell === null) cell = "";
  455. // if (k!== this.view.viewJson.group.column){
  456. var v = cell;
  457. if (c.isHtml){
  458. td.set("html", v);
  459. }else{
  460. td.set("text", v);
  461. }
  462. if( typeOf(c.contentProperties) === "object" )td.setProperties(c.contentProperties);
  463. if (this.view.json.itemStyles) td.setStyles(this.view.json.itemStyles);
  464. if( typeOf(c.contentStyles) === "object" )td.setStyles(c.contentStyles);
  465. // }else{
  466. // if (this.view.json.itemStyles) td.setStyles(this.view.json.itemStyles);
  467. // }
  468. if (this.view.openColumns.indexOf(k)!==-1){
  469. this.setOpenWork(td, c)
  470. }
  471. // if (k!== this.view.viewJson.group.column){
  472. Object.each( c.events || {}, function (e , key) {
  473. if(e.code){
  474. if( key === "loadContent" ){
  475. this.view.Macro.fire( e.code,
  476. {"node" : td, "json" : c, "data" : v, "view": this.view, "row" : this});
  477. }else if( key !== "loadTitle" ){
  478. td.addEvent(key, function(event){
  479. return this.view.Macro.fire(
  480. e.code,
  481. {"node" : td, "json" : c, "data" : v, "view": this.view, "row" : this},
  482. event
  483. );
  484. }.bind(this));
  485. }
  486. }
  487. }.bind(this));
  488. // }
  489. }
  490. //}
  491. }.bind(this));
  492. //默认选中
  493. var defaultSelectedScript = this.view.json.defaultSelectedScript || this.view.viewJson.defaultSelectedScript;
  494. if( !this.isSelected && defaultSelectedScript ){
  495. // var flag = this.view.json.select || this.view.viewJson.select || "none";
  496. // if ( flag ==="single" || flag==="multi"){
  497. //
  498. // }
  499. var flag = this.view.Macro.exec( defaultSelectedScript,
  500. {"node" : this.node, "data" : this.data, "view": this.view, "row" : this});
  501. if( flag ){
  502. if( flag === "multi" || flag === "single" ){
  503. this.select( flag );
  504. }else if( flag.toString() === "true" ){
  505. var f = this.view.json.select || this.view.viewJson.select || "none";
  506. if ( f ==="single" || f==="multi"){
  507. this.select();
  508. }
  509. }
  510. }
  511. }
  512. this.setEvent();
  513. this.view.fireEvent("postLoadItemRow", [null, this]);
  514. },
  515. getText : function(c, k, td){
  516. var path = c.path, code = c.code, obj = this.data;
  517. if( path ){
  518. var pathList = path.split(".");
  519. for( var i=0; i<pathList.length; i++ ){
  520. var p = pathList[i];
  521. if( (/(^[1-9]\d*$)/.test(p)) )p = p.toInt();
  522. if( obj[ p ] ){
  523. obj = obj[ p ];
  524. }else{
  525. obj = "";
  526. break;
  527. }
  528. }
  529. }
  530. if( code && code.trim())obj = this.view.Macro.exec( code, {"value": obj, "data": this.data, "entry": c, "node" : td, "json" : c, "row" : this});
  531. var toName = function (value) {
  532. if(typeOf(value) === "array"){
  533. Array.each( value, function (v, idx) {
  534. value[idx] = toName(v)
  535. })
  536. }else if( typeOf(value) === "object" ){
  537. Object.each( value, function (v, key) {
  538. value[key] = toName(v);
  539. })
  540. }else if( typeOf( value ) === "string" ){
  541. value = o2.name.cn( value )
  542. }
  543. return value;
  544. };
  545. var d;
  546. if( obj!= undefined && obj!= null ){
  547. if( typeOf(obj) === "array" ) {
  548. d = c.isName ? JSON.stringify(toName(Array.clone(obj))) : JSON.stringify(obj);
  549. }else if( typeOf(obj) === "object" ){
  550. d = c.isName ? JSON.stringify(toName(Object.clone(obj))) : JSON.stringify(obj);
  551. }else{
  552. d = c.isName ? o2.name.cn( obj.toString() ) : obj;
  553. }
  554. }
  555. return d;
  556. },
  557. setOpenWork: function(td, column){
  558. td.setStyle("cursor", "pointer");
  559. if( column.clickCode ){
  560. if( !this.view.Macro ){
  561. MWF.require("MWF.xScript.Macro", function () {
  562. this.view.businessData = {};
  563. this.view.Macro = new MWF.Macro.PageContext(this.view);
  564. }.bind(this), false);
  565. }
  566. td.addEvent("click", function( ev ){
  567. var result = this.view.Macro.fire(column.clickCode, this, ev);
  568. ev.stopPropagation();
  569. return result;
  570. }.bind(this));
  571. }else{
  572. // if (this.view.json.type==="cms"){
  573. // td.addEvent("click", function(ev){
  574. // this.openCms(ev)
  575. // ev.stopPropagation();
  576. // }.bind(this));
  577. // }else{
  578. td.addEvent("click", function(ev){
  579. this.openWorkAndCompleted(ev)
  580. ev.stopPropagation();
  581. }.bind(this));
  582. // }
  583. }
  584. }
  585. });
  586. MWF.xApplication.query.Query.Statement.Filter = new Class({
  587. Extends : MWF.xApplication.query.Query.Viewer.Filter
  588. });
  589. MWF.xApplication.query.Query.Statement.Actionbar = new Class({
  590. Extends : MWF.xApplication.query.Query.Viewer.Actionbar
  591. });
  592. MWF.xApplication.query.Query.Statement.Paging = new Class({
  593. Extends : MWF.xApplication.query.Query.Viewer.Paging
  594. });