Main.js 65.4 KB
Newer Older
R
roo00 已提交
1 2 3 4 5 6
MWF.xApplication.Profile.options.multitask = false;
MWF.xApplication.Profile.Main = new Class({
    Extends: MWF.xApplication.Common.Main,
    Implements: [Options, Events],

    options: {
NoSubject's avatar
NoSubject 已提交
7
        "style": "newVersion",
R
roo00 已提交
8 9
        "name": "Profile",
        "icon": "icon.png",
NoSubject's avatar
NoSubject 已提交
10
        "width": "1100",
11
        "height": "820",
R
roo00 已提交
12 13
        "isResize": false,
        "isMax": false,
NoSubject's avatar
NoSubject 已提交
14
        "mvcStyle": "style.css",
R
roo00 已提交
15 16
        "title": MWF.xApplication.Profile.LP.title
    },
NoSubject's avatar
NoSubject 已提交
17 18 19 20 21 22 23
    _loadCss: function(){},
    loadCss: function(file, callback){
        var path = (file && typeOf(file)==="string") ? file : "style.css";
        var cb = (file && typeOf(file)==="function") ? file : callback;
        var cssPath = this.path+this.options.style+"/"+path;
        this.content.loadCss(cssPath, cb);
    },
R
roo00 已提交
24 25
    onQueryLoad: function(){
        this.lp = MWF.xApplication.Profile.LP;
NoSubject's avatar
NoSubject 已提交
26

NoSubject's avatar
NoSubject 已提交
27
        this.action = MWF.Actions.get("x_organization_assemble_personal");
NoSubject's avatar
NoSubject 已提交
28
        MWF.xDesktop.requireApp("Profile", "Common", null, false);
R
roo00 已提交
29 30
    },
    loadApplication: function(callback){
NoSubject's avatar
NoSubject 已提交
31 32 33
        this.action.getPerson(function(json){
            this.personData = json.data;
            this.personData.personIcon = this.action.getPersonIcon();
NoSubject's avatar
NoSubject 已提交
34

35
            this.content.loadHtml(this.path+this.options.style+"/"+((this.inBrowser||layout.viewMode=="Default")? "viewBrowser": "view")+".html", {"bind": {"data": this.personData, "lp": this.lp}, "module": this}, function(){
NoSubject's avatar
NoSubject 已提交
36 37 38 39
                this.loadContent()
            }.bind(this));
        }.bind(this));
        //this.loadCss();
R
roo00 已提交
40

NoSubject's avatar
NoSubject 已提交
41 42 43
        // this.loadTitle();
        // this.loadContent();
        if (callback) callback();
R
roo00 已提交
44 45 46
    },

    loadContent: function(){
47
        debugger;
NoSubject's avatar
NoSubject 已提交
48
        var pageConfigNodes = this.content.getElements(".o2_profile_configNode");
NoSubject's avatar
NoSubject 已提交
49

NoSubject's avatar
NoSubject 已提交
50
        this.contentNode = this.content.getElement(".o2_profile_contentNode");
R
roo00 已提交
51
        MWF.require("MWF.widget.Tab", function(){
NoSubject's avatar
NoSubject 已提交
52
            this.tab = new MWF.widget.Tab(this.contentNode, {"style": "profileV2"});
R
roo00 已提交
53 54
            this.tab.load();

NoSubject's avatar
NoSubject 已提交
55 56 57
            pageConfigNodes.each(function(node){
                this.tab.addTab(node, node.get("title"));
            }.bind(this));
NoSubject's avatar
NoSubject 已提交
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
            this.contentNode.getElement("[name=MWFcontentNodeContainer]").setStyles({
                "height":"calc(100% - 50px)",
                "overflow":"auto"
            });
            this.tab.pages.map(function(stab){

                var tabNode = stab.tabNode;

                tabNode.addEvent("click",function(){
                    this.addClass("mainColor_border");
                    this.getChildren().addClass("mainColor_color");
                    this.getSiblings().removeClass("mainColor_border");

                    this.getSiblings().map(function(otabNode) {

                        otabNode.getChildren().removeClass("mainColor_color");
                    })

                }.bind(tabNode));
            }.bind(this));
R
roo00 已提交
78 79

            if (this.options.tab){
NoSubject's avatar
NoSubject 已提交
80
                this.tab.pages[this.options.tab].showIm();
NoSubject's avatar
NoSubject 已提交
81 82
                this.tab.pages[this.options.tab].tabNode.addClass("mainColor_border");
                this.tab.pages[this.options.tab].textNode.addClass("mainColor_color");
R
roo00 已提交
83
            }else{
NoSubject's avatar
NoSubject 已提交
84
                this.tab.pages[0].showIm();
NoSubject's avatar
NoSubject 已提交
85 86
                this.tab.pages[0].tabNode.addClass("mainColor_border");
                this.tab.pages[0].textNode.addClass("mainColor_color");
R
roo00 已提交
87 88
            }

NoSubject's avatar
NoSubject 已提交
89
            this.loadInforConfigActions();
NoSubject's avatar
NoSubject 已提交
90 91 92

            if (!this.inBrowser&&layout.viewMode=="Layout"){

NoSubject's avatar
NoSubject 已提交
93 94 95 96 97
                this.loadLayoutConfigActions();
            }else{

            }

NoSubject's avatar
NoSubject 已提交
98
            this.loadIdeaConfigActions();
R
roo00 已提交
99
            this.loadEmPowerConfigAction();
NoSubject's avatar
NoSubject 已提交
100 101 102
            this.loadPasswordConfigActions();
            this.loadSSOConfigAction();

R
roo00 已提交
103 104
        }.bind(this));
    },
105 106 107
    openFaceSet: function(){
        layout.openApplication(null, "FaceSet");
    },
NoSubject's avatar
NoSubject 已提交
108 109
    loadInforConfigActions: function(){
        this.contentImgNode = this.content.getElement(".o2_profile_inforIconContentImg");
NoSubject's avatar
NoSubject 已提交
110
        this.content.getElement(".o2_profile_inforIconChange").addClass("mainColor_color mainColor_border").addEvent("click", function(){
NoSubject's avatar
NoSubject 已提交
111 112 113 114
            this.changeIcon();
        }.bind(this));

        var inputs = this.tab.pages[0].contentNode.getElements("input");
NoSubject's avatar
NoSubject 已提交
115 116 117 118 119
        inputs.addEvent("focus",function(){
            this.addClass("mainColor_border mainColor_color");
        }).addEvent("blur",function(){
            this.removeClass("mainColor_border mainColor_color");
        });
NoSubject's avatar
NoSubject 已提交
120 121 122 123 124
        this.mailInputNode = inputs[0];
        this.mobileInputNode = inputs[1];
        this.officePhoneInputNode = inputs[2];
        this.weixinInputNode = inputs[3];
        this.qqInputNode = inputs[4];
125 126 127 128
        this.ipAddressInputNode = inputs[5];

        this.signatureInputNode = this.tab.pages[0].contentNode.getElement("textarea");
        this.signatureInputNode.addEvent("focus",function(){
NoSubject's avatar
NoSubject 已提交
129 130 131 132
            this.addClass("mainColor_border mainColor_color");
        }).addEvent("blur",function(){
            this.removeClass("mainColor_border mainColor_color");
        });
NoSubject's avatar
NoSubject 已提交
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 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 186 187 188 189 190 191 192 193 194 195 196 197

        this.content.getElement(".o2_profile_saveInforAction").addEvent("click", function(){
            this.savePersonInfor();
        }.bind(this));
    },

    loadLayoutConfigActions: function(){
        var buttons = this.tab.pages[1].contentNode.getElements(".o2_profile_layoutClearDataAction");
        this.clearDataAction = buttons[0];
        this.defaultDataAction = (buttons.length>1) ? buttons[1]: null;
        this.clearDefaultDataAction = (buttons.length>2) ? buttons[2]: null;
        this.forceDataAction = (buttons.length>3) ? buttons[3]: null;
        this.deleteForceDataAction = (buttons.length>4) ? buttons[4]: null;

        this.clearDataAction.addEvent("click", function(){
            MWF.require("MWF.widget.UUID", function(){
                MWF.UD.deleteData("layout", function(){
                    this.notice(this.lp.clearok, "success");
                    this.desktop.notRecordStatus = true;
                }.bind(this));
            }.bind(this));
        }.bind(this));

        if( MWF.AC.isAdministrator() ){
            this.defaultDataAction.addEvent("click", function(){
                MWF.require("MWF.widget.UUID", function(){
                    var text = this.lp.setDefaultOk;
                    this.close();
                    var status = layout.desktop.getLayoutStatusData();
                    MWF.UD.putPublicData("defaultLayout", status, function(){
                        MWF.xDesktop.notice("success", {"x": "right", "y": "top"}, text, layout.desktop.desktopNode);
                    }.bind(this));
                }.bind(this));
            }.bind(this));

            this.clearDefaultDataAction.addEvent("click", function(){
                MWF.require("MWF.widget.UUID", function(){
                    MWF.UD.deletePublicData("defaultLayout", function(){
                        this.notice(this.lp.clearok, "success");
                        this.desktop.notRecordStatus = true;
                    }.bind(this));
                }.bind(this));
            }.bind(this));

            this.forceDataAction.addEvent("click", function(){
                MWF.require("MWF.widget.UUID", function(){
                    var text = this.lp.setForceOk;
                    this.close();
                    var status = layout.desktop.getLayoutStatusData();
                    MWF.UD.putPublicData("forceLayout", status, function(){
                        MWF.xDesktop.notice("success", {"x": "right", "y": "top"}, text, layout.desktop.desktopNode);
                    }.bind(this));
                }.bind(this));
            }.bind(this));

            this.deleteForceDataAction.addEvent("click", function(){
                MWF.require("MWF.widget.UUID", function(){
                    MWF.UD.deletePublicData("forceLayout", function(){
                        this.notice(this.lp.clearok, "success");
                        this.desktop.notRecordStatus = true;
                    }.bind(this));
                }.bind(this));
            }.bind(this));
        }

R
roo00 已提交
198

NoSubject's avatar
NoSubject 已提交
199 200 201 202 203
        var UINode = this.tab.pages[1].contentNode.getLast();
        this.loadDesktopBackground(UINode);
    },

    loadIdeaConfigActions: function(){
NoSubject's avatar
NoSubject 已提交
204 205 206 207 208 209
        var i = (this.inBrowser||layout.viewMode=="Default")? 1 : 2;
        this.ideasArea = this.tab.pages[i].contentNode.setStyle("min-height","500px").getElement("textarea").addEvent("focus",function(){
            this.addClass("mainColor_border mainColor_color");
        }).addEvent("blur",function(){
            this.removeClass("mainColor_border mainColor_color");
        });
NoSubject's avatar
NoSubject 已提交
210

NoSubject's avatar
NoSubject 已提交
211 212 213 214 215
        this.ideasSaveAction = this.ideasArea.getNext().addEvent("mouseover",function(){
            this.addClass("mainColor_bg");
        }).addEvent("mouseout",function(){
            this.removeClass("mainColor_bg");
        });
NoSubject's avatar
NoSubject 已提交
216
        this.ideasSaveDefaultAction = this.ideasSaveAction.getNext() || null;
NoSubject's avatar
NoSubject 已提交
217 218


NoSubject's avatar
NoSubject 已提交
219
        if (MWF.AC.isAdministrator()){
NoSubject's avatar
NoSubject 已提交
220 221 222 223 224
            this.ideasSaveDefaultAction.addEvent("mouseover",function(){
                this.addClass("mainColor_bg");
            }).addEvent("mouseout",function(){
                this.removeClass("mainColor_bg");
            });
NoSubject's avatar
NoSubject 已提交
225 226 227 228 229 230 231
            this.ideasSaveDefaultAction.addEvent("click", function(){
                MWF.require("MWF.widget.UUID", function(){
                    var data = {};
                    data.ideas = this.ideasArea.get("value").split("\n");
                    MWF.UD.putPublicData("idea", data, function(){
                        this.notice(this.lp.ideaSaveOk, "success");
                    }.bind(this));
R
roo00 已提交
232
                }.bind(this));
NoSubject's avatar
NoSubject 已提交
233 234
            }.bind(this))
        }
R
roo00 已提交
235

NoSubject's avatar
NoSubject 已提交
236 237 238 239 240 241 242
        MWF.require("MWF.widget.UUID", function(){
            MWF.UD.getDataJson("idea", function(json){
                if (json){
                    if (json.ideas) this.ideasArea.set("value", json.ideas.join("\n"));
                }
            }.bind(this));
        }.bind(this));
R
roo00 已提交
243

NoSubject's avatar
NoSubject 已提交
244 245 246 247 248 249 250 251 252 253
        this.ideasSaveAction.addEvent("click", function(){
            MWF.require("MWF.widget.UUID", function(){
                var data = {};
                data.ideas = this.ideasArea.get("value").split("\n");
                MWF.UD.putData("idea", data, function(){
                    this.notice(this.lp.ideaSaveOk, "success");
                }.bind(this));
            }.bind(this));
        }.bind(this))
    },
R
roo00 已提交
254
    loadEmPowerConfigAction: function(){
NoSubject's avatar
NoSubject 已提交
255 256 257 258 259 260 261 262 263
        var i = (this.inBrowser||layout.viewMode=="Default")? 2 : 3;

        this.tab.pages[i].contentNode.setStyle("overflow","auto");
        var tabEmpowerNodes = this.tab.pages[i].contentNode.getElements("div.o2_profile_emPower_tab");
        this.emPowerContentNode = this.tab.pages[i].contentNode.getElement("div.o2_profile_emPower_content");

        MWF.require("MWF.widget.Tab", function() {
            this.tabEmpower = new MWF.widget.Tab(this.emPowerContentNode, {"style": "empower"});
            this.tabEmpower.load();
R
roo00 已提交
264

NoSubject's avatar
NoSubject 已提交
265 266
            tabEmpowerNodes.each(function(node){
                this.tabEmpower.addTab(node, node.get("title"));
R
roo00 已提交
267

NoSubject's avatar
NoSubject 已提交
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
            }.bind(this));

            this.tabEmpower.pages.map(function(stab){

                var tabNode = stab.tabNode.setStyle("cursor","pointer");

                tabNode.addEvent("click",function(){
                    this.addClass("mainColor_bg");
                    this.getSiblings().removeClass("mainColor_bg");

                }.bind(tabNode));
            }.bind(this));

            if (!this.options.tabEmpower) {
                this.tabEmpower.pages[0].showIm();
                this.tabEmpower.pages[0].tabNode.addClass("mainColor_bg");
            } else {
                this.tabEmpower.pages[this.options.tab].showIm();
                this.tabEmpower.pages[this.options.tab].tabNode.addClass("mainColor_bg");
            }

        }.bind(this));

        this.loadEmpowerBtn();
        this.loadMyEmPower();
        this.loadReceiveEmPower();
        this.loadMyEmPowerLog();
        this.loadReceiveEmPowerLog();
    },
    loadEmpowerBtn: function(){
        var BtnImg = new Element("div.o2_profile_emPower_Btnimg");
        var BtnText = new Element("div.o2_profile_emPower_Btntext");
        var addEmPowerDiv = new Element("div.o2_profile_emPower_Add").adopt(BtnImg.cloneNode(),BtnText.cloneNode().set("text",this.lp.empower.addEmPower));
        var withDrawEmPowerDiv = new Element("div.o2_profile_emPower_WithDraw").adopt(BtnImg.cloneNode(),BtnText.cloneNode().set("text",this.lp.empower.withdraw));
        this.tabEmpower.tabNodeContainerArea.adopt(withDrawEmPowerDiv,addEmPowerDiv);

        this.tabEmpower.tabNodeContainerArea.getElements(".o2_profile_emPower_Add").addEvent("click",function(){
R
roo00 已提交
305 306
            var popForm = new MWF.xApplication.Profile.emPowerPopupForm(null, {}, {
                "style": "empower",
NoSubject's avatar
NoSubject 已提交
307 308
                "width": "550",
                "height": layout.desktop.session.user.identityList.length>1?"490":"440",
R
roo00 已提交
309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328
                "hasTop": true,
                "hasIcon": false,
                "hasTopIcon" : false,
                "hasTopContent" : false,
                "draggable": true,
                "maxAction" : true,
                "closeAction": true,
                "isFull" : false,
                "startTime" : null,
                "endTime" : null,
                "isWholeday" : false,
                "title" : "新建外出授权",
                "defaultCalendarId" : ""
            }, {
                app: this,
                container : this.content,
                lp : this.lp,
                actions : this.action,
                css : {}
            });
NoSubject's avatar
NoSubject 已提交
329 330 331 332 333
            if(layout.desktop.session.user.identityList.length>=1){
                popForm.create();
            }else{
                this.notice( this.lp.empower.alert2 ,"error");
            }
R
roo00 已提交
334
        }.bind(this));
NoSubject's avatar
NoSubject 已提交
335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355
        //撤回按钮
        this.tabEmpower.tabNodeContainerArea.getElements(".o2_profile_emPower_WithDraw").addEvent("click",function(){
            // var checkElement = this.emPowerTable.getElements("input[name=id]:checked");
            var checkElement = this.tabEmpower.showPage.contentNode.getElements("td input[name=id]:checked")
            var editCount = 0;
            checkElement.forEach(function(item){
                this.action.deleteEmPower(item.get("value"),function(json){
                    if(json.type=="success"){
                        editCount += 1;
                    }
                    item.getParent().getParent().getParent().destroy();
                }.bind(this),null,false);
                /*enable为false时无法再次委托相同内容,又因为目前没做授权的编辑,所以撤回直接调用delete接口
                var idata = this.emPowerData[item.get("value")];
                idata.enable = false;
                this.action.editEmPower(item.get("value"),idata,function(json){
                    if(json.type=="success"){
                        editCount += 1;
                    }
                    item.getParent().getParent().destroy();
                }.bind(this),null,false);*/
R
roo00 已提交
356 357
            }.bind(this));

NoSubject's avatar
NoSubject 已提交
358 359 360 361
            if(checkElement.length==0){
                this.notice(this.lp.empower.selectEmPower, "error");
            }else if(checkElement.length&&editCount==checkElement.length){
                this.notice(this.lp.empower.withdrawOk, "success");
R
roo00 已提交
362
            }else{
NoSubject's avatar
NoSubject 已提交
363 364 365 366 367
                //this.notice(this.lp.empower.withdrawOk, "success");
            }

            if(this.myEmPower.getElements("tr").length==1){
                this["myEmPowerNoDataDiv"].setStyle("display","");
R
roo00 已提交
368
            }
NoSubject's avatar
NoSubject 已提交
369

R
roo00 已提交
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
        }.bind(this));

    },
    loadMyEmPower: function(){

        this.myEmPower = this.tabEmpower.pages[0].contentNode;
        //this.myEmPowerContent = new Element("div.myEmPowerContent",{text:"hhhhhh"}).inject(this.myEmPower);
        this.getAction( function( ){
            this.action.getMyEmPower(function(json){
                var data = json.data;
                this.getEmPowerTable("myEmPower",data,this.myEmPower);
            }.bind(this));
        }.bind(this));

    },
    loadReceiveEmPower: function(){
        this.receiveEmPower =  this.tabEmpower.pages[1].contentNode;
        //this.myEmPowerContent = new Element("div.myEmPowerContent",{text:"hhhhhh"}).inject(this.myEmPower);
        this.getAction( function( ){
            this.action.getReceiveEmPower(function(json){
                var data = json.data;
                this.getEmPowerTable("receiveEmPower",data,this.receiveEmPower);
            }.bind(this));
        }.bind(this) );
    },
    loadMyEmPowerLog: function(){
        this.myEmPowerLog =  this.tabEmpower.pages[2].contentNode;
NoSubject's avatar
NoSubject 已提交
397 398

        this.getEmPowerLogTable("myEmPowerLog","",this.myEmPowerLog);
R
roo00 已提交
399 400 401
    },
    loadReceiveEmPowerLog: function(){
        this.receiveEmPowerLog =  this.tabEmpower.pages[3].contentNode;
NoSubject's avatar
NoSubject 已提交
402 403

        this.getEmPowerLogTable("receiveEmPowerLog","",this.receiveEmPowerLog);
R
roo00 已提交
404 405
    },
    getEmPowerLogTable: function(type,data,content){
NoSubject's avatar
NoSubject 已提交
406 407 408 409 410 411 412 413
        var _this = this;

        new MWF.xApplication.Profile.Common.Content(content, {
            "title":content.get("title"),
            "searchItemList": [
            ],
            "columns": [
                {width:"30%","title": this.lp.empower.title,  "field": "subject","formatter":function(data,target){
NoSubject's avatar
NoSubject 已提交
414
                        new Element("a",{"text":data.title,"style":"cursor:pointer"}).inject(target).addEvent("click",function(e){
NoSubject's avatar
NoSubject 已提交
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
                            var options = {"workId": data.work, "appId": "process.Work"+data.work};
                            _this.desktop.openApplication(e, "process.Work", options);
                        });
                    }},
                type=="myEmPowerLog"?{width:"10%","title": this.lp.empower.toPerson,  "field": "toPerson","formatter":function(data,target){
                        new Element("div",{"text":data.toPerson.split("@")[0]}).inject(target);
                    }}:{width:"10%","title": this.lp.empower.fromPerson,  "field": "fromPerson","formatter":function(data,target){
                        new Element("div",{"text":data.fromPerson.split("@")[0]}).inject(target);
                    }},
                {width:"15%","title": this.lp.empower.applicationName,  "field": "applicationName"},
                {width:"15%","title": this.lp.empower.processName,  "field": "processName"},
                {width:"15%","title": this.lp.empower.activityName,  "field": "activityName"},
                {width:"15%","title": this.lp.empower.createTime,  "field": "updateTime"}
            ],
            "opButtonList": [
            ],
            "onBeforeLoadData": function () {
                _this.getAction( function( ){
                    if( type=="myEmPowerLog"){
                        _this.action.listWithCurrentPersonPaging(this.options.page,this.options.pageSize,"",function(json){

                            this.dataList = json.data;
                            this.total = json.count;
                        }.bind(this),null,false);
                    }else{
                        _this.action.listToCurrentPersonPaging(this.options.page,this.options.pageSize,"",function(json){

                            this.dataList = json.data;
                            this.total = json.count;
                        }.bind(this),null,false);
                    }
R
roo00 已提交
446

NoSubject's avatar
NoSubject 已提交
447
                }.bind(this) );
R
roo00 已提交
448
            }
NoSubject's avatar
NoSubject 已提交
449
        }).load();
R
roo00 已提交
450 451

        if(!this[type+"NoDataDiv"]){
NoSubject's avatar
NoSubject 已提交
452
            this[type+"NoDataDiv"] = new Element("div.o2_profile_emPower_noData").adopt(
453
                new Element("img",{src:"../x_component_Profile/$Main/newVersion/icon_wuweituo.png"}),
NoSubject's avatar
NoSubject 已提交
454 455
                new Element("div",{text:"无待办"})
            ).inject(content.getElement(".profile_common_tableDiv"));
R
roo00 已提交
456
        }
NoSubject's avatar
NoSubject 已提交
457
        if(content.getElements("tr").length==1){
R
roo00 已提交
458 459 460 461 462
            this[type+"NoDataDiv"].setStyle("display","");
        }else{
            if(this[type+"NoDataDiv"]){
                this[type+"NoDataDiv"].setStyle("display","none");
            }
NoSubject's avatar
NoSubject 已提交
463

R
roo00 已提交
464
        }
NoSubject's avatar
NoSubject 已提交
465

R
roo00 已提交
466 467
    },
    getEmPowerTable: function(type,data,content){
NoSubject's avatar
NoSubject 已提交
468 469 470 471
        //var table = content.getElement("table.emPowerTable");
        this.emPowerTable = content.getElement("table.emPowerTable");
        if(!this.emPowerTable){
            this.emPowerTable = new Element("table.emPowerTable",{
R
roo00 已提交
472
                width:"100%",
NoSubject's avatar
NoSubject 已提交
473 474 475 476
                border:"0",
                cellpadding:"0",
                cellspacing:"0"
            }).inject(content);
R
roo00 已提交
477 478
        }
        this.userName = layout.desktop.session.user.distinguishedName;
NoSubject's avatar
NoSubject 已提交
479
        var th = new Element("tr.first");
R
roo00 已提交
480 481
        if(type=="myEmPower"){

NoSubject's avatar
NoSubject 已提交
482 483 484
            var BtnImg = new Element("div.o2_profile_emPower_Btnimg");
            var BtnText = new Element("div.o2_profile_emPower_Btntext");

R
roo00 已提交
485 486
            this.emPowerData={};

NoSubject's avatar
NoSubject 已提交
487 488 489 490 491 492
            var cblabel = new Element("label.o2_profile_empower_checkbox").adopt(new Element("input",{
                name:"allEmpower",
                id:"allEmpower",
                type:"checkbox"
            })).setStyle("float","left").addEvent("click",function(){
                if(this.getElement("input").get("checked")){
B
boomEgg 已提交
493
                    this.getParent().getParent().getParent().getElements("input[type=checkbox]").set("checked",true);
NoSubject's avatar
NoSubject 已提交
494 495 496 497 498 499 500 501 502 503
                    this.getParent().getParent().getParent().getElements("label").addClass("o2_profile_empower_checkbox__checked o2_profile_empower_checkbox_checked");
                    this.getParent().getParent().getParent().getElements("tr").addClass("selected");
                }else{
                    this.getParent().getParent().getParent().getElements("input[type=checkbox]").set("checked",false);
                    this.getParent().getParent().getParent().getElements("label").removeClass("o2_profile_empower_checkbox__checked o2_profile_empower_checkbox_checked");
                    this.getParent().getParent().getParent().getElements("tr").removeClass("selected");
                }
            });

            th.adopt(new Element("th",{width:"16%"}).adopt(cblabel,new Element("div",{text:this.lp.empower.toPerson}).setStyle("float","left")));
R
roo00 已提交
504
        }else{
NoSubject's avatar
NoSubject 已提交
505
            th.adopt(new Element("th",{width:"16%"}).adopt(new Element("div",{text:this.lp.empower.fromPerson})));
R
roo00 已提交
506 507 508
        }

        th.adopt(new Element("th",{width:"7%"}).adopt(new Element("div",{text:this.lp.empower.type})));
NoSubject's avatar
NoSubject 已提交
509 510 511 512 513
        th.adopt(new Element("th",{width:"16%"}).adopt(new Element("div",{text:this.lp.empower.applicationName+"/"+this.lp.empower.processName})));
        th.adopt(new Element("th",{width:"18%"}).adopt(new Element("div",{text:this.lp.empower.startTime})));
        th.adopt(new Element("th",{width:"18%"}).adopt(new Element("div",{text:this.lp.empower.completedTime})));


R
roo00 已提交
514
        if(type=="myEmPower"){
NoSubject's avatar
NoSubject 已提交
515
            th.adopt(new Element("th",{width:"25%"}).adopt(new Element("div",{text:"操作"})));
R
roo00 已提交
516
        }
NoSubject's avatar
NoSubject 已提交
517
        this.emPowerTable.adopt(th);
R
roo00 已提交
518
        data.forEach(function(item){
NoSubject's avatar
NoSubject 已提交
519

R
roo00 已提交
520
            if(true||item.enable==true){
NoSubject's avatar
NoSubject 已提交
521
                var tr = new Element("tr"+(item.enable?"":".disabled"));
R
roo00 已提交
522 523
                var td = new Element("td");

NoSubject's avatar
NoSubject 已提交
524
                var cblabel = new Element("label.o2_profile_empower_checkbox").adopt(new Element("input",{
R
roo00 已提交
525 526 527
                    name:"id",
                    value:item.id,
                    type:"checkbox"
NoSubject's avatar
NoSubject 已提交
528 529 530 531 532 533 534 535 536
                })).setStyle("float","left").addEvent("click",function(){
                    if(this.getElement("input").get("checked")){
                        this.addClass("o2_profile_empower_checkbox__checked o2_profile_empower_checkbox_checked");
                        this.getParent().getParent().addClass("selected");
                    }else{
                        this.removeClass("o2_profile_empower_checkbox__checked o2_profile_empower_checkbox_checked");
                        this.getParent().getParent().removeClass("selected");
                    }
                })
R
roo00 已提交
537 538 539 540
                var tds = [];

                if(type=="myEmPower"){
                    this.emPowerData[item.id]=item;
NoSubject's avatar
NoSubject 已提交
541
                    tds.push(td.cloneNode().adopt(cblabel,new Element("div",{name:"toPerson",text:item.toPerson.split("@")[0]})));
R
roo00 已提交
542 543 544 545 546
                }else{
                    tds.push(td.cloneNode().adopt(new Element("div",{name:"fromPerson",text:item.fromPerson.split("@")[0]})));
                }

                tds.push(td.cloneNode().adopt(new Element("div",{name:"type",text:this.lp.empower["type_"+item.type]})));
NoSubject's avatar
NoSubject 已提交
547
                tds.push(td.cloneNode().adopt(new Element("div",{name:"typeName",text:item.applicationName||item.processName||(item.type=='filter'?JSON.parse(item.filterListData)[0].value:"-")})));
R
roo00 已提交
548 549 550 551
                tds.push(td.cloneNode().adopt(new Element("div",{name:"startTime",text:item.startTime})));
                tds.push(td.cloneNode().adopt(new Element("div",{name:"completedTime",text:item.completedTime})));
                //后续添加编辑/删除/撤回按钮
                var _self = this;
NoSubject's avatar
NoSubject 已提交
552

R
roo00 已提交
553 554 555 556 557
                if(type=="myEmPower"){
                    //启用、禁用按钮
                    var endTime = new Date(item.completedTime);
                    var startTime= new Date(item.startTime);
                    var nowTime = new Date();
NoSubject's avatar
NoSubject 已提交
558 559 560 561
                    //text:item.enable?_self.lp.empower.disable:_self.lp.empower.enable
                    var enableClass = item.enable?"o2_profile_emPower_Disable":"o2_profile_emPower_Enable";
                    var enableText = item.enable?_self.lp.empower.disable:_self.lp.empower.enable
                    var isEnable = new Element("div."+enableClass).adopt(BtnImg.cloneNode(),BtnText.cloneNode().set("text",enableText)).addEvent("click",function(){
R
roo00 已提交
562 563 564
                        this.enable = !this.enable;
                        _self.action.editEmPower(this.id,this,function(json){
                            //submitCount++;
NoSubject's avatar
NoSubject 已提交
565

R
roo00 已提交
566 567 568 569 570 571 572
                            this.notice(this.lp.empower.saveOk,json.type);
                            var content = this.content.getElement(".o2_profile_emPower_tab");
                            content.getElement("table").empty();
                            this.loadMyEmPower();
                        }.bind(_self),null,false);
                    }.bind(item));
                    tds.push(td.cloneNode().setStyles({
NoSubject's avatar
NoSubject 已提交
573
                        "margin":"auto"
R
roo00 已提交
574
                    }).adopt(
NoSubject's avatar
NoSubject 已提交
575 576
                        new Element("div.o2_profile_emPower_Edit").adopt(BtnImg.cloneNode(),BtnText.cloneNode().set("text",this.lp.empower.edit)).addEvent("click",function(e){

R
roo00 已提交
577 578 579 580 581 582
                            var _data = this;
                            _data.fromPerson = _data.fromIdentity;
                            _data.toPerson = _data.toIdentity;
                            _data.startTime = _data.startTime;
                            _data.endTime = _data.completedTime;

NoSubject's avatar
NoSubject 已提交
583
                            var editPopForm = new MWF.xApplication.Profile.emPowerPopupForm(null, _data, {
R
roo00 已提交
584
                                "style": "empower",
NoSubject's avatar
NoSubject 已提交
585 586
                                "width": "550",
                                "height": layout.desktop.session.user.identityList.length>1?"490":"440",
R
roo00 已提交
587 588 589 590 591 592 593 594 595 596 597 598
                                "hasTop": true,
                                "hasIcon": false,
                                "hasTopIcon" : false,
                                "hasTopContent" : false,
                                "draggable": true,
                                "maxAction" : true,
                                "closeAction": true,
                                "isFull" : false,
                                "startTime" : null,
                                "endTime" : null,
                                "isWholeday" : false,
                                "title" : _self.lp.empower.editEmpower,
B
boomEgg 已提交
599 600 601 602
                                "configData":{
                                    Process:(_data.type=="process"?[{name:_data.processName,id:_data.process,editon:_data.edition}]:[]),
                                    Application:(_data.type=="application"?[{name:_data.applicationName,id:_data.application}]:[])
                                },
R
roo00 已提交
603 604 605 606 607 608 609 610 611
                                "defaultCalendarId" : ""
                            }, {
                                app: _self,
                                container : _self.content,
                                lp : _self.lp,
                                actions : _self.action,
                                css : {}
                            });
                            editPopForm.edit();
NoSubject's avatar
NoSubject 已提交
612

R
roo00 已提交
613
                        }.bind(item)),
NoSubject's avatar
NoSubject 已提交
614 615 616
                        (nowTime<startTime||nowTime>endTime)&&false?"":(isEnable),
                        new Element("div.o2_profile_emPower_WithDraw").adopt(BtnImg.cloneNode(),BtnText.cloneNode().set("text",this.lp.empower.withdraw)).set("empowerid",item.id).addEvent("click",function(){

R
roo00 已提交
617 618 619 620
                            var _this = this;

                            _self.action.deleteEmPower(_this.get("empowerid"),function(json){
                                this.notice(this.lp.empower.withdrawOk,json.type);
NoSubject's avatar
NoSubject 已提交
621
                                _this.getParent().getParent().destroy();
R
roo00 已提交
622 623
                            }.bind(_self),null,false);
                        })
NoSubject's avatar
NoSubject 已提交
624
                    ));
R
roo00 已提交
625 626 627

                }/**/
                tr.adopt(tds);
NoSubject's avatar
NoSubject 已提交
628 629
                this.emPowerTable.adopt(tr);

R
roo00 已提交
630
            }
NoSubject's avatar
NoSubject 已提交
631 632


R
roo00 已提交
633
        }.bind(this));
NoSubject's avatar
NoSubject 已提交
634

R
roo00 已提交
635
        if(!this[type+"NoDataDiv"]){
NoSubject's avatar
NoSubject 已提交
636
            this[type+"NoDataDiv"] = new Element("div.o2_profile_emPower_noData").adopt(
637
                new Element("img",{src:"../x_component_Profile/$Main/newVersion/icon_wuweituo.png"}),
NoSubject's avatar
NoSubject 已提交
638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672
                new Element("div",{text:this.lp.empower.noData}),
                type=="myEmPower"?new Element("div.o2_profile_emPower_Add.mainColor_color",{text:"新建委托"}).addEvent("click",function(){
                    var popForm = new MWF.xApplication.Profile.emPowerPopupForm(null, {}, {
                        "style": "empower",
                        "width": "550",
                        "height": layout.desktop.session.user.identityList.length>1?"490":"440",
                        "hasTop": true,
                        "hasIcon": false,
                        "hasTopIcon" : false,
                        "hasTopContent" : false,
                        "draggable": true,
                        "maxAction" : true,
                        "closeAction": true,
                        "isFull" : false,
                        "startTime" : null,
                        "endTime" : null,
                        "isWholeday" : false,
                        "title" : "新建外出授权",
                        "defaultCalendarId" : ""
                    }, {
                        app: this,
                        container : this.content,
                        lp : this.lp,
                        actions : this.action,
                        css : {}
                    });
                    if(layout.desktop.session.user.identityList.length>=1){
                        popForm.create();
                    }else{
                        this.notice( this.lp.empower.alert2 ,"error");
                    }

                }.bind(this)):""
            ).inject(content);

R
roo00 已提交
673
        }
NoSubject's avatar
NoSubject 已提交
674
        if(this.emPowerTable.getElements("tr").length==1){
R
roo00 已提交
675 676 677 678 679 680 681 682 683
            this[type+"NoDataDiv"].setStyle("display","");
            //table.adopt(new Element("tr").adopt(new Element("td")).adopt()));
        }else{
            if(this[type+"NoDataDiv"]){
                this[type+"NoDataDiv"].setStyle("display","none");
            }
            //this.myEmPowerTable.adopt(trs);
        }
    },
NoSubject's avatar
NoSubject 已提交
684

R
roo00 已提交
685

NoSubject's avatar
NoSubject 已提交
686 687

    loadPasswordConfigActions: function(){
NoSubject's avatar
NoSubject 已提交
688 689
        var i = (this.inBrowser||layout.viewMode=="Default")? 3 : 4;
        var inputs = this.tab.pages[i].contentNode.setStyle("min-height","300px").getElements("input");
NoSubject's avatar
NoSubject 已提交
690 691 692
        this.oldPasswordInputNode = inputs[0];
        this.passwordInputNode = inputs[1];
        this.morePasswordInputNode = inputs[2];
NoSubject's avatar
NoSubject 已提交
693
        this.savePasswordAction = this.tab.pages[i].contentNode.getElement(".o2_profile_savePasswordAction");
NoSubject's avatar
NoSubject 已提交
694 695

        this.oldPasswordInputNode.addEvents({
NoSubject's avatar
NoSubject 已提交
696 697
            "blur": function(){this.removeClass("o2_profile_inforContentInput_focus mainColor_border mainColor_color");},
            "focus": function(){this.addClass("o2_profile_inforContentInput_focus mainColor_border mainColor_color");}
NoSubject's avatar
NoSubject 已提交
698 699
        });
        this.passwordInputNode.addEvents({
NoSubject's avatar
NoSubject 已提交
700 701 702
            "blur": function(){this.removeClass("o2_profile_inforContentInput_focus mainColor_border mainColor_color");},
            "focus": function(){this.addClass("o2_profile_inforContentInput_focus mainColor_border mainColor_color");},
            "keyup" : function(){ this.checkPassowrdStrength(  this.passwordInputNode.get("value") ) }.bind(this)
NoSubject's avatar
NoSubject 已提交
703 704
        });
        this.morePasswordInputNode.addEvents({
NoSubject's avatar
NoSubject 已提交
705 706
            "blur": function(){this.removeClass("o2_profile_inforContentInput_focus mainColor_border mainColor_color");},
            "focus": function(){this.addClass("o2_profile_inforContentInput_focus mainColor_border mainColor_color");}
NoSubject's avatar
NoSubject 已提交
707 708 709
        });
        this.savePasswordAction.addEvent("click", function(){
            this.changePassword();
NoSubject's avatar
NoSubject 已提交
710
        }.bind(this)).addClass("mainColor_bg");
R
roo00 已提交
711
    },
NoSubject's avatar
NoSubject 已提交
712
    loadSSOConfigAction: function(){
NoSubject's avatar
NoSubject 已提交
713 714
        var i = (this.inBrowser||layout.viewMode=="Default")? 4 : 5;
        this.ssoConfigAreaNode = this.tab.pages[i].contentNode.setStyle("min-height","300px").getElement(".o2_profile_ssoConfigArea");
NoSubject's avatar
NoSubject 已提交
715 716 717
        MWF.Actions.get("x_organization_assemble_authentication").listOauthServer(function(json){
            json.data.each(function(d){
                var node = new Element("a", {
NoSubject's avatar
NoSubject 已提交
718
                    "class":"mainColor_color",
NoSubject's avatar
NoSubject 已提交
719 720 721
                    "styles": {"font-size": "14px", "display": "block", "margin-bottom": "10px"},
                    "text": d.displayName,
                    "target": "_blank",
722
                    "href": "../x_desktop/oauth.html?oauth="+encodeURIComponent(d.name)+"&redirect="+"&method=oauthBind"
NoSubject's avatar
NoSubject 已提交
723 724 725 726 727
                }).inject(this.ssoConfigAreaNode)
            }.bind(this));
        }.bind(this));
    },

R
roo00 已提交
728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820
    changeIcon: function(){
        var options = {};
        var width = "668";
        var height = "510";
        width = width.toInt();
        height = height.toInt();

        var size = this.content.getSize();
        var x = (size.x-width)/2;
        var y = (size.y-height)/2;
        if (x<0) x = 0;
        if (y<0) y = 0;
        if (layout.mobile){
            x = 20;
            y = 0;
        }

        var _self = this;
        MWF.require("MWF.xDesktop.Dialog", function() {
            MWF.require("MWF.widget.ImageClipper", function(){
                var dlg = new MWF.xDesktop.Dialog({
                    "title": this.lp.changePersonIcon,
                    "style": "image",
                    "top": y,
                    "left": x - 20,
                    "fromTop": y,
                    "fromLeft": x - 20,
                    "width": width,
                    "height": height,
                    "html": "<div></div>",
                    "maskNode": this.content,
                    "container": this.content,
                    "buttonList": [
                        {
                            "text": MWF.LP.process.button.ok,
                            "action": function () {
                                //_self.uploadPersonIcon();
                                _self.image.uploadImage( function( json ){
                                    _self.action.getPerson(function(json){
                                        if (json.data){
                                            this.personData = json.data;
                                            _self.contentImgNode.set("src", _self.action.getPersonIcon());
                                        }
                                        this.close();
                                    }.bind(this));
                                }.bind(this), null );
                            }
                        },
                        {
                            "text": MWF.LP.process.button.cancel,
                            "action": function () {
                                _self.image = null;
                                this.close();
                            }
                        }
                    ]
                });
                dlg.show();

                this.image = new MWF.widget.ImageClipper(dlg.content.getFirst(), {
                    "aspectRatio": 1,
                    "description" : "",
                    "imageUrl" : this.action.getPersonIcon(),
                    "resetEnable" : false,

                    "data": null,
                    "parameter": null,
                    "action": this.action.action,
                    "method": "changeIcon"
                });
                this.image.load();
            }.bind(this));
        }.bind(this))
    },
    uploadPersonIcon: function(){
        if (this.image){
            if( this.image.getResizedImage() ){

                this.action.changeIcon(function(){
                    this.action.getPerson(function(json){
                        if (json.data){
                            this.personData = json.data;
                            //if (this.personData.icon){
                            this.contentImgNode.set("src", this.action.getPersonIcon());
                            //}
                        }
                    }.bind(this))
                }.bind(this), null, this.image.getFormData(), this.image.resizedImage);
            }
        }
    },

    savePersonInfor: function(){
U
unknown 已提交
821 822 823 824 825 826 827 828 829 830 831 832 833
        // var array = [];
        // var ipAddress = this.ipAddressInputNode.get("value") || "";
        // var ipV4Format = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
        // var ipV6Format = /^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/;
        // if( ipAddress.trim() ){
        //     ipAddress.split(",").each( function(ip){
        //         if(!ip.match(ipV4Format) && !ip.match(ipV6Format))array.push( ip );
        //     })
        // }
        // if( array.length > 0 ){
        //     this.notice( this.lp.ipAddressIncorrectNotice + array.join(","), "error");
        //     return false;
        // }
834 835


R
roo00 已提交
836 837 838 839 840
        this.personData.officePhone = this.officePhoneInputNode.get("value");
        this.personData.mail = this.mailInputNode.get("value");
        this.personData.mobile = this.mobileInputNode.get("value");
        this.personData.weixin = this.weixinInputNode.get("value");
        this.personData.qq = this.qqInputNode.get("value");
841
        this.personData.ipAddress = this.ipAddressInputNode.get("value");
R
roo00 已提交
842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857
        this.personData.signature = this.signatureInputNode.get("value");
        this.action.updatePerson(this.personData, function(){
            this.notice(this.lp.saveInforOk, "success");
        }.bind(this));
    },

    loadDesktopBackground: function(UINode){
        var currentSrc = layout.desktop.options.style;
        MWF.UD.getDataJson("layoutDesktop", function(json){
            if (json) currentSrc = json.src;
        }.bind(this), false);

        MWF.getJSON(layout.desktop.path+"styles.json", function(json){
            json.each(function(style){
                var img = MWF.defaultPath+"/xDesktop/$Layout/"+style.style+"/preview.jpg";
                //var dskImg = MWF.defaultPath+"/xDesktop/$Layout/"+style.style+"/desktop.jpg";
NoSubject's avatar
NoSubject 已提交
858
                var imgArea = new Element("div.o2_profile_previewBackground").inject(UINode);
R
roo00 已提交
859
                if (currentSrc==style.style){
NoSubject's avatar
NoSubject 已提交
860
                    //imgArea.setStyles({"border": "4px solid #ffea00"});
861
                    new Element("img.icon",{"src":"../x_component_Profile/$Main/newVersion/icon_ok2_click_copy_2.png"}).inject(imgArea);
NoSubject's avatar
NoSubject 已提交
862
                    imgArea.addClass("profile_previewBackground_current");
R
roo00 已提交
863 864 865 866 867 868 869 870 871 872 873
                }
                new Element("img", {"src": img}).inject(imgArea);

                imgArea.store("dskimg", style.style);
                var _self = this;
                imgArea.addEvent("click", function(){ _self.selectDesktopImg(this, UINode); });
            }.bind(this));
        }.bind(this));
    },
    selectDesktopImg: function(item, UINode){
        var desktopImg = item.retrieve("dskimg");
NoSubject's avatar
NoSubject 已提交
874

R
roo00 已提交
875 876
        MWF.UD.putData("layoutDesktop", {"src": desktopImg}, function(){
            UINode.getChildren().each(function(node){
NoSubject's avatar
NoSubject 已提交
877 878 879 880 881 882
                //node.setStyles({"border": "4px solid #eeeeee"});
                node.removeClass("profile_previewBackground_current");
                if(node.getElement(".icon")){

                    node.getElement(".icon").destroy();
                }
R
roo00 已提交
883
            }.bind(this));
NoSubject's avatar
NoSubject 已提交
884
            //item.setStyles({"border": "4px solid #ffea00"});
885
            new Element("img.icon",{"src":"../x_component_Profile/$Main/newVersion/icon_ok2_click_copy_2.png"}).inject(item);
NoSubject's avatar
NoSubject 已提交
886
            item.addClass("profile_previewBackground_current");
R
roo00 已提交
887 888 889 890 891 892 893 894 895

            var dskImg = MWF.defaultPath+"/xDesktop/$Layout/"+desktopImg+"/desktop.jpg";
            layout.desktop.node.setStyle("background-image", "url("+dskImg+")");
        }.bind(this));
    },
    changePassword: function(){
        var oldPassword = this.oldPasswordInputNode.get("value");
        var password = this.passwordInputNode.get("value");
        var morePassword = this.morePasswordInputNode.get("value");
B
boomEgg 已提交
896
        var remindNode = this.contentNode.getElement(".o2_profile_passwordWarmming");
R
roo00 已提交
897

B
boomEgg 已提交
898
        if (password!=morePassword){
R
roo00 已提交
899 900 901
            this.notice(this.lp.passwordNotMatch, "error");
            this.passwordInputNode.setStyles(this.css.inforContentInputNode_error);
            this.morePasswordInputNode.setStyles(this.css.inforContentInputNode_error);
B
boomEgg 已提交
902 903
        }else if(null||remindNode){
            this.notice(remindNode.get("text"), "error");
R
roo00 已提交
904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930
        }else{
            this.action.changePassword(oldPassword, password, morePassword, function(){
                this.oldPasswordInputNode.set("value", "");
                this.passwordInputNode.set("value", "");
                this.morePasswordInputNode.set("value", "");
                this.notice(this.lp.changePasswordOk, "success");
            }.bind(this));

            if (layout.config.mail){
                var url = "http://"+layout.config.mail+"//names.nsf?changepassword&password="+encodeURIComponent(oldPassword)+"&passwordnew="+encodeURIComponent(password)+"&passwordconfirm="+encodeURIComponent(password);
                var iframe = new Element("iframe", {"styles": {"display": "none"}}).inject(this.desktop.desktopNode);
                iframe.set("src", url);
                window.setTimeout(function(){
                    iframe.destroy();
                }.bind(this), 2000);
            }
        }
    },

    getAction: function(callback){
        if (!this.acrion){
            this.action = MWF.Actions.get("x_organization_assemble_personal");
            if (callback) callback();
        }else{
            if (callback) callback();
        }
    },
NoSubject's avatar
NoSubject 已提交
931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953
    createPasswordStrengthNode : function(){
        var passwordStrengthArea = this.passwordRemindContainer;

        var lowNode = new Element( "div", {styles : this.css.passwordStrengthNode }).inject( passwordStrengthArea );
        this.lowColorNode = new Element( "div", {styles : this.css.passwordStrengthColor }).inject( lowNode );
        this.lowTextNode = new Element( "div", {styles : this.css.passwordStrengthText, text : this.lp.weak }).inject( lowNode );

        var middleNode = new Element( "div" , {styles : this.css.passwordStrengthNode }).inject( passwordStrengthArea );
        this.middleColorNode = new Element( "div", {styles : this.css.passwordStrengthColor }).inject( middleNode );
        this.middleTextNode = new Element( "div", {styles : this.css.passwordStrengthText, text : this.lp.middle }).inject( middleNode );

        var highNode = new Element("div", {styles : this.css.passwordStrengthNode }).inject( passwordStrengthArea );
        this.highColorNode = new Element( "div", {styles : this.css.passwordStrengthColor }).inject( highNode );
        this.highTextNode = new Element( "div", {styles : this.css.passwordStrengthText, text : this.lp.high }).inject( highNode );
    },
    getPasswordLevel: function( password, callback ){
        /*Level(级别)
         •0-3 : [easy]
         •4-6 : [midium]
         •7-9 : [strong]
         •10-12 : [very strong]
         •>12 : [extremely strong]
         */
R
roo00 已提交
954 955
        this.getAction( function( ){
            this.action.checkPassword( password, function( json ){
NoSubject's avatar
NoSubject 已提交
956
                if(callback)callback( json.data.value );
R
roo00 已提交
957 958
            }.bind(this), null, false );
        }.bind(this) );
NoSubject's avatar
NoSubject 已提交
959 960 961
    },
    getPasswordComplex : function(pwd){
        if( typeof pwd != "string")
R
roo00 已提交
962
            return false;
NoSubject's avatar
NoSubject 已提交
963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027
        var sum = 0;
        /*
        5 分: 小于 8 个字符
        10 分: 8 到 10 个字符
        25 分: 大于 10 个字符
        */
        if(pwd.length<8){
            sum += 5;
        }else if(pwd.length<=10){
            sum += 10;
        }else{
            sum += 25;
        }
        /*
        0 分: 没有字母
        10 分: 全都是小(大)写字母
        25 分: 大小写混合字母
        */
        var lowerReg = /[a-z]/;
        var uperReg = /[A-Z]/;
        if(pwd.match(lowerReg)&&pwd.match(uperReg)){
            sum += 25;
        }else if(!pwd.match(lowerReg)&&!pwd.match(uperReg)){
            sum += 0;
        }else{
            sum += 10;
        }
        /*
        0 分: 没有数字
        10 分: 1或2个数字
        20 分: 大于 2 个数字
        */
        var numReg = /[0-9]/;
        var langReg = /[0-9]{3,}/;
        if(pwd.match(langReg)){
            sum += 20;
        }else if(pwd.match(numReg)){
            sum += 10;
        }else{
            sum += 0;
        }
        return sum;
    },
    checkPassowrdStrength: function(pwd){
        var i = (this.inBrowser||layout.viewMode=="Default")? 3 : 4;
        var passwordStrengthNode = this.tab.pages[i].contentNode.getElement(".o2_profile_passwordStrengthArea");
        var passwordRemindNode =  this.tab.pages[i].contentNode.getElement(".o2_profile_passwordRemindNode");

        var nodes = passwordStrengthNode.getElements(".o2_profile_passwordStrengthColor");
        var lowColorNode = nodes[0];
        var middleColorNode = nodes[1];
        var highColorNode = nodes[2];
        nodes = passwordStrengthNode.getElements(".o2_profile_passwordStrengthText");
        var lowTextNode = nodes[0];
        var middleTextNode = nodes[1];
        var highTextNode = nodes[2];

        lowColorNode.removeClass("o2_profile_passwordStrengthColor_low");
        middleColorNode.removeClass("o2_profile_passwordStrengthColor_middle");
        highColorNode.removeClass("o2_profile_passwordStrengthColor_high");
        lowTextNode.removeClass("o2_profile_passwordStrengthText_current");
        middleTextNode.removeClass("o2_profile_passwordStrengthText_current");
        highTextNode.removeClass("o2_profile_passwordStrengthText_current");

        if (pwd==null||pwd==''){
R
roo00 已提交
1028
        }else{
NoSubject's avatar
NoSubject 已提交
1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068
            this.getPasswordLevel( pwd, function( result ){
                if(result){
                    passwordRemindNode.addClass("o2_profile_passwordWarmming").set("text",result);
                }else{
                    passwordRemindNode.removeClass("o2_profile_passwordWarmming").set("text",this.lp.paswordRule);
                    var score = this.getPasswordComplex(pwd);

                    if(score<=40){
                        lowColorNode.addClass("o2_profile_passwordStrengthColor_low");
                        lowTextNode.addClass("o2_profile_passwordStrengthText_current");
                    }else if(score<=55){
                        middleColorNode.addClass("o2_profile_passwordStrengthColor_middle");
                        middleTextNode.addClass("o2_profile_passwordStrengthText_current");
                    }else{
                        highColorNode.addClass("o2_profile_passwordStrengthColor_high");
                        highTextNode.addClass("o2_profile_passwordStrengthText_current");
                    }
                }


                /*switch(level) {
                    case 0:
                    case 1:
                    case 2:
                    case 3:
                        lowColorNode.addClass("o2_profile_passwordStrengthColor_low");
                        lowTextNode.addClass("o2_profile_passwordStrengthText_current");
                        break;
                    case 4:
                    case 5:
                    case 6:
                        middleColorNode.addClass("o2_profile_passwordStrengthColor_middle");
                        middleTextNode.addClass("o2_profile_passwordStrengthText_current");
                        break;
                    default:
                        highColorNode.addClass("o2_profile_passwordStrengthColor_high");
                        highTextNode.addClass("o2_profile_passwordStrengthText_current");
                }*/
            }.bind(this) )

R
roo00 已提交
1069 1070 1071
        }
    }
});
NoSubject's avatar
NoSubject 已提交
1072

