RoleExplorer.js 25 KB

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