<commit_before>MWF.xDesktop.requireApp("Attendance", "Explorer", null, false);
MWF.xDesktop.requireApp("Template", "MDomItem", null, false);
MWF.xDesktop.requireApp("Selector", "package", null, false);
MWF.xApplication.Attendance.StatisticsCycle = new Class({
	Extends: MWF.xApplication.Attendance.Explorer,
	Implements: [Options, Events],

    initialize: function(node, app, actions, options){
        this.setOptions(options);
        this.app = app;
        this.path = "../x_component_Attendance/$StatisticsCycle/";
        this.cssPath = "../x_component_Attendance/$StatisticsCycle/"+this.options.style+"/css.wcss";
        this._loadCss();

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

        this.initData();
        if (!this.personActions) this.personActions = new MWF.xAction.org.express.RestActions();
    },
    loadView : function(){
        this.view = new MWF.xApplication.Attendance.StatisticsCycle.View(this.elementContentNode, this.app,this, this.viewData, this.options.searchKey );
        this.view.load();
        this.setContentSize();
    },
    createDocument: function(){
        if(this.view)this.view._createDocument();
    }
});

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

    _getCurrentPageData: function(callback, count){
            this.actions.listCycle(function(json){
                if (callback) callback(json);
            });
    },
    _removeDocument: function(document, all){
        this.actions.deleteCycle(document.id, function(json){
            this.explorer.view.reload();
            this.app.notice(this.app.lp.deleteDocumentOK, "success");
        }.bind(this));
    },
    _createDocument: function(){
        var sc = new MWF.xApplication.Attendance.StatisticsCycle.Form(this.explorer);
        sc.create();
    },
    _openDocument: function( documentData ){
        var sc = new MWF.xApplication.Attendance.StatisticsCycle.Form(this.explorer, documentData );
        sc.edit();
    }

});

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

});


