กำหนดสิทธิ์จัดการโครงสร้าง

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-09-06 16:30:07 +07:00
parent 6e9c8bf593
commit 09fdfe9f20
2 changed files with 81 additions and 27 deletions

View file

@ -30,16 +30,15 @@ const props = defineProps({
});
const qurey = reactive({
searchKeyword: "",
searchField: "fullName",
page: 1,
pageSize: 10,
searchKeyword: "", //
searchField: "fullName", // field
page: 1, //
pageSize: 10, //
});
const selected = ref<DataProfile[]>([]);
const rows = ref<DataProfile[]>([]);
const total = ref<number>(0);
const maxPage = ref<number>(0);
const selected = ref<DataProfile[]>([]); //
const rows = ref<DataProfile[]>([]); //
const total = ref<number>(0); //
const maxPage = ref<number>(0); //
const columns = ref<QTableProps["columns"]>([
{
name: "fullName",
@ -83,6 +82,12 @@ const columns = ref<QTableProps["columns"]>([
},
]);
/**
* งกนดงขอมลรายช
* @param newPage โหลดหนาแรก าเป true โหลดหนาแรก false ใหโหลดหนาปจจ
*
* เกบมลรายชอไวใน rows.value
*/
async function onSearchListPerson(newPage: boolean = false) {
qurey.page = newPage ? 1 : qurey.page;
selected.value = [];
@ -105,6 +110,11 @@ async function onSearchListPerson(newPage: boolean = false) {
});
}
/**
* งกนยนยนการเพมราช
*
* เมอเพมเสรจจะดงขอมลรายชอคนททธดการโครงสรางตามหนวยงาน
*/
function onSubmitPerson() {
dialogConfirm(
$q,
@ -142,6 +152,11 @@ function updatePagination(newPagination: Pagination) {
qurey.pageSize = newPagination.rowsPerPage;
}
/**
* งกนป popup ราชช
*
* และกำหนดคาของ qurey ไปเปนค defult rows.value และ selected.value ไปเปนคาวาง
*/
function onClose() {
modal.value = false;
qurey.page = 1;
@ -152,6 +167,11 @@ function onClose() {
selected.value = [];
}
/**
* การเปลยนแปลงของ pageSize ใน queryBody
*
* เม pageSize การเปลยนแปลงใหโหลดขอมลหนาแรก
*/
watch(
() => qurey.pageSize,
() => {
@ -165,7 +185,7 @@ watch(
<q-card style="min-width: 60%">
<DialogHeader :tittle="'รายชื่อ'" :close="onClose" />
<q-separator />
<q-card-section>
<q-card-section style="max-height: 50vh" class="scroll">
<div class="col-12">
<q-toolbar style="padding: 0">
<q-select