FileExplorer.js 24 KB

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