sbjw
2025-08-27 5ebdc4d6d2501908342e3740e65bb89090a91f81
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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
import React, {Component} from 'react'
import './ExamplePage.css'
import "./ExampleBhPage.css";
import {GIS} from "iclient3d-plot-diy";
import {Button} from "antd";
 
 
export default class ExampleBhPage extends Component {
    constructor(props) {
        super(props);
        this.state = {
            htmlString: '<h3>正在加载中...</h3>',
        };
    }
 
    optionObjs1 = {
        "目标简标": {
            bz: true,
            bzlx: 'simple',
            jbwb: 'R:00017',
            type: "2002",
            returnHeight: true,
            useModify: false,
            lon: 102.73054539488224, lat: 31.005468100060593, height: 0,
            points: []
        },
        "目标详标": {
            bz: true,
            bzlx: 'detail',
            jbwb: 'R:00017',
            xbwb: "17/10/2019\n16:45:8\n9260.00-10400.00MHZ",
            type: "2002",
            useModify: false,
            lon: 102.70054539488224, lat: 31.000468100060593, height: 0,
            points: []
        },
        "飞行简标": {
            bz: true,
            bzlx: 'simple',
            jbwb: "P:00019",
            type: "2002",
            useModify: false,
            lon: 102.76054539488224, lat: 31.000468100060593, height: 0,
            points: [{lon: 102.76554539488224, lat: 31.000468100060593, height: 0}, {
                lon: 102.76904539488224,
                lat: 30.992468100060593,
                height: 0
            }]
        },
        "飞行详标": {
            bz: true,
            bzlx: 'detail',
            jbwb: 'P:00019',
            xbwb: "F16-1\n美国\n16:45:56\nR:00019\nC:00019",
            type: "2002",
            useModify: false,
            lon: 102.73054539488224, lat: 31.001068100060593, height: 0,
            points: [{lon: 102.73554539488224, lat: 31.001068100060593, height: 0}, {
                lon: 102.73904539488224,
                lat: 30.992468100060593,
                height: 0
            }]
        },
        "雷达对抗侦察区域": {
            type: "lddkzcqy",
            bj: 1,
            qsjd: 30,
            zzjd: 75,
            lon: 102.72004539488224, lat: 31.001068100060593, height: 0,
            useModify: false,
        },
        "雷达对抗干扰波束": {
            type: 'lddkgrps',
            bj: 1,
            qsjd: 30,
            zzjd: 75,
            lon: 102.72004539488224, lat: 30.991068100060593, height: 0,
            useModify: false,
        },
        "雷达对抗测向线": {
            type: "lddkcxx",
            kcwb: "10110",
            kcgls: 1,
            kcjd: 30,
            useModify: false,
            lon: 102.76054539488224, lat: 31.011068100060593, height: 0,
            points: []
        },
        "雷达对抗关系": {
            type: "lddkgx",
            kcwb: "10110",
            kcgls: 1,
            kcjd: 30,
            useModify: false,
            lon: 102.78054539488224,
            lat: 31.015068100060593,
            height: 0,
            points: []
        },
        "雷达对目标探测": {
            type: "lddmbtc",
            bj: 0.5,
            qsjd: 0,
            zzjd: 360,
            lon: 102.71004539488224, lat: 30.990068100060593, height: 0,
            useModify: false,
        },
        "通信对抗侦察区域": {
            type: "txdkzcqy",
            bj: 0.5,
            qsjd: 0,
            zzjd: 360,
            lon: 102.69804539488224, lat: 30.990068100060593, height: 0,
            useModify: false,
        },
        "通信对抗干扰波束": {
            type: "txdkgrps",
            bj: 1,
            qsjd: 30,
            zzjd: 75,
            lon: 102.76004539488224, lat: 30.991068100060593, height: 0,
            useModify: false,
        },
        "通信对抗测向线": {
            type: "txdkcxx",
            kcgls: 1,
            kcjd: 30,
            useModify: false,
            lon: 102.76854539488224, lat: 31.009068100060593, height: 0,
            points: []
        },
        "通信畅通区域": {
            type: 'txctqy',
            bj: 0.5,
            qsjd: 0,
            zzjd: 360,
            lon: 102.71504539488224, lat: 30.980068100060593, height: 0,
            useModify: false,
        },
        "通信网": {
            type: "txw",
            useModify: false,
            lon: 102.70854539488224, lat: 31.0098468100060593, height: 0,
            points: []
        },
        "光电对抗侦察区域": {
            type: 'gddkzcqy',
            bj: 0.5,
            qsjd: 0,
            zzjd: 360,
            lon: 102.69054539488224, lat: 31.0098468100060593, height: 0,
            useModify: false,
        },
        "光电有源对抗干扰波束": {
            type: 'gdyydkgrbs',
            kcgls: 1,
            kcjd: 30,
            lon: 102.67054539488224, lat: 31.0098468100060593, height: 0,
            useModify: false,
        },
        "漫反射干扰区域": {
            type: 'mfsgrqy',
            bj: 1,
            qsjd: 30,
            zzjd: 75,
            lon: 102.67054539488224, lat: 31.0028468100060593, height: 0,
            useModify: false,
        },
        '烟幕形成区域': {
            type: 'ymxcqy',
            points: [{lon: 102.64984, lat: 30.99237, height: 0},
                {lon: 102.66012682459443, lat: 30.995109020954718, height: 0},
                {lon: 102.67126799815856, lat: 30.98766239848537, height: 0},
                {lon: 102.64984, lat: 30.983747593478107, height: 0},
                {lon: 102.64984, lat: 30.99237, height: 0}],
            useModify: false,
        },
        "掩护区域": {
            type: 'yhqy',
            points: [{lon: 102.642853926199, lat: 31.012509646376447, height: 0},
                {lon: 102.65927322610115, lat: 31.01540811637356, height: 0},
                {lon: 102.66192135373299, lat: 31.005988487769518, height: 0},
                {lon: 102.64755620178961, lat: 31.00246196283815, height: 0},
                {lon: 102.642853926199, lat: 31.012509646376447, height: 0}],
            useModify: false,
        },
        "协同关系": {
            type: 'xtgx',
            points: [{lon: 102.642853926199, lat: 31.012509646376447, height: 0},
                {lon: 102.66192135373299, lat: 31.005988487769518, height: 0}],
            useModify: false,
        },
        "干扰线": {
            type: 'grx',
            points: [{lon: 102.732420985008, lat: 30.97556325857848, height: 0},
                {lon: 102.73983041603873, lat: 30.97504986175468, height: 0}],
            useModify: false
        },
        "预警线": {
            type: 'yjx',
            useModify: false,
            points: [{lon: 102.732420985008, lat: 30.97956325857848, height: 0},
                {lon: 102.73983041603873, lat: 30.98004986175468, height: 0}]
        },
        "目标分配线": {
            type: 'mbfpx',
            useModify: false,
            points: [{lon: 102.732420985008, lat: 30.97756325857848, height: 0},
                {lon: 102.73983041603873, lat: 30.97804986175468, height: 0}]
        },
        "目标醒目": {
            bz: true,
            xz: true,
            bzlx: 'simple',
            jbwb: 'R:00017',
            type: "2002",
            returnHeight: true,
            useModify: false,
            lon: 102.73554539488224, lat: 31.005068100060593, height: 0,
            points: []
        },
    };
 
