北京经济技术开发区经开区虚拟城市项目-【前端】-移动端Web
lixuliang
2024-03-13 edba1eb33a06bfb9b64e9d6d2e3de8bc49eca333
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
<!DOCTYPE html>
<html lang="en">
 
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport"
        content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
    <title>地形剖面操作</title>
    <link href="../SmartEarthSDK/Workers/layui/css/layui.css" rel="stylesheet" />
    <style>
        .iptline1 {
            position: absolute;
            top: 0.06rem;
            right: -0.2rem;
            font-weight: bold !important;
        }
 
        .layui-input {
            background-color: white;
            width: 80%;
            height: 0.3rem;
        }
 
        .layui-form-label {
            font-weight: bold !important;
            font-size: 0.1rem;
            margin-left: 0.2rem;
        }
 
        .layui-input-inline {
            display: inline-block;
        }
 
        .layui-form {
            margin-top: 0.1rem;
        }
 
        .layui-input-block {
            margin-left: unset;
            text-align: center;
        }
 
        .layui-btn {
            width: 0.8rem;
            height: 0.3rem;
            line-height: 1.3;
            font-size: 0.1rem;
        }
    </style>
</head>
 
<body onload="test()">
    <form class="layui-form" action="">
        <div class="layui-form-item" style="width:80%;color: white;font-size: 0.1rem;">
            <label class="layui-form-label ">采样间距</label>
            <div class="layui-input-inline">
                <input id="text" name="cay" lay-verify="required" value="50" placeholder="请输入采样间距" autocomplete="off"
                    class="layui-input">
                <span class="iptline1">(米)</span>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button type="button" class="layui-btn layui-btn-normal" lay-submit lay-filter="dxpmcz">绘制</button>
                <button type="button" class="layui-btn layui-btn-normal" lay-submit lay-filter="dxpmczend">结束绘制</button>
                <button type="button" class="layui-btn layui-btn-normal" lay-filter="clear" id='clear'>清除</button>
            </div>
        </div>
    </form>
    <script src="../jquery-2.0.3.js"></script>
    <script src="../SmartEarthSDK/Workers/layui/layui.js"></script>
    <!--<script src="../../js/html/index.js"></script>-->
    <!--操作-->
    <script>
        function test() {
            let htmlDom = document.getElementsByTagName('html')[0]
            htmlDom.style.fontSize = window.screen.availWidth / 3.75 + 'px';
        }
        var sgworld = parent.sgworld;
        var dxpm;
        layui.use(['form'], function () {
            var form = layui.form
            //结束绘制
            form.on('submit(dxpmczend)', function (data) {
                if (dxpm) {
                    window.parent.showmessage('正在计算请稍等……');
                    dxpm.isover = true;
                    setTimeout(() => {
                        dxpm.end();
                    }, 200);
                }
            });
            //清除绘制结果
            form.on('submit(clear)', function (data) {
                if (dxpm) {
                    dxpm.isover = true
                    dxpm.end();
                }
                var itemid = sgworld.ProjectTree.findItem('测量结果\\剖面分析')
                if (itemid) {
                    sgworld.ProjectTree.deleteItem(itemid)
                }
            });
            //监听提交
            form.on('submit(dxpmcz)', function (data) {
                var cspz = { parameterd: 0, cyjj: 0, objid: 0 };
                //采样点数
                cspz.parameterd = 10;
                if (data.field.cay != null && data.field.cay != "") {
                    cspz.cyjj = parseInt(data.field.cay);
                }
                var a = $('select').attr('value');
                //alert(a);
                if (dxpm != null) {
                    dxpm.deleteObject();
                }
                cspz.objid = sgworld.ProjectTree.findItem("测量结果");
                if (cspz.objid == "") {
                    cspz.objid = sgworld.ProjectTree.createGroup("测量结果", true, 0);
                }
                cspz.objid = sgworld.ProjectTree.createGroup("剖面分析", true, cspz.objid);
                //parent.SmartEarthPopupData.layerContainer && parent.SmartEarthPopupData.layerContainer.hide();
                var temp = parent;
                var templayeropen = parent._layerOpen;
                dxpm = sgworld.Command.execute(2, 6, cspz, function (Distance) {
                    try {
                        window.parent.hidemessage();
                    }
                    catch (ex) { }
                    if (Distance.gcs&&Distance.gcs.length) {
                        // var gcs = Distance.gcs;
                        // var gd = "";
                        // for (var i = 0; i < Distance.gcs.length; i++) {
                        //     if (i == 0) {
                        //         gd = gcs[i];
                        //     } else {
                        //         gd = gd + "," + gcs[i];
                        //     }
                        // }
                        // temp.sessionStorage.setItem('distance', Distance.distance)
                        // temp.sessionStorage.setItem('cay', Distance.cys)
                        // temp.sessionStorage.setItem('gcs', gd)
                        // window.parent.showDXPMResult();
                        parent._AnalysisDXPM.analyseData = Distance;
                        parent.showDXPMResult();
                    }else{
                        parent._AnalysisDXPM && parent._AnalysisDXPM.deleteObject();
                    }
 
                });
                parent._AnalysisDXPM = dxpm;
            });
        })
    </script>
</body>
 
</html>