需求发布-装备类目改为3层
This commit is contained in:
parent
5c5ddc5a24
commit
47e2b36df9
|
|
@ -306,7 +306,19 @@ const validatorEndTime = (val) => {
|
||||||
// 获取装备类目
|
// 获取装备类目
|
||||||
const getEquipmentTypeData = async () => {
|
const getEquipmentTypeData = async () => {
|
||||||
const { data: res } = await getEquipmentTypeAPI()
|
const { data: res } = await getEquipmentTypeAPI()
|
||||||
equipmentTypeList.value = res
|
// 只需要 前3个层级
|
||||||
|
const filterData = (data, level = 1) => {
|
||||||
|
return data.map((item) => {
|
||||||
|
if (level < 3) {
|
||||||
|
item.children = filterData(item.children, level + 1)
|
||||||
|
} else {
|
||||||
|
delete item.children
|
||||||
|
}
|
||||||
|
return item
|
||||||
|
})
|
||||||
|
}
|
||||||
|
equipmentTypeList.value = filterData(res)
|
||||||
|
// console.log('🚀 ~ getEquipmentTypeData ~ equipmentTypeList.value:', equipmentTypeList.value)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 打开日期选择框
|
// 打开日期选择框
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue