123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259 |
-
- @{
- ViewBag.Title = "岗位管理";
- Layout = "~/Views/Shared/_Layout.cshtml";
- }
- @using MES.Production.Service;
- @using Central.Control.Domain;
- @using Ant.Service.Common;
- @using Ant.Service.Common.Enums;
- @using MES.Production.Entity;
- @using CommonToolHelper;
- @model UserCarMapModel
- <!-- 重点参数:infoTitle, infoBody -->
- <!doctype html>
- <html lang="zh-CN">
- <head>
- <!-- 原始地址://webapi.amap.com/ui/1.0/ui/overlay/SimpleInfoWindow/examples/index.html -->
- <base href="http://webapi.amap.com/ui/1.0/ui/overlay/SimpleInfoWindow/examples/" />
- <meta charset="utf-8">
- <meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
- <script src="~/Content/js/jquery/jquery-1.8.2.min.js"></script>
- <title>地图</title>
- <style>
- html,
- body,
- #container {
- width: 100%;
- height: 600px;
- margin: 0px;
- }
- p.my-desc {
- margin: 5px 0;
- line-height: 150%;
- }
- body {
- background-color: white;
- }
- .changeicon {
- float: right;
- margin-right: -15px;
- position: absolute;
- right: -7px;
- top: 0px;
- border: none;
- background-color: #18a689;
- color: #FFFFFF;
- line-height: 33px;
- height: 33px;
- }
- </style>
- </head>
- <body>
- <div id="container"></div>
- <div class="row white-bg animated fadeInRight">
- <div class="wrapper-content">
- <div class="panel-body">
- <div class="tab-content">
- <div id="tab-1" class="tab-pane active">
- <div class="clearfix f-hafl">
- <div class="col-hafl">
- <div class="form-group">
- <label class="col-lg-3 control-label">农机名称:</label>
- <div class="col-lg-8" style="width:45% !important">
- <label style="margin-top:7px;">@Model.carName</label>
- </div>
- </div>
- </div>
- <div class="col-hafl">
- <div class="form-group">
- <label class="col-lg-3 control-label" style="width:29% !important; padding-left:5px; padding-right:5px;">农机状态:</label>
- <div class="col-lg-8">
- <label style="margin-top:7px;">@Model.carState</label>
- </div>
- </div>
- </div>
- </div>
- <div class="clearfix f-hafl">
- <div class="col-hafl">
- <div class="form-group">
- <label class="col-lg-3 control-label">IMEI号:</label>
- <div class="col-lg-8" style="width:45% !important">
- <label style="margin-top:7px;">@Model.carId</label>
- </div>
- </div>
- </div>
- <div class="col-hafl">
- <div class="form-group">
- <label class="col-lg-3 control-label" style="width:29% !important; padding-left:5px; padding-right:5px;">是否在线:</label>
- <div class="col-lg-8">
- <label style="margin-top:7px;">@(Model.isOnLine == 1 ? "在线" : "不在线")</label>
- </div>
- </div>
- </div>
- </div>
- <div class="clearfix f-hafl">
- <div class="col-hafl">
- <div class="form-group">
- <label class="col-lg-3 control-label">车锁状态:</label>
- <div class="col-lg-8">
- <label class="radio-inline">
- <input type="radio" name="sexcode" id="a1" onchange="SendLockCarCmd()" @(Model.LockState == true ? "checked" : "") value="1">锁车
- </label>
- <label class="radio-inline">
- <input type="radio" name="sexcode" id="a2" onchange="SendUnLockCarCmd()" @(Model.LockState == false ? "checked" : "") value="2">解锁
- </label>
- </div>
- </div>
- </div>
- </div>
- @*<div class="hr-line-dashed">
- <div class="form-group m20">
- <div class="col-sm-2 col-sm-offset-2">
- <button class="btn btn-primary btn-save" onclick="checkradio()" type="submit"><i class="fa fa-check"></i> <span>确定保存</span></button>
- <button class="btn btn-warning" id="btn-dig-close" onclick="checkradio()" type="button"><i class="im-undo2"></i> 取消返回</button>
- </div>
- </div>
- </div>*@
- </div>
- </div>
- </div>
- </div>
- </div>
- <script type="text/javascript" src='http://webapi.amap.com/maps?v=1.4.2&key=fa36ec6323075f37020083ceffe8eb24'></script>
- <!-- UI组件库 1.0 -->
- <script src="http://webapi.amap.com/ui/1.0/main.js?v=1.0.11"></script>
- <script type="text/javascript">
- //创建地图
- function SendLockCarCmd() {
- var item = $(":radio:checked");
- var urlstr = "http://"+window.location.host + "/";
- //alert(urlstr);
- var len = item.length;
- if (len > 0) {
- if ($(":radio:checked").val() == 1)
- {
- $.ajax({
- url: urlstr + 'Sys/Car/SendLockCarCmd?carid='+@Model.carId,
- data: null,
- type: 'get',
- dataType: 'json',
- async: false,
- cache: false,
- success: function (res) {
- if (res.Status == 'y') {
- //var data = eval(res.Data);
- //for (var i = 0; i < data.length; i++) {
- // var jsonH = data[i];
- // option += '<option value="' + jsonH.ID + '">' + jsonH.NAME + '</option>';
- //}
- //alert("锁车发送成功!");
- }
- }
- });
- }
- else
- {
- }
- }
- }
- //解锁
- function SendUnLockCarCmd() {
- var item = $(":radio:checked");
- var urlstr = "http://"+window.location.host + "/";
- //alert(urlstr);
- var len = item.length;
- if (len > 0) {
- if ($(":radio:checked").val() == 2)
- {
- $.ajax({
- url: urlstr + 'Sys/Car/SendUnLockCarCmd?carid='+@Model.carId,
- data: null,
- type: 'get',
- dataType: 'json',
- async: false,
- cache: false,
- success: function (res) {
- if (res.Status == 'y') {
- //var data = eval(res.Data);
- //for (var i = 0; i < data.length; i++) {
- // var jsonH = data[i];
- // option += '<option value="' + jsonH.ID + '">' + jsonH.NAME + '</option>';
- //}
- // alert("解锁发送成功!");
- }
- }
- });
- }
- else
- {
- }
- }
- }
- var map = new AMap.Map('container', {
- resizeEnable: true,
- zoom: 16,
- center: [@Model.lng, @Model.lat]
- });
- AMapUI.loadUI(['overlay/SimpleInfoWindow'], function (SimpleInfoWindow) {
- var marker = new AMap.Marker({
- map: map,
- zIndex: 99999,
- offset: new AMap.Pixel(-14, -34),//相对于基点的位置
- icon: new AMap.Icon({ //复杂图标
- size: new AMap.Size(34, 49),//图标大小
- image: "@Model.imageUrl", //大图地址
- })
- });
- var infoWindow = new SimpleInfoWindow({
- infoTitle: '<strong>@Model.carName</strong>',
- infoBody: '<p class="my-desc"><strong>@Model.Note<br/>@Model.address</strong></p>',
- //基点指向marker的头部位置
- offset: new AMap.Pixel(0, -31)
- });
- function openInfoWin() {
- infoWindow.open(map, marker.getPosition());
- }
- //marker 点击时打开
- AMap.event.addListener(marker, 'click', function () {
- openInfoWin();
- });
- });
- </script>
- </body>
- </html>
|