RoleExplorer.js 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560
  1. MWF.xDesktop.requireApp("Org", "$Explorer", null, false);
  2. MWF.xApplication.Org.RoleExplorer = new Class({
  3. Extends: MWF.xApplication.Org.$Explorer,
  4. Implements: [Options, Events],
  5. options: {
  6. "style": "default",
  7. "lp": {
  8. },
  9. "creator": false
  10. },
  11. _loadLp: function(){
  12. this.options.lp = {
  13. "elementLoaded": this.app.lp.roleLoaded,
  14. "search": this.app.lp.search,
  15. "searchText": this.app.lp.searchText,
  16. "elementSave": this.app.lp.roleSave,
  17. "deleteElements": this.app.lp.deleteRoles,
  18. "deleteElementsCancel": this.app.lp.deleteElementsCancel,
  19. "deleteElementsTitle": this.app.lp.deleteRolesTitle,
  20. "deleteElementsConfirm": this.app.lp.deletePersonsConfirm,
  21. "elementBaseText": this.app.lp.roleBaseText,
  22. "elementName": this.app.lp.roleName,
  23. "noSignature": this.app.lp.noSignature,
  24. "edit": this.app.lp.edit,
  25. "cancel": this.app.lp.cancel,
  26. "save": this.app.lp.save,
  27. "add": this.app.lp.add
  28. }
  29. },
  30. _listElementNext: function(lastid, count, callback){
  31. this.actions.listRoleNext(lastid || "(0)", count, function(json){
  32. if (callback) callback.apply(this, [json]);
  33. }.bind(this));
  34. },
  35. _newElement: function(data, explorer){
  36. return new MWF.xApplication.Org.RoleExplorer.Role(data, explorer, this.isEditor);
  37. },
  38. _listElementByKey: function(callback, failure, key){
  39. this.actions.listRoleByKey(function(json){
  40. if (callback) callback.apply(this, [json]);
  41. }.bind(this), failure, key);
  42. },
  43. _getAddElementData: function(){
  44. return {
  45. "personList": [],
  46. "groupList": [],
  47. "description": "",
  48. "unique": "",
  49. "orderNumber": "",
  50. "id": "",
  51. "name": "",
  52. "control": {
  53. "allowEdit": true,
  54. "allowDelete": true
  55. }
  56. };
  57. },
  58. loadToolbar: function(){
  59. if (this._isActionManager()){
  60. this.isEditor = true;
  61. this.addTopElementNode = new Element("div", {"styles": this.css.addTopGroupNode}).inject(this.toolbarNode);
  62. this.addTopElementNode.addEvent("click", function(){
  63. this.addTopElement();
  64. }.bind(this));
  65. }
  66. this.createSearchNode();
  67. this.loadPingyinArea();
  68. },
  69. _isActionManager: function(){
  70. return (MWF.AC.isOrganizationManager() || MWF.AC.isRoleManager());
  71. }
  72. });
  73. MWF.xApplication.Org.RoleExplorer.Role = new Class({
  74. Extends: MWF.xApplication.Org.$Explorer.Item,
  75. showItemProperty: function(){
  76. this.content = new MWF.xApplication.Org.RoleExplorer.RoleContent(this);
  77. },
  78. "delete": function(success, failure){
  79. this.explorer.actions.deleteRole(this.data.id, function(){
  80. this.destroy();
  81. if (success) success();
  82. }.bind(this), function(xhr, text, error){
  83. var errorText = error;
  84. if (xhr) errorText = xhr.responseText;
  85. MWF.xDesktop.notice("error", {x: "right", y:"top"}, "request json error: "+errorText);
  86. if (failure) failure();
  87. });
  88. },
  89. _getIcon: function(){
  90. return "/x_component_Org/$Explorer/default/icon/role.png";
  91. }
  92. });
  93. MWF.xApplication.Org.RoleExplorer.RoleContent = new Class({
  94. Extends: MWF.xApplication.Org.$Explorer.ItemContent,
  95. _getData: function(callback){
  96. if (this.item.data.id){
  97. this.explorer.actions.getRole(function(json){
  98. this.data = json.data;
  99. this.item.data = json.data;
  100. if (callback) callback();
  101. }.bind(this), null, this.item.data.id);
  102. }else{
  103. this.data = this.item.data;
  104. if (callback) callback();
  105. }
  106. },
  107. _showItemPropertyTitle: function(){
  108. this.titleInfor = new MWF.xApplication.Org.RoleExplorer.RoleContent.TitleInfor(this);
  109. //this.baseInfor = new MWF.xApplication.Org.BaseInfor(this);
  110. },
  111. _showItemPropertyBottom: function(){
  112. this.bottomInfor = new MWF.xApplication.Org.RoleExplorer.RoleContent.BottomInfor(this);
  113. },
  114. _loadTabs: function(){
  115. this.baseContentNode = new Element("div", {"styles": this.item.style.tabContentNode});
  116. this.basePage = this.propertyTab.addTab(this.baseContentNode, this.explorer.app.lp.roleBaseText);
  117. this.personMemberContentNode = new Element("div", {"styles": this.item.style.tabContentNode});
  118. this.personMemberPage = this.propertyTab.addTab(this.personMemberContentNode, this.explorer.app.lp.rolePersonMembers);
  119. this.groupMemberContentNode = new Element("div", {"styles": this.item.style.tabContentNode});
  120. this.groupMemberPage = this.propertyTab.addTab(this.groupMemberContentNode, this.explorer.app.lp.roleGroupMembers);
  121. },
  122. _loadContent: function(){
  123. this._listBaseInfor();
  124. this.loadListCount();
  125. var _self = this;
  126. this.personMemberList = this._listMembers("personList", "woPersonList", this.personMemberContentNode, [{
  127. "get": function(){
  128. var src = _self.explorer.actions.getPersonIcon(this.id);
  129. return "<div style='width:24px; height:24px;''><img style='width:24px; height:24px; border-radius:12px; border: 0' src='"+src+"'/></div>";
  130. },
  131. "set": function(){}
  132. }, "name", "employee", "mobile", "mail", {
  133. "get": function(){
  134. return "<div style='width:24px; height:24px; cursor: pointer; background:url(/x_component_Org/$Explorer/"+
  135. _self.explorer.app.options.style+"/icon/open.png) center center no-repeat'></div>";
  136. },
  137. "events": {
  138. "click": function(){
  139. _self.explorer.openPerson(this.data, this.td);
  140. }
  141. }
  142. }], [
  143. {"style": "width: 30px", "text": ""},
  144. {"style": "width: 20%", "text": this.explorer.app.lp.personName},
  145. {"style": "", "text": this.explorer.app.lp.personEmployee},
  146. {"style": "", "text": this.explorer.app.lp.personMobile},
  147. {"style": "", "text": this.explorer.app.lp.personMail},
  148. {"style": "width: 30px", "text": ""}
  149. ], this.addPersonMember.bind(this), "personCountNode", this.explorer.app.lp.deletePersonMemeberTitle, this.explorer.app.lp.deletePersonMemeber);
  150. this.groupMemberList = this._listMembers("groupList", "woGroupList", this.groupMemberContentNode, ["name", "distinguishedName", "description", {
  151. "get": function(){
  152. return "<div style='width:24px; height:24px; cursor: pointer; background:url(/x_component_Org/$Explorer/"+
  153. _self.explorer.app.options.style+"/icon/open.png) center center no-repeat'></div>";
  154. },
  155. "events": {
  156. "click": function(){
  157. _self.explorer.openGroup(this.data, this.td);
  158. }
  159. }
  160. }], [
  161. {"style": "width: 20%", "text": this.explorer.app.lp.groupName},
  162. {"style": "width: 40%", "text": this.explorer.app.lp.groupDn},
  163. {"style": "", "text": this.explorer.app.lp.groupDescription},
  164. {"style": "width: 30px", "text": ""}
  165. ], this.addGroupMember.bind(this), "groupCountNode", this.explorer.app.lp.deleteGroupMemeberTitle, this.explorer.app.lp.deleteGroupMemeber);
  166. },
  167. loadListCount: function(){
  168. var personCount = this.data.personList.length;
  169. if (personCount){
  170. if (this.personCountNode){
  171. this.personCountNode.set("text", personCount);
  172. }else{
  173. this.personCountNode = new Element("div", {"styles": this.item.style.tabCountNode, "text": personCount}).inject(this.personMemberPage.tabNode);
  174. }
  175. }else{
  176. if (this.personCountNode) this.personCountNode.destroy();
  177. }
  178. var groupCount = this.data.groupList.length;
  179. if (groupCount){
  180. if (this.groupCountNode){
  181. this.groupCountNode.set("text", groupCount);
  182. }else{
  183. this.groupCountNode = new Element("div", {"styles": this.item.style.tabCountNode, "text": groupCount}).inject(this.groupMemberPage.tabNode);
  184. }
  185. }else{
  186. if (this.groupCountNode) this.groupCountNode.destroy();
  187. }
  188. },
  189. _listBaseInfor: function(){
  190. this.baseInfor = new MWF.xApplication.Org.RoleExplorer.RoleContent.BaseInfor(this);
  191. },
  192. _listMembers: function(list, woList, node, attr, titles, addItemFun, countNode, deleteTitle, deleteText){
  193. var memberList = new MWF.xApplication.Org.List(node, this, {
  194. "action": this.data.control.allowEdit,
  195. "canEdit": false,
  196. "deleteItemTitle": deleteTitle,
  197. "deleteItemText": deleteText,
  198. "data": {
  199. "person": this.data.id,
  200. "name": "",
  201. "unique": "",
  202. "orderNumber": "",
  203. "attributeList": []
  204. },
  205. "attr": attr,
  206. "onQueryDelete": function(){
  207. this.saveCloneData = Object.clone(this.data);
  208. }.bind(this),
  209. "onDelete": function(continueDelete){
  210. this.explorer.actions.saveRole(this.saveCloneData, function(json){
  211. this.data[list] = this.saveCloneData[list];
  212. this.data[woList] = this.saveCloneData[woList];
  213. this.data.id = json.data.id;
  214. this.saveCloneData = null;
  215. delete this.saveCloneData;
  216. }.bind(this), function(xhr, text, error){
  217. continueDelete = false;
  218. this.explorer.app.notice((JSON.decode(xhr.responseText).message.trim() || "request json error"), "error");
  219. }.bind(this), false);
  220. }.bind(this),
  221. "onPostDelete": function(delCount){
  222. if (this[countNode]){
  223. var count = this[countNode].get("text").toInt()-delCount;
  224. this[countNode].set("text", count);
  225. }
  226. }.bind(this)
  227. });
  228. memberList.addItem = addItemFun;
  229. memberList.load(titles);
  230. if (this.data[woList] && this.data[woList].length){
  231. this.data[woList].each(function(d){
  232. this.addListItem(memberList, d, list, woList);
  233. // var item = memberList.push(d);
  234. // item["delete"] = function(callback){
  235. // debugger;
  236. // _self.saveCloneData[list].erase(this.data.id);
  237. // _self.saveCloneData[woList] = _self.saveCloneData[woList].filter(function(a){
  238. // return (this.data.id !== a.id);
  239. // }.bind(this));
  240. // if (callback) callback();
  241. // };
  242. }.bind(this));
  243. }
  244. return memberList;
  245. },
  246. addListItem: function(memberList, data, list, woList){
  247. var _self = this;
  248. var item = memberList.push(data);
  249. item["delete"] = function(callback){
  250. _self.saveCloneData[list].erase(this.data.id);
  251. _self.saveCloneData[woList] = _self.saveCloneData[woList].filter(function(a){
  252. return (this.data.id !== a.id);
  253. }.bind(this));
  254. if (callback) callback();
  255. };
  256. },
  257. checkSaveBaseInfor: function(callback){
  258. if (!this.data.id){
  259. if (this.baseInfor){
  260. if (this.baseInfor.mode==="edit") this.baseInfor.save(function(){
  261. if (callback) callback();
  262. }.bind(this));
  263. }
  264. }else{
  265. if (callback) callback();
  266. }
  267. },
  268. addPersonMember: function(){
  269. this.checkSaveBaseInfor(function(){
  270. MWF.xDesktop.requireApp("Selector", "Person", function(){
  271. var selector = new MWF.xApplication.Selector.Person(this.explorer.app.content,{
  272. "values": this.data.personList,
  273. "onComplete": function(items){
  274. var ids = [];
  275. var persons = [];
  276. items.each(function(item){
  277. ids.push(item.data.id);
  278. persons.push(item.data);
  279. });
  280. this.data.personList = ids;
  281. this.data.woPersonList = persons;
  282. this._saveElement(this.data, function(){
  283. this.personMemberList.clear();
  284. this.data.woPersonList.each(function(d){
  285. this.addListItem(this.personMemberList, d, "personList", "woPersonList");
  286. }.bind(this));
  287. this.loadListCount();
  288. }.bind(this));
  289. }.bind(this)
  290. });
  291. selector.load();
  292. }.bind(this));
  293. }.bind(this));
  294. },
  295. addGroupMember: function(){
  296. this.checkSaveBaseInfor(function(){
  297. MWF.xDesktop.requireApp("Selector", "Group", function(){
  298. var selector = new MWF.xApplication.Selector.Group(this.explorer.app.content,{
  299. "values": this.data.groupList,
  300. "onComplete": function(items){
  301. var ids = [];
  302. var groups = [];
  303. items.each(function(item){
  304. ids.push(item.data.id);
  305. groups.push(item.data);
  306. });
  307. this.data.groupList = ids;
  308. this.data.woGroupList = groups;
  309. this._saveElement(this.data, function(){
  310. this.groupMemberList.clear();
  311. this.data.woGroupList.each(function(d){
  312. this.addListItem(this.groupMemberList, d, "groupList", "woGroupList");
  313. }.bind(this));
  314. this.loadListCount();
  315. }.bind(this));
  316. }.bind(this)
  317. });
  318. selector.load();
  319. }.bind(this));
  320. }.bind(this));
  321. },
  322. _saveElement: function(data, success, failure){
  323. this.explorer.actions.saveRole(data, function(json){
  324. Object.merge(this.data, data);
  325. if (this.data.id){
  326. this.data.id = json.data.id;
  327. this.item.refresh();
  328. if (success) success();
  329. }else{
  330. this.explorer.actions.getRole(function(json){
  331. this.data = json.data;
  332. this.item.refresh();
  333. if (success) success();
  334. }.bind(this), null, json.data.id);
  335. }
  336. }.bind(this), function(xhr, text, error){
  337. if (failure) failure(xhr, text, error);
  338. }.bind(this));
  339. }
  340. });
  341. MWF.xApplication.Org.RoleExplorer.RoleContent.TitleInfor = new Class({
  342. Extends: MWF.xApplication.Org.$Explorer.ItemContent.TitleInfor,
  343. _getStyle: function(){
  344. var css = Object.clone(this.item.style.person);
  345. return Object.merge(css, this.item.style.role);
  346. },
  347. _getIcon: function(){
  348. return "/x_component_Org/$Explorer/default/icon/role70.png";
  349. },
  350. setBackground: function(){
  351. this.titleBgNode.setStyle("background-image", "url(/x_component_Org/$Explorer/"+this.explorer.app.options.style+"/icon/group_bg_bg.png)");
  352. this.titleNode.setStyle("background-image", "url(/x_component_Org/$Explorer/"+this.explorer.app.options.style+"/icon/group_bg.png)");
  353. },
  354. loadRightInfor: function(){
  355. //var text = this.data.name+((this.data.unique) ? "("+this.data.unique+")" : "");
  356. var text = this.data.name;
  357. if (!this.nameNode) this.nameNode = new Element("div", {"styles": this.style.titleInforNameNode}).inject(this.titleInforRightNode);
  358. if (!this.signatureNode) this.signatureNode = new Element("div", {"styles": this.style.titleInforSignatureNode}).inject(this.titleInforRightNode);
  359. this.nameNode.set("text", text);
  360. this.signatureNode.set("text", (this.data.distinguishedName || "" ));
  361. }
  362. });
  363. MWF.xApplication.Org.RoleExplorer.RoleContent.BottomInfor = new Class({
  364. Extends: MWF.xApplication.Org.$Explorer.ItemContent.BottomInfor,
  365. addInforList: function(){
  366. var text = this.explorer.app.lp.roleReadDn.replace(/{dn}/g, (this.data.distinguishedName || " "));
  367. this.addInfor(text);
  368. text = this.explorer.app.lp.roleReadCreate.replace(/{date}/g, (this.data.createTime || " "));
  369. text = text.replace(/{date2}/g, (this.data.updateTime || " "));
  370. this.addInfor(text);
  371. }
  372. });
  373. MWF.xApplication.Org.RoleExplorer.RoleContent.BaseInfor = new Class({
  374. initialize: function(content){
  375. this.content = content;
  376. this.item = content.item;
  377. this.data = this.content.data;
  378. this.explorer = this.item.explorer;
  379. this.contentNode = this.content.baseContentNode;
  380. this.style = this.item.style.person;
  381. this.mode = "read";
  382. this.load();
  383. },
  384. load: function(){
  385. this.node = new Element("div", {"styles": this.style.baseContentNode}).inject(this.contentNode);
  386. this.editContentNode = new Element("div", {"styles": this.style.baseEditNode}).inject(this.node);
  387. this.editContentNode.set("html", this.getContentHtml());
  388. this.editContentNode.getElements("td.inforTitle").setStyles(this.style.baseInforTitleNode);
  389. this.editContentNode.getElements("td.inforContent").setStyles(this.style.baseInforContentNode);
  390. this.editContentNode.getElements("td.inforAction").setStyles(this.style.baseInforActionNode);
  391. this.loadAction();
  392. },
  393. getContentHtml: function(){
  394. var html = "<table width='100%' cellpadding='3px' cellspacing='5px'>";
  395. html += "<tr><td class='inforTitle'>"+this.explorer.app.lp.roleName+":</td><td class='inforContent'>"+(this.data.name || "")+"</td>" +
  396. "<td class='inforTitle'>"+this.explorer.app.lp.roleUnique+":</td><td class='inforContent'>"+(this.data.unique || "")+"</td></tr>";
  397. html += "<tr><td class='inforTitle'>"+this.explorer.app.lp.roleDescription+":</td><td colspan='3' class='inforContent'>"+(this.data.description || "")+"</td>";
  398. html += "<tr><td colspan='4' class='inforAction'></td></tr>";
  399. //this.baseInforRightNode.set("html", html);
  400. return html;
  401. },
  402. loadAction: function(){
  403. //this.explorer.app.lp.edit
  404. var actionAreas = this.editContentNode.getElements("td");
  405. var actionArea = actionAreas[actionAreas.length-1];
  406. if (this.data.control.allowEdit){
  407. this.baseInforEditActionAreaNode = new Element("div", {"styles": this.style.baseInforEditActionAreaNode}).inject(actionArea);
  408. this.editNode = new Element("div", {"styles": this.style.actionEditNode, "text": this.explorer.app.lp.editRole}).inject(this.baseInforEditActionAreaNode);
  409. this.saveNode = new Element("div", {"styles": this.style.actionSaveNode, "text": this.explorer.app.lp.saveRole}).inject(this.baseInforEditActionAreaNode);
  410. this.cancelNode = new Element("div", {"styles": this.style.actionCancelNode, "text": this.explorer.app.lp.cancel}).inject(this.baseInforEditActionAreaNode);
  411. this.editNode.setStyle("display", "block");
  412. this.editNode.addEvent("click", this.edit.bind(this));
  413. this.saveNode.addEvent("click", function(){this.save();}.bind(this));
  414. this.cancelNode.addEvent("click", this.cancel.bind(this));
  415. }else{
  416. }
  417. },
  418. edit: function(){
  419. var tdContents = this.editContentNode.getElements("td.inforContent");
  420. tdContents[0].setStyles(this.style.baseInforContentNode_edit).empty();
  421. this.nameInputNode = new Element("input", {"styles": this.style.inputNode}).inject(tdContents[0]);
  422. this.nameInputNode.set("value", (this.data.name));
  423. tdContents[1].setStyles(this.style.baseInforContentNode_edit).empty();
  424. this.uniqueInputNode = new Element("input", {"styles": this.style.inputNode}).inject(tdContents[1]);
  425. this.uniqueInputNode.set("value", (this.data.unique));
  426. tdContents[2].setStyles(this.style.baseInforContentNode_edit).empty();
  427. this.descriptionInputNode = new Element("input", {"styles": this.style.inputNode}).inject(tdContents[2]);
  428. this.descriptionInputNode.set("value", (this.data.description));
  429. var _self = this;
  430. this.editContentNode.getElements("input").addEvents({
  431. "focus": function(){if (this.get("type").toLowerCase()==="text"){this.setStyles(_self.style.inputNode_focus);}},
  432. "blur": function(){if (this.get("type").toLowerCase()==="text"){this.setStyles(_self.style.inputNode_blur);}}
  433. });
  434. this.mode = "edit";
  435. this.editNode.setStyle("display", "none");
  436. this.saveNode.setStyle("display", "block");
  437. this.cancelNode.setStyle("display", "block");
  438. },
  439. save: function(callback){
  440. if (!this.nameInputNode.get("value")){
  441. this.explorer.app.notice(this.explorer.app.lp.inputRoleInfor, "error", this.explorer.propertyContentNode);
  442. return false;
  443. }
  444. //this.data.genderType = gender;
  445. if (!this.uniqueInputNode.get("value")) this.data.unique = this.nameInputNode.get("value");
  446. this.content.propertyContentScrollNode.mask({
  447. "style": {
  448. "opacity": 0.7,
  449. "background-color": "#999"
  450. }
  451. });
  452. this.saveRole(function(){
  453. this.cancel();
  454. this.content.propertyContentScrollNode.unmask();
  455. if (callback) callback();
  456. }.bind(this), function(xhr, text, error){
  457. this.explorer.app.notice((JSON.decode(xhr.responseText).message.trim() || "request json error"), "error");
  458. this.content.propertyContentScrollNode.unmask();
  459. }.bind(this));
  460. },
  461. saveRole: function(callback, cancel){
  462. var data = Object.clone(this.data);
  463. data.name = this.nameInputNode.get("value");
  464. data.unique = this.uniqueInputNode.get("value");
  465. data.description = this.descriptionInputNode.get("value");
  466. this.explorer.actions.saveRole(data, function(json){
  467. Object.merge(this.data, data);
  468. if (this.data.id){
  469. this.data.id = json.data.id;
  470. this.item.refresh();
  471. if (callback) callback();
  472. }else{
  473. this.explorer.actions.getRole(function(json){
  474. this.data = Object.merge(this.data, json.data);
  475. this.item.data = this.data;
  476. this.item.refresh();
  477. if (callback) callback();
  478. }.bind(this), null, json.data.id);
  479. }
  480. }.bind(this), function(xhr, text, error){
  481. if (cancel) cancel(xhr, text, error);
  482. }.bind(this));
  483. },
  484. cancel: function(){
  485. if (this.data.id){
  486. var tdContents = this.editContentNode.getElements("td.inforContent");
  487. tdContents[0].setStyles(this.style.baseInforContentNode).set("html", this.data.name || "");
  488. tdContents[1].setStyles(this.style.baseInforContentNode).set("html", this.data.unique || "");
  489. tdContents[2].setStyles(this.style.baseInforContentNode).set("html", this.data.description || "");
  490. this.mode = "read";
  491. this.editNode.setStyle("display", "block");
  492. this.saveNode.setStyle("display", "none");
  493. this.cancelNode.setStyle("display", "none");
  494. }else{
  495. this.item.destroy();
  496. }
  497. },
  498. // getGenderType: function(){
  499. // var text = "";
  500. // if (this.data.genderType){
  501. // switch (this.data.genderType) {
  502. // case "m":
  503. // text = this.explorer.app.lp.man;
  504. // break;
  505. // case "f":
  506. // text = this.explorer.app.lp.female;
  507. // break;
  508. // default:
  509. // text = this.explorer.app.lp.other;
  510. // }
  511. // }
  512. // return text;
  513. // },
  514. destroy: function(){
  515. this.node.empty();
  516. this.node.destroy();
  517. MWF.release(this);
  518. }
  519. // _getIcon: function(){
  520. // var src = "data:image/png;base64,"+this.data.icon;
  521. // if (!this.data.icon){
  522. // if (this.data.genderType==="f"){
  523. // src = "/x_component_Org/$Explorer/default/icon/female.png"
  524. // }else{
  525. // src = "/x_component_Org/$Explorer/default/icon/man.png"
  526. // }
  527. // }
  528. // return src;
  529. // }
  530. });