แก้ไขฟอร์มการสืบสวนข้อเท็จจริง
This commit is contained in:
parent
5ad7140335
commit
6f80fb2347
6 changed files with 474 additions and 381 deletions
|
|
@ -1,16 +1,17 @@
|
|||
import { defineStore } from "pinia";
|
||||
import { ref } from "vue";
|
||||
import type { QTableProps } from "quasar";
|
||||
import type { investigatefactsDataRowType, DataOption } from '@/modules/11_discipline/interface/index/Main'
|
||||
import type { investigatefactsDataRowType, DataOption, DataNumberOption } from '@/modules/11_discipline/interface/index/Main'
|
||||
|
||||
/*** store ของข้อมูลสืบสวนข้อเท็จจริง */
|
||||
export const useInvestigateFactStore = defineStore("DisciplineInvestigateFact", () => {
|
||||
const rows = ref<investigatefactsDataRowType[]>([])
|
||||
|
||||
const daysExtendOps = ref<DataOption[]>([
|
||||
{ id: "000", name: "15 วัน" },
|
||||
{ id: "001", name: "30 วัน" },
|
||||
{ id: "002", name: "45 วัน" },
|
||||
{ id: "003", name: "60 วัน" },
|
||||
const daysExtendOps = ref<DataNumberOption[]>([
|
||||
{ id: 15, name: "15 วัน" },
|
||||
{ id: 30, name: "30 วัน" },
|
||||
{ id: 45, name: "45 วัน" },
|
||||
{ id: 60, name: "60 วัน" },
|
||||
]);
|
||||
const investigationOps = ref<DataOption[]>([
|
||||
{ id: "001", name: "เเต่งตั้งการสืบสวน" },
|
||||
|
|
@ -22,7 +23,17 @@ export const useInvestigateFactStore = defineStore("DisciplineInvestigateFact",
|
|||
{ id: "002", name: "ไม่ร้ายเเรง" },
|
||||
{ id: "003", name: "ร้ายเเรง" },
|
||||
]);
|
||||
const daysExtendOp = ref<DataOption[]>(daysExtendOps.value);
|
||||
const statusResultOptions = ref<DataOption[]>([
|
||||
{ id: "not_specified", name: "ยังไม่ระบุ" },
|
||||
{ id: "have_cause", name: "มีมูล" },
|
||||
{ id: "no_cause", name: "ไม่มีมูล" },
|
||||
]);
|
||||
const causeTextOptions = ref<DataOption[]>([
|
||||
{ id: "ร้ายแรง", name: "ร้ายแรง" },
|
||||
{ id: "ไม่ร้ายแรง", name: "ไม่ร้ายแรง" },
|
||||
]);
|
||||
|
||||
const daysExtendOp = ref<DataNumberOption[]>(daysExtendOps.value);
|
||||
const investigationOp = ref<DataOption[]>(investigationOps.value);
|
||||
const faultOp = ref<DataOption[]>(faultOps.value);
|
||||
const visibleColumns = ref<string[]>([
|
||||
|
|
@ -85,22 +96,20 @@ export const useInvestigateFactStore = defineStore("DisciplineInvestigateFact",
|
|||
style: "font-size: 14px",
|
||||
},
|
||||
]);
|
||||
function filterFnOptionsType(val: string, update: any, type: string) {
|
||||
function filterFnOptionsType(val: string | number, 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
|
||||
(v: any) => v.name.toLowerCase().indexOf(val) > -1
|
||||
);
|
||||
|
||||
} else if (type === "investigationOp") {
|
||||
investigationOp.value = investigationOps.value.filter(
|
||||
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
|
||||
(v: any) => v.name.toLowerCase().indexOf(val) > -1
|
||||
);
|
||||
} else if (type === "daysExtendOp") {
|
||||
daysExtendOp.value = daysExtendOps.value.filter(
|
||||
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
|
||||
(v: any) => v.id.indexOf(val) > -1
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -154,6 +163,8 @@ export const useInvestigateFactStore = defineStore("DisciplineInvestigateFact",
|
|||
daysExtendOp,
|
||||
investigationOp,
|
||||
visibleColumns,
|
||||
columns
|
||||
columns,
|
||||
statusResultOptions,
|
||||
causeTextOptions
|
||||
};
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue