FileExplorer.js 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563
  1. MWF.xDesktop.requireApp("process.ProcessManager", "DictionaryExplorer", null, false);
  2. MWF.xApplication.process.ProcessManager.FileExplorer = new Class({
  3. Extends: MWF.xApplication.process.ProcessManager.DictionaryExplorer,
  4. Implements: [Options, Events],
  5. options: {
  6. "create": MWF.APPPM.LP.file.create,
  7. "search": MWF.APPPM.LP.file.search,
  8. "searchText": MWF.APPPM.LP.file.searchText,
  9. "noElement": MWF.APPPM.LP.file.noDictionaryNoticeText
  10. },
  11. // createSearchElementNode: function(){
  12. // this.titleActionNodeNode = new Element("div", {
  13. // "styles": this.css.titleActionNode,
  14. // "text": MWF.APPPM.LP.file.loadFiles
  15. // }).inject(this.toolbarNode);
  16. // this.titleActionNodeNode.addEvent("click", function(){
  17. // this.implodeFiles();
  18. // }.bind(this));
  19. // },
  20. getNewData: function(){
  21. return {
  22. "id": "",
  23. "name": "",
  24. "alias": "",
  25. "description": "",
  26. "application": (this.app.options.application || this.app.application).id,
  27. "fileName": ""
  28. }
  29. },
  30. getSizeText: function(s){
  31. var o = [
  32. {"t": "K", "i": 1024},
  33. {"t": "M", "i": 1024*1024},
  34. {"t": "G", "i": 1024*1024*1024}
  35. ];
  36. var i = 0;
  37. var n = s/o[i].i;
  38. while (n>1000 && i<2){
  39. i++;
  40. n = s/o[i].i;
  41. }
  42. n = Math.round(n*100)/100;
  43. return ""+n+" "+o[i].t;
  44. },
  45. implodeFiles: function(){
  46. if (this.upload){
  47. this.upload.upload();
  48. }else{
  49. MWF.require("MWF.widget.Upload", function(){
  50. var datas = [];
  51. this.upload = new MWF.widget.Upload(this.app.content, {
  52. "action": MWF.Actions.get("x_processplatform_assemble_designer").action,
  53. "multiple": true,
  54. "method": "uploadFile",
  55. "parameter": {"id": ""},
  56. "onBeforeUploadEntry": function(file, up){
  57. var data = this.getNewData();
  58. data.name = file.name;
  59. data.fileName = file.name;
  60. data.description = file.name+" "+this.getSizeText(file.size);
  61. data.updateTime = (new Date()).format("db");
  62. MWF.Actions.get("x_processplatform_assemble_designer").saveFile(data, function(json){
  63. up.options.parameter = {"id": json.data.id};
  64. var node = this.elementContentListNode.getFirst();
  65. if (node) if (node.hasClass("noElementNode")){
  66. node.destroy();
  67. }
  68. datas.push(data);
  69. }.bind(this), null, false);
  70. }.bind(this),
  71. "onEvery": function(json, current, count, file){
  72. var data = datas[current-1];
  73. var itemObj = this._getItemObject(data);
  74. itemObj.load();
  75. }.bind(this)
  76. }).load();
  77. }.bind(this));
  78. }
  79. },
  80. loadContentNode: function(){
  81. this.cssPath = this.path+this.options.style+"/file.css";
  82. this.elementContentNode = new Element("div", {
  83. "styles": this.css.elementContentNode
  84. }).inject(this.node);
  85. this.elementContentNode.addEvent("click", function(){
  86. while (this.selectMarkItems.length){
  87. this.selectMarkItems[0].unSelected();
  88. }
  89. }.bind(this));
  90. this.elementContentListNode = new Element("div", {
  91. "styles": this.css.elementContentListNode
  92. }).inject(this.elementContentNode);
  93. this.elementContentListNode.loadCss(this.cssPath);
  94. this.setContentSize();
  95. this.app.addEvent("resize", function(){this.setContentSize();}.bind(this));
  96. },
  97. _createElement: function(e){
  98. this.implodeFiles();
  99. },
  100. _loadItemDataList: function(callback){
  101. var id = "";
  102. if (this.app.application) id = this.app.application.id;
  103. if (this.app.options.application) id = this.app.options.application.id;
  104. this.actions.listFile(id,callback);
  105. },
  106. _getItemObject: function(item){
  107. return new MWF.xApplication.process.ProcessManager.FileExplorer.File(this, item)
  108. },
  109. setTooltip: function(){
  110. this.options.tooltip = {
  111. "create": MWF.APPPM.LP.file.create,
  112. "search": MWF.APPPM.LP.file.search,
  113. "searchText": MWF.APPPM.LP.file.searchText,
  114. "noElement": MWF.APPPM.LP.file.noScriptNoticeText
  115. };
  116. },
  117. deleteItems: function(){
  118. this.hideDeleteAction();
  119. while (this.deleteMarkItems.length){
  120. var item = this.deleteMarkItems.shift();
  121. if (this.deleteMarkItems.length){
  122. item.deleteFile();
  123. }else{
  124. item.deleteFile(function(){
  125. }.bind(this));
  126. }
  127. }
  128. },
  129. destroy: function(){
  130. this.node.destroy();
  131. o2.removeCss(this.cssPath);
  132. o2.release(this);
  133. },
  134. getIconJson: function(callback){
  135. if (!this.icons){
  136. MWF.getJSON("../x_component_File/$Main/icon.json", function(json){
  137. this.icons = json;
  138. if (callback) callback();
  139. }.bind(this), false, false);
  140. }else{
  141. if (callback) callback();
  142. }
  143. },
  144. getIcon: function(fileName){
  145. this.getIconJson();
  146. var ext = fileName.substring(fileName.lastIndexOf(".")+1, fileName.length);
  147. if (!ext) ext="unkonw";
  148. var iconName = this.icons[ext.toLowerCase()] || this.icons.unknow;
  149. return "../x_component_File/$Main/default/file/"+iconName;
  150. }
  151. });
  152. MWF.xApplication.process.ProcessManager.FileExplorer.File = new Class({
  153. Extends: MWF.xApplication.process.ProcessManager.DictionaryExplorer.Dictionary,
  154. load: function(){
  155. var view = this.explorer.path+this.explorer.options.style+"/file.html";
  156. this.node = new Element("div.o2_fileItemNode", {
  157. "events": {
  158. "mouseover": function(){
  159. if (this.deleteActionNode) this.deleteActionNode.fade("in");
  160. if (this.saveasActionNode) this.saveasActionNode.fade("in");
  161. }.bind(this),
  162. "mouseout": function(){
  163. if (this.deleteActionNode) this.deleteActionNode.fade("out");
  164. if (this.saveasActionNode) this.saveasActionNode.fade("out");
  165. }.bind(this)
  166. }
  167. }).inject(this.container);
  168. if (this.data.name.icon) this.icon = this.data.name.icon;
  169. var ext = this.data.fileName.substring(this.data.fileName.lastIndexOf(".")+1, this.data.fileName.length);
  170. this.data.fileUrl = this._getUrl();
  171. if (["png","jpg","bmp","gif","jpeg","jpe"].indexOf(ext)!==-1){
  172. //new Image()
  173. this.data.iconUrl = this.data.fileUrl;
  174. }else{
  175. this.data.iconUrl = this.explorer.getIcon(this.data.fileName);
  176. }
  177. //this.data.iconUrl = this.explorer.path+""+this.explorer.options.style+"/processIcon/"+this.icon;
  178. this.node.loadHtml(view, {"bind": this.data}, function(){
  179. debugger;
  180. var itemIconNode = this.node.getElement(".o2_fileItemIconNode");
  181. var itemImgNode = this.node.getElement(".o2_fileItemImgNode");
  182. var itemUrlNode = this.node.getElement(".o2_fileItemUrlNode");
  183. itemUrlNode.setStyle("-webkit-user-select", "text");
  184. var s = itemIconNode.getSize();
  185. // if (!s.x) s.x = itemIconNode.getStyle("width").toFloat();
  186. // if (!s.y) s.y = itemIconNode.getStyle("height").toFloat();
  187. itemImgNode.setStyles({
  188. "max-width": ""+s.x+"px",
  189. "max-height": ""+s.y+"px"
  190. });
  191. itemImgNode.set("src", this.data.iconUrl);
  192. this.deleteActionNode = this.node.getElement(".o2_fileDeleteActionNode");
  193. var itemTextTitleNode = this.node.getElement(".o2_fileItemTextTitleNode");
  194. itemIconNode.addEvent("click", function(e){
  195. this.toggleSelected();
  196. e.stopPropagation();
  197. }.bind(this));
  198. itemIconNode.makeLnk({
  199. "par": this._getLnkPar()
  200. });
  201. if (!this.explorer.options.noDelete) this._createActions();
  202. itemTextTitleNode.addEvent("click", function(e){
  203. this._open(e);
  204. e.stopPropagation();
  205. }.bind(this));
  206. this._customNodes();
  207. this._isNew();
  208. }.bind(this));
  209. },
  210. _createActions: function(){
  211. if (this.deleteActionNode) this.deleteActionNode.addEvent("click", function(e){
  212. this.deleteItem(e);
  213. }.bind(this));
  214. },
  215. _customNodes: function(){},
  216. _open: function(e){
  217. var _self = this;
  218. MWF.Actions.get("x_processplatform_assemble_designer").getFile(this.data.id, function(json){
  219. this.data = json.data;
  220. new MWF.xApplication.process.ProcessManager.FileDesigner(this.explorer, this.data);
  221. }.bind(this));
  222. },
  223. _getIcon: function(){
  224. return "file.png";
  225. },
  226. _getUrl: function(){
  227. var url = MWF.Actions.get("x_processplatform_assemble_surface").action.actions.readFile.uri;
  228. url = url.replace(/{flag}/, this.data.id);
  229. url = url.replace(/{applicationFlag}/, this.data.application);
  230. url = "/x_processplatform_assemble_surface"+url;
  231. return o2.filterUrl(MWF.Actions.getHost("x_processplatform_assemble_surface")+url);
  232. },
  233. _getLnkPar: function(){
  234. return {
  235. "icon": this.data.iconUrl,
  236. "title": this.data.name,
  237. "par": "@url#"+this._getUrl()
  238. };
  239. },
  240. deleteFile: function(callback){
  241. this.explorer.app.restActions.deleteFile(this.data.id, function(){
  242. this.node.destroy();
  243. if (callback) callback();
  244. }.bind(this));
  245. },
  246. _isNew: function(){
  247. if (this.data.updateTime){
  248. var createDate = Date.parse(this.data.updateTime);
  249. var currentDate = new Date();
  250. if (createDate.diff(currentDate, "hour")<12) {
  251. this.newNode = new Element("div", {
  252. "styles": this.css.itemFileNewNode
  253. }).inject(this.node);
  254. this.newNode.addEvent("click", function(e){
  255. this.toggleSelected();
  256. e.stopPropagation();
  257. }.bind(this));
  258. }
  259. }
  260. },
  261. selected: function(){
  262. if (this.deleteMode) this.deleteItem();
  263. this.isSelected = true;
  264. this.node.setStyles(this.css.itemNode_selected);
  265. this.explorer.selectMarkItems.push(this);
  266. }
  267. });
  268. MWF.xApplication.process.ProcessManager.FileDesigner = new Class({
  269. initialize: function(explorer, item){
  270. this.explorer = explorer;
  271. this.app = this.explorer.app;
  272. this.data = item;
  273. this.container = this.explorer.container;
  274. this.css = this.explorer.css;
  275. this.lp = MWF.APPPM.LP;
  276. this.load();
  277. },
  278. getNewData: function(){
  279. return {
  280. "id": "",
  281. "name": "",
  282. "alias": "",
  283. "description": "",
  284. "application": (this.explorer.app.options.application || this.explorer.app.application).id,
  285. "fileName": ""
  286. }
  287. },
  288. resize: function(){
  289. var size = this.app.content.getSize();
  290. var nodeSize = this.fileAreaNode.getSize();
  291. var x = (size.x-nodeSize.x)/2;
  292. var y = (size.y-nodeSize.y)/2;
  293. if (y<0) y=0;
  294. if (x<0) x=0;
  295. this.fileAreaNode.setStyles({
  296. "top": ""+y+"px",
  297. "left": ""+x+"px"
  298. });
  299. var titleSize = this.titleNode.getSize();
  300. var buttonSize = this.buttonNode.getSize();
  301. var h = nodeSize.y-titleSize.y-buttonSize.y;
  302. this.contentNode.setStyle("height", ""+h+"px");
  303. },
  304. load: function(){
  305. if (!this.data) this.data = this.getNewData();
  306. this.fileMaskNode = new Element("div", {"styles": this.css.createTemplateMaskNode}).inject(this.app.content);
  307. this.fileAreaNode = new Element("div", {"styles": this.css.createFormTemplateAreaNode}).inject(this.app.content);
  308. this.fileAreaNode.fade("in");
  309. this.titleNode = new Element("div", {"styles": this.css.fileDesignerTitleNode}).inject(this.fileAreaNode);
  310. this.titleIconNode = new Element("div", {"styles": this.css.fileDesignerTitleIconNode}).inject(this.titleNode);
  311. if (!this.data.id) this.titleIconNode.setStyle("background-image", "url("+this.explorer.path+this.app.options.style+"/icon/new.png)");
  312. this.titleTextNode = new Element("div", {"styles": this.css.fileDesignerTitleTextNode}).inject(this.titleNode);
  313. var title = (this.data.name) ? this.data.name : this.explorer.options.tooltip.create;
  314. this.titleTextNode.set("text", title);
  315. this.contentNode = new Element("div", {"styles": this.css.fileDesignerContentNode}).inject(this.fileAreaNode);
  316. this.createContent();
  317. this.buttonNode = new Element("div", {"styles": this.css.fileDesignerButtonNode}).inject(this.fileAreaNode);
  318. this.createButton();
  319. this.resizeFun = this.resize.bind(this);
  320. this.resizeFun();
  321. this.app.addEvent("resize", this.resizeFun);
  322. this.setEvent();
  323. },
  324. createContent: function(){
  325. this.contentAreaNode = new Element("div", {"styles": this.css.fileDesignerContentAreaNode}).inject(this.contentNode);
  326. this.nameInput = this.createContentLine(this.lp.name, this.data.name);
  327. this.aliasInput = this.createContentLine(this.lp.alias, this.data.alias);
  328. this.descriptionInput = this.createContentLine(this.lp.file.description, this.data.description, true);
  329. this.createContentFile();
  330. this.createContentFileUrl();
  331. },
  332. createContentFileUrl: function(){
  333. if (this.data.fileName){
  334. var div = new Element("div", {"styles": this.css.fileDesignerContentLineNode}).inject(this.contentAreaNode);
  335. var lineTitleNode = new Element("div", {"styles": this.css.fileDesignerContentLineTitleNode, "text": "URL"}).inject(div);
  336. this.fileUrlNode = new Element("div", {"styles": this.css.fileDesignerContentLineContentNode}).inject(div);
  337. div.setStyle("height", "80px");
  338. var url = MWF.Actions.get("x_processplatform_assemble_surface").action.actions.readFile.uri;
  339. url = url.replace(/{flag}/, this.data.id);
  340. url = url.replace(/{applicationFlag}/, this.data.application);
  341. url = "/x_processplatform_assemble_surface"+url;
  342. this.fileUrlNode.setStyle("line-height", "18px");
  343. var href = MWF.Actions.getHost("x_processplatform_assemble_surface")+url;
  344. //this.fileUrlNode.set("html", "<a target='_blank' href='"+href+"'>"+url+"</a>");
  345. this.fileUrlNode.set("text", url);
  346. var a = new Element("div", {
  347. "styles": {"height": "30px"},
  348. "html": "<a target='_blank' href='"+o2.filterUrl(href)+"'>open</a>"
  349. }).inject(this.fileUrlNode, "bottom");
  350. }
  351. },
  352. modifyContentFileUrl: function(){
  353. if (!this.fileUrlNode){
  354. this.createContentFileUrl();
  355. }else{
  356. var url = MWF.Actions.get("x_processplatform_assemble_surface").action.actions.readFile.uri;
  357. url = url.replace(/{flag}/, this.data.id);
  358. url = url.replace(/{applicationFlag}/, this.data.application);
  359. //this.fileUrlNode.set("text", "/x_processplatform_assemble_surface"+url);
  360. url = "/x_processplatform_assemble_surface"+url;
  361. this.fileUrlNode.setStyle("line-height", "18px");
  362. var href = MWF.Actions.getHost("x_processplatform_assemble_surface")+url;
  363. //this.fileUrlNode.set("html", "<a target='_blank' href='"+href+"'>"+url+"</a>");
  364. this.fileUrlNode.set("text", url);
  365. var a = new Element("div", {
  366. "styles": {"height": "30px"},
  367. "html": "<a target='_blank' href='"+o2.filterUrl(href)+"'>open</a>"
  368. }).inject(this.fileUrlNode, "bottom");
  369. }
  370. },
  371. createContentFile: function(){
  372. var div = new Element("div", {"styles": this.css.fileDesignerContentFileLineNode}).inject(this.contentAreaNode);
  373. var lineTitleNode = new Element("div", {"styles": this.css.fileDesignerContentFileLineTitleNode, "text": this.lp.attachment}).inject(div);
  374. var lineRightNode = new Element("div", {"styles": this.css.fileDesignerContentFileLineRightNode}).inject(div);
  375. this.fileContentNode = new Element("div", {"styles": this.css.fileDesignerContentFileLineContentNode}).inject(div);
  376. this.uploadFileButton = new Element("div", {"styles": this.css.fileDesignerUploadButtonNode, "text": this.lp.upload}).inject(lineRightNode);
  377. if (this.data.fileName){
  378. this.loadFileIcon();
  379. }
  380. },
  381. // getIconJson: function(callback){
  382. // if (!this.icons){
  383. // MWF.getJSON("../x_component_File/$Main/icon.json", function(json){
  384. // this.icons = json;
  385. // if (callback) callback();
  386. // }.bind(this), false, false);
  387. // }else{
  388. // if (callback) callback();
  389. // }
  390. // },
  391. // getIcon: function(ext){
  392. // if (!ext) ext="unkonw";
  393. // var iconName = this.icons[ext.toLowerCase()] || this.icons.unknow;
  394. // return "../x_component_File/$Main/default/file/"+iconName;
  395. // },
  396. loadFileIcon: function(){
  397. debugger;
  398. this.fileContentNode.empty();
  399. //var ext = this.data.fileName.substr(this.data.fileName.lastIndexOf(".")+1, this.data.fileName.length);
  400. //this.explorer.getIconJson(function(){
  401. var url = this.explorer.getIcon(this.data.fileName);
  402. var fileIconNode = new Element("div", {"styles": this.css.fileDesignerContentFileLineFileIconNode}).inject(this.fileContentNode);
  403. fileIconNode.setStyle("background-image", "url('"+url+"')");
  404. var fileTextNode = new Element("div", {"styles": this.css.fileDesignerContentFileLineFileNameNode, "text": this.data.fileName}).inject(this.fileContentNode);
  405. var fileSizeNode = new Element("div", {"styles": this.css.fileDesignerContentFileLineFileSizeNode, "text": this.data.description}).inject(this.fileContentNode);
  406. //}.bind(this));
  407. },
  408. createContentLine: function(text, value, readonly){
  409. var div = new Element("div", {"styles": this.css.fileDesignerContentLineNode}).inject(this.contentAreaNode);
  410. var lineTitleNode = new Element("div", {"styles": this.css.fileDesignerContentLineTitleNode, "text": text}).inject(div);
  411. var lineContentNode = new Element("div", {"styles": this.css.fileDesignerContentLineContentNode}).inject(div);
  412. return new Element("input", {"styles": this.css.fileDesignerContentLineInputNode, "value": value, "readonly": readonly}).inject(lineContentNode);
  413. },
  414. createButton: function(){
  415. this.cancelButton = new Element("div", {"styles": this.css.fileDesignerCancelButtonNode, "text": this.lp.cancel}).inject(this.buttonNode);
  416. this.okButton = new Element("div", {"styles": this.css.fileDesignerOkButtonNode, "text": this.lp.ok}).inject(this.buttonNode);
  417. },
  418. setEvent: function(){
  419. this.cancelButton.addEvent("click", function(e){ this.close(e); }.bind(this));
  420. this.okButton.addEvent("click", function(){ this.save(); }.bind(this));
  421. this.uploadFileButton.addEvent("click", function(){ this.upload(); }.bind(this));
  422. },
  423. upload: function(){
  424. if (!this.data.id){
  425. //MWF.Actions.get("x_processplatform_assemble_designer").saveFile(this.data, function(){
  426. // this.explorer.reload();
  427. this.uploadFile(function(){
  428. this.app.notice(this.lp.file.uploadSuccess, "success");
  429. }.bind(this));
  430. //}.bind(this));
  431. }else{
  432. this.uploadFile(function(){
  433. this.app.notice(this.lp.file.uploadSuccess, "success");
  434. }.bind(this));
  435. }
  436. },
  437. uploadFile: function(callback){
  438. MWF.require("MWF.widget.Upload", function(){
  439. new MWF.widget.Upload(this.app.content, {
  440. "action": MWF.Actions.get("x_processplatform_assemble_designer").action,
  441. "multiple": false,
  442. "method": "uploadFile",
  443. "parameter": {"id": this.data.id},
  444. "onCompleted": function(){
  445. this.loadFileIcon();
  446. this.modifyContentFileUrl();
  447. this.explorer.reload();
  448. if (callback) callback();
  449. }.bind(this),
  450. "onBeforeUpload": function(files, up){
  451. var name = files[0].name;
  452. this.nameInput.set("value", name);
  453. var data = this.getData();
  454. this.data = Object.merge(this.data, data);
  455. MWF.Actions.get("x_processplatform_assemble_designer").saveFile(this.data, function(json){
  456. this.explorer.reload();
  457. up.options.parameter = {"id": json.data.id};
  458. }.bind(this), null, false);
  459. }.bind(this),
  460. "onEvery": function(json, current, count, file){
  461. //this.data.description = file.name+" "+this.getSizeText(file.size);
  462. //this.data.id = json.data.id;
  463. this.data.fileName = file.name;
  464. this.data.description = file.name+" "+this.getSizeText(file.size);
  465. this.descriptionInput.set("value", this.data.description);
  466. MWF.Actions.get("x_processplatform_assemble_designer").saveFile(this.data);
  467. }.bind(this)
  468. }).load();
  469. }.bind(this));
  470. },
  471. getSizeText: function(s){
  472. var o = [
  473. {"t": "K", "i": 1024},
  474. {"t": "M", "i": 1024*1024},
  475. {"t": "G", "i": 1024*1024*1024}
  476. ];
  477. var i = 0;
  478. var n = s/o[i].i;
  479. while (n>1000 && i<2){
  480. i++;
  481. n = s/o[i].i;
  482. }
  483. n = Math.round(n*100)/100;
  484. return ""+n+" "+o[i].t;
  485. },
  486. getData: function(){
  487. return {
  488. "name": this.nameInput.get("value"),
  489. "alias": this.aliasInput.get("value"),
  490. "description": this.descriptionInput.get("value")
  491. }
  492. },
  493. close: function(e){
  494. var data = this.getData();
  495. var _self = this;
  496. if (data.name!==this.data.name || data.alias!==this.data.alias || data.description!== this.data.description){
  497. this.app.confirm("infor", e, this.lp.file.saveConfirm, this.lp.file.saveConfirmText, 350, 120, function(){
  498. this.close();
  499. _self.save();
  500. }, function(){
  501. this.close();
  502. _self.destroy();
  503. })
  504. }else{
  505. this.destroy();
  506. }
  507. },
  508. save: function(){
  509. var data = this.getData();
  510. this.data = Object.merge(this.data, data);
  511. MWF.Actions.get("x_processplatform_assemble_designer").saveFile(this.data, function(){
  512. this.explorer.reload();
  513. this.app.notice(this.lp.file.saveSuccess, "success");
  514. this.destroy();
  515. }.bind(this));
  516. },
  517. destroy: function(){
  518. this.fileMaskNode.destroy();
  519. this.fileAreaNode.destroy();
  520. if (this.resizeFun) this.app.removeEvent("resize", this.resizeFun);
  521. MWF.release(this);
  522. }
  523. });