ปรับ code โครงสร้าง
This commit is contained in:
parent
9f30a71efe
commit
efa8896898
5 changed files with 271 additions and 133 deletions
|
|
@ -13,23 +13,25 @@ import ListView from "@/modules/02_organizationalNew/components/listView.vue";
|
|||
import StructureView from "@/modules/02_organizationalNew/components/structureView.vue";
|
||||
import DialogFormNewStructure from "@/modules/02_organizationalNew/components/DialogNewStructure.vue";
|
||||
import DialogDateTime from "@/modules/02_organizationalNew/components/DialogFormDateTime.vue";
|
||||
import DialogHistory from "@/modules/02_organizationalNew/components/DialogHistory.vue";
|
||||
import DialogPositionDetail from "@/modules/02_organizationalNew/components/PositionDetail.vue";
|
||||
|
||||
/** importStore*/
|
||||
import { useOrganizational } from "@/modules/02_organizationalNew/store/organizational";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
/** use*/
|
||||
const $q = useQuasar();
|
||||
const { showLoader, hideLoader, messageError, date2Thai } = useCounterMixin();
|
||||
|
||||
const modalNewStructure = ref<boolean>(false);
|
||||
const modalPositionDetail = ref<boolean>(false);
|
||||
|
||||
const store = useOrganizational();
|
||||
|
||||
const isStatusData = ref<boolean>(false);
|
||||
const ishasActive = ref<boolean>(false);
|
||||
const ishasDraft = ref<boolean>(false);
|
||||
/** modalDialog*/
|
||||
const modalNewStructure = ref<boolean>(false); // เพิ่มโครงสร้าง
|
||||
const modalDateTime = ref<boolean>(false); // ตั้งเวลาเผยแพร่
|
||||
|
||||
/** สถานะ*/
|
||||
const isStatusData = ref<boolean>(false); // แสดงตั้งเวลาเผยแพร่
|
||||
const ishasActive = ref<boolean>(false); // สถานะการทำงาน
|
||||
const ishasDraft = ref<boolean>(false); // สถานะแบบร่าง
|
||||
/** List เพิ่มโครงสร้าง*/
|
||||
const itemStructure = ref<DataOption[]>([
|
||||
{
|
||||
id: "NEW",
|
||||
|
|
@ -48,7 +50,15 @@ const itemStructure = ref<DataOption[]>([
|
|||
name: "ทำสำเนาโครงสร้าง ตำแหน่งและคนครอง",
|
||||
},
|
||||
]);
|
||||
const typeStructure = ref<string>(""); // ประเภทการเพิ่มโครงสร้าง
|
||||
|
||||
/** ประวัติโครงสร้าง*/
|
||||
const itemHistory = ref<DataOption[]>([]); // List ประวัติโครงสร้าง
|
||||
const historyId = ref<string>(""); // ID ประวัติโครงสร้าง
|
||||
const labelHistory = ref<string>("ประวัติโครงสร้าง"); // ชื่อประวัติโครงสร้าง
|
||||
const count = ref<number>(0);
|
||||
|
||||
/** function เรียกข้อมูลโครงสร้าง แบบปัจุบันและ แบบร่าง*/
|
||||
async function fetchOrganizationActive() {
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -81,10 +91,9 @@ async function fetchOrganizationActive() {
|
|||
});
|
||||
}
|
||||
|
||||
const itemHistory = ref<DataOption[]>([]);
|
||||
const historyId = ref<string>("");
|
||||
/** function เรียกข้อมูลประวัติโครงสร้าง*/
|
||||
async function fetchHistory() {
|
||||
// showLoader();
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.organizationHistoryNew)
|
||||
.then((res) => {
|
||||
|
|
@ -106,27 +115,32 @@ async function fetchHistory() {
|
|||
});
|
||||
}
|
||||
|
||||
const typeStructure = ref<string>("");
|
||||
/**
|
||||
* function openPopup เพิ่มโครงสร้าง
|
||||
* @param type ประเภทการเพิ่มโครงาสร้าง
|
||||
*/
|
||||
function ocClickAddStructure(type: string) {
|
||||
modalNewStructure.value = !modalNewStructure.value;
|
||||
typeStructure.value = type;
|
||||
}
|
||||
|
||||
const modalDateTime = ref<boolean>(false);
|
||||
/** function openPopup ตั้งเวลาเผยแพร่*/
|
||||
function onClickDateTime() {
|
||||
modalDateTime.value = !modalDateTime.value;
|
||||
}
|
||||
|
||||
const modalHistory = ref<boolean>(false);
|
||||
const count = ref<number>(0);
|
||||
const labelHistory = ref<string>("ประวัติโครงสร้าง");
|
||||
/**
|
||||
* function เปิดประวัติโครงสร้าง
|
||||
* @param id id โครงสร้าง
|
||||
* @param name ชื่อโครงสร้าง
|
||||
*/
|
||||
function onClickHistory(id: string, name: string) {
|
||||
historyId.value = id;
|
||||
labelHistory.value = name;
|
||||
count.value++;
|
||||
// modalHistory.value = !modalHistory.value;
|
||||
}
|
||||
|
||||
/** lifecycleHook */
|
||||
onMounted(async () => {
|
||||
await fetchOrganizationActive();
|
||||
await fetchHistory();
|
||||
|
|
@ -134,15 +148,20 @@ onMounted(async () => {
|
|||
</script>
|
||||
<template>
|
||||
<div class="row items-center">
|
||||
<div class="toptitle text-dark row items-center q-py-xs">โครงสร้างอัตรากำลัง</div>
|
||||
<div class="toptitle text-dark row items-center q-py-xs">
|
||||
โครงสร้างอัตรากำลัง
|
||||
</div>
|
||||
<q-space />
|
||||
|
||||
<div class="toptitle row items-center" v-if="store.typeOrganizational === 'draft'">
|
||||
<div
|
||||
class="toptitle row items-center"
|
||||
v-if="store.typeOrganizational === 'draft'"
|
||||
>
|
||||
<div
|
||||
v-if="store.isPublic && store.orgPublishDate"
|
||||
class=" q-pr-md text-caption"
|
||||
class="q-pr-md text-caption"
|
||||
>
|
||||
วันที่เผยแพร่ :
|
||||
วันที่เผยแพร่ :
|
||||
<strong>{{ date2Thai(store.orgPublishDate) }}</strong>
|
||||
</div>
|
||||
<q-btn
|
||||
|
|
@ -248,7 +267,13 @@ onMounted(async () => {
|
|||
</q-btn-dropdown>
|
||||
</q-btn-group>
|
||||
|
||||
<q-btn-dropdown dense unelevated class="q-px-md" color="green-6" label="เพิ่มโครงสร้าง">
|
||||
<q-btn-dropdown
|
||||
dense
|
||||
unelevated
|
||||
class="q-px-md"
|
||||
color="green-6"
|
||||
label="เพิ่มโครงสร้าง"
|
||||
>
|
||||
<q-list>
|
||||
<q-item
|
||||
dense
|
||||
|
|
@ -265,9 +290,6 @@ onMounted(async () => {
|
|||
</q-list>
|
||||
</q-btn-dropdown>
|
||||
|
||||
<!-- <q-btn flat round color="primary" icon="history">
|
||||
<q-tooltip>ประวัติโครงสร้าง</q-tooltip>
|
||||
</q-btn> -->
|
||||
<q-space />
|
||||
<q-btn
|
||||
flat
|
||||
|
|
@ -276,7 +298,7 @@ onMounted(async () => {
|
|||
icon="mdi-file-tree"
|
||||
@click="store.statusView = 'list'"
|
||||
/>
|
||||
<q-separator inset vertical/>
|
||||
<q-separator inset vertical />
|
||||
<q-btn
|
||||
flat
|
||||
dense
|
||||
|
|
@ -308,16 +330,14 @@ onMounted(async () => {
|
|||
/>
|
||||
|
||||
<!-- ตั้งเวลาเผยแพร่ -->
|
||||
<DialogDateTime :modal="modalDateTime" :close="onClickDateTime" :fetchActive="fetchOrganizationActive"/>
|
||||
|
||||
<!-- ประวัติโครงสร้าง -->
|
||||
<!-- <DialogHistory :modal="modalHistory" :close="onClickHistory" /> -->
|
||||
|
||||
<!-- รายละเอียดโครงสร้าง -->
|
||||
<!-- <DialogStructureDetail v-model:structure-detail="modalStructureDetail" /> -->
|
||||
<DialogDateTime
|
||||
:modal="modalDateTime"
|
||||
:close="onClickDateTime"
|
||||
:fetchActive="fetchOrganizationActive"
|
||||
/>
|
||||
|
||||
<!-- รายละเอียดตำแหน่ง -->
|
||||
<DialogPositionDetail v-model:position-detail="modalPositionDetail" />
|
||||
<!-- <DialogPositionDetail v-model:position-detail="modalPositionDetail" /> -->
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue