多单位版国产化地质资料管理系统
zhai
2025-12-18 3c6f6c1e3016e38146a4c46be6e7b625c35591f2
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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
 
<!DOCTYPE HTML>
<html>
<head>
    <base href="<%=basePath%>">
 
    <title>线段设置</title>
    <link href="static/plugins/font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css">
    <link href="static/plugins/jquery-easyui/themes/bootstrap/easyui.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="static/styles/material-teal.css" type="text/css">
    <link rel="stylesheet" href="static/styles/initialize.css" type="text/css">
    <link rel="stylesheet" href="static/styles/common.css" type="text/css">
 
    <script type="text/javascript" src="static/plugins/jquery-easyui/jquery.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript" src="static/plugins/slimScroll/jquery.slimscroll.min.js"></script>
    <script type="text/javascript" src="static//plugins/ace/src-noconflict/ace.js" charset="utf-8"></script>
    <style>
        html, body {
            height: 100%;
            width: 100%;
            overflow: hidden;
        }
 
        .panel-body {
            border: 0 none;
            font-size: 14px;
        }
 
        .ptbody table td {
            font-size: 16px;
            color: #000;
        }
 
        .ptbody table td p {
            margin-bottom: 10px;
        }
 
        .pt-form-btn {
            bottom: 0;
        }
    </style>
</head>
<body>
<div class="pt-main-top2">
        <span class="pt-title-icon pt-title-icon2">
            <i class="fa fa-share-alt"></i>
        </span>
    <h4>线段设置</h4>
    <div class="pt-nav-tab2 easyui-tabs" style="width:100%;" data-options="plain:true">
        <div title="基本属性" class="pt-nav-list">
            <div class="pt-form">
                <form id="ff" method="post">
                    <div class="ptbody">
                        <table style="width: 100%;">
                            <tr>
                                <td class="tbtitle" style="width: 140px;">
                                    <em class="pt-color-danger">*</em> 线的ID:
                                </td>
                                <td>
                                    <input id="nodeId" name="nodeId" class="easyui-textbox" type="text"
                                           data-options="required:true,readonly:true" style="width:500px;" value=""/>
                                </td>
                            </tr>
                            <tr>
                                <td class="tbtitle" style="width: 140px;">
                                    <em class="pt-color-danger">*</em> 线的名称:
                                </td>
                                <td>
                                    <input id="nodeName" name="nodeName" class="easyui-textbox" type="text"
                                           style="width:500px;" value=""/>
                                </td>
                            </tr>
                            <tr>
                                <td class="tbtitle" style="width: 140px;">
                                    线的节点:
                                </td>
                                <td>
                                    <span id="span_startNodeName"></span> -->
                                    <span id="span_endNodeName"></span>
                                </td>
                            </tr>
                            <tr>
                                <td class="tbtitle" style="width: 140px;">
                                    线的权重:
                                </td>
                                <td>
                                    <input id="nodeWeight" class="easyui-numberspinner" data-options="min:0"
                                           style="width:150px;">
                                </td>
                            </tr>
                            <tr>
                                <td class="tbtitle" style="width: 140px;">
                                    <em class="pt-color-danger">*</em> 线的类型:
                                </td>
                                <td>
                                    <select id="nodeType" name="nodeType" class="easyui-combobox" style="width:150px;"
                                            data-options="{panelHeight: 'auto', editable: false}">
                                        <option value="0" selected>单向</option>
                                        <option value="1" selected>双向</option>
                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <td class="tbtitle" style="width: 140px;">公式:</td>
                                <td>
                                    <pre id="lineFormula" style="width:500px; min-height:150px;"></pre>
                                    <!--<input id="lineFormula" name="lineFormula" class="easyui-textbox" type="text" data-options="multiline:true" style="width:500px; height:80px;" /> -->
                                </td>
                            </tr>
                            <tr>
                                <td class="tbtitle" style="width: 140px;">反向公式:</td>
                                <td>
                                    <pre id="lineReverseFormula" style="width:500px; min-height:150px;"></pre>
                                </td>
                            </tr>
                        </table>
                    </div>
                </form>
 
            </div>
        </div>
 
    </div>
    <div class="pt-form-btn">
        <div class="form-group">
            <button class="pt-btn pt-btn-primary" id="btn_save" onclick="save();">确定</button>
            <button class="pt-btn pt-btn-default" onclick="cancel();">取消</button>
        </div>
    </div>
</div>
<script type="text/javascript" src="static/scripts/ResizeScroll.js"></script>
<script>
    var editorFormula = null;
    var editorReverseFormula = null;
    $(function () {
        editorFormula = ace.edit("lineFormula"); //公式
        editorFormula.setTheme("ace/theme/monokai");
        editorFormula.session.setMode("ace/mode/javascript");
        editorFormula.setFontSize(16);
 
        editorReverseFormula = ace.edit("lineReverseFormula"); //公式
        editorReverseFormula.setTheme("ace/theme/monokai");
        editorReverseFormula.session.setMode("ace/mode/javascript");
        editorReverseFormula.setFontSize(16);
 
        var data = parent.document.getElementById("hide_node").value;
        data = JSON.parse(data);
        $("#nodeId").textbox("setValue", data.id);
        $("#nodeName").textbox("setValue", data.text);
 
        $("#span_startNodeName").html(data.startNodeName);
        $("#span_endNodeName").html(data.endNodeName);
 
        if (data.content.nodeType) {
            $("#nodeType").combobox("setValue", data.content.nodeType);
        } else {
            $("#nodeType").combobox("setValue", "0");
        }
 
        if (data.content.nodeWeight) {
            $("#nodeWeight").numberspinner("setValue", data.content.nodeWeight);
        } else {
            $("#nodeWeight").numberspinner("setValue", "0");
        }
 
        if (data.content.formula) {
            editorFormula.session.setValue(data.content.formula);
        }
        if (data.content.reverseFormula) {
            editorReverseFormula.session.setValue(data.content.reverseFormula);
        }
 
        new ResizeScroll({
            "id": ".ptbody",
            fun: function () {
                var wh = $(window).height();
                return (wh - 52 - 69);
 
            }
        });
 
    })
 
    //保存
    function save() {
        var valid = $("#nodeName").textbox("isValid");
        if (valid) {
            //有效
            var id = $("#nodeId").textbox("getValue");
            var text = $("#nodeName").textbox("getValue");
            var nodeType = $("#nodeType").combobox("getValue");
            var nodeWeight = $("#nodeWeight").numberspinner("getValue");
            var formula = editorFormula.getValue().replace(/(^\s*)|(\s*$)/g, "");
            var reverseFormula = editorReverseFormula.getValue().replace(/(^\s*)|(\s*$)/g, "");
            var data = {
                "id": id,
                "text": text,
                content: {
                    "nodeType": nodeType,
                    "nodeWeight": nodeWeight,
                    "formula": formula,
                    "reverseFormula": reverseFormula
                }
            };
            var strdata = JSON.stringify(data);
            parent.document.getElementById("hide_node").value = strdata;
            var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
            parent.resetLineNode(index);
        }
    }
 
    function cancel() {
        var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
        parent.closeWin(index);
    }
</script>
</body>
</html>