chalani page added
This commit is contained in:
parent
39588f6c3b
commit
e5250ab59e
|
|
@ -17,6 +17,14 @@ const authChildren: Array<RouteRecordRaw> = [
|
||||||
meta: {
|
meta: {
|
||||||
permission: "",
|
permission: "",
|
||||||
},
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "/chalani",
|
||||||
|
name: "chalani",
|
||||||
|
component: () => import("@/views/Chalani/Chalani.vue"),
|
||||||
|
meta: {
|
||||||
|
permission: "",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,10 @@ import { authAPI } from "@/core/endpoints/auth";
|
||||||
import { getCSRFTokenFromCookie } from "./utilities";
|
import { getCSRFTokenFromCookie } from "./utilities";
|
||||||
import { useUser } from "@/stores/User/User";
|
import { useUser } from "@/stores/User/User";
|
||||||
|
|
||||||
// const apiURL: string = window.APP_CONFIG.API_URL;
|
const apiURL: string = window.APP_CONFIG.API_URL;
|
||||||
|
|
||||||
const api = axios.create({
|
const api = axios.create({
|
||||||
baseURL: "http://localhost:8000/api/v3/",
|
baseURL: apiURL,
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
},
|
},
|
||||||
|
|
@ -50,7 +50,7 @@ api.interceptors.response.use(
|
||||||
originalRequest.headers["X-CSRFToken"] = csrfToken;
|
originalRequest.headers["X-CSRFToken"] = csrfToken;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
await axios.post("http://localhost:8000/api/v3/" + authAPI.refresh, null, {
|
await axios.post(apiURL + authAPI.refresh, null, {
|
||||||
withCredentials: true,
|
withCredentials: true,
|
||||||
headers: {
|
headers: {
|
||||||
"X-CSRFToken": csrfToken,
|
"X-CSRFToken": csrfToken,
|
||||||
|
|
|
||||||
98
src/views/Chalani/Chalani.vue
Normal file
98
src/views/Chalani/Chalani.vue
Normal file
|
|
@ -0,0 +1,98 @@
|
||||||
|
<template>
|
||||||
|
<ContentLayout :title="layout.title" :actions="layout.action" @onCreate="onCreate">
|
||||||
|
<template #body>
|
||||||
|
<div class="content-search">
|
||||||
|
<DateSelector id="report-date" v-model="selectedDate" :classValue="`w-full`" :isBS="true" />
|
||||||
|
</div>
|
||||||
|
<Tabulator
|
||||||
|
:columns="headerDetails"
|
||||||
|
:data="itemList"
|
||||||
|
:heightOffset="250"
|
||||||
|
:action="true"
|
||||||
|
placeholder="No Darta Found"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</ContentLayout>
|
||||||
|
<Create />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, onMounted, onBeforeUnmount, watch } from "vue";
|
||||||
|
import { BStoAD, NepaliDate } from "nepali-date-library";
|
||||||
|
|
||||||
|
import { storeToRefs } from "pinia";
|
||||||
|
import Create from "@/views/Chalani/Create.vue";
|
||||||
|
import { createGenericStore } from "@/stores/GenericStore";
|
||||||
|
import { createOverlayStore } from "@/stores/OverlayStore";
|
||||||
|
import { Toast } from "dolphin-components";
|
||||||
|
|
||||||
|
const ChalaniStore = createGenericStore("chalani")();
|
||||||
|
const ChalaniTowserStore = createOverlayStore("chalani-towser")();
|
||||||
|
|
||||||
|
const { itemList } = storeToRefs(ChalaniStore);
|
||||||
|
|
||||||
|
const layout = ref({
|
||||||
|
title: [
|
||||||
|
{
|
||||||
|
name: "Chalani",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
action: [
|
||||||
|
{
|
||||||
|
title: "Create",
|
||||||
|
emit: "onCreate",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
|
||||||
|
// const timeFormatter = (cell: any) => {
|
||||||
|
// const timeStr = cell.getValue();
|
||||||
|
// if (timeStr) {
|
||||||
|
// const [hours, minutes] = timeStr.split(":").map(Number);
|
||||||
|
// const date = new Date(0, 0, 0, hours, minutes);
|
||||||
|
// return date.toLocaleTimeString([], {
|
||||||
|
// hour: "numeric",
|
||||||
|
// minute: "2-digit",
|
||||||
|
// hour12: true,
|
||||||
|
// });
|
||||||
|
// } else {
|
||||||
|
// return cell.getValue();
|
||||||
|
// }
|
||||||
|
// };
|
||||||
|
|
||||||
|
const selectedDate = ref(BStoAD(new NepaliDate().format("YYYY-MM-DD")));
|
||||||
|
|
||||||
|
const headerDetails = [
|
||||||
|
{
|
||||||
|
field: "document_no",
|
||||||
|
title: "Document Number",
|
||||||
|
headerFilter: true,
|
||||||
|
headerFilterPlaceholder: "Search",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: "sender_name",
|
||||||
|
title: "Sender",
|
||||||
|
headerFilter: true,
|
||||||
|
headerFilterPlaceholder: "Search",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: "receiver_name",
|
||||||
|
title: "Receiver",
|
||||||
|
headerFilter: true,
|
||||||
|
headerFilterPlaceholder: "Search",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: "issued_date",
|
||||||
|
title: "Issued Date",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: "is_active",
|
||||||
|
title: "Status",
|
||||||
|
width: "250",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const onCreate = () => {
|
||||||
|
ChalaniTowserStore.open();
|
||||||
|
};
|
||||||
|
</script>
|
||||||
44
src/views/Chalani/Create.vue
Normal file
44
src/views/Chalani/Create.vue
Normal file
|
|
@ -0,0 +1,44 @@
|
||||||
|
<template>
|
||||||
|
<!-- <Modal :title="modal.title" :actions="modal.action" @onClose="onClose"></Modal> -->
|
||||||
|
<Towser
|
||||||
|
:show="ChalaniTowserStore.show"
|
||||||
|
:title="towser.title"
|
||||||
|
:actions="towser.action"
|
||||||
|
@onClose="onClose"
|
||||||
|
>
|
||||||
|
|
||||||
|
</Towser>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref } from "vue";
|
||||||
|
import { createGenericStore } from "@/stores/GenericStore";
|
||||||
|
import { createOverlayStore } from "@/stores/OverlayStore";
|
||||||
|
const ChalaniStore = createGenericStore("user-meal-schedule")();
|
||||||
|
const ChalaniTowserStore = createOverlayStore("chalani-towser")();
|
||||||
|
const towser = ref({
|
||||||
|
show: false,
|
||||||
|
title: [
|
||||||
|
{
|
||||||
|
name: "Chalani",
|
||||||
|
link: "#",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Create",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
action: [
|
||||||
|
{
|
||||||
|
title: "Close",
|
||||||
|
emit: "onClose",
|
||||||
|
class: "btn-outline",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Save",
|
||||||
|
emit: "onSave",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
|
||||||
|
const onClose = () => {};
|
||||||
|
</script>
|
||||||
Loading…
Reference in New Issue
Block a user