แก้ไข ชื่อ store

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-10-18 17:50:37 +07:00
parent 8113b723ad
commit 2f0e86046b
15 changed files with 9 additions and 9 deletions

View file

@ -0,0 +1,68 @@
import { defineStore } from "pinia";
import { ref } from "vue";
import type { DataOption } from "../interface/index/Main";
export const useComplainstDataStore = defineStore("DisciplineComplainst", () => {
const rows = ref<any>([])
function fectComplainst(data: any) {
let datalist = data.map((e: any) => ({
subject: e.subject,
detail: e.detail,
complainant: e.complainant,
offenseDescription: e.offenseDescription,
creationDate: e.creationDate,
considerationLevel: e.considerationLevel,
considerationDeadlineDate: e.considerationDeadlineDate,
}))
rows.value = datalist
}
const complainantoptionsMain = ref<DataOption[]>()
const complainantoptions = ref<DataOption[]>()
const agencytoptionsMain = ref<DataOption[]>()
const agencytoptions = ref<DataOption[]>()
const optionListNameMain = ref<DataOption[]>([])
const optionListName = ref<DataOption[]>([])
function fectOptioin(complainantoptions: any, agencytoptions: any) {
complainantoptionsMain.value = complainantoptions
agencytoptionsMain.value = agencytoptions
}
function selectComplainantTpye(list: any) {
optionListNameMain.value = list
optionListName.value = list
}
function filterSelector(val: any, update: Function, type: string) {
update(() => {
if (type === "filtercomplainantType" && complainantoptionsMain.value) {
complainantoptions.value = complainantoptionsMain.value.filter(
(e) => e.name.search(val) !== -1
);
} else if (type === "filteragencytoptions" && agencytoptionsMain.value) {
agencytoptions.value = agencytoptionsMain.value.filter(
(e) => e.name.search(val) !== -1
);
} else if (type === "filtercomplainantOP" && optionListNameMain.value) {
optionListName.value = optionListNameMain.value.filter(
(e) => e.name.search(val) !== -1
);
}
})
}
return {
rows,
optionListName,
fectComplainst,
selectComplainantTpye,
filterSelector,
fectOptioin,
complainantoptions,
agencytoptions,
}
})

View file

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

View file

@ -0,0 +1,109 @@
import { defineStore } from "pinia";
import { ref } from "vue";
import type {
investigateDisDataRowType,
DataOption,
directorType,
} from "@/modules/11_discipline/interface/index/Main";
export const useInvestigateDisStore = defineStore(
"DisciplineInvestigateDis",
() => {
const rows = ref<investigateDisDataRowType[]>([]);
const rows2 = ref<directorType[]>([]);
const selected = ref<directorType[]>([]);
const optionsTypefault = ref<DataOption[]>([
{ id: "0", name: "ไม่ระบุ" },
{ id: "1", name: "ร้ายแรง" },
{ id: "2", name: "ไม่ร้ายแรง" },
]);
const optionsfaultLevel = ref<DataOption[]>([
{ id: "0", name: "ไม่ร้ายแรง" },
{ id: "1", name: "ภาคทัณฑ์" },
{ id: "2", name: "ตัดเงินเดือน" },
{ id: "3", name: "ลดขั้นเงินเดือน" },
{ id: "4", name: "ร้ายแรง" },
{ id: "5", name: "ปลดออก" },
{ id: "6", name: "ไล่ออก" },
]);
async function fecthList(data: investigateDisDataRowType[]) {
let datalist: any[] = data.map((e: any) => ({
subject: e.subject,
interrogated: e.interrogated,
fault: convertFault(e.fault),
penaltyLevel: convertPenaltyLevel(e.penaltyLevel),
caseFault: e.caseFault,
dateInvestigate: e.dateInvestigate,
status: convertSatatus(e.status),
active: activeStatus(e.active),
}));
rows.value = datalist;
}
async function fecthDirector(data: directorType[]) {
let datalistDirector: any[] = data.map((e: any) => ({
nameDirector: e.nameDirector,
position: e.position,
duty: e.duty,
email: e.email,
telephone: e.telephone,
}));
rows2.value = datalistDirector;
selected.value = rows2.value;
console.log(rows2.value);
}
function convertFault(val: string) {
switch (val) {
case "0":
return "ความผิดวินัยยังไม่ระบุ";
case "1":
return "ความผิดวินัยไม่ร้ายแรง";
case "2":
return "ความผิดวินัยร้ายแรง";
}
}
function convertSatatus(val: string) {
switch (val) {
case "0":
return "เสร็จสิ้นแล้ว";
case "1":
return "ยุติเรื่อง";
}
}
function activeStatus(val: string) {
switch (val) {
case "0":
return "กำลังยืนยันผล";
case "1":
return "ยืนยันผลเเล้ว";
case "2":
return "ยืนยันผล";
}
}
function convertPenaltyLevel(val: string) {
switch (val) {
case "0":
return "ไม่ร้ายแรง";
case "1":
return "ภาคทัณฑ์";
case "3":
return "ตัดเงินเดือน";
case "4":
return "ลดขั้นเงินเดือน";
case "5":
return "ร้ายแรง";
case "6":
return "ปลดออก";
case "7":
return "ไล่ออก";
}
}
return {
fecthList,
rows,
rows2,
optionsTypefault,
optionsfaultLevel,
fecthDirector,
};
}
);

