ปรับ UI โครงสร้าง

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-01-29 11:19:48 +07:00
parent 88041a1974
commit 8c1bfb7a75
6 changed files with 237 additions and 111 deletions

View file

@ -5,7 +5,6 @@ import http from "@/plugins/http";
import config from "@/app.config";
/** importType*/
import type { DataActive } from "@/modules/02_organizationalNew/interface/response/organizational";
/** importComponents*/
import ListView from "@/modules/02_organizationalNew/components/listView.vue";
@ -21,7 +20,6 @@ import { useCounterMixin } from "@/stores/mixin";
const $q = useQuasar();
const { showLoader, hideLoader, messageError } = useCounterMixin();
const modalNewStructure = ref<boolean>(false);
const stroe = useOrganizational();
const isStatusData = ref<boolean>(false);
@ -45,16 +43,15 @@ const itemStructure = ref<any>([
name: "ทำสำเนาโครงสร้าง ตำแหน่งและคนครอง",
},
]);
const dataActive = ref<DataActive>();
async function fetchOrganizationActive() {
showLoader();
await http
.get(config.API.activeOrganization)
.then((res) => {
console.log(res);
const data = res.data.result;
if (data) {
stroe.fetchDataActive(data);
if (data.activeName === null && data.draftName === null) {
isStatusData.value = false;
} else {
@ -79,6 +76,13 @@ async function fetchOrganizationActive() {
});
}
const modalNewStructure = ref<boolean>(false);
const typeStructure = ref<string>("");
function ocClickAddStructure(type: string) {
modalNewStructure.value = !modalNewStructure.value;
typeStructure.value = type;
}
const modalDateTime = ref<boolean>(false);
function onClickDateTime() {
modalDateTime.value = !modalDateTime.value;
@ -137,7 +141,7 @@ onMounted(async () => {
color="primary"
size="lg"
icon="add"
@click="modalNewStructure = true"
@click="ocClickAddStructure('NEW')"
>
<q-tooltip>เพมโครงสราง </q-tooltip>
</q-btn>
@ -175,6 +179,7 @@ onMounted(async () => {
v-close-popup
v-for="(item, index) in itemStructure"
:key="index"
@click="ocClickAddStructure(item.val)"
>
<q-item-section>
<q-item-label>{{ item.name }}</q-item-label>
@ -222,10 +227,13 @@ onMounted(async () => {
<DialogFormNewStructure
v-model:new-structure="modalNewStructure"
v-model:status="isStatusData"
v-model:type="typeStructure"
/>
<!-- งเวลาเผยแพร -->
<DialogDateTime :modal="modalDateTime" :close="onClickDateTime" />
<!-- ประวโครงสราง -->
<DialogHistory :modal="modalHistory" :close="onClickHistory" />
</template>