fix(registry): add delete button for Table Card

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2026-02-18 15:05:07 +07:00
parent 505a932b88
commit 04a76b3025
15 changed files with 151 additions and 29 deletions

View file

@ -860,7 +860,7 @@ onMounted(async () => {
icon="edit"
@click="onClickOpenDialog(true, props.row)"
>
<q-tooltip>แกไขขอม</q-tooltip>
<q-tooltip>แกไขขอม</q-tooltip>
</q-btn>
<q-btn

View file

@ -214,7 +214,7 @@ async function fetchData() {
/**
* นทกขอมลประกาศเกยรต
* @param editStatus แกไข,เพ
* @param editStatus แกไข,เพ
*/
async function addEditData(editStatus: boolean = false) {
if (!profileId.value) return;
@ -653,7 +653,7 @@ onMounted(() => {
icon="edit"
@click="onClickOpenDialog(true, props.row)"
>
<q-tooltip>แกไขขอม</q-tooltip>
<q-tooltip>แกไขขอม</q-tooltip>
</q-btn>
<q-btn

View file

@ -159,7 +159,7 @@ function fetchDataEmployment(id: string) {
/**
* function เป dialog Form อมลการจาง
* @param statusEdit สถานะการ สราง หร แกไข
* @param statusEdit สถานะการ สราง หร แกไข
* @param id รายการการจาง
*/
function onOpenDialog(statusEdit: boolean = false, id: string = "") {

View file

@ -434,7 +434,7 @@ function openDialogHistory(idOrder: string) {
id.value = idOrder;
}
/** fetch ข้อมูลประวัติการแกไขข้อมูลวินัย*/
/** fetch ข้อมูลประวัติการแกไขข้อมูลวินัย*/
async function fetchDataHistory() {
showLoader();
@ -602,7 +602,7 @@ onMounted(() => {
<q-tooltip>แกไขขอม</q-tooltip>
</q-btn>
<q-btn
v-if="checkPermission($route)?.attrIsDelete"
v-if="!isLeave && checkPermission($route)?.attrIsDelete"
color="red"
flat
dense
@ -658,8 +658,9 @@ onMounted(() => {
flat
round
@click="openDialogHistory(props.row.id)"
><q-tooltip>ประวแกไขว</q-tooltip></q-btn
>
<q-tooltip>ประวแกไขว</q-tooltip>
</q-btn>
<q-btn
v-if="isLeave == false && checkPermission($route)?.attrIsUpdate"
color="edit"
@ -667,8 +668,20 @@ onMounted(() => {
flat
round
@click="openDialogEdit(props.row)"
><q-tooltip>แกไข</q-tooltip></q-btn
>
<q-tooltip>แกไข</q-tooltip>
</q-btn>
<q-btn
v-if="!isLeave && checkPermission($route)?.attrIsDelete"
color="red"
flat
dense
round
icon="delete"
@click="handleDelete(props.row.id)"
>
<q-tooltip>ลบขอม</q-tooltip>
</q-btn>
</q-card-actions>
<q-separator />
<q-list>

View file

@ -476,7 +476,7 @@ function clickEditRowType() {
}
}
function f(id: string) {
function handleDelete(id: string) {
// dialogRemove($q, async () => {
// showLoader();
// try {
@ -615,7 +615,7 @@ onMounted(() => {
<q-tooltip>แกไขขอม</q-tooltip>
</q-btn>
<q-btn
v-if="checkPermission($route)?.attrIsDelete"
v-if="!isLeave && checkPermission($route)?.attrIsDelete"
color="red"
flat
dense
@ -651,8 +651,9 @@ onMounted(() => {
flat
round
@click="openDialogHistory(props.row.id)"
><q-tooltip>ประวแกไขการลา</q-tooltip></q-btn
>
<q-tooltip>ประวแกไขการลา</q-tooltip>
</q-btn>
<q-btn
v-if="isLeave == false && checkPermission($route)?.attrIsUpdate"
color="edit"
@ -660,8 +661,20 @@ onMounted(() => {
flat
round
@click="openDialogEdit(props.row)"
><q-tooltip>แกไขขอม</q-tooltip></q-btn
>
<q-tooltip>แกไขขอม</q-tooltip>
</q-btn>
<q-btn
v-if="!isLeave && checkPermission($route)?.attrIsDelete"
color="red"
flat
dense
round
icon="delete"
@click="handleDelete(props.row.id)"
>
<q-tooltip>ลบขอม</q-tooltip>
</q-btn>
</q-card-actions>
<q-separator />
<q-list>

View file

@ -51,7 +51,7 @@ const isLeave = defineModel<boolean>("isLeave", {
const id = ref<string>(""); //id
const modal = ref<boolean>(false); // popup
const modalHistory = ref<boolean>(false); // popup
const edit = ref<boolean>(false); //
const edit = ref<boolean>(false); //
//
const dutyData = reactive<RequestItemsObject>({
profileId: profileId.value,
@ -588,7 +588,7 @@ onMounted(() => {
<q-tooltip>แกไขขอม</q-tooltip>
</q-btn>
<q-btn
v-if="checkPermission($route)?.attrIsDelete"
v-if="!isLeave && checkPermission($route)?.attrIsDelete"
color="red"
flat
dense
@ -644,7 +644,8 @@ onMounted(() => {
flat
round
@click="openDialogHistory(props.row.id)"
><q-tooltip>ประวแกไขปฏราชการพเศษ</q-tooltip>
>
<q-tooltip>ประวแกไขปฏราชการพเศษ</q-tooltip>
</q-btn>
<q-btn
v-if="isLeave == false && checkPermission($route)?.attrIsUpdate"
@ -653,7 +654,19 @@ onMounted(() => {
flat
round
@click="openDialogEdit(props.row)"
><q-tooltip>แกไขขอม</q-tooltip>
>
<q-tooltip>แกไขขอม</q-tooltip>
</q-btn>
<q-btn
v-if="!isLeave && checkPermission($route)?.attrIsDelete"
color="red"
flat
dense
round
icon="delete"
@click="handleDelete(props.row.id)"
>
<q-tooltip>ลบขอม</q-tooltip>
</q-btn>
</q-card-actions>

View file

@ -224,8 +224,8 @@ async function fetchData() {
.get(config.API.profileAssistance(empType.value, profileId.value))
.then((res) => {
const data = res.data.result;
rows.value = data;
rowsMain.value = data;
serchDataTable();
})
.catch((err) => {
messageError($q, err);
@ -600,7 +600,11 @@ onMounted(() => {
</q-btn>
<q-btn
v-if="checkPermission($route)?.attrIsDelete && !props.row.commandId"
v-if="
!isLeave &&
checkPermission($route)?.attrIsDelete &&
!props.row.commandId
"
color="red"
flat
dense
@ -694,6 +698,22 @@ onMounted(() => {
>
<q-tooltip>งตวกล</q-tooltip>
</q-btn>
<q-btn
v-if="
!isLeave &&
checkPermission($route)?.attrIsDelete &&
!props.row.commandId
"
color="red"
flat
dense
round
icon="delete"
@click="handleDelete(props.row.id)"
>
<q-tooltip>ลบขอม</q-tooltip>
</q-btn>
</q-card-actions>
<q-separator />

View file

@ -616,7 +616,7 @@ async function fetchDataTenure() {
/**
* function เลอกประเภทตำแหน
* @param val id ประเภทตำแหน
* @param status แกไข , เพ
* @param status แกไข , เพ
*/
async function updateSelectType(val: string, status: boolean = false) {
const listLevel = val

View file

@ -162,7 +162,7 @@ function openDialogHistory(idOrder: string) {
modalHistory.value = true;
}
/** ฟังก์ชันดึงข้อมูลประวัติการแกไขข้อมูล*/
/** ฟังก์ชันดึงข้อมูลประวัติการแกไขข้อมูล*/
async function fetchDataHistory() {
showLoader();
try {

View file

@ -59,7 +59,7 @@ const modal = ref<boolean>(false); // แสดงฟอร์มแก้ไข
const informaData = ref<ResponseObject>(); //
const modalHistory = ref<boolean>(false); //
const age = ref<string | null>(""); //
const formData = reactive<RequestObject>(store.defaultProfile); //
const formData = reactive<RequestObject>(store.defaultProfile); //
const emailVerify = ref<string | null>("");
/** ข้อมูล Label*/

View file

@ -367,7 +367,7 @@ function closeDialog() {
/**
* function แกไขขอม
* @param type ประเภทของบคคล
* @param isStatusEdit สถานะแกไข
* @param isStatusEdit สถานะแกไข
* @param data อมลเด
*/
function onOpenDialogForm(

View file

@ -753,7 +753,7 @@ onMounted(async () => {
</q-btn>
<q-btn
v-if="checkPermission($route)?.attrIsDelete"
v-if="!isLeave && checkPermission($route)?.attrIsDelete"
color="red"
flat
dense
@ -790,7 +790,7 @@ onMounted(async () => {
<q-tooltip>ประวแกไขประวการศกษา</q-tooltip>
</q-btn>
<q-btn
v-if="isLeave == false"
v-if="isLeave == false && checkPermission($route)?.attrIsUpdate"
dense
flat
round
@ -800,6 +800,18 @@ onMounted(async () => {
>
<q-tooltip>แกไขขอม</q-tooltip>
</q-btn>
<q-btn
v-if="!isLeave && checkPermission($route)?.attrIsDelete"
color="red"
flat
dense
round
icon="delete"
@click="handleDelete(props.row.id)"
>
<q-tooltip>ลบขอม</q-tooltip>
</q-btn>
</q-card-actions>
<q-separator />
<q-list>

View file

@ -546,7 +546,7 @@ onMounted(() => {
</q-btn>
<q-btn
v-if="checkPermission($route)?.attrIsDelete"
v-if="!isLeave && checkPermission($route)?.attrIsDelete"
color="red"
flat
dense
@ -605,7 +605,7 @@ onMounted(() => {
<q-tooltip>ประวแกไขความสามารถพเศษ</q-tooltip>
</q-btn>
<q-btn
v-if="isLeave == false"
v-if="isLeave == false && checkPermission($route)?.attrIsUpdate"
dense
flat
round
@ -620,6 +620,18 @@ onMounted(() => {
>
<q-tooltip>แกไขขอม</q-tooltip>
</q-btn>
<q-btn
v-if="!isLeave && checkPermission($route)?.attrIsDelete"
color="red"
flat
dense
round
icon="delete"
@click="handleDelete(props.row.id)"
>
<q-tooltip>ลบขอม</q-tooltip>
</q-btn>
</q-card-actions>
<q-separator />
<q-list>

View file

@ -596,7 +596,7 @@ async function fetchDataOptionExecutive() {
/**
* function เลอกประเภทตำแหน
* @param val id ประเภทตำแหน
* @param status แกไข , เพ
* @param status แกไข , เพ
*/
async function updateSelectType(val: string, status: boolean = false) {
const listLevel = val

View file

@ -295,8 +295,8 @@ async function getData() {
await http
.get(config.API.profileNewNoPaidByProfileId(profileId.value, empType.value))
.then(async (res) => {
rows.value = await res.data.result;
rowsMain.value = await res.data.result;
serchDataTable();
})
.catch((e) => {
messageError($q, e);
@ -335,6 +335,21 @@ function serchDataTable() {
);
}
function handleDelete(id: string) {
// dialogRemove($q, async () => {
// showLoader();
// try {
// await http.delete(config.API.profileChangeNameUpdate + `${id}`);
// await getData();
// success($q, "");
// } catch (err) {
// messageError($q, err);
// } finally {
// hideLoader();
// }
// });
}
/** ทำงานเมื่อ Components ถูกเรียกใช้งาน */
onMounted(() => {
getData();
@ -460,6 +475,18 @@ onMounted(() => {
>
<q-tooltip>แกไขขอม</q-tooltip>
</q-btn>
<q-btn
v-if="!isLeave && checkPermission($route)?.attrIsDelete"
color="red"
flat
dense
round
icon="delete"
@click="handleDelete(props.row.id)"
>
<q-tooltip>ลบขอม</q-tooltip>
</q-btn>
</q-td>
<q-td
v-for="col in props.cols"
@ -517,7 +544,19 @@ onMounted(() => {
icon="edit"
@click="onClickOpenDialog(true, props.row)"
>
<q-tooltip>แกไขขอม</q-tooltip>
<q-tooltip>แกไขขอม</q-tooltip>
</q-btn>
<q-btn
v-if="!isLeave && checkPermission($route)?.attrIsDelete"
color="red"
flat
dense
round
icon="delete"
@click="handleDelete(props.row.id)"
>
<q-tooltip>ลบขอม</q-tooltip>
</q-btn>
</q-card-actions>
<q-separator />