จัดการผู้ใช้งาน
This commit is contained in:
parent
c99786a634
commit
5c68d4be8c
4 changed files with 16 additions and 6 deletions
|
|
@ -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 = "";
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
||||
|
|
|
|||
|
|
@ -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) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue