|
|
@@ -14,7 +14,9 @@ |
|
|
|
var clientAsyncData = {}; |
|
|
|
|
|
|
|
var clientData = {}; |
|
|
|
|
|
|
|
var desktopData = {}; |
|
|
|
var sourceData = {}; |
|
|
|
var userData = {}; |
|
|
|
|
|
|
|
function initLoad(callback) { |
|
|
|
var res = loadSate.yes; |
|
|
@@ -278,13 +280,19 @@ |
|
|
|
init: function () { |
|
|
|
if (clientAsyncData.user.states == loadSate.no) { |
|
|
|
clientAsyncData.user.states = loadSate.ing; |
|
|
|
var ver = storage.get("userData").ver || ""; |
|
|
|
//var ver = storage.get("userData").ver || ""; |
|
|
|
var ver = ""; |
|
|
|
if (userData) { |
|
|
|
ver = userData.ver || ""; |
|
|
|
} |
|
|
|
|
|
|
|
learun.httpAsync('GET', top.$.rootUrl + '/LR_OrganizationModule/User/GetMap', { ver: ver }, function (data) { |
|
|
|
if (!data) { |
|
|
|
clientAsyncData.user.states = loadSate.fail; |
|
|
|
} else { |
|
|
|
if (data.ver) { |
|
|
|
storage.set("userData", data); |
|
|
|
userData = data; |
|
|
|
//storage.set("userData", data); |
|
|
|
} |
|
|
|
clientAsyncData.user.states = loadSate.yes; |
|
|
|
clientAsyncData.dataItem.init(); |
|
|
@@ -300,7 +308,8 @@ |
|
|
|
}, 100);// 如果还在加载100ms后再检测 |
|
|
|
} |
|
|
|
else { |
|
|
|
var data = storage.get("userData").data || {}; |
|
|
|
//var data = storage.get("userData").data || {}; |
|
|
|
var data = userData.data || {}; |
|
|
|
var keys = (op.key || '').split(','); |
|
|
|
var array=new Array(); |
|
|
|
if (keys.length > 1) { |
|
|
@@ -325,7 +334,8 @@ |
|
|
|
}, 100);// 如果还在加载100ms后再检测 |
|
|
|
} |
|
|
|
else { |
|
|
|
var data = storage.get("userData").data || {}; |
|
|
|
//var data = storage.get("userData").data || {}; |
|
|
|
var data = userData.data || {}; |
|
|
|
op.callback(data, op); |
|
|
|
} |
|
|
|
} |
|
|
@@ -487,8 +497,9 @@ |
|
|
|
}, 100);// 如果还在加载100ms后再检测 |
|
|
|
} |
|
|
|
else { |
|
|
|
var data = storage.get("sourceData_" + op.code).data || []; |
|
|
|
var data = sourceData["sourceData_" + code] || [];// storage.get("sourceData_" + op.code).data || []; |
|
|
|
if (!!data) { |
|
|
|
//op.callback(sourceData["sourceData_" + code].find(op.key, op.keyId, data) || {}, op); |
|
|
|
op.callback(clientAsyncData.sourceData.find(op.key, op.keyId, data) || {}, op); |
|
|
|
} else { |
|
|
|
op.callback({}, op); |
|
|
@@ -507,7 +518,8 @@ |
|
|
|
}, 100);// 如果还在加载100ms后再检测 |
|
|
|
} |
|
|
|
else if (clientAsyncData.sourceData.states[op.code] == loadSate.yes) { |
|
|
|
var data = storage.get("sourceData_" + op.code).data || []; |
|
|
|
//var data = storage.get("sourceData_" + op.code).data || []; |
|
|
|
var data = sourceData["sourceData_" + op.code].data || []; |
|
|
|
|
|
|
|
if (!!data) { |
|
|
|
op.callback(data, op); |
|
|
@@ -517,13 +529,19 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
load: function (code) { |
|
|
|
var ver = storage.get("sourceData_" + code).ver || ""; |
|
|
|
// var ver = storage.get("sourceData_" + code).ver || ""; |
|
|
|
var ver = ""; |
|
|
|
if (sourceData["sourceData_" + code]) { |
|
|
|
ver = sourceData["sourceData_" + code].ver || ""; |
|
|
|
} |
|
|
|
//var ver = sourceData["sourceData_" + code].ver || "";//storage.get("sourceData_" + code).ver || ""; |
|
|
|
learun.httpAsync('GET', top.$.rootUrl + '/LR_SystemModule/DataSource/GetMap', { code: code, ver: ver }, function (data) { |
|
|
|
if (!data) { |
|
|
|
clientAsyncData.sourceData.states[code] = loadSate.fail; |
|
|
|
} else { |
|
|
|
if (data.ver) { |
|
|
|
storage.set("sourceData_" + code, data); |
|
|
|
sourceData["sourceData_" + code] = data; |
|
|
|
//storage.set("sourceData_" + code, data); |
|
|
|
} |
|
|
|
clientAsyncData.sourceData.states[code] = loadSate.yes; |
|
|
|
} |
|
|
@@ -650,7 +668,7 @@ |
|
|
|
init: function () { |
|
|
|
if (clientAsyncData.desktop.states == loadSate.no) { |
|
|
|
clientAsyncData.desktop.states = loadSate.ing; |
|
|
|
var j = storage.get("desktopData").ver || ""; |
|
|
|
var j = "";//storage.get("desktopData").ver || ""; |
|
|
|
learun.httpAsync("GET", |
|
|
|
top.$.rootUrl + "/LR_Desktop/DTTarget/GetMap", |
|
|
|
{ |
|
|
@@ -661,7 +679,8 @@ |
|
|
|
clientAsyncData.desktop.states = loadSate.fail; |
|
|
|
} else { |
|
|
|
if (k.ver) { |
|
|
|
storage.set("desktopData", k); |
|
|
|
desktopData = k; |
|
|
|
//storage.set("desktopData", k); |
|
|
|
} |
|
|
|
clientAsyncData.desktop.states = loadSate.yes; |
|
|
|
clientAsyncData.department.init(); |
|
|
@@ -675,7 +694,7 @@ |
|
|
|
clientAsyncData.desktop.get(k); |
|
|
|
}, 100) |
|
|
|
} else { |
|
|
|
var j = storage.get("desktopData").data || {}; |
|
|
|
var j = desktopData;//storage.get("desktopData").data || {}; |
|
|
|
k.callback(j || {}, k); |
|
|
|
} |
|
|
|
} |
|
|
|