|
|
@@ -389,26 +389,20 @@ const getDetailData = async (id) => {
|
|
|
//设置默认数据
|
|
|
if (list.length > 0) {
|
|
|
let isIndex = false
|
|
|
- // for (let i = 0; i < list.length; i++) {
|
|
|
- // const planYear = list[i].planYear.toString()
|
|
|
- // if (planYear === currentYear.value) {
|
|
|
- // yearIndex.value = i
|
|
|
- // yearKey.value = list[i].planYear
|
|
|
- // console.log( yearKey.value, ' yearKey.value')
|
|
|
-
|
|
|
-
|
|
|
- // isIndex = true
|
|
|
- // }
|
|
|
-
|
|
|
- // }
|
|
|
for (let i = 0; i < list.length; i++) {
|
|
|
const planYear = list[i].planYear.toString()
|
|
|
if (planYear === planYearData.value) {
|
|
|
- yearKey.value = planYearData.value
|
|
|
+ yearKey.value = list[i].planYear
|
|
|
yearIndex.value = i
|
|
|
isIndex = true
|
|
|
break
|
|
|
+ } else if (planYearData.value > parseInt( Math.max(...list.map(item => parseInt(item.planYear))))) {
|
|
|
+ yearKey.value = list[list.length - 1].planYear
|
|
|
+ yearIndex.value = list.length - 1
|
|
|
+ isIndex = true
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
//默认值
|
|
|
if (!isIndex) {
|
|
|
@@ -417,6 +411,9 @@ const getDetailData = async (id) => {
|
|
|
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
} else {
|
|
|
yearIndex.value = -1
|
|
|
yearKey.value = null
|