Commit 0c1cf9dc by T

第一次提交,现场版本

parents
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<title>宁波市公安局应急装备库装备智能管控系统</title>
<link rel="stylesheet" href="lib/bootstrap.css">
<script src="lib/fengmap.min.js"></script>
<script src="lib/jquery.min.js"></script>
<script src="lib/bootstrap.min.js"></script>
<script src="lib/createBubble.js"></script>
<style>
#map-container {
/* position: absolute; */
width: 75%;
height: 100%;
}
#tableinfo {
/* position: absolute;
right: 0%;
top: 0%; */
width: 25%;
height: 100%;
z-index: 99;
border-left: 1px solid #ccc;
}
#tableinfo table{
width: 100%;
}
#tableinfo th {
background-color: #6495ED;
}
#tableinfo td,#tableinfo th {
padding: 10px 20px;
text-align: center;
color: #606266;
}
#tableinfo tr {
border-bottom: 1px solid #ccc;
}
.map-warp{
position: fixed;
left: 0;
top: 0;
right: 0;
bottom: 0;
width: 100%;
height: 100%;
}
.map-content{
display: flex;
justify-content: space-between;
height: 100%;
}
.box-title{
padding: 20px;
display: flex;
justify-content: space-between;
align-items: center;
}
.box-title span{
width: 50%;
text-align: center;
}
</style>
</head>
<body>
<div class="map-warp">
<!-- <div class="title">宁波巡特警装备管理系统</div> -->
<div class="map-content">
<div id="map-container"></div>
<div style="width: 100%; height: 50px; background-color: #fff;position: absolute;right: 25%; bottom: 0;z-index: 98"></div>
<div id="tableinfo">
<div class="box-title">
<span>柜子名称:</span>
<span class="box-name"></span>
</div>
<table>
<thead>
<tr>
<th style="color: #fff">序号</th>
<th style="color: #fff">名 称</th>
<th style="color: #fff">数 量</th>
</tr>
</thead>
<tbody id="tablebody">
</tbody>
</table>
</div>
</div>
</div>
</body>
<script>
var fmapID = 'ningbogonganjuxuntejincangku'; //mapId
var map;
var searchAnalyser;
var navi = null;
var $_GET = (function () {
var url = window.document.location.href.toString();
var u = url.split("?");
if (typeof(u[1]) == "string") {
u = u[1].split("&");
var get = {};
for (var i in u) {
var j = u[i].split("=");
get[j[0]] = j[1];
}
return get;
} else {
return {};
}
})();
var ID= $_GET['ID'];
var FID = [];
//气泡数据
var EqName = '';
var StorageCode = [];
//气泡属性
var name = '';
var x = 0;
var y = 0;
var groupID = 0;
var bubbleObj = null;
//表格数据
var carList = [];
window.onload = function () {
//加载
map = new fengmap.FMMap({
container: document.getElementById('map-container'), //渲染dom
mapServerURL: './data/' + fmapID,//地图数据位置
defaultThemeName: '2001',
mapThemeURL : './data/theme',
defaultMapScaleLevel: 23,
mapScaleLevelRange: [18, 29], //比例尺允许范围
appName: '测试仓库', //开发者申请应用名称
key: 'ca31a695fcf43c3f19ca6530ec4d9b92', //开发者申请应用下web服务的key
});
map.openMapById(fmapID); //打开地图数据
//地图加载完成后
map.on('loadComplete', function () {
map.tiltAngle = 75; //设置地图的倾斜度为90度。
map.rotateAngle = 0; //设置地图的旋转角为0度。
searchAnalyser = map.searchAnalyser; //获取搜索类
bubbleObj = new createBubble(map);
if (FID != 0 && FID != null ) {
findCoordinate(FID)
console.log(FID)
}
//根据fid查询
function findCoordinate(FID) {
for (var i in FID) {
var searchReq = new fengmap.FMSearchRequest(fengmap.FMNodeType.MODEL); //设置查询地图元素类型
searchReq.FID(FID[i]);
searchAnalyser.query(searchReq, function(request, result) {
var models = result[0];
console.log(models)
if (i == 0) {
//result 为查询到的结果集。
x = models.mapCoord.x;
y = models.mapCoord.y;
groupID = models.groupID;
canva()
}
if (models != null) {
map.storeSelect(models, true, true)
}
})
}
}
map.on('mapClickNode', function (event) {
// if (event.typeID === 200502) {
// // FID = event.FID
// // name = event.name
// // $('#FID').html(FID)
// // $('#name').html(name)
// // var FID = event.FID;
// console.log('event',event)
// // var oInput = document.createElement('input');
// // oInput.value = FID;
// // document.body.appendChild(oInput);
// // oInput.select(); // 选择对象
// // document.execCommand("Copy"); // 执行浏览器复制命令
// // oInput.className = 'oInput';
// // oInput.style.display='none';
// } else {
// }
$('#tablebody').html('')
console.log('event',event)
$('.box-name').html(event.name)
var ID = event.FID
$.ajax ({
type: 'get',
url: 'http://41.204.124.248:8686/Map/GetMaterialBySID?sid='+ID,
dataType: 'json',
success: function(res) {
console.log('resresres',res)
// $.each(res.data, function(index, obj) {
// // FID.push(obj.MapID);
// // if (StorageCode.length == 0) {
// // StorageCode = obj.StorageCode;
// // } else {
// // if (obj.StorageCode){
// // StorageCode += ',' + obj.StorageCode ;
// // } else {
// // return
// // }
// // }
// })
var ShowList = res.data
for (let i in ShowList) {
i ++;
$('#tablebody').append('<tr><td>'+ i+'</td><td>'+ ShowList[i-1].LibraryName+'</td><td>'+ ShowList[i-1].nCount+'</td></tr>')
i--
}
// name += '<span style="color: #606166"> 置:</span><span style="color: #436EEE;font-weight:bold">'+ StorageCode + '</span><br>';
// name += '<span style="color: #606166"> 称:</span><span style="color: #436EEE;font-weight:bold">' + res.data.MapIDList[0].EqName + '</span>';
},
error: function(data) {
console.log(data)
}
})
})
function canva() {
navi = new fengmap.FMNavigation({
map: map,
// 设置导航线的样式
lineStyle: {
//设置线为导航线样式
lineType: fengmap.FMLineType.FMARROW,
lineWidth: 6,
//设置线的颜色
// godColor: '#FF0000',
//设置边线的颜色
// godEdgeColor: '#920000',
}
});
navi.setStartPoint({
x: 13536439.8,
y: 3484247.98,
height: 0.20000000298023224,
groupID: 1,
size: 32
})
navi.setEndPoint({
x: x,
y: y,
groupID: groupID,
height: 0.20000000298023224,
size: 32
});
navi.drawNaviLine();
}
//气泡
position = {
x: x,
y: y,
z: 2,
//设置气泡的自定义属性
name: name
};
bubbleObj.bubbledomEvent(position);
})
function innerTable() {
}
}
</script>
</script>
</html>
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.webServer>
<staticContent>
<mimeMap fileExtension=".fmap" mimeType="application/octet-stream" />
<mimeMap fileExtension=".theme" mimeType="application/octet-stream" />
<mimeMap fileExtension=".fmi" mimeType="application/octet-stream" />
</staticContent>
<directoryBrowse enabled="true" />
</system.webServer>
</configuration>
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<title>宁波市公安局应急装备库装备智能管控系统</title>
<style>
iframe {
width: 100%;
height: 700px;
border: 0;
}
</style>
</head>
<body>
<iframe src="http://41.204.124.244:5004/map/equipmentsshow.html?ID=2" id="frame1"></iframe>
<button onclick="getChildItem()">提交</button>
</body>
<script>
function getChildItem() {
var child = window.frames[0];
var MapCode = child
console.log(MapCode)
}
</script>
</html>
{
"1": "924224010158",
"2": "924224010173",
"3": "924224010172",
"4": "924224010171",
"5": "924224010170",
"6": "924224010169",
"7": "924224010167",
"8": "924224010168",
"9": "924224010157",
"10": "924224010155",
"11": "924224010152",
"12": "924224010156",
"13": "924224010154",
"14": "924224010153",
"15": "924224010146",
"16": "924224010149",
"17": "924224010151",
"18": "924224010147",
"19": "924224010148",
"20": "924224010150",
"21": "924224010162",
"22": "924224010164",
"23": "924224010166",
"24": "924224010163",
"25": "924224010160",
"26": "924224010165",
"27": "924224010161",
"28": "924224010159",
"29": "924224010175",
"30": "924224010174",
"31": "924224010182",
"32": "924224010185",
"33": "924224010178",
"34": "924224010186",
"35": "924224010180",
"36": "924224010177",
"37": "924224010187",
"38": "924224010183",
"39": "924224010176",
"40": "924224010184",
"41": "924224010181",
"42": "924224010179",
"43": "924224010199",
"44": "924224010197",
"45": "924224010198",
"46": "924224010193",
"47": "924224010194",
"48": "924224010192",
"49": "924224010196",
"50": "924224010195",
"51": "924224010190",
"52": "924224010189",
"53": "924224010188",
"54": "924224010191",
"55": "924224010118",
"56": "924224010117",
"57": "924224010112",
"58": "924224010113",
"59": "924224010119",
"60": "924224010116",
"61": "924224010114",
"62": "924224010115",
"63": "924224010139",
"64": "924224010141",
"65": "924224010140",
"66": "924224010136",
"67": "924224010138",
"68": "924224010137",
"69": "924224010135",
"70": "924224010132",
"71": "924224010134",
"72": "924224010133",
"73": "924224010131",
"74": "924224010128",
"75": "924224010129",
"76": "924224010130",
"77": "924224010123",
"78": "924224010125",
"79": "924224010121",
"80": "924224010126",
"81": "924224010122",
"82": "924224010120",
"83": "924224010127",
"84": "924224010124",
"85": "924224010144",
"86": "924224010143",
"87": "924224010142",
"88": "924224010145"
}
\ No newline at end of file
差异被折叠。 点击展开。
差异被折叠。 点击展开。
差异被折叠。 点击展开。
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论