zhanmingkan
2022-05-14 0fc43fe898d14895c97427801293edfb3a0c5bf1
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
<!DOCTYPE html>
<html>
 
<head>
    <meta charset="UTF-8">
    <title>轨迹飞行</title>
    <link href="../../libs/layui/css/layui.css" rel="stylesheet">
    <script type="text/javascript" src="../../libs/jquery/jquery-3.5.1.min.js"></script>
    <script type="text/javascript" src="../../libs/layui/layui.js"></script>
    <link rel="stylesheet" href="//at.alicdn.com/t/font_2599272_671fgrsk7ev.css">
    <style>
        .romadiv {
            overflow-x: hidden;
            overflow-y: auto;
            padding: 0;
        }
 
        .mt-content-head {
            width: 100%;
            height: 30px;
            line-height: 30px;
            text-align: center;
            margin-top: 10px;
        }
 
        .mt-table-content {
            /* margin-top: 10px; */
            height: 500px;
            color: white;
            width: 100%;
            border: 1px white solid;
            border-radius: 15px;
            /* width: 250px; */
            float: left;
            /* margin-left: 10px; */
        }
 
        .mt-table-head {
            width: 300px;
            /* height: 50px; */
            /* margin-top: 15px; */
            /* font-size: 24px; */
        }
 
        .mt-table-row {
            height: 30px;
            /* margin-top: 15px; */
        }
 
        .mt-table-row-left {
            margin: 0px;
            padding-left: 10px;
            width: 200px;
            border-bottom: solid 1px white;
            border-right: solid 1px white;
        }
 
        .mt-table-row-right {
            margin: 0px;
            padding-left: 10px;
            width: 78px;
            border-bottom: solid 1px white;
            overflow: hidden;
            text-overflow:ellipsis;
            white-space: nowrap;
        }
 
        .mt-table-row-label {
            color: white;
            float: left;
            line-height: 30px;
            font-size: 12px;
        }
 
        .iconfont {
            font-size: 13px;
        }
 
        .mybtn-blue {
            color: #fff;
            background-color: #1E9FFF;
            border-color: #1E9FFF;
        }
        .mybtn-yellow {
            color: #fff;
            background-color: #FFB800;
            border-color: #FFB800;
        }
 
        .mybtn-green {
            color: #fff;
            background-color: #009688;
            border-color: #009688;
        }
        .mybtn-red {
            color: #fff;
            background-color: #FF5722;
            border-color: #FF5722;
        }
    </style>
</head>
 
<body>
 
    <div class="romadiv" action="">
        <div class="mt-row">
            <div class="mt-content-head">
                <button type="button" class="layui-btn mybtn-blue  layui-btn-sm" onclick="roamDraw()">
                    <i class="layui-icon-release"></i>绘制路径</button>
                <button type="button" class="layui-btn mybtn-red  layui-btn-sm" onclick="roamImport()">导入</button>
                <button type="button" class="layui-btn mybtn-green  layui-btn-sm" onclick="roamExport()">导出</button>
            </div>
        </div>
        <div class="mt-table-content" style="margin-top: 5px;">
            <div class="mt-table-head">
                <div class="mt-table-row-left mt-table-row-label">名称</div>
                <div class="mt-table-row-right mt-table-row-label ">操作</div>
            </div>
            <div id="view"></div>
            <!-- <div class="mt-table-row">
                <div class="mt-table-row-left mt-table-row-label">默认飞行</div>
                <div class="mt-table-row-right mt-table-row-label ">
                    <div style="display:inline" onclick="roamFly()"> <i class="iconfont icon-manyou"></i></div>
                    <div style="display:inline" onclick="roamEdit()"> <i class="iconfont icon-huitu"></i></div>
                    <div style="display:inline" onclick="roamDelete()"> <i class="iconfont icon-shanchu"></i></div>
 
                </div>
            </div> -->
            <!-- <button type="button" class="layui-btn mybtn  layui-btn-sm" onclick="roamFly()">第一人称漫游</button> -->
            <!-- <button type="button" class="layui-btn mybtn  layui-btn-sm" onclick="stopRoaming()">结束漫游</button> -->
            <!-- <button type="button" class="layui-btn mybtn  layui-btn-sm" onclick="camera()">视角</button> -->
 
        </div>
        <script id="demo" type="text/html">
            <div>
            {{#  layui.each(d.list, function(index, item){ }}
            <div class="mt-table-row">
                <div class="mt-table-row-left mt-table-row-label">{{item.name}}</div>
                <div class="mt-table-row-right mt-table-row-label ">
                    <div style="display:inline" onclick="roamFly({{index}})"> <i class="iconfont icon-manyou"></i></div>
                    <div style="display:inline" onclick="roamEdit({{index}})"> <i class="iconfont icon-huitu"></i></div>
                    <div style="display:inline" onclick="roamDelete({{index}})"> <i class="iconfont icon-shanchu"></i></div>
                </div>
            </div>
            {{#  }); }}
            {{#  if(d.list.length === 0){ }}
              无数据
            {{#  } }} 
            </div>
        </script>
    </div>
    <script>
        var data = parent.roamData;
 
        refreshTPL();
 
        function refreshTPL() {
            layui.use('laytpl', function () {
                var laytpl = layui.laytpl;
                var getTpl = demo.innerHTML
                    , view = document.getElementById('view');
                laytpl(getTpl).render(data, function (html) {
                    view.innerHTML = html;
                });
            });
        }
 
        function roamDraw(index) {
            parent.drawRoamLine();
        };
        function roamImport() {
 
        }
        function roamExport() {
 
        }
        function roamFly(index) {
            parent.roamFlyPanel(data.list[index].name);
            parent.roamFly2(data.list[index]);
        }
        function roamEdit(index) {
            parent.drawRoamLine(index);
            // parent.overlookCamera();
            // parent.roamDraw();
        }
        function roamDelete(index) {
            // parent.stopRoaming();
            data.list.splice(index, 1);
            refreshTPL();
 
        }
    </script>
</body>
 
</html>