Merge branch 'ah-simple' of http://192.168.0.75:3000/bonus/Zlpt_Portal into ah-simple
This commit is contained in:
commit
b995f19fb0
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue