This commit is contained in:
51
ayanova/src/api/dash-registry.js
Normal file
51
ayanova/src/api/dash-registry.js
Normal file
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
if (
|
||||
window.$gz.role.hasRole([
|
||||
role.BizAdminFull,
|
||||
role.BizAdminLimited,
|
||||
role.DispatchFull,
|
||||
role.DispatchLimited,
|
||||
role.InventoryLimited,
|
||||
role.InventoryFull,
|
||||
role.AccountingFull,
|
||||
role.TechLimited,
|
||||
role.TechFull,
|
||||
role.SalesFull,
|
||||
role.SalesLimited
|
||||
])
|
||||
) {
|
||||
sub.push({
|
||||
title: "Search",
|
||||
icon: "$ayiSearch",
|
||||
route: "/home-search",
|
||||
key: key++
|
||||
});
|
||||
}
|
||||
*/
|
||||
import authorizationroles from "./authorizationroles";
|
||||
let role = authorizationroles.AUTHORIZATION_ROLES;
|
||||
export default {
|
||||
registry: {
|
||||
dashBizOnlyTest: {
|
||||
roles: [role.BizAdminFull, role.BizAdminLimited],
|
||||
title: "Biz only dash item"
|
||||
},
|
||||
dashTechOnlyTest: {
|
||||
roles: [role.TechFull, role.TechLimited],
|
||||
title: "Tech only dash item"
|
||||
},
|
||||
dashSalesOnlyTest: {
|
||||
roles: [role.SalesFull, role.TechLSalesLimitedimited],
|
||||
title: "Sales only dash item"
|
||||
}
|
||||
},
|
||||
availableItems() {
|
||||
let ret=[];
|
||||
for (const [key, value] of Object.entries(this.registry)) {
|
||||
// console.log(`key: ${key}, value: ${JSON.stringify(value)}`);
|
||||
if(authorizationroles.hasRole(value.roles)){
|
||||
ret.push()
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -10,8 +10,8 @@
|
||||
xl="3"
|
||||
>
|
||||
<gz-dash
|
||||
:title="'Dash-' + i"
|
||||
:id="'dash-item-' + i"
|
||||
:title="'Dash-' + item.id"
|
||||
:id="'dash-item-' + item.id"
|
||||
v-on:dash-remove="dashRemove"
|
||||
v-on:dash-move-start="dashMoveStart"
|
||||
v-on:dash-move-back="dashMoveBack"
|
||||
@@ -24,6 +24,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import DashRegistry from "../api/dash-registry";
|
||||
import GzDash from "../components/dash-base.vue";
|
||||
/**
|
||||
*
|
||||
@@ -47,12 +48,13 @@ export default {
|
||||
title: "Dashboard",
|
||||
helpUrl: "form-home-dashboard"
|
||||
});
|
||||
DashRegistry.availableItems();
|
||||
},
|
||||
methods: {
|
||||
dashItems: function() {
|
||||
let ret = [];
|
||||
for (var i = 0; i < 12; i++) {
|
||||
ret.push({ index: i, title: `Dash ${i}` });
|
||||
ret.push({ id: i.toString(), title: `Dash ${i}` });
|
||||
}
|
||||
return ret;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user