View file

@ -0,0 +1,93 @@
import { defineStore } from "pinia";
import { ref } from "vue";
import type { investigatefactsDataRowType, DataOption } from '@/modules/11_discipline/interface/index/Main'
export const useInvestigateFactStore = defineStore("DisciplineInvestigateFact", () => {
const rows = ref<investigatefactsDataRowType[]>([])
const faultOp = ref<DataOption[]>();
const daysExtendOp = ref<DataOption[]>();
const investigationOp = ref<DataOption[]>();
const daysExtendOps = ref<DataOption[]>([
{ id: "000", name: "15 วัน" },
{ id: "001", name: "30 วัน" },
{ id: "002", name: "45 วัน" },
{ id: "003", name: "60 วัน" },
]);
const investigationOps = ref<DataOption[]>([
{ id: "001", name: "เเต่งตั้งการสืบสวน" },
{ id: "002", name: "สืบสวนทางลับ" },
{ id: "003", name: "อื่นๆ" },
]);
const faultOps = ref<DataOption[]>([
{ id: "001", name: "ยังไม่ระบุ" },
{ id: "002", name: "ไม่ร้ายเเรง" },
{ id: "003", name: "ร้ายเเรง" },
]);
function filterFnOptionsType(val: string, update: any, type: string) {
update(() => {
const needle = val.toLowerCase();
if (type === "faultOp") {
faultOp.value = faultOps.value.filter(
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
);
} else if (type === "investigationOp") {
investigationOp.value = investigationOps.value.filter(
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
);
} else if (type === "daysExtendOp") {
daysExtendOp.value = daysExtendOps.value.filter(
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
);
}
});
}
async function fecthList(data: investigatefactsDataRowType[]) {
let datalist: investigatefactsDataRowType[] = data.map((e: any) => ({
subject: e.subject,
interrogated: e.interrogated,
fault: e.fault ?? convertFault(e.fault),
status: e.status ?? convertSatatus(e.status),
active: e.active ?? activeStatus(e.active)
}))
rows.value = datalist
}
function convertFault(val: string) {
switch (val) {
case "0":
return "ความผิดวินัยไม่ร้ายแรง"
case "1":
return "ความผิดวินัยร้ายแรง"
}
}
function convertSatatus(val: string) {
switch (val) {
case "0":
return "ยุติเรื่อง"
case "1":
return "เสร็จสิ้นเเล้ว"
}
}
function activeStatus(val: string) {
switch (val) {
case "0":
return "ยังไม่ได้ยืนยันผล"
case "1":
return "ยืนยันผลเเล้ว"
}
}
return {
fecthList,
rows,
daysExtendOps,
investigationOps,
faultOps,
filterFnOptionsType,
faultOp,
daysExtendOp,
investigationOp,
};
})

