jufubao-admin-library 1.1.177 → 1.1.178
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
>
|
|
56
56
|
<el-option
|
|
57
57
|
:key="item.value"
|
|
58
|
-
v-for="item in
|
|
58
|
+
v-for="item in startTimeList(item.end)"
|
|
59
59
|
:label="item.label"
|
|
60
60
|
:value="item.value"
|
|
61
61
|
></el-option>
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
>
|
|
69
69
|
<el-option
|
|
70
70
|
:key="item.value"
|
|
71
|
-
v-for="item in
|
|
71
|
+
v-for="item in endTimeList(item.start)"
|
|
72
72
|
:label="item.label"
|
|
73
73
|
:value="item.value"
|
|
74
74
|
></el-option>
|
|
@@ -489,7 +489,7 @@
|
|
|
489
489
|
this.$message.error('请选择时间')
|
|
490
490
|
return
|
|
491
491
|
}
|
|
492
|
-
if(this.handTimeOptions[i]['end']<this.handTimeOptions[i]['start']){
|
|
492
|
+
if(Number(this.handTimeOptions[i]['end'])<Number(this.handTimeOptions[i]['start'])){
|
|
493
493
|
this.$message.error('开始时间不能大于结束时间')
|
|
494
494
|
return
|
|
495
495
|
}
|
|
@@ -572,6 +572,34 @@
|
|
|
572
572
|
remove(index) {
|
|
573
573
|
this.handTimeOptions.splice(index, 1);
|
|
574
574
|
},
|
|
575
|
+
/**
|
|
576
|
+
* 根据结束时间过滤开始时间列表
|
|
577
|
+
* @param {number} end - 结束时间,用于过滤开始时间列表
|
|
578
|
+
* @returns {Array} 过滤后的时间列表
|
|
579
|
+
*/
|
|
580
|
+
startTimeList(end) {
|
|
581
|
+
let timeList = this.timeList // 获取组件中的时间列表
|
|
582
|
+
if (end) { // 如果提供了结束时间
|
|
583
|
+
timeList = timeList.filter(item => { // 过滤时间列表
|
|
584
|
+
return Number(item.value) <= Number(end) // 只保留值小于结束时间的时间项
|
|
585
|
+
})
|
|
586
|
+
}
|
|
587
|
+
return timeList // 返回过滤后的时间列表
|
|
588
|
+
},
|
|
589
|
+
/**
|
|
590
|
+
* 根据开始时间过滤并返回结束时间列表
|
|
591
|
+
* @param {number} start - 开始时间,用于过滤时间列表
|
|
592
|
+
* @returns {Array} 过滤后的时间列表
|
|
593
|
+
*/
|
|
594
|
+
endTimeList(start) {
|
|
595
|
+
let timeList = this.timeList // 获取组件中的时间列表
|
|
596
|
+
if (start) { // 如果传入了开始时间
|
|
597
|
+
timeList = timeList.filter(item => { // 过滤时间列表
|
|
598
|
+
return Number(item.value) >= Number(start) // 只保留值大于开始时间的时间项
|
|
599
|
+
})
|
|
600
|
+
}
|
|
601
|
+
return timeList // 返回处理后的时间列表
|
|
602
|
+
}
|
|
575
603
|
|
|
576
604
|
}
|
|
577
605
|
}
|