.
This commit is contained in:
@ -49,7 +49,7 @@
|
||||
// checkbox
|
||||
name: 'check',
|
||||
key: 'Selected',
|
||||
width: 40,
|
||||
width: 45,
|
||||
align: 'center',
|
||||
sortable: false,
|
||||
allcheck: true,
|
||||
@ -125,53 +125,57 @@
|
||||
allowFilter: true,
|
||||
styleFilter: styleFilter,
|
||||
bgFilter: bgFilter
|
||||
},
|
||||
{
|
||||
key: 'AcquisitionType',
|
||||
caption: GetTextByKey("P_MA_ACQUISITIONTYPE", "Acquisition Type"),
|
||||
width: 120,
|
||||
allowFilter: true,
|
||||
styleFilter: styleFilter,
|
||||
bgFilter: bgFilter
|
||||
},
|
||||
{
|
||||
key: 'AssetGroups',
|
||||
caption: GetTextByKey("P_JS_ASSETGROUP", "Asset Group"),
|
||||
width: 160,
|
||||
allowFilter: false,
|
||||
styleFilter: styleFilter,
|
||||
bgFilter: bgFilter,
|
||||
filter: function (item) {
|
||||
if (item.AssetGroups)
|
||||
return item.AssetGroups.join(", ");
|
||||
else
|
||||
return "";
|
||||
}
|
||||
},
|
||||
{
|
||||
key: 'Jobsites',
|
||||
caption: GetTextByKey("P_JOBSITE", "Jobsite"),
|
||||
width: 160,
|
||||
allowFilter: false,
|
||||
styleFilter: styleFilter,
|
||||
bgFilter: bgFilter,
|
||||
filter: function (item) {
|
||||
if (item.Jobsites && item.Jobsites.length > 0) {
|
||||
var r = "";
|
||||
for (var i = 0; i < item.Jobsites.length; i++) {
|
||||
r += item.Jobsites[i].Key;
|
||||
if (item.Jobsites[i].Value && item.Jobsites[i].Value != "")
|
||||
r += "(" + item.Jobsites[i].Value + ")";
|
||||
r += ", ";
|
||||
}
|
||||
r = r.substring(0, r.length - 2);
|
||||
return r;
|
||||
}
|
||||
else
|
||||
return "";
|
||||
}
|
||||
}
|
||||
);
|
||||
if (this.jobsiteId == null) {
|
||||
columns.push(
|
||||
{
|
||||
key: 'AcquisitionType',
|
||||
caption: GetTextByKey("P_MA_ACQUISITIONTYPE", "Acquisition Type"),
|
||||
width: 120,
|
||||
allowFilter: true,
|
||||
styleFilter: styleFilter,
|
||||
bgFilter: bgFilter
|
||||
},
|
||||
{
|
||||
key: 'AssetGroups',
|
||||
caption: GetTextByKey("P_JS_ASSETGROUP", "Asset Group"),
|
||||
width: 160,
|
||||
allowFilter: false,
|
||||
styleFilter: styleFilter,
|
||||
bgFilter: bgFilter,
|
||||
filter: function (item) {
|
||||
if (item.AssetGroups)
|
||||
return item.AssetGroups.join(", ");
|
||||
else
|
||||
return "";
|
||||
}
|
||||
},
|
||||
{
|
||||
key: 'Jobsites',
|
||||
caption: GetTextByKey("P_JOBSITE", "Jobsite"),
|
||||
width: 160,
|
||||
allowFilter: false,
|
||||
styleFilter: styleFilter,
|
||||
bgFilter: bgFilter,
|
||||
filter: function (item) {
|
||||
if (item.Jobsites && item.Jobsites.length > 0) {
|
||||
var r = "";
|
||||
for (var i = 0; i < item.Jobsites.length; i++) {
|
||||
r += item.Jobsites[i].Key;
|
||||
if (item.Jobsites[i].Value && item.Jobsites[i].Value != "")
|
||||
r += "(" + item.Jobsites[i].Value + ")";
|
||||
r += ", ";
|
||||
}
|
||||
r = r.substring(0, r.length - 2);
|
||||
return r;
|
||||
}
|
||||
else
|
||||
return "";
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
//grid.canMultiSelect = true;
|
||||
grid.columns = columns;
|
||||
grid.init();
|
||||
@ -233,11 +237,11 @@
|
||||
this.machineList = $('<div style="width: 1188px; height: 400px; margin: 10px 0 4px"></div>').appendTo(content);
|
||||
|
||||
var dialogFunction = $('<div class="dialog-func"></div>').appendTo(dialog);
|
||||
$('<input type="button" value="' + GetTextByKey("P_SELECTASSETS_CANCEL", "Cancel") + '" class="dialog-close" />').appendTo(dialogFunction).css("height", 26);//height与Workspace.css冲突
|
||||
$('<input type="button" value="' + GetTextByKey("P_SELECTASSETS_CANCEL", "Cancel") + '" class="dialog-close" />').appendTo(dialogFunction).css("height", "unset");//height与Workspace.css冲突
|
||||
$('<input type="button" value="' + GetTextByKey("P_SELECTASSETS_OK", "OK") + '" />').click(onOKClick.bind(this)).appendTo(dialogFunction);
|
||||
$('<div class="clear"></div>').appendTo(dialogFunction);
|
||||
|
||||
$('<div class="maskbg" style="display: none"><div class="loading_icon icon c-spin"></div></div>').appendTo(dialog);
|
||||
$('<div class="maskbg" style="display: none"><div class="loading_icon c-spin"></div></div>').appendTo(dialog);
|
||||
|
||||
// init
|
||||
initMachinesGrid.call(this, this.machineList);
|
||||
@ -263,10 +267,10 @@
|
||||
if (this.jobsiteId == null && this.allowhidden) {
|
||||
this.showHidden.prop('checked', false);
|
||||
}
|
||||
dialog.attr('init', '1').showDialog().css({
|
||||
dialog.attr('init', '1').css({
|
||||
'top': (document.documentElement.clientHeight - $('#dialog_machines').height()) / (topRatio || 3),
|
||||
'left': (document.documentElement.clientWidth - $('#dialog_machines').width()) / 2
|
||||
});
|
||||
}).showDialogfixed();
|
||||
this.gridAssets.setData([]);
|
||||
onSearch.call(this);
|
||||
};
|
||||
|
@ -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 () {
|
||||
|
@ -4,7 +4,7 @@ var navigate;
|
||||
|
||||
$(function () {
|
||||
$('#dialog_favorite').dialog(function () {
|
||||
$('#mask_bg').hide();
|
||||
showmaskbg(false);
|
||||
$('.maskbg').hide();
|
||||
});
|
||||
});
|
||||
@ -127,7 +127,7 @@ function saveFavorites(data, issort) {
|
||||
else {
|
||||
if (issort) {
|
||||
$('#dialog_favorite').hideDialog();
|
||||
$('#mask_bg').hide();
|
||||
showmaskbg(false);
|
||||
}
|
||||
refreshFavorites();
|
||||
}
|
||||
@ -543,7 +543,7 @@ function showFavoritesGridList(data) {
|
||||
}
|
||||
|
||||
function openFavoriteDialog() {
|
||||
$('#mask_bg').show();
|
||||
showmaskbg(true);
|
||||
$('#dialog_favorite .dialog-title span.title').text(GetTextByKey("P_FAV_EDITFAVORITES", 'Edit Favorites'));
|
||||
|
||||
$('#dialog_favorite')
|
||||
@ -876,7 +876,7 @@ function createDashboardTitle(menudiv) {
|
||||
}
|
||||
|
||||
function openDashboardsDialog() {
|
||||
$('#mask_bg').show();
|
||||
showmaskbg(true);
|
||||
$('#dialog_dashboards .dialog-title span.title').text(GetTextByKey("P_MAIN_REPORTSDASHBOARDS", 'Reports & Dashboards'));
|
||||
|
||||
$('#dialog_dashboards')
|
||||
@ -901,7 +901,7 @@ function openDashboard() {
|
||||
if (dah.IsChart.Value) {
|
||||
setRecentOpenedDashboard(dah.ID);
|
||||
$('#dialog_dashboards').hideDialog();
|
||||
$('#mask_bg').hide();
|
||||
showmaskbg(false);
|
||||
openFleetChart(dah.ID, dah.Name);
|
||||
}
|
||||
else {
|
||||
|
@ -102,7 +102,12 @@ function loadLanguageRes(ver) {
|
||||
var lang = _fleet.currentLang;
|
||||
if (!lang)
|
||||
lang = "en-us";
|
||||
return loadJsonFromServer(sp + "Languages\\" + lang + ".json?s=" + ver);
|
||||
try {
|
||||
return loadJsonFromServer(sp + "Languages\\" + lang + ".json?s=" + ver);
|
||||
}
|
||||
catch {
|
||||
return loadJsonFromServer(sp + "Languages\\en-us.json?s=" + ver);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
2
Site/js/lib/app.min.css
vendored
2
Site/js/lib/app.min.css
vendored
File diff suppressed because one or more lines are too long
19
Site/js/lib/app.min.js
vendored
19
Site/js/lib/app.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
Site/js/lib/ui.min.css
vendored
2
Site/js/lib/ui.min.css
vendored
File diff suppressed because one or more lines are too long
4
Site/js/lib/ui.min.js
vendored
4
Site/js/lib/ui.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -392,9 +392,8 @@ function getParameterValue(paramid, paramtype) {
|
||||
|
||||
function openSetAlertLayerParameters() {
|
||||
setAlertLayerParameters();
|
||||
$('#mask_bg').show();
|
||||
showmaskbg(true);
|
||||
$('#dialog_parameter .dialog-title span.title').text('Pivots');
|
||||
//$('#mask_bg').show();
|
||||
$('#dialog_parameter')
|
||||
.attr('act', 'edit')
|
||||
.css({
|
||||
@ -411,6 +410,6 @@ function setParameterCompleted() {
|
||||
parametervalues = getAlertLayerParameters();
|
||||
machineObject.searchMachine(false);
|
||||
$('#dialog_parameter').hideDialog();
|
||||
$('#mask_bg').hide();
|
||||
showmaskbg(false);
|
||||
pivotsDialogOpend = false;
|
||||
}
|
||||
|
@ -1,5 +1,8 @@
|
||||
|
||||
var allAssets;
|
||||
var allBasicAssetsObj//当前用户有权限的所有机器缓存对象
|
||||
var allBasicAssetsObj_Timeout = null;
|
||||
var BasicAssetsExpire = false;
|
||||
var allAssets;//当前过滤条件下的全部机器
|
||||
var selectedAsset = undefined;
|
||||
var assetDictionary = [[]];
|
||||
var allGroups;
|
||||
@ -7,6 +10,7 @@ var groupAssets = [[]];
|
||||
var jobsiteAssets = [[]];
|
||||
|
||||
function updateAssets() {
|
||||
|
||||
assetDictionary = [[]];
|
||||
groupAssets = [[]];
|
||||
jobsiteAssets = [[]];
|
||||
@ -69,6 +73,8 @@ if (typeof (AssetObject) != "function") {
|
||||
AssetObject = function (mapHelper) {
|
||||
var isFirstLoad = true;//是否第一次加载,第一次加载需定位
|
||||
var allMachineCheckBox = [];
|
||||
var inGettingAllBasicAssets = false;
|
||||
var inGettingBasicAsset = false;
|
||||
var inSearchingMachine = false;
|
||||
|
||||
var allLocations;
|
||||
@ -468,12 +474,80 @@ if (typeof (AssetObject) != "function") {
|
||||
currentShownIndex = -1;
|
||||
allMachineCheckBox.splice(0, allMachineCheckBox.length);//清空CheckBox数组
|
||||
//this.getMachines(isauto);//getMachines放在loadMapAlertLayer加载完成后执行
|
||||
|
||||
if (allBasicAssetsObj && !BasicAssetsExpire) {
|
||||
this.loadMapAlertLayer(isauto);
|
||||
}
|
||||
else {
|
||||
this.getAssetBasicInfos(function () {
|
||||
_this.loadMapAlertLayer(isauto);
|
||||
});
|
||||
}
|
||||
this.getCompanyLocations();
|
||||
this.loadMapAlertLayer(isauto);
|
||||
|
||||
displayFilerIcon();
|
||||
}
|
||||
|
||||
this.getAssetBasicInfos = function (next) {
|
||||
if (inGettingAllBasicAssets)
|
||||
return;
|
||||
inGettingAllBasicAssets = true;
|
||||
_network.mapviewquery("GetAssetBasicInfos", htmlencode(JSON.stringify([companyids])), function (data) {
|
||||
inGettingAllBasicAssets = false;
|
||||
if (typeof (data) !== "string") {
|
||||
allBasicAssetsObj = new AllBasicAssetsObject();
|
||||
allBasicAssetsObj.setAssets(data);
|
||||
BasicAssetsExpire = false;
|
||||
|
||||
if (allBasicAssetsObj_Timeout)
|
||||
clearTimeout(allBasicAssetsObj_Timeout)
|
||||
allBasicAssetsObj_Timeout = setTimeout(function () {
|
||||
BasicAssetsExpire = true;
|
||||
}, 5 * 60 * 1000);
|
||||
|
||||
if (next)
|
||||
next();
|
||||
}
|
||||
else {
|
||||
showMachineAlert();
|
||||
}
|
||||
}, function () {
|
||||
inGettingAllBasicAssets = false;
|
||||
showMachineAlert();
|
||||
});
|
||||
}
|
||||
|
||||
var notificationAssetQueue = [];
|
||||
this.getAssetBasicInfoByAssets = function (aids) {
|
||||
if (inGettingBasicAsset) {
|
||||
for (var i = 0; i < aids.length; i++) {
|
||||
var aid = aids[i];
|
||||
if (notificationAssetQueue.indexOf(aid) < 0)
|
||||
notificationAssetQueue.push(aid);
|
||||
}
|
||||
return;
|
||||
}
|
||||
inGettingBasicAsset = true;
|
||||
|
||||
_network.mapviewquery("GetAssetBasicInfoByAssets", htmlencode(JSON.stringify([companyids, JSON.stringify(aids)])), function (data) {
|
||||
inGettingBasicAsset = false;
|
||||
if (typeof (data) !== "string") {
|
||||
if (allBasicAssetsObj)
|
||||
allBasicAssetsObj.changeAssets(data);
|
||||
}
|
||||
if (notificationAssetQueue.length > 0) {
|
||||
_this.getAssetBasicInfoByAssets(notificationAssetQueue);
|
||||
notificationAssetQueue = [];
|
||||
}
|
||||
}, function () {
|
||||
inGettingBasicAsset = false;
|
||||
if (notificationAssetQueue.length > 0) {
|
||||
_this.getAssetBasicInfoByAssets(notificationAssetQueue);
|
||||
notificationAssetQueue = [];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.getMachines = function (isauto) {
|
||||
var mal = $("#selMapAlertLayer").val();
|
||||
if (!mal) mal = "";
|
||||
@ -533,40 +607,26 @@ if (typeof (AssetObject) != "function") {
|
||||
}
|
||||
var ss = s.split(String.fromCharCode(170));
|
||||
a.ID = Number(ss[0]);
|
||||
a.VIN = ss[1];
|
||||
a.Name = ss[2];
|
||||
a.Name2 = ss[3];
|
||||
a.Make = ss[4];
|
||||
a.Model = ss[5];
|
||||
a.AssetType = ss[6];
|
||||
a.Latitude = Number(ss[1]);
|
||||
a.Longitude = Number(ss[2]);
|
||||
a.IconUrl = ss[3];
|
||||
a.AlertTips = ss[4];
|
||||
a.Priority = Number(ss[5]);
|
||||
|
||||
a.Latitude = Number(ss[7]);
|
||||
a.Longitude = Number(ss[8]);
|
||||
a.IconUrl = ss[9];
|
||||
a.AlertTips = ss[10];
|
||||
a.Priority = Number(ss[11]);
|
||||
|
||||
if (ss[12] && ss[12] !== "") {
|
||||
a.AssetGroups = ss[12].split(",")
|
||||
if (allBasicAssetsObj) {
|
||||
var ta = allBasicAssetsObj.getAsset(a.ID);
|
||||
if (ta) {
|
||||
a.VIN = ta.VIN;
|
||||
a.DisplayName = ta.Name;
|
||||
a.Make = ta.MakeName;
|
||||
a.Model = ta.ModelName;
|
||||
a.AssetType = ta.TypeName;
|
||||
a.OnRoad = ta.OnRoad;
|
||||
a.Attachment = ta.Attachment;
|
||||
a.AssetGroups = ta.AssetGroups;
|
||||
a.JobSites = ta.JobSites;
|
||||
}
|
||||
}
|
||||
else {
|
||||
a.AssetGroups = [];
|
||||
}
|
||||
|
||||
if (ss[13] && ss[13] !== "") {
|
||||
a.JobSites = ss[13].split(",");
|
||||
}
|
||||
else {
|
||||
a.JobSites = [];
|
||||
}
|
||||
|
||||
a.DisplayName = a.Name2;
|
||||
if (!a.DisplayName || a.DisplayName === "")
|
||||
a.DisplayName = a.Name;
|
||||
if (!a.DisplayName || a.DisplayName === "")
|
||||
a.DisplayName = a.VIN;
|
||||
if (!a.DisplayName || a.DisplayName === "")
|
||||
a.DisplayName = a.ID;
|
||||
|
||||
assets.push(a);
|
||||
}
|
||||
@ -788,7 +848,6 @@ if (typeof (AssetObject) != "function") {
|
||||
|
||||
|
||||
this.getCompanyLocations = function () {
|
||||
var _this = this;
|
||||
_network.mapviewquery("GetCompanyLocations", companyids, function (data) {
|
||||
allLocations = data;
|
||||
if (allLocations && allLocations.length > 0)
|
||||
@ -826,7 +885,6 @@ if (typeof (AssetObject) != "function") {
|
||||
if (!selmal) selmal = userParams.MapAlertLayer;
|
||||
|
||||
var p = companyids + ";" + selmal;
|
||||
var _this = this;
|
||||
_network.mapviewquery("GetMapAlertLayers", p, function (data) {
|
||||
if (data && data.length > 0) {
|
||||
$("#mapAlertLayerDiv").show();
|
||||
@ -845,6 +903,84 @@ if (typeof (AssetObject) != "function") {
|
||||
$('#loadingDiv').hide();
|
||||
});
|
||||
}
|
||||
|
||||
var _websocket;
|
||||
function openmsgwebsocket() {
|
||||
if (typeof MSGWebSocketURL !== "undefined") {
|
||||
_websocket = new $websocket(MSGWebSocketURL);
|
||||
_websocket.onreceive = onmsgreceived;
|
||||
_websocket.connect();
|
||||
}
|
||||
}
|
||||
|
||||
function onmsgreceived(data) {
|
||||
console.log(JSON.stringify(data));
|
||||
if (data) {
|
||||
if (data.Code == "200" || data.Code == "201")//add, update
|
||||
_this.getAssetBasicInfoByAssets([data.Message]);
|
||||
}
|
||||
}
|
||||
|
||||
openmsgwebsocket();
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof AllBasicAssetsObject != "function") {
|
||||
AllBasicAssetsObject = function () {
|
||||
var assetObjArray = [];
|
||||
this.setAssets = function (assets) {
|
||||
var obj = { MaxId: 0, Assets: [] };
|
||||
assetObjArray.push(obj);
|
||||
for (var i = 0; i < assets.length; i++) {
|
||||
var asset = assets[i];
|
||||
if (obj.Assets.length >= 500) {
|
||||
var obj = { MaxId: 0, Assets: [] };
|
||||
assetObjArray.push(obj);
|
||||
}
|
||||
obj.MaxId = asset.Id;
|
||||
obj.Assets.push(asset);
|
||||
}
|
||||
}
|
||||
|
||||
this.getAsset = function (id) {
|
||||
for (var i = 0; i < assetObjArray.length; i++) {
|
||||
var obj = assetObjArray[i];
|
||||
if (obj.MaxId < id)
|
||||
continue;
|
||||
|
||||
for (var j = 0; j < obj.Assets.length; j++) {
|
||||
var asset = obj.Assets[j];
|
||||
if (asset.Id == id)
|
||||
return asset;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.changeAssets = function (assets) {
|
||||
var obj = { MaxId: 0, Assets: [] };
|
||||
assetObjArray.push(obj);
|
||||
for (var i = 0; i < assets.length; i++) {
|
||||
var asset = assets[i];
|
||||
var ta = this.getAsset(asset.Id);
|
||||
if (ta) {
|
||||
Object.assign(ta, asset);
|
||||
}
|
||||
else
|
||||
this.addAsset(asset);
|
||||
}
|
||||
}
|
||||
|
||||
this.addAsset = function (asset) {
|
||||
for (var i = 0; i < assetObjArray.length; i++) {
|
||||
var obj = assetObjArray[i];
|
||||
if (obj.MaxId < asset.Id && i != assetObjArray.length - 1)
|
||||
continue;
|
||||
|
||||
obj.Assets.push(asset);
|
||||
if (asset.Id > obj.MaxId)
|
||||
obj.MaxId = asset.Id;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -862,8 +998,8 @@ var assetHisLocations = [];//历史记录的位置信息
|
||||
function getAssetPopupContent(cid, asset) {
|
||||
var loc = asset.Location;
|
||||
|
||||
var popContent = "<b>" + GetTextByKey("P_MV_NAME_COLON", "Name:") + " </b> " + htmlencode(asset.Name) + "<br/>";
|
||||
popContent += "<b>" + GetTextByKey("P_MV_NAMECUSTOM_COLON", "Name (Custom):") + " </b>" + htmlencode(asset.Name2) + "<br/>";
|
||||
var popContent = "<b>" + GetTextByKey("P_MV_NAME_COLON", "Name:") + " </b> " + htmlencode(asset.DisplayName) + "<br/>";
|
||||
//popContent += "<b>" + GetTextByKey("P_MV_NAMECUSTOM_COLON", "Name (Custom):") + " </b>" + htmlencode(asset.Name2) + "<br/>";
|
||||
popContent += "<b>" + GetTextByKey("P_MV_SN_COLON", "SN:") + " </b>" + asset.VIN + "<br/>";
|
||||
popContent += "<b>" + GetTextByKey("P_MV_MAKE_COLON", "Make:") + " </b>" + asset.Make + "<br/>";
|
||||
popContent += "<b>" + GetTextByKey("P_MV_MODEL_COLON", "Model:") + " </b>" + asset.Model + "<br/>";
|
||||
|
@ -412,9 +412,8 @@ function getParameterValue(paramid, isCriteria) {
|
||||
|
||||
function openSetAlertLayerParameters() {
|
||||
setAlertLayerParameters();
|
||||
$('#mask_bg').show();
|
||||
showmaskbg(true);
|
||||
$('#dialog_parameter .dialog-title span.title').text(GetTextByKey("P_MV_PIVOTS", 'Pivots'));
|
||||
//$('#mask_bg').show();
|
||||
$('#dialog_parameter')
|
||||
.attr('act', 'edit')
|
||||
.css({
|
||||
@ -431,6 +430,6 @@ function setParameterCompleted() {
|
||||
parametervalues = getAlertLayerParameters();
|
||||
assetObject.searchMachine(false);
|
||||
$('#dialog_parameter').hideDialog();
|
||||
$('#mask_bg').hide();
|
||||
showmaskbg(false);
|
||||
pivotsDialogOpend = false;
|
||||
}
|
||||
|
@ -755,6 +755,8 @@ if (typeof (MapHelper) !== "function") {
|
||||
var ps = [];
|
||||
var infowindowassetexist = false;//infowindow显示的机器是否在查询结果里
|
||||
var infowindowassetid = -1;
|
||||
if (toolTipAssetSummary)
|
||||
toolTipAssetSummary.clearCache();
|
||||
if (toolTipAssetSummary && toolTipAssetSummary.status == 0)
|
||||
infowindowassetid = toolTipAssetSummary.assetid;
|
||||
for (var i = 0; i < machines.length; i++) {
|
||||
@ -1006,7 +1008,7 @@ if (typeof (MapHelper) !== "function") {
|
||||
this.locateJobSite = function (js) {
|
||||
var g = machineGraphics["JSID" + js.ID];
|
||||
if (g) {
|
||||
mapObj.MyMap.setExtent(g.geometry.getExtent());
|
||||
mapObj.MyMap.setExtent(g.geometry.getExtent(), true);
|
||||
|
||||
var popContent = "<b>" + GetTextByKey("P_MV_NAME_COLON", "Name:") + " </b>" + htmlencode(js.Name) + "<br/>";
|
||||
popContent += "<b>" + GetTextByKey("P_MV_LATITUDE_COLON", "Latitude:") + " </b>" + js.Latitude + "<br/>";
|
||||
@ -1331,7 +1333,6 @@ if (typeof (MapHelper) !== "function") {
|
||||
from = "1900-1-1";
|
||||
if (!to)
|
||||
to = "2099-12-31";
|
||||
var temp = null;
|
||||
var dtfrom = new Date(from.replace(/-/g, "/").replace("T", " "))
|
||||
var dtto = new Date(to.replace(/-/g, "/").replace("T", " "))
|
||||
for (var i in locationHistoryPolylines) {
|
||||
@ -1340,15 +1341,26 @@ if (typeof (MapHelper) !== "function") {
|
||||
var ldtend = new Date(polyLine.EndTime.replace(/-/g, "/").replace("T", " "));
|
||||
if (ldtstart >= dtfrom && ldtend <= dtto) {
|
||||
var lineGraphic = this.createLocationHistoryLineGraphic(polyLine, color);
|
||||
if (color)
|
||||
lineGraphic.isTrip = true;
|
||||
var oldLineGraphic = locationLineGraphics[i];
|
||||
mapObj.BaseMapLayer.remove(oldLineGraphic);
|
||||
locationLineGraphics[i] = lineGraphic;
|
||||
mapObj.BaseMapLayer.add(lineGraphic);
|
||||
temp = lineGraphic;
|
||||
}
|
||||
}
|
||||
if (temp && color)
|
||||
mapObj.MyMap.setExtent(temp.geometry.getExtent());
|
||||
var tempExtent = null;
|
||||
for (var i in locationLineGraphics) {
|
||||
var g = locationLineGraphics[i];
|
||||
if (g.isTrip) {
|
||||
if (tempExtent == null)
|
||||
tempExtent = g.geometry.getExtent();
|
||||
else
|
||||
tempExtent = tempExtent.union(g.geometry.getExtent());
|
||||
}
|
||||
}
|
||||
if (tempExtent && color)
|
||||
mapObj.MyMap.setExtent(tempExtent, true);
|
||||
}
|
||||
|
||||
this.createLocationHistoryPoint = function (m, point) {
|
||||
@ -1582,7 +1594,7 @@ if (typeof (MapHelper) !== "function") {
|
||||
if (gs[0].geometry.type == "point")
|
||||
mapObj.MyMap.centerAt(gs[0].geometry);
|
||||
else
|
||||
mapObj.MyMap.setExtent(gs[0].geometry.getExtent());
|
||||
mapObj.MyMap.setExtent(gs[0].geometry.getExtent(), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -56,7 +56,6 @@ function onPlayClick(last) {
|
||||
|
||||
function openSetLocationHistory() {
|
||||
$('#dialog_locationhistory .dialog-title span.title').text(GetTextByKey("P_MA_LOCATIONHISTORY", 'Location History'));
|
||||
//$('#mask_bg').show();
|
||||
getLocationPrimaryDataSource();
|
||||
$('#locationhistoryDiv').show();
|
||||
}
|
||||
@ -70,15 +69,13 @@ function locationHistoryClick(e) {
|
||||
|
||||
if (PopupViewShowing) {
|
||||
if (e) {
|
||||
$('#mask_bg').show();
|
||||
showmaskbg(true);
|
||||
$('#dialog_lochis')
|
||||
.css({
|
||||
'top': 50,
|
||||
'right': 100,
|
||||
'bottom': 50,
|
||||
'left': 100,
|
||||
'width': document.documentElement.clientWidth - 200,
|
||||
'height': document.documentElement.clientHeight - 150
|
||||
})
|
||||
.showDialog();
|
||||
.showDialogfixed();
|
||||
execIframeFunc("getlocationhis", [e.data.CompanyID, e.data.ID, e.data.DisplayName], "iframelochis");
|
||||
}
|
||||
return;
|
||||
@ -144,7 +141,8 @@ function locationTimeperiodChange() {
|
||||
$('#dialog_endtimehour').val(setTimeSelect(hours));
|
||||
$('#dialog_endtimeminute').val(setTimeSelect(minutes));
|
||||
}
|
||||
} }
|
||||
}
|
||||
}
|
||||
|
||||
var lastHisFromDT;
|
||||
var lastHisToDT;
|
||||
@ -302,8 +300,7 @@ function isAssetMatch(asset, filter) {
|
||||
filter = filter.toLowerCase();
|
||||
if (asset.ID.toString().indexOf(filter) >= 0
|
||||
|| asset.VIN.toLowerCase().indexOf(filter) >= 0
|
||||
|| asset.Name.toLowerCase().indexOf(filter) >= 0
|
||||
|| asset.Name2.toLowerCase().indexOf(filter) >= 0
|
||||
|| asset.DisplayName.toLowerCase().indexOf(filter) >= 0
|
||||
|| asset.Make.toLowerCase().indexOf(filter) >= 0
|
||||
|| asset.Model.toLowerCase().indexOf(filter) >= 0
|
||||
|| asset.AssetType.toLowerCase().indexOf(filter) >= 0)
|
||||
@ -358,7 +355,7 @@ function openRequestVideoDialog(assetid, logid) {
|
||||
$("#dialog_videoct").prop("checked", false);
|
||||
$("#dialog_videoct").change();
|
||||
|
||||
$('#mask_bg').show();
|
||||
showmaskbg(true);
|
||||
$('#dialog_requestvideo')
|
||||
.attr('act', 'edit')
|
||||
.css({
|
||||
|
@ -5,11 +5,11 @@
|
||||
$("#btnSavedSearches").click(openSavedSearches);
|
||||
$("#btnSaveSearchDetault").click(openSaveSearch);
|
||||
$('#dialog_savedsearches').dialog(function () {
|
||||
$('#mask_bg').hide();
|
||||
showmaskbg(false);
|
||||
});
|
||||
|
||||
$('#dialog_savesearch').dialog(function () {
|
||||
$('#mask_bg').hide();
|
||||
showmaskbg(false);
|
||||
});
|
||||
});
|
||||
|
||||
@ -41,7 +41,7 @@ function showSearchList(grid_dt, data) {
|
||||
|
||||
/**********************Saved Searches***********************************/
|
||||
function openSavedSearches() {
|
||||
$('#mask_bg').show();
|
||||
showmaskbg(true);
|
||||
$('#dialog_savedsearches .dialog-title span.title').text(GetTextByKey("P_MV_SAVEDSEARCHES", 'Saved Searches'));
|
||||
$('#dialog_savedsearches')
|
||||
.attr('act', 'edit')
|
||||
@ -170,7 +170,7 @@ function onLoadSavedSearches(search) {
|
||||
setSavedSearche(search);
|
||||
refreshData();
|
||||
$('#dialog_savedsearches').hideDialog();
|
||||
$('#mask_bg').hide();
|
||||
showmaskbg(false);
|
||||
}
|
||||
|
||||
function setSavedSearche(search) {
|
||||
@ -194,7 +194,7 @@ function setSavedSearche(search) {
|
||||
function openSaveSearch() {
|
||||
$('#savesearch_searchname').val('');
|
||||
$('#savesearch_default').prop('checked', false);
|
||||
$('#mask_bg').show();
|
||||
showmaskbg(true);
|
||||
$('#dialog_savesearch .dialog-title span.title').text(GetTextByKey("P_MV_SAVESEARCH", 'Save Search'));
|
||||
$('#dialog_savesearch')
|
||||
.attr('act', 'edit')
|
||||
@ -295,7 +295,7 @@ function SaveMapViewSearch(item) {
|
||||
$('#savesearch_default').prop('checked', false);
|
||||
_dialog.showAlert(GetTextByKey("P_MV_SAVSUCCESSFULLY", 'Saved successfully.'), GetTextByKey("P_MV_SAVESEARCH", 'Save Search'));
|
||||
$('#dialog_savesearch').hideDialog();
|
||||
$('#mask_bg').hide();
|
||||
showmaskbg(false);
|
||||
}
|
||||
}, function (err) {
|
||||
_dialog.showAlert(GetTextByKey("P_MV_FAILEDTOSAVETHISSEARCH", 'Failed to save this search.'), GetTextByKey("P_MV_SAVESEARCH", 'Save Search'));
|
||||
|
@ -89,18 +89,18 @@ function getShapeFileInfos() {
|
||||
}
|
||||
|
||||
function showConfirm1(msg, title, fok, fcancel) {
|
||||
$('#mask_bg').show();
|
||||
showmaskbg(true);
|
||||
$('#addodomask').show();
|
||||
$('#addenginehoursmask').show();
|
||||
_dialog.showConfirm(msg, title, function (e) {
|
||||
$('#mask_bg').hide();
|
||||
showmaskbg(false);
|
||||
$('#addodomask').hide();
|
||||
$('#addenginehoursmask').hide();
|
||||
if (typeof fok === 'function') {
|
||||
fok(e);
|
||||
}
|
||||
}, function () {
|
||||
$('#mask_bg').hide();
|
||||
showmaskbg(false);
|
||||
$('#addodomask').hide();
|
||||
$('#addenginehoursmask').hide();
|
||||
});
|
||||
@ -114,7 +114,7 @@ function deleteShapeClick(e) {
|
||||
'Key': e.data.CompanyID,
|
||||
'Value': e.data.ID
|
||||
};
|
||||
$('#mask_bg').show();
|
||||
showmaskbg(true);
|
||||
showConfirm1(GetTextByKey("P_MV_DOYOUWANTTODELETETHESHAPEFILE", 'Do you want to delete the shape file?'), GetTextByKey("p_MV_DELETESHAPEFILE", 'Delete Shape File'), function () {
|
||||
_network.mapviewquery("DeleteShape", JSON.stringify(item), function (data) {
|
||||
mapHelper.removeShape(e.data);
|
||||
@ -129,7 +129,7 @@ function openImportShapeFile() {
|
||||
$('#dialog_shapename').val('');
|
||||
$('#dialog_shapenotes').val('');
|
||||
$('#span_filename').text('');
|
||||
$('#mask_bg').show();
|
||||
showmaskbg(true);
|
||||
$('#dialog_importshapefile .dialog-title span.title').text(GetTextByKey("P_MV_IMPORTSHAPEFILE", 'Import Shape File'));
|
||||
$('#dialog_importshapefile')
|
||||
.attr('act', 'edit')
|
||||
@ -196,7 +196,7 @@ function SaveImportShapeFile() {
|
||||
getShapeFileInfos();
|
||||
shapefiledata = undefined;
|
||||
$('#dialog_importshapefile').hideDialog();
|
||||
$('#mask_bg').hide();
|
||||
showmaskbg(false);
|
||||
},
|
||||
error: function (err) {
|
||||
_dialog.showAlert(err.statusText, GetTextByKey("P_MV_IMPORTSHAPEFILE", 'Import Shape File'));
|
||||
|
@ -403,7 +403,7 @@ if (typeof $websocket !== 'function') {
|
||||
'width': $(document).outerWidth(false) - left - 50,
|
||||
'height': $(document).outerHeight(false) - 64
|
||||
});
|
||||
$('#mask_bg').height($(document).outerHeight(false) - 64).width($(document).outerWidth(false) - 50);
|
||||
$('#mask_bg').height($(document).outerHeight(false)).width($(document).outerWidth(false));
|
||||
|
||||
if (this.attr("init") !== "1") {
|
||||
this.attr("init", "1");
|
||||
@ -1625,6 +1625,29 @@ function showConfirm(msg, title, fok, fcancel) {
|
||||
fok(e);
|
||||
}
|
||||
}, function () {
|
||||
if (fcancel)
|
||||
fcancel();
|
||||
showmaskbg(false);
|
||||
});
|
||||
}
|
||||
}
|
||||
function showConfirmYesNoCancel(msg, title, fok, fcancel, fclose) {
|
||||
if (window.parent && typeof window.parent.showconfirm == 'function') {
|
||||
window.parent.showConfirmYesNoCancel(msg, title, fok, fcancel, fclose);
|
||||
} else {
|
||||
showmaskbg(true);
|
||||
_dialog.showConfirmYesNoCancel(msg, title, function (e) {
|
||||
showmaskbg(false);
|
||||
if (typeof fok === 'function') {
|
||||
fok(e);
|
||||
}
|
||||
}, function () {
|
||||
if (fcancel)
|
||||
fcancel();
|
||||
showmaskbg(false);
|
||||
}, function () {
|
||||
if (fclose)
|
||||
fclose();
|
||||
showmaskbg(false);
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user