#
Junjie
14 小时以前 efbd157c0d810c39d04cd86752e769a3f3a1a1fc
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
<!DOCTYPE html>
<html lang="en">
 
    <head>
        <meta charset="UTF-8">
        <title>调试参数</title>
        <link rel="stylesheet" href="../../../static/vue/element/element.css">
        <script type="text/javascript" src="../../../static/js/jquery/jquery-3.3.1.min.js"></script>
        <script type="text/javascript" src="../../../static/js/common.js"></script>
        <script type="text/javascript" src="../../../static/vue/js/vue.min.js"></script>
        <script type="text/javascript" src="../../../static/vue/element/element.js"></script>
        <style>
            .show-box {
                width: 20%;
                display: flex;
                justify-content: flex-start;
                align-items: center;
                margin-bottom: 30px;
            }
        </style>
    </head>
 
    <body>
        <div id="app">
            <div>
                <el-card class="box-card">
                    <div slot="header" class="clearfix">
                        <span>调度参数</span>
                    </div>
 
                    <div style="display: flex;flex-wrap: wrap;">
                        <div class="show-box">
                            <div>调度小车同层最大数量</div>
                            <el-input v-model="codeMap.dispatchShuttleMaxNum" style="width: 60%;"></el-input>
                        </div>
 
                        <div class="show-box">
                            <div>入库预留小车</div>
                            <el-input v-model="codeMap.shuttleWrkInObligateCount" style="width: 60%;"></el-input>
                        </div>
 
                        <div class="show-box">
                            <div>避障内圈半径</div>
                            <el-input v-model="codeMap.avoidInnerCircle" style="width: 60%;"></el-input>
                        </div>
 
                        <div class="show-box">
                            <div>避障外圈半径</div>
                            <el-input v-model="codeMap.avoidOuterCircle" style="width: 60%;"></el-input>
                        </div>
 
                        <div class="show-box">
                            <div>地图母轨方向(x,y)</div>
                            <el-input v-model="codeMap.direction_map" style="width: 60%;"></el-input>
                        </div>
 
                        <div class="show-box">
                            <div>小车出提升机近点距离</div>
                            <el-input v-model="codeMap.shuttleOutLiftLocationDistance" style="width: 60%;"></el-input>
                        </div>
 
                        <div class="show-box">
                            <div>小车移动连续下发指令</div>
                            <el-radio border v-model="codeMap.shuttleMoveCommandsContinuously" label="Y">开</el-radio>
                            <el-radio border v-model="codeMap.shuttleMoveCommandsContinuously" label="N">关</el-radio>
                        </div>
 
                        <div class="show-box">
                            <div>允许交管重新规划路径</div>
                            <el-radio border v-model="codeMap.trafficControlRestartCalcPath" label="Y">开</el-radio>
                            <el-radio border v-model="codeMap.trafficControlRestartCalcPath" label="N">关</el-radio>
                        </div>
 
                        <div class="show-box">
                            <div>输出RCS调试日志</div>
                            <el-radio border v-model="codeMap.rcsDebugShowLog" label="true">开</el-radio>
                            <el-radio border v-model="codeMap.rcsDebugShowLog" label="false">关</el-radio>
                        </div>
                    </div>
 
                    <div style="margin-top: 20px;">
                        <el-button type="primary" @click="saveParam('shuttle')">保存</el-button>
                    </div>
                </el-card>
            </div>
 
            <div style="margin-top: 20px;">
                <el-card class="box-card">
                    <div slot="header" class="clearfix">
                        <span>充电参数</span>
                    </div>
 
                    <div style="display: flex;flex-wrap: wrap;">
                        <div class="show-box">
                            <div>小车充电最大阈值</div>
                            <el-input v-model="codeMap.chargeMaxValue" style="width: 60%;"></el-input>
                        </div>
 
                        <div class="show-box">
                            <div>小车电量预警阈值</div>
                            <el-input v-model="codeMap.shuttlePowerEarlyValue" style="width: 60%;"></el-input>
                        </div>
 
                        <div class="show-box">
                            <div>小车满电校准</div>
                            <el-radio border v-model="codeMap.shuttleMaxPowerVerify" label="true">开</el-radio>
                            <el-radio border v-model="codeMap.shuttleMaxPowerVerify" label="false">关</el-radio>
                        </div>
 
                        <div class="show-box">
                            <div>定时充电开关</div>
                            <el-radio border v-model="codeMap.timedCharge" label="Y">开</el-radio>
                            <el-radio border v-model="codeMap.timedCharge" label="N">关</el-radio>
                        </div>
 
                        <div class="show-box">
                            <div>定时充电时间段</div>
                            <el-input v-model="codeMap.timedChargeRange" style="width: 60%;"></el-input>
                        </div>
 
                        <div class="show-box">
                            <div>小车默认充电线</div>
                            <el-input v-model="codeMap.shuttleDefaultChargePowerLine" style="width: 60%;"></el-input>
                        </div>
 
                        <div class="show-box">
                            <div>小车定时充电线</div>
                            <el-input v-model="codeMap.timedChargePowerLine" style="width: 60%;"></el-input>
                        </div>
                    </div>
 
                    <div style="margin-top: 20px;">
                        <el-button type="primary" @click="saveParam('charge')">保存</el-button>
                    </div>
                </el-card>
            </div>
 
            <div style="margin-top: 20px;">
                <el-card class="box-card">
                    <div slot="header" class="clearfix">
                        <span>演示模式参数</span>
                    </div>
                    <div style="display: flex;flex-wrap: wrap;">
                        <div class="show-box">
                            <div>移动演示模式-楼层</div>
                            <el-input v-model="codeMap.demoRunLev" style="width: 60%;"></el-input>
                        </div>
 
                        <div class="show-box">
                            <div>移动演示模式-是否换层</div>
                            <el-radio border v-model="codeMap.demoSwitchLev" label="Y">开</el-radio>
                            <el-radio border v-model="codeMap.demoSwitchLev" label="N">关</el-radio>
                        </div>
 
                        <div class="show-box">
                            <div>演示模式-货物搬运</div>
                            <el-radio border v-model="codeMap.demoCargoMove" label="Y">开</el-radio>
                            <el-radio border v-model="codeMap.demoCargoMove" label="N">关</el-radio>
                        </div>
 
                    </div>
 
                    <div style="margin-top: 20px;">
                        <el-button type="primary" @click="saveParam('demo')">保存</el-button>
                    </div>
                </el-card>
            </div>
        </div>
        <script>
            var app = new Vue({
                el: '#app',
                data: {
                    codeMap: {},
                },
                created() {
                    this.init()
                },
                methods: {
                    init() {
                        this.getConfigData()
                    },
                    getConfigData() {
                        let that = this;
                        $.ajax({
                            url: baseUrl + "/config/listAll/auth",
                            headers: {
                                'token': localStorage.getItem('token')
                            },
                            data: {},
                            dataType: 'json',
                            contentType: 'application/json;charset=UTF-8',
                            method: 'GET',
                            success: function(res) {
                                if (res.code == 200) {
                                    let codeMap = {}
                                    res.data.forEach((item) => {
                                        codeMap[item.code] = item.value
                                    })
                                    that.codeMap = codeMap;
                                } else if (res.code === 403) {
                                    top.location.href = baseUrl + "/";
                                } else {
                                    that.$message({
                                        message: res.msg,
                                        type: 'error'
                                    });
                                }
                            }
                        });
                    },
                    saveParam(type) {
                        let that = this;
                        let codeList = this.getParamData(type)
                        let updateCodeList = [];
 
                        codeList.forEach((key) => {
                            let value = this.codeMap[key]
                            updateCodeList.push({
                                code: key,
                                value: value
                            })
                        })
 
                        console.log(updateCodeList)
 
                        $.ajax({
                            url: baseUrl + "/config/updateBatch",
                            headers: {
                                'token': localStorage.getItem('token')
                            },
                            data: JSON.stringify(updateCodeList),
                            dataType: 'json',
                            contentType: 'application/json;charset=UTF-8',
                            method: 'POST',
                            success: function(res) {
                                if (res.code == 200) {
                                    that.$message({
                                        message: '保存成功',
                                        type: 'success'
                                    });
                                } else if (res.code === 403) {
                                    top.location.href = baseUrl + "/";
                                } else {
                                    that.$message({
                                        message: res.msg,
                                        type: 'error'
                                    });
                                }
                            }
                        });
                    },
                    getParamData(type) {
                        let data = []
                        if(type == "shuttle") {
                            data.push('dispatchShuttleMaxNum');
                            data.push('shuttleWrkInObligateCount');
                            data.push('avoidInnerCircle');
                            data.push('avoidOuterCircle');
                            data.push('direction_map');
                            data.push('shuttleOutLiftLocationDistance');
                            data.push('shuttleMoveCommandsContinuously');
                            data.push('trafficControlRestartCalcPath');
                            data.push('rcsDebugShowLog');
                        }else if (type == "charge") {
                            data.push('chargeMaxValue');
                            data.push('shuttlePowerEarlyValue');
                            data.push('shuttleMaxPowerVerify');
                            data.push('timedCharge');
                            data.push('timedChargeRange');
                            data.push('shuttleDefaultChargePowerLine');
                            data.push('timedChargePowerLine');
                        }else if (type == "demo") {
                            data.push('demoRunLev');
                            data.push('demoSwitchLev');
                            data.push('demoCargoMove');
                        }
 
                        return data;
                    },
                },
            })
        </script>
    </body>
 
</html>