|
@@ -1,5 +1,5 @@
|
|
|
MWF.xApplication.Attendance = MWF.xApplication.Attendance || {};
|
|
MWF.xApplication.Attendance = MWF.xApplication.Attendance || {};
|
|
|
-MWF.require("MWF.widget.O2Identity", null,false);
|
|
|
|
|
|
|
+MWF.require("MWF.widget.O2Identity", null, false);
|
|
|
//MWF.xDesktop.requireApp("Attendance", "Actions.RestActions", null, false);
|
|
//MWF.xDesktop.requireApp("Attendance", "Actions.RestActions", null, false);
|
|
|
MWF.xDesktop.requireApp("Attendance", "Common", null, false);
|
|
MWF.xDesktop.requireApp("Attendance", "Common", null, false);
|
|
|
MWF.xDesktop.requireApp("Template", "MDomItem", null, false);
|
|
MWF.xDesktop.requireApp("Template", "MDomItem", null, false);
|
|
@@ -12,7 +12,7 @@ MWF.xApplication.Attendance.Main = new Class({
|
|
|
Implements: [Options, Events],
|
|
Implements: [Options, Events],
|
|
|
|
|
|
|
|
options: {
|
|
options: {
|
|
|
- "curNaviId" : null,
|
|
|
|
|
|
|
+ "curNaviId": null,
|
|
|
"style": "default",
|
|
"style": "default",
|
|
|
"name": "Attendance",
|
|
"name": "Attendance",
|
|
|
"icon": "icon.png",
|
|
"icon": "icon.png",
|
|
@@ -22,10 +22,10 @@ MWF.xApplication.Attendance.Main = new Class({
|
|
|
"isMax": true,
|
|
"isMax": true,
|
|
|
"title": MWF.xApplication.Attendance.LP.title
|
|
"title": MWF.xApplication.Attendance.LP.title
|
|
|
},
|
|
},
|
|
|
- onQueryLoad: function(){
|
|
|
|
|
|
|
+ onQueryLoad: function () {
|
|
|
this.lp = MWF.xApplication.Attendance.LP;
|
|
this.lp = MWF.xApplication.Attendance.LP;
|
|
|
},
|
|
},
|
|
|
- loadApplication: function(callback){
|
|
|
|
|
|
|
+ loadApplication: function (callback) {
|
|
|
if (!this.options.isRefresh) {
|
|
if (!this.options.isRefresh) {
|
|
|
this.maxSize(function () {
|
|
this.maxSize(function () {
|
|
|
this.loadLayout();
|
|
this.loadLayout();
|
|
@@ -34,9 +34,10 @@ MWF.xApplication.Attendance.Main = new Class({
|
|
|
this.loadLayout();
|
|
this.loadLayout();
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- loadLayout: function(){
|
|
|
|
|
- this.manageUnits =[];
|
|
|
|
|
|
|
+ loadLayout: function () {
|
|
|
|
|
+ this.manageUnits = [];
|
|
|
this.manageTopUnits = [];
|
|
this.manageTopUnits = [];
|
|
|
|
|
+ this.enableType = "";
|
|
|
|
|
|
|
|
this.restActions = MWF.Actions.get("x_attendance_assemble_control");
|
|
this.restActions = MWF.Actions.get("x_attendance_assemble_control");
|
|
|
this.personActions = MWF.Actions.get("x_organization_assemble_personal");
|
|
this.personActions = MWF.Actions.get("x_organization_assemble_personal");
|
|
@@ -45,263 +46,306 @@ MWF.xApplication.Attendance.Main = new Class({
|
|
|
this.createNode();
|
|
this.createNode();
|
|
|
this.loadApplicationContent();
|
|
this.loadApplicationContent();
|
|
|
},
|
|
},
|
|
|
- isAdmin: function(){
|
|
|
|
|
- return this.isTopUnitManager() || MWF.AC.isAttendanceManager() || MWF.AC.isAdministrator()
|
|
|
|
|
|
|
+ isAdmin: function () {
|
|
|
|
|
+ return this.isTopUnitManager() || MWF.AC.isAttendanceManager() || MWF.AC.isAdministrator()
|
|
|
},
|
|
},
|
|
|
- isUnitManager : function(){
|
|
|
|
|
|
|
+ isUnitManager: function () {
|
|
|
return this.manageUnits.length > 0;
|
|
return this.manageUnits.length > 0;
|
|
|
},
|
|
},
|
|
|
- isTopUnitManager : function(){
|
|
|
|
|
|
|
+ isTopUnitManager: function () {
|
|
|
return this.manageTopUnits.length > 0;
|
|
return this.manageTopUnits.length > 0;
|
|
|
},
|
|
},
|
|
|
- getNameFlag : function(name){
|
|
|
|
|
|
|
+ getNameFlag: function (name) {
|
|
|
var t = typeOf(name);
|
|
var t = typeOf(name);
|
|
|
- if (t==="array"){
|
|
|
|
|
|
|
+ if (t === "array") {
|
|
|
var v = [];
|
|
var v = [];
|
|
|
- name.each(function(id){
|
|
|
|
|
- v.push((typeOf(id)==="object") ? (id.distinguishedName || id.id || id.unique || id.name) : id);
|
|
|
|
|
|
|
+ name.each(function (id) {
|
|
|
|
|
+ v.push((typeOf(id) === "object") ? (id.distinguishedName || id.id || id.unique || id.name) : id);
|
|
|
});
|
|
});
|
|
|
return v;
|
|
return v;
|
|
|
- }else{
|
|
|
|
|
- return [(t==="object") ? (name.distinguishedName || name.id || name.unique || name.name) : name];
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return [(t === "object") ? (name.distinguishedName || name.id || name.unique || name.name) : name];
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- loadController: function(callback){
|
|
|
|
|
- this.restActions.listPermission( function( json ){
|
|
|
|
|
|
|
+ loadController: function (callback) {
|
|
|
|
|
+ this.restActions.listPermission(function (json) {
|
|
|
json.data = json.data || [];
|
|
json.data = json.data || [];
|
|
|
- json.data.each(function(item){
|
|
|
|
|
- if( item.adminLevel == "COMPANY" && item.adminName == layout.desktop.session.user.distinguishedName){
|
|
|
|
|
- this.manageTopUnits.push( item.unitName )
|
|
|
|
|
- }else if( item.adminLevel == "DEPT" && item.adminName == layout.desktop.session.user.distinguishedName ){
|
|
|
|
|
- this.manageUnits.push( item.unitName )
|
|
|
|
|
|
|
+ json.data.each(function (item) {
|
|
|
|
|
+ if (item.adminLevel == "COMPANY" && item.adminName == layout.desktop.session.user.distinguishedName) {
|
|
|
|
|
+ this.manageTopUnits.push(item.unitName)
|
|
|
|
|
+ } else if (item.adminLevel == "DEPT" && item.adminName == layout.desktop.session.user.distinguishedName) {
|
|
|
|
|
+ this.manageUnits.push(item.unitName)
|
|
|
}
|
|
}
|
|
|
}.bind(this));
|
|
}.bind(this));
|
|
|
- if(callback)callback(json);
|
|
|
|
|
|
|
+ if (callback) callback(json);
|
|
|
}.bind(this));
|
|
}.bind(this));
|
|
|
},
|
|
},
|
|
|
- createNode: function(){
|
|
|
|
|
|
|
+ loadEnableType: function (callback) {
|
|
|
|
|
+ var action = o2.Actions.load("x_attendance_assemble_control");
|
|
|
|
|
+ action.AttendanceSettingAction.enableType(//平台封装好的方法
|
|
|
|
|
+ function (json) { //服务调用成功的回调函数, json为服务传回的数据
|
|
|
|
|
+ if (json.data && json.data.value) {
|
|
|
|
|
+ debugger;
|
|
|
|
|
+ this.enableType = json.data.value;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (callback) callback(json);
|
|
|
|
|
+ }.bind(this));
|
|
|
|
|
+ },
|
|
|
|
|
+ createNode: function () {
|
|
|
this.content.setStyle("overflow", "hidden");
|
|
this.content.setStyle("overflow", "hidden");
|
|
|
this.node = new Element("div", {
|
|
this.node = new Element("div", {
|
|
|
- "styles": {"width": "100%", "height": "100%", "overflow": "hidden"}
|
|
|
|
|
|
|
+ "styles": { "width": "100%", "height": "100%", "overflow": "hidden" }
|
|
|
}).inject(this.content);
|
|
}).inject(this.content);
|
|
|
},
|
|
},
|
|
|
- loadApplicationContent: function(){
|
|
|
|
|
- this.loadController(function(){
|
|
|
|
|
- this.loaNavi();
|
|
|
|
|
|
|
+ loadApplicationContent: function () {
|
|
|
|
|
+ this.loadController(function () {
|
|
|
|
|
+ this.loadEnableType(function () {
|
|
|
|
|
+ this.loaNavi();
|
|
|
|
|
+ }.bind(this));
|
|
|
}.bind(this));
|
|
}.bind(this));
|
|
|
//this.loadApplicationLayout();
|
|
//this.loadApplicationLayout();
|
|
|
},
|
|
},
|
|
|
- loaNavi: function(callback){
|
|
|
|
|
|
|
+ loaNavi: function (callback) {
|
|
|
this.naviNode = new Element("div.naviNode", {
|
|
this.naviNode = new Element("div.naviNode", {
|
|
|
"styles": this.css.naviNode
|
|
"styles": this.css.naviNode
|
|
|
}).inject(this.node);
|
|
}).inject(this.node);
|
|
|
|
|
|
|
|
- var curNavi = { "id" : "" };
|
|
|
|
|
- if( this.status ){
|
|
|
|
|
|
|
+ var curNavi = { "id": "" };
|
|
|
|
|
+ if (this.status) {
|
|
|
curNavi.id = this.status.id
|
|
curNavi.id = this.status.id
|
|
|
}
|
|
}
|
|
|
- if( this.options.curNaviId ){
|
|
|
|
|
|
|
+ if (this.options.curNaviId) {
|
|
|
curNavi.id = this.options.curNaviId;
|
|
curNavi.id = this.options.curNaviId;
|
|
|
}
|
|
}
|
|
|
- this.navi = new MWF.xApplication.Attendance.Navi(this, this.naviNode, curNavi );
|
|
|
|
|
|
|
+ this.navi = new MWF.xApplication.Attendance.Navi(this, this.naviNode, curNavi);
|
|
|
},
|
|
},
|
|
|
- clearContent: function(){
|
|
|
|
|
- if (this.explorerContent){
|
|
|
|
|
- if (this.explorer && this.explorer.destroy ){
|
|
|
|
|
|
|
+ clearContent: function () {
|
|
|
|
|
+ if (this.explorerContent) {
|
|
|
|
|
+ if (this.explorer && this.explorer.destroy) {
|
|
|
this.explorer.destroy();
|
|
this.explorer.destroy();
|
|
|
}
|
|
}
|
|
|
this.explorerContent.destroy();
|
|
this.explorerContent.destroy();
|
|
|
this.explorerContent = null;
|
|
this.explorerContent = null;
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- openMyIndex : function(){
|
|
|
|
|
- MWF.xDesktop.requireApp("Attendance", "MyIndex", function(){
|
|
|
|
|
|
|
+ openMyIndex: function () {
|
|
|
|
|
+ MWF.xDesktop.requireApp("Attendance", "MyIndex", function () {
|
|
|
|
|
+ this.clearContent();
|
|
|
|
|
+ this.explorerContent = new Element("div", {
|
|
|
|
|
+ "styles": this.css.rightContentNode
|
|
|
|
|
+ }).inject(this.node);
|
|
|
|
|
+ this.explorer = new MWF.xApplication.Attendance.MyIndex(this.explorerContent, this, this.restActions, { "isAdmin": this.isAdmin() });
|
|
|
|
|
+ this.explorer.load();
|
|
|
|
|
+ }.bind(this));
|
|
|
|
|
+ },
|
|
|
|
|
+ openMyDetail: function () {
|
|
|
|
|
+ MWF.xDesktop.requireApp("Attendance", "MyDetail", function () {
|
|
|
|
|
+ this.clearContent();
|
|
|
|
|
+ this.explorerContent = new Element("div", {
|
|
|
|
|
+ "styles": this.css.rightContentNode
|
|
|
|
|
+ }).inject(this.node);
|
|
|
|
|
+ this.explorer = new MWF.xApplication.Attendance.MyDetail(this.explorerContent, this, this.restActions, { "isAdmin": this.isAdmin() });
|
|
|
|
|
+ this.explorer.load();
|
|
|
|
|
+ }.bind(this));
|
|
|
|
|
+ },
|
|
|
|
|
+ openUnitIndex: function () {
|
|
|
|
|
+ MWF.xDesktop.requireApp("Attendance", "UnitIndex", function () {
|
|
|
|
|
+ this.clearContent();
|
|
|
|
|
+ this.explorerContent = new Element("div", {
|
|
|
|
|
+ "styles": this.css.rightContentNode
|
|
|
|
|
+ }).inject(this.node);
|
|
|
|
|
+ this.explorer = new MWF.xApplication.Attendance.UnitIndex(this.explorerContent, this, this.restActions, { "isAdmin": this.isAdmin() });
|
|
|
|
|
+ this.explorer.load();
|
|
|
|
|
+ }.bind(this));
|
|
|
|
|
+ },
|
|
|
|
|
+ openUnitDingdingIndex: function () {
|
|
|
|
|
+ MWF.xDesktop.requireApp("Attendance", "UnitDingdingIndex", function () {
|
|
|
this.clearContent();
|
|
this.clearContent();
|
|
|
this.explorerContent = new Element("div", {
|
|
this.explorerContent = new Element("div", {
|
|
|
"styles": this.css.rightContentNode
|
|
"styles": this.css.rightContentNode
|
|
|
}).inject(this.node);
|
|
}).inject(this.node);
|
|
|
- this.explorer = new MWF.xApplication.Attendance.MyIndex(this.explorerContent, this, this.restActions,{"isAdmin":this.isAdmin() } );
|
|
|
|
|
|
|
+ this.explorer = new MWF.xApplication.Attendance.UnitDingdingIndex(this.explorerContent, this, this.restActions, { "isAdmin": this.isAdmin() });
|
|
|
this.explorer.load();
|
|
this.explorer.load();
|
|
|
}.bind(this));
|
|
}.bind(this));
|
|
|
},
|
|
},
|
|
|
- openMyDetail : function(){
|
|
|
|
|
- MWF.xDesktop.requireApp("Attendance", "MyDetail", function(){
|
|
|
|
|
|
|
+ openUnitDetail: function () {
|
|
|
|
|
+ MWF.xDesktop.requireApp("Attendance", "UnitDetail", function () {
|
|
|
this.clearContent();
|
|
this.clearContent();
|
|
|
this.explorerContent = new Element("div", {
|
|
this.explorerContent = new Element("div", {
|
|
|
"styles": this.css.rightContentNode
|
|
"styles": this.css.rightContentNode
|
|
|
}).inject(this.node);
|
|
}).inject(this.node);
|
|
|
- this.explorer = new MWF.xApplication.Attendance.MyDetail(this.explorerContent, this, this.restActions,{"isAdmin":this.isAdmin() } );
|
|
|
|
|
|
|
+ this.explorer = new MWF.xApplication.Attendance.UnitDetail(this.explorerContent, this, this.restActions, { "isAdmin": this.isAdmin() });
|
|
|
this.explorer.load();
|
|
this.explorer.load();
|
|
|
}.bind(this));
|
|
}.bind(this));
|
|
|
},
|
|
},
|
|
|
- openUnitIndex : function(){
|
|
|
|
|
- MWF.xDesktop.requireApp("Attendance", "UnitIndex", function(){
|
|
|
|
|
|
|
+ openDingdingUnitDetail: function () {
|
|
|
|
|
+ MWF.xDesktop.requireApp("Attendance", "UnitDingdingDetail", function () {
|
|
|
this.clearContent();
|
|
this.clearContent();
|
|
|
this.explorerContent = new Element("div", {
|
|
this.explorerContent = new Element("div", {
|
|
|
"styles": this.css.rightContentNode
|
|
"styles": this.css.rightContentNode
|
|
|
}).inject(this.node);
|
|
}).inject(this.node);
|
|
|
- this.explorer = new MWF.xApplication.Attendance.UnitIndex(this.explorerContent, this, this.restActions,{"isAdmin":this.isAdmin() } );
|
|
|
|
|
|
|
+ this.explorer = new MWF.xApplication.Attendance.UnitDingdingDetail(this.explorerContent, this, this.restActions, { "isAdmin": this.isAdmin() });
|
|
|
this.explorer.load();
|
|
this.explorer.load();
|
|
|
}.bind(this));
|
|
}.bind(this));
|
|
|
},
|
|
},
|
|
|
- openUnitDetail : function(){
|
|
|
|
|
- MWF.xDesktop.requireApp("Attendance", "UnitDetail", function(){
|
|
|
|
|
|
|
+ openPeopleDetail: function () {
|
|
|
|
|
+ MWF.xDesktop.requireApp("Attendance", "PeopleDetail", function () {
|
|
|
this.clearContent();
|
|
this.clearContent();
|
|
|
this.explorerContent = new Element("div", {
|
|
this.explorerContent = new Element("div", {
|
|
|
"styles": this.css.rightContentNode
|
|
"styles": this.css.rightContentNode
|
|
|
}).inject(this.node);
|
|
}).inject(this.node);
|
|
|
- this.explorer = new MWF.xApplication.Attendance.UnitDetail(this.explorerContent, this, this.restActions,{"isAdmin":this.isAdmin() } );
|
|
|
|
|
|
|
+ this.explorer = new MWF.xApplication.Attendance.PeopleDetail(this.explorerContent, this, this.restActions, { "isAdmin": this.isAdmin() });
|
|
|
this.explorer.load();
|
|
this.explorer.load();
|
|
|
}.bind(this));
|
|
}.bind(this));
|
|
|
},
|
|
},
|
|
|
- openPeopleDetail : function(){
|
|
|
|
|
- MWF.xDesktop.requireApp("Attendance", "PeopleDetail", function(){
|
|
|
|
|
|
|
+ openDingdingPeopleDetail: function () {
|
|
|
|
|
+ MWF.xDesktop.requireApp("Attendance", "PeopleDingdingDetail", function () {
|
|
|
this.clearContent();
|
|
this.clearContent();
|
|
|
this.explorerContent = new Element("div", {
|
|
this.explorerContent = new Element("div", {
|
|
|
"styles": this.css.rightContentNode
|
|
"styles": this.css.rightContentNode
|
|
|
}).inject(this.node);
|
|
}).inject(this.node);
|
|
|
- this.explorer = new MWF.xApplication.Attendance.PeopleDetail(this.explorerContent, this, this.restActions,{"isAdmin":this.isAdmin() } );
|
|
|
|
|
|
|
+ this.explorer = new MWF.xApplication.Attendance.PeopleDingdingDetail(this.explorerContent, this, this.restActions, { "isAdmin": this.isAdmin() });
|
|
|
this.explorer.load();
|
|
this.explorer.load();
|
|
|
}.bind(this));
|
|
}.bind(this));
|
|
|
},
|
|
},
|
|
|
- openTopUnitDetail : function(){
|
|
|
|
|
- MWF.xDesktop.requireApp("Attendance", "TopUnitDetail", function(){
|
|
|
|
|
|
|
+ openTopUnitDetail: function () {
|
|
|
|
|
+ MWF.xDesktop.requireApp("Attendance", "TopUnitDetail", function () {
|
|
|
this.clearContent();
|
|
this.clearContent();
|
|
|
this.explorerContent = new Element("div", {
|
|
this.explorerContent = new Element("div", {
|
|
|
"styles": this.css.rightContentNode
|
|
"styles": this.css.rightContentNode
|
|
|
}).inject(this.node);
|
|
}).inject(this.node);
|
|
|
- this.explorer = new MWF.xApplication.Attendance.TopUnitDetail(this.explorerContent, this, this.restActions,{"isAdmin":this.isAdmin() } );
|
|
|
|
|
|
|
+ this.explorer = new MWF.xApplication.Attendance.TopUnitDetail(this.explorerContent, this, this.restActions, { "isAdmin": this.isAdmin() });
|
|
|
this.explorer.load();
|
|
this.explorer.load();
|
|
|
}.bind(this));
|
|
}.bind(this));
|
|
|
},
|
|
},
|
|
|
- openSelfHoliday : function(){
|
|
|
|
|
- MWF.xDesktop.requireApp("Attendance", "SelfHoliday", function(){
|
|
|
|
|
|
|
+ openSelfHoliday: function () {
|
|
|
|
|
+ MWF.xDesktop.requireApp("Attendance", "SelfHoliday", function () {
|
|
|
this.clearContent();
|
|
this.clearContent();
|
|
|
this.explorerContent = new Element("div", {
|
|
this.explorerContent = new Element("div", {
|
|
|
"styles": this.css.rightContentNode
|
|
"styles": this.css.rightContentNode
|
|
|
}).inject(this.node);
|
|
}).inject(this.node);
|
|
|
- this.explorer = new MWF.xApplication.Attendance.SelfHoliday(this.explorerContent, this, this.restActions,{"isAdmin":this.isAdmin() } );
|
|
|
|
|
|
|
+ this.explorer = new MWF.xApplication.Attendance.SelfHoliday(this.explorerContent, this, this.restActions, { "isAdmin": this.isAdmin() });
|
|
|
this.explorer.load();
|
|
this.explorer.load();
|
|
|
}.bind(this));
|
|
}.bind(this));
|
|
|
},
|
|
},
|
|
|
- openMyAppealDeal : function(){
|
|
|
|
|
- MWF.xDesktop.requireApp("Attendance", "MyAppeal", function(){
|
|
|
|
|
|
|
+ openMyAppealDeal: function () {
|
|
|
|
|
+ MWF.xDesktop.requireApp("Attendance", "MyAppeal", function () {
|
|
|
this.clearContent();
|
|
this.clearContent();
|
|
|
this.explorerContent = new Element("div", {
|
|
this.explorerContent = new Element("div", {
|
|
|
"styles": this.css.rightContentNode
|
|
"styles": this.css.rightContentNode
|
|
|
}).inject(this.node);
|
|
}).inject(this.node);
|
|
|
- this.explorer = new MWF.xApplication.Attendance.MyAppeal(this.explorerContent, this, this.restActions,{"isAdmin":this.isAdmin() } );
|
|
|
|
|
|
|
+ this.explorer = new MWF.xApplication.Attendance.MyAppeal(this.explorerContent, this, this.restActions, { "isAdmin": this.isAdmin() });
|
|
|
this.explorer.load();
|
|
this.explorer.load();
|
|
|
}.bind(this));
|
|
}.bind(this));
|
|
|
},
|
|
},
|
|
|
- openAppealDeal : function(){
|
|
|
|
|
- MWF.xDesktop.requireApp("Attendance", "AppealExplorer", function(){
|
|
|
|
|
|
|
+ openAppealDeal: function () {
|
|
|
|
|
+ MWF.xDesktop.requireApp("Attendance", "AppealExplorer", function () {
|
|
|
this.clearContent();
|
|
this.clearContent();
|
|
|
this.explorerContent = new Element("div", {
|
|
this.explorerContent = new Element("div", {
|
|
|
"styles": this.css.rightContentNode
|
|
"styles": this.css.rightContentNode
|
|
|
}).inject(this.node);
|
|
}).inject(this.node);
|
|
|
- this.explorer = new MWF.xApplication.Attendance.AppealExplorer(this.explorerContent, this, this.restActions,{"isAdmin":this.isAdmin() } );
|
|
|
|
|
|
|
+ this.explorer = new MWF.xApplication.Attendance.AppealExplorer(this.explorerContent, this, this.restActions, { "isAdmin": this.isAdmin() });
|
|
|
this.explorer.load();
|
|
this.explorer.load();
|
|
|
}.bind(this));
|
|
}.bind(this));
|
|
|
},
|
|
},
|
|
|
- openImporting : function(){
|
|
|
|
|
- MWF.xDesktop.requireApp("Attendance", "ImportExplorer", function(){
|
|
|
|
|
|
|
+ openImporting: function () {
|
|
|
|
|
+ MWF.xDesktop.requireApp("Attendance", "ImportExplorer", function () {
|
|
|
this.clearContent();
|
|
this.clearContent();
|
|
|
this.explorerContent = new Element("div", {
|
|
this.explorerContent = new Element("div", {
|
|
|
"styles": this.css.rightContentNode
|
|
"styles": this.css.rightContentNode
|
|
|
}).inject(this.node);
|
|
}).inject(this.node);
|
|
|
- this.explorer = new MWF.xApplication.Attendance.ImportExplorer(this.explorerContent, this, this.restActions,{"isAdmin":this.isAdmin() } );
|
|
|
|
|
|
|
+ this.explorer = new MWF.xApplication.Attendance.ImportExplorer(this.explorerContent, this, this.restActions, { "isAdmin": this.isAdmin() });
|
|
|
this.explorer.load();
|
|
this.explorer.load();
|
|
|
}.bind(this));
|
|
}.bind(this));
|
|
|
},
|
|
},
|
|
|
- openImportedInvalidInfor : function(){
|
|
|
|
|
- MWF.xDesktop.requireApp("Attendance", "InvalidInfor", function(){
|
|
|
|
|
|
|
+ openImportedInvalidInfor: function () {
|
|
|
|
|
+ MWF.xDesktop.requireApp("Attendance", "InvalidInfor", function () {
|
|
|
this.clearContent();
|
|
this.clearContent();
|
|
|
this.explorerContent = new Element("div", {
|
|
this.explorerContent = new Element("div", {
|
|
|
"styles": this.css.rightContentNode
|
|
"styles": this.css.rightContentNode
|
|
|
}).inject(this.node);
|
|
}).inject(this.node);
|
|
|
- this.explorer = new MWF.xApplication.Attendance.InvalidInfor(this.explorerContent, this, this.restActions,{"isAdmin":this.isAdmin() } );
|
|
|
|
|
|
|
+ this.explorer = new MWF.xApplication.Attendance.InvalidInfor(this.explorerContent, this, this.restActions, { "isAdmin": this.isAdmin() });
|
|
|
this.explorer.load();
|
|
this.explorer.load();
|
|
|
}.bind(this));
|
|
}.bind(this));
|
|
|
},
|
|
},
|
|
|
- openAbnormalExport : function(){
|
|
|
|
|
- MWF.xDesktop.requireApp("Attendance", "AbnormalExport", function(){
|
|
|
|
|
|
|
+ openAbnormalExport: function () {
|
|
|
|
|
+ MWF.xDesktop.requireApp("Attendance", "AbnormalExport", function () {
|
|
|
this.clearContent();
|
|
this.clearContent();
|
|
|
this.explorerContent = new Element("div", {
|
|
this.explorerContent = new Element("div", {
|
|
|
"styles": this.css.rightContentNode
|
|
"styles": this.css.rightContentNode
|
|
|
}).inject(this.node);
|
|
}).inject(this.node);
|
|
|
- this.explorer = new MWF.xApplication.Attendance.AbnormalExport(this.explorerContent, this, this.restActions,{"isAdmin":this.isAdmin() } );
|
|
|
|
|
|
|
+ this.explorer = new MWF.xApplication.Attendance.AbnormalExport(this.explorerContent, this, this.restActions, { "isAdmin": this.isAdmin() });
|
|
|
this.explorer.load();
|
|
this.explorer.load();
|
|
|
}.bind(this));
|
|
}.bind(this));
|
|
|
},
|
|
},
|
|
|
- openScheduleSetting: function(){
|
|
|
|
|
- MWF.xDesktop.requireApp("Attendance", "ScheduleExplorer", function(){
|
|
|
|
|
|
|
+ openScheduleSetting: function () {
|
|
|
|
|
+ MWF.xDesktop.requireApp("Attendance", "ScheduleExplorer", function () {
|
|
|
this.clearContent();
|
|
this.clearContent();
|
|
|
this.explorerContent = new Element("div", {
|
|
this.explorerContent = new Element("div", {
|
|
|
"styles": this.css.rightContentNode
|
|
"styles": this.css.rightContentNode
|
|
|
}).inject(this.node);
|
|
}).inject(this.node);
|
|
|
- this.explorer = new MWF.xApplication.Attendance.ScheduleExplorer(this.explorerContent, this, this.restActions,{"isAdmin":this.isAdmin() } );
|
|
|
|
|
|
|
+ this.explorer = new MWF.xApplication.Attendance.ScheduleExplorer(this.explorerContent, this, this.restActions, { "isAdmin": this.isAdmin() });
|
|
|
this.explorer.load();
|
|
this.explorer.load();
|
|
|
}.bind(this));
|
|
}.bind(this));
|
|
|
},
|
|
},
|
|
|
- openPermissionSetting: function(){
|
|
|
|
|
- MWF.xDesktop.requireApp("Attendance", "PermissionExplorer", function(){
|
|
|
|
|
|
|
+ openPermissionSetting: function () {
|
|
|
|
|
+ MWF.xDesktop.requireApp("Attendance", "PermissionExplorer", function () {
|
|
|
this.clearContent();
|
|
this.clearContent();
|
|
|
this.explorerContent = new Element("div", {
|
|
this.explorerContent = new Element("div", {
|
|
|
"styles": this.css.rightContentNode
|
|
"styles": this.css.rightContentNode
|
|
|
}).inject(this.node);
|
|
}).inject(this.node);
|
|
|
- this.explorer = new MWF.xApplication.Attendance.PermissionExplorer(this.explorerContent, this, this.restActions,{"isAdmin":this.isAdmin() } );
|
|
|
|
|
|
|
+ this.explorer = new MWF.xApplication.Attendance.PermissionExplorer(this.explorerContent, this, this.restActions, { "isAdmin": this.isAdmin() });
|
|
|
this.explorer.load();
|
|
this.explorer.load();
|
|
|
}.bind(this));
|
|
}.bind(this));
|
|
|
},
|
|
},
|
|
|
- openHolidaySetting : function(){
|
|
|
|
|
- MWF.xDesktop.requireApp("Attendance", "HolidayExplorer", function(){
|
|
|
|
|
|
|
+ openHolidaySetting: function () {
|
|
|
|
|
+ MWF.xDesktop.requireApp("Attendance", "HolidayExplorer", function () {
|
|
|
this.clearContent();
|
|
this.clearContent();
|
|
|
this.explorerContent = new Element("div", {
|
|
this.explorerContent = new Element("div", {
|
|
|
"styles": this.css.rightContentNode
|
|
"styles": this.css.rightContentNode
|
|
|
}).inject(this.node);
|
|
}).inject(this.node);
|
|
|
- this.explorer = new MWF.xApplication.Attendance.HolidayExplorer(this.explorerContent, this, this.restActions,{"isAdmin":this.isAdmin() } );
|
|
|
|
|
|
|
+ this.explorer = new MWF.xApplication.Attendance.HolidayExplorer(this.explorerContent, this, this.restActions, { "isAdmin": this.isAdmin() });
|
|
|
this.explorer.load();
|
|
this.explorer.load();
|
|
|
}.bind(this));
|
|
}.bind(this));
|
|
|
},
|
|
},
|
|
|
- openStaticsCycleExplorer : function(){
|
|
|
|
|
- MWF.xDesktop.requireApp("Attendance", "StatisticsCycle", function(){
|
|
|
|
|
|
|
+ openStaticsCycleExplorer: function () {
|
|
|
|
|
+ MWF.xDesktop.requireApp("Attendance", "StatisticsCycle", function () {
|
|
|
this.clearContent();
|
|
this.clearContent();
|
|
|
this.explorerContent = new Element("div", {
|
|
this.explorerContent = new Element("div", {
|
|
|
"styles": this.css.rightContentNode
|
|
"styles": this.css.rightContentNode
|
|
|
}).inject(this.node);
|
|
}).inject(this.node);
|
|
|
- this.explorer = new MWF.xApplication.Attendance.StatisticsCycle(this.explorerContent, this, this.restActions,{"isAdmin":this.isAdmin() } );
|
|
|
|
|
|
|
+ this.explorer = new MWF.xApplication.Attendance.StatisticsCycle(this.explorerContent, this, this.restActions, { "isAdmin": this.isAdmin() });
|
|
|
this.explorer.load();
|
|
this.explorer.load();
|
|
|
}.bind(this));
|
|
}.bind(this));
|
|
|
},
|
|
},
|
|
|
- openAppSetting : function(){
|
|
|
|
|
- MWF.xDesktop.requireApp("Attendance", "AppSetting", function(){
|
|
|
|
|
- var setting = new MWF.xApplication.Attendance.AppSetting(this,this.restActions);
|
|
|
|
|
|
|
+ openAppSetting: function () {
|
|
|
|
|
+ MWF.xDesktop.requireApp("Attendance", "AppSetting", function () {
|
|
|
|
|
+ var setting = new MWF.xApplication.Attendance.AppSetting(this, this.restActions);
|
|
|
setting.edit();
|
|
setting.edit();
|
|
|
}.bind(this));
|
|
}.bind(this));
|
|
|
},
|
|
},
|
|
|
- openAddressSetting : function(){
|
|
|
|
|
- MWF.xDesktop.requireApp("Attendance", "AddressExplorer", function(){
|
|
|
|
|
|
|
+ openAddressSetting: function () {
|
|
|
|
|
+ MWF.xDesktop.requireApp("Attendance", "AddressExplorer", function () {
|
|
|
this.clearContent();
|
|
this.clearContent();
|
|
|
this.explorerContent = new Element("div", {
|
|
this.explorerContent = new Element("div", {
|
|
|
"styles": this.css.rightContentNode
|
|
"styles": this.css.rightContentNode
|
|
|
}).inject(this.node);
|
|
}).inject(this.node);
|
|
|
- this.explorer = new MWF.xApplication.Attendance.AddressExplorer(this.explorerContent, this, this.restActions,{"isAdmin":this.isAdmin() } );
|
|
|
|
|
|
|
+ this.explorer = new MWF.xApplication.Attendance.AddressExplorer(this.explorerContent, this, this.restActions, { "isAdmin": this.isAdmin() });
|
|
|
this.explorer.load();
|
|
this.explorer.load();
|
|
|
}.bind(this));
|
|
}.bind(this));
|
|
|
},
|
|
},
|
|
|
- openPersonSetting : function(){
|
|
|
|
|
- MWF.xDesktop.requireApp("Attendance", "PersonSetting", function(){
|
|
|
|
|
|
|
+ openPersonSetting: function () {
|
|
|
|
|
+ MWF.xDesktop.requireApp("Attendance", "PersonSetting", function () {
|
|
|
this.clearContent();
|
|
this.clearContent();
|
|
|
this.explorerContent = new Element("div", {
|
|
this.explorerContent = new Element("div", {
|
|
|
"styles": this.css.rightContentNode
|
|
"styles": this.css.rightContentNode
|
|
|
}).inject(this.node);
|
|
}).inject(this.node);
|
|
|
- this.explorer = new MWF.xApplication.Attendance.PersonSetting(this.explorerContent, this, this.restActions,{"isAdmin":this.isAdmin() } );
|
|
|
|
|
|
|
+ this.explorer = new MWF.xApplication.Attendance.PersonSetting(this.explorerContent, this, this.restActions, { "isAdmin": this.isAdmin() });
|
|
|
this.explorer.load();
|
|
this.explorer.load();
|
|
|
}.bind(this));
|
|
}.bind(this));
|
|
|
},
|
|
},
|
|
|
- recordStatus: function(){
|
|
|
|
|
- return this.navi && this.navi.currentItem ? this.navi.currentItem.retrieve("data") : {};
|
|
|
|
|
|
|
+ recordStatus: function () {
|
|
|
|
|
+ return this.navi && this.navi.currentItem ? this.navi.currentItem.retrieve("data") : {};
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
@@ -309,10 +353,10 @@ MWF.xApplication.Attendance.Main = new Class({
|
|
|
|
|
|
|
|
MWF.xApplication.Attendance.Navi = new Class({
|
|
MWF.xApplication.Attendance.Navi = new Class({
|
|
|
Implements: [Options, Events],
|
|
Implements: [Options, Events],
|
|
|
- options : {
|
|
|
|
|
- "id" : ""
|
|
|
|
|
|
|
+ options: {
|
|
|
|
|
+ "id": ""
|
|
|
},
|
|
},
|
|
|
- initialize: function(app, node, options){
|
|
|
|
|
|
|
+ initialize: function (app, node, options) {
|
|
|
this.setOptions(options);
|
|
this.setOptions(options);
|
|
|
this.app = app;
|
|
this.app = app;
|
|
|
this.node = $(node);
|
|
this.node = $(node);
|
|
@@ -324,61 +368,64 @@ MWF.xApplication.Attendance.Navi = new Class({
|
|
|
this.elements = [];
|
|
this.elements = [];
|
|
|
this.load();
|
|
this.load();
|
|
|
},
|
|
},
|
|
|
- load: function(){
|
|
|
|
|
- this.scrollNode = new Element("div.naviScrollNode", { "styles" : this.css.naviScrollNode }).inject( this.node );
|
|
|
|
|
- this.areaNode = new Element("div.naviAreaNode", { "styles" : this.css.naviAreaNode }).inject( this.scrollNode );
|
|
|
|
|
|
|
+ load: function () {
|
|
|
|
|
+ this.scrollNode = new Element("div.naviScrollNode", { "styles": this.css.naviScrollNode }).inject(this.node);
|
|
|
|
|
+ this.areaNode = new Element("div.naviAreaNode", { "styles": this.css.naviAreaNode }).inject(this.scrollNode);
|
|
|
|
|
|
|
|
this.setNodeScroll();
|
|
this.setNodeScroll();
|
|
|
|
|
|
|
|
- var naviUrl = this.app.path+"navi.json";
|
|
|
|
|
- MWF.getJSON(naviUrl, function(json){
|
|
|
|
|
- json.each(function(navi){
|
|
|
|
|
- if( navi.access && navi.access == "admin" ){
|
|
|
|
|
- if( this.app.isAdmin() )this.createNaviNode(navi);
|
|
|
|
|
- }else if( navi.access && navi.access == "admin_dept" ){
|
|
|
|
|
- if( this.app.isUnitManager() || this.app.isAdmin() )this.createNaviNode(navi);
|
|
|
|
|
- }else{
|
|
|
|
|
|
|
+ var naviUrl = this.app.path + "navi.json";
|
|
|
|
|
+ MWF.getJSON(naviUrl, function (json) {
|
|
|
|
|
+ json.each(function (navi) {
|
|
|
|
|
+ if (navi.access && navi.access == "admin") {
|
|
|
|
|
+ if (this.app.isAdmin()) this.createNaviNode(navi);
|
|
|
|
|
+ } else if (navi.access && navi.access == "admin_dept") {
|
|
|
|
|
+ if (this.app.isUnitManager() || this.app.isAdmin()) this.createNaviNode(navi);
|
|
|
|
|
+ } else if (navi.access && navi.access == "dingding") { //启用钉钉考勤同步后
|
|
|
|
|
+ debugger;
|
|
|
|
|
+ if ((this.app.isUnitManager() || this.app.isAdmin()) && (this.app.enableType == "dingding")) this.createNaviNode(navi);
|
|
|
|
|
+ } else {
|
|
|
this.createNaviNode(navi);
|
|
this.createNaviNode(navi);
|
|
|
}
|
|
}
|
|
|
}.bind(this));
|
|
}.bind(this));
|
|
|
- if( this.options.id == "" )this.elements[0].click();
|
|
|
|
|
|
|
+ if (this.options.id == "") this.elements[0].click();
|
|
|
|
|
|
|
|
this.setContentSize();
|
|
this.setContentSize();
|
|
|
|
|
|
|
|
this.app.addEvent("resize", this.setContentSize.bind(this));
|
|
this.app.addEvent("resize", this.setContentSize.bind(this));
|
|
|
}.bind(this));
|
|
}.bind(this));
|
|
|
},
|
|
},
|
|
|
- setNodeScroll: function(){
|
|
|
|
|
- MWF.require("MWF.widget.DragScroll", function(){
|
|
|
|
|
|
|
+ setNodeScroll: function () {
|
|
|
|
|
+ MWF.require("MWF.widget.DragScroll", function () {
|
|
|
new MWF.widget.DragScroll(this.scrollNode);
|
|
new MWF.widget.DragScroll(this.scrollNode);
|
|
|
}.bind(this));
|
|
}.bind(this));
|
|
|
- MWF.require("MWF.widget.ScrollBar", function(){
|
|
|
|
|
- new MWF.widget.ScrollBar(this.scrollNode, {"indent": false});
|
|
|
|
|
|
|
+ MWF.require("MWF.widget.ScrollBar", function () {
|
|
|
|
|
+ new MWF.widget.ScrollBar(this.scrollNode, { "indent": false });
|
|
|
}.bind(this));
|
|
}.bind(this));
|
|
|
},
|
|
},
|
|
|
- createNaviNode :function(data){
|
|
|
|
|
- if( data.type == "sep" ){
|
|
|
|
|
|
|
+ createNaviNode: function (data) {
|
|
|
|
|
+ if (data.type == "sep") {
|
|
|
var flag = true;
|
|
var flag = true;
|
|
|
- if( data.access == "admin" ){
|
|
|
|
|
- if( !this.app.isAdmin() )flag = false;
|
|
|
|
|
- }else if( data.access && data.access == "admin_dept" ){
|
|
|
|
|
- if( !this.app.isUnitManager() && !this.app.isAdmin() )flag = false;
|
|
|
|
|
|
|
+ if (data.access == "admin") {
|
|
|
|
|
+ if (!this.app.isAdmin()) flag = false;
|
|
|
|
|
+ } else if (data.access && data.access == "admin_dept") {
|
|
|
|
|
+ if (!this.app.isUnitManager() && !this.app.isAdmin()) flag = false;
|
|
|
}
|
|
}
|
|
|
- if( flag ){
|
|
|
|
|
|
|
+ if (flag) {
|
|
|
new Element("div", { "styles": this.css.viewNaviSepartorNode }).inject(this.areaNode);
|
|
new Element("div", { "styles": this.css.viewNaviSepartorNode }).inject(this.areaNode);
|
|
|
}
|
|
}
|
|
|
- }else if( data.sub && data.sub.length > 0 ){
|
|
|
|
|
|
|
+ } else if (data.sub && data.sub.length > 0) {
|
|
|
this.createNaviMenuNode(data);
|
|
this.createNaviMenuNode(data);
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
this.menus[data.id] = {};
|
|
this.menus[data.id] = {};
|
|
|
this.createNaviItemNode(data, data.id);
|
|
this.createNaviItemNode(data, data.id);
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- createNaviMenuNode :function(data){
|
|
|
|
|
- if( data.access == "admin" ){
|
|
|
|
|
- if( !this.app.isAdmin() )return;
|
|
|
|
|
- }else if(data.access == "admin_dept"){
|
|
|
|
|
- if( !this.app.isUnitManager() && !this.app.isAdmin() )return;
|
|
|
|
|
|
|
+ createNaviMenuNode: function (data) {
|
|
|
|
|
+ if (data.access == "admin") {
|
|
|
|
|
+ if (!this.app.isAdmin()) return;
|
|
|
|
|
+ } else if (data.access == "admin_dept") {
|
|
|
|
|
+ if (!this.app.isUnitManager() && !this.app.isAdmin()) return;
|
|
|
}
|
|
}
|
|
|
var _self = this;
|
|
var _self = this;
|
|
|
var menuNode = new Element("div", {
|
|
var menuNode = new Element("div", {
|
|
@@ -387,7 +434,7 @@ MWF.xApplication.Attendance.Navi = new Class({
|
|
|
menuNode.store("data", data);
|
|
menuNode.store("data", data);
|
|
|
menuNode.store("type", "menu");
|
|
menuNode.store("type", "menu");
|
|
|
|
|
|
|
|
- var textNode = new Element("div", {
|
|
|
|
|
|
|
+ var textNode = new Element("div", {
|
|
|
"styles": this.css.naviMenuTextNode,
|
|
"styles": this.css.naviMenuTextNode,
|
|
|
"text": data.title
|
|
"text": data.title
|
|
|
});
|
|
});
|
|
@@ -399,54 +446,54 @@ MWF.xApplication.Attendance.Navi = new Class({
|
|
|
this.elements.push(menuNode);
|
|
this.elements.push(menuNode);
|
|
|
|
|
|
|
|
menuNode.addEvents({
|
|
menuNode.addEvents({
|
|
|
- "mouseover": function(){ if (_self.currentMenu!=this) this.setStyles(_self.app.css.naviMenuNode_over);},
|
|
|
|
|
- "mouseout": function(){if (_self.currentMenu!=this) this.setStyles(_self.app.css.naviMenuNode);},
|
|
|
|
|
- "mousedown": function(){if (_self.currentMenu!=this) this.setStyles(_self.app.css.naviMenuNode_down);},
|
|
|
|
|
- "mouseup": function(){if (_self.currentMenu!=this) this.setStyles(_self.app.css.naviMenuNode_over);},
|
|
|
|
|
- "click": function(){
|
|
|
|
|
|
|
+ "mouseover": function () { if (_self.currentMenu != this) this.setStyles(_self.app.css.naviMenuNode_over); },
|
|
|
|
|
+ "mouseout": function () { if (_self.currentMenu != this) this.setStyles(_self.app.css.naviMenuNode); },
|
|
|
|
|
+ "mousedown": function () { if (_self.currentMenu != this) this.setStyles(_self.app.css.naviMenuNode_down); },
|
|
|
|
|
+ "mouseup": function () { if (_self.currentMenu != this) this.setStyles(_self.app.css.naviMenuNode_over); },
|
|
|
|
|
+ "click": function () {
|
|
|
//if (_self.currentNavi!=this) _self.doAction.apply(_self, [this]);
|
|
//if (_self.currentNavi!=this) _self.doAction.apply(_self, [this]);
|
|
|
_self.clickMenu.apply(_self, [this]);
|
|
_self.clickMenu.apply(_self, [this]);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- data.sub.each(function( d ){
|
|
|
|
|
- this.createNaviItemNode( d, data.id, menuNode )
|
|
|
|
|
|
|
+ data.sub.each(function (d) {
|
|
|
|
|
+ this.createNaviItemNode(d, data.id, menuNode)
|
|
|
}.bind(this))
|
|
}.bind(this))
|
|
|
},
|
|
},
|
|
|
- clickMenu: function(naviNode) {
|
|
|
|
|
|
|
+ clickMenu: function (naviNode) {
|
|
|
var navi = naviNode.retrieve("data");
|
|
var navi = naviNode.retrieve("data");
|
|
|
var action = navi.action;
|
|
var action = navi.action;
|
|
|
|
|
|
|
|
this.closeCurrentMenu();
|
|
this.closeCurrentMenu();
|
|
|
- if( this.menus[navi.id].itemNodes ) {
|
|
|
|
|
- this.menus[navi.id].itemNodes.each( function(itemNode){
|
|
|
|
|
- itemNode.setStyle("display","block");
|
|
|
|
|
|
|
+ if (this.menus[navi.id].itemNodes) {
|
|
|
|
|
+ this.menus[navi.id].itemNodes.each(function (itemNode) {
|
|
|
|
|
+ itemNode.setStyle("display", "block");
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
var type = naviNode.retrieve("type");
|
|
var type = naviNode.retrieve("type");
|
|
|
if (!navi.target || navi.target != "_blank") {
|
|
if (!navi.target || navi.target != "_blank") {
|
|
|
- naviNode.setStyles( this.css.naviMenuNode_current );
|
|
|
|
|
|
|
+ naviNode.setStyles(this.css.naviMenuNode_current);
|
|
|
this.currentMenu = naviNode;
|
|
this.currentMenu = naviNode;
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- closeCurrentMenu:function(){
|
|
|
|
|
- if( this.currentMenu ) {
|
|
|
|
|
|
|
+ closeCurrentMenu: function () {
|
|
|
|
|
+ if (this.currentMenu) {
|
|
|
var data = this.currentMenu.retrieve("data");
|
|
var data = this.currentMenu.retrieve("data");
|
|
|
if (this.menus[data.id].itemNodes) {
|
|
if (this.menus[data.id].itemNodes) {
|
|
|
this.menus[data.id].itemNodes.each(function (itemNode) {
|
|
this.menus[data.id].itemNodes.each(function (itemNode) {
|
|
|
itemNode.setStyle("display", "none");
|
|
itemNode.setStyle("display", "none");
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
- this.currentMenu.setStyles( this.css.naviMenuNode);
|
|
|
|
|
|
|
+ this.currentMenu.setStyles(this.css.naviMenuNode);
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- createNaviItemNode : function( data,menuId ){
|
|
|
|
|
|
|
+ createNaviItemNode: function (data, menuId) {
|
|
|
|
|
|
|
|
- if( data.access == "admin" ){
|
|
|
|
|
- if( !this.app.isAdmin() )return;
|
|
|
|
|
- }else if( data.access && data.access == "admin_dept" ){
|
|
|
|
|
- if( !this.app.isUnitManager() && !this.app.isAdmin() )return;
|
|
|
|
|
|
|
+ if (data.access == "admin") {
|
|
|
|
|
+ if (!this.app.isAdmin()) return;
|
|
|
|
|
+ } else if (data.access && data.access == "admin_dept") {
|
|
|
|
|
+ if (!this.app.isUnitManager() && !this.app.isAdmin()) return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
var _self = this;
|
|
var _self = this;
|
|
@@ -456,13 +503,13 @@ MWF.xApplication.Attendance.Navi = new Class({
|
|
|
var itemNode = new Element("div", {
|
|
var itemNode = new Element("div", {
|
|
|
"styles": this.css.naviItemNode
|
|
"styles": this.css.naviItemNode
|
|
|
});
|
|
});
|
|
|
- itemNode.setStyle("display","block");
|
|
|
|
|
|
|
+ itemNode.setStyle("display", "block");
|
|
|
|
|
|
|
|
items.push(itemNode);
|
|
items.push(itemNode);
|
|
|
itemNode.store("data", data);
|
|
itemNode.store("data", data);
|
|
|
itemNode.store("type", "item");
|
|
itemNode.store("type", "item");
|
|
|
|
|
|
|
|
- var textNode = new Element("div", {
|
|
|
|
|
|
|
+ var textNode = new Element("div", {
|
|
|
"styles": this.css.naviItemTextNode,
|
|
"styles": this.css.naviItemTextNode,
|
|
|
"text": data.title
|
|
"text": data.title
|
|
|
});
|
|
});
|
|
@@ -474,20 +521,20 @@ MWF.xApplication.Attendance.Navi = new Class({
|
|
|
this.items[data.id] = itemNode;
|
|
this.items[data.id] = itemNode;
|
|
|
|
|
|
|
|
itemNode.addEvents({
|
|
itemNode.addEvents({
|
|
|
- "mouseover": function(){ if (_self.currentItem!=this) this.setStyles(_self.app.css.naviItemNode_over);},
|
|
|
|
|
- "mouseout": function(){if (_self.currentItem!=this) this.setStyles(_self.app.css.naviItemNode);},
|
|
|
|
|
- "mousedown": function(){if (_self.currentItem!=this) this.setStyles(_self.app.css.naviItemNode_down);},
|
|
|
|
|
- "mouseup": function(){if (_self.currentItem!=this) this.setStyles(_self.app.css.naviItemNode_over);},
|
|
|
|
|
- "click": function(){
|
|
|
|
|
|
|
+ "mouseover": function () { if (_self.currentItem != this) this.setStyles(_self.app.css.naviItemNode_over); },
|
|
|
|
|
+ "mouseout": function () { if (_self.currentItem != this) this.setStyles(_self.app.css.naviItemNode); },
|
|
|
|
|
+ "mousedown": function () { if (_self.currentItem != this) this.setStyles(_self.app.css.naviItemNode_down); },
|
|
|
|
|
+ "mouseup": function () { if (_self.currentItem != this) this.setStyles(_self.app.css.naviItemNode_over); },
|
|
|
|
|
+ "click": function () {
|
|
|
_self.clickItem.apply(_self, [this]);
|
|
_self.clickItem.apply(_self, [this]);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- if( data.id == this.options.id ){
|
|
|
|
|
|
|
+ if (data.id == this.options.id) {
|
|
|
itemNode.click();
|
|
itemNode.click();
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- clickItem : function(naviNode) {
|
|
|
|
|
|
|
+ clickItem: function (naviNode) {
|
|
|
var navi = naviNode.retrieve("data");
|
|
var navi = naviNode.retrieve("data");
|
|
|
var action = navi.action;
|
|
var action = navi.action;
|
|
|
|
|
|
|
@@ -502,9 +549,9 @@ MWF.xApplication.Attendance.Navi = new Class({
|
|
|
this.app[navi.action].call(this.app, navi);
|
|
this.app[navi.action].call(this.app, navi);
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- setContentSize : function(){
|
|
|
|
|
|
|
+ setContentSize: function () {
|
|
|
var size = this.app.content.getSize();
|
|
var size = this.app.content.getSize();
|
|
|
- this.scrollNode.setStyle("height", size.y - 5 );
|
|
|
|
|
|
|
+ this.scrollNode.setStyle("height", size.y - 5);
|
|
|
}
|
|
}
|
|
|
//loadCalendar: function () {
|
|
//loadCalendar: function () {
|
|
|
// var calendarArea = new Element("div#calendarArea",{
|
|
// var calendarArea = new Element("div#calendarArea",{
|