This commit is contained in:
2024-03-26 15:56:31 +08:00
parent 634e8b71ab
commit 0855ae42cd
547 changed files with 94818 additions and 60463 deletions

View File

@@ -6,13 +6,18 @@ if (typeof ($assetsummary) != "function") {
var infowindowScrollTop = 0;
var assetInfoCache = [];
var assetExtCache = [];
$assetsummary = function (p, cid, assetid, alerttips, type, assets) {//type 0.left;1.bottom
function clearAssetsummaryCache() {
assetInfoCache = [];
assetExtCache = [];
}
$assetsummary = function (p, cid, assetid, viewalerttypes, alerttips, type, assets) {//type 0.left;1.bottom
if (typeof p === "string")
p = $("#" + p);
if (!p)
p = document;
this.companyid = cid || "";
this.assetid = assetid;
this.viewalerttypes = viewalerttypes;
this.alerttips = alerttips;
this.type = type;
this.assets = assets;
@@ -378,16 +383,17 @@ if (typeof ($assetsummary) != "function") {
div_summary.append(br);
if (asset.Description && asset.Description !== "") {
asset.Description = replaceHtmlText(asset.Description);
b = $('<b>' + GetTextByKey("P_MV_DESCRIPTION_COLON", "Description:") + ' </b>');
div_summary.append(b);
label = $('<label></label>').html(asset.Description);
//label = $('<label></label>').html(replaceHtmlText(asset.Description));
label = $('<label></label>').text(asset.Description);
div_summary.append(label).append(br).append(br);
}
if (_this.alerttips && _this.alerttips !== "") {
var atips = replaceHtmlText(_this.alerttips)
label = $('<label></label>').html(atips);
//var atips = replaceHtmlText(_this.alerttips)
//label = $('<label></label>').html(atips);
label = $('<label></label>').text(_this.alerttips);
div_summary.append(label).append(br);
}
if (canViewAlertsManagement) {
@@ -481,24 +487,20 @@ if (typeof ($assetsummary) != "function") {
if (j === "AlertLocalTime")
r[j] = { DisplayValue: r["AlertLocalTimeStr"], Value: r[j] };
}
var fr = { Values: r };
rows.push(fr);
rows.push(r);
}
_this.grid_alertsdt.setData(rows);
if (_this.grid_alertsdt)
_this.grid_alertsdt.setData(rows);
}
function InitAlertsGridData() {
_this.grid_alertsdt = new GridView('#divalertgrid_' + _this.ctrlindex);
_this.grid_alertsdt.lang = {
all: GetTextByKey("P_GRID_ALL", "(All)"),
ok: GetTextByKey("P_GRID_OK", "OK"),
reset: GetTextByKey("P_GRID_RESET", "Reset")
};
if ($('#divalertgrid_' + _this.ctrlindex).length < 1) return;
_this.grid_alertsdt = createGridView('#divalertgrid_' + _this.ctrlindex);
var list_columns = [
{ name: 'AlertLocalDateStr', caption: GetTextByKey("P_MV_DATE", "Date"), valueIndex: 'AlertLocalDateStr', css: { 'width': 70, 'text-align': 'left' } },
{ name: 'AlertLocalTimeStr', caption: GetTextByKey("P_MV_TIME", "Time"), valueIndex: 'AlertLocalTimeStr', css: { 'width': 75, 'text-align': 'left' } },
{ name: 'Level', caption: GetTextByKey("P_MV_LEVEL", "Level"), valueIndex: 'Level', css: { 'width': 60, 'text-align': 'left' } },
{ name: 'AlertType', caption: GetTextByKey("P_AM_ALERTTYPE", "Alert Type"), valueIndex: 'AlertType', css: { 'width': 60, 'text-align': 'left' } },
{ name: 'Description', caption: GetTextByKey("P_MV_DESCRIPTION", "Description"), valueIndex: 'Description', css: { 'width': 200, 'text-align': 'left' } }
];
var columns = [];
@@ -518,12 +520,6 @@ if (typeof ($assetsummary) != "function") {
_this.grid_alertsdt.canMultiSelect = false;
_this.grid_alertsdt.columns = columns;
_this.grid_alertsdt.init();
_this.grid_alertsdt.selectedrowchanged = function (rowindex) {
var rowdata = _this.grid_alertsdt.source[rowindex];
if (rowdata) {
}
}
}
function devicerequest(method, param, callback, error) {
@@ -583,7 +579,7 @@ if (typeof ($assetsummary) != "function") {
return;
}
_this.showLoading();
devicerequest('GetAssetExtInfo', _this.companyid + String.fromCharCode(170) + _this.assetid, function (data) {
devicerequest('GetAssetExtInfo', _this.companyid + String.fromCharCode(170) + _this.assetid + String.fromCharCode(170) + (_this.viewalerttypes || ""), function (data) {
_this.hideLoading();
if (typeof data === 'string') {
return;