diff --git a/src/modules/13_portfolio/interface/Main.ts b/src/modules/13_portfolio/interface/Main.ts new file mode 100644 index 0000000..e0a84da --- /dev/null +++ b/src/modules/13_portfolio/interface/Main.ts @@ -0,0 +1,13 @@ +interface PortfolioRowsType { + id: string; + createdAt: Date | null; + lastUpdatedAt: Date | null; + createdFullName: string; + lastUpdateFullName: string; + name: string; + detail: string; +} + +export type { + PortfolioRowsType +} \ No newline at end of file diff --git a/src/modules/13_portfolio/views/Add.vue b/src/modules/13_portfolio/views/Add.vue index bc0cf83..b18ab7e 100644 --- a/src/modules/13_portfolio/views/Add.vue +++ b/src/modules/13_portfolio/views/Add.vue @@ -2,14 +2,14 @@ import { ref, onMounted } from "vue"; import { useQuasar } from "quasar"; import { useRouter, useRoute } from "vue-router"; -import { useCounterMixin } from "@/stores/mixin"; +import axios from "axios"; + import http from "@/plugins/http"; import config from "@/app.config"; -import axios from "axios"; -import type { QForm } from "quasar"; +import { useCounterMixin } from "@/stores/mixin"; -const router = useRouter(); const $q = useQuasar(); +const router = useRouter(); const mixin = useCounterMixin(); const { success, messageError, showLoader, hideLoader, dialogConfirm } = mixin; @@ -18,22 +18,12 @@ const { success, messageError, showLoader, hideLoader, dialogConfirm } = mixin; */ const route = useRoute(); const files = ref(); -const name = ref(""); -const detail = ref(""); +const name = ref(""); +const detail = ref(""); const id = ref(""); const routeName = router.currentRoute.value.name; const fileList = ref([]); -/** - * เรียกฟังก์ชันทั้งหมดตอนเรียกใช้ไฟล์นี้ - */ -onMounted(() => { - if (route.params.id !== undefined) { - id.value = route.params.id.toString(); - fecthData(id.value); - } -}); - const saveData = async () => { dialogConfirm( $q, @@ -174,6 +164,16 @@ function fileOpen(fileName: string) { hideLoader(); }); } + +/** + * เรียกฟังก์ชันทั้งหมดตอนเรียกใช้ไฟล์นี้ + */ +onMounted(() => { + if (route.params.id !== undefined) { + id.value = route.params.id.toString(); + fecthData(id.value); + } +});