View file

@ -0,0 +1,24 @@
import { defineStore } from "pinia";
import { ref } from "vue";
export const useOrderStore = defineStore("DisciplineOrder", () => {
const rows = ref<any>([])
async function fecthOrder(data: any) {
let datalist = data.map((e: any) => ({
subject: e.subject,
ordernumber: e.ordernumber,
dateOrder: e.dateOrder,
orderby: e.orderby,
signer: e.signer,
statusorder: e.statusorder
}))
rows.value = datalist
}
return {
rows,
fecthOrder
}
})

View file

@ -0,0 +1,62 @@
import { defineStore } from "pinia";
import { ref } from "vue";
import type { DataOption } from '@/modules/11_discipline/interface/index/Main'
export const useReportDataStore = defineStore("DisciplineReport11", () => {
const faultOp = ref<DataOption[]>();
const ocSelectOp = ref<DataOption[]>();
const governmentOp = ref<DataOption[]>();
const faultOps = ref<DataOption[]>([
{ id: "001", name: "ยังไม่ระบุ" },
{ id: "002", name: "ไม่ร้ายเเรง" },
{ id: "003", name: "ร้ายเเรง" },
]);
const ocSelectOps = ref<DataOption[]>([
{ id: "001", name: "กทม" },
{ id: "002", name: "กรุงเทพ" },
]);
const governmentOps = ref<DataOption[]>([
{ id: "001", name: "กทม" },
{ id: "002", name: "กรุงเทพ" },
{ id: "003", name: "bankok" },
]);
const optionReport = ref<DataOption[]>([
{ id: "1", name: "รายงานเรื่องร้องเรียนแยกรายวัน รายเดือน รายปี" },
{ id: "2", name: "รายงานเรื่องร้องเรียนข้าราชการสามัญฯ ในสังกัดกรุงเทพมหานคร แยกตามหน่วยงาน" },
{ id: "3", name: "รายงานจำนวนข้าราชการสามัญฯ ที่กระทำความผิดทางวินัย แยกตามลักษณะความผิด" },
{ id: "4", name: "รายงานรายชื่อข้าราชการสามัญฯ ที่กระทำความผิดทางวินัยแยกตามลักษณะความผิด" },
{ id: "5", name: "รายงานจำนวนข้าราชการสามัญฯ ที่กระทำความผิดแยกตามระดับความผิด" },
{ id: "6", name: "รายงานรายชื่อข้าราชการสามัญฯ ที่กระทำความผิดทางวินัยแยกตามลักษณะความผิด" },
{ id: "7", name: "รายงานจำนวนข้าราชการสามัญฯ ที่กระทำความผิดทางวินัยแต่ยุติเรื่อง แยกลักษณะความผิด" },
{ id: "8", name: "รายงานจำนวนข้าราชการสามัญฯ ที่กระทำความผิดทางวินัยแต่ยุติเรื่อง แยกตามตำแหน่ง" },
]);
function filterFnOptionsType(val: string, update: any, type: string) {
update(() => {
const needle = val.toLowerCase();
if (type === "ocSelectOp") {
ocSelectOp.value = ocSelectOps.value.filter(
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
);
} else if (type === "governmentOp") {
governmentOp.value = governmentOps.value.filter(
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
);
} else if (type === "faultOp") {
faultOp.value = faultOps.value.filter(
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
);
}
});
}
return {
optionReport,
filterFnOptionsType,
faultOp,
ocSelectOp,
governmentOp,
faultOps,
ocSelectOps,
governmentOps,
};
});