จัดการผู้ใช้งาน => เพิ่มผู้ใช้งาน => เพิ่ม column prefix, ลบ btn แก้ไข

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-06-14 11:42:57 +07:00
parent 1e061649e0
commit 293642fd02
5 changed files with 50 additions and 20 deletions

View file

@ -3,6 +3,7 @@ import env from "../index";
const management = `${env.API_URI}/org/keycloak`;
const managementAuth = `${env.API_URI}/org/auth/authRole`;
const managementSys = `${env.API_URI}/org/auth/authSys`;
const managementPermission = `${env.API_URI}/org/auth/authRole/govoment`;
export default {
management,
@ -12,4 +13,7 @@ export default {
/** จัดการบทบาทและสิทธิ์*/
managementAuth,
/** กำหนดสิทธิ์*/
managementPermission,
};

View file

@ -9,8 +9,8 @@ import DialogHeader from "@/components/DialogHeader.vue";
/** importType*/
import type { QTableProps } from "quasar";
import type { Roles } from "@/modules/02_users/interface/response/Main";
import type { FilterReqMaster } from "@/modules/02_users/interface/request/Main";
import type { Roles } from "@/modules/02_users/interface/response/Main";
/** importStore*/
import { useCounterMixin } from "@/stores/mixin";
@ -35,6 +35,10 @@ const props = defineProps({
type: Function,
required: true,
},
dataPosMaster: {
type: Object,
required: true,
},
});
const rows = ref<Roles[]>([]);
@ -89,17 +93,27 @@ function onSubmit() {
dialogMessageNotify($q, "กรุณาเลือกสิทธิ์อย่างน้อง 1 สิทธิ์");
} else {
dialogConfirm($q, () => {
const arrayId = selected.value.map((e: Roles) => e.id);
console.log(arrayId);
showLoader();
closeDialog();
props.fetchDataTable(
reqMaster.value.id,
reqMaster.value.revisionId,
reqMaster.value.type
);
hideLoader();
const arrayId = selected.value.map((e: Roles) => e.id);
http
.post(config.API.managementPermission, {
authRoleId: arrayId[0],
posMasterId: props.dataPosMaster.id,
})
.then(() => {
closeDialog();
props.fetchDataTable(
reqMaster.value.id,
reqMaster.value.revisionId,
reqMaster.value.type
);
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
});
}
}
@ -139,17 +153,17 @@ watch(
dense
:rows-per-page-options="[10, 25, 50, 100]"
:visible-columns="visibleColumns"
selection="multiple"
selection="single"
v-model:selected="selected"
>
<template v-slot:header-selection="scope">
<!-- <template v-slot:header-selection="scope">
<q-checkbox
keep-color
color="primary"
dense
v-model="scope.selected"
/>
</template>
</template> -->
<template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer">

View file

@ -49,6 +49,15 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "prefix",
align: "left",
label: "คำนำหน้าชื่อ",
sortable: true,
field: "prefix",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "firstName",
align: "left",

View file

@ -109,12 +109,12 @@ const userId = ref<string>("");
/** List Mune*/
const itemMenu = ref<ItemsMenu[]>([
{
label: "แก้ไข",
icon: "edit",
color: "edit",
type: "edit",
},
// {
// label: "",
// icon: "edit",
// color: "edit",
// type: "edit",
// },
{
label: "จัดการสิทธิ์",
icon: "mdi-account-group",

View file

@ -198,6 +198,7 @@ const reqMaster = reactive<FilterReqMaster>({
const maxPage = ref<number>(0);
const totalRow = ref<number>(0);
const posMaster = ref<PosMaster[]>([]);
const dataPosMaster = ref<PosMaster>();
const pagination = ref<Pagination>({
page: reqMaster.page,
rowsPerPage: reqMaster.pageSize,
@ -310,6 +311,7 @@ function updatePagination(newPagination: Pagination) {
function onClickAddRole(data: PosMaster) {
modalDialogAdd.value = true;
dataPosMaster.value = data;
}
/** callblck function ทำการ fetch ข้อมูล tree เมื่อมีการเปลี่ยน Tab ปัจจับัน,แบบร่าง*/
@ -681,6 +683,7 @@ onMounted(() => {
<DialogAdd
v-model:modal="modalDialogAdd"
v-model:reqMaster="reqMaster"
:dataPosMaster="dataPosMaster as PosMaster"
:fetchDataTable="fetchDataTable"
/>
</template>