Merge branch 'develop' into dev-tee

This commit is contained in:
setthawutttty 2023-10-26 16:43:03 +07:00
commit d0056f1c5e
16 changed files with 210 additions and 353 deletions

View file

@ -29,18 +29,18 @@ async function fetchListComplaints() {
detail: "มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน",
complainant: "นางศิรินภา คงน้อย",
offenseDescription: "ร้ายแรง",
creationDate: "2023-10-16",
creationDate: new Date("2023-12-01"),
considerationLevel: "ด่วนมาก",
considerationDeadlineDate: "2023-11-01",
considerationDeadlineDate: new Date("2023-12-02"),
},
{
subject: "ทุจริตในหน้าที่",
detail: "มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน",
complainant: "นายแก้ว คำ",
offenseDescription: "ร้ายแรง",
creationDate: "2023-10-16",
creationDate: new Date("2023-12-01"),
considerationLevel: "ด่วนมาก",
considerationDeadlineDate: "2023-11-01",
considerationDeadlineDate: new Date("2023-12-02"),
},
{
subject: "ทุจริตในหน้าที่",
@ -48,9 +48,9 @@ async function fetchListComplaints() {
"มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน",
complainant: "นายภัทรานุย คงนอย",
offenseDescription: "ร้ายแรง",
creationDate: "2023-10-16",
creationDate: new Date("2023-12-01"),
considerationLevel: "ด่วนมาก",
considerationDeadlineDate: "2023-11-01",
considerationDeadlineDate: new Date("2023-12-02"),
},
];
await fetchComplainst(listData);

View file

