diff --git a/src/modules/11_discipline/components/2_InvestigateFacts/investigatefactsAdd.vue b/src/modules/11_discipline/components/2_InvestigateFacts/AddPage.vue similarity index 85% rename from src/modules/11_discipline/components/2_InvestigateFacts/investigatefactsAdd.vue rename to src/modules/11_discipline/components/2_InvestigateFacts/AddPage.vue index 0fabed5b6..0e46075d4 100644 --- a/src/modules/11_discipline/components/2_InvestigateFacts/investigatefactsAdd.vue +++ b/src/modules/11_discipline/components/2_InvestigateFacts/AddPage.vue @@ -1,7 +1,10 @@ - + - diff --git a/src/modules/11_discipline/components/5_Report/reportDetail.vue b/src/modules/11_discipline/components/5_Report/DetailPage.vue similarity index 83% rename from src/modules/11_discipline/components/5_Report/reportDetail.vue rename to src/modules/11_discipline/components/5_Report/DetailPage.vue index 4f36355c0..54b333f26 100644 --- a/src/modules/11_discipline/components/5_Report/reportDetail.vue +++ b/src/modules/11_discipline/components/5_Report/DetailPage.vue @@ -4,52 +4,31 @@ import { VuePDF, usePDF } from "@tato30/vue-pdf"; import { useCounterMixin } from "@/stores/mixin"; import { useRoute } from "vue-router"; import { useQuasar } from "quasar"; - +import type { DataOption } from "@/modules/11_discipline/interface/index/Main"; import { useReportDataStore } from "@/modules/11_discipline/stroes/ReportStore"; import http from "@/plugins/http"; import config from "@/app.config"; -const date = ref(null); -const dateEnd = ref(null); +const date = ref(); +const dateEnd = ref(); const route = useRoute(); const typeReport = route.params.type.toString(); const store = useReportDataStore(); const mixin = useCounterMixin(); const { messageError, showLoader, hideLoader, date2Thai } = mixin; -const { optionReport } = store; +const { filterFnOptionsType } = store; const $q = useQuasar(); const ocSelect = ref(""); -const ocSelectOp = ref(); -const ocSelectOps = ref([ - { id: "001", value: "กทม" }, - { id: "002", value: "กรุงเทพ" }, -]); const government = ref(""); -const governmentOp = ref(); -const governmentOps = ref([ - { id: "001", value: "กทม" }, - { id: "002", value: "กรุงเทพ" }, - { id: "003", value: "bankok" }, -]); -const fault = ref(); -const faultOp = ref(); -const faultOps = ref([ - { id: "001", value: "ยังไม่ระบุ" }, - { id: "002", value: "ไม่ร้ายเเรง" }, - { id: "003", value: "ร้ายเเรง" }, -]); +const fault = ref(); const pdfSrc = ref(); const numOfPages = ref(0); const page = ref(1); const titleReport = ref(""); -interface OptionReport { - id: string; - title: string; -} onMounted(async () => { - let report = optionReport.find((e: OptionReport) => e.id == typeReport); - report && (titleReport.value = report.title); + let report = store.optionReport.find((e: DataOption) => e.id == typeReport); + report && (titleReport.value = report.name); }); const splitterModel = ref(14); @@ -75,25 +54,6 @@ const backPage = () => { page.value--; } }; - -function filterFnOptionsType(val: string, update: any, type: string) { - update(() => { - const needle = val.toLowerCase(); - if (type === "ocSelectOp") { - ocSelectOp.value = ocSelectOps.value.filter( - (v: any) => v.value.toLowerCase().indexOf(needle) > -1 - ); - } else if (type === "governmentOp") { - governmentOp.value = governmentOps.value.filter( - (v: any) => v.value.toLowerCase().indexOf(needle) > -1 - ); - } else if (type === "faultOp") { - faultOp.value = faultOps.value.filter( - (v: any) => v.value.toLowerCase().indexOf(needle) > -1 - ); - } - }); -}