添加项目文件。
This commit is contained in:
56
HT.Cloud.Web/wwwroot/js/framework-clientdata.js
Normal file
56
HT.Cloud.Web/wwwroot/js/framework-clientdata.js
Normal file
@ -0,0 +1,56 @@
|
||||
var clients = {};
|
||||
var currentUser = {};
|
||||
$(function () {
|
||||
if (!!top.clients && top.clients.hasOwnProperty("dataItems")) {
|
||||
clients = top.clients;
|
||||
}
|
||||
else {
|
||||
clients = $.clientsInit();
|
||||
}
|
||||
if (!!top.currentUser && top.clients.hasOwnProperty("F_Id")) {
|
||||
currentUser = top.currentUser;
|
||||
}
|
||||
else {
|
||||
currentUser = $.userInit();
|
||||
}
|
||||
})
|
||||
$.clientsInit = function () {
|
||||
var dataJson = {
|
||||
dataItems: [],
|
||||
authorizeButton: [],
|
||||
authorizeFields: [],
|
||||
moduleFields: [],
|
||||
};
|
||||
var init = function () {
|
||||
$.ajax({
|
||||
url: "/ClientsData/GetClientsDataJson?v=" + new Date().Format("yyyy-MM-dd hh:mm:ss"),
|
||||
type: "get",
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function (data) {
|
||||
dataJson.dataItems = data.dataItems;
|
||||
dataJson.authorizeButton = data.authorizeButton;
|
||||
dataJson.authorizeFields = data.authorizeFields;
|
||||
dataJson.moduleFields = data.moduleFields;
|
||||
}
|
||||
});
|
||||
}
|
||||
init();
|
||||
return dataJson;
|
||||
}
|
||||
$.userInit = function () {
|
||||
var dataJson = {};
|
||||
var init = function () {
|
||||
$.ajax({
|
||||
url: "/ClientsData/GetUserCode?v=" + new Date().Format("yyyy-MM-dd hh:mm:ss"),
|
||||
type: "get",
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function (data) {
|
||||
dataJson = data;
|
||||
}
|
||||
});
|
||||
}
|
||||
init();
|
||||
return dataJson;
|
||||
}
|
Reference in New Issue
Block a user