SelfHoliday.js 23.6 KB
Newer Older
R
roo00 已提交
1 2 3 4 5 6 7 8 9 10
MWF.xDesktop.requireApp("Attendance", "Explorer", null, false);
MWF.xDesktop.requireApp("Selector", "package", null, false);
MWF.xDesktop.requireApp("Template", "Explorer", null, false);
MWF.xApplication.Attendance.SelfHoliday = new Class({
	Extends: MWF.xApplication.Attendance.Explorer,
	Implements: [Options, Events],

    initialize: function(node, app, actions, options){
        this.setOptions(options);
        this.app = app;
11 12
        this.path = "/x_component_Attendance/$SelfHoliday/";
        this.cssPath = "/x_component_Attendance/$SelfHoliday/"+this.options.style+"/css.wcss";
R
roo00 已提交
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
        this._loadCss();

        this.actions = actions;
        this.node = $(node);

        this.initData();
        if (!this.personActions) this.personActions = new MWF.xAction.org.express.RestActions();
    },
    load: function(){
        this.loadToolbar();
        this.loadFilter();
        this.loadContentNode();

        this.loadView();
        this.setNodeScroll();

    },
    loadFilter : function(){
        this.fileterNode = new Element("div.fileterNode", {
            "styles" : this.css.fileterNode
        }).inject(this.node);

        this._loadFilterContent();
    },
    exportExcel : function(){
        var exportForm = new MWF.xApplication.Attendance.SelfHoliday.ExportExcelForm( this );
        exportForm.edit();
    },
    _loadFilterContent : function(){
U
unknown 已提交
42
	    var lp = MWF.xApplication.Attendance.LP;
R
roo00 已提交
43
        var _self = this;
44
        var html = "<table bordr='0' cellpadding='5' cellspacing='0' styles='formTable' width='1350'>"+
R
roo00 已提交
45 46 47 48 49 50 51
            "<tr>" +
            "    <td styles='formTableTitle' lable='q_topUnitName'></td>"+
            "    <td styles='formTableValue' item='q_topUnitName'></td>"+
            "    <td styles='formTableTitle' lable='q_unitName'></td>"+
            "    <td styles='formTableValue' item='q_unitName'></td>"+
            "    <td styles='formTableTitle' lable='q_empName'></td>"+
            "    <td styles='formTableValue' item='q_empName'></td>"+
52 53 54 55
            "    <td styles='formTableTitle' lable='startdateString'></td>"+
            "    <td styles='formTableValue' item='startdateString'></td>"+
            "    <td styles='formTableTitle' lable='enddateString'></td>"+
            "    <td styles='formTableValue' item='enddateString'></td>"+
R
roo00 已提交
56 57 58 59 60 61 62 63 64 65
            "    <td styles='formTableValue' item='action'></td>"+
            "</tr>" +
            "</table>";
        this.fileterNode.set("html",html);

        MWF.xDesktop.requireApp("Template", "MForm", function(){
            this.filter = new MForm( this.fileterNode,  {}, {
                style : "filter",
                isEdited : true,
                itemTemplate : {
U
unknown 已提交
66 67 68 69 70
                    q_topUnitName : { "text" : lp.selectCompany, "type" : "org", "orgType" : "unit", style : {"min-width" : "200px"} },
                    q_unitName : { "text" : lp.selectDepartment, "type" : "org", "orgType" : "unit", style : {"min-width" : "250px"} },
                    q_empName : {  "text" : lp.selectPerson, "type" : "org", "orgType" : "person", style : {"min-width" : "100px"} },
                    startdateString : {  "text" : lp.startTime, "tType" : "date",style : {"border" : "1px solid rgb(153, 153, 153)","background":'url("../x_component_Template/$MForm/default/icon/calendar.png") 98% center no-repeat',"border-radius":"3px","box-shadow":"rgb(204, 204, 204) 0px 0px 6px","height":"26px","width":"100px"} },
                    enddateString : { "text" : lp.endTime, "tType" : "date" ,style : {"border" : "1px solid rgb(153, 153, 153)","background":'url("../x_component_Template/$MForm/default/icon/calendar.png") 98% center no-repeat',"border-radius":"3px","box-shadow":"rgb(204, 204, 204) 0px 0px 6px","height":"26px","width":"100px"}},
R
roo00 已提交
71 72
                    action : {
                        "type" : "button",
U
unknown 已提交
73
                        "value" : lp.query,
R
roo00 已提交
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137
                        "event" : { "click" : function(){
                            var filterData =  _self.filter.getResult( true,",",true,true,true);
                            this.loadView( filterData );
                        }.bind(this)}
                    }
                }
            }, this.app, this.css);
            this.filter.load();
        }.bind(this), true);
    },
    loadView : function( filterData ){
        this.elementContentNode.empty();
        this.view = new MWF.xApplication.Attendance.SelfHoliday.View(this.elementContentNode, this.app,this, this.viewData, this.options.searchKey );
        this.view.filterData = filterData;
        this.view.load();
        this.setContentSize();
    },
    createDocument: function(){
        if(this.view)this.view._createDocument();
    }
});

