<!DOCTYPE html>
|
<html lang="en">
|
|
<head>
|
<meta charset="UTF-8">
|
<title>工程树对象属性</title>
|
<link href="../SmartEarthSDK/Workers/layui/css/layui.css" rel="stylesheet" />
|
<style>
|
.layui-form-label {
|
padding: 9px 0;
|
width: 60px !important;
|
}
|
|
.layui-form-item .layui-input-inline {
|
margin-left: 77px;
|
margin-right: 8px;
|
}
|
|
.layui-form-item {
|
margin-bottom: 0 !important;
|
}
|
|
.propTable {
|
max-height: 100px;
|
overflow-y: auto;
|
overflow-x: hidden;
|
}
|
.propTable table{
|
width:400px;
|
border-collapse: separate;
|
border-spacing: 10px 0px;
|
}
|
.propTable table th{
|
background-color: skyblue;
|
width: 40px;
|
}
|
.propTable table tr{
|
height:20px;
|
}
|
.propTable::-webkit-scrollbar {
|
/*滚动条整体样式*/
|
width: 8px;
|
/*高宽分别对应横竖滚动条的尺寸*/
|
height: 8px;
|
scrollbar-arrow-color: red;
|
}
|
|
.propTable::-webkit-scrollbar-thumb {
|
border-radius: 5px;
|
-webkit-box-shadow: inset 0 0 5px rgba(218, 218, 218, 0.2);
|
box-shadow: inset 0 0 5px rgba(218, 218, 218, 0.2);
|
background: rgba(218, 218, 218, 0.5);
|
scrollbar-arrow-color: red;
|
}
|
|
.propTable::-webkit-scrollbar-track {
|
-webkit-box-shadow: inset 0 0 5px rgba(218, 218, 218, 0.2);
|
box-shadow: inset 0 0 5px rgba(218, 218, 218, 0.2);
|
border-radius: 0;
|
background: rgba(218, 218, 218, 0.1);
|
}
|
</style>
|
</head>
|
|
<body>
|
<form>
|
<div class="layui-form-item" style="margin-top: 12px;font-weight: bold">
|
<label class="layui-form-label">名称</label>
|
<div class="layui-input-inline">
|
<input type="text" lay-verify="pass" placeholder="0" autocomplete="off" class="layui-input name"
|
disabled="disabled">
|
</div>
|
</div>
|
<div class="layui-form-item" style="font-weight: bold">
|
<label class="layui-form-label">要素</label>
|
<div class="layui-input-inline">
|
<input type="text" lay-verify="pass" placeholder="0" autocomplete="off" class="layui-input ID"
|
disabled="disabled">
|
</div>
|
</div>
|
<div class="layui-form-item" style="font-weight: bold">
|
<label class="layui-form-label">属性</label>
|
<div class="layui-input-inline propTable">
|
<table class="prop cesium-infoBox-defaultTable"></table>
|
</div>
|
</div>
|
<div class="layui-form-item" style="font-weight: bold;">
|
<label class="layui-form-label">透明度</label>
|
<div class="layui-input-inline" style="margin-right: 18px;padding-top: 18px;">
|
<div id="imagerAlpha" class="imagerAlpha"></div>
|
</div>
|
</div>
|
</form>
|
<script src="../jquery-2.0.3.js"></script>
|
<script src="../SmartEarthSDK/Workers/layui/layui.js"></script>
|
<script>
|
$(function () {
|
//判断是节点右键获取属性还是选择功能点击对象获取属性
|
var oId = '';
|
if (parent.treeObj) {
|
$('.name').val(parent.treeObj.rightClickData.name);
|
$('.ID').val(parent.treeObj.rightClickData.id || '无');
|
let imgData = [
|
['地址', parent.treeObj.rightClickData.urls],
|
['图层', parent.treeObj.rightClickData.layer],
|
['类型', parent.treeObj.rightClickData.class],
|
['类别', parent.treeObj.rightClickData.sourceType],
|
];
|
let tabel =
|
`<tbody>
|
${imgData.map(item => {
|
return `<tr>
|
<th>${item[0]}</th><td>${item[1]}</td>
|
</tr>`
|
}).join('')}
|
</tbody>`;
|
$('.prop').html(tabel);
|
|
let data = parent.sgworld.ProjectTree.getObject(parent.treeObj.rightClickData.id);
|
layui.use(['form', 'slider'], function () {
|
var form = layui.form;
|
var slider = layui.slider;
|
|
slider.render({
|
elem: '#imagerAlpha',
|
theme: '#1E9FFF', //主题色
|
min: 1,
|
max: 10,
|
value: 10-data.item.alpha * 10,
|
change: function (value) {
|
var transparency=10-value;
|
data.item.alpha = transparency / 10;
|
}
|
});
|
});
|
return;
|
}
|
|
})
|
</script>
|
</body>
|
|
</html>
|