longyvfengyun
2023-12-25 d8d792a6842832e8f6af6604274c438b25053afe
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
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
import axios from "./axios";
import md5 from "js-md5";
import formatPassword from "@/assets/js/tools/formatPassword";
 
/**
 * 初始化连接池
 * 无参
 */
export const initDBPool = () => {
    return axios({
        method: "post",
        url: "LoginAction!initDBPool",
        data: null
    });
};
 
/**
 * 登录系统
 * 参数 "uinf.UName="+用户名+"&uinf.Upassword="+密码+"&uinf.UId="+是否记住密码(0,1)
 * 密码需要使用hex_md5加密
 */
export const login = (username, password, verity) => {
    return axios({
        method: "post",
        url: `LoginAction_login?uinf.UName=${username}&uinf.Upassword=${encodeURIComponent(encodeURIComponent(formatPassword(password)))}&uinf.UNote=${verity}&uinf.UId=0`,
        data: null
    });
};
 
export const getLoginVerity = ()=>{
    return axios({
        method: "post",
        url: `MessageAction!getFontDynamicCode`,
        data: null
    });
};
 
export const uKeyLogin = (username, password, uKeyId) => {
    return axios({
        method: "post",
        url: `LoginAction_login4UKey?uinf.UName=${username}&uinf.Upassword=${encodeURIComponent(encodeURIComponent(formatPassword(password)))}&uinf.UId=0&uinf.UKey_ID=${uKeyId}`,
        data: null
    });
};
 
/**
 * 根据手机号获取动态口令
 * @param num   手机号
 * @returns {AxiosPromise}
 */
export const getVerifyCode = (num) =>{
    return axios({
        method: "post",
        url: "MessageAction!getDynamicPassword",
        data: "json="+num
    });
}
/**
 * 使用手机号登录
 * @param num
 * @param code
 * @returns {AxiosPromise}
 */
export const phoneVerifyCodeLogin = (num, code) => {
    return axios({
        method: "post",
        url: "MessageAction!validateDynamicPassword",
        data: "json="+JSON.stringify({
            UMobilephone: num,
            UNote: code
        })
    });
}
 
/**
 * 检测后台session
 * 无参
 */
export const checkLoginSession = () => {
    return axios({
        method: "post",
        url: "LoginAction!getSessionByString",
        data: null
    });
};
 
 
/**
 * 查询省
 * 无参
 */
export const searchProvince = () => {
    return axios({
        method: "post",
        url: "BattInfAction!serchAllStationName1",
        data: null
    });
};
 
 
/**
 * 查询市
 * 参数:json={"StationName1":"北京市"}
 */
export const searchCity = (params) => {
    return axios({
        method: "post",
        url: "BattInfAction!serchAllStationName2",
        data: "json=" + JSON.stringify(params)
    });
};
 
/**
 * 查询区县
 * 参数:json = {"StationName1":"北京市","StationName2":"市辖区"}
 */
export const searchCounty = (params) => {
    return axios({
        method: "post",
        url: "BattInfAction!serchAllStationName5",
        data: "json=" + JSON.stringify(params)
    });
};
 
/**
 * 查询机房停电信息
 * 无参
 */
export const searchPowerOff = () => {
    return axios({
        method: "post",
        url: "BattPower_offAction!serchPowerOff",
        data: null
    });
};
 
 
/**
 * 查询电池组健康率
 * 无参
 */
export const searchBattGood = () => {
    return axios({
        method: "post",
        url: "Battalarm_dataAction!serchGood",
        data: null
    });
};
 
/**
 * 添加地图上的机房
 * 参数:json={"StationName1":"", "StationName2":"", "StationName5":"","StationName3":""
 * "Address":"","longitude":"","latitude":"","information":""}
 */
export const addMapStation = (params) => {
    return axios({
        method: "post",
        url: "BattMap_informationAction!add",
        data: "json=" + JSON.stringify(params)
    });
};
 
/**
 * 更新地图上的机房
 * @param params
 * @returns {AxiosPromise}
 */
export const updateMapStation = (params) => {
    return axios({
        method: "post",
        url: "BattMap_informationAction!update",
        data: "json=" + JSON.stringify(params)
    });
};
/* 设置站点名   无参*/
export const addMapHomeList = () => {
    return axios({
        method: "post",
        url: "BattMap_informationAction!serchNotInBattMapByUid",
        data: null
    });
};
/**
 * 设置地图的中心点坐标和地图显示的等级
 * @param data  需要设置的参数
 * @returns {AxiosPromise}
 */
export const setMapCenterPoint = (data) => {
    return axios({
        method: 'post',
        url: 'Positiomap_usrAction!add',
        data: 'json=' + JSON.stringify(data)
    });
};
 
 
/**
 * 查询地图机房信息(结果中有机房的位置信息)
 * 参数:json = {"StationName1":"北京市","StationName2":"市辖区","StationName5":"海淀区"}
 */