R
roo00 已提交
1073 1074 1075 1076 1077 1078
/*----2019年8月30日---外出授权---表单*/
MWF.xDesktop.requireApp("Template", "MPopupForm", null, false);
MWF.xApplication.Profile.emPowerPopupForm = new Class({
    Extends : MPopupForm,
    options: {
        "style": "empower",
NoSubject's avatar
NoSubject 已提交
1079 1080
        "width": "550",
        "height": "440",
R
roo00 已提交
1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091
        "hasTop": true,
        "hasIcon": false,
        "hasTopIcon" : false,
        "hasTopContent" : false,
        "draggable": true,
        "maxAction" : true,
        "closeAction": true,
        "isFull" : false,
        "startTime" : null,
        "endTime" : null,
        "isWholeday" : false,
NoSubject's avatar
NoSubject 已提交
1092 1093 1094 1095 1096
        "defaultCalendarId" : "",
        "onPostCreateBottom": function () {

            this.formBottomNode.getElement(".formOkActionNode").addClass("mainColor_bg");
        }
R
roo00 已提交
1097
    },
R
roo00 已提交
1098 1099
    load: function () {
        //重新指定css文件,由于临时用,所以尽可能写一个文件里
1100
        this.cssPath = "../x_component_Profile/$Main/"+this.options.style+"/css.wcss";
R
roo00 已提交
1101
        this._loadCss();
NoSubject's avatar
NoSubject 已提交
1102

R
roo00 已提交
1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115
        this.configData = this.options.configData||{};
        this.lp = this.lp.empower;
        //this.addEvent("queryOk",this.queryOk());

    },
    _createTableContent : function() {

        this.userName = layout.desktop.session.user.distinguishedName;
        this.userId = layout.desktop.session.user.id;
        this.userIdentityList = layout.desktop.session.user.identityList;
        var identityTextList = [];
        var identityList =[];
        this.userIdentityList.each(function(it){
1116 1117
            identityTextList.push(it.name+"("+it.unitName+")");
            identityList.push((it.distinguishedName));
R
roo00 已提交
1118 1119
        });

NoSubject's avatar
NoSubject 已提交
1120
        //this.formTableContainer.setStyle("width","80%");
R
roo00 已提交
1121 1122 1123 1124 1125 1126 1127 1128 1129

        var startTime, endTime, defaultStartDate, defaultStartTime, defaultEndDate, defaultEndTime;
        if( this.data.startTime && this.data.endTime ){
            startTime= this.date = typeOf( this.data.startTime )=="string" ? Date.parse( this.data.startTime ) : this.data.startTime;
            endTime= typeOf( this.data.endTime )=="string" ? Date.parse( this.data.endTime ) : this.data.endTime;
            defaultStartDate = startTime.format("%Y-%m-%d");
            defaultStartTime = startTime.format("%H:%M");
            defaultEndDate = endTime.format("%Y-%m-%d");
            defaultEndTime = endTime.format("%H:%M");
R
roo00 已提交
1130
        }else{
R
roo00 已提交
1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142
            startTime = this.date = new Date().increment("hour",1);
            endTime = startTime.clone().increment("hour",1);
            defaultStartDate = startTime.format("%Y-%m-%d");
            defaultStartTime = startTime.format("%H") + ":00";
            defaultEndDate = endTime.format("%Y-%m-%d");
            defaultEndTime = endTime.format("%H") + ":00";
        }
        var data={};
        this.formTableArea.set("html", this.getHtml());

        MWF.xDesktop.requireApp("Template", "MForm", function () {

NoSubject's avatar
NoSubject 已提交
1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213
            this.form = new MForm(this.formTableArea, data, {
                isEdited: this.isEdited || this.isNew,
                style : "profile",
                itemTemplate: {
                    fromPerson: { text: this.lp.fromPerson,type: "select", isEdited : (identityTextList.length>1),
                        selectText: identityTextList,
                        selectValue: identityList,
                        defaultValue: this.data.fromIdentity||identityList[0],
                        style:{
                            "width": "310px",
                            "height": "36px",
                            "box-shadow": "rgb(153, 153, 153) 0px 0px 0px",
                            "line-height": "36px",
                            "background": "#FFFFFF",
                            "border": "1px solid #DEDEDE",
                            "border-radius": "100px",
                            "font-family": "MicrosoftYaHei",
                            "padding":"0 5px",
                            "font-size": "14px",
                            "color": "#666666",
                            "margin": "0 0 10px 0"
                        }
                    },
                    toPerson: { text: this.lp.toPerson,type: "org", isEdited : this.isEdited || this.isNew, orgType: ["identity"], count : 1, orgWidgetOptions : {
                            "onLoadedInfor": function(item){
                                // this.loadAcceptAndReject( item );
                            }.bind(this)
                        },defaultValue:this.data.toPerson},
                    startDateInput: {
                        text: this.lp.startTime,
                        tType: "date",
                        defaultValue: defaultStartDate,
                        notEmpty: true
                    },
                    startTimeInput: {
                        tType: "time",
                        defaultValue: defaultStartTime,
                        className: ((this.isNew || this.isEdited || 1) ? "inputTimeUnformatWidth" : ""),
                        disable: data.isAllDayEvent
                    },
                    endDateInput: {
                        text: this.lp.completedTime,
                        tType: "date",
                        defaultValue: defaultEndDate,
                        notEmpty: true
                    },
                    endTimeInput: {
                        tType: "time",
                        defaultValue: defaultEndTime,
                        className: ((this.isNew || this.isEdited || 1) ? "inputTimeUnformatWidth" : ""),
                        disable: data.isAllDayEvent
                    },
                    type: {
                        text: this.lp.type, type: "radio",
                        selectText: [this.lp.type_all, this.lp.type_application, this.lp.type_process],
                        //selectText: ["全部", "应用", "流程"],
                        selectValue: ["all", "application", "process"],
                        defaultValue: this.data.type||"all",
                        event :{
                            "click":function(){

                                var type = this.form.getItem("type").getValue();
                                this.formTableArea.getElement("td[item=application]").parentNode.setStyle("display","none");
                                this.formTableArea.getElement("td[item=process]").parentNode.setStyle("display","none");
                                if(type=="all"){
                                    //this.formTableArea.getElement("td[item=application]").parentNode.setStyle("display","");
                                    //this.formTableArea.getElement("td[item=process]").parentNode.setStyle("display","");
                                }else{
                                    this.formTableArea.getElement("td[item="+type+"]").parentNode.setStyle("display","");
                                }
                            }.bind(this)
R
roo00 已提交
1214 1215
                        }
                    }
NoSubject's avatar
NoSubject 已提交
1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228
                },
                onPostLoad:function(){
                    /*样式重构*/
                    this.formTableArea.getElements("td[item=type] div").forEach(function(item){
                        var labelRadio = new Element("label.o2_profile_empower_radio"+(item.getElement("input").get("checked")?".o2_profile_empower_radio__checked.o2_profile_empower_radio_checked":"")).adopt(item.getElement("input")).addEvent("click",function(){

                            this.getParent().getParent().getElements("label").removeClass("o2_profile_empower_radio__checked o2_profile_empower_radio_checked");
                            this.addClass("o2_profile_empower_radio__checked o2_profile_empower_radio_checked");
                        });
                        item.adopt(labelRadio,item.getElement("span"))
                    });
                }.bind(this)
            },this.app,this.css);
R
roo00 已提交
1229
            this.form.load();
NoSubject's avatar
NoSubject 已提交
1230 1231 1232



R
roo00 已提交
1233
        }.bind(this));
NoSubject's avatar
NoSubject 已提交
1234 1235 1236 1237 1238
        /*重构单选框样式
        * */



R
roo00 已提交
1239 1240 1241

        this.applicationNode = this.formTableArea.getElement("td[item=application]");
        //this.applicationNode.empty();
NoSubject's avatar
NoSubject 已提交
1242

R
roo00 已提交
1243 1244 1245
        this.selectApplicationNode = new Element("div.selectNode", {
            width: "30",
            height: "30",
NoSubject's avatar
NoSubject 已提交
1246 1247
        }).inject(this.applicationNode).setStyles(this.css.selectNode).addEvents({
            "hover":function(){
1248
                this.setStyle("background","url(../x_component_Profile/$Main/newVersion/icon_zengjia_blue2_click.png) center center no-repeat");
B
boomEgg 已提交
1249
            },
NoSubject's avatar
NoSubject 已提交
1250
            "blur":function(){
1251
                this.setStyle("background","url(../x_component_Profile/$Main/newVersion/icon_zengjia_blue2.png) center center no-repeat");
NoSubject's avatar
NoSubject 已提交
1252 1253
            }
        });
R
roo00 已提交
1254 1255 1256
        this.showApplicationNode = new Element("div.showNode", {
            width: "200",
            height: "30",
NoSubject's avatar
NoSubject 已提交
1257
            // text: "选择应用"
R
roo00 已提交
1258 1259 1260
        }).inject(this.applicationNode).setStyles(this.css.showNode);
        this.createApplicationSelect(this.showApplicationNode,this.selectApplicationNode,"Application");
        this.processNode = this.formTableArea.getElement("td[item=process]");
R
roo00 已提交
1261

R
roo00 已提交
1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273
        this.selectProcessNode = new Element("div.selectNode", {
            width: "30",
            height: "30",
        }).inject(this.processNode).setStyles(this.css.selectNode);
        this.showProcessNode = new Element("div.showNode", {
            width: "200",
            height: "30",
            //text: "选择流程"
        }).inject(this.processNode).setStyles(this.css.showNode);
        this.createApplicationSelect(this.showProcessNode,this.selectProcessNode,"Process");

    },
NoSubject's avatar
NoSubject 已提交
1274

R
roo00 已提交
1275 1276 1277
    _ok: function (data, callback) {
        //data 是表单的数据, callback 是正确的回调
        //data.
NoSubject's avatar
NoSubject 已提交
1278

R
roo00 已提交
1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305
        var submitData = [];
        //数据处理
        var sdata = {};
        sdata.fromIdentity = data.fromPerson;
        sdata.fromPerson = data.fromPerson.split("@")[0];
        sdata.toIdentity = data.toPerson;
        sdata.toPerson = data.toPerson.split("@")[0];
        sdata.startTime = data.startDateInput+" "+data.startTimeInput+":00";
        sdata.completedTime = data.endDateInput+" "+data.endTimeInput+":00";
        sdata.enable = true;

        if(data.type=="all"){
            sdata.type = data.type;
            submitData.push(sdata);
        }else if(data.type=="application"){
            this.configData["Application"].forEach(function(item){
                var subData = JSON.parse(JSON.stringify(sdata));
                subData["application"] = item.id;
                subData["applicationName"] = item.name;
                subData["applicationAlias"] = item.alias;
                subData.type = "application";
                submitData.push(subData);
            });
        }else if(data.type=="process"){

            this.configData["Process"].forEach(function(item){
                var subData =  JSON.parse(JSON.stringify(sdata));
NoSubject's avatar
NoSubject 已提交
1306

R
roo00 已提交
1307 1308 1309
                subData["process"] = item.id;
                subData["processName"] = item.name;
                subData["processAlias"] = item.alias;
B
boomEgg 已提交
1310
                subData["edition"] = !!item.edition?item.edition:(item.id);
R
roo00 已提交
1311 1312 1313
                subData.type = "process";
                submitData.push(subData);
            });
R
roo00 已提交
1314
        }
NoSubject's avatar
NoSubject 已提交
1315

R
roo00 已提交
1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339
        /*this.saveConfigData=[];
        this.saveConfigCount = submitData.length;*/
        var submitCount=0;
        submitData.forEach(function(item){
            if(this.data.id&&submitCount==0){
                this.actions.editEmPower(this.data.id,item,function(json){
                    submitCount++;
                }.bind(this),null,false);
            }else{
                this.actions.createEmPower(item,function(json){
                    submitCount++;
                }.bind(this),null,false);
            }

        }.bind(this));
        if(!submitData.length){
            this.app.notice( this.lp.alert1 ,"error");
        }

        if(submitCount>0){
            var content = this.container.getElement(".o2_profile_emPower_tab");
            content.getElement("table").empty();
            this.app.loadMyEmPower();
        }
NoSubject's avatar
NoSubject 已提交
1340

R
roo00 已提交
1341 1342 1343 1344 1345 1346 1347 1348 1349 1350
        if(submitData.length&&submitCount==submitData.length){
            //this.close();
            this.app.notice(this.lp.saveOk,"success");
            this.close();
        }else if(submitCount>0){
            this.app.notice(this.lp.saveNotAll,"error");
            this.close();
        }
    },
    createApplicationSelect : function(node,selectNode,type){
NoSubject's avatar
NoSubject 已提交
1351

R
roo00 已提交
1352 1353 1354 1355 1356 1357 1358 1359 1360
        if (this.configData[type]&&this.configData[type].length){
            MWF.require("MWF.widget.O2Identity", function(){
                var p = new MWF.widget.O2Process(this.configData[type][0], node);
            }.bind(this));
        }else{
            this.configData[type]=[];
        }
        selectNode.addEvent("click", function(){
            MWF.xDesktop.requireApp("Selector", "package", function(){
NoSubject's avatar
NoSubject 已提交
1361

R
roo00 已提交
1362 1363 1364 1365 1366 1367 1368 1369
                var options = {
                    "type": type,
                    "values": this.configData[type],
                    "count": 0,
                    "onComplete": function (items) {
                        node.empty();
                        this[type] = {};
                        this.configData[type] = [];
NoSubject's avatar
NoSubject 已提交
1370

R
roo00 已提交
1371 1372 1373 1374 1375 1376 1377
                        items.forEach(function(item,indext){

                            MWF.require("MWF.widget.O2Identity", function(){
                                var p = new MWF.widget.O2Process(item.data, node);
                                this[type] = {
                                    "name": item.data.name,
                                    "id": item.data.id,
B
boomEgg 已提交
1378
                                    "edition":item.data.edition,
R
roo00 已提交
1379 1380 1381 1382 1383
                                    "application": item.data.application,
                                    "applicationName": item.data.applicationName,
                                    "alias": item.data.alias
                                };
                                this.configData[type].include(this[type]);
NoSubject's avatar
NoSubject 已提交
1384

R
roo00 已提交
1385 1386
                            }.bind(this));
                        }.bind(this));
NoSubject's avatar
NoSubject 已提交
1387

R
roo00 已提交
1388 1389 1390 1391 1392 1393 1394 1395 1396
                    }.bind(this)
                };

                var selector = new MWF.O2Selector(this.container, options);

            }.bind(this));
        }.bind(this));
    },
    getHtml : function(){
NoSubject's avatar
NoSubject 已提交
1397
        return  "<table width='100%' bordr='0' cellpadding='0' cellspacing='0' styles='formTable' id='empowerEditTable'>" +
R
roo00 已提交
1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411
            //"<tr><td colspan='2' styles='formTableHead'>申诉处理单</td></tr>" +

            "<tr style='display:"+ (this.userIdentityList.length>1?"":"none")+"'><td styles='formTableTitleRight' lable='fromPerson'></td>" +
            "    <td styles='formTableValue' colspan='2'>" +
            "       <div item='fromPerson'></div>" +
            "   </td>" +
            "</tr>" +
            "<tr><td styles='formTableTitleRight' lable='toPerson'></td>" +
            "    <td styles='formTableValue' colspan='2'>" +
            "       <div item='toPerson'></div>" +
            //"       <div item='selecttoPerson'></div>" +
            "   </td>" +
            "</tr>" +
            "<tr><td styles='formTableTitleRight' width='100' lable='startDateInput'></td>" +
NoSubject's avatar
NoSubject 已提交
1412
            "    <td styles='formTableValue' item='startDateInput' width='205'></td>" +
R
roo00 已提交
1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428
            "    <td styles='formTableValue' item='startTimeInput'></td>" +
            "</tr>" +
            "<tr><td styles='formTableTitleRight' lable='endDateInput'></td>" +
            "    <td styles='formTableValue' item='endDateInput'></td>" +
            "    <td styles='formTableValue' item='endTimeInput'></td>" +
            "</tr>" +
            "<tr><td styles='formTableTitleRight' ></td>" +
            "    <td styles='formTableValue' item='type' colspan='2'></td>" +
            "</tr>" +
            "<tr style='display:"+(this.data.type=="application"?"":"none")+"'><td styles='formTableTitleRight' lable='application'>"+this.lp.application+"</td>" +
            "    <td styles='formTableValue1' item='application' colspan='2'></td>" +
            "</tr>" +
            "<tr style='display:"+(this.data.type=="process"?"":"none")+"'><td styles='formTableTitleRight' lable='process'>"+this.lp.process+"</td>" +
            "    <td styles='formTableValue1' item='process' colspan='2'></td>" +
            "</tr>" +
            "</table>";
R
roo00 已提交
1429
    }
NoSubject's avatar
NoSubject 已提交
1430
});