这是我的封装JS库的代码笔记
;$(function (global, factory) {
var _factoryObj = new factory();
console.dir(global);
global.retroactionUtil = _factoryObj;
}(this, function () {
_thatObj = this;
this.currentUser = '';
this.init = function () {
//获取当前登录人信息
$.ajax({
url: docBaseB + 'dmsCommonFuncController.do?getMyUser',
type: 'post',
async: false,
data: {},
cache: false,
success: function (result) {
var data = stringutils.parseJSONObject(result);
_thatObj.currentUser = data;
},
error: function (e) { // 请求失败处理函数
}
});
}
//-------------------------------------------------------
this.isDccCheck = function (curroles) {
var roles = curroles.toLowerCase();
if (roles.indexOf("dcc") >= 0) {
//是DCC
return true;
} else {
//非DCC
return false;
}
}
this.hideRemove = function (idname) {
$('#' + idname).remove();
}
this.showBtn = function (idname) {
$('#' + idname).show();
}
//参数判断
this.curroles= $('#curroles').val();//角色
//-------------------------------------------------------
/*
* 重发按钮权限:
* 1、DCC人员
* 2、反馈单的申请人
*
* */
this.btnArr = ['resend'];
}));
var MaterialGrid = (function () {
var instance;
function Grid() {
this.init();
this.DataEdit = false;//是否可编辑
}
Grid.prototype = {
init: function () {
},
_editOption:{}
};
return {
getInstance: function () {
if (!instance) {
instance = new Grid();
}
return instance;
}
};
})();