MWF.xApplication.Attendance.StatisticsCycle.Form = new Class({
    Extends: MWF.xApplication.Attendance.Explorer.PopupForm,
    options : {
        "width": 600,
        "height": 600,
        "hasTop" : true,
        "hasBottom" : true,
        "title" : "",
        "draggable" : true,
        "closeAction" : true
    },
    _createTableContent: function(){
        var lp = this.app.lp.schedule;

        var html = "<table width='100%' bordr='0' cellpadding='5' cellspacing='0' styles='formTable'>"+
            "<tr><td colspan='2' styles='formTableHead'>统计周期设置</td></tr>" +
            "<tr><td styles='formTabelTitle' lable='topUnitName'></td>"+
            "    <td styles='formTableValue'>" +
            "       <div item='topUnitName'></div>"+
            "       <div style='font-size: 12px;color: #999;'>双击选择，填写'*'匹配所有公司</div>"+
            "   </td></tr>" +
            "<tr><td styles='formTabelTitle' lable='unitName'></td>"+
            "    <td styles='formTableValue'>" +
            "       <div item='unitName'></div>"+
            "       <div style='font-size: 12px;color: #999;'>双击选择，填写'*'匹配所有部门</div>"+
            "   </td></tr>" +
            "<tr><td styles='formTabelTitle' lable='cycleYear'></td>"+
            "    <td styles='formTableValue' item='cycleYear'></td></tr>" +
            "<tr><td styles='formTabelTitle' lable='cycleMonth'></td>"+
            "    <td styles='formTableValue' item='cycleMonth'></td></tr>" +
            "<tr><td styles='formTabelTitle' lable='cycleStartDateString'></td>"+
            "    <td styles='formTableValue' item='cycleStartDateString'></td></tr>" +
            "<tr><td styles='formTabelTitle' lable='cycleEndDateString'></td>"+
            "    <td styles='formTableValue' item='cycleEndDateString'></td></tr>" +
            "<tr><td styles='formTabelTitle' lable='description'></td>"+
            "    <td styles='formTableValue' item='description'></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 : {
                    topUnitName : { text: "统计公司",  tType : "unit",unsetDefaultEvent : true, event : {
                        dblclick : function(item, ev){
                            item.selectPerson(item.getElements()[0],"","unit")
                        }
                    }},
                    unitName : { text: "统计部门", tType : "unit",unsetDefaultEvent : true, event : {
                        dblclick : function(item, ev){
                            item.selectPerson(item.getElements()[0],"","unit")
                        }
                    } },
                    cycleYear : { text: "统计周期年份", type : "select", notEmpty:true, defaultValue : new Date().getFullYear(), selectValue : function(){
                        var years = [];
                        var year = new Date().getFullYear() + 5;
                        for (var i = 0; i < 10; i++) {
                            years.push(year--);
                        }<commit_msg>考勤，前端修改统计周期设置选部门<commit_after>MWF.xDesktop.requireApp("Attendance", "Explorer", null, false);
MWF.xDesktop.requireApp("Template", "MDomItem", null, false);
MWF.xDesktop.requireApp("Selector", "package", null, false);
MWF.xApplication.Attendance.StatisticsCycle = new Class({
	Extends: MWF.xApplication.Attendance.Explorer,
	Implements: [Options, Events],

    initialize: function(node, app, actions, options){
        this.setOptions(options);
        this.app = app;
        this.path = "../x_component_Attendance/$StatisticsCycle/";
        this.cssPath = "../x_component_Attendance/$StatisticsCycle/"+this.options.style+"/css.wcss";
        this._loadCss();

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

        this.initData();
        if (!this.personActions) this.personActions = new MWF.xAction.org.express.RestActions();
    },
    loadView : function(){
        this.view = new MWF.xApplication.Attendance.StatisticsCycle.View(this.elementContentNode, this.app,this, this.viewData, this.options.searchKey );
        this.view.load();
        this.setContentSize();
    },
    createDocument: function(){
        if(this.view)this.view._createDocument();
    }
});

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

    _getCurrentPageData: function(callback, count){
            this.actions.listCycle(function(json){
                if (callback) callback(json);
            });
    },
    _removeDocument: function(document, all){
        this.actions.deleteCycle(document.id, function(json){
            this.explorer.view.reload();
            this.app.notice(this.app.lp.deleteDocumentOK, "success");
        }.bind(this));
    },
    _createDocument: function(){
        var sc = new MWF.xApplication.Attendance.StatisticsCycle.Form(this.explorer);
        sc.create();
    },
    _openDocument: function( documentData ){
        var sc = new MWF.xApplication.Attendance.StatisticsCycle.Form(this.explorer, documentData );
        sc.edit();
    }

});

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

});


MWF.xApplication.Attendance.StatisticsCycle.Form = new Class({
    Extends: MWF.xApplication.Attendance.Explorer.PopupForm,
    options : {
        "width": 600,
        "height": 600,
        "hasTop" : true,
        "hasBottom" : true,
        "title" : "",
        "draggable" : true,
        "closeAction" : true
    },
    _createTableContent: function(){
        var lp = this.app.lp.schedule;

        var html = "<table width='100%' bordr='0' cellpadding='5' cellspacing='0' styles='formTable'>"+
            "<tr><td colspan='2' styles='formTableHead'>统计周期设置</td></tr>" +
            "<tr><td styles='formTabelTitle' lable='topUnitName'></td>"+
            "    <td styles='formTableValue'>" +
            "       <div item='topUnitName'></div>"+
            "       <div style='font-size: 12px;color: #999;'>双击选择，填写'*'匹配所有公司</div>"+
            "   </td></tr>" +
            "<tr><td styles='formTabelTitle' lable='unitName'></td>"+
            "    <td styles='formTableValue'>" +
            "       <div item='unitName'></div>"+
            "       <div style='font-size: 12px;color: #999;'>双击选择，填写'*'匹配所有部门</div>"+
            "   </td></tr>" +
            "<tr><td styles='formTabelTitle' lable='cycleYear'></td>"+
            "    <td styles='formTableValue' item='cycleYear'></td></tr>" +
            "<tr><td styles='formTabelTitle' lable='cycleMonth'></td>"+
            "    <td styles='formTableValue' item='cycleMonth'></td></tr>" +
            "<tr><td styles='formTabelTitle' lable='cycleStartDateString'></td>"+
            "    <td styles='formTableValue' item='cycleStartDateString'></td></tr>" +
            "<tr><td styles='formTabelTitle' lable='cycleEndDateString'></td>"+
            "    <td styles='formTableValue' item='cycleEndDateString'></td></tr>" +
            "<tr><td styles='formTabelTitle' lable='description'></td>"+
            "    <td styles='formTableValue' item='description'></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 : {
                    topUnitName : { text:"统计公司", type : "org", orgType : "unit" },
                    unitName : { text: "统计部门", type : "org", orgType : "unit" },
                    cycleYear : { text: "统计周期年份", type : "select", notEmpty:true, defaultValue : new Date().getFullYear(), selectValue : function(){
                        var years = [];
                        var year = new Date().getFullYear() + 5;
                        for (var i = 0; i < 10; i++) {
                            years.push(year--);
                        }
{'fraction_non_alphanumeric': 0.1620935914301823, 'fraction_numerical': 0.005262168765269686, 'mean_word_length': 2.40903267136451, 'pattern_counts': {'":': 4, '<': 117, '<?xml version=': 0, '>': 115, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6983133', 'n_tokens_mistral': 3302, 'n_tokens_neox': 3312, 'n_words': 505}