added setting for users
This commit is contained in:
@@ -21,14 +21,23 @@ import { computed } from 'vue'
|
||||
import BasicMenu from '@/components/BasicMenu/index.vue'
|
||||
import { useRouterStore } from '@core/stores/router'
|
||||
import { get } from 'lodash'
|
||||
import { customerSpecialPricingEnabledSetting, initWalletSettingsFromApi } from '@/utils/config'
|
||||
|
||||
initWalletSettingsFromApi()
|
||||
|
||||
const routerStore = useRouterStore()
|
||||
const menu = computed(() => {
|
||||
const item = routerStore.routes.find((item) => item.name === 'customers')
|
||||
const children = get(item, 'children[0].children', []) as Array<{ meta?: { order?: number } }>
|
||||
return [...children].sort(
|
||||
(a, b) => (a.meta?.order ?? 99) - (b.meta?.order ?? 99)
|
||||
)
|
||||
const children = get(item, 'children[0].children', []) as Array<{
|
||||
name?: string
|
||||
meta?: { order?: number }
|
||||
}>
|
||||
return [...children]
|
||||
.filter(
|
||||
(child) =>
|
||||
child.name !== 'customerMain_specialPrice' || customerSpecialPricingEnabledSetting.value
|
||||
)
|
||||
.sort((a, b) => (a.meta?.order ?? 99) - (b.meta?.order ?? 99))
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user