MWF.xApplication.Attendance.SelfHoliday.View = new Class({
    Extends: MWF.xApplication.Attendance.Explorer.View,
    _createItem: function(data){
        return new MWF.xApplication.Attendance.SelfHoliday.Document(this.table, data, this.explorer, this);
    },

    _getCurrentPageData: function(callback, count){
        //this.actions.listSelfHoliday(function(json){
        //    if (callback) callback(json);
        //});
        if(!count )count=20;
        var id = (this.items.length) ? this.items[this.items.length-1].data.id : "(0)";
        var filter = this.filterData || {};
        this.actions.listSelfHolidayFilterNext(id, count, filter, function(json){
            if (callback) callback(json);
        });
    },
    _removeDocument: function(documentData, all){
        this.actions.deleteSelfHoliday(documentData.id, function(json){
            this.explorer.view.reload();
            this.app.notice(this.app.lp.deleteDocumentOK, "success");
        }.bind(this));
    },
    _createDocument: function(){
        var selfHoliday = new MWF.xApplication.Attendance.SelfHoliday.Form(this.explorer);
        selfHoliday.create();
    },
    _openDocument: function( documentData ){
        var selfHoliday = new MWF.xApplication.Attendance.SelfHoliday.Form(this.explorer, documentData );
        selfHoliday.open();
    }

});

MWF.xApplication.Attendance.SelfHoliday.Document = new Class({
    Extends: MWF.xApplication.Attendance.Explorer.Document

});

MWF.xApplication.Attendance.SelfHoliday.ExportExcelForm = new Class({
    Extends: MWF.xApplication.Attendance.Explorer.PopupForm,
    _createTableContent: function(){
U
unknown 已提交
138
        var lp = MWF.xApplication.Attendance.LP;
R
roo00 已提交
139 140

        var html = "<table width='100%' bordr='0' cellpadding='5' cellspacing='0' styles='formTable'>"+
U
unknown 已提交
141
            "<tr><td colspan='2' styles='formTableHead'>"+lp.exportEmployeeHolidayRecord+"</td></tr>" +
R
roo00 已提交
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157
            "<tr>" +
            "    <td styles='formTableTitle' lable='startDate'></td>"+
            "    <td styles='formTableValue' item='startDate'></td>"+
            "</tr>" +
            "<tr>" +
            "    <td styles='formTableTitle' lable='endDate'></td>"+
            "    <td styles='formTableValue' item='endDate'></td>"+
            //"    <td styles='formTableValue' item='action'></td>"+
            "</tr>" +
            "</table>";
        this.formTableArea.set("html",html);

        MWF.xDesktop.requireApp("Template", "MForm", function(){
            this.form = new MForm( this.formTableArea, {q_empName : layout.desktop.session.user.distinguishedName }, {
                isEdited : true,
                itemTemplate : {
U
unknown 已提交
158 159
                    startDate : {  "text" : lp.startTime, "tType" : "date" },
                    endDate : { "text" : lp.endTime, "tType" : "date" }
R
roo00 已提交
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185
                }
            }, this.app );
            this.form.load();
        }.bind(this), true);

    },
    _ok: function( data, callback ){
        this.app.restActions.exportSelfHoliday( data.startDate, data.endDate, function(json){
            if( callback )callback(json);
        }.bind(this) );
        this.close();
    }
});

