isOfficer
This commit is contained in:
parent
6da1827526
commit
e043a3c9cc
4 changed files with 74 additions and 37 deletions
|
|
@ -32,6 +32,9 @@ const {
|
|||
success,
|
||||
} = mixin;
|
||||
|
||||
const isOfficer = ref<boolean | null>(null);
|
||||
const isStaff = ref<boolean | null>(null);
|
||||
|
||||
const paramsId = route.params.id;
|
||||
const myForm = ref<QForm | null>(null);
|
||||
const roleAdmin = ref<boolean>(false);
|
||||
|
|
@ -140,11 +143,27 @@ const getClass = (val: boolean) => {
|
|||
};
|
||||
};
|
||||
|
||||
async function getWorkFlow() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.workflowKeycloakSystem("ORG_COMMAND"))
|
||||
.then(async (res) => {
|
||||
const data = await res.data.result;
|
||||
isOfficer.value = data.isOfficer;
|
||||
isStaff.value = data.isStaff;
|
||||
roleAdmin.value = data.isOfficer;
|
||||
hideLoader();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
hideLoader();
|
||||
})
|
||||
.finally(() => {});
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
const user = await tokenParsed();
|
||||
if (user) {
|
||||
roleAdmin.value = await user.role.includes("placement1");
|
||||
}
|
||||
getWorkFlow();
|
||||
|
||||
fetchData();
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -83,9 +83,8 @@ onMounted(async () => {
|
|||
await fetchPlacementData();
|
||||
}
|
||||
|
||||
const user = await tokenParsed();
|
||||
if (user) {
|
||||
roleAdmin.value = await user.role.includes("placement1");
|
||||
if (DataStore.isOfficer) {
|
||||
roleAdmin.value = DataStore.isOfficer;
|
||||
}
|
||||
|
||||
await getStat();
|
||||
|
|
|
|||
|
|
@ -779,26 +779,41 @@ watch(containStatus, () => {
|
|||
}
|
||||
});
|
||||
|
||||
async function getWorkFlow() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.workflowKeycloakSystem("ORG_COMMAND"))
|
||||
.then(async (res) => {
|
||||
const data = await res.data.result;
|
||||
DataStore.isOfficer = data.isOfficer;
|
||||
DataStore.isStaff = data.isStaff;
|
||||
roleAdmin.value = data.isOfficer;
|
||||
if (roleAdmin.value === false) {
|
||||
displayAdd.value = false;
|
||||
visibleColumns.value = [
|
||||
"position",
|
||||
"fullName",
|
||||
"examNumber",
|
||||
"idCard",
|
||||
"positionNumber",
|
||||
"organizationName",
|
||||
"reportingDate",
|
||||
"bmaOfficer",
|
||||
"statusName",
|
||||
"positionCandidate",
|
||||
];
|
||||
}
|
||||
hideLoader();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
hideLoader();
|
||||
})
|
||||
.finally(() => {});
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
const user = await tokenParsed();
|
||||
if (user) {
|
||||
roleAdmin.value = await user.role.includes("placement1");
|
||||
if (roleAdmin.value === false) {
|
||||
displayAdd.value = false;
|
||||
visibleColumns.value = [
|
||||
"position",
|
||||
"fullName",
|
||||
"examNumber",
|
||||
"idCard",
|
||||
"positionNumber",
|
||||
"organizationName",
|
||||
"reportingDate",
|
||||
"bmaOfficer",
|
||||
"statusName",
|
||||
"positionCandidate",
|
||||
];
|
||||
}
|
||||
}
|
||||
await getWorkFlow();
|
||||
await getTable();
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue