add site
This commit is contained in:
		
							
								
								
									
										269
									
								
								Site/AssetView/AssetMapView.aspx
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										269
									
								
								Site/AssetView/AssetMapView.aspx
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,269 @@ | ||||
| <%@ Page Language="C#" AutoEventWireup="true" CodeFile="AssetMapView.aspx.cs" Inherits="AssetMapView" %> | ||||
|  | ||||
| <!DOCTYPE html> | ||||
|  | ||||
| <html xmlns="http://www.w3.org/1999/xhtml"> | ||||
| <head runat="server"> | ||||
|     <meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||||
|     <title></title> | ||||
|     <style> | ||||
|         html, | ||||
|         body { | ||||
|             /*font-family: sans-serif;*/ | ||||
|             padding: 0; | ||||
|             margin: 0; | ||||
|             height: 100%; | ||||
|             width: 100%; | ||||
|         } | ||||
|  | ||||
|         #content { | ||||
|             width: 100%; | ||||
|             top: 0px; | ||||
|             bottom: 0; | ||||
|             margin: 0; | ||||
|             position: fixed; | ||||
|             /*color: #6b6b6b;*/ | ||||
|             overflow: auto; | ||||
|         } | ||||
|  | ||||
|         #parameter_left { | ||||
|             background: #f4f4f4; | ||||
|             height: 100%; | ||||
|             width: 200px; | ||||
|             float: left; | ||||
|             color: #000; | ||||
|             position: relative; | ||||
|         } | ||||
|  | ||||
|         div { | ||||
|             cursor: default; | ||||
|         } | ||||
|     </style> | ||||
|     <style type="text/css"> | ||||
|         .data-grid { | ||||
|             height: 100%; | ||||
|             font-size: 12px !important; | ||||
|             font-family: "Segoe UI","Segoe UI Web (West European)","Segoe UI",-apple-system,BlinkMacSystemFont,"Roboto","Helvetica Neue",sans-serif !important; | ||||
|         } | ||||
|     </style> | ||||
|     <link rel="stylesheet" href="<%=GetFileUrlWithVersion("../css/default.css")%>" type="text/css" /> | ||||
|     <link rel="stylesheet" href="<%=GetFileUrlWithVersion("../css/split_sub.css")%>" type="text/css" /> | ||||
|     <link rel="stylesheet" href="<%=GetFileUrlWithVersion("../css/split_sub.css")%>" /> | ||||
|     <link rel="stylesheet" href="<%=GetFileUrlWithVersion("../css/mapview.css")%>" /> | ||||
|     <link rel="stylesheet" href="<%=GetFileUrlWithVersion("../css/editmultiselect.css")%>" /> | ||||
|     <link rel="stylesheet" href="https://js.arcgis.com/3.40/esri/css/esri.css" /> | ||||
|     <link rel="stylesheet" href="<%=GetFileUrlWithVersion("../css/jquery.datetimepicker.css")%>" /> | ||||
|     <link rel="stylesheet" href="<%=GetFileUrlWithVersion("../css/playbar.css")%>" /> | ||||
|     <link type="text/css" href="<%=GetFileUrlWithVersion("../js/components/css/gridview.css") %>" rel="stylesheet" /> | ||||
|     <link type="text/css" href="<%=GetFileUrlWithVersion("../css/override.css") %>" rel="stylesheet" /> | ||||
|     <link href="<%=GetFileUrlWithVersion("../css/panel.css")%>" rel="stylesheet" type="text/css" /> | ||||
|  | ||||
|  | ||||
|     <script src="<%=GetFileUrlWithVersion("../js/jquery-" + (JQueryVersion ?? "3.6.0") + ".min.js")%>" type="text/javascript"></script> | ||||
|     <script src="<%=GetFileUrlWithVersion("../js/cookie.js")%>"></script> | ||||
|     <script src="<%=GetFileUrlWithVersion("../js/utility.js")%>" type="text/javascript"></script> | ||||
|     <script type="text/javascript" src="<%=GetFileUrlWithVersion("../js/components/gridview.js") %>"></script> | ||||
|     <script> | ||||
|         var GridView = window.GridView || window['g5-gridview']; | ||||
|         //必须放在地图js之前 | ||||
|         var dojoConfig = { | ||||
|             paths: { | ||||
|                 extras1: location.pathname.replace(/\/[^/]+$/, "") + "/../js/mapview" | ||||
|             }, | ||||
|             cacheBust: true | ||||
|         }; | ||||
|     </script> | ||||
|     <script src="<%=GetFileUrlWithVersion("../js/jquery.datetimepicker.full.js")%>"></script> | ||||
|     <script src="<%=GetFileUrlWithVersion("../js/vue.min.js")%>"></script> | ||||
|     <script>Vue.config.productionTip = false; Vue.config.silent = true;</script> | ||||
|     <script src="https://js.arcgis.com/3.40"></script> | ||||
|     <%--<script src="<%=GetFileUrlWithVersion("js/mapinit3.19.js")%>"></script>--%> | ||||
|     <%--<script src="<%=GetFileUrlWithVersion("../js/mapview.js")%>"></script>--%> | ||||
|     <%--<script src="<%=GetFileUrlWithVersion("../js/playbar.js")%>"></script>--%> | ||||
|  | ||||
|     <script src="<%=GetFileUrlWithVersion("../js/language.js")%>"></script> | ||||
|     <script src="<%=GetFileUrlWithVersion("../js/mapview/asset.js")%>"></script> | ||||
|     <script src="<%=GetFileUrlWithVersion("../js/mapview/maphelper.js")%>"></script> | ||||
|     <script src="<%=GetFileUrlWithVersion("../js/mapview/mapview.js")%>"></script> | ||||
|     <script type="text/javascript"> | ||||
|         _network.root = '<%=Page.ResolveUrl("~/")%>'; | ||||
|         var MachineID = "<%=MachineID %>"; | ||||
|         var VIN = '<%=VIN.Replace("'","\\'") %>'; | ||||
|         var Datasource = "<%=Datasource %>"; | ||||
|         var currentdate = "<%=CurrentDate %>"; | ||||
|  | ||||
|         var isMapLoaded = false; | ||||
|         var leftCtrlWidth = 390; | ||||
|         var rightCtrlWidth = 280; | ||||
|         var mapHelper; | ||||
|         var machineAlert; | ||||
|         var userParams = undefined; | ||||
|         var assetObject = undefined; | ||||
|  | ||||
|         var notShowDetail = true; | ||||
|         var notShowIcons = true; | ||||
|         enableInfoWindow = false; | ||||
|         var canEditAsset = false; | ||||
|         var canViewWorkOrder = false; | ||||
|         var canViewMR = false; | ||||
|         showMapSlider = false; | ||||
|         var showTooltipIcons = false; | ||||
|  | ||||
|         var serVersion = ""; | ||||
|  | ||||
|         _network.assetmapviewquery = function (method, param, callback, error, nolog) { | ||||
|             _network.request("AssetView/AssetMapView.aspx?tp=ashx", -1, method, param, callback, error, nolog); | ||||
|         } | ||||
|  | ||||
|         function init() { | ||||
|             loadMap(); | ||||
|         } | ||||
|  | ||||
|         function loadMap() { | ||||
|             mapHelper = new MapHelper(onMapInitialized); | ||||
|             mapHelper.notShowInfoWindow = true; | ||||
|             assetObject = new AssetObject(mapHelper); | ||||
|         } | ||||
|  | ||||
|         function onMapInitialized() { | ||||
|             isMapLoaded = true; | ||||
|             initData(onDataInitialized); | ||||
|         } | ||||
|  | ||||
|         function initData(callback) { | ||||
|             $("#historyCtrl").show();//所有类型站点都显示Show History | ||||
|             //$("#contentCtrl").css("bottom", "184px"); | ||||
|  | ||||
|             $("#autoRecenterDiv").show(); | ||||
|  | ||||
|             //assetObject.getContractor(callback); | ||||
|             if (callback) | ||||
|                 callback(); | ||||
|         } | ||||
|  | ||||
|         function onDataInitialized() { | ||||
|             isMapLoaded = true; | ||||
|             refreshData(); | ||||
|             setInterval(refreshData, 60 * 1000);//开启定时刷新 | ||||
|         } | ||||
|  | ||||
|         function refreshData() { | ||||
|             try { | ||||
|                 getMachineItem(); | ||||
|                 //assetObject.getCompanyLocations(); | ||||
|             } | ||||
|             catch (e) { | ||||
|                 machineAlert = _dialog.showAlert(GetTextByKey("P_MV_UNABLETOOBTAINASSETDATAATTEMPTINGTORECONNECT", 'Unable to obtain asset data.  Attempting to reconnect...'), GetTextByKey("P_MV_REFRESHASSETDATA", 'Refresh asset data')); | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         function getMachineItem() { | ||||
|             _network.assetmapviewquery("GetMachineItem", htmlencode(JSON.stringify([MachineID, VIN, Datasource])), function (data) { | ||||
|                 if (data && typeof (data) !== "string") { | ||||
|                     if (data.Location) { | ||||
|                         data.Latitude = data.Location.Latitude; | ||||
|                         data.Longitude = data.Location.Longitude; | ||||
|                     } | ||||
|  | ||||
|                     mapHelper.clearMachine(); | ||||
|                     mapHelper.showMachine(data); | ||||
|                     mapHelper.locateMachine(data, true, 14); | ||||
|                     currentLocationHistoryMachine = data; | ||||
|  | ||||
|                     //$("#refreshTimeDiv").text(GetTextByKey("P_MV_LASTREFRESHED", "Last Refreshed: ") + getNowFormatDate()); | ||||
|                 } else | ||||
|                     mapHelper.clearMachine(); | ||||
|                 $('#loadingDiv').hide(); | ||||
|             }, function () { | ||||
|                 $('#loadingDiv').hide(); | ||||
|             }); | ||||
|         } | ||||
|  | ||||
|         function showOtherIcons() { | ||||
|             var leftCtrl = $("#leftCtrl"); | ||||
|             $("#mapMeunDiv").css("left", leftCtrl.width() + 25); | ||||
|         } | ||||
|  | ||||
|         function reloaddata(machineid, vin) { | ||||
|             MachineID = machineid; | ||||
|             VIN = vin; | ||||
|             if (isMapLoaded) { | ||||
|                 bm = getCookie("basemap"); | ||||
|                 if (currentbasemap != bm) { | ||||
|                     currentbasemap = bm; | ||||
|                     mapHelper.changeBaseMap(currentbasemap); | ||||
|                 } | ||||
|                 if ((MachineID && MachineID > 0) | ||||
|                     || (VIN && VIN !== "")) | ||||
|                     refreshData(); | ||||
|                 else | ||||
|                     mapHelper.clearMachine(); | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         function GetLanguageByCookie() { | ||||
|             var lang = getCookie('<%=Common.LanguageCookieName%>'); | ||||
|             if (lang == null) { | ||||
|                 return "en-us"; | ||||
|             } else { | ||||
|                 return lang; | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         $(function () { | ||||
|             _fleet.currentLang = GetLanguageByCookie(); | ||||
|             currentbasemap = getCookie("basemap"); | ||||
|             $("#content").applyFleetLanguageText(true); | ||||
|             init(); | ||||
|  | ||||
|             $("#showDealerLocationsDiv").click(null, function (e) { | ||||
|                 if ($("#showDealerLocationsDiv").attr("state") == "0") { | ||||
|                     assetObject.showLocations(); | ||||
|                     $("#showDealerLocationsDiv").attr("state", "1").attr("title", GetTextByKey("P_MV_TURNOFFDEALERLOCATIONS", "Turn Off Dealer Locations")); | ||||
|                 } | ||||
|                 else { | ||||
|                     assetObject.clearLocations(); | ||||
|                     $("#showDealerLocationsDiv").attr("state", "0").attr("title", GetTextByKey("P_MV_TURNONDEALERLOCATIONS", "Turn On Dealer Locations")); | ||||
|                 } | ||||
|             }); | ||||
|  | ||||
|             $("#basemapgalleryDiv").click(null, function (e) { | ||||
|                 $("#basemapGallery").show(); | ||||
|             }); | ||||
|  | ||||
|             if (typeof window.parent.ondocumentclick == 'function') { | ||||
|                 $(document.body).click(window.parent.ondocumentclick); | ||||
|             } | ||||
|         }); | ||||
|     </script> | ||||
| </head> | ||||
| <body> | ||||
|     <form id="form1" runat="server"> | ||||
|         <div id="content" style="margin-top: 2px;"> | ||||
|             <input id="selContractor" type="hidden" value="<%=CompanyID %>" /> | ||||
|             <div id="layout"> | ||||
|                 <div> | ||||
|                     <div id="mapView"> | ||||
|                     </div> | ||||
|                     <div id="basemapgalleryDiv" style="display: none;"> | ||||
|                         <div id="basemapImg"></div> | ||||
|                         <div id="basemapTitle"></div> | ||||
|                     </div> | ||||
|                     <div id="basemapGallery"></div> | ||||
|                 </div> | ||||
|                 <div id="mapMeunDiv" style="position: absolute; top: 90px; left: 20px; z-index: 50;"> | ||||
|                     <div id="showDealerLocationsDiv" style="display: none; top: 90px;" state="1" title="Turn Off Dealer Locations"> | ||||
|                         <%=Logo1 %> | ||||
|                     </div> | ||||
|                 </div> | ||||
|                 <div id="loadingDiv" style="display: none;"> | ||||
|                     <div class="loadingmach icnmach icn-spinmach"></div> | ||||
|                 </div> | ||||
|                 <%--<div id="refreshTimeDiv"></div>--%> | ||||
|             </div> | ||||
|  | ||||
|             <div id="mask_bg" style="display: none;"><div class="loading c-spin"></div></div> | ||||
|         </div> | ||||
|     </form> | ||||
| </body> | ||||
| </html> | ||||
		Reference in New Issue
	
	Block a user