Compare commits

..

No commits in common. "8c2f100cba0407649158bfb0f6c7ada9b0987d3d" and "97348f2ecd759ad3e13beb84ce113347220368d7" have entirely different histories.

2 changed files with 6 additions and 45 deletions

View file

@ -16,6 +16,4 @@ export default {
/** กำหนดสิทธิ์*/
managementPermission,
resetPassword: `${management}/user/reset-password`,
};

View file

@ -36,11 +36,8 @@ const {
hideLoader,
success,
dialogConfirm,
dialogMessageNotify,
} = useCounterMixin();
const NODE_ENV = ref<string>(process.env.NODE_ENV || "development");
/** Tree*/
const activeId = ref<string>(""); // id
const orgId = ref<string | null>(null); // id node
@ -198,12 +195,6 @@ const itemMenu = ref<ItemsMenu[]>([
color: "blue-9",
type: "managementRole",
},
{
label: "รีเซ็ตรหัสผ่าน",
icon: "mdi-lock-reset",
color: "teal-4",
type: "resetPassword",
},
{
label: "ลบ",
icon: "delete",
@ -290,7 +281,7 @@ async function fetchListUsers() {
e.name === "STAFF" ||
e.name === "SUPER_ADMIN" ||
e.name === "ADMIN" ||
e.name === "USER",
e.name === "USER"
)
: [],
}));
@ -328,8 +319,6 @@ function onClickAction(type: string, data: Users) {
// /
const status = type === "open" ? true : false;
onLockUser(data.id, status);
} else if (type === "resetPassword") {
onReSetPassword(data.id);
}
}
@ -357,7 +346,7 @@ async function onDeleteUser(id: string) {
currentPage.value = await updateCurrentPage(
currentPage.value,
maxPage.value,
rows.value.length,
rows.value.length
);
await fetchListUsers();
success($q, "ลบข้อมูลสำเร็จ");
@ -396,7 +385,7 @@ function onLockUser(id: string, type: boolean) {
type ? "ยืนยันการเปิดใช้" : "ยืนยันการระงับใช้งาน",
type
? "ต้องการยืนยันการเปิดใช้นี้หรือไม่ ?"
: "ต้องการยืนยันระงับการใช้งานนี้หรือไม่ ?",
: "ต้องการยืนยันระงับการใช้งานนี้หรือไม่ ?"
);
}
@ -421,7 +410,7 @@ function filterFnOptions(val: string, update: Function, type: string) {
case "employeeClass":
update(() => {
employeeClassOption.value = employeeClassMain.value.filter(
(v: DataOption) => v.name.indexOf(val) > -1,
(v: DataOption) => v.name.indexOf(val) > -1
);
});
break;
@ -441,32 +430,6 @@ async function onSearchData() {
await fetchListUsers();
}
function onReSetPassword(id: string) {
dialogConfirm(
$q,
async () => {
try {
showLoader();
const messsage =
NODE_ENV.value === "production"
? "รหัสผ่านจะถูกเปลี่ยนเป็น วันเดือนปีพุทธศักราชเกิด ของผู้ใช้งาน (รูปแบบ ววดดปปปป เช่น 14042533)"
: "ระบบจะตั้งรหัสผ่านใหม่เป็น P@ssw0rd";
await http.post(config.API.resetPassword, {
keycloak: id,
});
success($q, "รีเซ็ตรหัสผ่านสำเร็จ");
dialogMessageNotify($q, messsage);
} catch (error) {
messageError($q, error);
} finally {
hideLoader();
}
},
"ยืนยันการรีเซ็ตรหัสผ่าน",
"ต้องการยืนยันการรีเซ็ตรหัสผ่านนี้หรือไม่ ?",
);
}
/**
* การเปลยนแปลงของจำนวนขอมลตอหน
* งขอมลรายชอผใชงานตามจำนวนขอมลตอหน
@ -475,7 +438,7 @@ watch(
() => pageSize.value,
() => {
fetchListUsers();
},
}
);
const tokenParsedData = ref<string[]>([]);
@ -510,7 +473,7 @@ onMounted(async () => {
<template>
<div class="row items-center">
<div class="toptitle text-dark row items-center q-py-xs">
ดการผใชงาน {{ NODE_ENV }}
ดการผใชงาน
</div>
</div>