จัดการผู้ใช้งาน

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-11-27 11:20:16 +07:00
parent c99786a634
commit 5c68d4be8c
4 changed files with 16 additions and 6 deletions

View file

@ -35,6 +35,10 @@ const props = defineProps({
type: Function,
required: true,
},
employeeClass: {
type: String,
required: true,
},
});
// Table
@ -142,8 +146,9 @@ function fetchListUser() {
};
http
.post(
config.API.orgProfileListKeycloak() +
`?page=${query.page}&pageSize=${query.pageSize}`,
config.API.orgProfileListKeycloak(
props.employeeClass === "employee" ? "-employee" : ""
) + `?page=${query.page}&pageSize=${query.pageSize}`,
body
)
.then(async (res) => {
@ -221,6 +226,8 @@ function onSubmit() {
showLoader();
const url = isStatusEdit.value
? config.API.managementUser + `/${userId.value}`
: props.employeeClass === "employee"
? config.API.managementUser + `/emp`
: config.API.managementUser;
http[isStatusEdit.value ? "put" : "post"](url, {
@ -245,6 +252,7 @@ function onSubmit() {
* งก Dialog และกำหนด วแปรไปเปนค defult
*/
function closeDialog() {
rows.value = [];
modal.value = false;
formData.profileId = "";
formData.username = "";

View file

@ -501,8 +501,9 @@ onMounted(async () => {
<DialogAddUser
:fetchlist="fetchListUsers"
v-model:modal="modalDialogAdd"
v-model:isStatusEdit="isStatusEdit"
:userId="userId"
v-model:is-status-edit="isStatusEdit"
:user-id="userId"
:employee-class="employeeClass"
/>
</template>

View file

@ -89,7 +89,7 @@ async function fetchCommandType() {
page: page.value,
pageSize: pageSize.value,
isActive: isActive.value,
search: keyword.value,
keyword: keyword.value,
},
})
.then(async (res) => {