.
This commit is contained in:
@@ -4,6 +4,8 @@ if (typeof ($assetsummary) != "function") {
|
||||
var assetIconCollapsed = false;
|
||||
var alertsCollapsed = false;
|
||||
var infowindowScrollTop = 0;
|
||||
var assetInfoCache = [];
|
||||
var assetExtCache = [];
|
||||
$assetsummary = function (p, cid, assetid, alerttips, type, assets) {//type 0.left;1.bottom
|
||||
if (typeof p === "string")
|
||||
p = $("#" + p);
|
||||
@@ -53,7 +55,7 @@ if (typeof ($assetsummary) != "function") {
|
||||
//this.maskbgctrl = $('<div class="maskbg"><div class="loading_icon icon c-spin"></div></div>');
|
||||
//p.append(this.maskbgctrl);
|
||||
|
||||
this.loadingicon = $('<span class="loading c-spin" style="top: 60px;right: 13px;font-size: 20px;color: black;position: absolute;left:unset;width:unset;height:unset;line-height:unset;"></span>');
|
||||
this.loadingicon = $('<span class="loading c-spin" style="top: 60px;right: 13px;font-size: 20px;color: black;position: absolute;left:unset;width:unset;height:unset;line-height:unset;display:none;"></span>');
|
||||
p.append(this.loadingicon);
|
||||
|
||||
this.loadingCount = 0;
|
||||
@@ -75,6 +77,10 @@ if (typeof ($assetsummary) != "function") {
|
||||
loadAssetExtInfo();
|
||||
}
|
||||
|
||||
this.clearCache = function () {
|
||||
assetInfoCache = [];
|
||||
assetExtCache = [];
|
||||
}
|
||||
|
||||
if (this.assetid) {
|
||||
loadAssetInfo();
|
||||
@@ -545,6 +551,13 @@ if (typeof ($assetsummary) != "function") {
|
||||
}
|
||||
|
||||
function loadAssetInfo() {
|
||||
var asset = assetInfoCache['' + _this.assetid];
|
||||
if (asset) {
|
||||
_this.asset = asset;
|
||||
if (_this.status == 0)
|
||||
showAssetInfo();
|
||||
return;
|
||||
}
|
||||
_this.showLoading();
|
||||
devicerequest('GetAssetSummaryInfo', _this.companyid + String.fromCharCode(170) + _this.assetid, function (data) {
|
||||
_this.hideLoading();
|
||||
@@ -553,6 +566,7 @@ if (typeof ($assetsummary) != "function") {
|
||||
return;
|
||||
}
|
||||
_this.asset = data;
|
||||
assetInfoCache['' + _this.assetid] = data;
|
||||
if (_this.status == 0)
|
||||
showAssetInfo();
|
||||
}, function () {
|
||||
@@ -561,6 +575,13 @@ if (typeof ($assetsummary) != "function") {
|
||||
}
|
||||
|
||||
function loadAssetExtInfo() {
|
||||
var ext = assetExtCache['' + _this.assetid];
|
||||
if (ext) {
|
||||
_this.assetext = ext;
|
||||
if (_this.status == 0 && _this.asset)
|
||||
showAssetExtInfo(_this.assetext);
|
||||
return;
|
||||
}
|
||||
_this.showLoading();
|
||||
devicerequest('GetAssetExtInfo', _this.companyid + String.fromCharCode(170) + _this.assetid, function (data) {
|
||||
_this.hideLoading();
|
||||
@@ -568,6 +589,7 @@ if (typeof ($assetsummary) != "function") {
|
||||
return;
|
||||
}
|
||||
_this.assetext = data;
|
||||
assetExtCache['' + _this.assetid] = data;
|
||||
if (_this.status == 0 && _this.asset)
|
||||
showAssetExtInfo(_this.assetext);
|
||||
}, function () {
|
||||
|
Reference in New Issue
Block a user