    optionObjs = {
        "分组1": [
            {
                bz: true,
                bzlx: 'simple',
                jbwb: 'R:00017',
                type: "2002",
                returnHeight: true,
                useModify: false,
                lon: 102.73054539488224, lat: 31.005468100060593, height: 0,
                points: []
            }, {
                bz: true,
                bzlx: 'simple',
                jbwb: 'R:00018',
                type: "2002",
                returnHeight: true,
                useModify: false,
                lon: 102.73554539488224, lat: 31.005468100060593, height: 0,
                points: []
            }],
        "分组2": [
            {
                bz: true,
                bzlx: 'simple',
                jbwb: "P:00019",
                type: "2002",
                useModify: false,
                lon: 102.76054539488224, lat: 31.000468100060593, height: 0,
                points: [{lon: 102.76554539488224, lat: 31.000468100060593, height: 0}, {
                    lon: 102.76904539488224,
                    lat: 30.992468100060593,
                    height: 0
                }]
            }, {
                bz: true,
                bzlx: 'detail',
                jbwb: 'P:00019',
                xbwb: "F16-1\n美国\n16:45:56\nR:00019\nC:00019",
                type: "2002",
                useModify: false,
                lon: 102.73054539488224, lat: 31.001068100060593, height: 0,
                points: [{lon: 102.73554539488224, lat: 31.001068100060593, height: 0}, {
                    lon: 102.73904539488224,
                    lat: 30.992468100060593,
                    height: 0
                }]
            }]
    }
 
    //新增
    addOptions(key, options) {
        this.mapFunction.mapApiService.appendBh(key, options);
    }
 
    //显示分组
    showOptions(key, options) {
        this.mapFunction.mapApiService.showBh(key);
    }
 
    //隐藏分组
    hideOptions(key, options) {
        this.mapFunction.mapApiService.hideBh(key);
    }
 
    //删除分组
    delOptions(key) {
        this.mapFunction.mapApiService.removeBh(key);
    }
 
    //导出分组标绘数据
    exportBh(key) {
        let options = this.mapFunction.mapApiService.exportBh(key);
        console.log(options);
        alert(JSON.stringify(options));
    }
 
 
    options1
 
    componentDidMount() {
 
        fetch('./example/ExampleBhPage.md')
            .then(response => response.text())
            .then(mdText => {
                this.setState({htmlString: window.marked.parse(mdText)});
            });
    }
 
    render() {
        let buttons = [];
        let all = [];
        for (let i in this.optionObjs1) {
            all.push(this.optionObjs1[i]);
        }
        this.optionObjs['分组3'] = all;
        for (let key in this.optionObjs) {
            let option = this.optionObjs[key];
            buttons.push(<Button type="primary"
                                 onClick={this.addOptions.bind(this, key, option)}>{'初始化' + key}</Button>);
            buttons.push(<Button type="primary"
                                 onClick={this.showOptions.bind(this, key)}>{'显示' + key}</Button>);
            buttons.push(<Button type="primary"
                                 onClick={this.hideOptions.bind(this, key)}>{'隐藏' + key}</Button>);
            buttons.push(<Button type="primary"
                                 onClick={this.delOptions.bind(this, key)}>{'删除' + key}</Button>);
            buttons.push(<Button type="primary"
                                 onClick={this.exportBh.bind(this, key)}>{'导出' + key}</Button>);
            buttons.push(<br/>);
        }
 
        return (
            <div className={"example_bh_page_container"}>
                <h3>分组数据展示</h3>
                <div className={"map_wrapper"}>
                    <GIS refs={
                        e => {
                            this.mapFunction = e
                        }
                    }
                         plotUrl={this.state.plotUrl}
                         mapRef={this}
                         showDefaultLayer={true}
                         global={[102.5, 30.5, 103.5, 31.5]}
                    />
                </div>
                {buttons}
 
                <div className={"code_wrapper"}>
                    <div dangerouslySetInnerHTML={{__html: this.state.htmlString}}></div>
                </div>
            </div>
        )
    }
}