ScheduleExplorer.js 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504
  1. MWF.xDesktop.requireApp("Template", "Explorer", null, false);
  2. MWF.xDesktop.requireApp("Attendance", "Explorer", null, false);
  3. MWF.xDesktop.requireApp("Selector", "package", null, false);
  4. MWF.xApplication.Attendance.ScheduleExplorer = new Class({
  5. Extends: MWF.xApplication.Attendance.Explorer,
  6. Implements: [Options, Events],
  7. initialize: function(node, app, actions, options){
  8. this.setOptions(options);
  9. this.app = app;
  10. this.path = "../x_component_Attendance/$ScheduleExplorer/";
  11. this.cssPath = "../x_component_Attendance/$ScheduleExplorer/"+this.options.style+"/css.wcss";
  12. this._loadCss();
  13. this.actions = actions;
  14. this.node = $(node);
  15. this.initData();
  16. if (!this.personActions) this.personActions = new MWF.xAction.org.express.RestActions();
  17. },
  18. loadView : function(){
  19. this.view = new MWF.xApplication.Attendance.ScheduleExplorer.View(this.elementContentNode, this.app,this, this.viewData, this.options.searchKey );
  20. this.view.load();
  21. this.setContentSize();
  22. },
  23. createDocument: function(){
  24. if(this.view)this.view._createDocument();
  25. }
  26. });
  27. MWF.xApplication.Attendance.ScheduleExplorer.View = new Class({
  28. Extends: MWF.xApplication.Attendance.Explorer.View,
  29. _createItem: function(data){
  30. return new MWF.xApplication.Attendance.ScheduleExplorer.Document(this.table, data, this.explorer, this);
  31. },
  32. _getCurrentPageData: function(callback, count){
  33. this.actions.listSchedule(function(json){
  34. json.data=json.data.map(function (v) {
  35. v.signProxy = !v.signProxy?1:v.signProxy;
  36. return v;
  37. });
  38. if (callback) callback(json);
  39. });
  40. },
  41. _removeDocument: function(documentData, all){
  42. this.actions.deleteSchedule(documentData.id, function(json){
  43. this.explorer.view.reload();
  44. this.app.notice(this.app.lp.deleteDocumentOK, "success");
  45. }.bind(this));
  46. },
  47. _createDocument: function(){
  48. var schedule = new MWF.xApplication.Attendance.ScheduleExplorer.Schedule(this.explorer);
  49. schedule.create();
  50. },
  51. copyObject: function(obj){
  52. if(typeof obj != 'object'){
  53. return obj;
  54. }
  55. var newobj = new Object(null);
  56. for ( var attr in obj) {
  57. newobj[attr] = this.copyObject(obj[attr]);
  58. }
  59. return newobj;
  60. },
  61. _openDocument: function( documentData ){
  62. var data =this.copyObject(documentData);
  63. var schedule = new MWF.xApplication.Attendance.ScheduleExplorer.Schedule(this.explorer, data );
  64. schedule.edit();
  65. }
  66. });
  67. MWF.xApplication.Attendance.ScheduleExplorer.Document = new Class({
  68. Extends: MWF.xApplication.Attendance.Explorer.Document
  69. });
  70. MWF.xApplication.Attendance.ScheduleExplorer.Schedule = new Class({
  71. Extends: MWF.xApplication.Attendance.Explorer.PopupForm,
  72. options : {
  73. "width": 600,
  74. "height": 450,
  75. "hasTop" : true,
  76. "hasBottom" : true,
  77. "title" : "",
  78. "draggable" : true,
  79. "closeAction" : true
  80. },
  81. _createTableContent: function(){
  82. var lp = this.app.lp.schedule;
  83. var signProxy = this.data.signProxy;
  84. console.log(signProxy)
  85. var html = "<table width='100%' bordr='0' cellpadding='5' cellspacing='0' styles='formTable'>"+
  86. "<tr><td colspan='2' styles='formTableHead'>"+lp.setSchedule+"</td></tr>" +
  87. "<tr><td styles='formTabelTitle' lable='unitName'></td>"+
  88. " <td styles='formTableValue' item='unitName'></td></tr>" +
  89. "<tr><td styles='formTabelTitle' lable='signProxy'></td>"+
  90. " <td styles='formTableValue' item='signProxy'></td></tr>" +
  91. "<tr><td styles='formTabelTitle' lable='onDutyTime'></td>"+
  92. " <td styles='formTableValue' item='onDutyTime'></td></tr>" +
  93. "<tr style='"+(!signProxy||signProxy=="0"||signProxy=="1"?"display: none":"")+"'><td styles='formTabelTitle' lable='middayRestStartTime'></td>"+
  94. " <td styles='formTableValue' item='middayRestStartTime'></td></tr>" +
  95. "<tr style='"+(!signProxy||signProxy=="0"||signProxy=="1"?"display: none":"")+"'><td styles='formTabelTitle' lable='middayRestEndTime'></td>"+
  96. " <td styles='formTableValue' item='middayRestEndTime'></td></tr>" +
  97. "<tr><td styles='formTabelTitle' lable='offDutyTime'></td>"+
  98. " <td styles='formTableValue' item='offDutyTime'></td></tr>" +
  99. "<tr><td styles='formTabelTitle' lable='lateStartTime'></td>"+
  100. " <td styles='formTableValue' item='lateStartTime'></td></tr>" +
  101. "<tr><td styles='formTabelTitle' lable='leaveEarlyStartTime'></td>"+
  102. " <td styles='formTableValue' item='leaveEarlyStartTime'></td></tr>" +
  103. "<tr><td styles='formTabelTitle' lable='absenceStartTime'></td>"+
  104. " <td styles='formTableValue' item='absenceStartTime'></td></tr>" +
  105. "</table>";
  106. this.formTableArea.set("html",html);
  107. MWF.xDesktop.requireApp("Template", "MForm", function(){
  108. var ob = Object;
  109. this.form = new MForm( this.formTableArea, this.data, {
  110. onPostLoad: function(){
  111. if(signProxy!=0&&signProxy!=1){
  112. this.options.height=570;
  113. }
  114. }.bind(this),
  115. isEdited : this.isEdited || this.isNew,
  116. itemTemplate : {
  117. unitName : { text: lp.unit, type : "org", orgType : "unit" },
  118. signProxy : { text: lp.signProxy.name, type : "select" ,selectText:ob.values(lp.signProxy.select),selectValue:ob.keys(lp.signProxy.select),style:{
  119. "width": "99%",
  120. "border": "1px solid rgb(153, 153, 153)",
  121. "border-radius": "3px",
  122. "box-shadow": "rgb(204, 204, 204) 0px 0px 6px",
  123. "min-height": "26px",
  124. "overflow": "hidden"
  125. },event :{
  126. "change":function(){
  127. var signProxy = this.form.getItem("signProxy").getValue();
  128. if(signProxy!="1"&&signProxy!="0"){
  129. this.formTableArea.getElement("[lable=middayRestStartTime]").getParent().setStyle("display","table-row");
  130. this.formTableArea.getElement("[lable=middayRestEndTime]").getParent().setStyle("display","table-row");
  131. this.formNode.setStyle("height","570px");
  132. this.form.options.itemTemplate.middayRestStartTime.text=lp.signProxy[signProxy].middayRestStartTime;
  133. this.form.options.itemTemplate.middayRestEndTime.text=lp.signProxy[signProxy].middayRestEndTime;
  134. this.form.options.itemTemplate.middayRestStartTime.notEmpty=true;
  135. this.form.options.itemTemplate.middayRestEndTime.notEmpty=true;
  136. }else{
  137. this.formTableArea.getElement("[lable=middayRestStartTime]").getParent().setStyle("display","none");
  138. this.formTableArea.getElement("[lable=middayRestEndTime]").getParent().setStyle("display","none");
  139. this.formNode.setStyle("height","450px");
  140. this.form.options.itemTemplate.middayRestStartTime.notEmpty=false;
  141. this.form.options.itemTemplate.middayRestEndTime.notEmpty=false;
  142. }
  143. this.form.data[0].signProxy = signProxy;
  144. this.form.load();
  145. }.bind(this)
  146. }},
  147. onDutyTime : { text: lp.workTime, tType : "time",notEmpty:true },
  148. middayRestStartTime:{ text: lp.signProxy["2"].middayRestStartTime, tType : "time",notEmpty:(signProxy!=0&&signProxy!=1)?true:false },
  149. middayRestEndTime:{ text: lp.signProxy["2"].middayRestEndTime, tType : "time",notEmpty:(signProxy!=0&&signProxy!=1)?true:false },
  150. offDutyTime : { text: lp.offTime, tType : "time",notEmpty:true },
  151. lateStartTime : { text: lp.lateTime, tType : "time",notEmpty:true},
  152. leaveEarlyTime : { text:lp.leaveEarlyTime, tType : "time" },
  153. absenceStartTime : { text:lp.absenteeismTime, tType : "time" }
  154. }
  155. }, this.app);
  156. this.form.load();
  157. }.bind(this), true);
  158. },
  159. _ok: function( data, callback ){
  160. //checkDate
  161. var dateList = [];
  162. var signProxy = data.signProxy;
  163. if(signProxy!=1){
  164. dateList= [data.onDutyTime,data.middayRestStartTime,data.middayRestEndTime,data.offDutyTime];
  165. }else{
  166. dateList= [data.onDutyTime,data.offDutyTime];
  167. }
  168. var D = Date.parse;
  169. for(var i=0;i<dateList.length;i++){
  170. if(i!=0&&D(dateList[i])-D(dateList[i-1])<0){
  171. this.app.notice( this.app.lp.schedule.illegal[signProxy][i-1],"error",this.formNode,{x:"center",y:"center"});
  172. return;
  173. }
  174. }
  175. this.app.restActions.saveSchedule(data, function(json){
  176. if( callback )callback(json);
  177. }.bind(this));
  178. }
  179. });
  180. //
  181. //
  182. //MWF.xApplication.Attendance.ScheduleExplorer.Schedule2 = new Class({
  183. // Extends: MWF.widget.Common,
  184. // options: {
  185. // "width": "600",
  186. // "height": "450"
  187. // },
  188. // initialize: function( explorer, data ){
  189. // this.explorer = explorer;
  190. // this.app = explorer.app;
  191. // this.data = data || {};
  192. // this.css = this.explorer.css;
  193. //
  194. // this.load();
  195. // },
  196. // load: function(){
  197. // this.data.workTime = this.data.onDutyTime;
  198. // this.data.offTime = this.data.offDutyTime;
  199. // this.data.unit = this.data.unitName;
  200. // this.data.lateTime = this.data.lateStartTime;
  201. // this.data.leaveEarlyTime =this.data.leaveEarlyStartTime;
  202. // this.data.absenteeismTime =this.data.absenceStartTime;
  203. // },
  204. //
  205. // open: function(e){
  206. // this.isNew = false;
  207. // this.isEdited = false;
  208. // },
  209. // create: function(){
  210. // this.isNew = true;
  211. // this._open();
  212. // },
  213. // edit: function(){
  214. // this.isEdited = true;
  215. // this._open();
  216. // },
  217. // _open : function(){
  218. // this.createMarkNode = new Element("div", {
  219. // "styles": this.css.createMarkNode,
  220. // "events": {
  221. // "mouseover": function(e){e.stopPropagation();},
  222. // "mouseout": function(e){e.stopPropagation();}
  223. // }
  224. // }).inject(this.app.content, "after");
  225. //
  226. // this.createAreaNode = new Element("div", {
  227. // "styles": this.css.createAreaNode
  228. // });
  229. //
  230. // this.createNode();
  231. //
  232. // this.createAreaNode.inject(this.createMarkNode, "after");
  233. // this.createAreaNode.fade("in");
  234. //
  235. // this.unit.focus();
  236. //
  237. // this.setCreateNodeSize();
  238. // this.setCreateNodeSizeFun = this.setCreateNodeSize.bind(this);
  239. // this.addEvent("resize", this.setCreateNodeSizeFun);
  240. // },
  241. // createNode: function(){
  242. // var _self = this;
  243. // this.createNode = new Element("div", {
  244. // "styles": this.css.createNode
  245. // }).inject(this.createAreaNode);
  246. //
  247. //
  248. // this.createIconNode = new Element("div", {
  249. // "styles": this.isNew ? this.css.createNewNode : this.css.createIconNode
  250. // }).inject(this.createNode);
  251. //
  252. //
  253. // this.createFormNode = new Element("div", {
  254. // "styles": this.css.createFormNode
  255. // }).inject(this.createNode);
  256. //
  257. // var lp = this.app.lp.schedule;
  258. //
  259. // var inputStyle = "width: 99%; border:1px solid #999; background-color:#FFF; border-radius: 3px; box-shadow: 0px 0px 6px #CCC;height: 26px;";
  260. // var inputTimeStyle = "width: 99%; border:1px solid #999; background-color:#FFF; border-radius: 3px; box-shadow: 0px 0px 6px #CCC;height: 26px;"+
  261. // "background : url(../x_component_Attendance/$ScheduleExplorer/default/icon/calendar.png) 98% center no-repeat";
  262. // var inputPersonStyle = "width: 99%; border:1px solid #999; background-color:#FFF; border-radius: 3px; box-shadow: 0px 0px 6px #CCC;height: 26px;"+
  263. // "background : url(../x_component_Attendance/$PermissionExplorer/default/icon/selectperson.png) 98% center no-repeat";
  264. //
  265. // var html = "<table width='100%' height='270' border='0' cellPadding='0' cellSpacing='0'>" +
  266. // "<tr>"+
  267. // "<td colspan='2' style='height: 50px; line-height: 50px; text-align: center; min-width: 80px; font-size:18px;font-weight: bold;'>" + lp.setSchedule + "</td>" +
  268. // "</tr>" +
  269. // "<tr>"+
  270. // "<td style='height: 60px; line-height: 60px; text-align: left; min-width: 80px; width:25%' rowspan='2'>" + lp.unit + ":</td>" +
  271. // "<td style='; text-align: right;'>"+
  272. // (!this.isNew && !this.isEdited ? "" :
  273. // ("<input type='text' id='unit' " + "style='" + inputPersonStyle +"'" + " value='" + ( this.data && this.data.unit ? this.data.unit : "") + "'/>")) +
  274. // "</td>"+
  275. // "</tr>" +
  276. // "<tr>"+
  277. // "<td style='; text-align: left;font-size:14px;padding-bottom: 5px'>"+
  278. // (!this.isNew && !this.isEdited ? "" :("<input type='button' id='selTopUnit' " +"style='margin-right:5px'"+ " value='选择公司'/>")) +
  279. // (!this.isNew && !this.isEdited ? "" :("<input type='button' id='selUnit' " + " value='选择部门'/>")) +
  280. // //"注:不选择" + lp.unit + "则为默认排班"+
  281. // "</td>"+
  282. // "</tr>" +
  283. // "<tr>" +
  284. // "<td style='height: 30px; line-height: 30px; text-align: left'>"+lp.workTime+":</td>" +
  285. // "<td style='; text-align: right;'>" +
  286. // (!this.isNew && !this.isEdited ? "" :
  287. // ("<input type='text' id='workTime' " + "style='" + inputTimeStyle +"'" + " value='" + ( this.data && this.data.workTime ? this.data.workTime : "") + "'/>")) +
  288. // "</td>" +
  289. // "</tr>" +
  290. // "<tr>" +
  291. // "<td style='height: 30px; line-height: 30px; text-align: left'>"+lp.offTime+":</td>" +
  292. // "<td style='; text-align: right;'>" +
  293. // (!this.isNew && !this.isEdited ? "" :
  294. // ("<input type='text' id='offTime' " + "style='" + inputTimeStyle +"'" + " value='" + ( this.data && this.data.offTime ? this.data.offTime : "") + "'/>")) +
  295. // "</td>" +
  296. // "</tr>" +
  297. // "<tr>" +
  298. // "<td style='height: 30px; line-height: 30px; text-align: left'>"+lp.lateTime+":</td>" +
  299. // "<td style='; text-align: right;'>" +
  300. // (!this.isNew && !this.isEdited ? "" :
  301. // ("<input type='text' id='lateTime' " + "style='" + inputTimeStyle +"'" + " value='" + ( this.data && this.data.lateTime ? this.data.lateTime : "") + "'/>")) +
  302. // "</td>" +
  303. // "</tr>" +
  304. // "<tr>" +
  305. // "<td style='height: 30px; line-height: 30px; text-align: left'>"+lp.leaveEarlyTime+":</td>" +
  306. // "<td style='; text-align: right;'>" +
  307. // (!this.isNew && !this.isEdited ? "" :
  308. // ("<input type='text' id='leaveEarlyTime' " + "style='" + inputTimeStyle +"'" + " value='" + ( this.data && this.data.leaveEarlyTime ? this.data.leaveEarlyTime : "") + "'/>")) +
  309. // "</td>" +
  310. // "</tr>" +
  311. // "<tr>" +
  312. // "<td style='height: 30px; line-height: 30px; text-align: left'>"+lp.absenteeismTime+":</td>" +
  313. // "<td style='; text-align: right;'>" +
  314. // (!this.isNew && !this.isEdited ? "" :
  315. // ("<input type='text' id='absenteeismTime' " + "style='" + inputTimeStyle +"'" + " value='" + ( this.data && this.data.absenteeismTime ? this.data.absenteeismTime : "") + "'/>")) +
  316. // "</td>" +
  317. // "</tr>" +
  318. // "</table>";
  319. // this.createFormNode.set("html", html);
  320. //
  321. // this.unit = this.createFormNode.getElement("#unit");
  322. // this.workTime = this.createFormNode.getElement("#workTime");
  323. // this.offTime = this.createFormNode.getElement("#offTime");
  324. // this.lateTime = this.createFormNode.getElement("#lateTime");
  325. // this.leaveEarlyTime = this.createFormNode.getElement("#leaveEarlyTime");
  326. // this.absenteeismTime = this.createFormNode.getElement("#absenteeismTime");
  327. //
  328. // this.createFormNode.getElement("#selUnit").addEvent("click",function(){
  329. // _self.selectUnit(this,"d");
  330. // })
  331. // this.createFormNode.getElement("#selTopUnit").addEvent("click",function(){
  332. // _self.selectUnit(this,"c");
  333. // })
  334. //
  335. // this.workTime.addEvent("click",function(){
  336. // _self.selectCalendar(this);
  337. // })
  338. // this.offTime.addEvent("click",function(){
  339. // _self.selectCalendar(this);
  340. // })
  341. // this.lateTime.addEvent("click",function(){
  342. // _self.selectCalendar(this);
  343. // })
  344. // this.leaveEarlyTime.addEvent("click",function(){
  345. // _self.selectCalendar(this);
  346. // })
  347. // this.absenteeismTime.addEvent("click",function(){
  348. // _self.selectCalendar(this);
  349. // })
  350. //
  351. // this.cancelActionNode = new Element("div", {
  352. // "styles": this.css.createCancelActionNode,
  353. // "text": this.app.lp.cancel
  354. // }).inject(this.createFormNode);
  355. // this.createOkActionNode = new Element("div", {
  356. // "styles": this.css.createOkActionNode,
  357. // "text": this.app.lp.ok
  358. // }).inject(this.createFormNode);
  359. //
  360. // this.cancelActionNode.addEvent("click", function(e){
  361. // this.cancelCreate(e);
  362. // }.bind(this));
  363. // this.createOkActionNode.addEvent("click", function(e){
  364. // this.okCreate(e);
  365. // }.bind(this));
  366. // },
  367. //
  368. // setCreateNodeSize: function (width, height, top, left) {
  369. // if (!width)width = this.options && this.options.width ? this.options.width : "50%"
  370. // if (!height)height = this.options && this.options.height ? this.options.height : "50%"
  371. // if (!top) top = this.options && this.options.top ? this.options.top : 0;
  372. // if (!left) left = this.options && this.options.left ? this.options.left : 0;
  373. //
  374. // var allSize = this.app.content.getSize();
  375. // var limitWidth = allSize.x; //window.screen.width
  376. // var limitHeight = allSize.y; //window.screen.height
  377. //
  378. // "string" == typeof width && (1 < width.length && "%" == width.substr(width.length - 1, 1)) && (width = parseInt(limitWidth * parseInt(width, 10) / 100, 10));
  379. // "string" == typeof height && (1 < height.length && "%" == height.substr(height.length - 1, 1)) && (height = parseInt(limitHeight * parseInt(height, 10) / 100, 10));
  380. // 300 > width && (width = 300);
  381. // 220 > height && (height = 220);
  382. // top = top || parseInt((limitHeight - height) / 2, 10);
  383. // left = left || parseInt((limitWidth - width) / 2, 10);
  384. //
  385. // this.createAreaNode.setStyles({
  386. // "width": "" + width + "px",
  387. // "height": "" + height + "px",
  388. // "top": "" + top + "px",
  389. // "left": "" + left + "px"
  390. // });
  391. //
  392. // this.createNode.setStyles({
  393. // "width": "" + width + "px",
  394. // "height": "" + height + "px"
  395. // });
  396. //
  397. // var iconSize = this.createIconNode ? this.createIconNode.getSize() : {x: 0, y: 0};
  398. // var topSize = this.formTopNode ? this.formTopNode.getSize() : {x: 0, y: 0};
  399. // var bottomSize = this.formBottomNode ? this.formBottomNode.getSize() : {x: 0, y: 0};
  400. //
  401. // var contentHeight = height - iconSize.y - topSize.y - bottomSize.y;
  402. // //var formMargin = formHeight -iconSize.y;
  403. // this.createFormNode.setStyles({
  404. // "height": "" + contentHeight + "px"
  405. // });
  406. // },
  407. // cancelCreate: function(e){
  408. // var _self = this;
  409. // var unit = this.unit.get("value");
  410. // if ( this.isNew && unit!="" && unit!="default" ){
  411. // this.app.confirm("warn", e,
  412. // this.app.lp.create_cancel_title,
  413. // this.app.lp.create_cancel, "320px", "100px",
  414. // function(){
  415. // _self.createMarkNode.destroy();
  416. // _self.createAreaNode.destroy();
  417. // this.close();
  418. // },function(){
  419. // this.close();
  420. // }
  421. // );
  422. // }else{
  423. // this.createMarkNode.destroy();
  424. // this.createAreaNode.destroy();
  425. // delete _self;
  426. // }
  427. // },
  428. // okCreate: function(e){
  429. // var data = {
  430. // "id" : (this.data && this.data.id) ? this.data.id : null,
  431. // "unitName": this.unit.get("value"),
  432. // "onDutyTime": this.workTime.get("value"),
  433. // "offDutyTime": this.offTime.get("value"),
  434. // "lateStartTime": this.lateTime.get("value"),
  435. // "leaveEarlyStartTime": this.leaveEarlyTime.get("value"),
  436. // "absenceStartTime": this.absenteeismTime.get("value")
  437. // };
  438. //
  439. // if (data.onDutyTime && data.offDutyTime && data.lateStartTime ){
  440. // this.app.restActions.saveSchedule(data, function(json){
  441. // if( json.type == "ERROR" ){
  442. // this.app.notice( json.message , "error");
  443. // }else{
  444. // this.createMarkNode.destroy();
  445. // this.createAreaNode.destroy();
  446. // if(this.explorer.view)this.explorer.view.reload();
  447. // this.app.notice( this.isNew ? this.app.lp.createSuccess : this.app.lp.updateSuccess , "success");
  448. // }
  449. // // this.app.processConfig();
  450. // }.bind(this));
  451. // }else{
  452. // this.app.notice( "请选择上班打卡时间、下班打卡时间和迟到起算时间", "error");
  453. // }
  454. // },
  455. // selectCalendar : function( calendarNode ){
  456. // MWF.require("MWF.widget.Calendar", function(){
  457. // var calendar = new MWF.widget.Calendar( calendarNode, {
  458. // "style": "xform",
  459. // "timeOnly": true,
  460. // "isTime": true,
  461. // "target": this.app.content
  462. // });
  463. // calendar.show();
  464. // }.bind(this));
  465. // },
  466. // selectUnit: function(el, type ){
  467. // var options = {
  468. // "type": type == "d" ? "unit" : "topUnit",
  469. // "title": type == "d" ? "选择部门" : "选择公司",
  470. // "values": this.data.unit || [],
  471. // "count" : "1",
  472. // "onComplete": function(items){
  473. // this.data.unit = [];
  474. // items.each(function(item){
  475. // this.data.unit.push(item.data.name);
  476. // }.bind(this));
  477. // this.unit.set("value",this.data.unit);
  478. // }.bind(this)
  479. // };
  480. // var selector = new MWF.O2Selector(this.app.content, options);
  481. // }
  482. //});