export const searchMapStation = (params) => {
    return axios({
        method: "post",
        url: "BattMap_informationAction!serchStationName3",
        data: "json=" + JSON.stringify(params)
    });
};
 
 
/**
 * 查询机房信息
 * 参数:json = {"StationName1":"北京市","StationName2":"市辖区","StationName5":"海淀区"}
 */
export const searchStation = (params) => {
    return axios({
        method: "post",
        url: "BattInfAction!serchAllStationName",
        data: "json=" + JSON.stringify(params)
    });
};
 
/**
 * 查询站点信息
 */
export const searchStationHome = (params) => {
    return axios({
        method: "post",
        url: "StationAction!serchAllStationName",
        data: "json=" + JSON.stringify(params)
    });
};
/**
 * 查询电池组信息
 * 参数:json = {"StationName1":"北京市","StationName2":"市辖区","StationName5":"海淀区","StationName3":"紫晶科技机房"}
 */
export const searchBattInfo = (params) => {
    return axios({
        method: "post",
        url: "BattInfAction!serchAllBattinf",
        data: "json=" + JSON.stringify(params)
    });
};
 
 
//----------------------------
/**
 * 查询已添加到地图的机房
 * 参数:json={"adata":{"alm_cleared_type":0,"alm_id":1},"bplan":{"discharge_reason":3}}
 */
export const searchMap = () => {
    return axios({
        method: "post",
        url: "BattMap_informationAction!searchUserManageStation",
        data: "json=" + JSON.stringify({
            adata: {
                alm_cleared_type: 0,
                alm_id: 1,
            },
            bplan: {
                discharge_reason: 3,
            }
        })
    });
};
 
 
/**
 * 查询机房告警数,落后数和延时数
 * 参数:result={"StationId":"42070218"}
 */
export const searchRooms = (params) => {
    return axios({
        method: "post",
        url: "BattInfAction!serchByIdLow",
        data: "result=" + JSON.stringify(params)
    });
};
 
 
/**
 * 删除地图上的机房
 * 参数:json={"num":141,"StationId":"42070545",
 * "StationName":"湖北省-武汉市-BTS-东西湖区-GDXG演示","StationName3":"",
 * "Address":"湖北省-武汉市-东西湖区-公园南路","longitude":114.252963,"latitude":30.646197,"information":"",
 * "FBSDeviceId":910000120}
 */
export const delMapHome = (params) => {
    return axios({
        method: "post",
        url: "BattMap_informationAction!del",
        data: "json=" + JSON.stringify(params)
    });
};
 
/**
 * 根据机房的id查询机房的经纬度
 * 参数:json={"StationName1":"北京市","StationName2":"市辖区","StationName3":"紫晶科技机房","StationName5":"海淀区"}
 */
export const searchRoomLocation = (params) => {
    return axios({
        method: "post",
        url: "BattMap_informationAction!serchAddressByStationName3",
        data: "json=" + JSON.stringify(params)
    });
};
 
/**
 * 根据机房id获取定位信息
 *
 * @param   {[type]}  params  机房id
 *
 * @return  {[type]}          查询结果
 */
export const searchAddressById = (params) => {
    return axios({
        method: 'post',
        url: "BattMap_informationAction!searchAddressByStationId",
        data: "json=" + JSON.stringify(params)
    });
};
 
/**
 * 设置地图默认显示的中心坐标
 * 参数:json={"map_longitude":113.971219,"map_latitude":30.605035,"map_level":11}
 */
export const searchCoordinate = (params) => {
    return axios({
        method: "post",
        url: "Positiomap_usrAction!add",
        data: "json=" + JSON.stringify(params)
    });
};
 
/**
 * 获取地图的中心坐标并将地图移动该坐标
 * 无参
 */
export const searchCoordinateMove = () => {
    return axios({
        method: "post",
        url: "Positiomap_usrAction!serchByCondition",
        data: null
    });
};
 
 
/**
 * 查询页面中的导航
 * 无参
 */
export const addNavigation = () => {
    return axios({
        method: "post",
        url: "CustompageAction!searchAll",
        data: null
    });
};
 
/**
 * 查询电池告警率
 * 无参
 */
export const searchAlarm = () => {
    return axios({
        method: "post",
        url: "Battalarm_dataAction!serchAlm",
        data: "bmd.binf.StationName="
    });
};
 
/**
 * 查询电池状态
 * 无参
 */
export const searchBattState = () => {
    return axios({
        method: "post",
        url: "Batt_rtstateAction!serchBattStateRate",
        data: null
    });
};
 
/**
 * 检测当前用户是否在其他未知登录
 * 无参
 * @return  查询结果
 */
export const checkUserLogin = () => {
    return axios({
        method: "post",
        url: "LoginAction_check",
        data: null
    });
};
 
/**
 * 根据基站信息查询基站的告警和落后信息
 * 参数: json={"StationId":"@机房编号","FBSDeviceId":"@设备id"}
 */
