Common.js 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708
  1. MWF.xApplication.Attendance = MWF.xApplication.Attendance || {};
  2. MWF.xDesktop.requireApp("Attendance", "lp."+MWF.language, null, false);
  3. //MWF.xApplication.Attendance.Org = new Class({
  4. // initialize: function ( actions ){
  5. // this.actions = actions
  6. // },
  7. // getUnitByPerson : function( name, callback, fail, async ){
  8. // this.actions.listUnitByPerson( function( json ){
  9. // if( callback )callback(json.data);
  10. // }, null, async )
  11. // },
  12. // getTopUnitByPerson : function( name, callback ){
  13. // this.actions.listTopUnitByPerson( function( json ){
  14. // if( callback )callback(json.data);
  15. // }, null, name )
  16. // }
  17. //})
  18. MWF.xApplication.Attendance.Calendar = new Class({
  19. Implements: [Options, Events],
  20. options : {
  21. date : null
  22. },
  23. initialize: function (node, explorer, data, options) {
  24. this.setOptions(options);
  25. this.app = explorer.app;
  26. this.explorer = explorer;
  27. this.actions = this.app.actions;
  28. this.node = node;
  29. this.css = explorer.css;
  30. //this.data = data;
  31. this.holiday = data.holiday;
  32. this.eventData = data.eventData;
  33. this.detail = data.detail;
  34. this.statusColor = explorer.statusColor;
  35. },
  36. reload: function () {
  37. this.node.empty();
  38. this.load();
  39. },
  40. load : function(){
  41. this.loadResource(function(){
  42. this.loadCalendar();
  43. }.bind(this))
  44. },
  45. loadResource: function ( callback ) {
  46. var baseUrls = [
  47. "../x_component_Attendance/$Common/fullcalendar/lib/moment.js",
  48. "../x_component_Attendance/$Common/fullcalendar/lib/jquery.js"
  49. ];
  50. var fullcalendarUrl = "../x_component_Attendance/$Common/fullcalendar/fullcalendar.js";
  51. var langUrl = "../x_component_Attendance/$Common/fullcalendar/lang/"+MWF.language+".js";
  52. COMMON.AjaxModule.loadCss("../x_component_Attendance/$Common/fullcalendar/fullcalendar.css",function(){
  53. COMMON.AjaxModule.load(baseUrls, function(){
  54. jQuery.noConflict();
  55. COMMON.AjaxModule.load(fullcalendarUrl, function(){
  56. COMMON.AjaxModule.load(langUrl, function(){
  57. if(callback)callback();
  58. }.bind(this))
  59. }.bind(this));
  60. }.bind(this))
  61. }.bind(this))
  62. },
  63. loadCalendar : function(){
  64. var _self = this;
  65. jQuery(this.node).fullCalendar({
  66. header: {
  67. left: '', //'prev,next today',
  68. center: '', //'title',
  69. right: '' //'holidayButton'
  70. },
  71. contentHeight: 350,
  72. defaultDate: this.options.date.format( this.app.lp.dateFormatDay ) ,
  73. //editable: true,
  74. eventColor : "#fff",
  75. eventTextColor : "#fff",
  76. rendingNumberCellFun : function( date, formatedDate, dateStr ){
  77. if( this.holiday && this.holiday.holidays && this.holiday.holidays.contains( formatedDate )){
  78. return "<span style='float:right;padding-right:5px;color:red'>"+this.app.lp.offDutyAbbrev+"</span>"
  79. }
  80. if( this.holiday && this.holiday.workdays && this.holiday.workdays.contains( formatedDate ) ){
  81. return "<span style='float:right;padding-right:5px;'>"+this.app.lp.onDutyAbbrev+"</span>"
  82. }
  83. }.bind(this),
  84. eventMouseover : function(event, jsEvent, view){
  85. jsEvent.target.title = event.text;
  86. },
  87. events: this.eventData
  88. });
  89. }
  90. });
  91. MWF.xApplication.Attendance.Echarts = new Class({
  92. Implements: [Options, Events],
  93. options :{
  94. "type" : "pie",
  95. "date" : null
  96. },
  97. initialize: function (node, explorer, data, options) {
  98. this.setOptions(options);
  99. this.app = explorer.app;
  100. this.lp = this.app.lp;
  101. this.actions = this.app.actions;
  102. this.node = node;
  103. this.css = explorer.css;
  104. this.data = data;
  105. this.statusColor = explorer.statusColor;
  106. },
  107. load : function(){
  108. if( !this.options.date )this.options.date = new Date();
  109. this.year = this.options.date.getFullYear();
  110. var month = this.options.date.getMonth()+1;
  111. this.month = month.toString().length == 2 ? month : "0"+month;
  112. this.loadResource(function(){
  113. if( this.options.type == "pie"){
  114. this.loadPieChart();
  115. }else{
  116. this.loadLineChart();
  117. }
  118. }.bind(this))
  119. },
  120. loadResource: function ( callback ) {
  121. var baseUrls = [
  122. "../x_component_Attendance/$Common/echarts/echarts.common.js"
  123. ];
  124. var themeUrl = "../x_component_Attendance/$Common/echarts/theme/shine.js";
  125. COMMON.AjaxModule.load(baseUrls, function(){
  126. COMMON.AjaxModule.load(themeUrl, function(){
  127. if(callback)callback();
  128. }.bind(this))
  129. }.bind(this));
  130. },
  131. loadPieChart: function ( ) {
  132. this.chart = echarts.init(this.node, 'shine');
  133. this.chart.setOption({
  134. // title: {
  135. // text: this.lp.attendanceSummary
  136. // //subtext: '纯属虚构'
  137. // },
  138. tooltip: {
  139. trigger: 'item',
  140. formatter: "{a} <br/>{b}: {c} ({d}%)"
  141. },
  142. //legend: {
  143. // orient: 'vertical',
  144. // x: 'left',
  145. // data:['直接访问','邮件营销','联盟广告','视频广告','搜索引擎']
  146. //},
  147. series: [
  148. {
  149. name: this.lp.attendanceStatus,
  150. type:'pie',
  151. radius: ['55%', '70%'],
  152. avoidLabelOverlap: false,
  153. label: {
  154. normal: {
  155. show: false,
  156. position: 'center'
  157. },
  158. emphasis: {
  159. show: true,
  160. textStyle: {
  161. fontSize: '30',
  162. fontWeight: 'bold'
  163. }
  164. }
  165. },
  166. labelLine: {
  167. normal: {
  168. show: false
  169. }
  170. },
  171. data: this.getPieData()
  172. }
  173. ]
  174. });
  175. },
  176. loadLineChart: function () {
  177. var _self = this;
  178. var crossMonth = (this.options.cycleStart.getMonth() != this.options.cycleEnd.getMonth());
  179. var x = this.getDateByMonth();
  180. var data = this.analyseLineData();
  181. var option = {
  182. // title: {
  183. // text: this.lp.attendanceTrendChart
  184. // },
  185. grid : {
  186. left : 50,
  187. right : 40
  188. },
  189. tooltip: {
  190. trigger: 'axis',
  191. formatter: function (params) {
  192. var vs, p1, p2, v;
  193. if ( !params[0].value || params[0].value == "-") {
  194. p1 = "";
  195. }else{
  196. vs = params[0].value.toString().split(".");
  197. if( vs.length == 1 ){
  198. v = vs[0]+":00";
  199. }else{
  200. v = vs[1].length == 1 ? vs[0]+":"+vs[1]+"0" : vs.join(":")
  201. }
  202. p1 = params[0].seriesName + " " + v;
  203. }
  204. if ( !params[1].value || params[1].value == "-") {
  205. p2 = "";
  206. }else{
  207. vs = params[1].value.toString().split(".");
  208. if( vs.length == 1 ){
  209. v = vs[0]+":00";
  210. }else{
  211. v = vs[1].length == 1 ? vs[0]+":"+vs[1]+"0" : vs.join(":")
  212. }
  213. p2 = params[1].seriesName + " " + v;
  214. }
  215. if( crossMonth ){
  216. return params[0].name + '<br />'+ p1 + '<br />' + p2;
  217. }else{
  218. return _self.year +"-" + _self.month +"-" + params[0].name + '<br />'+ p1 + '<br />' + p2;
  219. }
  220. }
  221. },
  222. legend: {
  223. data: this.lp.trendChartLegend
  224. }
  225. //toolbox: {
  226. // show: true,
  227. // feature: {
  228. // dataZoom: {},
  229. // //dataView: {readOnly: false},
  230. // magicType: {type: ['line', 'bar']},
  231. // restore: {},
  232. // saveAsImage: {}
  233. // }
  234. //}
  235. };
  236. option.yAxis = {
  237. type: 'value',
  238. min : (data.yOffTime.length == 0 && data.yOnTime.length == 0) ? "5.00" : "dataMin" ,
  239. max : (data.yOffTime.length == 0 && data.yOnTime.length == 0) ? "23.00" : "dataMax",
  240. axisLabel: {
  241. formatter: function (val) {
  242. vs = val.toString().split(".");
  243. if( vs.length == 1 ){
  244. return vs[0]+":00";
  245. }else{
  246. return vs[1].length == 1 ? vs[0]+":"+vs[1]+"0" : vs.join(":")
  247. }
  248. }
  249. }
  250. };
  251. option.xAxis = [
  252. {
  253. type: 'category',
  254. //min : "dataMin" ,
  255. //max : "dataMax",
  256. boundaryGap : false,
  257. data : x,
  258. axisLabel : {
  259. //rotate : crossMonth ? 15 : 0
  260. }
  261. }
  262. ];
  263. option.series= [
  264. {
  265. name: this.lp.trendChartLegend[0],
  266. type:'line',
  267. data : data.yOnTime.map(function (str) {
  268. return (!str || isNaN(parseFloat(str.replace(':', '.')))) ? "-" : parseFloat(str.replace(':', '.'))
  269. })
  270. },
  271. {
  272. name: this.lp.trendChartLegend[1],
  273. type:'line',
  274. data:data.yOffTime.map(function (str) {
  275. return (!str || isNaN(parseFloat(str.replace(':', '.')))) ? "-" : parseFloat(str.replace(':', '.'))
  276. })
  277. }
  278. ];
  279. this.chart = echarts.init(this.node, 'shine');
  280. this.chart.setOption(option);
  281. },
  282. getPieData : function(){
  283. var val = [];
  284. for( var n in this.data){
  285. val.push({
  286. value : this.data[n],
  287. name : this.lp[n],
  288. itemStyle :{
  289. normal : {
  290. color : this.statusColor[n]
  291. }
  292. }
  293. })
  294. }
  295. return val;
  296. //[
  297. // {value:335, name:'直接访问'},
  298. // {value:310, name:'邮件营销'},
  299. // {value:234, name:'联盟广告'},
  300. // {value:135, name:'视频广告'},
  301. // {value:1548, name:'搜索引擎'}
  302. //]
  303. },
  304. getDateByMonth : function(){
  305. var days = [];
  306. if( this.options.cycleStart.getMonth() == this.options.cycleEnd.getMonth() ){
  307. var year = this.year || new Date().getFullYear();
  308. var month = this.options.date.getMonth() || new Date().getMonth();
  309. var date = new Date(year, month, 1);
  310. while (date.getMonth() === month) {
  311. days.push( date.getDate() );
  312. date.setDate(date.getDate() + 1);
  313. }
  314. }else{
  315. var start = this.options.cycleStart.clone();
  316. var end = this.options.cycleEnd.clone();
  317. while (start <= end) {
  318. days.push( start.format("%Y-%m-%d") );
  319. start.setDate(start.getDate() + 1);
  320. }
  321. }
  322. this.allDates = days;
  323. return days;
  324. },
  325. analyseLineData: function(){
  326. var days = this.getDateByMonth();
  327. var dataObj = {};
  328. this.data.each( function( d ,i ){
  329. dataObj[d.recordDateString] = d;
  330. });
  331. var yOnTime = [];
  332. var yOffTime = [];
  333. if( this.options.cycleStart.getMonth() == this.options.cycleEnd.getMonth() ){
  334. var year = this.year || new Date().getFullYear().toString();
  335. var month = this.options.date.format( "%m" );
  336. days.each(function( d ,i ){
  337. var key = year + "-" + month + "-" + ( d > 9 ? d : ("0"+d) );
  338. var val = dataObj[ key ];
  339. if( val ){
  340. yOnTime.push( val.onDutyTime != "" ? val.onDutyTime : "-" );
  341. yOffTime.push( val.offDutyTime != "" ? val.offDutyTime : "-" )
  342. }else{
  343. yOnTime.push( "-" );
  344. yOffTime.push( "-" )
  345. }
  346. })
  347. }else{
  348. days.each(function( d ,i ){
  349. var key = d;
  350. var val = dataObj[ key ];
  351. if( val ){
  352. yOnTime.push( val.onDutyTime != "" ? val.onDutyTime : "-" );
  353. yOffTime.push( val.offDutyTime != "" ? val.offDutyTime : "-" )
  354. }else{
  355. yOnTime.push( "-" );
  356. yOffTime.push( "-" )
  357. }
  358. })
  359. }
  360. return {
  361. yOnTime : yOnTime,
  362. yOffTime : yOffTime
  363. }
  364. },
  365. loadUnitPieChart : function() {
  366. //if( !this.options.date )this.options.date = new Date();
  367. //this.year = this.options.date.getFullYear()
  368. //var month = this.options.date.getMonth()+1
  369. //this.month = month.toString().length == 2 ? month : "0"+month;
  370. this.loadResource(function(){
  371. this._loadUnitPieChart();
  372. }.bind(this))
  373. },
  374. _loadUnitPieChart: function ( ) {
  375. var data = this.getUnitPieData();
  376. this.chart = echarts.init(this.node, 'shine');
  377. this.chart.setOption({
  378. // title: {
  379. // text: this.lp.attendanceSummary
  380. // //subtext: '纯属虚构'
  381. // },
  382. tooltip: {
  383. trigger: 'item',
  384. formatter: "{a} <br/>{b}: {c} ({d}%)"
  385. },
  386. //legend: {
  387. // orient: 'vertical',
  388. // x: 'right',
  389. // data: data.name
  390. //},
  391. series: [
  392. {
  393. name: this.lp.attendanceStatus,
  394. type:'pie',
  395. radius: ['55%', '70%'],
  396. avoidLabelOverlap: false,
  397. label: {
  398. normal: {
  399. show: false,
  400. position: 'center'
  401. },
  402. emphasis: {
  403. show: true,
  404. textStyle: {
  405. fontSize: '30',
  406. fontWeight: 'bold'
  407. }
  408. }
  409. },
  410. labelLine: {
  411. normal: {
  412. show: false
  413. }
  414. },
  415. data: data.data
  416. }
  417. ]
  418. });
  419. },
  420. getUnitPieData : function(){
  421. var data = {
  422. name : [],
  423. data : []
  424. };
  425. for( var n in this.data){
  426. data.name.push( this.lp[n] );
  427. data.data.push({
  428. value : this.data[n],
  429. name : this.lp[n],
  430. itemStyle :{
  431. normal : {
  432. color : this.statusColor[n]
  433. }
  434. }
  435. })
  436. }
  437. return data;
  438. //[
  439. // {value:335, name:'直接访问'},
  440. // {value:310, name:'邮件营销'},
  441. // {value:234, name:'联盟广告'},
  442. // {value:135, name:'视频广告'},
  443. // {value:1548, name:'搜索引擎'}
  444. //]
  445. },
  446. loadUnitBarChart : function(){
  447. this.loadResource(function(){
  448. this._loadUnitBarChart();
  449. }.bind(this))
  450. },
  451. _loadUnitBarChart : function(){
  452. var data = this.getUnitBarData();
  453. var option = {
  454. // title: {
  455. // text: this.lp.attendanceTrend
  456. // //subtext: '纯属虚构'
  457. // },
  458. tooltip : {
  459. trigger: 'axis',
  460. axisPointer : { // 坐标轴指示器,坐标轴触发有效
  461. type : 'shadow' // 默认为直线,可选为:'line' | 'shadow'
  462. }
  463. },
  464. //legend: {
  465. // data:['直接访问','邮件营销','联盟广告','视频广告','搜索引擎','百度','谷歌','必应','其他']
  466. //},
  467. grid: {
  468. left: '3%',
  469. right: '4%',
  470. bottom: '3%',
  471. containLabel: true
  472. },
  473. xAxis : [
  474. {
  475. type : 'category',
  476. data : data.name
  477. }
  478. ],
  479. yAxis : [
  480. {
  481. type : 'value'
  482. }
  483. ],
  484. series : data.data
  485. };
  486. this.chart = echarts.init(this.node, 'shine');
  487. this.chart.setOption( option )
  488. },
  489. getUnitBarData : function(){
  490. var obj = {};
  491. this.data.each(function( d ){
  492. for( var n in d.data ){
  493. if( !obj[n] ){
  494. obj[n] = {
  495. month : [],
  496. name : this.lp[n],
  497. type : "bar",
  498. itemStyle :{
  499. normal : { color : this.statusColor[n] } },
  500. data :[]
  501. }
  502. }
  503. obj[n].data.push( d.data[n] );
  504. obj[n].month.push( d.year + "-" + d.month );
  505. }
  506. }.bind(this));
  507. var data = {
  508. data : []
  509. };
  510. for( var o in obj ){
  511. if( !data.name )data.name = obj[o].month;
  512. data.data.push( obj[o] )
  513. }
  514. return data;
  515. }
  516. });
  517. MWF.xApplication.Attendance.MonthSelector = new Class({
  518. Implements: [Events],
  519. initialize: function(date, explorer){
  520. this.explorer = explorer;
  521. this.css = this.explorer.css;
  522. this.app = this.explorer.app;
  523. this.date = date;
  524. this.year = this.date.get("year");
  525. this.load();
  526. },
  527. load: function(){
  528. this.monthSelectNode = new Element("div", {"styles": this.css.calendarMonthSelectNode}).inject(this.explorer.node);
  529. this.monthSelectNode.position({
  530. relativeTo: this.explorer.titleTextNode,
  531. position: 'bottomCenter',
  532. edge: 'upperCenter'
  533. });
  534. this.monthSelectNode.addEvent("mousedown", function(e){e.stopPropagation();});
  535. this.monthSelectTitleNode = new Element("div", {"styles": this.css.calendarMonthSelectTitleNode}).inject(this.monthSelectNode);
  536. this.monthSelectPrevYearNode = new Element("div", {"styles": this.css.calendarMonthSelectTitlePrevYearNode}).inject(this.monthSelectTitleNode);
  537. this.monthSelectNextYearNode = new Element("div", {"styles": this.css.calendarMonthSelectTitleNextYearNode}).inject(this.monthSelectTitleNode);
  538. this.monthSelectTextNode = new Element("div", {"styles": this.css.calendarMonthSelectTitleTextNode}).inject(this.monthSelectTitleNode);
  539. this.monthSelectTextNode.set("text", this.year);
  540. var html = "<tr><td></td><td></td><td></td></tr>";
  541. html += "<tr><td></td><td></td><td></td></tr>";
  542. html += "<tr><td></td><td></td><td></td></tr>";
  543. html += "<tr><td></td><td></td><td></td></tr>";
  544. this.monthSelectTable = new Element("table", {
  545. "styles": {"margin-top": "10px"},
  546. "height": "200px",
  547. "width": "90%",
  548. "align": "center",
  549. "border": "0",
  550. "cellPadding": "0",
  551. "cellSpacing": "5",
  552. "html": html
  553. }).inject(this.monthSelectNode);
  554. //this.loadMonth();
  555. this.monthSelectBottomNode = new Element("div", {"styles": this.css.calendarMonthSelectBottomNode, "text": this.app.lp.today}).inject(this.monthSelectNode);
  556. this.setEvent();
  557. },
  558. loadMonth: function(){
  559. this.monthSelectTextNode.set("text", this.year);
  560. var d = new Date();
  561. var todayY = d.get("year");
  562. var todayM = d.get("month");
  563. var thisY = this.date.get("year");
  564. var thisM = this.date.get("month");
  565. var _self = this;
  566. var tds = this.monthSelectTable.getElements("td");
  567. tds.each(function(td, idx){
  568. td.empty();
  569. td.removeEvents("mouseover");
  570. td.removeEvents("mouseout");
  571. td.removeEvents("mousedown");
  572. td.removeEvents("mouseup");
  573. td.removeEvents("click");
  574. var m = idx+1;
  575. td.store("month", m);
  576. td.setStyles(this.css.calendarMonthSelectTdNode);
  577. td.set("text", ""+m);
  578. td.setStyle("background-color", "#FFF");
  579. td.setStyle("color", "#333");
  580. if ((this.year == thisY) && (idx == thisM)){
  581. td.setStyle("background-color", "#F7F7F7");
  582. td.setStyle("color", "#333");
  583. td.store("current", true);
  584. this.currentTd = td;
  585. }
  586. if ((this.year == todayY) && (idx == todayM)){
  587. td.setStyle("color", "#4A90E2");
  588. td.store("today", true);
  589. }
  590. td.addEvents({
  591. "mouseover": function(){
  592. if( !this.retrieve("current") && !this.retrieve("today") ){
  593. this.setStyles(_self.css.calendarMonthSelectTdNode_over);
  594. }
  595. },
  596. "mouseout": function(){
  597. if( !this.retrieve("current") && !this.retrieve("today") ){
  598. this.setStyles(_self.css.calendarMonthSelectTdNode);
  599. }
  600. },
  601. "mousedown": function(){
  602. if( !this.retrieve("current") && !this.retrieve("today") ){
  603. this.setStyles(_self.css.calendarMonthSelectTdNode_down);
  604. }
  605. },
  606. "mouseup": function(){
  607. if( !this.retrieve("current") && !this.retrieve("today") ){
  608. this.setStyles(_self.css.calendarMonthSelectTdNode_over);
  609. }
  610. },
  611. "click": function(){
  612. if(_self.currentTd)_self.currentTd.eliminate("current");
  613. _self.currentTd = this;
  614. _self.currentTd.store("current", true);
  615. _self.selectedMonth(this);
  616. }
  617. });
  618. }.bind(this));
  619. },
  620. setEvent: function(){
  621. this.monthSelectPrevYearNode.addEvent("click", function(){
  622. this.prevYear();
  623. }.bind(this));
  624. this.monthSelectNextYearNode.addEvent("click", function(){
  625. this.nextYear();
  626. }.bind(this));
  627. this.monthSelectBottomNode.addEvent("click", function(){
  628. this.todayMonth();
  629. }.bind(this));
  630. },
  631. prevYear: function(){
  632. this.year--;
  633. if (this.year<1900) this.year=1900;
  634. this.monthSelectTextNode.set("text", this.year);
  635. this.loadMonth();
  636. },
  637. nextYear: function(){
  638. this.year++;
  639. //if (this.year<1900) this.year=1900;
  640. this.monthSelectTextNode.set("text", this.year);
  641. this.loadMonth();
  642. },
  643. todayMonth: function(){
  644. var d = new Date();
  645. this.explorer.changeMonthTo(d);
  646. this.hide();
  647. },
  648. selectedMonth: function(td){
  649. var m = td.retrieve("month");
  650. var d = Date.parse(this.year+"/"+m+"/1");
  651. this.explorer.changeMonthTo(d);
  652. this.hide();
  653. },
  654. show: function(){
  655. this.date = this.explorer.date;
  656. this.year = this.date.get("year");
  657. this.loadMonth();
  658. this.monthSelectNode.setStyle("display", "block");
  659. this.hideFun = this.hide.bind(this);
  660. document.body.addEvent("mousedown", this.hideFun);
  661. },
  662. hide: function(){
  663. this.monthSelectNode.setStyle("display", "none");
  664. document.body.removeEvent("mousedown", this.hideFun);
  665. },
  666. destroy: function(){
  667. //this.titleNode.destroy();
  668. //this.titleNode = null;
  669. //this.titleDayNode = null;
  670. //this.titleInforNode = null;
  671. //
  672. //delete this.explorer.days[this.key];
  673. //
  674. //this.node.empty();
  675. //MWF.release(this);
  676. }
  677. });