View.js 94 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225
  1. MWF.xApplication = MWF.xApplication || {};
  2. MWF.xApplication.query = MWF.xApplication.query || {};
  3. MWF.xApplication.query.ViewDesigner = MWF.xApplication.query.ViewDesigner || {};
  4. MWF.APPDVD = MWF.xApplication.query.ViewDesigner;
  5. MWF.require("MWF.widget.Common", null, false);
  6. MWF.require("MWF.xScript.Macro", null, false);
  7. MWF.xDesktop.requireApp("query.ViewDesigner", "lp."+MWF.language, null, false);
  8. MWF.xDesktop.requireApp("query.ViewDesigner", "Property", null, false);
  9. MWF.xApplication.query.ViewDesigner.View = new Class({
  10. Extends: MWF.widget.Common,
  11. Implements: [Options, Events],
  12. options: {
  13. "style": "default",
  14. "isView": false,
  15. "showTab": true,
  16. "propertyPath": "../x_component_query_ViewDesigner/$View/view.html"
  17. },
  18. initialize: function(designer, data, options){
  19. this.setOptions(options);
  20. this.path = "../x_component_query_ViewDesigner/$View/";
  21. this.cssPath = "../x_component_query_ViewDesigner/$View/"+this.options.style+"/css.wcss";
  22. this._loadCss();
  23. this.designer = designer;
  24. this.data = data;
  25. if (!this.data.data) this.data.data = {};
  26. this.parseData();
  27. this.node = this.designer.designNode;
  28. //this.tab = this.designer.tab;
  29. this.areaNode = new Element("div", {"styles": {"height": "100%", "overflow": "auto"}});
  30. //MWF.require("MWF.widget.ScrollBar", function(){
  31. // new MWF.widget.ScrollBar(this.areaNode, {"distance": 100});
  32. //}.bind(this));
  33. this.propertyListNode = this.designer.propertyDomArea;
  34. //this.propertyNode = this.designer.propertyContentArea;
  35. if(this.designer.application) this.data.applicationName = this.designer.application.name;
  36. if(this.designer.application) this.data.application = this.designer.application.id;
  37. this.isNewView = (this.data.name) ? false : true;
  38. this.items = [];
  39. this.view = this;
  40. this.autoSave();
  41. this.designer.addEvent("queryClose", function(){
  42. if (this.autoSaveTimerID) window.clearInterval(this.autoSaveTimerID);
  43. }.bind(this));
  44. },
  45. autoSave: function(){
  46. this.autoSaveTimerID = window.setInterval(function(){
  47. if (!this.autoSaveCheckNode) this.autoSaveCheckNode = this.designer.contentToolbarNode.getElement("#MWFDictionaryAutoSaveCheck");
  48. if (this.autoSaveCheckNode){
  49. if (this.autoSaveCheckNode.get("checked")){
  50. this.save();
  51. }
  52. }
  53. }.bind(this), 60000);
  54. },
  55. parseData: function(){
  56. this.json = this.data;
  57. if( !this.json.data.events ){
  58. var url = "../x_component_query_ViewDesigner/$View/view.json";
  59. MWF.getJSON(url, {
  60. "onSuccess": function(obj){
  61. this.json.data.events = obj.data.events;
  62. }.bind(this),
  63. "onerror": function(text){
  64. this.notice(text, "error");
  65. }.bind(this),
  66. "onRequestFailure": function(xhr){
  67. this.notice(xhr.responseText, "error");
  68. }.bind(this)
  69. },false);
  70. }
  71. },
  72. showProperty: function(){
  73. if (!this.property){
  74. this.property = new MWF.xApplication.query.ViewDesigner.Property(this, this.designer.propertyContentArea, this.designer, {
  75. "path": this.options.propertyPath,
  76. "onPostLoad": function(){
  77. this.property.show();
  78. }.bind(this)
  79. });
  80. this.property.load();
  81. }else{
  82. this.property.show();
  83. }
  84. },
  85. hideProperty: function(){
  86. if (this.property) this.property.hide();
  87. },
  88. load : function(){
  89. this.setAreaNodeSize();
  90. this.designer.addEvent("resize", this.setAreaNodeSize.bind(this));
  91. this.areaNode.inject(this.node);
  92. this.designer.viewListAreaNode.getChildren().each(function(node){
  93. var view = node.retrieve("view");
  94. if (view.id==this.data.id){
  95. if (this.designer.currentListViewItem){
  96. this.designer.currentListViewItem.setStyles(this.designer.css.listViewItem);
  97. }
  98. node.setStyles(this.designer.css.listViewItem_current);
  99. this.designer.currentListViewItem = node;
  100. this.lisNode = node;
  101. }
  102. }.bind(this));
  103. this.domListNode = new Element("div", {"styles": {"overflow": "hidden"}}).inject(this.designer.propertyDomArea);
  104. this.loadTemplateStyle( function () {
  105. this.loadActionbar();
  106. this.loadView();
  107. this.loadPaging();
  108. this.selected();
  109. this.setEvent();
  110. //if (this.options.showTab) this.page.showTabIm();
  111. this.setViewWidth();
  112. this.designer.addEvent("resize", this.setViewWidth.bind(this));
  113. }.bind(this))
  114. },
  115. setEvent: function(){
  116. this.areaNode.addEvent("click", this.selected.bind(this));
  117. this.refreshNode.addEvent("click", function(e){
  118. this.loadViewData();
  119. e.stopPropagation();
  120. }.bind(this));
  121. this.addColumnNode.addEvent("click", function(e){
  122. this.addColumn();
  123. e.stopPropagation();
  124. }.bind(this));
  125. },
  126. loadViewData: function(){
  127. if (this.data.id){
  128. this.saveSilence(function(){
  129. this.viewContentBodyNode.empty();
  130. this.viewContentTableNode = new Element("table", {
  131. "styles": this.css.viewContentTableNode,
  132. "border": "0px",
  133. "cellPadding": "0",
  134. "cellSpacing": "0"
  135. }).inject(this.viewContentBodyNode);
  136. this.designer.actions.loadView(this.data.id, null,function(json){
  137. var entries = {};
  138. json.data.selectList.each(function(entry){entries[entry.column] = entry;}.bind(this));
  139. if (this.json.data.group.column){
  140. if (json.data.groupGrid.length){
  141. var groupColumn = null;
  142. for (var c = 0; c<json.data.selectList.length; c++){
  143. if (json.data.selectList[c].column === json.data.group.column){
  144. groupColumn = json.data.selectList[c];
  145. break;
  146. }
  147. }
  148. json.data.groupGrid.each(function(line, idx){
  149. var groupTr = new Element("tr", {
  150. "styles": this.json.data.viewStyles ? this.json.data.viewStyles["contentTr"] : this.css.viewContentTrNode,
  151. "data-is-group" : "yes"
  152. }).inject(this.viewContentTableNode);
  153. var colSpan = this.items.length ;
  154. var td = new Element("td", {
  155. "styles": this.json.data.viewStyles ? this.json.data.viewStyles["contentGroupTd"] : this.css.viewContentGroupTdNode,
  156. "colSpan": colSpan
  157. }).inject(groupTr);
  158. var groupAreaNode;
  159. if( this.json.data.viewStyles ){
  160. groupAreaNode = new Element("div", {"styles": this.json.data.viewStyles["groupCollapseNode"]}).inject(td);
  161. groupAreaNode.set("text", line.group);
  162. }else{
  163. groupAreaNode = new Element("div", {"styles": this.css.viewContentTdGroupNode}).inject(td);
  164. var groupIconNode = new Element("div", {"styles": this.css.viewContentTdGroupIconNode}).inject(groupAreaNode);
  165. var groupTextNode = new Element("div", {"styles": this.css.viewContentTdGroupTextNode}).inject(groupAreaNode);
  166. if (groupColumn){
  167. //groupTextNode.set("text", (groupColumn.code) ? MWF.Macro.exec(groupColumn.code, {"value": line.group, "gridData": json.data.groupGrid, "data": json.data, "entry": line}) : line.group);
  168. groupTextNode.set("text", line.group);
  169. }else{
  170. groupTextNode.set("text", line.group);
  171. }
  172. }
  173. var subtrs = [];
  174. line.list.each(function(entry){
  175. var tr = new Element("tr", {
  176. "styles": this.json.data.viewStyles ? this.json.data.viewStyles["contentTr"] : this.css.viewContentTrNode
  177. }).inject(this.viewContentTableNode);
  178. tr.setStyle("display", "none");
  179. //this.createViewCheckboxTd( tr );
  180. var td = new Element("td", {
  181. "styles": this.json.data.viewStyles ? this.json.data.viewStyles["contentTd"] : this.css.viewContentTdNode
  182. }).inject(tr);
  183. Object.each(entries, function(c, k){
  184. var d = entry.data[k];
  185. if (d!=undefined){
  186. if (k!=this.json.data.group.column){
  187. var td = new Element("td", {
  188. "styles": this.json.data.viewStyles ? this.json.data.viewStyles["contentTd"] : this.css.viewContentTdNode
  189. }).inject(tr);
  190. //td.set("text", (entries[k].code) ? MWF.Macro.exec(entries[k].code, {"value": d, "gridData": json.data.groupGrid, "data": json.data, "entry": entry}) : d);
  191. if (c.isHtml){
  192. td.set("html", d);
  193. }else{
  194. td.set("text", d);
  195. }
  196. }
  197. }
  198. }.bind(this));
  199. // Object.each(entry.data, function(d, k){
  200. // if (k!=this.json.data.group.column){
  201. // var td = new Element("td", {"styles": this.css.viewContentTdNode}).inject(tr);
  202. // td.set("text", (entries[k].code) ? MWF.Macro.exec(entries[k].code, {"value": d, "gridData": json.data.groupGrid, "data": json.data, "entry": entry}) : d);
  203. // }
  204. // }.bind(this));
  205. subtrs.push(tr)
  206. }.bind(this));
  207. groupAreaNode.store("subtrs", subtrs);
  208. var _self = this;
  209. groupAreaNode.addEvent("click", function(){
  210. var subtrs = this.retrieve("subtrs");
  211. var iconNode = groupAreaNode.getFirst("div");
  212. if (subtrs[0]){
  213. if (subtrs[0].getStyle("display")=="none"){
  214. subtrs.each(function(subtr){ subtr.setStyle("display", "table-row"); });
  215. if( iconNode ) {
  216. iconNode.setStyle("background", "url(" + "../x_component_process_ViewDesigner/$View/default/icon/down.png) center center no-repeat");
  217. }else{
  218. this.setStyles( _self.json.data.viewStyles["groupExpandNode"] )
  219. }
  220. }else{
  221. subtrs.each(function(subtr){ subtr.setStyle("display", "none"); });
  222. if( iconNode ) {
  223. iconNode.setStyle("background", "url(" + "../x_component_process_ViewDesigner/$View/default/icon/right.png) center center no-repeat");
  224. }else{
  225. this.setStyles( _self.json.data.viewStyles["groupCollapseNode"] )
  226. }
  227. }
  228. }
  229. _self.setContentHeight();
  230. });
  231. }.bind(this));
  232. this.setContentColumnWidth();
  233. this.setContentHeight();
  234. }else if(this.json.data.noDataText){
  235. var noDataTextNodeStyle = this.css.noDataTextNode;
  236. if( this.json.data.viewStyles ){
  237. if( this.json.data.viewStyles["noDataTextNode"] ){
  238. noDataTextNodeStyle = this.json.data.viewStyles["noDataTextNode"]
  239. }else{
  240. this.json.data.viewStyles["noDataTextNode"] = this.css.noDataTextNode
  241. }
  242. }
  243. this.noDataTextNode = new Element( "div", {
  244. "styles": noDataTextNodeStyle,
  245. "text" : this.json.data.noDataText
  246. }).inject( this.viewContentBodyNode );
  247. }
  248. }else{
  249. if (json.data.grid.length){
  250. json.data.grid.each(function(line, idx){
  251. var tr = new Element("tr", {
  252. "styles": this.json.data.viewStyles ? this.json.data.viewStyles["contentTr"] : this.css.viewContentTrNode
  253. }).inject(this.viewContentTableNode);
  254. //this.createViewCheckboxTd( tr );
  255. Object.each(entries, function(c, k){
  256. var d = line.data[k];
  257. if (d!=undefined){
  258. var td = new Element("td", {
  259. "styles": this.json.data.viewStyles ? this.json.data.viewStyles["contentTd"] : this.css.viewContentTdNode
  260. }).inject(tr);
  261. //td.set("text", (entries[k].code) ? MWF.Macro.exec(entries[k].code, {"value": d, "gridData": json.data.grid, "data": json.data, "entry": line}) : d);
  262. if (c.isHtml){
  263. td.set("html", d);
  264. }else{
  265. td.set("text", d);
  266. }
  267. //td.set("text", d);
  268. }
  269. }.bind(this));
  270. // Object.each(line.data, function(d, k){
  271. // var td = new Element("td", {"styles": this.css.viewContentTdNode}).inject(tr);
  272. // td.set("text", (entries[k].code) ? MWF.Macro.exec(entries[k].code, {"value": d, "gridData": json.data.grid, "data": json.data, "entry": line}) : d);
  273. // }.bind(this));
  274. }.bind(this));
  275. this.setContentColumnWidth();
  276. this.setContentHeight();
  277. }else if(this.json.data.noDataText){
  278. var noDataTextNodeStyle = this.css.noDataTextNode;
  279. if( this.json.data.viewStyles ){
  280. if( this.json.data.viewStyles["noDataTextNode"] ){
  281. noDataTextNodeStyle = this.json.data.viewStyles["noDataTextNode"]
  282. }else{
  283. this.json.data.viewStyles["noDataTextNode"] = this.css.noDataTextNode
  284. }
  285. }
  286. this.noDataTextNode = new Element( "div", {
  287. "styles": noDataTextNodeStyle,
  288. "text" : this.json.data.noDataText
  289. }).inject( this.viewContentBodyNode );
  290. }
  291. }
  292. }.bind(this));
  293. //this.getLookupAction(function(){
  294. // this.lookupAction.invoke({"name": "lookup","async": true, "parameter": {"id": this.data.id},"success": function(json){
  295. // if (json.data.length){
  296. // json.data.each(function(line, idx){
  297. // var tr = new Element("tr", {"styles": this.css.viewContentTrNode}).inject(this.viewContentTableNode);
  298. // line.each(function(cell, i){
  299. // var td = new Element("td", {"styles": this.css.viewContentTdNode}).inject(tr);
  300. // td.set("text", cell);
  301. // }.bind(this));
  302. // }.bind(this));
  303. // this.setContentColumnWidth();
  304. // this.setContentHeight();
  305. // }
  306. // }.bind(this)});
  307. //}.bind(this));
  308. }.bind(this));
  309. }
  310. },
  311. setContentColumnWidth: function(){
  312. var titleTds = this.viewTitleTrNode.getElements("td");
  313. var widthList = [];
  314. titleTds.each(function(td){widthList.push(td.getSize().x);});
  315. var flag = false;
  316. if (this.viewContentTableNode){
  317. trs = this.viewContentTableNode.getElements("tr");
  318. for (var i=0; i<trs.length; i++){
  319. var tr = trs[i];
  320. var tds = tr.getElements("td");
  321. tds.each(function(contentTd, i){
  322. if (contentTd.get("colSpan")==1){
  323. contentTd.setStyle("width", ""+widthList[i]+"px");
  324. flag = true;
  325. }
  326. });
  327. if (flag) break;
  328. }
  329. //var tr = this.viewContentTableNode.getFirst("tr");
  330. //if (tr){
  331. // var tds = tr.getElements("td");
  332. // tds.each(function(contentTd, i){
  333. // if (!contentTd.get("colSpan")){
  334. // contentTd.setStyle("width", ""+widthList[i]+"px");
  335. // }
  336. // });
  337. //}
  338. }
  339. },
  340. //getLookupAction: function(callback){
  341. // if (!this.lookupAction){
  342. // MWF.require("MWF.xDesktop.Actions.RestActions", function(){
  343. // this.lookupAction = new MWF.xDesktop.Actions.RestActions("", "x_processplatform_assemble_surface_lookup", "");
  344. // this.lookupAction.getActions = function(actionCallback){
  345. //
  346. // this.actions = {"lookup": {"uri": "/jaxrs/view/{id}"}};
  347. // if (actionCallback) actionCallback();
  348. // }
  349. // if (callback) callback();
  350. // }.bind(this));
  351. // }else{
  352. // if (callback) callback();
  353. // }
  354. //},
  355. addColumn: function(){
  356. MWF.require("MWF.widget.UUID", function(){
  357. var id = (new MWF.widget.UUID).id;
  358. var json = {
  359. "id": id,
  360. "column": id,
  361. "displayName": this.designer.lp.unnamed,
  362. "orderType": "original"
  363. };
  364. if (!this.json.data.selectList) this.json.data.selectList = [];
  365. this.json.data.selectList.push(json);
  366. var column = new MWF.xApplication.query.ViewDesigner.View.Column(json, this);
  367. this.items.push(column);
  368. column.selected();
  369. if (this.viewContentTableNode){
  370. var trs = this.viewContentTableNode.getElements("tr");
  371. trs.each(function(tr){
  372. new Element("td", {"styles": this.css.viewContentTdNode}).inject(tr)
  373. }.bind(this));
  374. //this.setContentColumnWidth();
  375. }
  376. this.setViewWidth();
  377. this.addColumnNode.scrollIntoView(true);
  378. }.bind(this));
  379. //new Fx.Scroll(this.view.areaNode, {"wheelStops": false, "duration": 0}).toRight();
  380. },
  381. selected: function(){
  382. if (this.currentSelectedModule){
  383. if (this.currentSelectedModule==this){
  384. return true;
  385. }else{
  386. this.currentSelectedModule.unSelected();
  387. }
  388. }
  389. this.currentSelectedModule = this;
  390. this.showProperty();
  391. },
  392. unSelected: function(){
  393. this.currentSelectedModule = null;
  394. this.hideProperty();
  395. },
  396. loadViewNodes: function(){
  397. this.viewAreaNode = new Element("div#viewAreaNode", {"styles": this.css.viewAreaNode}).inject(this.areaNode);
  398. this.viewTitleNode = new Element("div#viewTitleNode", {"styles": this.css.viewTitleNode}).inject(this.viewAreaNode);
  399. this.refreshNode = new Element("div", {"styles": this.css.refreshNode}).inject(this.viewTitleNode);
  400. this.addColumnNode = new Element("div", {"styles": this.css.addColumnNode}).inject(this.viewTitleNode);
  401. this.viewTitleContentNode = new Element("div", {"styles": this.css.viewTitleContentNode}).inject(this.viewTitleNode);
  402. this.viewTitleTableNode = new Element("table", {
  403. "styles": this.css.viewTitleTableNode,
  404. "border": "0px",
  405. "cellPadding": "0",
  406. "cellSpacing": "0"
  407. }).inject(this.viewTitleContentNode);
  408. this.viewTitleTrNode = new Element("tr", {"styles": this.css.viewTitleTrNode}).inject(this.viewTitleTableNode);
  409. this.viewContentScrollNode = new Element("div", {"styles": this.css.viewContentScrollNode}).inject(this.viewAreaNode);
  410. this.viewContentNode = new Element("div", {"styles": this.css.viewContentNode}).inject(this.viewContentScrollNode);
  411. MWF.require("MWF.widget.ScrollBar", function(){
  412. new MWF.widget.ScrollBar(this.viewContentScrollNode, {"style": "view", "distance": 100, "indent": false});
  413. }.bind(this));
  414. this.contentLeftNode = new Element("div", {"styles": this.css.contentLeftNode}).inject(this.viewContentNode);
  415. this.contentRightNode = new Element("div", {"styles": this.css.contentRightNode}).inject(this.viewContentNode);
  416. this.viewContentBodyNode = new Element("div", {"styles": this.css.viewContentBodyNode}).inject(this.viewContentNode);
  417. this.viewContentTableNode = new Element("table", {
  418. "styles": this.css.viewContentTableNode,
  419. "border": "0px",
  420. "cellPadding": "0",
  421. "cellSpacing": "0"
  422. }).inject(this.viewContentBodyNode);
  423. },
  424. setContentHeight: function(){
  425. var size = this.areaNode.getSize();
  426. var titleSize = this.viewTitleNode.getSize();
  427. var actionbarSize = this.actionbarNode ? this.actionbarNode.getSize() : {x:0, y:0};
  428. var pagingSize = this.pagingNode ? this.pagingNode.getSize() : {x:0, y:0};
  429. var height = size.y-titleSize.y-actionbarSize.y-pagingSize.y-2;
  430. this.viewContentScrollNode.setStyle("height", height);
  431. var contentSize = this.viewContentBodyNode.getSize();
  432. if (height<contentSize.y) height = contentSize.y+10;
  433. this.viewContentNode.setStyle("height", height);
  434. this.contentLeftNode.setStyle("height", height);
  435. this.contentRightNode.setStyle("height", height);
  436. //this.viewContentBodyNode.setStyle("min-height", height);
  437. },
  438. loadViewColumns: function(){
  439. // for (var i=0; i<10; i++){
  440. if (this.json.data.selectList) {
  441. this.json.data.selectList.each(function (json) {
  442. this.items.push(new MWF.xApplication.query.ViewDesigner.View.Column(json, this));
  443. }.bind(this));
  444. }
  445. // }
  446. },
  447. loadViewSelectAllNode : function(){
  448. var _self = this;
  449. var td = new Element("td.viewTitleCheckboxTd",{ "styles": this.css.viewTitleColumnAreaNode }).inject( this.viewTitleTrNode );
  450. td.setStyles({
  451. "width":"30px", "text-align" : "center",
  452. "display" : this.json.data.selectAllEnable ? "table-cell" : "none"
  453. });
  454. new Element("input",{
  455. "type" : "checkbox",
  456. "events" : {
  457. "change" : function(){
  458. _self.viewContentTableNode.getElements(".viewContentCheckbox").set("checked", this.checked )
  459. }
  460. }
  461. }).inject(td);
  462. },
  463. createViewCheckboxTd : function( tr ){
  464. var td = new Element("td.viewContentCheckboxTd", {"styles": this.css.viewContentTdNode}).inject(tr, "top");
  465. td.setStyles({
  466. "width":"30px", "text-align" : "center",
  467. "display" : this.json.data.selectAllEnable ? "table-cell" : "none"
  468. });
  469. new Element("input.viewContentCheckbox",{
  470. "type" : "checkbox"
  471. }).inject(td);
  472. },
  473. loadView: function(){
  474. this.loadViewNodes();
  475. //this.loadViewSelectAllNode();
  476. this.loadViewColumns();
  477. // this.addTopItemNode.addEvent("click", this.addTopItem.bind(this));
  478. },
  479. loadActionbar: function(){
  480. this.actionbarNode = new Element("div#actionbarNode", {"styles": this.css.actionbarNode}).inject(this.areaNode);
  481. this.actionbarList = [];
  482. if( !this.json.data.actionbarHidden ){
  483. this.showActionbar( true );
  484. }
  485. },
  486. hideActionbar : function(){
  487. this.actionbarNode.hide();
  488. this.setContentHeight();
  489. },
  490. showActionbar : function( noSetHeight ){
  491. this.actionbarNode.show();
  492. if( !this.json.data.actionbarList )this.json.data.actionbarList = [];
  493. if( !this.actionbarList || this.actionbarList.length == 0 ){
  494. if( this.json.data.actionbarList.length ){
  495. this.json.data.actionbarList.each( function(json){
  496. this.actionbarList.push( new MWF.xApplication.query.ViewDesigner.View.Actionbar( json, this.json.data.actionbarList, this) )
  497. }.bind(this));
  498. }else{
  499. this.actionbarList.push( new MWF.xApplication.query.ViewDesigner.View.Actionbar( null, this.json.data.actionbarList, this) )
  500. }
  501. }
  502. if( !noSetHeight )this.setContentHeight();
  503. },
  504. loadPaging: function( noSetHeight ){
  505. this.pagingNode = new Element("div#pagingNode", {"styles": this.css.pagingNode}).inject(this.areaNode);
  506. this.pagingList = [];
  507. if( !this.json.data.pagingList )this.json.data.pagingList = [];
  508. if( !this.pagingList || this.pagingList.length == 0 ){
  509. if( this.json.data.pagingList.length ){
  510. this.json.data.pagingList.each( function(json){
  511. this.pagingList.push( new MWF.xApplication.query.ViewDesigner.View.Paging( json, this.json.data.pagingList, this) )
  512. }.bind(this));
  513. }else{
  514. this.pagingList.push( new MWF.xApplication.query.ViewDesigner.View.Paging( null, this.json.data.pagingList, this) )
  515. }
  516. }
  517. // if( !noSetHeight )this.setContentHeight();
  518. },
  519. setViewWidth: function(){
  520. if( !this.viewAreaNode )return;
  521. this.viewAreaNode.setStyle("width", "auto");
  522. this.viewTitleNode.setStyle("width", "auto");
  523. var s1 = this.viewTitleTableNode.getSize();
  524. var s2 = this.refreshNode.getSize();
  525. var s3 = this.addColumnNode.getSize();
  526. var width = s1.x+s2.x+s2.x;
  527. var size = this.areaNode.getSize();
  528. if (width>size.x){
  529. this.viewTitleNode.setStyle("width", ""+width+"px");
  530. this.viewAreaNode.setStyle("width", ""+width+"px");
  531. }else{
  532. this.viewTitleNode.setStyle("width", ""+size.x+"px");
  533. this.viewAreaNode.setStyle("width", ""+size.x+"px");
  534. }
  535. this.setContentColumnWidth();
  536. this.setContentHeight();
  537. },
  538. //setPropertyContent: function(){
  539. // this.designer.propertyIdNode.set("text", this.data.id);
  540. // this.designer.propertyNameNode.set("value", this.data.name);
  541. // this.designer.propertyAliasNode.set("value", this.data.alias);
  542. // this.designer.propertyDescriptionNode.set("value", this.data.description);
  543. //
  544. // this.designer.jsonDomNode.empty();
  545. // MWF.require("MWF.widget.JsonParse", function(){
  546. // this.jsonParse = new MWF.widget.JsonParse(this.data.data, this.designer.jsonDomNode, this.designer.jsonTextAreaNode);
  547. // window.setTimeout(function(){
  548. // this.jsonParse.load();
  549. // }.bind(this), 1);
  550. // }.bind(this));
  551. //},
  552. setAreaNodeSize: function(){
  553. //var size = this.node.getSize();
  554. ////var tabSize = this.tab.tabNodeContainer.getSize();
  555. //var tabSize = this.node.getSize();
  556. //var y = size.y - tabSize.y;
  557. //this.areaNode.setStyle("height", ""+y+"px");
  558. //if (this.editor) if (this.editor.editor) this.editor.editor.resize();
  559. },
  560. // createRootItem: function() {
  561. // this.items.push(new MWF.xApplication.process.DictionaryDesigner.Dictionary.item("ROOT", this.data.data, null, 0, this, true));
  562. // },
  563. preview: function(){
  564. if( this.isNewView ){
  565. this.designer.notice( this.designer.lp.saveViewNotice, "error" );
  566. return;
  567. }
  568. this.saveSilence( function () {
  569. var url = "../x_desktop/app.html?app=query.Query&status=";
  570. url += JSON.stringify({
  571. id : this.data.application,
  572. viewId : this.data.id
  573. });
  574. window.open(o2.filterUrl(url),"_blank");
  575. }.bind(this));
  576. },
  577. saveSilence: function(callback){
  578. if (!this.data.name){
  579. this.designer.notice(this.designer.lp.notice.inputName, "error");
  580. return false;
  581. }
  582. // var list;
  583. // if( this.data.data && this.data.data.where ){
  584. // if( this.data.data.where.creatorIdentityList ){
  585. // list = this.data.data.where.creatorIdentityList;
  586. // for( var i=0; i< list.length ; i++){
  587. // if( typeOf( list[i] ) === "object" )list[i] = list[i].name || "";
  588. // }
  589. // }
  590. // if( this.data.data.where.creatorPersonList ){
  591. // list = this.data.data.where.creatorPersonList;
  592. // for( var i=0; i< list.length ; i++){
  593. // if( typeOf( list[i] ) === "object" )list[i] = list[i].name || "";
  594. // }
  595. // }
  596. // if( this.data.data.where.creatorUnitList ){
  597. // list = this.data.data.where.creatorIdentityList;
  598. // for( var i=0; i< list.length ; i++){
  599. // if( typeOf( list[i] ) === "object" )list[i] = list[i].name || "";
  600. // }
  601. // }
  602. // }
  603. this.designer.actions.saveView(this.data, function(json){
  604. this.data.id = json.data.id;
  605. this.isNewView = false;
  606. //this.page.textNode.set("text", this.data.name);
  607. if (this.lisNode) {
  608. this.lisNode.getLast().set("text", this.data.name+"("+this.data.alias+")");
  609. }
  610. if (callback) callback();
  611. }.bind(this));
  612. },
  613. save: function(callback){
  614. //if (this.designer.tab.showPage==this.page){
  615. if (!this.data.name){
  616. this.designer.notice(this.designer.lp.notice.inputName, "error");
  617. return false;
  618. }
  619. //}
  620. debugger;
  621. // var list;
  622. // if( this.data.data && this.data.data.where ){
  623. // if( this.data.data.where.creatorIdentityList ){
  624. // list = this.data.data.where.creatorIdentityList;
  625. // for( var i=0; i< list.length ; i++){
  626. // if( typeOf( list[i] ) === "object" )list[i] = list[i].name || "";
  627. // }
  628. // }
  629. // if( this.data.data.where.creatorPersonList ){
  630. // list = this.data.data.where.creatorPersonList;
  631. // for( var i=0; i< list.length ; i++){
  632. // if( typeOf( list[i] ) === "object" )list[i] = list[i].name || "";
  633. // }
  634. // }
  635. // if( this.data.data.where.creatorUnitList ){
  636. // list = this.data.data.where.creatorUnitList;
  637. // for( var i=0; i< list.length ; i++){
  638. // if( typeOf( list[i] ) === "object" )list[i] = list[i].name || "";
  639. // }
  640. // }
  641. // }
  642. this.designer.actions.saveView(this.data, function(json){
  643. this.designer.notice(this.designer.lp.notice.save_success, "success", this.node, {"x": "left", "y": "bottom"});
  644. this.isNewView = false;
  645. this.data.id = json.data.id;
  646. //this.page.textNode.set("text", this.data.name);
  647. if (this.lisNode) {
  648. this.lisNode.getLast().set("text", this.data.name+"("+this.data.alias+")");
  649. }
  650. if (callback) callback();
  651. }.bind(this));
  652. },
  653. explode: function(){},
  654. implode: function(){},
  655. _setEditStyle: function(name, input, oldValue){
  656. if (name=="type"){
  657. this.items.each(function(item){
  658. if (item.property){
  659. var processDiv = item.property.propertyContent.getElements("#"+item.json.id+"dataPathSelectedProcessArea");
  660. var cmsDiv = item.property.propertyContent.getElements("#"+item.json.id+"dataPathSelectedCMSArea");
  661. if (this.json[name]=="cms"){
  662. cmsDiv.setStyle("display", "block");
  663. processDiv.setStyle("display", "none");
  664. }else{
  665. cmsDiv.setStyle("display", "none");
  666. processDiv.setStyle("display", "block");
  667. }
  668. }
  669. }.bind(this));
  670. }
  671. if( name=="data.actionbarHidden" ){
  672. if( this.json.data.actionbarHidden ){
  673. this.hideActionbar()
  674. }else{
  675. this.showActionbar()
  676. }
  677. }
  678. if( name=="data.selectAllEnable" ){
  679. if( this.json.data.selectAllEnable ){
  680. this.viewTitleTrNode.getElement(".viewTitleCheckboxTd").setStyle("display","table-cell");
  681. this.viewContentTableNode.getElements(".viewContentCheckboxTd").setStyle("display","table-cell");
  682. }else{
  683. this.viewTitleTrNode.getElement(".viewTitleCheckboxTd").setStyle("display","none");
  684. this.viewContentTableNode.getElements(".viewContentCheckboxTd").setStyle("display","none");
  685. }
  686. }
  687. if (name=="data.viewStyleType"){
  688. var file = (this.stylesList && this.json.data.viewStyleType) ? this.stylesList[this.json.data.viewStyleType].file : null;
  689. var extendFile = (this.stylesList && this.json.data.viewStyleType) ? this.stylesList[this.json.data.viewStyleType].extendFile : null;
  690. this.loadTemplateStyles( file, extendFile, function( templateStyles ){
  691. this.templateStyles = templateStyles;
  692. var oldFile, oldExtendFile;
  693. if( oldValue && this.stylesList[oldValue] ){
  694. oldFile = this.stylesList[oldValue].file;
  695. oldExtendFile = this.stylesList[oldValue].extendFile;
  696. }
  697. this.loadTemplateStyles( oldFile, oldExtendFile, function( oldTemplateStyles ){
  698. this.json.data.styleConfig = (this.stylesList && this.json.data.viewStyleType) ? this.stylesList[this.json.data.viewStyleType] : null;
  699. if (oldTemplateStyles["view"]) this.clearTemplateStyles(oldTemplateStyles["view"]);
  700. if (this.templateStyles["view"]) this.setTemplateStyles(this.templateStyles["view"]);
  701. this.setAllStyles();
  702. this.actionbarList.each( function (module) {
  703. if (oldTemplateStyles["actionbar"]){
  704. module.clearTemplateStyles(oldTemplateStyles["actionbar"]);
  705. }
  706. module.setStyleTemplate();
  707. module.setAllStyles();
  708. })
  709. this.pagingList.each( function (module) {
  710. if (oldTemplateStyles["paging"]){
  711. module.clearTemplateStyles(oldTemplateStyles["paging"]);
  712. }
  713. module.setStyleTemplate();
  714. module.setAllStyles();
  715. });
  716. // this.moduleList.each(function(module){
  717. // if (oldTemplateStyles[module.moduleName]){
  718. // module.clearTemplateStyles(oldTemplateStyles[module.moduleName]);
  719. // }
  720. // module.setStyleTemplate();
  721. // module.setAllStyles();
  722. // }.bind(this));
  723. }.bind(this))
  724. }.bind(this))
  725. }
  726. if (name=="data.viewStyles"){
  727. this.setCustomStyles();
  728. }
  729. },
  730. setAllStyles: function(){
  731. // this.setPropertiesOrStyles("styles");
  732. // this.setPropertiesOrStyles("properties");
  733. this.setCustomStyles();
  734. this.reloadMaplist();
  735. },
  736. reloadMaplist: function(){
  737. if (this.property) Object.each(this.property.maplists, function(map, name){ map.reload(this.json[name]);}.bind(this));
  738. },
  739. // setPropertiesOrStyles: function(name){
  740. // if (name=="styles"){
  741. // this.setCustomStyles();
  742. // }
  743. // if (name=="properties"){
  744. // this.node.setProperties(this.json.properties);
  745. // }
  746. // },
  747. setCustomStyles: function(){
  748. this.items.each( function( item ){
  749. item.setCustomStyles()
  750. }.bind(this));
  751. // var border = this.node.getStyle("border");
  752. // this.node.clearStyles();
  753. // this.node.setStyles((this.options.mode==="Mobile") ? this.css.formMobileNode : this.css.formNode);
  754. // var y = this.container.getStyle("height");
  755. // y = (y) ? y.toInt()-2 : this.container.getSize().y-2;
  756. // this.node.setStyle("min-height", ""+y+"px");
  757. //
  758. // if (this.initialStyles) this.node.setStyles(this.initialStyles);
  759. // this.node.setStyle("border", border);
  760. //
  761. // Object.each(this.json.styles, function(value, key){
  762. // var reg = /^border\w*/ig;
  763. // if (!key.test(reg)){
  764. // this.node.setStyle(key, value);
  765. // }
  766. // }.bind(this));
  767. },
  768. loadTemplateStyle : function( callback ){
  769. this.loadStylesList(function(){
  770. var oldStyleValue = "";
  771. if ((!this.json.data.viewStyleType) || !this.stylesList[this.json.data.viewStyleType]) this.json.data.viewStyleType="default";
  772. // if (this.options.mode=="Mobile"){
  773. // if (this.json.viewStyleType != "defaultMobile"){
  774. // var styles = this.stylesList[this.json.viewStyleType];
  775. // if( !styles || typeOf(styles.mode)!=="array" || !styles.mode.contains( "mobile" ) ){
  776. // oldStyleValue = this.json.viewStyleType;
  777. // this.json.viewStyleType = "defaultMobile";
  778. // }
  779. // }
  780. // }
  781. this.loadTemplateStyles( this.stylesList[this.json.data.viewStyleType].file, this.stylesList[this.json.data.viewStyleType].extendFile,
  782. function( templateStyles ){
  783. this.templateStyles = templateStyles;
  784. // this.loadDomModules();
  785. if( !this.json.data.viewStyleType )this.json.data.viewStyleType = "default";
  786. if ( this.templateStyles && this.templateStyles["view"]){
  787. if(!this.json.data.viewStyles){
  788. this.json.data.viewStyles = Object.clone(this.templateStyles["view"]);
  789. }else{
  790. this.setTemplateStyles(this.templateStyles["view"]);
  791. }
  792. }
  793. this.setCustomStyles();
  794. // this.node.setProperties(this.json.data.properties);
  795. if(callback)callback();
  796. // this.setNodeEvents();
  797. // if (this.options.mode=="Mobile"){
  798. // if (oldStyleValue) this._setEditStyle("viewStyleType", null, oldStyleValue);
  799. // }
  800. }.bind(this)
  801. );
  802. }.bind(this));
  803. },
  804. removeStyles: function(from, to){
  805. if (this.json.data.viewStyles[to]){
  806. Object.each(from, function(style, key){
  807. if (this.json.data.viewStyles[to][key] && this.json.data.viewStyles[to][key]==style){
  808. delete this.json.data.viewStyles[to][key];
  809. }
  810. }.bind(this));
  811. }
  812. },
  813. copyStyles: function(from, to){
  814. if (!this.json.data.viewStyles[to]) this.json.data.viewStyles[to] = {};
  815. Object.each(from, function(style, key){
  816. if (!this.json.data.viewStyles[to][key]) this.json.data.viewStyles[to][key] = style;
  817. }.bind(this));
  818. },
  819. // clearTemplateStyles: function(styles){
  820. // if (styles){
  821. // if (styles.styles) this.removeStyles(styles.styles, "styles");
  822. // if (styles.properties) this.removeStyles(styles.properties, "properties");
  823. // }
  824. // },
  825. // setTemplateStyles: function(styles){
  826. // if (styles.styles) this.copyStyles(styles.styles, "styles");
  827. // if (styles.properties) this.copyStyles(styles.properties, "properties");
  828. // },
  829. clearTemplateStyles: function(styles){
  830. if (styles){
  831. if (styles.container) this.removeStyles(styles.container, "container");
  832. if (styles.table) this.removeStyles(styles.table, "table");
  833. if (styles.titleTr) this.removeStyles(styles.titleTr, "titleTr");
  834. if (styles.titleTd) this.removeStyles(styles.titleTd, "titleTd");
  835. if (styles.contentTr) this.removeStyles(styles.contentTr, "contentTr");
  836. if (styles.contentSelectedTr) this.removeStyles(styles.contentSelectedTr, "contentSelectedTr");
  837. if (styles.contentTd) this.removeStyles(styles.contentTd, "contentTd");
  838. if (styles.contentGroupTd) this.removeStyles(styles.contentGroupTd, "contentGroupTd");
  839. if (styles.groupCollapseNode) this.removeStyles(styles.groupCollapseNode, "groupCollapseNode");
  840. if (styles.groupExpandNode) this.removeStyles(styles.groupExpandNode, "groupExpandNode");
  841. if (styles.checkboxNode) this.removeStyles(styles.checkboxNode, "checkboxNode");
  842. if (styles.checkedCheckboxNode) this.removeStyles(styles.checkedCheckboxNode, "checkedCheckboxNode");
  843. if (styles.radioNode) this.removeStyles(styles.radioNode, "radioNode");
  844. if (styles.checkedRadioNode) this.removeStyles(styles.checkedRadioNode, "checkedRadioNode");
  845. if (styles.tableProperties) this.removeStyles(styles.tableProperties, "tableProperties");
  846. }
  847. },
  848. setTemplateStyles: function(styles){
  849. if (styles.container) this.copyStyles(styles.container, "container");
  850. if (styles.table) this.copyStyles(styles.table, "table");
  851. if (styles.titleTr) this.copyStyles(styles.titleTr, "titleTr");
  852. if (styles.titleTd) this.copyStyles(styles.titleTd, "titleTd");
  853. if (styles.contentTr) this.copyStyles(styles.contentTr, "contentTr");
  854. if (styles.contentSelectedTr) this.copyStyles(styles.contentSelectedTr, "contentSelectedTr");
  855. if (styles.contentTd) this.copyStyles(styles.contentTd, "contentTd");
  856. if (styles.contentGroupTd) this.copyStyles(styles.contentGroupTd, "contentGroupTd");
  857. if (styles.groupCollapseNode) this.copyStyles(styles.groupCollapseNode, "groupCollapseNode");
  858. if (styles.groupExpandNode) this.copyStyles(styles.groupExpandNode, "groupExpandNode");
  859. if (styles.checkboxNode) this.copyStyles(styles.checkboxNode, "checkboxNode");
  860. if (styles.checkedCheckboxNode) this.copyStyles(styles.checkedCheckboxNode, "checkedCheckboxNode");
  861. if (styles.radioNode) this.copyStyles(styles.radioNode, "radioNode");
  862. if (styles.checkedRadioNode) this.copyStyles(styles.checkedRadioNode, "checkedRadioNode");
  863. if (styles.tableProperties) this.copyStyles(styles.tableProperties, "tableProperties");
  864. },
  865. loadTemplateStyles : function( file, extendFile, callback ){
  866. if( !file ){
  867. if (callback) callback({});
  868. return;
  869. }
  870. this.templateStylesList = this.templateStylesList || {};
  871. if( this.templateStylesList[file] ){
  872. if (callback) callback(this.templateStylesList[file]);
  873. return;
  874. }
  875. this.loadTemplateStyleFile( file, function( json_file ){
  876. this.loadTemplateExtendStyleFile( extendFile, function( json_extend ){
  877. this.templateStylesList[file] = Object.merge( json_file, json_extend );
  878. if (callback) callback(this.templateStylesList[file]);
  879. }.bind(this))
  880. }.bind(this))
  881. },
  882. loadTemplateStyleFile : function(file, callback ){
  883. if( !file ){
  884. if (callback) callback({});
  885. return;
  886. }
  887. var stylesUrl = "../x_component_query_ViewDesigner/$View/skin/"+file;
  888. MWF.getJSON(stylesUrl,{
  889. "onSuccess": function(responseJSON){
  890. //this.templateStylesList[file] = responseJSON;
  891. if (callback) callback(responseJSON);
  892. }.bind(this),
  893. "onRequestFailure": function(){
  894. if (callback) callback({});
  895. }.bind(this),
  896. "onError": function(){
  897. if (callback) callback({});
  898. }.bind(this)
  899. }
  900. );
  901. },
  902. loadTemplateExtendStyleFile : function(extendFile, callback ){
  903. if( !extendFile ){
  904. if (callback) callback({});
  905. return;
  906. }
  907. var stylesUrl = "../x_component_query_ViewDesigner/$View/skin/"+extendFile;
  908. MWF.getJSON(stylesUrl,{
  909. "onSuccess": function(responseJSON){
  910. //this.templateStylesList[file] = responseJSON;
  911. if (callback) callback(responseJSON);
  912. }.bind(this),
  913. "onRequestFailure": function(){
  914. if (callback) callback({});
  915. }.bind(this),
  916. "onError": function(){
  917. if (callback) callback({});
  918. }.bind(this)
  919. }
  920. );
  921. },
  922. loadStylesList: function(callback){
  923. var configUrl = "../x_component_query_ViewDesigner/$View/skin/config.json";
  924. MWF.getJSON(configUrl,{
  925. "onSuccess": function(responseJSON){
  926. this.stylesList = responseJSON;
  927. if (callback) callback(this.stylesList);
  928. }.bind(this),
  929. "onRequestFailure": function(){
  930. this.stylesList = {};
  931. if (callback) callback(this.stylesList);
  932. }.bind(this),
  933. "onError": function(){
  934. this.stylesList = {};
  935. if (callback) callback(this.stylesList);
  936. }.bind(this)
  937. }
  938. );
  939. },
  940. saveAs: function(){
  941. var form = new MWF.xApplication.query.ViewDesigner.View.NewNameForm(this, {
  942. name : this.data.name + "_" + MWF.xApplication.query.ViewDesigner.LP.copy,
  943. query : this.data.query || this.data.application,
  944. queryName : this.data.queryName || this.data.applicationName
  945. }, {
  946. onSave : function( data, callback ){
  947. this._saveAs( data, callback );
  948. }.bind(this)
  949. }, {
  950. app: this.designer
  951. });
  952. form.edit()
  953. },
  954. cloneObject : function( obj ){
  955. if (null == obj || "object" != typeof obj) return obj;
  956. if ( typeof obj.length==='number'){ //数组
  957. //print( "array" );
  958. var copy = [];
  959. for (var i = 0, len = obj.length; i < len; ++i) {
  960. copy[i] = this.cloneObject(obj[i]);
  961. }
  962. return copy;
  963. }else{
  964. var copy = {};
  965. for (var attr in obj) {
  966. copy[attr] = this.cloneObject(obj[attr]);
  967. }
  968. return copy;
  969. }
  970. },
  971. _saveAs : function( data , callback){
  972. var _self = this;
  973. var d = this.cloneObject( this.data );
  974. d.isNewView = true;
  975. d.id = this.designer.actions.getUUID();
  976. d.name = data.name;
  977. d.alias = "";
  978. d.query = data.query;
  979. d.queryName = data.queryName;
  980. d.application = data.query;
  981. d.applicationName = data.queryName;
  982. d.pid = d.id + d.id;
  983. delete d[this.data.id+"viewFilterType"];
  984. d[d.id+"viewFilterType"]="custom";
  985. d.data.selectList.each( function( entry ){
  986. entry.id = (new MWF.widget.UUID).id;
  987. }.bind(this));
  988. this.designer.actions.saveView(d, function(json){
  989. this.designer.notice(this.designer.lp.notice.saveAs_success, "success", this.node, {"x": "left", "y": "bottom"});
  990. if (callback) callback();
  991. }.bind(this));
  992. }
  993. });
  994. MWF.xApplication.query.ViewDesigner.View.Column = new Class({
  995. initialize: function(json, view, next){
  996. this.propertyPath = "../x_component_query_ViewDesigner/$View/column.html";
  997. this.view = view;
  998. this.json = json;
  999. this.next = next;
  1000. this.css = this.view.css;
  1001. this.content = this.view.viewTitleTrNode;
  1002. this.domListNode = this.view.domListNode;
  1003. this.load();
  1004. },
  1005. load: function(){
  1006. this.areaNode = new Element("td", {"styles": this.css.viewTitleColumnAreaNode});
  1007. this.areaNode.store("column", this);
  1008. if (this.next){
  1009. this.areaNode.inject(this.next.areaNode, "before");
  1010. }else{
  1011. this.areaNode.inject(this.content);
  1012. }
  1013. this.node = new Element("div", {
  1014. "styles": this.css.viewTitleColumnNode
  1015. }).inject(this.areaNode);
  1016. this.textNode = new Element("div", {
  1017. "styles": this.css.viewTitleColumnTextNode,
  1018. "text": this.json.displayName
  1019. }).inject(this.node);
  1020. this.createDomListItem();
  1021. this._createIconAction();
  1022. //if (!this.json.export) this.hideMode();
  1023. this.setEvent();
  1024. this.setCustomStyles();
  1025. },
  1026. setCustomStyles : function(){
  1027. var viewStyles = this.view.json.data.viewStyles;
  1028. var border = this.areaNode.getStyle("border");
  1029. this.areaNode.clearStyles();
  1030. this.areaNode.setStyles(this.css.viewTitleColumnAreaNode);
  1031. // var y = this.container.getStyle("height");
  1032. // y = (y) ? y.toInt()-2 : this.container.getSize().y-2;
  1033. // this.node.setStyle("min-height", ""+y+"px");
  1034. // if (this.initialStyles) this.node.setStyles(this.initialStyles);
  1035. this.node.setStyle("border", border);
  1036. Object.each(viewStyles.titleTd, function(value, key){
  1037. var reg = /^border\w*/ig;
  1038. if (!key.test(reg)){
  1039. this.node.setStyle(key, value);
  1040. }
  1041. }.bind(this));
  1042. },
  1043. createDomListItem: function(){
  1044. this.listNode = new Element("div", {"styles": this.css.cloumnListNode});
  1045. if (this.next){
  1046. this.listNode.inject(this.next.listNode, "before");
  1047. }else{
  1048. this.listNode.inject(this.domListNode);
  1049. }
  1050. var listIconNode = new Element("div", {"styles": this.css.cloumnListIconNode}).inject(this.listNode);
  1051. var listTextNode = new Element("div", {"styles": this.css.cloumnListTextNode}).inject(this.listNode);
  1052. this.resetTextNode();
  1053. },
  1054. setEvent: function(){
  1055. this.node.addEvents({
  1056. "click": function(e){this.selected(); e.stopPropagation();}.bind(this),
  1057. "mouseover": function(){if (!this.isSelected) this.node.setStyles(this.css.viewTitleColumnNode_over)}.bind(this),
  1058. "mouseout": function(){if (!this.isSelected) if (this.isError){
  1059. this.node.setStyles(this.css.viewTitleColumnNode_error)
  1060. }else{
  1061. this.node.setStyles(this.css.viewTitleColumnNode)
  1062. }}.bind(this)
  1063. });
  1064. this.listNode.addEvents({
  1065. "click": function(e){this.selected(); e.stopPropagation();}.bind(this),
  1066. "mouseover": function(){debugger; if (!this.isSelected) this.listNode.setStyles(this.css.cloumnListNode_over)}.bind(this),
  1067. "mouseout": function(){if (!this.isSelected) this.listNode.setStyles(this.css.cloumnListNode)}.bind(this)
  1068. });
  1069. },
  1070. _createIconAction: function(){
  1071. if (!this.actionArea){
  1072. this.actionArea = new Element("div", {"styles": this.css.actionAreaNode}).inject(this.view.areaNode, "after");
  1073. this._createAction({
  1074. "name": "move",
  1075. "icon": "move1.png",
  1076. "event": "mousedown",
  1077. "action": "move",
  1078. "title": MWF.APPDVD.LP.action.move
  1079. });
  1080. this._createAction({
  1081. "name": "add",
  1082. "icon": "add.png",
  1083. "event": "click",
  1084. "action": "addColumn",
  1085. "title": MWF.APPDVD.LP.action.add
  1086. });
  1087. this._createAction({
  1088. "name": "delete",
  1089. "icon": "delete1.png",
  1090. "event": "click",
  1091. "action": "delete",
  1092. "title": MWF.APPDVD.LP.action["delete"]
  1093. });
  1094. }
  1095. },
  1096. _createAction: function(action){
  1097. var actionNode = new Element("div", {
  1098. "styles": this.css.actionNodeStyles,
  1099. "title": action.title
  1100. }).inject(this.actionArea);
  1101. actionNode.setStyle("background", "url("+this.view.path+this.view.options.style+"/action/"+action.icon+") no-repeat left center");
  1102. actionNode.addEvent(action.event, function(e){
  1103. this[action.action](e);
  1104. }.bind(this));
  1105. actionNode.addEvents({
  1106. "mouseover": function(e){
  1107. e.target.setStyle("border", "1px solid #999");
  1108. }.bind(this),
  1109. "mouseout": function(e){
  1110. e.target.setStyle("border", "1px solid #F1F1F1");
  1111. }.bind(this)
  1112. });
  1113. },
  1114. _setActionAreaPosition: function(){
  1115. var p = this.node.getPosition(this.view.areaNode.getOffsetParent());
  1116. var y = p.y-25;
  1117. var x = p.x;
  1118. this.actionArea.setPosition({"x": x, "y": y});
  1119. },
  1120. _showActions: function(){
  1121. if (this.actionArea){
  1122. this._setActionAreaPosition();
  1123. this.actionArea.setStyle("display", "block");
  1124. }
  1125. },
  1126. _hideActions: function(){
  1127. if (this.actionArea) this.actionArea.setStyle("display", "none");
  1128. },
  1129. selected: function(){
  1130. if (this.view.currentSelectedModule){
  1131. if (this.view.currentSelectedModule==this){
  1132. return true;
  1133. }else{
  1134. this.view.currentSelectedModule.unSelected();
  1135. }
  1136. }
  1137. this.node.setStyles(this.css.viewTitleColumnNode_selected);
  1138. this.listNode.setStyles(this.css.cloumnListNode_selected);
  1139. new Fx.Scroll(this.view.areaNode, {"wheelStops": false, "duration": 100}).toElementEdge(this.node);
  1140. new Fx.Scroll(this.view.designer.propertyDomArea, {"wheelStops": false, "duration": 100}).toElement(this.listNode);
  1141. this.view.currentSelectedModule = this;
  1142. this.isSelected = true;
  1143. this._showActions();
  1144. this.showProperty();
  1145. },
  1146. unSelected: function(){
  1147. this.view.currentSelectedModule = null;
  1148. //this.node.setStyles(this.css.viewTitleColumnNode);
  1149. if (this.isError){
  1150. this.node.setStyles(this.css.viewTitleColumnNode_error)
  1151. }else{
  1152. this.node.setStyles(this.css.viewTitleColumnNode)
  1153. }
  1154. this.listNode.setStyles(this.css.cloumnListNode);
  1155. this.isSelected = false;
  1156. this._hideActions();
  1157. this.hideProperty();
  1158. },
  1159. showProperty: function(){
  1160. if (!this.property){
  1161. this.property = new MWF.xApplication.query.ViewDesigner.Property(this, this.view.designer.propertyContentArea, this.view.designer, {
  1162. "path": this.propertyPath,
  1163. "onPostLoad": function(){
  1164. this.property.show();
  1165. var processDiv = this.property.propertyContent.getElements("#"+this.json.id+"dataPathSelectedProcessArea");
  1166. var cmsDiv = this.property.propertyContent.getElements("#"+this.json.id+"dataPathSelectedCMSArea");
  1167. if (this.view.json.type=="cms"){
  1168. processDiv.setStyle("display", "none");
  1169. cmsDiv.setStyle("display", "block");
  1170. }else{
  1171. processDiv.setStyle("display", "block");
  1172. cmsDiv.setStyle("display", "none");
  1173. }
  1174. }.bind(this)
  1175. });
  1176. this.property.load();
  1177. }else{
  1178. this.property.show();
  1179. }
  1180. },
  1181. hideProperty: function(){
  1182. if (this.property) this.property.hide();
  1183. },
  1184. _setEditStyle: function(name, input, oldValue){
  1185. if (name=="displayName") this.resetTextNode();
  1186. if (name=="selectType") this.resetTextNode();
  1187. if (name=="attribute") this.resetTextNode();
  1188. if (name=="path") this.resetTextNode();
  1189. if (name=="column"){
  1190. this.view.json.data.orderList.each(function(order){
  1191. if (order.column==oldValue) order.column = this.json.column
  1192. }.bind(this));
  1193. if (this.view.json.data.group.column == oldValue) this.view.json.data.group.column = this.json.column;
  1194. }
  1195. },
  1196. resetTextNode: function(){
  1197. var listText = (this.json.selectType=="attribute") ? (this.json.attribute || "") : (this.json.path || "");
  1198. if (!listText) listText = "unnamed";
  1199. this.textNode.set("text", this.json.displayName);
  1200. this.listNode.getLast().set("text", this.json.displayName+"("+listText+")");
  1201. },
  1202. "delete": function(e){
  1203. var _self = this;
  1204. if (!e) e = this.node;
  1205. this.view.designer.confirm("warn", e, MWF.APPDVD.LP.notice.deleteColumnTitle, MWF.APPDVD.LP.notice.deleteColumn, 300, 120, function(){
  1206. _self.destroy();
  1207. this.close();
  1208. }, function(){
  1209. this.close();
  1210. }, null);
  1211. },
  1212. isOrderColumn : function(){
  1213. var sortList = this.view.json.data.orderList || [];
  1214. var flag = false;
  1215. sortList.each(function(order){
  1216. if (order.column==this.json.column)flag = true;
  1217. }.bind(this));
  1218. return flag;
  1219. },
  1220. isGroupColumn : function() {
  1221. if (!this.view.json || !this.view.json.data || !this.view.json.data.group) return false;
  1222. return this.view.json.data.group.column === this.json.column;
  1223. },
  1224. destroy: function(){
  1225. if (this.view.currentSelectedModule==this) this.view.currentSelectedModule = null;
  1226. if (this.actionArea) this.actionArea.destroy();
  1227. if (this.listNode) this.listNode.destroy();
  1228. if (this.property) this.property.propertyContent.destroy();
  1229. var idx = this.view.items.indexOf(this);
  1230. if (this.view.viewContentTableNode){
  1231. var trs = this.view.viewContentTableNode.getElements("tr");
  1232. var isGroup = this.isGroupColumn();
  1233. trs.each(function(tr){
  1234. if( isGroup ){
  1235. if( tr.get("data-is-group") === "yes" ){
  1236. tr.destroy()
  1237. }
  1238. }else{
  1239. if( tr.get("data-is-group") !== "yes" ){
  1240. tr.deleteCell(idx);
  1241. }
  1242. }
  1243. }.bind(this));
  1244. }
  1245. if (this.view.json.data.group.column === this.json.column){
  1246. this.view.json.data.group.column = null;
  1247. }
  1248. var sortList = this.view.json.data.orderList || [];
  1249. var deleteItem = null;
  1250. sortList.each(function(order){
  1251. if (order.column==this.json.column){
  1252. deleteItem = order;
  1253. }
  1254. }.bind(this));
  1255. if (deleteItem) sortList.erase(deleteItem);
  1256. if (this.view.json.data.selectList) this.view.json.data.selectList.erase(this.json);
  1257. if (this.view.json.data.calculate) if (this.view.json.data.calculate.calculateList) this.view.json.data.calculate.calculateList.erase(this.json);
  1258. this.view.items.erase(this);
  1259. if (this.view.property) this.view.property.loadStatColumnSelect();
  1260. this.areaNode.destroy();
  1261. this.view.selected();
  1262. this.view.setViewWidth();
  1263. MWF.release(this);
  1264. delete this;
  1265. },
  1266. addColumn: function(e, data){
  1267. MWF.require("MWF.widget.UUID", function(){
  1268. var json;
  1269. if (data){
  1270. json = Object.clone(data);
  1271. json.id = (new MWF.widget.UUID).id;
  1272. json.column = (new MWF.widget.UUID).id;
  1273. }else{
  1274. var id = (new MWF.widget.UUID).id;
  1275. json = {
  1276. "id": id,
  1277. "column": id,
  1278. "displayName": this.view.designer.lp.unnamed,
  1279. "orderType": "original"
  1280. };
  1281. }
  1282. var idx = this.view.json.data.selectList.indexOf(this.json);
  1283. this.view.json.data.selectList.splice(idx, 0, json);
  1284. var column = new MWF.xApplication.query.ViewDesigner.View.Column(json, this.view, this);
  1285. this.view.items.splice(idx, 0, column);
  1286. column.selected();
  1287. if (this.view.viewContentTableNode){
  1288. var trs = this.view.viewContentTableNode.getElements("tr");
  1289. trs.each(function(tr){
  1290. var td = tr.insertCell(idx);
  1291. td.setStyles(this.css.viewContentTdNode);
  1292. }.bind(this));
  1293. }
  1294. this.view.setViewWidth();
  1295. }.bind(this));
  1296. },
  1297. move: function(e){
  1298. var columnNodes = [];
  1299. this.view.items.each(function(item){
  1300. if (item!=this){
  1301. columnNodes.push(item.areaNode);
  1302. }
  1303. }.bind(this));
  1304. this._createMoveNode();
  1305. this._setNodeMove(columnNodes, e);
  1306. },
  1307. _createMoveNode: function(){
  1308. this.moveNode = new Element("div", {"text": this.node.get("text")});
  1309. this.moveNode.inject(this.view.designer.content);
  1310. this.moveNode.setStyles({
  1311. "border": "2px dashed #ffa200",
  1312. "opacity": 0.7,
  1313. "height": "30px",
  1314. "line-height": "30px",
  1315. "padding": "0px 10px",
  1316. "position": "absolute"
  1317. });
  1318. },
  1319. _setMoveNodePosition: function(e){
  1320. var x = e.page.x+2;
  1321. var y = e.page.y+2;
  1322. this.moveNode.positionTo(x, y);
  1323. },
  1324. createMoveFlagNode: function(){
  1325. this.moveFlagNode = new Element("td", {"styles": this.css.moveFlagNode});
  1326. },
  1327. _setNodeMove: function(droppables, e){
  1328. this._setMoveNodePosition(e);
  1329. var movePosition = this.moveNode.getPosition();
  1330. var moveSize = this.moveNode.getSize();
  1331. var contentPosition = this.content.getPosition();
  1332. var contentSize = this.content.getSize();
  1333. var nodeDrag = new Drag.Move(this.moveNode, {
  1334. "droppables": droppables,
  1335. "limit": {
  1336. "x": [contentPosition.x, contentPosition.x+contentSize.x],
  1337. "y": [movePosition.y, movePosition.y+moveSize.y]
  1338. },
  1339. "onEnter": function(dragging, inObj){
  1340. if (!this.moveFlagNode) this.createMoveFlagNode();
  1341. this.moveFlagNode.inject(inObj, "before");
  1342. }.bind(this),
  1343. "onLeave": function(dragging, inObj){
  1344. if (this.moveFlagNode){
  1345. this.moveFlagNode.dispose();
  1346. }
  1347. }.bind(this),
  1348. "onDrop": function(dragging, inObj){
  1349. if (inObj){
  1350. this.areaNode.inject(inObj, "before");
  1351. var column = inObj.retrieve("column");
  1352. this.listNode.inject(column.listNode, "before");
  1353. var idx = this.view.json.data.selectList.indexOf(column.json);
  1354. this.view.json.data.selectList.erase(this.json);
  1355. this.view.items.erase(this);
  1356. this.view.json.data.selectList.splice(idx, 0, this.json);
  1357. this.view.items.splice(idx, 0, this);
  1358. if (this.moveNode) this.moveNode.destroy();
  1359. if (this.moveFlagNode) this.moveFlagNode.destroy();
  1360. this._setActionAreaPosition();
  1361. }else{
  1362. if (this.moveNode) this.moveNode.destroy();
  1363. if (this.moveFlagNode) this.moveFlagNode.destroy();
  1364. }
  1365. }.bind(this),
  1366. "onCancel": function(dragging){
  1367. if (this.moveNode) this.moveNode.destroy();
  1368. if (this.moveFlagNode) this.moveFlagNode.destroy();
  1369. }.bind(this)
  1370. });
  1371. nodeDrag.start(e);
  1372. }
  1373. //hideMode: function(){
  1374. // if (!this.columnHideFlagNode){
  1375. // this.columnHideFlagNode = new Element("div", {"styles": this.view.css.columnHideFlagNode}).inject(this.node);
  1376. // }
  1377. //},
  1378. //showMode: function(){
  1379. // if (this.columnHideFlagNode) this.columnHideFlagNode.destroy();
  1380. // this.columnHideFlagNode = null;
  1381. //}
  1382. });
  1383. MWF.xApplication.query.ViewDesigner.View.$Module = MWF.QV$Module = new Class({
  1384. Extends: MWF.widget.Common,
  1385. Implements: [Options, Events],
  1386. copyStyles: function(from, to){
  1387. if (!this.json[to]) this.json[to] = {};
  1388. Object.each(from, function(style, key){
  1389. //if (!this.json[to][key])
  1390. this.json[to][key] = style;
  1391. }.bind(this));
  1392. },
  1393. removeStyles: function(from, to){
  1394. if (this.json[to]){
  1395. Object.each(from, function(style, key){
  1396. if (this.json[to][key] && this.json[to][key]==style){
  1397. delete this.json[to][key];
  1398. }
  1399. //if (this.json[from][key]){
  1400. // delete this.json[to][key];
  1401. //}
  1402. }.bind(this));
  1403. }
  1404. },
  1405. setTemplateStyles: function(styles){
  1406. if (styles.styles) this.copyStyles(styles.styles, "styles");
  1407. if (styles.properties) this.copyStyles(styles.properties, "properties");
  1408. },
  1409. clearTemplateStyles: function(styles){
  1410. if (styles){
  1411. if (styles.styles) this.removeStyles(styles.styles, "styles");
  1412. if (styles.properties) this.removeStyles(styles.properties, "properties");
  1413. }
  1414. },
  1415. setStyleTemplate: function(){
  1416. if( this.view.templateStyles && this.view.templateStyles[this.moduleName] ){
  1417. this.setTemplateStyles(this.view.templateStyles[this.moduleName]);
  1418. }
  1419. },
  1420. setAllStyles: function(){
  1421. this.setPropertiesOrStyles("styles");
  1422. this.setPropertiesOrStyles("inputStyles");
  1423. this.setPropertiesOrStyles("properties");
  1424. this.reloadMaplist();
  1425. },
  1426. showProperty: function(){
  1427. if (!this.property){
  1428. this.property = new MWF.xApplication.query.ViewDesigner.Property(this, this.view.designer.propertyContentArea, this.view.designer, {
  1429. "path": this.propertyPath,
  1430. "onPostLoad": function(){
  1431. this.property.show();
  1432. }.bind(this)
  1433. });
  1434. this.property.load();
  1435. }else{
  1436. this.property.show();
  1437. }
  1438. },
  1439. hideProperty: function(){
  1440. if (this.property) this.property.hide();
  1441. },
  1442. deletePropertiesOrStyles: function(name, key){
  1443. if (name=="properties"){
  1444. try{
  1445. this.node.removeProperty(key);
  1446. }catch(e){}
  1447. }
  1448. },
  1449. setPropertiesOrStyles: function(name){
  1450. if (name=="styles"){
  1451. try{
  1452. this.setCustomStyles();
  1453. }catch(e){}
  1454. }
  1455. if (name=="properties"){
  1456. try{
  1457. this.node.setProperties(this.json.properties);
  1458. }catch(e){}
  1459. }
  1460. },
  1461. setCustomNodeStyles: function(node, styles){
  1462. var border = node.getStyle("border");
  1463. node.clearStyles();
  1464. //node.setStyles(styles);
  1465. node.setStyle("border", border);
  1466. Object.each(styles, function(value, key){
  1467. var reg = /^border\w*/ig;
  1468. if (!key.test(reg)){
  1469. node.setStyle(key, value);
  1470. }
  1471. }.bind(this));
  1472. },
  1473. setCustomStyles: function(){
  1474. var border = this.node.getStyle("border");
  1475. this.node.clearStyles();
  1476. this.node.setStyles(this.css.moduleNode);
  1477. if (this.initialStyles) this.node.setStyles(this.initialStyles);
  1478. this.node.setStyle("border", border);
  1479. if (this.json.styles) Object.each(this.json.styles, function(value, key){
  1480. if ((value.indexOf("x_processplatform_assemble_surface")!=-1 || value.indexOf("x_portal_assemble_surface")!=-1)){
  1481. var host1 = MWF.Actions.getHost("x_processplatform_assemble_surface");
  1482. var host2 = MWF.Actions.getHost("x_portal_assemble_surface");
  1483. if (value.indexOf("/x_processplatform_assemble_surface")!==-1){
  1484. value = value.replace("/x_processplatform_assemble_surface", host1+"/x_processplatform_assemble_surface");
  1485. }else if (value.indexOf("x_processplatform_assemble_surface")!==-1){
  1486. value = value.replace("x_processplatform_assemble_surface", host1+"/x_processplatform_assemble_surface");
  1487. }
  1488. if (value.indexOf("/x_portal_assemble_surface")!==-1){
  1489. value = value.replace("/x_portal_assemble_surface", host2+"/x_portal_assemble_surface");
  1490. }else if (value.indexOf("x_portal_assemble_surface")!==-1){
  1491. value = value.replace("x_portal_assemble_surface", host2+"/x_portal_assemble_surface");
  1492. }
  1493. }
  1494. var reg = /^border\w*/ig;
  1495. if (!key.test(reg)){
  1496. if (key){
  1497. if (key.toString().toLowerCase()==="display"){
  1498. if (value.toString().toLowerCase()==="none"){
  1499. this.node.setStyle("opacity", 0.3);
  1500. }else{
  1501. this.node.setStyle("opacity", 1);
  1502. this.node.setStyle(key, value);
  1503. }
  1504. }else{
  1505. this.node.setStyle(key, value);
  1506. }
  1507. }
  1508. }
  1509. //this.node.setStyle(key, value);
  1510. }.bind(this));
  1511. },
  1512. _setEditStyle: function(name, obj, oldValue){
  1513. var title = "";
  1514. var text = "";
  1515. if (name==="name"){
  1516. title = this.json.name || this.json.id;
  1517. text = this.json.type.substr(this.json.type.lastIndexOf("$")+1, this.json.type.length);
  1518. this.treeNode.setText("<"+text+"> "+title);
  1519. }
  1520. if (name==="id"){
  1521. title = this.json.name || this.json.id;
  1522. if (!this.json.name){
  1523. text = this.json.type.substr(this.json.type.lastIndexOf("$")+1, this.json.type.length);
  1524. this.treeNode.setText("<"+text+"> "+this.json.id);
  1525. }
  1526. this.treeNode.setTitle(this.json.id);
  1527. this.node.set("id", this.json.id);
  1528. }
  1529. this._setEditStyle_custom(name, obj, oldValue);
  1530. },
  1531. reloadMaplist: function(){
  1532. if (this.property) Object.each(this.property.maplists, function(map, name){ map.reload(this.json[name]);}.bind(this));
  1533. },
  1534. getHtml: function(){
  1535. var copy = this.node.clone(true, true);
  1536. copy.clearStyles(true);
  1537. var html = copy.outerHTML;
  1538. copy.destroy();
  1539. return html;
  1540. },
  1541. getJson: function(){
  1542. var json = Object.clone(this.json);
  1543. var o = {};
  1544. o[json.id] = json;
  1545. return o;
  1546. }
  1547. })
  1548. MWF.require("MWF.widget.Toolbar", null, false);
  1549. MWF.xApplication.query.ViewDesigner.View.Actionbar = new Class({
  1550. Extends: MWF.xApplication.query.ViewDesigner.View.$Module,
  1551. options : {
  1552. "style" : "default",
  1553. "customImageStyle" : "default"
  1554. },
  1555. initialize: function(json, jsonList, view, options){
  1556. this.setOptions( options );
  1557. this.propertyPath = "../x_component_query_ViewDesigner/$View/actionbar.html";
  1558. this.path = "../x_component_query_ViewDesigner/$View/";
  1559. this.imagePath_default = "../x_component_query_ViewDesigner/$View/";
  1560. this.imagePath_custom = "../x_component_process_FormDesigner/Module/Actionbar/";
  1561. this.cssPath = "../x_component_query_ViewDesigner/$View/"+this.options.style+"/actionbar.wcss";
  1562. this.view = view;
  1563. this.json = json;
  1564. this.jsonList = jsonList;
  1565. this.css = this.view.css;
  1566. this.container = this.view.actionbarNode;
  1567. this.moduleName = "actionbar";
  1568. this.load();
  1569. },
  1570. load: function(){
  1571. this.systemTools = [];
  1572. this.customTools = [];
  1573. if( !this.json ){
  1574. this.loadDefaultJson(function(){
  1575. this._load()
  1576. }.bind(this));
  1577. }else{
  1578. this._load()
  1579. }
  1580. },
  1581. _load : function(){
  1582. this.json.moduleName = this.moduleName;
  1583. this._createNode();
  1584. //this._createIconAction();
  1585. //if (!this.json.export) this.hideMode();
  1586. this.setEvent();
  1587. },
  1588. loadDefaultJson: function(callback){
  1589. var url = this.path+"actionbar.json";
  1590. MWF.getJSON(url, {
  1591. "onSuccess": function(obj){
  1592. this.view.designer.actions.getUUID(function(id){
  1593. obj.id=id;
  1594. //obj.isNewView = true;
  1595. //obj.application = this.view.designer.application.id;
  1596. this.json = obj;
  1597. this.jsonList.push( this.json );
  1598. if (callback) callback(obj);
  1599. }.bind(this));
  1600. }.bind(this),
  1601. "onerror": function(text){
  1602. this.view.designer.notice(text, "error");
  1603. }.bind(this),
  1604. "onRequestFailure": function(xhr){
  1605. this.view.designer.notice(xhr.responseText, "error");
  1606. }.bind(this)
  1607. });
  1608. },
  1609. setTemplateStyles: function(styles){
  1610. this.json.style = styles.style;
  1611. this.json.iconStyle = styles.iconStyle || "";
  1612. this.json.iconOverStyle = styles.iconOverStyle || "";
  1613. this.json.customIconStyle = styles.customIconStyle;
  1614. this.json.customIconOverStyle = styles.customIconOverStyle || "";
  1615. this.json.forceStyles = styles.forceStyles || "";
  1616. },
  1617. clearTemplateStyles: function(styles){
  1618. this.json.style = "form";
  1619. this.json.iconStyle = "";
  1620. this.json.iconOverStyle = "";
  1621. this.json.customIconStyle = "";
  1622. this.json.customIconOverStyle = "";
  1623. this.json.forceStyles = "";
  1624. },
  1625. setAllStyles: function(){
  1626. this._resetActionbar();
  1627. },
  1628. setEvent: function(){
  1629. this.node.addEvents({
  1630. "click": function(e){this.selected(); e.stopPropagation();}.bind(this),
  1631. "mouseover": function(){if (!this.isSelected) this.node.setStyles(this.css.toolbarWarpNode_over)}.bind(this),
  1632. "mouseout": function(){if (!this.isSelected) this.node.setStyles(this.css.toolbarWarpNode) }.bind(this)
  1633. });
  1634. },
  1635. selected: function(){
  1636. if (this.view.currentSelectedModule){
  1637. if (this.view.currentSelectedModule==this){
  1638. return true;
  1639. }else{
  1640. this.view.currentSelectedModule.unSelected();
  1641. }
  1642. }
  1643. this.node.setStyles(this.css.toolbarWarpNode_selected);
  1644. //this.listNode.setStyles(this.css.cloumnListNode_selected);
  1645. new Fx.Scroll(this.view.areaNode, {"wheelStops": false, "duration": 100}).toElementEdge(this.node);
  1646. //new Fx.Scroll(this.view.designer.propertyDomArea, {"wheelStops": false, "duration": 100}).toElement(this.listNode);
  1647. this.view.currentSelectedModule = this;
  1648. this.isSelected = true;
  1649. //this._showActions();
  1650. this.showProperty();
  1651. },
  1652. unSelected: function(){
  1653. this.view.currentSelectedModule = null;
  1654. this.node.setStyles(this.css.toolbarWarpNode)
  1655. //this.listNode.setStyles(this.css.cloumnListNode);
  1656. this.isSelected = false;
  1657. //this._hideActions();
  1658. this.hideProperty();
  1659. },
  1660. resetTextNode: function(){
  1661. var listText = (this.json.selectType=="attribute") ? (this.json.attribute || "") : (this.json.path || "");
  1662. if (!listText) listText = "unnamed";
  1663. this.textNode.set("text", this.json.displayName);
  1664. this.listNode.getLast().set("text", this.json.displayName+"("+listText+")");
  1665. },
  1666. _createNode: function(callback){
  1667. this.node = new Element("div", {
  1668. "id": this.json.id,
  1669. "MWFType": "actionbar",
  1670. "styles": this.css.toolbarWarpNode,
  1671. "events": {
  1672. "selectstart": function(e){
  1673. e.preventDefault();
  1674. }
  1675. }
  1676. }).inject(this.container );
  1677. this.toolbarNode = new Element("div").inject(this.node);
  1678. this.toolbarWidget = new MWF.widget.Toolbar(this.toolbarNode, {"style": this.json.style}, this);
  1679. if (!this.json.actionStyles){
  1680. this.json.actionStyles = Object.clone(this.toolbarWidget.css);
  1681. }else{
  1682. this.toolbarWidget.css = Object.clone(this.json.actionStyles);
  1683. }
  1684. //MWF.getJSON(this.path+"toolbars.json", function(json){
  1685. // this.json.defaultTools = json;
  1686. // this.setToolbars(json, this.toolbarNode);
  1687. // debugger;
  1688. // this.toolbarWidget.load();
  1689. //}.bind(this), false);
  1690. if (this.json.defaultTools){
  1691. var json = Array.clone(this.json.defaultTools);
  1692. //if (this.json.tools) json.append(this.json.tools);
  1693. this.setToolbars(json, this.toolbarNode);
  1694. if (this.json.tools){
  1695. this.setCustomToolbars(Array.clone(this.json.tools), this.toolbarNode);
  1696. }
  1697. this.toolbarWidget.load();
  1698. this._setEditStyle_custom("hideSystemTools");
  1699. //json = null;
  1700. }else{
  1701. MWF.getJSON(this.path+"toolbars.json", function(json){
  1702. this.json.defaultTools = json;
  1703. var json = Array.clone(this.json.defaultTools);
  1704. //if (this.json.tools) json.append(this.json.tools);
  1705. this.setToolbars(json, this.toolbarNode);
  1706. if (this.json.tools){
  1707. this.setCustomToolbars(Array.clone(this.json.tools), this.toolbarNode);
  1708. }
  1709. this.toolbarWidget.load();
  1710. this._setEditStyle_custom("hideSystemTools");
  1711. //json = null;
  1712. }.bind(this), false);
  1713. }
  1714. },
  1715. _refreshActionbar: function(){
  1716. //if (this.form.options.mode == "Mobile"){
  1717. // this.node.set("text", MWF.APPFD.LP.notice.notUseModuleInMobile+"("+this.moduleName+")");
  1718. // this.node.setStyles({"height": "24px", "line-height": "24px", "background-color": "#999"});
  1719. //}else{
  1720. this.toolbarNode = this.node.getFirst("div");
  1721. this.toolbarNode.empty();
  1722. this.toolbarWidget = new MWF.widget.Toolbar(this.toolbarNode, {"style": this.json.style}, this);
  1723. if (!this.json.actionStyles) this.json.actionStyles = Object.clone(this.toolbarWidget.css);
  1724. this.toolbarWidget.css = this.json.actionStyles;
  1725. if (this.json.defaultTools){
  1726. var json = Array.clone(this.json.defaultTools);
  1727. //if (this.json.tools) json.append(this.json.tools);
  1728. this.setToolbars(json, this.toolbarNode);
  1729. if (this.json.tools){
  1730. this.setCustomToolbars(Array.clone(this.json.tools), this.toolbarNode);
  1731. }
  1732. this.toolbarWidget.load();
  1733. //json = null;
  1734. }else{
  1735. MWF.getJSON(this.path+"toolbars.json", function(json){
  1736. this.json.defaultTools = json;
  1737. var json = Array.clone(this.json.defaultTools);
  1738. //if (this.json.tools) json.append(this.json.tools);
  1739. this.setToolbars(json, this.toolbarNode);
  1740. if (this.json.tools){
  1741. this.setCustomToolbars(Array.clone(this.json.tools), this.toolbarNode);
  1742. }
  1743. this.toolbarWidget.load();
  1744. //json = null;
  1745. }.bind(this), false);
  1746. }
  1747. //}
  1748. },
  1749. _resetActionbar: function(){
  1750. //if (this.form.options.mode == "Mobile"){
  1751. // this.node.set("text", MWF.APPFD.LP.notice.notUseModuleInMobile+"("+this.moduleName+")");
  1752. // this.node.setStyles({"height": "24px", "line-height": "24px", "background-color": "#999"});
  1753. //}else{
  1754. this.toolbarNode = this.node.getFirst("div");
  1755. this.toolbarNode.empty();
  1756. this.toolbarWidget = new MWF.widget.Toolbar(this.toolbarNode, {"style": this.json.style}, this);
  1757. if (!this.json.actionStyles){
  1758. this.json.actionStyles = Object.merge( Object.clone( this.toolbarWidget.css ), this.json.forceStyles || {} );
  1759. }else{
  1760. this.toolbarWidget.css = Object.merge( Object.clone( this.json.actionStyles ), this.toolbarWidget.css, this.json.forceStyles || {} );
  1761. this.json.actionStyles = Object.clone(this.toolbarWidget.css);
  1762. }
  1763. if (this.json.defaultTools){
  1764. var json = Array.clone(this.json.defaultTools);
  1765. //if (this.json.tools) json.append(this.json.tools);
  1766. this.setToolbars(json, this.toolbarNode);
  1767. if (this.json.tools){
  1768. this.setCustomToolbars(Array.clone(this.json.tools), this.toolbarNode);
  1769. }
  1770. this.toolbarWidget.load();
  1771. //json = null;
  1772. }else{
  1773. MWF.getJSON(this.path+"toolbars.json", function(json){
  1774. this.json.defaultTools = json;
  1775. var json = Array.clone(this.json.defaultTools);
  1776. //if (this.json.tools) json.append(this.json.tools);
  1777. this.setToolbars(json, this.toolbarNode);
  1778. if (this.json.tools){
  1779. this.setCustomToolbars(Array.clone(this.json.tools), this.toolbarNode);
  1780. }
  1781. this.toolbarWidget.load();
  1782. //json = null;
  1783. }.bind(this), false);
  1784. }
  1785. //}
  1786. },
  1787. setToolbars: function(tools, node){
  1788. tools.each(function(tool){
  1789. var actionNode = new Element("div", {
  1790. "MWFnodetype": tool.type,
  1791. "MWFButtonImage": this.imagePath_default+""+this.options.style+"/actionbar/"+( this.json.iconStyle || "default" )+"/"+tool.img,
  1792. "title": tool.title,
  1793. "MWFButtonAction": tool.action,
  1794. "MWFButtonText": tool.text
  1795. }).inject(node);
  1796. if( this.json.iconOverStyle ){
  1797. actionNode.set("MWFButtonImageOver" , this.imagePath_default+""+this.options.style+"/actionbar/"+this.json.iconOverStyle+"/"+tool.img );
  1798. }
  1799. this.systemTools.push(actionNode);
  1800. if (tool.sub){
  1801. var subNode = node.getLast();
  1802. this.setToolbars(tool.sub, subNode);
  1803. }
  1804. }.bind(this));
  1805. },
  1806. setCustomToolbars: function(tools, node){
  1807. //var style = (this.json.style || "default").indexOf("red") > -1 ? "red" : "blue";
  1808. var path = "";
  1809. if( this.json.customIconStyle ){
  1810. path = this.json.customIconStyle+ "/";
  1811. }
  1812. tools.each(function(tool){
  1813. var actionNode = new Element("div", {
  1814. "MWFnodetype": tool.type,
  1815. "MWFButtonImage": this.imagePath_custom+""+this.options.customImageStyle +"/custom/"+path+tool.img,
  1816. "title": tool.title,
  1817. "MWFButtonAction": tool.action,
  1818. "MWFButtonText": tool.text
  1819. }).inject(node);
  1820. if( this.json.customIconOverStyle ){
  1821. actionNode.set("MWFButtonImageOver" , this.imagePath_custom+""+this.options.customImageStyle +"/custom/"+this.json.customIconOverStyle+ "/" +tool.img );
  1822. }
  1823. this.customTools.push(actionNode);
  1824. if (tool.sub){
  1825. var subNode = node.getLast();
  1826. this.setToolbars(tool.sub, subNode);
  1827. }
  1828. }.bind(this));
  1829. },
  1830. _setEditStyle_custom: function(name){
  1831. if (name=="hideSystemTools"){
  1832. if (this.json.hideSystemTools){
  1833. this.systemTools.each(function(tool){
  1834. tool.setStyle("display", "none");
  1835. });
  1836. }else{
  1837. this.systemTools.each(function(tool){
  1838. tool.setStyle("display", "block");
  1839. });
  1840. }
  1841. }
  1842. if (name=="defaultTools" || name=="tools" || name==="actionStyles"){
  1843. this._refreshActionbar();
  1844. }
  1845. }
  1846. });
  1847. MWF.require("MWF.widget.Paging", null, false);
  1848. MWF.xApplication.query.ViewDesigner.View.Paging = new Class({
  1849. Extends: MWF.xApplication.query.ViewDesigner.View.$Module,
  1850. options : {
  1851. "style" : "default"
  1852. },
  1853. initialize: function(json, jsonList, view, options){
  1854. this.setOptions( options );
  1855. this.propertyPath = "../x_component_query_ViewDesigner/$View/paging.html";
  1856. this.view = view;
  1857. this.json = json;
  1858. this.jsonList = jsonList;
  1859. this.css = this.view.css;
  1860. this.container = this.view.pagingNode;
  1861. this.moduleName = "paging";
  1862. this.load();
  1863. },
  1864. load: function(){
  1865. this.systemTools = [];
  1866. this.customTools = [];
  1867. if( !this.json ){
  1868. this.loadDefaultJson(function(){
  1869. this._load();
  1870. }.bind(this));
  1871. }else{
  1872. this._load();
  1873. }
  1874. },
  1875. _load : function(){
  1876. this.json.moduleName = this.moduleName;
  1877. this._createNode();
  1878. this.setEvent();
  1879. },
  1880. loadDefaultJson: function(callback){
  1881. var url = this.view.path+"paging.json";
  1882. MWF.getJSON(url, {
  1883. "onSuccess": function(obj){
  1884. this.view.designer.actions.getUUID(function(id){
  1885. obj.id=id;
  1886. this.json = obj;
  1887. this.jsonList.push( this.json );
  1888. if (callback) callback(obj);
  1889. }.bind(this));
  1890. }.bind(this),
  1891. "onerror": function(text){
  1892. this.view.designer.notice(text, "error");
  1893. }.bind(this),
  1894. "onRequestFailure": function(xhr){
  1895. this.view.designer.notice(xhr.responseText, "error");
  1896. }.bind(this)
  1897. });
  1898. },
  1899. setTemplateStyles: function(styles){
  1900. if( this.json.buttonStyle === "rect" ){
  1901. this.json.style = styles.style_rect;
  1902. }else if( this.json.buttonStyle === "round" ){
  1903. this.json.style = styles.style_round;
  1904. }else{
  1905. this.json.style = styles.style;
  1906. }
  1907. this.json.forceStyles = styles.forceStyles || "";
  1908. },
  1909. clearTemplateStyles: function(styles){
  1910. this.json.style = "blue_round";
  1911. this.json.forceStyles = "";
  1912. },
  1913. setAllStyles: function(){
  1914. this._resetPaging();
  1915. },
  1916. setEvent: function(){
  1917. this.node.addEvents({
  1918. "click": function(e){this.selected(); e.stopPropagation();}.bind(this),
  1919. "mouseover": function(){if (!this.isSelected) this.node.setStyles(this.css.pagingWarpNode_over)}.bind(this),
  1920. "mouseout": function(){if (!this.isSelected) this.node.setStyles(this.css.pagingWarpNode) }.bind(this)
  1921. });
  1922. },
  1923. selected: function(){
  1924. if (this.view.currentSelectedModule){
  1925. if (this.view.currentSelectedModule==this){
  1926. return true;
  1927. }else{
  1928. this.view.currentSelectedModule.unSelected();
  1929. }
  1930. }
  1931. this.node.setStyles(this.css.pagingWarpNode_selected);
  1932. new Fx.Scroll(this.view.areaNode, {"wheelStops": false, "duration": 100}).toElementEdge(this.node);
  1933. this.view.currentSelectedModule = this;
  1934. this.isSelected = true;
  1935. this.showProperty();
  1936. },
  1937. unSelected: function(){
  1938. this.view.currentSelectedModule = null;
  1939. this.node.setStyles(this.css.pagingWarpNode);
  1940. this.isSelected = false;
  1941. this.hideProperty();
  1942. },
  1943. resetTextNode: function(){
  1944. var listText = (this.json.selectType=="attribute") ? (this.json.attribute || "") : (this.json.path || "");
  1945. if (!listText) listText = "unnamed";
  1946. this.textNode.set("text", this.json.displayName);
  1947. this.listNode.getLast().set("text", this.json.displayName+"("+listText+")");
  1948. },
  1949. _createNode: function(callback){
  1950. this.node = new Element("div", {
  1951. "id": this.json.id,
  1952. "MWFType": "paging",
  1953. "styles": this.css.pagingWarpNode,
  1954. "events": {
  1955. "selectstart": function(e){
  1956. e.preventDefault();
  1957. }
  1958. }
  1959. }).inject(this.container );
  1960. this.pagingNode = new Element("div").inject(this.node);
  1961. this.loadWidget();
  1962. // this.pagingWidget = new MWF.widget.Paging(this.pagingNode, {"style": this.json.style}, this);
  1963. // if (!this.json.pagingStyles){
  1964. // this.json.pagingStyles = Object.clone(this.pagingWidget.css);
  1965. // }
  1966. // this.pagingWidget.load();
  1967. },
  1968. loadWidget : function( isReset ){
  1969. var visiblePages = this.json.visiblePages ? this.json.visiblePages.toInt() : 9;
  1970. this.pagingWidget = new o2.widget.Paging(this.pagingNode, {
  1971. style : this.json.style || "default",
  1972. countPerPage: 20, //this.json.pageSize || this.options.perPageCount,
  1973. visiblePages: visiblePages,
  1974. currentPage: 1,
  1975. itemSize: visiblePages * 20 * 3,
  1976. // pageSize: this.pages,
  1977. hasNextPage: typeOf( this.json.hasPreNextPage ) === "boolean" ? this.json.hasPreNextPage : true,
  1978. hasPrevPage: typeOf( this.json.hasPreNextPage ) === "boolean" ? this.json.hasPreNextPage : true,
  1979. hasTruningBar: typeOf( this.json.hasTruningBar ) === "boolean" ? this.json.hasTruningBar : true,
  1980. hasBatchTuring: typeOf( this.json.hasBatchTuring ) === "boolean" ? this.json.hasBatchTuring : true,
  1981. hasFirstPage: typeOf( this.json.hasFirstLastPage ) === "boolean" ? this.json.hasFirstLastPage : true,
  1982. hasLastPage: typeOf( this.json.hasFirstLastPage ) === "boolean" ? this.json.hasFirstLastPage : true,
  1983. hasJumper: typeOf( this.json.hasPageJumper ) === "boolean" ? this.json.hasPageJumper : true,
  1984. hiddenWithDisable: false,
  1985. // hiddenWithNoItem: true,
  1986. text: {
  1987. prePage: this.json.prePageText,
  1988. nextPage: this.json.nextPageText,
  1989. firstPage: this.json.firstPageText,
  1990. lastPage: this.json.lastPageText
  1991. },
  1992. onJumpingPage : function( pageNum, itemNum ){
  1993. }.bind(this),
  1994. onPostLoad : function () {
  1995. this.view.setContentHeight()
  1996. // if(this.setContentHeightFun)this.setContentHeightFun();
  1997. }.bind(this)
  1998. }, isReset ? {} : (this.json.pagingStyles || {}));
  1999. if( isReset ){
  2000. if (!this.json.pagingStyles){
  2001. this.json.pagingStyles = Object.merge( Object.clone( this.pagingWidget.css ), this.json.forceStyles || {} );
  2002. }else{
  2003. this.pagingWidget.css = Object.merge( Object.clone( this.json.pagingStyles ), this.pagingWidget.css, this.json.forceStyles || {} );
  2004. this.json.pagingStyles = Object.clone(this.pagingWidget.css);
  2005. }
  2006. }else{
  2007. if (!this.json.pagingStyles){
  2008. this.json.pagingStyles = Object.clone(this.pagingWidget.css);
  2009. }
  2010. }
  2011. this.pagingWidget.load();
  2012. },
  2013. _resetPaging : function(){
  2014. this.pagingNode.empty();
  2015. this.loadWidget( true );
  2016. },
  2017. _refreshPaging: function(){
  2018. this.pagingNode.empty();
  2019. this.loadWidget();
  2020. },
  2021. _setEditStyle_custom: function(name, obj, oldValue){
  2022. if ( ["hasTruningBar","visiblePages","hasBatchTuring",
  2023. "hasFirstLastPage","hasPreNextPage","hasPageJumper",
  2024. "firstPageText","lastPageText","prePageText","nextPageText",
  2025. "pagingStyles"].contains(name)){
  2026. this._refreshPaging();
  2027. }else if( name === "buttonStyle" ){
  2028. if( this.json.buttonStyle === "rect" ){
  2029. this.json.style = this.view.templateStyles.paging.style_rect;
  2030. }else{
  2031. this.json.style = this.view.templateStyles.paging.style_round;
  2032. }
  2033. this._resetPaging();
  2034. }
  2035. }
  2036. });