surprise
2023-12-29 18377dc5d61caf3a6a0835e17015ac2601f8709d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<!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>