|
|
@@ -7,17 +7,11 @@
|
|
7
|
7
|
style="width: 200px" />
|
|
8
|
8
|
</el-form-item>
|
|
9
|
9
|
<el-form-item label="时间段" prop="timeSlot">
|
|
10
|
|
- <el-time-picker
|
|
11
|
|
- v-model="queryParams.timeSlot"
|
|
12
|
|
- is-range
|
|
13
|
|
- range-separator="-"
|
|
14
|
|
- start-placeholder="开始时间"
|
|
15
|
|
- end-placeholder="结束时间"
|
|
16
|
|
- value-format="HH:mm"
|
|
17
|
|
- format="HH:mm"
|
|
18
|
|
- placeholder="请选择时间段"
|
|
19
|
|
- clearable
|
|
20
|
|
- style="width: 200px" />
|
|
|
10
|
+ <el-select v-model="queryParams.timeSlot" placeholder="请选择时间段" clearable style="width: 200px">
|
|
|
11
|
+ <el-option label="00:00-08:00" value="00:00-08:00" />
|
|
|
12
|
+ <el-option label="08:00-17:00" value="08:00-17:00" />
|
|
|
13
|
+ <el-option label="17:00-24:00" value="17:00-24:00" />
|
|
|
14
|
+ </el-select>
|
|
21
|
15
|
</el-form-item>
|
|
22
|
16
|
<el-form-item>
|
|
23
|
17
|
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
|
|
@@ -96,16 +90,11 @@
|
|
96
|
90
|
</el-col>
|
|
97
|
91
|
<el-col :span="12">
|
|
98
|
92
|
<el-form-item label="时间段" prop="timeSlot">
|
|
99
|
|
- <el-time-picker
|
|
100
|
|
- v-model="form.timeSlot"
|
|
101
|
|
- is-range
|
|
102
|
|
- range-separator="-"
|
|
103
|
|
- start-placeholder="开始时间"
|
|
104
|
|
- end-placeholder="结束时间"
|
|
105
|
|
- value-format="HH:mm"
|
|
106
|
|
- format="HH:mm"
|
|
107
|
|
- placeholder="请选择时间段"
|
|
108
|
|
- style="width: 100%" />
|
|
|
93
|
+ <el-select v-model="form.timeSlot" placeholder="请选择时间段" style="width: 100%">
|
|
|
94
|
+ <el-option label="00:00-08:00" value="00:00-08:00" />
|
|
|
95
|
+ <el-option label="08:00-17:00" value="08:00-17:00" />
|
|
|
96
|
+ <el-option label="17:00-24:00" value="17:00-24:00" />
|
|
|
97
|
+ </el-select>
|
|
109
|
98
|
</el-form-item>
|
|
110
|
99
|
</el-col>
|
|
111
|
100
|
</el-row>
|
|
|
@@ -304,11 +293,7 @@ const { queryParams, form, rules } = toRefs(data)
|
|
304
|
293
|
/** 查询劝阻充电宝数据列表 */
|
|
305
|
294
|
function getList() {
|
|
306
|
295
|
loading.value = true
|
|
307
|
|
- const params = { ...queryParams.value }
|
|
308
|
|
- if (params.timeSlot && Array.isArray(params.timeSlot)) {
|
|
309
|
|
- params.timeSlot = params.timeSlot.join('-')
|
|
310
|
|
- }
|
|
311
|
|
- listDiscouragePowerBanksData(params).then(response => {
|
|
|
296
|
+ listDiscouragePowerBanksData(queryParams.value).then(response => {
|
|
312
|
297
|
discouragePowerBanksDataList.value = response.rows
|
|
313
|
298
|
total.value = response.total
|
|
314
|
299
|
loading.value = false
|
|
|
@@ -378,12 +363,7 @@ function handleUpdate(row) {
|
|
378
|
363
|
reset()
|
|
379
|
364
|
const _id = row.id || ids.value
|
|
380
|
365
|
getDiscouragePowerBanksData(_id).then(response => {
|
|
381
|
|
- const data = response.data
|
|
382
|
|
- // 转换时间段字符串为数组格式
|
|
383
|
|
- if (data.timeSlot && typeof data.timeSlot === 'string' && data.timeSlot.includes('-')) {
|
|
384
|
|
- data.timeSlot = data.timeSlot.split('-')
|
|
385
|
|
- }
|
|
386
|
|
- form.value = data
|
|
|
366
|
+ form.value = response.data
|
|
387
|
367
|
open.value = true
|
|
388
|
368
|
title.value = "修改劝阻充电宝数据"
|
|
389
|
369
|
})
|
|
|
@@ -393,19 +373,14 @@ function handleUpdate(row) {
|
|
393
|
373
|
function submitForm() {
|
|
394
|
374
|
proxy.$refs["discouragePowerBanksDataRef"].validate(valid => {
|
|
395
|
375
|
if (valid) {
|
|
396
|
|
- const submitData = { ...form.value }
|
|
397
|
|
- // 转换时间段为字符串格式 08:00-17:00
|
|
398
|
|
- if (submitData.timeSlot && Array.isArray(submitData.timeSlot)) {
|
|
399
|
|
- submitData.timeSlot = submitData.timeSlot.join('-')
|
|
400
|
|
- }
|
|
401
|
|
- if (submitData.id != null) {
|
|
402
|
|
- updateDiscouragePowerBanksData(submitData).then(response => {
|
|
|
376
|
+ if (form.value.id != null) {
|
|
|
377
|
+ updateDiscouragePowerBanksData(form.value).then(response => {
|
|
403
|
378
|
proxy.$modal.msgSuccess("修改成功")
|
|
404
|
379
|
open.value = false
|
|
405
|
380
|
getList()
|
|
406
|
381
|
})
|
|
407
|
382
|
} else {
|
|
408
|
|
- addDiscouragePowerBanksData(submitData).then(response => {
|
|
|
383
|
+ addDiscouragePowerBanksData(form.value).then(response => {
|
|
409
|
384
|
proxy.$modal.msgSuccess("新增成功")
|
|
410
|
385
|
open.value = false
|
|
411
|
386
|
getList()
|