@ -111,32 +111,13 @@ const checkSelected = computed(() => {
const saveDirector = () => {
dialogConfirm(
$q,
() => Ordersave(),
() => DirectorSave(),
"ยืนยันเพิ่มรายชื่อกรรมการ",
"ต้องการยืนยันเพิ่มรายชื่อกรรมการ?"
);
};
//
const Ordersave = async () => {
// const id = selected.value.map((r) => r.id);
// const body = {
// id,
// };
// showLoader();
// await http
// .post(config.API.transferReport, body)
// .then((res: any) => {
// success($q, "");
// props.closeModal?.();
// })
// .catch((e) => {
// messageError($q, e);
// })
// .finally(async () => {
// props.getData?.();
// hideLoader();
// });
};
const DirectorSave = async () => {};
const emit = defineEmits(["update:filterKeyword2", "update:selected"]);
const updateInput = (value: any) => {
@ -158,7 +139,7 @@ watchEffect(() => {
<DialogHeader title="เลือกรายชื่อกรรมการ" :close="clickClose" />
<q-separator />
<q-card-section class="q-pt-none">
<div class="row justify-end">
<div>
<div>
<q-toolbar style="padding: 0">
<q-input
@ -170,7 +151,7 @@ watchEffect(() => {
:model-value="filterKeyword2"
@update:model-value="updateInput"
placeholder="ค้นหารายชื่อ"
style="width: 850px; max-width: auto"
style="max-width: 100%"
>
<template v-slot:append>
<q-icon v-if="filterKeyword2 == ''" name="search" />
@ -182,21 +163,6 @@ watchEffect(() => {
/>
</template>
</q-input>
<!-- <q-select
v-model="visibleColumns2"
multiple
outlined
dense
options-dense
:display-value="$q.lang.table.columns"
emit-value
map-options
:options="columns2"
option-value="name"
options-cover
style="min-width: 150px"
class="gt-xs q-ml-sm"
/> -->
</q-toolbar>
</div>
</div>
@ -205,7 +171,7 @@ watchEffect(() => {
:columns="columns2"
:rows="rows2"
:filter="filterKeyword2"
row-key="id"
row-key="nameDirector"
:visible-columns="visibleColumns2"
selection="single"
v-model:selected="selected"
@ -229,26 +195,12 @@ watchEffect(() => {
v-model="props.selected"
/>
</q-td>
<q-td key="no" :props="props">
{{ props.rowIndex + 1 }}
</q-td>
<q-td key="nameDirector" :props="props">
{{ props.row.nameDirector }}
</q-td>
<q-td key="position" :props="props">
{{ props.row.position }}
</q-td>
<q-td key="duty" :props="props">
{{ props.row.duty }}
</q-td>
<q-td key="email" :props="props">
<div class="table_ellipsis">
{{ props.row.email }}
<q-td v-for="col in props.cols" :key="col.name" :props="props">
<div v-if="col.name == 'no'">
{{ props.rowIndex + 1 }}
</div>
</q-td>
<q-td key="telephone" :props="props">
<div class="table_ellipsis">
{{ props.row.telephone }}
<div v-else>
{{ col.value }}
</div>
</q-td>
</q-tr>

View file

@ -26,7 +26,7 @@ onMounted(async () => {
fault: "1",
penaltyLevel: "7",
caseFault: "ทุจริตในหน้าที่",
dateInvestigate: "1 ธ.ค. 2565",
dateInvestigate: "2023-12-01",
status: "0",
active: "2",
},
@ -36,7 +36,7 @@ onMounted(async () => {
fault: "1",
penaltyLevel: "7",
caseFault: "ทุจริตในหน้าที่",
dateInvestigate: "30 พ.ย. 2565",
dateInvestigate: "2023-11-30",
status: "0",
active: "0",
},
@ -46,7 +46,7 @@ onMounted(async () => {
fault: "2",
penaltyLevel: "1",
caseFault: "พบการทุจริต",
dateInvestigate: "14 ก.ย. 2565",
dateInvestigate: "2023-09-14",
status: "1",
active: "1",
},
@ -56,7 +56,7 @@ onMounted(async () => {
fault: "2",
penaltyLevel: "1",
caseFault: "พูดจาไม่สุภาพกับผู้บังคับบัญชา",
dateInvestigate: "11 ส.ค. 2565",
dateInvestigate: "2023-08-11",
status: "0",
active: "1",
},
@ -92,10 +92,10 @@ const clickAdd = () => {
<template #columns="props">
<q-tr :props="props" class="cursor-pointer">
<q-td v-for="col in props.cols" :key="col.name" :props="props">
<q-td v-if="col.name == 'no'">
<div v-if="col.name == 'no'">
{{ props.rowIndex + 1 }}
</q-td>
<div>
</div>
<div v-else>
{{ col.value }}
</div>
</q-td>

View file

@ -1,7 +1,7 @@
<script setup lang="ts">
import { ref, onMounted } from "vue";
import { useRouter } from "vue-router";
import type { DataList } from "../../interface/response/order";
import type { DataList, DataListRes } from "../../interface/response/order";
// importStroe
import { useOrderStore } from "@/modules/11_discipline/store/OrderStore";
@ -21,11 +21,11 @@ onMounted(async () => {
// API
async function fetchListOrder() {
const listData: DataList[] = [
const listData: DataListRes[] = [
{
subject: "ทุจริตในหน้าที่",
ordernumber: "1/2556",
dateOrder: "1 ธ.ค. 2565",
dateOrder: new Date("2023-12-01"),
orderby: "สำนักงานคณพกรรมการข้าราชการกรุงเทพฯ",
signer: "นางศิรินภา คงน้อย",
statusorder: "เสร็จสิ้นแล้ว",
@ -33,7 +33,7 @@ async function fetchListOrder() {
{
subject: "ทุจริตในหน้าที่",
ordernumber: "4/2556",
dateOrder: "1 ธ.ค. 2565",
dateOrder: new Date("2023-12-01"),
orderby: "สำนักงานคณพกรรมการข้าราชการกรุงเทพฯ",
signer: "นางศิรินภา คงน้อย",
statusorder: "เสร็จสิ้นแล้ว",
@ -41,7 +41,7 @@ async function fetchListOrder() {
{
subject: "ทุจริตในหน้าที่",
ordernumber: "2/2556",
dateOrder: "1 ธ.ค. 2565",
dateOrder: new Date("2023-12-01"),
orderby: "สำนักงานคณพกรรมการข้าราชการกรุงเทพฯ",
signer: "นางศิรินภา คงน้อย",
statusorder: "เสร็จสิ้นแล้ว",

View file

@ -4,67 +4,15 @@ import type { QTableProps } from "quasar";
import router from "@/router";
import { useCounterMixin } from "@/stores/mixin";
import { useQuasar } from "quasar";
import { useDisciplineChannelDataStore } from "@/modules/11_discipline/store/ChannelStore";
import config from "@/app.config";
import http from "@/plugins/http";
const mixin = useCounterMixin();
const {
date2Thai,
success,
messageError,
showLoader,
hideLoader,
dialogConfirm,
dialogRemove,
} = mixin;
const { dialogRemove } = mixin;
const $q = useQuasar(); // noti quasar
const visibleColumns = ref<string[]>([
"no",
"subject",
"interrogated",
"fault",
"status",
]); //
//
const columns = ref<QTableProps["columns"]>([
{
name: "no",
align: "left",
label: "ลำดับ",
sortable: false,
field: "no",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "subject",
align: "left",
label: "ชื่อประเภท",
sortable: true,
field: "subject",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
]);
const rows = ref<any>([
{
subject: " จดหมาย",
},
{
subject: " อีเมล์",
},
{
subject: " โทรศัพท์",
},
{
subject: " บอกเล่า",
},
]);
//
const filterKeyword = ref<string>("");
const filterRef = ref<HTMLInputElement | null>(null);
@ -74,19 +22,13 @@ const resetFilter = () => {
filterRef.value.focus();
}
};
const attrs = ref<any>(useAttrs());
const paging = ref<boolean>(true);
const dataStore = useDisciplineChannelDataStore();
const pagination = ref({
// sortBy: "desc",
descending: false,
page: 1,
rowsPerPage: 10,
});
const paginationLabel = (start: string, end: string, total: string) => {
if (paging.value == true) return " " + start + "-" + end + " ใน " + total;
else return start + "-" + end + " ใน " + total;
};
const clickAdd = () => {
router.push(`/discipline/channel/add`);
@ -104,7 +46,23 @@ const clickDelete = (id: string) => {
);
};
onMounted(() => {});
onMounted(() => {
// get store
dataStore.fetchData([
{
subject: " จดหมาย",
},
{
subject: " อีเมล์",
},
{
subject: " โทรศัพท์",
},
{
subject: " บอกเล่า",
},
]);
});
</script>
<template>
<div class="toptitle text-dark col-12 row items-center">
@ -149,7 +107,7 @@ onMounted(() => {});
</q-input>
<q-select
v-model="visibleColumns"
v-model="dataStore.visibleColumns"
multiple
for="visibleColumns"
outlined
@ -158,7 +116,7 @@ onMounted(() => {});
:display-value="$q.lang.table.columns"
emit-value
map-options
:options="columns"
:options="dataStore.columns"
option-value="name"
options-cover
style="min-width: 150px"
@ -167,12 +125,11 @@ onMounted(() => {});
</div>
<div class="col-12">
<d-table
:columns="columns"
:rows="rows"
:columns="dataStore.columns"
:rows="dataStore.rows"
row-key="id"
:filter="filterKeyword"
:visible-columns="visibleColumns"
:pagination-label="paginationLabel"
:visible-columns="dataStore.visibleColumns"
v-model:pagination="pagination"
>
<template v-slot:header="props">

View file

@ -0,0 +1,5 @@
interface ChannelRows {
subject: string;
}
export type { ChannelRows };

View file

@ -1,15 +1,25 @@
interface DataListRow {
subject: string
detail: string
complainant: string
offenseDescription: string
creationDate: string | null
considerationLevel: string
considerationDeadlineDate: string | null
}
interface DataList {
subject: string
detail: string
complainant: string
offenseDescription: string
creationDate: string
creationDate: Date
considerationLevel: string
considerationDeadlineDate: string
considerationDeadlineDate: Date
}
export type {
DataList
DataList,
DataListRow
}

View file

@ -1,15 +1,25 @@
interface DataList {
subject: string
ordernumber: string
dateOrder: string
dateOrder: string | null;
orderby: string
signer: string
statusorder: string
}
interface DataListRes {
subject: string
ordernumber: string
dateOrder: Date
orderby: string
signer: string
statusorder: string
}
export type {
DataList
DataList,
DataListRes
}

View file

@ -0,0 +1,54 @@
import { defineStore } from "pinia";
import { ref } from "vue";
import type { ChannelRows } from "@/modules/11_discipline/interface/response/channel";
import type { QTableProps } from "quasar";
// store ระบบวินัย >> ข้อมูลพื้นฐาน >> กรรมการ
export const useDisciplineChannelDataStore = defineStore(
"disciplineChannel",
() => {
//ค้นหา คอลัมน์ คอลัมน์ที่แสดง
const visibleColumns = ref<string[]>([
"no",
"subject",
"interrogated",
"fault",
"status",
]); //ค้นหา คอลัมน์ คอลัมน์ที่แสดง
// หัวตาราง
const columns = ref<QTableProps["columns"]>([
{
name: "no",
align: "left",
label: "ลำดับ",
sortable: false,
field: "no",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "subject",
align: "left",
label: "ชื่อประเภท",
sortable: true,
field: "subject",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
]);
// ข้อมูลในตาราง
const rows = ref<ChannelRows[]>([]);
function fetchData(data: ChannelRows[]) {
rows.value = data;
}
return {
visibleColumns,
columns,
rows,
fetchData,
};
}
);

View file

@ -1,13 +1,17 @@
import { defineStore } from "pinia";
import { ref } from "vue";
import { useCounterMixin } from "@/stores/mixin";
import type { DataOption } from "@/modules/11_discipline/interface/index/Main";
import type { DataList } from "@/modules/11_discipline/interface/response/complaint"
import type { DataList, DataListRow } from "@/modules/11_discipline/interface/response/complaint"
import type { QTableProps } from "quasar";
const mixin = useCounterMixin()
const { date2Thai } = mixin
export const useComplainstDataStore = defineStore("DisciplineComplainst", () => {
const rows = ref<DataList[]>([])
const rows = ref<DataListRow[]>([])
const visibleColumns = ref<string[]>([]);
const columns = ref<QTableProps["columns"]>([]);
function fetchComplainst(data: DataList[]) {
@ -16,9 +20,9 @@ export const useComplainstDataStore = defineStore("DisciplineComplainst", () =>
detail: e.detail,
complainant: e.complainant,
offenseDescription: e.offenseDescription,
creationDate: e.creationDate,
creationDate: date2Thai(e.creationDate),
considerationLevel: e.considerationLevel,
considerationDeadlineDate: e.considerationDeadlineDate,
considerationDeadlineDate: date2Thai(e.considerationDeadlineDate),
}))
rows.value = datalist
}

View file

@ -6,6 +6,9 @@ import type {
DataOption,
directorType,
} from "@/modules/11_discipline/interface/index/Main";
import { useCounterMixin } from "@/stores/mixin";
const mixin = useCounterMixin();
const { date2Thai } = mixin;
export const useInvestigateDisStore = defineStore(
"DisciplineInvestigateDis",
@ -34,7 +37,7 @@ export const useInvestigateDisStore = defineStore(
fault: convertFault(e.fault),
penaltyLevel: convertPenaltyLevel(e.penaltyLevel),
caseFault: e.caseFault,
dateInvestigate: e.dateInvestigate,
dateInvestigate: date2Thai(new Date(e.dateInvestigate)),
status: convertSatatus(e.status),
active: activeStatus(e.active),
}));

View file

@ -1,22 +1,25 @@
import { defineStore } from "pinia";
import { ref } from "vue";
import type { QTableProps } from "quasar";
import type { DataList } from "@/modules/11_discipline/interface/response/order"
import { useCounterMixin } from "@/stores/mixin";
import type { QTableProps } from "quasar";
import type { DataList, DataListRes } from "@/modules/11_discipline/interface/response/order"
const mixin = useCounterMixin()
const { date2Thai } = mixin
export const useOrderStore = defineStore("DisciplineOrder", () => {
const rows = ref<DataList[]>([])
const columns = ref<QTableProps["columns"]>([]);
const visibleColumns = ref<string[]>([]);
async function fetchOrder(data: DataList[]) {
let datalist = data.map((e: DataList) => ({
async function fetchOrder(data: DataListRes[]) {
let datalist: DataList[] = data.map((e: DataListRes) => ({
subject: e.subject,
ordernumber: e.ordernumber,
dateOrder: e.dateOrder,
dateOrder: date2Thai(e.dateOrder),
orderby: e.orderby,
signer: e.signer,
statusorder: e.statusorder
}))
rows.value = datalist
}