whyczyk
2021-08-10 4231b4406ee43a42234ce47d41bcf4b94c48c138
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
import axios from "./axios";
import md5 from "js-md5";
/**
 * 登录系统
 * 参数 "uinf.UName="+用户名+"&uinf.Upassword="+密码+"&uinf.UId="+是否记住密码(0,1)
 * 密码需要使用hex_md5加密
 */
export const login = (username, password) => {
    return axios({
        method: "post",
        url: `LoginAction_login?uinf.UName=${username}&uinf.Upassword=${md5(password)}&uinf.UId=0`,
        data: null
    })
}
 
/**
 * 查询机房信息
 * 参数:json = {"StationName1":"北京市","StationName2":"市辖区","StationName5":"海淀区"}
 */
export const searchStation = (params) => {
    return axios({
        method: "post",
        url: "BattInfAction!serchAllStationName",
        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,
            }
        })
    })
}
 
export const searchMapHomeState = () => {
    return axios({
        method: "post",
        url: 'BattMap_informationAction!findStationState',
        data: null
    });
}
 
/**
 * 首页地图json数据配置  查询关联地图
 * 参数: json={"id":id}
 */
export const getAllMapOutlineAction = (data) => {
    return axios({
        method: "post",
        url: "MapOutlineAction!getAll",
        data: 'json=' + JSON.stringify(data),
    });
}
/**
 * 检测用户的密码
 * @param data 密码
 * @returns {AxiosPromise}
 */
export const checkUserPwd = (data) => {
    return axios({
        method: 'post',
        url: 'User_infAction!checkUserPass',
        data: "addjson=" + md5(data),
    });
}
/**
 * 读取FGCD_A059放电参数
 * @param data 传入json:{dev_id,op_cmd}
 * @returns {AxiosPromise}
 */
export const getParams = (data) => {
    return axios({
        method: 'POST',
        url: 'Fbs9100_setparamAction_action_searchA059Param',
        data: 'json=' + JSON.stringify(data)
    });
}
/**
 * 启动
 * @param data 启动命令
 * @returns {AxiosPromise}
 */
export const start = (data) => {
    return axios({
        method: 'post',
        url: 'Fbs9100_setparamAction_action_serchbyDev_id',
        data: 'json=' + JSON.stringify(data),
    });
}
 
/**
 * 设定
 * @param data 启动命令
 * @returns {AxiosPromise}
 */
export const setParams = (data) => {
    return axios({
        method: 'POST',
        url: 'Fbs9100_setparamAction_action_updateA059Param',
        data: 'json=' + JSON.stringify(data)
    });
}
/**
 * 查询电池组信息
 * 参数:json = {"StationName1":"北京市","StationName2":"市辖区","StationName5":"海淀区","StationName3":"紫晶科技机房"}
 */
export const searchBattInfo = (params) => {
    return axios({
        method: "post",
        url: "BattInfAction!serchAllBattinf",
        data: "json=" + JSON.stringify(params)
    })
}