comment code ส่วนเครื่องราช
This commit is contained in:
parent
e9b7cddf09
commit
7371689594
7 changed files with 745 additions and 766 deletions
|
|
@ -1,20 +1,25 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, useAttrs } from "vue";
|
||||
import type { QTableProps } from "quasar";
|
||||
import router from "@/router";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
/** impotrComponents */
|
||||
import DialogPopupReason from "@/components/Dialogs/PopupReason.vue";
|
||||
import DialogHeader from "@/modules/07_insignia/components/DialogHeader.vue";
|
||||
import cardTop from "@/modules/07_insignia/components/2_Manage/StatCard.vue";
|
||||
|
||||
/** impotrStores */
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
const mixin = useCounterMixin();
|
||||
const { dialogMessage } = mixin;
|
||||
const name = ref<string>("");
|
||||
|
||||
const $q = useQuasar(); //ใช้ noti quasar
|
||||
const attrs = ref<any>(useAttrs());
|
||||
|
||||
const modal = ref<boolean>(false);
|
||||
const saveWriteNote = ref<any[]>([]);
|
||||
const addNote = ref<boolean>(false);
|
||||
const name = ref<string>("");
|
||||
|
||||
const clickNote = () => {
|
||||
addNote.value = true;
|
||||
|
|
@ -32,6 +37,7 @@ const stat = ref<any>({
|
|||
remainInsig: 1,
|
||||
});
|
||||
|
||||
/** ข้อมูล Table1*/
|
||||
const visibleColumns = ref<string[]>([
|
||||
"no",
|
||||
"citizenId",
|
||||
|
|
@ -42,9 +48,7 @@ const visibleColumns = ref<string[]>([
|
|||
"positionLine",
|
||||
"positionNum",
|
||||
"status",
|
||||
]); //ค้นหา คอลัมน์ คอลัมน์ที่แสดง
|
||||
|
||||
// หัวตาราง
|
||||
]);
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
|
|
@ -128,44 +132,9 @@ const columns = ref<QTableProps["columns"]>([
|
|||
style: "font-size: 14px",
|
||||
},
|
||||
]);
|
||||
const rows = ref<any[]>([]);
|
||||
|
||||
// ข้อมูลตาราง (จำลอง)
|
||||
const rows = ref<any[]>([
|
||||
{
|
||||
no: "1",
|
||||
citizenId: "1XXXXXXXXXXXX",
|
||||
name: "นางสาวรัชภรณ์ ภักดี",
|
||||
organization: "ฝ่ายบริหารงานทั่วไป",
|
||||
positionType: "บริหาร",
|
||||
positionAdmin: "บริหาร",
|
||||
positionLine: "ชำนาญการพิเศษ",
|
||||
positionNum: "ลกก.3",
|
||||
status: "ยังมีชีวิต",
|
||||
},
|
||||
{
|
||||
no: "2",
|
||||
citizenId: "1XXXXXXXXXXXX",
|
||||
name: "นางสาวภาพรรณ ลออ",
|
||||
organization: "ฝ่ายบริหารงานทั่วไป",
|
||||
positionType: "บริหาร",
|
||||
positionAdmin: "จัดการงานทั่วไป",
|
||||
positionLine: "ชำนาญงาน",
|
||||
positionNum: "กบห.2",
|
||||
status: "ยังมีชีวิต",
|
||||
},
|
||||
{
|
||||
no: "3",
|
||||
citizenId: "1XXXXXXXXXXXX",
|
||||
name: "นางสาวรัชภรณ์ ภักดี",
|
||||
organization: "ฝ่ายบริหารงานทั่วไป",
|
||||
positionType: "บริหาร",
|
||||
positionAdmin: "บริหาร",
|
||||
positionLine: "ชำนาญการพิเศษ",
|
||||
positionNum: "ลกก.3",
|
||||
status: "ยังมีชีวิต",
|
||||
},
|
||||
]);
|
||||
|
||||
/** ข้อมูล Table2*/
|
||||
const visibleColumns2 = ref<string[]>([
|
||||
"no",
|
||||
"name",
|
||||
|
|
@ -173,7 +142,6 @@ const visibleColumns2 = ref<string[]>([
|
|||
"level",
|
||||
"institution",
|
||||
]);
|
||||
// หัวตาราง2
|
||||
const columns2 = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
|
|
@ -221,72 +189,40 @@ const columns2 = ref<QTableProps["columns"]>([
|
|||
style: "font-size: 14px",
|
||||
},
|
||||
]);
|
||||
const rows2 = ref<any[]>([]);
|
||||
|
||||
// ข้อมูลตาราง2 (จำลอง)
|
||||
const rows2 = ref<any[]>([
|
||||
{
|
||||
no: "1",
|
||||
name: "นายใจดี ยอดใจ ",
|
||||
position: "นักวิชาการพัสดุ",
|
||||
level: "ปฏิบัติการ",
|
||||
institution: "กลุ่มงานโครงสร้างและอัตรากำลัง ๒",
|
||||
},
|
||||
{
|
||||
no: "2",
|
||||
name: "นายจักกริน บัณฑิต",
|
||||
position: "นักวิชาการพัสดุ",
|
||||
level: "ปฏิบัติการ",
|
||||
institution: "กลุ่มงานโครงสร้างและอัตรากำลัง ๒",
|
||||
},
|
||||
{
|
||||
no: "3",
|
||||
name: "นางสาวกัณฐิมา กาฬสินธุ์",
|
||||
position: "นักจัดการงานทั่วไป",
|
||||
level: "ปฏิบัติการ",
|
||||
institution: "กลุ่มงานช่วยนักบริหาร",
|
||||
},
|
||||
{
|
||||
no: "4",
|
||||
name: "นางสาวเมขลา กระจ่างมนตรี",
|
||||
position: "นักจัดการงานทั่วไป",
|
||||
level: "ปฏิบัติการ",
|
||||
institution: "กลุ่มงานช่วยนักบริหาร",
|
||||
},
|
||||
{
|
||||
no: "5",
|
||||
name: "นางสาวฐิติรัตน์ พงษ์ศิริ",
|
||||
position: "นักจัดการงานทั่วไป",
|
||||
level: "ปฏิบัติการ",
|
||||
institution: "กลุ่มงานช่วยนักบริหาร",
|
||||
},
|
||||
]);
|
||||
// const clickDelete = (id: string) => {
|
||||
// $q.dialog({
|
||||
// title: "ยืนยันการลบข้อมูล",
|
||||
// message: "ต้องการลบข้อมูลนี้ใช่หรือไม่?",
|
||||
// cancel: {
|
||||
// flat: true,
|
||||
// color: "negative",
|
||||
// },
|
||||
// persistent: true,
|
||||
// })
|
||||
// .onOk(async () => {})
|
||||
// .onCancel(() => {})
|
||||
// .onDismiss(() => {});
|
||||
// };
|
||||
|
||||
// หัวตาราง2
|
||||
const clickDelete = (id: string) => {
|
||||
$q.dialog({
|
||||
title: "ยืนยันการลบข้อมูล",
|
||||
message: "ต้องการลบข้อมูลนี้ใช่หรือไม่?",
|
||||
cancel: {
|
||||
flat: true,
|
||||
color: "negative",
|
||||
},
|
||||
persistent: true,
|
||||
})
|
||||
.onOk(async () => {})
|
||||
.onCancel(() => {})
|
||||
.onDismiss(() => {});
|
||||
};
|
||||
const clickClose = async () => {
|
||||
/** function closePopup*/
|
||||
function clickClose() {
|
||||
modal.value = false;
|
||||
};
|
||||
}
|
||||
|
||||
const clickCloseNote = async () => {
|
||||
/** function closePopupNote*/
|
||||
function clickCloseNote() {
|
||||
addNote.value = false;
|
||||
};
|
||||
const clickAdd = () => {
|
||||
}
|
||||
|
||||
/** function openPopupAdd*/
|
||||
function clickAdd() {
|
||||
modal.value = true;
|
||||
};
|
||||
const saveNote = async () => {
|
||||
}
|
||||
|
||||
/** function บันทึกข้อมูล note*/
|
||||
async function saveNote() {
|
||||
if (saveWriteNote.value.length == 0) {
|
||||
dialogMessage(
|
||||
$q,
|
||||
|
|
@ -301,30 +237,21 @@ const saveNote = async () => {
|
|||
);
|
||||
return;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// ค้นหาในตาราง
|
||||
/** ค้นหาในตาราง*/
|
||||
const filterKeyword = ref<string>("");
|
||||
const filterRef = ref<any>(null);
|
||||
const resetFilter = () => {
|
||||
filterKeyword.value = "";
|
||||
filterRef.value.focus();
|
||||
};
|
||||
|
||||
const filterKeyword2 = ref<string>("");
|
||||
const filterRef2 = ref<any>(null);
|
||||
const resetFilter2 = () => {
|
||||
filterKeyword2.value = "";
|
||||
filterRef2.value.focus();
|
||||
};
|
||||
|
||||
const attrs = ref<any>(useAttrs());
|
||||
|
||||
const paging = ref<boolean>(true);
|
||||
const paginationLabel = (start: string, end: string, total: string) => {
|
||||
if (paging.value == true) return " " + start + "-" + end + " ใน " + total;
|
||||
else return start + "-" + end + " ใน " + total;
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
@ -409,7 +336,7 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
/>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<q-table
|
||||
<d-table
|
||||
ref="table"
|
||||
:columns="columns"
|
||||
:rows="rows"
|
||||
|
|
@ -422,7 +349,6 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
class="custom-header-table"
|
||||
v-bind="attrs"
|
||||
:visible-columns="visibleColumns"
|
||||
:pagination-label="paginationLabel"
|
||||
v-model:pagination="pagination"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
|
|
@ -480,19 +406,7 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:pagination="scope">
|
||||
<q-pagination
|
||||
v-model="pagination.page"
|
||||
active-color="primary"
|
||||
color="dark"
|
||||
:max="scope.pagesNumber"
|
||||
:max-pages="5"
|
||||
size="sm"
|
||||
boundary-links
|
||||
direction-links
|
||||
></q-pagination>
|
||||
</template>
|
||||
</q-table>
|
||||
</d-table>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
|
|
@ -524,7 +438,7 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
</template>
|
||||
</q-input>
|
||||
<div class="col-12">
|
||||
<q-table
|
||||
<d-table
|
||||
ref="table2"
|
||||
:columns="columns2"
|
||||
:rows="rows2"
|
||||
|
|
@ -537,7 +451,6 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
class="custom-header-table"
|
||||
v-bind="attrs"
|
||||
:visible-columns="visibleColumns2"
|
||||
:pagination-label="paginationLabel"
|
||||
v-model:pagination="pagination"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
|
|
@ -579,19 +492,7 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:pagination="scope">
|
||||
<q-pagination
|
||||
v-model="pagination.page"
|
||||
active-color="primary"
|
||||
color="dark"
|
||||
:max="scope.pagesNumber"
|
||||
:max-pages="5"
|
||||
size="sm"
|
||||
boundary-links
|
||||
direction-links
|
||||
></q-pagination>
|
||||
</template>
|
||||
</q-table>
|
||||
</d-table>
|
||||
</div>
|
||||
</q-card-section>
|
||||
</q-form>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue