โครงสร้างแสดงดาวน์โหลดรายงาน
This commit is contained in:
parent
96d6e470f8
commit
293250ac03
4 changed files with 29 additions and 14 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, watch } from "vue";
|
import { ref, watch, computed } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
|
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
|
@ -103,7 +103,8 @@ const listMenu = ref<ListMenu[]>([
|
||||||
color: "deep-purple",
|
color: "deep-purple",
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
const document = ref<DataDocument[]>([
|
|
||||||
|
const baseDocument = ref<DataDocument[]>([
|
||||||
{
|
{
|
||||||
name: "บัญชี 1",
|
name: "บัญชี 1",
|
||||||
val: "report1",
|
val: "report1",
|
||||||
|
|
@ -118,6 +119,14 @@ const document = ref<DataDocument[]>([
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
const document = computed(() => {
|
||||||
|
if (store.typeOrganizational === "draft") {
|
||||||
|
return baseDocument.value;
|
||||||
|
} else {
|
||||||
|
return baseDocument.value.filter((e: DataDocument) => e.val === "report2");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
/** columns*/
|
/** columns*/
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
|
|
@ -513,14 +522,8 @@ watch(
|
||||||
</q-btn>
|
</q-btn>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<q-btn
|
<!-- v-if="store.typeOrganizational === 'draft'" -->
|
||||||
v-if="store.typeOrganizational === 'draft'"
|
<q-btn flat round dense color="deep-purple" icon="save_alt">
|
||||||
flat
|
|
||||||
round
|
|
||||||
dense
|
|
||||||
color="deep-purple"
|
|
||||||
icon="save_alt"
|
|
||||||
>
|
|
||||||
<q-menu>
|
<q-menu>
|
||||||
<q-list
|
<q-list
|
||||||
dense
|
dense
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,12 @@ interface DataOption {
|
||||||
name: string;
|
name: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface DataOrgRevision {
|
||||||
|
id: string;
|
||||||
|
name: string;
|
||||||
|
orgRevisionCreatedAt: string;
|
||||||
|
}
|
||||||
|
|
||||||
interface DataDocument {
|
interface DataDocument {
|
||||||
name: string;
|
name: string;
|
||||||
val: string;
|
val: string;
|
||||||
|
|
@ -158,4 +164,5 @@ export type {
|
||||||
FormPositionSelectRef,
|
FormPositionSelectRef,
|
||||||
NewPagination,
|
NewPagination,
|
||||||
DataDocument,
|
DataDocument,
|
||||||
|
DataOrgRevision,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ interface OrgTree {
|
||||||
}
|
}
|
||||||
|
|
||||||
interface OrgRevision {
|
interface OrgRevision {
|
||||||
orgRevisionCreatedAt: string | null;
|
orgRevisionCreatedAt: Date | null;
|
||||||
orgRevisionId: string;
|
orgRevisionId: string;
|
||||||
orgRevisionIsCurrent: boolean;
|
orgRevisionIsCurrent: boolean;
|
||||||
orgRevisionIsDraft: boolean;
|
orgRevisionIsDraft: boolean;
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ import { useCounterMixin } from "@/stores/mixin";
|
||||||
/**
|
/**
|
||||||
* importType
|
* importType
|
||||||
*/
|
*/
|
||||||
import type { DataOption } from "@/modules/02_organization/interface/index/Main";
|
import type { DataOrgRevision } from "@/modules/02_organization/interface/index/Main";
|
||||||
import type { OrgRevision } from "@/modules/02_organization/interface/response/organizational";
|
import type { OrgRevision } from "@/modules/02_organization/interface/response/organizational";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -37,7 +37,7 @@ const modalDateTime = ref<boolean>(false); // ตั้งเวลาเผย
|
||||||
const isStatusData = ref<boolean>(false); // แสดงตั้งเวลาเผยแพร่
|
const isStatusData = ref<boolean>(false); // แสดงตั้งเวลาเผยแพร่
|
||||||
const typeStructure = ref<string>(""); // ประเภทการเพิ่มโครงสร้าง
|
const typeStructure = ref<string>(""); // ประเภทการเพิ่มโครงสร้าง
|
||||||
/** ประวัติโครงสร้าง*/
|
/** ประวัติโครงสร้าง*/
|
||||||
const itemHistory = ref<DataOption[]>([]); // List ประวัติโครงสร้าง
|
const itemHistory = ref<DataOrgRevision[]>([]); // List ประวัติโครงสร้าง
|
||||||
const historyId = ref<string>(""); // ID ประวัติโครงสร้าง
|
const historyId = ref<string>(""); // ID ประวัติโครงสร้าง
|
||||||
const labelHistory = ref<string>("ประวัติโครงสร้าง"); // ชื่อประวัติโครงสร้าง
|
const labelHistory = ref<string>("ประวัติโครงสร้าง"); // ชื่อประวัติโครงสร้าง
|
||||||
const count = ref<number>(0);
|
const count = ref<number>(0);
|
||||||
|
|
@ -91,6 +91,8 @@ async function fetchHistory() {
|
||||||
itemHistory.value = filterData.map((e: OrgRevision) => ({
|
itemHistory.value = filterData.map((e: OrgRevision) => ({
|
||||||
id: e.orgRevisionId,
|
id: e.orgRevisionId,
|
||||||
name: e.orgRevisionName,
|
name: e.orgRevisionName,
|
||||||
|
orgRevisionCreatedAt:
|
||||||
|
e.orgRevisionCreatedAt ?? date2Thai(e.orgRevisionCreatedAt),
|
||||||
}));
|
}));
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
|
@ -291,7 +293,10 @@ onMounted(async () => {
|
||||||
@click="onClickHistory(item.id, item.name)"
|
@click="onClickHistory(item.id, item.name)"
|
||||||
>
|
>
|
||||||
<q-item-section>
|
<q-item-section>
|
||||||
<q-item-label>{{ item.name }}</q-item-label>
|
<q-item-label
|
||||||
|
>{{ item.orgRevisionCreatedAt }}
|
||||||
|
{{ item.name }}</q-item-label
|
||||||
|
>
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
</q-list>
|
</q-list>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue