Merge branch 'ah-simple' of http://192.168.0.75:3000/bonus/Zlpt_Portal into ah-simple

This commit is contained in:
hongchao 2025-02-27 17:52:33 +08:00
commit b995f19fb0
3 changed files with 21 additions and 6 deletions

View File

@ -53,7 +53,9 @@ const loopList = ref([swiper_2, swiper_4, swiper_3])
const getCompanyListData = async () => {
const res: any = await getCompanyListApi()
const result: any = await getGoodsClassListApi()
companyList.value = res.data
// isShow false
companyList.value = res.data.filter((item: any) => item.isShow)
// console.log('🚀 ~ getCompanyListData ~ companyList.value:', companyList.value)
classList.value = result.data
// console.log('res', res)
}

View File

@ -7,10 +7,12 @@ import { useRoute } from 'vue-router'
const store: any = useStore()
const router = useRouter()
const route = useRoute()
const isAdmin = ref(JSON.parse(localStorage.getItem('main')).userInfo.admin)
const userInfo = JSON.parse(localStorage.getItem('main')).userInfo
// const isAdmin = ref(userInfo.admin)
//
// const isAdmin = ref(JSON.parse(localStorage.getItem('main')).userInfo.userName == 'yuecuishan_4261')
console.log('🚀 ~ isAdmin:', isAdmin.value)
// console.log('🚀 ~ userInfo:', userInfo)
const isAdmin = ref(userInfo.userId == 226 || userInfo.userId == 225)
// console.log('🚀 ~ isAdmin:', isAdmin.value)
import imgSrc from '@/assets/img/logo.png'

View File

@ -750,8 +750,19 @@ const disabledLeaseEndTime = (date: any) => {
const getClassAndCompanyData = async () => {
const classResult: any = await getGoodsClassListApi()
const companyResult: any = await getCompanyListApi()
classOptions.value = classResult.data
// 3
const filterData = (data: any, level = 1) => {
return data.map((item: any) => {
if (level < 3) {
item.children = filterData(item.children, level + 1)
} else {
delete item.children
}
return item
})
}
classOptions.value = filterData(classResult.data)
// console.log('🚀 ~ getClassAndCompanyData ~ classOptions.value:', classOptions.value)
companyOptions.value = companyResult.data
}