export const searchHomeNum = (data) => {
    return axios({
        method: "post",
        url: "BattMap_informationAction!multiAmount",
        data: 'json=' + JSON.stringify(data),
    });
};
 
export const searchMapHomeState = () => {
    return axios({
        method: "post",
        url: 'BattMap_informationAction!findStationState',
        data: null
    });
};
 
/**
 * 首页地图json数据配置  增加
 * 参数: json={"province":"省","city":"市","distinct":"区","name":"json文件名称"}
 */
export const addMapOutlineAction = (data) => {
    return axios({
        method: "post",
        url: "MapOutlineAction!add",
        data: 'json=' + JSON.stringify(data),
    });
};
 
/**
 * 首页地图json数据配置  修改
 * 参数: json={"province":"省","city":"市","distinct":"区","name":"json文件名称","status":0或1,"id":id}
 */
export const updateMapOutlineAction = (data) => {
    return axios({
        method: "post",
        url: "MapOutlineAction!update",
        data: 'json=' + JSON.stringify(data),
    });
};
 
/**
 * 首页地图json数据配置  地图设置激活
 * 参数: json={"id":id}
 */
export const activeMapOutlineAction = (data) => {
    return axios({
        method: "post",
        url: "MapOutlineAction!active",
        data: 'json=' + JSON.stringify(data),
    });
};
 
/**
 * 首页地图json数据配置  查询单个
 * 参数: json={"id":id}
 */
export const getMapOutlineAction = (data) => {
    return axios({
        method: "post",
        url: "MapOutlineAction!get",
        data: 'json=' + JSON.stringify(data),
    });
};
 
/**
 * 首页地图json数据配置  查询关联地图
 * 参数: json={"id":id}
 */
export const getAllMapOutlineAction = (data) => {
    return axios({
        method: "post",
        url: "MapOutlineAction!getAll",
        data: 'json=' + JSON.stringify(data),
    });
};
 
/**
 * 查询所有告警信息
 * 参数
 */
export const getAllRealAlarm = (data) => {
    return axios({
        method: "post",
        url: "Battalarm_dataAction!getRealAlarm",
    });
};
 
export const getRandomFromServer = () => {
    return axios({
        method: 'post',
        url: 'LoginAction_getRandom'
    });
};
 
export const loginSignVerity = (data) => {
    return axios({
        method: 'post',
        url: 'LoginAction_verify',
        data: 'json=' + JSON.stringify(data),
    });
};
 
/**
 * 查询维护员告警列表
 */
export const getTaskListWithFlag = (data) => {
    return axios({
        method: "post",
        url: 'WorkAlarmAction!getTaskListWithFlag',
        data: 'json=' + JSON.stringify(data)
    });
};
 
/**
 * 获取维护员告警列表
 */
export const searchAllByUserIdAndStatus = (data) => {
    return axios({
        method: "post",
        url: 'UserWorkAction!searchAllByUserIdAndStatus',
        data: 'json=' + JSON.stringify(data)
    });
};
 
/**
 * 根据站点查询相关人员
 */
export const getUserInfoByStationId = (data) => {
    return axios({
        method: "post",
        url: `User_infAction!getUserInfoByStationId`,
        data: 'json=' + JSON.stringify(data)
    });
};
 
/**
 * 确认指派任务订单
 */
export const dispatchTask = (data) => {
    return axios({
        method: "post",
        url: `WorkAlarmAction!dispatchTask`,
        data: 'json=' + JSON.stringify(data)
    });
};
 
/**
 * 开始处理更新状态
 */
export const searchStatusById = (data) => {
    return axios({
        method: "post",
        url: `UserWorkAction!searchStatusById`,
        data: 'json=' + JSON.stringify(data)
    });
};
 
/**
 * 更新告警处理
 */
export const updateUserWork = (data) => {
    return axios({
        method: "post",
        url: `UserWorkAction!updateUserWork`,
        data: 'json=' + JSON.stringify(data)
    });
};
 
/**
 * 文件上传
 */
export const uploadAlarmFile = (data) => {
    return axios({
        method: "post",
        url: `MyFileAction!uploadAlarmFile`,
        headers: {
            "Content-Type": "multipart/form-data"
        },
        data: data
    });
};
 
/**
 * 查询告警处理详情
 */
export const serchByCondition = (data) => {
    return axios({
        method: "post",
        url: `UserWorkAction!serchByCondition`,
        data: 'json=' + JSON.stringify(data)
    });
};
 
/**
 * 删除文件
 */
export const deleteAlarmFile = (data) => {
    return axios({
        method: "post",
        url: `MyFileAction!deleteAlarmFile`,
        data: 'json=' + JSON.stringify(data)
    });
};
 
/**
 * 更新当前告警状态
 */
export const updateWorkAlarm = (data) => {
    return axios({
        method: "post",
        url: `UserWorkAction!updateWorkAlarm`,
        data: 'json=' + JSON.stringify(data)
    });
};