ScheduleExplorer.js 23 KB

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