MWF.xApplication.Attendance.SelfHoliday.Form = new Class({
    Extends: MWF.xApplication.Attendance.Explorer.PopupForm,
    options : {
        "width": 600,
        "height": 450,
        "hasTop" : true,
        "hasBottom" : true,
        "title" : "",
        "draggable" : true,
        "closeAction" : true
    },
    _createTableContent: function(){
U
unknown 已提交
186
        var lp = MWF.xApplication.Attendance.LP;
R
roo00 已提交
187
        var html = "<table width='100%' bordr='0' cellpadding='5' cellspacing='0' styles='formTable'>"+
U
unknown 已提交
188
            "<tr><td colspan='2' styles='formTableHead'>"+lp.employeeHolidayRecord+"</td></tr>" +
R
roo00 已提交
189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207
            "<tr><td styles='formTabelTitle' lable='unitName'></td>"+
            "    <td styles='formTableValue' item='unitName'></td></tr>" +
            "<tr><td styles='formTabelTitle' lable='employeeName'></td>"+
            "    <td styles='formTableValue' item='employeeName'></td></tr>" +
            "<tr><td styles='formTabelTitle' lable='leaveType'></td>"+
            "    <td styles='formTableValue' item='leaveType'></td></tr>" +
            "<tr><td styles='formTabelTitle' lable='startTime'></td>"+
            "    <td styles='formTableValue' item='startTime'></td></tr>" +
            "<tr><td styles='formTabelTitle' lable='endTime'></td>"+
            "    <td styles='formTableValue' item='endTime'></td></tr>" +
            "<tr><td styles='formTabelTitle' lable='leaveDayNumber'></td>"+
            "    <td styles='formTableValue' item='leaveDayNumber'></td></tr>" +
            "</table>";
        this.formTableArea.set("html",html);

        MWF.xDesktop.requireApp("Template", "MForm", function(){
            this.form = new MForm( this.formTableArea, this.data, {
                isEdited : this.isEdited || this.isNew,
                itemTemplate : {
U
unknown 已提交
208 209
                    unitName : { text : lp.unit, "type" : "org", orgType : "unit", notEmpty : true},
                    employeeName : { text: lp.employeeName,  "type" : "org", orgType : "person" , notEmpty : true },
R
roo00 已提交
210
                    leaveType : {
U
unknown 已提交
211
                        text: lp.leaveType1,
R
roo00 已提交
212
                        "type" : "select", notEmpty : true,
U
unknown 已提交
213
                        "selectValue" : lp.leaveTypeSelectText1
R
roo00 已提交
214 215
                    },
                    startTime : {
U
unknown 已提交
216
                        text: lp.startTime, tType : "datetime", notEmpty : true
R
roo00 已提交
217 218
                    },
                    endTime : {
U
unknown 已提交
219
                        text: lp.endTime, tType : "datetime", notEmpty : true
R
roo00 已提交
220 221
                    },
                    leaveDayNumber : {
U
unknown 已提交
222
                        text:lp.leaveDayCount, tType : "number", notEmpty : true
R
roo00 已提交
223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561
                    }
                }
            }, this.app);
            this.form.load();
        }.bind(this), true);
    },
    _ok: function( data, callback ){
        this.app.restActions.saveSelfHoliday(data, function(json){
             if( callback )callback(json);
        }.bind(this));
    }
});
//
//MWF.xApplication.Attendance.SelfHoliday.Form = new Class({
//    Extends: MWF.widget.Common,
//    Implements: [Options, Events],
//    options: {
//        "width": "500",
//        "height": "400"
//    },
//    initialize: function( explorer, data ){
//        this.explorer = explorer;
//        this.app = explorer.app;
//        this.data = data || {};
//        this.css = this.explorer.css;
//
//        this.load();
//    },
//    load: function(){
//
//    },
//
//    open: function(){
//        this.isNew = false;
//        this.isEdited = false;
//        this._open();
//    },
//    create: function(){
//        this.isNew = true;
//        this._open();
//    },
//    edit: function(){
//        this.isEdited = true;
//        this._open();
//    },
//    _open : function(){
//        this.createMarkNode = new Element("div", {
//            "styles": this.css.createMarkNode,
//            "events": {
//                "mouseover": function(e){e.stopPropagation();},
//                "mouseout": function(e){e.stopPropagation();}
//            }
//        }).inject(this.app.content, "after");
//
//        this.createAreaNode = new Element("div", {
//            "styles": this.css.createAreaNode
//        });
//
//        this.createNode();
//
//        this.createAreaNode.inject(this.createMarkNode, "after");
//        this.createAreaNode.fade("in");
//
//
//        this.setCreateNodeSize();
//        this.setCreateNodeSizeFun = this.setCreateNodeSize.bind(this);
//        this.addEvent("resize", this.setCreateNodeSizeFun);
//    },
//    createNode: function(){
//        var _self = this;
//        var d = this.data;
//        this.createNode = new Element("div", {
//            "styles": this.css.createNode
//        }).inject(this.createAreaNode);
//
//
//        this.createIconNode = new Element("div", {
//            "styles": this.isNew ? this.css.createNewNode : this.css.createIconNode
//        }).inject(this.createNode);
//
//
//        this.createFormNode = new Element("div", {
//            "styles": this.css.createFormNode
//        }).inject(this.createNode);
//
//
//        var table = new Element("table", {
//            "width" : "100%", "border" : "0", "cellpadding" : "0", "cellspacing" : "0"
//        }).inject( this.createFormNode );
//
//        var tr = new Element("tr").inject(table);
//        var td = new Element("td", { "colspan":'2', "styles" : this.css.editTableHead, "text" : "员工休假记录"  }).inject(tr);
//
//        var tr = new Element("tr").inject(table);
//        var td = new Element("td", {  "styles" : this.css.editTableTitle, "text" : "部门:"  }).inject(tr);
//        var td = new Element("td", { "styles" : this.css.editTableValue }).inject(tr);
//        if( !this.isNew && !this.isEdited  ){
//            td.set("text",  d.unitName  )
//        }else{
//           this.unitName = new MDomItem( td, {
//                "name" : "unitName",
//                "value" : d.unitName,
//                "style" : this.css.inputPersonStyle,
//               "event" : {
//                   "click" : function( mdi){ _self.selectPeople(this, "unit", mdi.get("value").split(",") ) }
//               }
//            }, true, this.app );
//            this.unitName.load();
//        }
//
//        var tr = new Element("tr").inject(table);
//        var td = new Element("td", {  "styles" : this.css.editTableTitle, "text" : "员工姓名:"  }).inject(tr);
//        var td = new Element("td", { "styles" : this.css.editTableValue  }).inject(tr);
//        if( !this.isNew && !this.isEdited  ){
//            td.set("text",  d.employeeName  )
//        }else{
//            this.employeeName = new MDomItem( td, {
//                "name" : "employeeName",
//                "value" : d.employeeName,
//                "style" : this.css.inputPersonStyle,
//                "event" : {
//                    "click" : function( mdi){ _self.selectPeople(this, "person", mdi.get("value").split(",") ) }
//                }
//            }, true, this.app );
//            this.employeeName.load();
//        }
//
//        var tr = new Element("tr").inject(table);
//        var td = new Element("td", {  "styles" : this.css.editTableTitle, "text" : "休假类型:"  }).inject(tr);
//        var td = new Element("td", { "styles" : this.css.editTableValue  }).inject(tr);
//        if( !this.isNew && !this.isEdited  ){
//            td.set("text",  d.leaveType  )
//        }else{
//            this.leaveType = new MDomItem( td, {
//                "name" : "leaveType",
//                "type" : "select",
//                "value" : d.leaveType,
//                "selectValue" : "带薪年休假,带薪病假,带薪福利假,扣薪事假,其他".split(",")
//            }, true, this.app );
//            this.leaveType.load();
//        }
//
//        var tr = new Element("tr").inject(table);
//        var td = new Element("td", {  "styles" : this.css.editTableTitle, "text" : "开始时间:"  }).inject(tr);
//        var td = new Element("td", { "styles" : this.css.editTableValue }).inject(tr);
//        if( !this.isNew && !this.isEdited  ){
//            td.set("text",  d.startTime  )
//        }else{
//            this.startTime = new MDomItem( td, {
//                "name" : "startTime",
//                "value" : d.startTime,
//                "style" : this.css.inputTimeStyle,
//                "event" : {
//                    "click" : function( mdi){ _self.selectDateTime(this, false, true ) }
//                }
//            }, true, this.app );
//            this.startTime.load();
//        }
//
//        var tr = new Element("tr").inject(table);
//        var td = new Element("td", {  "styles" : this.css.editTableTitle, "text" : "结束时间:"  }).inject(tr);
//        var td = new Element("td", { "styles" : this.css.editTableValue} ).inject(tr);
//        if( !this.isNew && !this.isEdited  ){
//            td.set("text",  d.endTime  )
//        }else{
//            this.endTime = new MDomItem( td, {
//                "name" : "endTime",
//                "value" : d.endTime,
//                "style" : this.css.inputTimeStyle,
//                "event" : {
//                    "click" : function( mdi){ _self.selectDateTime(this, false, true ) }
//                }
//            }, true, this.app );
//            this.endTime.load();
//        }
//
//        var tr = new Element("tr").inject(table);
//        var td = new Element("td", {  "styles" : this.css.editTableTitle, "text" : "休假天数:"  }).inject(tr);
//        var td = new Element("td", { "styles" : this.css.editTableValue}).inject(tr);
//        if( !this.isNew && !this.isEdited  ){
//            td.set("text",  d.leaveDayNumber  )
//        }else{
//            this.leaveDayNumber = new MDomItem( td, {
//                "name" : "leaveDayNumber",
//                "value" : d.leaveDayNumber,
//                "style" : this.css.inputStyle,
//                "event" : {
//                    "keyup" : function(){ this.value=this.value.replace(/[^\d.]/g,'') }
//                }
//            }, true, this.app );
//            this.leaveDayNumber.load();
//        }
//
//        if( this.isNew || this.isEdited ){
//            this.createOkActionNode = new Element("div", {
//                "styles": this.css.createOkActionNode,
//                "text": this.app.lp.ok
//            }).inject(this.createFormNode);
//
//            this.createOkActionNode.addEvent("click", function(e){
//                this.okCreate(e);
//            }.bind(this));
//        }
//        this.cancelActionNode = new Element("div", {
//            "styles": this.css.createCancelActionNode,
//            "text": this.app.lp.cancel
//        }).inject(this.createFormNode);
//
//        this.cancelActionNode.addEvent("click", function(e){
//            this.cancelCreate(e);
//        }.bind(this));
//
//    },
//    setCreateNodeSize: function (width, height, top, left) {
//        if (!width)width = this.options && this.options.width ? this.options.width : "50%"
//        if (!height)height = this.options && this.options.height ? this.options.height : "50%"
//        if (!top) top = this.options && this.options.top ? this.options.top : 0;
//        if (!left) left = this.options && this.options.left ? this.options.left : 0;
//
//        var allSize = this.app.content.getSize();
//        var limitWidth = allSize.x; //window.screen.width
//        var limitHeight = allSize.y; //window.screen.height
//
//        "string" == typeof width && (1 < width.length && "%" == width.substr(width.length - 1, 1)) && (width = parseInt(limitWidth * parseInt(width, 10) / 100, 10));
//        "string" == typeof height && (1 < height.length && "%" == height.substr(height.length - 1, 1)) && (height = parseInt(limitHeight * parseInt(height, 10) / 100, 10));
//        300 > width && (width = 300);
//        220 > height && (height = 220);
//        top = top || parseInt((limitHeight - height) / 2, 10);
//        left = left || parseInt((limitWidth - width) / 2, 10);
//
//        this.createAreaNode.setStyles({
//            "width": "" + width + "px",
//            "height": "" + height + "px",
//            "top": "" + top + "px",
//            "left": "" + left + "px"
//        });
//
//        this.createNode.setStyles({
//            "width": "" + width + "px",
//            "height": "" + height + "px"
//        });
//
//        var iconSize = this.createIconNode ? this.createIconNode.getSize() : {x: 0, y: 0};
//        var topSize = this.formTopNode ? this.formTopNode.getSize() : {x: 0, y: 0};
//        var bottomSize = this.formBottomNode ? this.formBottomNode.getSize() : {x: 0, y: 0};
//
//        var contentHeight = height - iconSize.y - topSize.y - bottomSize.y;
//        //var formMargin = formHeight -iconSize.y;
//        this.createFormNode.setStyles({
//            "height": "" + contentHeight + "px"
//        });
//    },
//    cancelCreate: function(e){
//        var _self = this;
//        if( this.unitName )var unitName = this.unitName.get("value");
//        if ( this.isNew &&  unitName!="" && unitName!="default" ){
//            this.app.confirm("warn", e,
//                this.app.lp.create_cancel_title,
//                this.app.lp.create_cancel, "320px", "100px",
//                function(){
//                    _self.createMarkNode.destroy();
//                    _self.createAreaNode.destroy();
//                    this.close();
//                },function(){
//                    this.close();
//                }
//            );
//        }else{
//            this.createMarkNode.destroy();
//            this.createAreaNode.destroy();
//            delete _self;
//        }
//    },
//    okCreate: function(e){
//        var data = {
//            "id" : (this.data && this.data.id) ? this.data.id : null,
//            "unitName": this.unitName.get("value"),
//            "employeeName": this.employeeName.get("value"),
//            "leaveType": this.leaveType.get("value"),
//            "startTime": this.startTime.get("value"),
//            "endTime": this.endTime.get("value"),
//            "leaveDayNumber": this.leaveDayNumber.get("value")
//        };
//
//        //alert(JSON.stringify(data))
//
//        if (data.unitName && data.employeeName && data.leaveType && data.startTime && data.endTime && data.leaveDayNumber){
//            this.app.restActions.saveSelfHoliday(data, function(json){
//                if( json.type == "ERROR" ){
//                    this.app.notice( json.message  , "error");
//                }else{
//                    this.createMarkNode.destroy();
//                    this.createAreaNode.destroy();
//                    if(this.explorer.view)this.explorer.view.reload();
//                    this.app.notice( this.isNew ? this.app.lp.createSuccess : this.app.lp.updateSuccess  , "success");
//                }
//                //    this.app.processConfig();
//            }.bind(this));
//        }else{
//            this.app.notice( this.app.lp.selfHoliday.inputVaild, "error");
//        }
//    },
//    selectDateTime : function( el, timeOnly, isTme ){
//        MWF.require("MWF.widget.Calendar", function(){
//            var calendar = new MWF.widget.Calendar( el, {
//                "style": "xform",
//                "timeOnly": timeOnly,
//                "isTime": isTme,
//                "target": this.app.content
//            });
//            calendar.show();
//        }.bind(this));
//    },
//    selectPeople: function(el, type, value ){
//        var title
//        if( type == "unit" ){
//            title = "选择部门"
//        }else if( type == "topUnit" ){
//            title = "选择公司"
//        }else{
//            title = "选择个人"
//        }
//        var options = {
//            "type": type,
//            "title": title,
//            "count" : "1",
//            "values": value || [],
//            "onComplete": function(items){
//                var vs = [];
//                items.each(function(item){
//                    vs.push(item.data.name);
//                }.bind(this));
//                el.set("value",vs.join( "," ));
//            }.bind(this)
//        };
//        var selector = new MWF.O2Selector(this.app.content, options);
//    }
//});