This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-11-22 16:56:40 +07:00
parent 7f3eb5225f
commit 4c35662eed
22 changed files with 632 additions and 343 deletions

View file

@ -10,6 +10,7 @@
dense dense
:pagination-label="paginationLabel" :pagination-label="paginationLabel"
v-model:pagination="pagination" v-model:pagination="pagination"
:rows-per-page-options="[10, 25, 50, 100]"
> >
<template v-slot:pagination="scope"> <template v-slot:pagination="scope">
งหมด {{ attrs.rows.length }} รายการ งหมด {{ attrs.rows.length }} รายการ
@ -42,7 +43,6 @@ const props = defineProps({
}, },
}); });
const pagination = ref({ const pagination = ref({
sortBy: "desc", sortBy: "desc",
descending: false, descending: false,

View file

@ -73,7 +73,7 @@ const columns = ref<QTableProps["columns"]>([
{ {
name: "createdAt", name: "createdAt",
align: "center", align: "left",
label: "วันที่สร้าง", label: "วันที่สร้าง",
sortable: true, sortable: true,
field: "createdAt", field: "createdAt",
@ -85,7 +85,7 @@ const columns = ref<QTableProps["columns"]>([
{ {
name: "lastUpdatedAt", name: "lastUpdatedAt",
align: "center", align: "left",
label: "วันที่แก้ไข", label: "วันที่แก้ไข",
sortable: true, sortable: true,
field: "lastUpdatedAt", field: "lastUpdatedAt",
@ -308,7 +308,6 @@ onMounted(async () => {
map-options map-options
:options="columns" :options="columns"
option-value="name" option-value="name"
style="min-width: 140px" style="min-width: 140px"
/> />
</div> </div>
@ -382,7 +381,7 @@ onMounted(async () => {
/> />
</div> </div>
<div v-else> <div v-else>
{{ col.value }} {{ col.value ?? "-" }}
</div> </div>
</q-td> </q-td>
</q-tr> </q-tr>
@ -397,7 +396,9 @@ onMounted(async () => {
<q-card style="max-width: 350px"> <q-card style="max-width: 350px">
<q-form greedy @submit.prevent @validation-success="onSubmit"> <q-form greedy @submit.prevent @validation-success="onSubmit">
<dialog-header <dialog-header
:tittle="dialogStatus == 'edit' ? 'แก้ไขข้อมูล' : 'เพิ่มข้อมูล'" :tittle="
dialogStatus == 'edit' ? 'แก้ไขเครื่องราชฯ' : 'เพิ่มเครื่องราชฯ'
"
:close="closeDialog" :close="closeDialog"
/> />

View file

@ -82,6 +82,7 @@ const dialog = ref<boolean>(false); // เพิ่มข้อมูล,แก
const dialogStatus = ref<string>(""); // , const dialogStatus = ref<string>(""); // ,
const personalName = ref<string>("เขต/อำเภอ"); //label input const personalName = ref<string>("เขต/อำเภอ"); //label input
const rows = ref<FormDistrict[]>([]); // / const rows = ref<FormDistrict[]>([]); // /
const provinceName = ref<string>(""); //
/** /**
* fetch อมลรายการ ระดบการเขต/อำเภอ ตาม id ของจงหว * fetch อมลรายการ ระดบการเขต/อำเภอ ตาม id ของจงหว
@ -94,6 +95,7 @@ async function fetchData() {
.get(config.API.orgProvince + `/${id.value}`) .get(config.API.orgProvince + `/${id.value}`)
.then(async (res) => { .then(async (res) => {
const data = await res.data.result.districts; const data = await res.data.result.districts;
provinceName.value = await res.data.result.name;
const list = data.map((e: FormDistrict) => ({ const list = data.map((e: FormDistrict) => ({
...e, ...e,
@ -187,7 +189,7 @@ onMounted(async () => {
class="q-mr-sm" class="q-mr-sm"
@click="router.go(-1)" @click="router.go(-1)"
/> />
เขต/อำเภอ เขต/อำเภอ {{ `(${provinceName})` }}
</div> </div>
<q-card flat bordered> <q-card flat bordered>
@ -227,7 +229,6 @@ onMounted(async () => {
map-options map-options
:options="columns" :options="columns"
option-value="name" option-value="name"
style="min-width: 140px" style="min-width: 140px"
/> />
</div> </div>
@ -283,7 +284,7 @@ onMounted(async () => {
@click="nextPage(props.row.id)" @click="nextPage(props.row.id)"
> >
<div> <div>
{{ col.value }} {{ col.value ?? "-" }}
</div> </div>
</q-td> </q-td>
</q-tr> </q-tr>

View file

@ -95,6 +95,7 @@ const subDistrict = ref<string>(""); //แขวง / ตำบล;
const zipCode = ref<string>(""); // const zipCode = ref<string>(""); //
const dialogStatus = ref<string>(""); // , const dialogStatus = ref<string>(""); // ,
const personalName = ref<string>("แขวง/ตำบล"); //label input const personalName = ref<string>("แขวง/ตำบล"); //label input
const subdistrict = ref<string>(""); ///
/** /**
* fetch อมลรายการ ระดบการเขต/อำเภอ ตาม id ของแขวง/ตำบล * fetch อมลรายการ ระดบการเขต/อำเภอ ตาม id ของแขวง/ตำบล
@ -107,6 +108,7 @@ async function fetchData() {
.get(config.API.orgDistrict + `/${id.value}`) .get(config.API.orgDistrict + `/${id.value}`)
.then(async (res) => { .then(async (res) => {
const data = await res.data.result.subDistricts; const data = await res.data.result.subDistricts;
subdistrict.value = await res.data.result.name;
const list = data.map((e: FormSubDistrict) => ({ const list = data.map((e: FormSubDistrict) => ({
...e, ...e,
createdAt: e.createdAt ? date2Thai(new Date(e.createdAt)) : "", createdAt: e.createdAt ? date2Thai(new Date(e.createdAt)) : "",
@ -192,7 +194,7 @@ onMounted(async () => {
class="q-mr-sm" class="q-mr-sm"
@click="router.go(-1)" @click="router.go(-1)"
/> />
แขวง/ตำบล แขวง/ตำบล {{ `(${subdistrict})` }}
</div> </div>
<q-card flat bordered> <q-card flat bordered>
@ -233,7 +235,6 @@ onMounted(async () => {
map-options map-options
:options="columns" :options="columns"
option-value="name" option-value="name"
style="min-width: 140px" style="min-width: 140px"
/> />
</div> </div>
@ -286,7 +287,7 @@ onMounted(async () => {
</q-td> </q-td>
<q-td v-for="col in props.cols" :key="col.id"> <q-td v-for="col in props.cols" :key="col.id">
<div> <div>
{{ col.value }} {{ col.value ?? "-" }}
</div> </div>
</q-td> </q-td>
</q-tr> </q-tr>

View file

@ -68,12 +68,42 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
}, },
{
name: "createdAt",
align: "left",
label: "วันที่สร้าง",
sortable: true,
field: "createdAt",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "lastUpdatedAt",
align: "left",
label: "วันที่แก้ไข",
sortable: true,
field: "lastUpdatedAt",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "lastUpdateFullName",
align: "left",
label: "ผู้ดำเนินการ",
sortable: true,
field: "lastUpdateFullName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
]); ]);
const visibleColumns = ref<string[]>([ const visibleColumns = ref<string[]>([
"no", "no",
"posDictName", "posDictName",
"posTypeName", "posTypeName",
"posLevelName", "posLevelName",
"createdAt",
"lastUpdatedAt",
"lastUpdateFullName",
]); ]);
// //
const optionFilter = ref<DataOption[]>([ const optionFilter = ref<DataOption[]>([
@ -269,21 +299,9 @@ onMounted(async () => {
}); });
</script> </script>
<template> <template>
<div class="row col-12 q-mb-sm"> <div class="row col-12 q-mb-sm q-col-gutter-sm">
<div class="col-md-2"> <div class="row col-12">
<q-btn <q-space />
id="addComplaints"
for="addComplaints"
size="12px"
flat
round
color="primary"
icon="mdi-plus"
@click="onClickOpenDialog()"
><q-tooltip>เพมตำเเหน </q-tooltip></q-btn
>
</div>
<div class="row col-md-10 q-col-gutter-sm"> <div class="row col-md-10 q-col-gutter-sm">
<div class="col-md-4"> <div class="col-md-4">
<q-select <q-select
@ -332,6 +350,35 @@ onMounted(async () => {
</div> </div>
</div> </div>
</div> </div>
<div class="row col-12">
<q-btn
id="addComplaints"
for="addComplaints"
size="12px"
flat
round
color="primary"
icon="mdi-plus"
@click="onClickOpenDialog()"
><q-tooltip>เพมตำเเหน </q-tooltip></q-btn
>
<q-space />
<q-select
v-model="visibleColumns"
multiple
outlined
dense
options-dense
:display-value="$q.lang.table.columns"
emit-value
map-options
:options="columns"
option-value="name"
style="min-width: 140px"
/>
</div>
</div>
<div class="full-width q-mt-sm"> <div class="full-width q-mt-sm">
<d-table <d-table

View file

@ -57,11 +57,41 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
}, },
{
name: "createdAt",
align: "left",
label: "วันที่สร้าง",
sortable: true,
field: "createdAt",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "lastUpdatedAt",
align: "left",
label: "วันที่แก้ไข",
sortable: true,
field: "lastUpdatedAt",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "lastUpdateFullName",
align: "left",
label: "ผู้ดำเนินการ",
sortable: true,
field: "lastUpdateFullName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
]); ]);
const visibleColumns = ref<string[]>([ const visibleColumns = ref<string[]>([
"posTypeName", "posTypeName",
"posTypeShortName", "posTypeShortName",
"posTypeRank", "posTypeRank",
"createdAt",
"lastUpdatedAt",
"lastUpdateFullName",
]); ]);
// //
@ -204,7 +234,6 @@ onMounted(async () => {
map-options map-options
:options="columns" :options="columns"
option-value="name" option-value="name"
style="min-width: 140px" style="min-width: 140px"
/> />
</div> </div>

View file

@ -70,12 +70,42 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
}, },
{
name: "createdAt",
align: "left",
label: "วันที่สร้าง",
sortable: true,
field: "createdAt",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "lastUpdatedAt",
align: "left",
label: "วันที่แก้ไข",
sortable: true,
field: "lastUpdatedAt",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "lastUpdateFullName",
align: "left",
label: "ผู้ดำเนินการ",
sortable: true,
field: "lastUpdateFullName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
]); ]);
const visibleColumns = ref<string[]>([ const visibleColumns = ref<string[]>([
"no", "no",
"posLevelName", "posLevelName",
"posTypeName", "posTypeName",
"posLevelAuthority", "posLevelAuthority",
"createdAt",
"lastUpdatedAt",
"lastUpdateFullName",
]); ]);
const posTypeId = ref<string>(route.params.id.toString()); // id const posTypeId = ref<string>(route.params.id.toString()); // id
@ -248,7 +278,6 @@ onMounted(() => {
map-options map-options
:options="columns" :options="columns"
option-value="name" option-value="name"
style="min-width: 140px" style="min-width: 140px"
/> />
</div> </div>
@ -298,7 +327,7 @@ onMounted(() => {
{{ col.value ? convertPosLevelAuthority(col.value) : "-" }} {{ col.value ? convertPosLevelAuthority(col.value) : "-" }}
</div> </div>
<div v-else> <div v-else>
{{ col.value }} {{ col.value ?? "-" }}
</div> </div>
</q-td> </q-td>
</q-tr> </q-tr>
@ -365,7 +394,6 @@ onMounted(() => {
outlined outlined
dense dense
bg-color="white" bg-color="white"
hide-bottom-space hide-bottom-space
readonly readonly
/> />

View file

@ -94,6 +94,33 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
}, },
{
name: "createdAt",
align: "left",
label: "วันที่สร้าง",
sortable: true,
field: "createdAt",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "lastUpdatedAt",
align: "left",
label: "วันที่แก้ไข",
sortable: true,
field: "lastUpdatedAt",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "lastUpdateFullName",
align: "left",
label: "ผู้ดำเนินการ",
sortable: true,
field: "lastUpdateFullName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
]); ]);
const visibleColumns = ref<string[]>([ const visibleColumns = ref<string[]>([
"no", "no",
@ -104,6 +131,9 @@ const visibleColumns = ref<string[]>([
"posExecutiveName", "posExecutiveName",
"positionExecutiveField", "positionExecutiveField",
"positionArea", "positionArea",
"createdAt",
"lastUpdatedAt",
"lastUpdateFullName",
]); ]);
// //
@ -254,21 +284,9 @@ onMounted(async () => {
<template> <template>
<q-form @submit.prevent="fetchData()"> <q-form @submit.prevent="fetchData()">
<div class="row col-12 q-mb-sm"> <div class="row col-12 q-mb-sm q-col-gutter-sm">
<div class="col-md-2"> <div class="row col-12">
<q-btn <q-space />
id="addComplaints"
for="addComplaints"
size="12px"
flat
round
color="primary"
icon="mdi-plus"
@click="popupAdd()"
><q-tooltip>เพมตำเเหน </q-tooltip></q-btn
>
</div>
<div class="row col-md-10 q-col-gutter-sm"> <div class="row col-md-10 q-col-gutter-sm">
<div class="col-md-4"> <div class="col-md-4">
<q-select <q-select
@ -318,6 +336,36 @@ onMounted(async () => {
</div> </div>
</div> </div>
</div> </div>
<div class="row col-12">
<q-btn
id="addComplaints"
for="addComplaints"
size="12px"
flat
round
color="primary"
icon="mdi-plus"
@click="popupAdd()"
><q-tooltip>เพมตำเเหน </q-tooltip></q-btn
>
<q-space />
<q-select
v-model="visibleColumns"
multiple
outlined
dense
options-dense
:display-value="$q.lang.table.columns"
emit-value
map-options
:options="columns"
option-value="name"
style="min-width: 140px"
/>
</div>
</div>
</q-form> </q-form>
<div class="full-width q-mt-sm"> <div class="full-width q-mt-sm">

View file

@ -77,7 +77,13 @@ const columns = [
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
}, },
] as const satisfies QTableProps["columns"]; ] as const satisfies QTableProps["columns"];
const visibleColumns = ref<string[]>(["posTypeName", "posTypeRank"]); const visibleColumns = ref<string[]>([
"posTypeName",
"posTypeRank",
"createdAt",
"lastUpdatedAt",
"lastUpdateFullName",
]);
const editId = ref<string>(""); // id const editId = ref<string>(""); // id
const dialog = ref<boolean>(false); // modal popu , const dialog = ref<boolean>(false); // modal popu ,
@ -201,7 +207,6 @@ onMounted(async () => {
map-options map-options
:options="columns" :options="columns"
option-value="name" option-value="name"
style="min-width: 140px" style="min-width: 140px"
/> />
</div> </div>
@ -257,7 +262,7 @@ onMounted(async () => {
</q-btn> </q-btn>
</q-td> </q-td>
<q-td v-for="col in props.cols" :key="col.id"> <q-td v-for="col in props.cols" :key="col.id">
{{ col.value }} {{ col.value ?? "-" }}
</q-td> </q-td>
</q-tr> </q-tr>
</template> </template>

View file

@ -21,6 +21,9 @@ const visibleColumns = ref<string[]>([
"no", "no",
"posExecutiveName", "posExecutiveName",
"posExecutivePriority", "posExecutivePriority",
"createdAt",
"lastUpdatedAt",
"lastUpdateFullName",
]); ]);
const columns = ref<QTableProps["columns"]>([ const columns = ref<QTableProps["columns"]>([
{ {
@ -50,6 +53,33 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
}, },
{
name: "createdAt",
align: "left",
label: "วันที่สร้าง",
sortable: true,
field: "createdAt",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "lastUpdatedAt",
align: "left",
label: "วันที่แก้ไข",
sortable: true,
field: "lastUpdatedAt",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "lastUpdateFullName",
align: "left",
label: "ผู้ดำเนินการ",
sortable: true,
field: "lastUpdateFullName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
]); ]);
const dataEdit = ref<RowListForm>(); // const dataEdit = ref<RowListForm>(); //
@ -130,7 +160,6 @@ onMounted(async () => {
map-options map-options
:options="columns" :options="columns"
option-value="name" option-value="name"
style="min-width: 140px" style="min-width: 140px"
/> />
</div> </div>
@ -197,7 +226,7 @@ onMounted(async () => {
{{ props.rowIndex + 1 }} {{ props.rowIndex + 1 }}
</div> </div>
<div v-else> <div v-else>
{{ col.value }} {{ col.value ?? "-" }}
</div> </div>
</q-td> </q-td>
</q-tr> </q-tr>

View file

@ -126,6 +126,9 @@ const visibleColumns = ref<string[]>([
"posLevelName", "posLevelName",
"posLevelRank", "posLevelRank",
"posLevelAuthority", "posLevelAuthority",
"createdAt",
"lastUpdatedAt",
"lastUpdateFullName",
]); ]);
const id = ref<string>(route.params.id.toString()); // const id = ref<string>(route.params.id.toString()); //
@ -295,7 +298,6 @@ onMounted(async () => {
map-options map-options
:options="columns" :options="columns"
option-value="name" option-value="name"
style="min-width: 140px" style="min-width: 140px"
/> />
</div> </div>
@ -376,7 +378,7 @@ onMounted(async () => {
{{ posName }} {{ posName }}
</div> </div>
<div v-else> <div v-else>
{{ col.value }} {{ col.value ?? "-" }}
</div> </div>
</q-td> </q-td>
</q-tr> </q-tr>
@ -458,7 +460,6 @@ onMounted(async () => {
outlined outlined
dense dense
bg-color="white" bg-color="white"
hide-bottom-space hide-bottom-space
readonly readonly
/> />

View file

@ -20,8 +20,8 @@ export const usePositionDataStore = defineStore("PositionData", () => {
posTypeId: e.posTypes?.id, posTypeId: e.posTypes?.id,
posTypeName: e.posTypes?.posTypeName, posTypeName: e.posTypes?.posTypeName,
posTypeRank: e.posTypes?.posTypeRank, posTypeRank: e.posTypes?.posTypeRank,
createdAt: e.createdAt ? date2Thai(e.createdAt) : "", createdAt: e.createdAt ? date2Thai(e.createdAt) : "-",
lastUpdatedAt: e.lastUpdatedAt ? date2Thai(e.lastUpdatedAt) : "", lastUpdatedAt: e.lastUpdatedAt ? date2Thai(e.lastUpdatedAt) : "-",
posLevelAuthority: e.posLevelAuthority posLevelAuthority: e.posLevelAuthority
? storeOption.posLevelAuthorityConvert(e.posLevelAuthority) ? storeOption.posLevelAuthorityConvert(e.posLevelAuthority)
: "-", : "-",

View file

@ -22,8 +22,8 @@ export const usePositionTypeDataStore = defineStore("PositionTypeData", () => {
...e, ...e,
posTypes: undefined, posTypes: undefined,
posTypeId: e.posTypes?.id, posTypeId: e.posTypes?.id,
createdAt: e.createdAt ? date2Thai(e.createdAt) : "", createdAt: e.createdAt ? date2Thai(e.createdAt) : "-",
lastUpdatedAt: e.lastUpdatedAt ? date2Thai(e.lastUpdatedAt) : "", lastUpdatedAt: e.lastUpdatedAt ? date2Thai(e.lastUpdatedAt) : "-",
})) satisfies DataRow[]; })) satisfies DataRow[];
row.value = list; row.value = list;
} }

View file

@ -34,7 +34,7 @@ const columns = ref<QTableProps["columns"]>([
}, },
{ {
name: "createdAt", name: "createdAt",
align: "center", align: "left",
label: "วันที่สร้าง", label: "วันที่สร้าง",
sortable: true, sortable: true,
field: "createdAt", field: "createdAt",
@ -45,7 +45,7 @@ const columns = ref<QTableProps["columns"]>([
}, },
{ {
name: "lastUpdatedAt", name: "lastUpdatedAt",
align: "center", align: "left",
label: "วันที่แก้ไข", label: "วันที่แก้ไข",
sortable: true, sortable: true,
field: "lastUpdatedAt", field: "lastUpdatedAt",
@ -214,7 +214,6 @@ onMounted(async () => {
map-options map-options
:options="columns" :options="columns"
option-value="name" option-value="name"
style="min-width: 140px" style="min-width: 140px"
/> />
</div> </div>
@ -300,7 +299,11 @@ onMounted(async () => {
<q-card style="max-width: 350px"> <q-card style="max-width: 350px">
<q-form greedy @submit.prevent @validation-success="onSubmit"> <q-form greedy @submit.prevent @validation-success="onSubmit">
<dialog-header <dialog-header
:tittle="dialogStatus === 'edit' ? 'แก้ไขข้อมูล' : 'เพิ่มข้อมูล'" :tittle="
dialogStatus === 'edit'
? 'แก้ไขประเภทเครื่องราชฯ'
: 'เพิ่มประเภทเครื่องราชฯ'
"
:close="closeDialog" :close="closeDialog"
/> />

View file

@ -193,7 +193,7 @@ watch(
dense dense
v-model="qurey.searchField" v-model="qurey.searchField"
:options="store.searchFieldOption" :options="store.searchFieldOption"
label="เลือกที่ต้องการค้นหา" label="ค้นหาจาก"
emit-value emit-value
map-options map-options
option-label="name" option-label="name"
@ -206,7 +206,7 @@ watch(
outlined outlined
dense dense
v-model="qurey.searchKeyword" v-model="qurey.searchKeyword"
label="คำค้นหา" label="คำค้น"
clearable clearable
> >
<template v-slot:append v-if="!qurey.searchKeyword"> <template v-slot:append v-if="!qurey.searchKeyword">

View file

@ -315,8 +315,8 @@ watch(
</script> </script>
<template> <template>
<q-dialog v-model="modal" persistent full-width> <q-dialog v-model="modal" persistent>
<q-card> <q-card style="min-width: 80vw">
<q-form greedy @submit.prevent @validation-success="onSubmit"> <q-form greedy @submit.prevent @validation-success="onSubmit">
<DialogHeader <DialogHeader
:tittle="isStatusEdit ? 'แก้ไขผู้ใช้งาน' : 'เพิ่มผู้ใช้งาน'" :tittle="isStatusEdit ? 'แก้ไขผู้ใช้งาน' : 'เพิ่มผู้ใช้งาน'"
@ -324,9 +324,10 @@ watch(
/> />
<q-separator /> <q-separator />
<q-card-section :horizontal="$q.screen.gt.xs"> <q-card-section :horizontal="$q.screen.gt.md" style="padding: 0px">
<div class="row col-12 q-gutter-sm">
<!-- รายช --> <!-- รายช -->
<q-card-section class="col-md-8 col-xs-12"> <div class="q-pa-md col-md-8 col-xs-12">
<div class="row q-col-gutter-sm"> <div class="row q-col-gutter-sm">
<div class="col-12 col-sm-6 col-md-3"> <div class="col-12 col-sm-6 col-md-3">
<q-select <q-select
@ -432,11 +433,12 @@ watch(
</template> </template>
</d-table> </d-table>
</div> </div>
</q-card-section> </div>
<q-separator vertical /> <q-separator vertical />
<!-- input --> <!-- input -->
<q-card-section class="col-md-4 col-xs-12"> <div class="q-pa-md col">
<div class="row q-col-gutter-md"> <div class="row q-col-gutter-md">
<div class="col-12"> <div class="col-12">
<q-input <q-input
@ -507,11 +509,11 @@ watch(
v-model="formData.email" v-model="formData.email"
outlined outlined
dense dense
:rules="[(val:string) => !!val || `${'กรุณากรอก Email'}`,]" :rules="[(val:string) => !!val || `${'กรุณากรอก อีเมล'}`,]"
lazy-rules lazy-rules
hide-bottom-space hide-bottom-space
class="inputgreen" class="inputgreen"
label="Email" label="อีเมล"
type="email" type="email"
> >
</q-input> </q-input>
@ -536,7 +538,8 @@ watch(
/> />
</div> </div>
</div> </div>
</q-card-section> </div>
</div>
</q-card-section> </q-card-section>
<q-separator /> <q-separator />

View file

@ -62,7 +62,7 @@ const columns = ref<QTableProps["columns"]>([
{ {
name: "email", name: "email",
align: "left", align: "left",
label: "Email", label: "อีเมล",
sortable: true, sortable: true,
field: "email", field: "email",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",

View file

@ -6,6 +6,7 @@ import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
import { usePermissionsStore } from "@/modules/02_users/stores/permissions"; import { usePermissionsStore } from "@/modules/02_users/stores/permissions";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import { tokenParsed } from "@/plugins/auth";
/** importType*/ /** importType*/
import type { QTableProps } from "quasar"; import type { QTableProps } from "quasar";
@ -69,6 +70,15 @@ const expanded = ref<string[]>([]); // แสดงข้อมูลในโ
const nodeId = ref<string>(""); // id const nodeId = ref<string>(""); // id
/** Table*/ /** Table*/
const visibleColumns = ref<string[]>([
"no",
"posMasterNo",
"positionName",
"posTypeName",
"posLevelName",
"positionIsSelected",
"authRoleName",
]);
const columns = ref<QTableProps["columns"]>([ const columns = ref<QTableProps["columns"]>([
{ {
name: "no", name: "no",
@ -277,6 +287,11 @@ async function fetchOrganizationActive() {
* @param id id โครงสราง * @param id id โครงสราง
*/ */
async function fetchDataTree(id: string) { async function fetchDataTree(id: string) {
const tokenParsedData = await tokenParsed();
const isSuperAdmin = tokenParsedData.role.includes("SUPER_ADMIN");
if (!isSuperAdmin) {
nodes.value = [];
}
showLoader(); showLoader();
await http await http
.get(config.API.orgByid(id.toString())) .get(config.API.orgByid(id.toString()))
@ -284,6 +299,7 @@ async function fetchDataTree(id: string) {
const data = await res.data.result; const data = await res.data.result;
nodes.value.push(...data); nodes.value.push(...data);
nodes.value[0].orgRevisionId = id; nodes.value[0].orgRevisionId = id;
nodeId.value = nodes.value[0].orgTreeId;
await fetchDataTable(reqMaster.id, id, reqMaster.type); await fetchDataTable(reqMaster.id, id, reqMaster.type);
}) })
.catch((err) => { .catch((err) => {
@ -622,6 +638,22 @@ onMounted(() => {
</template> </template>
</q-input> </q-input>
</div> </div>
<div>
<q-select
v-model="visibleColumns"
multiple
outlined
dense
options-dense
:display-value="$q.lang.table.columns"
emit-value
map-options
:options="columns"
option-value="name"
style="min-width: 140px"
/>
</div>
</div> </div>
</q-toolbar> </q-toolbar>
<d-table <d-table
@ -636,6 +668,7 @@ onMounted(() => {
:rows-per-page-options="[10, 25, 50, 100]" :rows-per-page-options="[10, 25, 50, 100]"
@update:pagination="updatePagination" @update:pagination="updatePagination"
v-model:pagination="pagination" v-model:pagination="pagination"
:visible-columns="visibleColumns"
> >
<template v-slot:header="props"> <template v-slot:header="props">
<q-tr :props="props"> <q-tr :props="props">

View file

@ -6,6 +6,7 @@ import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import { useDataStoreUser } from "@/modules/02_users/stores/main"; import { useDataStoreUser } from "@/modules/02_users/stores/main";
import { tokenParsed } from "@/plugins/auth";
import type { QTableProps } from "quasar"; import type { QTableProps } from "quasar";
import type { import type {
@ -59,6 +60,12 @@ const personId = ref<string>("");
* เกบขอมลโครงสรางไวใน nodeTree * เกบขอมลโครงสรางไวใน nodeTree
*/ */
async function fatchOrg() { async function fatchOrg() {
const tokenParsedData = await tokenParsed();
const isSuperAdmin = tokenParsedData.role.includes("SUPER_ADMIN");
if (!isSuperAdmin) {
nodeTree.value = [];
}
showLoader(); showLoader();
await http await http
.get(config.API.permissionOrg) .get(config.API.permissionOrg)
@ -127,6 +134,7 @@ const columns = ref<QTableProps["columns"]>([
style: "font-size: 14px", style: "font-size: 14px",
}, },
]); ]);
const visibleColumns = ref<string[]>(["fullName", "orgNew"]);
const modalAdd = ref<boolean>(false); // modal const modalAdd = ref<boolean>(false); // modal
/** /**
@ -363,6 +371,23 @@ onMounted(async () => {
</div> </div>
</div> </div>
<div class="row col-12 q-mt-sm">
<q-space />
<q-select
v-model="visibleColumns"
multiple
outlined
dense
options-dense
:display-value="$q.lang.table.columns"
emit-value
map-options
:options="columns"
option-value="name"
style="min-width: 140px"
/>
</div>
<div class="col-12 q-mt-sm"> <div class="col-12 q-mt-sm">
<d-table <d-table
:columns="columns" :columns="columns"
@ -374,6 +399,7 @@ onMounted(async () => {
dense dense
:rows-per-page-options="[10, 25, 50, 100]" :rows-per-page-options="[10, 25, 50, 100]"
@update:pagination="updatePagination" @update:pagination="updatePagination"
:visible-columns="visibleColumns"
> >
<template v-slot:header="props"> <template v-slot:header="props">
<q-tr :props="props"> <q-tr :props="props">

View file

@ -5,6 +5,7 @@ import { useQuasar } from "quasar";
import http from "@/plugins/http"; import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import { tokenParsed } from "@/plugins/auth";
/** importType*/ /** importType*/
import type { QTableProps } from "quasar"; import type { QTableProps } from "quasar";
@ -66,6 +67,15 @@ const nodeId = ref<string>(""); // id โหนด
const isOfficer = ref<boolean>(false); // columns . const isOfficer = ref<boolean>(false); // columns .
/** Table*/ /** Table*/
const visibleColumns = ref<string[]>([
"no",
"posMasterNo",
"positionName",
"posTypeName",
"posLevelName",
"positionIsSelected",
"isPosMasterAssign",
]);
const columns = ref<QTableProps["columns"]>([ const columns = ref<QTableProps["columns"]>([
{ {
name: "no", name: "no",
@ -260,6 +270,11 @@ async function fetchOrganizationActive() {
* @param id id โครงสราง * @param id id โครงสราง
*/ */
async function fetchDataTree(id: string) { async function fetchDataTree(id: string) {
const tokenParsedData = await tokenParsed();
const isSuperAdmin = tokenParsedData.role.includes("SUPER_ADMIN");
if (!isSuperAdmin) {
nodes.value = [];
}
showLoader(); showLoader();
await http await http
.get(config.API.orgByid(id.toString())) .get(config.API.orgByid(id.toString()))
@ -267,6 +282,7 @@ async function fetchDataTree(id: string) {
const data = await res.data.result; const data = await res.data.result;
nodes.value.push(...data); nodes.value.push(...data);
nodes.value[0].orgRevisionId = id; nodes.value[0].orgRevisionId = id;
nodeId.value = nodes.value[0].orgTreeId;
await fetchDataTable(reqMaster.id, id, reqMaster.type); await fetchDataTable(reqMaster.id, id, reqMaster.type);
}) })
.catch((err) => { .catch((err) => {
@ -553,6 +569,22 @@ onMounted(() => {
</template> </template>
</q-input> </q-input>
</div> </div>
<div>
<q-select
v-model="visibleColumns"
multiple
outlined
dense
options-dense
:display-value="$q.lang.table.columns"
emit-value
map-options
:options="columns"
option-value="name"
style="min-width: 140px"
/>
</div>
</div> </div>
</q-toolbar> </q-toolbar>
<d-table <d-table
@ -567,6 +599,7 @@ onMounted(() => {
:rows-per-page-options="[10, 25, 50, 100]" :rows-per-page-options="[10, 25, 50, 100]"
@update:pagination="updatePagination" @update:pagination="updatePagination"
v-model:pagination="pagination" v-model:pagination="pagination"
:visible-columns="visibleColumns"
> >
<template v-slot:header="props"> <template v-slot:header="props">
<q-tr :props="props"> <q-tr :props="props">
@ -744,7 +777,7 @@ onMounted(() => {
</div> </div>
<div v-else class="text-body2"> <div v-else class="text-body2">
{{ col.value }} {{ col.value ?? "-" }}
</div> </div>
</q-td> </q-td>
</q-tr> </q-tr>

View file

@ -143,7 +143,7 @@ onMounted(async () => {
<q-card flast bordered class="q-pa-md"> <q-card flast bordered class="q-pa-md">
<div class="items-center col-12 row q-col-gutter-sm q-mb-sm"> <div class="items-center col-12 row q-col-gutter-sm q-mb-sm">
<q-btn flat round dense color="primary" icon="add" @click="openDialog"> <q-btn flat round dense color="primary" icon="add" @click="openDialog">
<q-tooltip>เพ Role </q-tooltip> <q-tooltip>เพทธ </q-tooltip>
</q-btn> </q-btn>
<q-space /> <q-space />

View file

@ -314,6 +314,7 @@ onMounted(async () => {
dense dense
@click="onDialogEdit(item)" @click="onDialogEdit(item)"
/> />
<q-tooltip>แกไข</q-tooltip>
</q-item-section> </q-item-section>
</q-item> </q-item>
</q-list> </q-list>