refactor: enhance access control for task order editing and employee name display
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 7s
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 7s
This commit is contained in:
parent
33e040c21a
commit
942449e373
3 changed files with 7 additions and 5 deletions
|
|
@ -173,7 +173,7 @@ watch(
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<FloatingActionButton
|
<FloatingActionButton
|
||||||
v-if="canAccess('taskOrder', 'edit')"
|
v-if="canAccess('taskOrder', 'edit') || pageState.isMessenger"
|
||||||
style="z-index: 999"
|
style="z-index: 999"
|
||||||
:hide-icon="!pageState.isMessenger"
|
:hide-icon="!pageState.isMessenger"
|
||||||
@click.stop="
|
@click.stop="
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@ function getEmployeeName(
|
||||||
return (
|
return (
|
||||||
{
|
{
|
||||||
['eng']: `${useOptionStore().mapOption(employee?.namePrefix || '')} ${employee?.firstNameEN} ${employee?.lastNameEN}`,
|
['eng']: `${useOptionStore().mapOption(employee?.namePrefix || '')} ${employee?.firstNameEN} ${employee?.lastNameEN}`,
|
||||||
['tha']: `${useOptionStore().mapOption(employee?.namePrefix || '')} ${employee?.firstName} ${employee?.lastName}`,
|
['tha']: `${useOptionStore().mapOption(employee?.namePrefix || '')} ${employee?.firstName || employee?.firstNameEN} ${employee?.lastName}`,
|
||||||
}[opts?.locale || 'eng'] || '-'
|
}[opts?.locale || 'eng'] || '-'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import { useRoute, useRouter } from 'vue-router';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { api } from 'src/boot/axios';
|
import { api } from 'src/boot/axios';
|
||||||
import { Lang } from 'src/utils/ui';
|
import { Lang } from 'src/utils/ui';
|
||||||
import { baseUrl } from 'stores/utils';
|
import { baseUrl, canAccess } from 'stores/utils';
|
||||||
|
|
||||||
import TaskStatusComponent from '../TaskStatusComponent.vue';
|
import TaskStatusComponent from '../TaskStatusComponent.vue';
|
||||||
import StateButton from 'src/components/button/StateButton.vue';
|
import StateButton from 'src/components/button/StateButton.vue';
|
||||||
|
|
@ -1010,7 +1010,6 @@ watch(
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
<!-- TODO: blind remark, urgent -->
|
<!-- TODO: blind remark, urgent -->
|
||||||
{{ console.log(taskListGroup) }}
|
|
||||||
<RemarkExpansion
|
<RemarkExpansion
|
||||||
v-if="
|
v-if="
|
||||||
view === TaskOrderStatus.Pending ||
|
view === TaskOrderStatus.Pending ||
|
||||||
|
|
@ -1176,7 +1175,10 @@ watch(
|
||||||
<template #append="{ props: subProps }">
|
<template #append="{ props: subProps }">
|
||||||
<TaskStatusComponent
|
<TaskStatusComponent
|
||||||
:key="subProps.row.id"
|
:key="subProps.row.id"
|
||||||
:no-action="view !== TaskOrderStatus.Validate"
|
:no-action="
|
||||||
|
view !== TaskOrderStatus.Validate &&
|
||||||
|
!canAccess('taskOrder', 'edit')
|
||||||
|
"
|
||||||
type="order"
|
type="order"
|
||||||
:readonly="
|
:readonly="
|
||||||
(() => {
|
(() => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue