This commit is contained in:
2023-04-28 14:30:46 +08:00
parent c9723008af
commit d831a707ae
4 changed files with 26 additions and 11 deletions
+23 -8
View File
@@ -50,8 +50,23 @@ if (typeof ($assetsummary) != "function") {
p.append(this.basectrl); p.append(this.basectrl);
this.maskbgctrl = $('<div class="maskbg"><div class="loading_icon icon c-spin"></div></div>'); //this.maskbgctrl = $('<div class="maskbg"><div class="loading_icon icon c-spin"></div></div>');
p.append(this.maskbgctrl); //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>');
p.append(this.loadingicon);
this.loadingCount = 0;
this.showLoading = function () {
this.loadingCount++;
this.loadingicon.show();
}
this.hideLoading = function () {
this.loadingCount--;
if (this.loadingCount === 0)
this.loadingicon.hide();
}
this.refresh = function () { this.refresh = function () {
p.parent(".contentPane").unbind(); p.parent(".contentPane").unbind();
@@ -530,8 +545,9 @@ if (typeof ($assetsummary) != "function") {
} }
function loadAssetInfo() { function loadAssetInfo() {
_this.maskbgctrl.show(); _this.showLoading();
devicerequest('GetAssetSummaryInfo', _this.companyid + String.fromCharCode(170) + _this.assetid, function (data) { devicerequest('GetAssetSummaryInfo', _this.companyid + String.fromCharCode(170) + _this.assetid, function (data) {
_this.hideLoading();
if (typeof data === 'string') { if (typeof data === 'string') {
_dialog.showAlert(GetTextByKey("P_SELECTASSETS_FAILEDGETLIST", 'Failed to get the machine list: ') + data, "Asset Summary"); _dialog.showAlert(GetTextByKey("P_SELECTASSETS_FAILEDGETLIST", 'Failed to get the machine list: ') + data, "Asset Summary");
return; return;
@@ -539,24 +555,23 @@ if (typeof ($assetsummary) != "function") {
_this.asset = data; _this.asset = data;
if (_this.status == 0) if (_this.status == 0)
showAssetInfo(); showAssetInfo();
_this.maskbgctrl.hide();
}, function () { }, function () {
_this.maskbgctrl.hide(); _this.hideLoading();
}); });
} }
function loadAssetExtInfo() { function loadAssetExtInfo() {
//_this.maskbgctrl.show(); _this.showLoading();
devicerequest('GetAssetExtInfo', _this.companyid + String.fromCharCode(170) + _this.assetid, function (data) { devicerequest('GetAssetExtInfo', _this.companyid + String.fromCharCode(170) + _this.assetid, function (data) {
_this.hideLoading();
if (typeof data === 'string') { if (typeof data === 'string') {
return; return;
} }
_this.assetext = data; _this.assetext = data;
if (_this.status == 0 && _this.asset) if (_this.status == 0 && _this.asset)
showAssetExtInfo(_this.assetext); showAssetExtInfo(_this.assetext);
//_this.maskbgctrl.hide();
}, function () { }, function () {
//_this.maskbgctrl.hide(); _this.hideLoading();
}); });
} }
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long