|
|
@@ -17,10 +17,14 @@ class Menu{
|
|
|
* Initialisation des services issues du context
|
|
|
*/
|
|
|
constructor() {
|
|
|
+ }
|
|
|
+
|
|
|
+ setUpContext(){
|
|
|
const {$ability, $config, store} = useContext();
|
|
|
this.$ability = $ability;
|
|
|
this.$config = $config;
|
|
|
this.$store = store;
|
|
|
+ return this;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -41,6 +45,9 @@ class Menu{
|
|
|
const educationalMenu = this.educationalMenu()
|
|
|
if(educationalMenu) menu.push(educationalMenu)
|
|
|
|
|
|
+ const billingMenu = this.billingMenu()
|
|
|
+ if(billingMenu) menu.push(billingMenu)
|
|
|
+
|
|
|
return ref(menu)
|
|
|
}
|
|
|
|
|
|
@@ -146,6 +153,52 @@ class Menu{
|
|
|
return children.length > 0 ? this.constructMenu('fa-graduation-cap', 'education_state', undefined, undefined, children) : null;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Construit le menu Facturation ou null si aucune page accessible
|
|
|
+ * @return {ItemMenu | null}
|
|
|
+ */
|
|
|
+ billingMenu():ItemMenu | null {
|
|
|
+ const children:ItemsMenu = [];
|
|
|
+
|
|
|
+ if (this.$ability().can('display', 'billing_product_page')) {
|
|
|
+ children.push(this.constructMenu('fa-cube', 'billing_product', '/intangibles/list/', true))
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.$ability().can('display', 'billing_products_by_student_page')) {
|
|
|
+ children.push(this.constructMenu('fa-cubes', 'billing_products_by_student', '/access_intangibles/list/', true))
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.$ability().can('display', 'billing_edition_page')) {
|
|
|
+ children.push(this.constructMenu('fa-copy', 'billing_edition', '/billing_edition', true))
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.$ability().can('display', 'billing_accounting_page')) {
|
|
|
+ children.push(this.constructMenu('fa-file-alt', 'billing_accounting', '/bill_accountings/list/', true))
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.$ability().can('display', 'billing_payment_list_page')) {
|
|
|
+ children.push(this.constructMenu('fa-credit-card', 'billing_payment_list', '/bill_payments_list/list/', true))
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.$ability().can('display', 'pes_page')) {
|
|
|
+ children.push(this.constructMenu('fa-align-justify', 'pes_export', '/pes/list/', true))
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.$ability().can('display', 'berger_levrault_page')) {
|
|
|
+ children.push(this.constructMenu('fa-align-justify', 'berger_levrault_export', '/berger_levraults/list/', true))
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.$ability().can('display', 'jvs_page')) {
|
|
|
+ children.push(this.constructMenu('fa-align-justify', 'jvs_export', '/jvs/list/', true))
|
|
|
+ }
|
|
|
+
|
|
|
+ if(children.length === 1){
|
|
|
+ return children[0];
|
|
|
+ }
|
|
|
+ return children.length > 0 ? this.constructMenu('fa-euro-sign', 'billing', undefined, undefined, children) : null;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* Construit un ItemMenu
|
|
|
* @param {string} icon
|
|
|
@@ -169,4 +222,4 @@ class Menu{
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-export default Menu
|
|
|
+export const $useMenu = new Menu()
|